webpackJsonp([12],[function(t,e,i){(function(t){"use strict";function e(){JSON.parse(urlParams.disabledFeatures).forEach(function(e){t.setEnabled(e,!1)}),JSON.parse(urlParams.enabledFeatures).forEach(function(e){t.setEnabled(e,!0)})}function o(){t.enabled("saveload_storage_customization")&&(window.parent[urlParams.uid].saveLoadAdapter?h.setCustomAdapter(window.parent[urlParams.uid].saveLoadAdapter):void 0!==urlParams.chartsStorageUrl&&urlParams.chartsStorageUrl&&void 0!==urlParams.clientId&&urlParams.clientId?h.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl,urlParams.chartsStorageVer||"1.0"):(t.setEnabled("saveload_storage_customization",!1),t.setEnabled("header_saveload",!1)))}function n(){z.resolve()}var r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E,V,D,O,B,R,z,F;i(647),i(1099),i(23),r=i(1166),i(984),i(409),i(735),e(),s=i(2),a=i(55),l=i(1107).DrawingToolbar,c=i(472).isDrawingToolbarVisible,h=i(389),u=i(73).Action,d=i(435).ChartSaver,p=i(815),_=i(97),f=i(43),m=i(41),g=m.formatterOptions,v=m.customFormatters,y=i(698),b=i(737),S=i(477).Root,w=i(1125).ChartPage,T=new S(window),x=new w(T.allocate()),i(729),C=i(749),P=i(745),L=i(1116).FavoriteDrawingToolbar,I=i(794),k=i(726),A=i(76).UndoHistory,M=i(45),E=i(818),i(264),i(732),V=i(104),D=!!urlParams.indicatorsFile,O=$.Deferred(),B=$.Deferred(),$.when(O,B).done(function(){ChartApiInstance.start()}),D?$.getScript(urlParams.indicatorsFile).done(function(){void 0!==window.__customIndicators&&window.isArray(window.__customIndicators)&&(window.PineJS=i(80),JSServer.studyLibrary=JSServer.studyLibrary.concat(window.__customIndicators),console.log("{0} custom indicators loaded.".format(window.__customIndicators.length)),O.resolve())}).fail(function(t){console.warn("Error loading custom indicators @ `{0}`: {1} ({2}) ".format(urlParams.indicatorsFile,t.statusText,t.status)),O.resolve()}):O.resolve(),window.widgetReady=function(t){f.subscribe("onChartReady",t)},window.customizeUI=function(t){null!=t.studiesOverrides&&M.setDefaultsOverrides(t.studiesOverrides),window.__defaultsOverrides=t.defaultsOverrides},window.applyStudiesOverrides=function(t){t&&window.chartWidgetCollection.applyStudiesOverrides(t)},window.applyOverrides=function(t){$.extend(!0,window.__defaultsOverrides,t),window.applyDefaultsOverrides(TradingView.defaultProperties.chartproperties),window.applyDefaultOverridesToLinetools(),window.chartWidgetCollection.applyOverrides(t)},window.is_authenticated=!1,window.parent[urlParams.uid].brokerFactory,R=function(){var e,i,o,n,r,h,u,m,S,w,T,A,M;if(!Modernizr.canvas||!Modernizr.canvastext)throw Error("Charting library cannot be running under this browser");t.setEnabled("charting_library_debug_mode","true"===urlParams.debug),t.setEnabled("chart_property_page_trading",!1),t.setEnabled("chart_property_page_template_button",!1),e=window.headerChartPanel=$(".header-chart-panel"),i=$("#library-container"),t.enabled("remove_library_container_border")&&(i.css("border","0px"),i.css("padding","1px")),window.customizeUI({
studiesOverrides:urlParams.studiesOverrides?JSON.parse(urlParams.studiesOverrides):void 0,defaultsOverrides:JSON.parse(urlParams.overrides)}),urlParams.numeric_formatting=urlParams.numeric_formatting&&JSON.parse(urlParams.numeric_formatting),urlParams.numeric_formatting&&"string"==typeof urlParams.numeric_formatting.decimal_sign&&(g.decimalSign=urlParams.numeric_formatting.decimal_sign[0]),window.ChartApiInstance=new k(window.parent[urlParams.uid].datafeed),window.parent[urlParams.uid].customFormatters&&(window.parent[urlParams.uid].customFormatters.timeFormatter&&(v.timeFormatter=window.parent[urlParams.uid].customFormatters.timeFormatter),window.parent[urlParams.uid].customFormatters.dateFormatter&&(v.dateFormatter=window.parent[urlParams.uid].customFormatters.dateFormatter)),urlParams.autoSaveDelay&&ChartApiInstance.setAutoSaveDelay(urlParams.autoSaveDelay),ChartApiInstance.setTimeFramesList(JSON.parse(urlParams.timeFrames)),ChartApiInstance.setStudiesAccessController(ChartApiInstance.createStudiesAccessController(urlParams.studiesAccess)),o=window.parent[window.urlParams.uid].settingsAdapter,null!=o?(TVSettings.setSettingsAdapter(o),TVSettings.sync()):t.enabled("use_localstorage_for_settings")&&TVSettings.sync(),n=urlParams.chartContent?JSON.parse(urlParams.chartContent).json:void 0,r=urlParams.interval||"D",h={resizerBridge:x.allocate({areaName:"center"}),padding:t.enabled("border_around_the_chart")?5:0,edge:t.enabled("border_around_the_chart")?5:0,content:n,widgetOptions:{hideIdeas:!0,addVolume:!0,handleSessionErrors:!0,muteSessionErrors:!0,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:r,defTimeframe:urlParams.timeframe&&urlParams.timeframe.toLowerCase()},globalEvents:!0,snapshotUrl:urlParams.snapshotUrl},u=t.enabled("left_toolbar"),u&&(m=new L({left:window.innerWidth/2,top:window.headerChartPanel.outerHeight()+61}),h.widgetOptions.favoriteDrawingToolbar=m,h.widgetOptions.isDrawingToolbarVisible=c),n&&void 0!==n.extendedData&&(S=n.extendedData,h.metaInfo={id:S.uid,name:S.name,description:S.description,uid:S.uid,username:"",tags:""}),w=window.chartWidgetCollection=new C(h),"undefined"!=typeof serviceLocator&&serviceLocator.registerService(CHART_WIDGET_COLLECTION_SERVICE,w),w.activeChartWidget.subscribe(function(t){f.emit("activeChartChanged",w.getAll().indexOf(t))}),window.saver=new d(w),window.chartWidget=w.activeChartWidget.value(),window.pro=new TradingView.Pro,T=JSON.parse(urlParams.favorites),T.intervals=T.intervals.map(function(t){var e=""+t;return e.match(/1[DWMYdwmy]/)&&(e=e.slice(1)),e}),t.enabled("study_templates")&&(window.studyTemplates=new p({chartWidgetCollection:w,notShowQuicks:!t.enabled("items_favoriting")})),window.headerWidget=new P({resizerBridge:x.allocate({areaName:"top"}),chartWidgetCollection:w,headerChartPanel:e,hideStudyTemplates:!0,favoriteIntervals:T.intervals,interval_options:{interval:r},favoriteChartTypes:T.chartTypes}),window.tradingViewApi=new E(w,window.saver,ChartApiInstance,window.headerWidget.saveLoadWidget()),_.bindToChartWidgetCollection(w),
A=urlParams.toolbarbg&&/^[0-9a-f]+$/i.test(urlParams.toolbarbg)?urlParams.toolbarbg+"":void 0,A&&$("<style>").text("body,.chart-controls-bar,#footer-chart-panel{background-color:#"+A+" !important}").appendTo($("head")),TradingView.isNaN(urlParams.studyCountLimit)||(TradingView.STUDY_COUNT_LIMIT=Math.max(2,+urlParams.studyCountLimit)),TradingView.isNaN(urlParams.ssreqdelay)||V.setSearchRequestDelay(Math.max(0,+urlParams.ssreqdelay)),u&&(M=x.allocate({areaName:"left"}),a.render(s.createElement(l,{bgColor:A,chartWidgetCollection:w,drawingsAccess:urlParams.drawingsAccess?JSON.parse(urlParams.drawingsAccess):void 0,resizerBridge:M}),M.body.value()[0])),window.quoteSessionMultiplexerInstance={},window.quoteSessionMultiplexerInstance.simple=new b("simple"),window.quoteSessionMultiplexerInstance.full=new b,window.lineToolPropertiesToolbar=new I(w),chartWidget.onDisconnected().subscribe(null,function(t){t&&y.showCriticalErrorMessage()}),$(".tv-content").bind("contextmenu",function(t){var e=$(t.originalEvent.target);if(!e.is("input")&&!e.is("textarea"))return!1}),B.resolve(),chartWidget.withModel(null,function(){ChartApiInstance.on("realtime_tick",function(t){f.emit("onTick",t)}),ChartApiInstance.on("onAutoSaveNeeded",function(){f.emit("onAutoSaveNeeded")}),t.enabled("charting_library_debug_mode")&&f.subscribeToAll(function(){var t=Array.prototype.slice.call(arguments);console.log('Event "{0}", arguments: {1}'.format(t[0],JSON.stringify(t.slice(1))))})}),f.subscribe("chart_load_requested",function(t){window.tradingViewApi.loadChart({json:JSON.parse(t.content),extendedData:t})})},window.destroyChart=function(){window.chartWidgetCollection&&(window.chartWidgetCollection.destroy(),window.chartWidgetCollection=null),window.quoteSessionMultiplexerInstance&&(window.quoteSessionMultiplexerInstance.simple&&window.quoteSessionMultiplexerInstance.simple.destroy(),window.quoteSessionMultiplexerInstance.full&&window.quoteSessionMultiplexerInstance.full.destroy(),window.quoteSessionMultiplexerInstance=null),ChartApiInstance&&(ChartApiInstance.destroy(),ChartApiInstance=null)},o(),z=$.Deferred(),window.parent[urlParams.uid].loadLastChart&&t.enabled("saveload_storage_customization")?h.getCharts(function(t){if(0===t.length)return void n();var e=t.sort(function(t,e){return e.modified_iso-t.modified_iso})[0];h.getChartContent(e,function(t){var e=JSON.parse(t.content);e.extendedData=t,urlParams.chartContent=JSON.stringify({json:e}),n()},n)},n):n(),F=$.Deferred(),$.when(r,F,z).done(function(){if($(window).resize(),$(".loading-indicator").hide(),setTimeout(R,0),t.enabled("14851")){!function(t,e,i,o,n,r,s){t.GoogleAnalyticsObject=n,t[n]=t[n]||function(){(t[n].q=t[n].q||[]).push(arguments)},t[n].l=1*new Date,r=e.createElement(i),s=e.getElementsByTagName(i)[0],r.async=1,r.src=o,s.parentNode.insertBefore(r,s)}(window,document,"script","//www.google-analytics.com/analytics.js","ga");var e=document.URL.match(RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-112911840-1","auto"),ga("set","anonymizeIp",!0),ga("set",{hostname:e,page:e,referrer:e}),
ga("send","pageview")}}),function(){var t=!0;window.parent[urlParams.uid].datafeed.onReady(function(e){t&&console.warn("`onReady` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),window.configurationData=e,F.resolve()}),t=!1}(),window.getFunctionFromArguments=function(t){return window.parent[urlParams.uid][t]},window.createShortcutAction=function(){var t={};return function(e,i){void 0===t[e]&&(t[e]=new u({shortcut:e})),t[e].callbacks().subscribe(null,i)}}(),window.initializationFinished=function(){A.clearStack()},window.resizeWindow=function(){$(window).resize()},window.createButton=function(){var t=null;return function(e){var i,o,n,r;return e=e||{},i=e.align||"left",o=window.headerWidget,n=o.createGroup("",{single:!0}),r=$('<div class="button"></div>').appendTo(n),t&&clearTimeout(t),t=setTimeout(function(){window.resizeWindow(),clearTimeout(t)},5),setTimeout(function(){o.addButton(n,"left"===i)}),r}}()}).call(e,i(7))},function(t,e){"use strict";function i(t,e){return new c(t,e)}function o(t,e){return t.x===e.x&&t.y===e.y}function n(t,e,i){if(0===t&&0===e)throw Error("A and B can not be both equal to zero.");return{A:t,B:e,C:i}}function r(t,e){var i,r,s;if(o(t,e))throw Error("Points should be distinct");return i=t.y-e.y,r=e.x-t.x,s=t.x*e.y-e.x*t.y,n(i,r,s)}function s(t,e){if(o(t,e))throw Error("Points of a segment should be distinct");return[t,e]}function a(t,e){return{edge:t,isPositive:e}}function l(t,e){return a(t,t.A*e.x+t.B*e.y+t.C>0)}Object.defineProperty(e,"__esModule",{value:!0});var c=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.addScaled=function(e,i){return new t(this.x+i*e.x,this.y+i*e.y)},t.prototype.subtract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.dotProduct=function(t){return this.x*t.x+this.y*t.y},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.scaled=function(e){return new t(this.x*e,this.y*e)},t.prototype.normalized=function(){return this.scaled(1/this.length())},t.prototype.transposed=function(){return new t(-this.y,this.x)},t.prototype.clone=function(){return new t(this.x,this.y)},t}();e.Point=c,e.point=i,e.equalPoints=o,e.line=n,e.lineThroughPoints=r,e.lineSegment=s,e.halfplane=a,e.halfplaneThroughPoint=l},,function(t,e,i){(function(t){"use strict";function o(t,e){a.call(this),this._linetool=t,this._pointindex=e,this._model=t._model,this._text="",this._coordinate=0,this._background="#5592C9",this._activeBackground="#0F6DBF",this._borderColor="#2E84A6",this._color="white",this._visible=!1,this._invalidated=!0,this._renderer=new l}function n(t,e){var i,r,s;if(c.call(this),this._model=t,this._properties=e,this._pointAdded=new g,this._pointChanged=new g,e.visible&&e.frozen||this._properties.merge(defaults("linetool")),i=defaults("linetoolvisibilities"),
e.intervalsVisibilities)for(r in i.intervalsVisibilities)this._properties.intervalsVisibilities[r]||this._properties.intervalsVisibilities.addProperty(r,i.intervalsVisibilities[r]);else this._properties.merge(i);if(this._paneViews=[],this._points=[],this._fixedPoints=[],this._timePoint=[],this._currentPointsetId=null,this._properties.symbol||this._properties.merge({symbol:t.mainSeries().symbol()}),this._properties.interval||this._properties.merge({interval:t.mainSeries().interval()}),this._properties.addExclusion&&(this._properties.addExclusion("symbol"),this._properties.addExclusion("symbolInfo"),this._properties.addExclusion("points"),this._properties.addExclusion("interval"),this._properties.addExclusion("visible"),this._properties.addExclusion("lastUpdateTime")),this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,n.prototype.calcIsActualSymbol),this._properties.listeners().subscribe(this,n.prototype.propertiesChanged),this._createPointsProperties(),"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash)),this.m_priceAxisViews=[],this.m_timeAxisViews=[],this.pointsCount()>0)for(s=0;s<this.pointsCount();s++)this.m_priceAxisViews.push(this.createPriceAxisView(s)),this.m_timeAxisViews.push(new o(this,s));this._properties.visible.listeners().subscribe(this,function(t){t.value()||this._model.selectedSource()!==this||this._model.setSelectedSource(null)}),this.customization=this.customization||{forcePriceAxisLabel:!1,disableSelection:!1,disableErasing:!1,disableSave:!1,showInObjectsTree:!0},$(window).resize(function(){this.isFixed()&&this.restoreFixedPoints()}.bind(this)),this._properties.lastUpdateTime||this._properties.addProperty("lastUpdateTime",0)}var r=i(1).Point,s=i(312).LineToolPriceAxisView,a=i(317).TimeAxisView,l=i(284),c=i(62).DataSource,h=i(44),u=i(57).Interval,d=i(173).DateTimeFormatter,p=i(739),_=i(37),f=i(76).UndoHistory,m=i(13).getLogger("Chart.LineDataSource"),g=i(20),v=i(9).propertyPages,y=i(93).lineToolsInfo;inherit(o,a),o.prototype.setActive=function(t){this._active=t},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i;this._visible=!1,this._model.timeScale().isEmpty()||(t=this._linetool.axisPoints(),t.length<=this._pointindex||this._linetool===this._model.selectedSource()&&(this._text="",e=t[this._pointindex].index,this._coordinate=this._model.timeScale().indexToCoordinate(e),i=this._model.timeScale().indexToUserTime(e),i&&(this._text=new d(this._model.mainSeries().isDWM()).format(i)),this._visible=!0,this._invalidated=!1))},o.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={text:this._text,coordinate:this._coordinate,color:this._color,background:this._active?this._activeBackground:this._background,borderColor:this._borderColor,visible:this._visible};return this._renderer.setData(t),this._renderer},inherit(n,c),n.prototype.pointAdded=function(){return this._pointAdded},
n.prototype.pointChanged=function(){return this._pointChanged},n.PointPriceProperty=function(e,i){t.call(this),this._lineSource=e,this._pointIndex=i,e.pointAdded().subscribe(this,function(t){this._pointIndex===t&&this._listeners.fire(this)}),e.pointChanged().subscribe(this,function(t){this._pointIndex===t&&this._listeners.fire(this)})},inherit(n.PointPriceProperty,t),n.prototype.enableCurrentIntervalVisibility=function(){var t,e,i,o,n,r,s,a=u.parse(this._model.mainSeries().interval());a.kind()===u.SECONDS&&(a.multiplier()<60?(this.properties().intervalsVisibilities.seconds.setValue(!0),t=Math.min(this.properties().intervalsVisibilities.secondsFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsFrom.setValue(t),e=Math.max(this.properties().intervalsVisibilities.secondsTo.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsTo.setValue(e)):a=new u(u.MINUTES,a.multiplier()/60)),a.kind()===u.MINUTES&&(a.multiplier()<60?(this.properties().intervalsVisibilities.minutes.setValue(!0),t=Math.min(this.properties().intervalsVisibilities.minutesFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesFrom.setValue(t),e=Math.max(this.properties().intervalsVisibilities.minutesTo.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesTo.setValue(e)):(i=Math.floor(a.multiplier()/60),this.properties().intervalsVisibilities.hours.setValue(!0),o=Math.min(this.properties().intervalsVisibilities.hoursFrom.value(),i),this.properties().intervalsVisibilities.hoursFrom.setValue(o),n=Math.max(this.properties().intervalsVisibilities.hoursTo.value(),i),this.properties().intervalsVisibilities.hoursTo.setValue(n))),a.kind()===u.DAYS&&(this.properties().intervalsVisibilities.days.setValue(!0),r=Math.min(this.properties().intervalsVisibilities.daysFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.daysFrom.setValue(r),s=Math.max(this.properties().intervalsVisibilities.daysTo.value(),a.multiplier()),this.properties().intervalsVisibilities.daysTo.setValue(s)),a.kind()===u.WEEKS&&this.properties().intervalsVisibilities.weeks.setValue(!0),a.kind()===u.MONTHS&&this.properties().intervalsVisibilities.months.setValue(!0)},n.prototype.getType=function(){return TradingView.className(this.constructor)},n.prototype.getConstructor=function(){return this._constructor||null},n.prototype.isActualSymbol=function(){return this._isActualSymbol},n.prototype.isActualInterval=function(){return this._isActualInterval},n.prototype.isSavedInChart=function(t){return!this.customization.disableSave},n.prototype.setSavingInChartEnabled=function(t){this.customization.disableSave=!t},n.prototype.showInObjectTree=function(){return this.customization.showInObjectsTree},n.prototype.setShowInObjectsTreeEnabled=function(t){this.customization.showInObjectsTree=t},n.prototype.isSelectionEnabled=function(){return!this.customization.disableSelection},n.prototype.setSelectionEnabled=function(t){this.customization.disableSelection=!t},n.prototype.visibilityKeyByInterval=function(t){
var e,i=u.parse(t);return n.IntervalsVisibilities.forEach(function(t){t.kind===i.kind()&&t.from<=i.multiplier()&&t.to>=i.multiplier()&&(e=t.key)}),e},n.prototype.calcIsActualSymbol=function(){var t,e=this._properties.symbol,i=this._model.mainSeries(),o=e.value();this._isActualSymbol=i.symbolSameAsCurrent(o),this._isActualSymbol&&(t=i.symbol(),o!==t&&(m.logWarn('Possible drawing "migrating" detected from "'+o+'" to "'+t+'"'),m.logWarn("Series symbolInfo: "+JSON.stringify(i.symbolInfo())),m.logWarn(Error().stack)),e.setValue(t)),this.calcIsActualInterval()},n.prototype.calcIsActualInterval=function(){var t,e,i,o,n=this._properties,r=this._model.mainSeries(),s=u.parse(r.interval()),a=n.intervalsVisibilities;this._isActualInterval=!1,s.kind()===u.SECONDS&&(t=a.seconds.value(),e=a.secondsFrom.value(),i=a.secondsTo.value(),this._isActualInterval=t&&s.multiplier()>=e&&s.multiplier()<=i),s.kind()===u.MINUTES&&s.multiplier()<60&&(t=a.minutes.value(),e=a.minutesFrom.value(),i=a.minutesTo.value(),this._isActualInterval=t&&s.multiplier()>=e&&s.multiplier()<=i),s.kind()===u.MINUTES&&s.multiplier()>=60&&(o=Math.floor(s.multiplier()/60),t=a.hours.value(),e=a.hoursFrom.value(),i=a.hoursTo.value(),this._isActualInterval=t&&o>=e&&o<=i),s.kind()===u.DAYS&&(t=a.days.value(),e=a.daysFrom.value(),i=a.daysTo.value(),this._isActualInterval=t&&s.multiplier()>=e&&s.multiplier()<=i),s.kind()===u.WEEKS&&(this._isActualInterval=a.weeks.value()),s.kind()===u.MONTHS&&(this._isActualInterval=a.months.value()),this._isActualInterval||this._model.selectedSource()!==this||this._model.setSelectedSource(null)},n.PointPriceProperty.prototype.value=function(){var t=this._lineSource.points()[this._pointIndex].price,e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},n.PointPriceProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.price=parseFloat(t),e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),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.PointIndexProperty=function(e,i){t.call(this),this._lineSource=e,this._pointIndex=i},inherit(n.PointIndexProperty,t),n.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},n.PointIndexProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.index=t,e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),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 t={points:this._timePoint,interval:this._model.mainSeries().interval()};this.linkKey&&!this.properties().singleChartOnly&&h.finishChangingLineTool({model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:t})},n.prototype._createPointProperty=function(t){var e,i=this._properties.points;i.addProperty(t),e=i[t],e.addChild("price",new n.PointPriceProperty(this,t)),e.addChild("bar",new n.PointIndexProperty(this,t))},n.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var t=0;t<this.pointsCount();t++)this._createPointProperty(t)},n.prototype.priceScale=function(){return this._ownerSource?this._ownerSource.m_priceScale:null},n.prototype.symbol=function(){return this._properties.symbol.value()},n.prototype.properties=function(){return this._properties},n.prototype.isSavedInStudyTemplates=function(){return!1},n.prototype.state=function(t){var e=TradingView.className(this.constructor),i={type:e,id:this.id(),state:this.properties().state(),points:this._timePoint,zorder:this.zorder(),linkKey:this.linkKey};return i.state._isActualInterval=this.isActualInterval(),delete i.state.points,t&&(i.indexes=this._points),this.ownerSource()&&(i.ownerSource=this.ownerSource().id()),this.isFixed()&&(i.positionPercents=this._positionPercents||this.calcPositionPercents()),"version"in this&&1!==this.version&&(i.version=this.version),this.hasAlert.value()&&(i.alertId=this._alertId),i},n.prototype.template=function(){var t=this.properties().state();return delete t.points,delete t.symbol,delete t.symbolInfo,t},n.prototype.restoreTemplate=function(t){delete t.symbolInfo,this._model._undoModel.drawingLoadTemplate(this,t)},n.prototype.clearData=function(){this._points=[]},n.prototype.currentPointsetId=function(){return"pointset_"+this._currentPointsetId},n.prototype.stop=function(){this.clearServerPoints(),this.hasAlert.value()&&TradingView.alertsDispatcher&&TradingView.alertsDispatcher.deleteAlert(this._alertId)},n.prototype.isStarted=function(){return null!==this._currentPointsetId},n.prototype.restart=function(){this.isFixed()||(this._currentPointsetId=null,this.createServerPoints())},n.prototype.tryCreateServerPoints=function(){this.isFixed()||null===this._currentPointsetId&&this.createServerPoints()},n.prototype.normalizePoint=function(t){var e=this._model.timeScale().normalizeBarIndex(t.index);return e.price=t.price,e},n.prototype.normalizePoints=function(){var t,e;for(this._timePoint=[],t=0;t<this._points.length;t++){if(e=this._model.timeScale().normalizeBarIndex(this._points[t].index),!e.time_t){this._timePoint=[];break}e.price=this._points[t].price,this._timePoint.push(e)}},n.prototype.denormalizeTimePoints=function(){var t,e,i=[];for(t=0;t<this._timePoint.length;t++){if(void 0===(e=this._model.timeScale().denormalizeTimePoint(this._timePoint[t]))){i=[];break}i.push({index:e,price:this._timePoint[t].price})}i.length>0&&(this._points=i)},
n.prototype.restorePoints=function(t,e,i){this._timePoint=t,this._points=e,i||this.denormalizeTimePoints()},n.prototype.restoreExternalPoints=function(t){if(this.properties().interval.setValue(t.interval),this._timePoint=t.points,this.denormalizeTimePoints(),!this.isActualSymbol())return void this.clearServerPoints();this.createServerPoints()},n.prototype.restorePositionPercents=function(t){this._positionPercents=t},n.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},n.prototype.propertiesChanged=function(){if(this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),this.linkKey){var t=this.properties().state();delete t.interval,h.changeLineStyle({linkKey:this.linkKey,state:t,model:this._model})}},n.prototype.points=function(){var t,e,i=[];for(t=0;t<this._points.length;t++)e=this._points[t],i.push({index:e.index,price:e.price,time:e.time});return this._lastPoint&&i.push({index:this._lastPoint.index,price:this._lastPoint.price,time:this._lastPoint.time}),this._currentMovingPoint&&this._startMovingPoint&&this.correctPoints(i),i},n.prototype.axisPoints=function(){return this.points()},n.prototype.fixedPoints=function(){var t,e,i,o,n=[];if(this._positionPercents&&!this.priceScale().isEmpty())for(t=0;t<this._positionPercents.length;t++)e=this._positionPercents[t],i=this._model.timeScale().width()*e.x,o=this.priceScale().height()*e.y,n.push(new r(i,o));else for(t=0;t<this._fixedPoints.length;t++)n.push(this._fixedPoints[t].clone());return this._lastPoint&&n.push(this._lastPoint.clone()),this._currentMovingPoint&&this._startMovingPoint&&this.correctFixedPoints(n),n},n.prototype._convertPriceFromPercentIfNeeded=function(t){var e,i=this.priceScale();i.isPercent()&&(e=this.ownerSource().firstValue(),t.price=i.priceRange().convertFromPercent(t.price,e))},n.prototype._convertPriceToPercentIfNeeded=function(t){var e,i=this.priceScale();i.isPercent()&&(e=this.ownerSource().firstValue(),t.price=i.priceRange().convertToPercent(t.price,e))},n.prototype._preparePoint=function(t,e){var i=t;return e&&e.shift&&this.points().length>=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),this._convertPriceFromPercentIfNeeded(i),i},n.prototype.addPoint=function(t,e,i){var o=this._preparePoint(t,e);return this._addPointIntenal(o,e,i)},n.prototype._addPointIntenal=function(t,e,i){this._points.push(t);var o=this._points.length===this.pointsCount();return o?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=t,this._pointAdded.fire(this._points.length-1),o},n.prototype.addFixedPoint=function(t){this._fixedPoints.push(t);var e=this._fixedPoints.length===this.pointsCount();return e&&this.calcPositionPercents(),e},n.prototype.calcPositionPercents=function(){var t,e,i,o;if(!this.priceScale()||this.priceScale().isEmpty())return[];for(this._positionPercents=[],t=0;t<this._fixedPoints.length;t++)e=this._fixedPoints[0],i=e.x/this._model.timeScale().width(),o=e.y/this.priceScale().height(),
this._positionPercents.push({x:i,y:o});return this._positionPercents},n.prototype.calcMiddlePoint=function(t,e){return new r((t.x+e.x)/2,(t.y+e.y)/2)},n.prototype.restoreFixedPoints=function(){this._fixedPoints=this.fixedPoints()},n.prototype.onData=function(t){var e,i,o,n,r,s;if(t.params.customId===this.currentPointsetId()&&0!==t.params.plots.length){for(e=0;e<t.params.plots.length;e++)i=t.params.plots[e],o=this._timePoint[i.index],n=i.value[0],r=new Date(1e3*i.value[1]),s={index:n,time:r,price:o.price},this._points.length<=i.index?(this._points.push(s),this._pointAdded.fire(this._points.length-1)):(this._points[i.index]=s,this._pointChanged.fire(i.index));this.checkAlert&&this.checkAlert(),this.updateAllViewsAndRedraw()}},n.prototype.correctPricesToPercents=function(){var t,e,i=this.priceScale(),o=this.ownerSource().firstValue();for(t=0;t<this._points.length;t++)e=this._points[t],e.price=i.priceRange().convertFromPercent(e.price,o),this._pointChanged.fire(t)},n.prototype.startChanging=function(t,e){t<this.m_priceAxisViews.length&&this.m_priceAxisViews[t].setActive(!0),t<this.m_timeAxisViews.length&&this.m_timeAxisViews[t].setActive(!0),this._properties.lastUpdateTime.setValue((new Date).valueOf())},n.prototype.setPoint=function(t,e,i){if(i&&i.shift&&this._properties.snapTo45Degrees){var o=0===t?1:t-1;this._snapPoint45Degree(e,this.points()[o])}this._convertPriceFromPercentIfNeeded(e),this._points[t]=e,this._pointChanged.fire(t),this.normalizePoints()},n.prototype.startMoving=function(t){this.isFixed()&&this.restoreFixedPoints(),this._convertPriceFromPercentIfNeeded(t),this._startMovingPoint=t,this._properties.lastUpdateTime.setValue((new Date).valueOf())},n.prototype.move=function(t){this._convertPriceFromPercentIfNeeded(t),this._currentMovingPoint=t,this.updateAllViews()},n.prototype.correctPoints=function(t){var e,i,o=this._currentMovingPoint.index-this._startMovingPoint.index,n=this._currentMovingPoint.price-this._startMovingPoint.price;if(0===o&&0===n)return!1;for(e=0;e<t.length;e++)i=t[e],i.index+=o,i.price+=n,t[e]=i;return!0},n.prototype.correctFixedPoints=function(t){var e,i=this._currentMovingPoint.subtract(this._startMovingPoint);for(e=0;e<t.length;e++)t[e]=t[e].add(i)},n.prototype.endMoving=function(t){var e,i,o;if(this._properties.interval.setValue(this._model.mainSeries().interval()),e=!1,i=!1,this._currentMovingPoint&&this._startMovingPoint){if(e=this._currentMovingPoint.index!==this._startMovingPoint.index,i=this._currentMovingPoint.price!==this._startMovingPoint.price,this.isFixed())this.correctFixedPoints(this._fixedPoints);else if(this.correctPoints(this._points))for(o=0;o<this._points.length;o++)this._pointChanged.fire(o);this._startMovingPoint=null,this._currentMovingPoint=null}if(this.isFixed())return this.calcPositionPercents(),void this.updateAllViews();this.normalizePoints(),this.updateAllViews(),e&&!t&&this.createServerPoints(),(i||e)&&this.synchronizeAlert(!this._alertUndoMode)},n.prototype.endChanging=function(t,e){var i
;for(this._properties.interval.setValue(this._model.mainSeries().interval()),e||(this.normalizePoints(),this.createServerPoints()),i=0;i<this.m_priceAxisViews.length;i++)this.m_priceAxisViews[i].setActive(!1);for(i=0;i<this.m_timeAxisViews.length;i++)this.m_timeAxisViews[i].setActive(!1);this.synchronizeAlert(!t)},n.prototype.paneViews=function(t){var e,i;if(!this._isActualSymbol||!this._isActualInterval)return null;if(!this._properties.visible.value())return null;if(h.hideAllDrawings().value()&&this.canBeHidden())return null;for(e=[],i=this._paneViews.length-1;i>=0;--i)e.push(this._paneViews[i]);return e},n.prototype._setPaneViews=function(t){this._paneViews=t,this._model.invalidate(new _(_.LIGHT_UPDATE))},n.prototype.dataWindowView=function(){return null},n.prototype.statusView=function(){return null},n.prototype.priceAxisViews=function(t,e){var i,o,n;return this._isActualSymbol&&-1!==t.dataSources().indexOf(this)&&e===this.priceScale()?this._model.lineBeingEdited()===this?(i=this._model.linePointBeingEdited(),i<this.m_priceAxisViews.length?(o=this.m_priceAxisViews.slice(),n=o[i],o.splice(i,1),o.push(n),o):this.m_priceAxisViews):this.m_priceAxisViews:null},n.prototype.timeAxisViews=function(){var t,e,i;return this._model.lineBeingEdited()===this?(t=this._model.linePointBeingEdited(),t<this.m_timeAxisViews.length?(e=this.m_timeAxisViews.slice(),i=e[t],e.splice(t,1),e.push(i),e):this.m_timeAxisViews):this.m_timeAxisViews},n.prototype.updateAllViews=function(){var t,e,i;if(!this._isActualSymbol)return null;if(!this._properties.visible.value())return null;if(null!==(t=this.paneViews()))for(e=t,i=0;i<e.length;i++)e[i].update();for(e=this.m_priceAxisViews,i=0;i<e.length;i++)e[i].update();for(e=this.m_timeAxisViews,i=0;i<e.length;i++)e[i].update()},n.prototype.setLastPoint=function(t,e){this._lastPoint=this._preparePoint(t,e),this.updateAllViews()},n.prototype.setLastFixedPoint=function(t){this._lastFixedPoint=t,this.updateAllViews()},n.prototype.title=function(){return"Line Tool"},n._pointSetId=1,n.prototype.start=function(){this.createServerPoints()},n.prototype.createServerPoints=function(){var t,e,i,o,r,s;if(!this._recursiveGuard&&this._isActualSymbol&&this._model.chartApi().connected()&&(this.clearServerPoints(),!this._model.timeScale().isEmpty()&&(0===this._timePoint.length&&this.normalizePoints(),0!==this._timePoint.length))){for(this._currentPointsetId=++n._pointSetId,t=this._model.mainSeries().symbolId(),e=this.properties().interval.value(),i=[],o=0;o<this._timePoint.length;o++)r=this._timePoint[o],i.push([r.time_t,r.offset]);s=this,this._model.chartApi().createPointset(this.currentPointsetId(),"turnaround",t,e,i,function(t){s.onData(t)})}},n.prototype.clearServerPoints=function(){null!==this._currentPointsetId&&(this._model.chartApi().removePointset(this.currentPointsetId()),this._currentPointsetId=null)},n.prototype.isBeingEdited=function(){return this===this._model.lineBeingEdited()||this===this._model.sourceBeingMoved},n.prototype.isFixed=function(){
return this.properties().locked&&this.properties().locked.value()},n.prototype.isLocked=n.prototype.isFrozen=function(){return this.properties().frozen&&this.properties().frozen.value()},n.prototype._tooltipFieldsHash={},n.prototype._tooltipFieldsOrder=["time","price","index","time0","price0","time1","price1","time2","price2","time3","price3","time4","price4","distance","term","pointsPerBar"],n.prototype._tooltipFieldsOrdered=null,n.prototype._formatTooltip=function(){return null===this._tooltipFieldsOrdered&&(this._tooltipFieldsOrdered=new p(this._tooltipFieldsHash,p.byOrder(this._tooltipFieldsOrder))),this._tooltipFieldsOrdered.array.filter(function(t){return null!==t.value&&""!==t.value}).map(function(t){return"<span>"+t.title+":</span> "+t.value}).join("<br />")},n.prototype.pointToScreenPoint=function(t){var e,i,o,n,s,a,l=this._model.timeScale(),c=this.priceScale();if(!c||c.isEmpty()||l.isEmpty())return[new r(0,0),new r(0,0)];if(e=null,c.isPercent()){if(!this.ownerSource())return;if(null===(e=this.ownerSource().firstValue())||!isFinite(e))return}return i=l.indexToCoordinate(t.index,!0),o=t.price,c.isPercent()&&(o=c.priceRange().convertToPercent(o,e)),n=c.priceToCoordinate(o,!0),s=new r(i,n),i=l.indexToCoordinate(t.index,!1),n=c.priceToCoordinate(o,!1),a=new r(i,n),[s,a]},n.prototype.screenPointToPoint=function(t){var e=this._model.timeScale(),i=this.priceScale(),o=e.coordinateToIndex(t.x),n=i.coordinateToPrice(t.y),r=null;if(i.isPercent()){if(!this.ownerSource())return;if(null===(r=this.ownerSource().firstValue())||!isFinite(r))return}return i.isPercent()&&(n=i.priceRange().convertFromPercent(n,r)),{price:n,index:o}},n.prototype.tags=function(){return[this._constructor]},n.prototype._snapPoint45Degree=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f=this._model.timeScale(),m=f.indexToCoordinate(e.index),g=f.indexToCoordinate(t.index)-m,v=this.m_priceScale,y=e.price,b=t.price,S=this.ownerSource().firstValue();v.isPercent()&&(y=v.priceRange().convertToPercent(y,S)),o=v.priceToCoordinate(y),n=v.priceToCoordinate(b)-o,r=Math.round(Math.atan2(g,n)/Math.PI*4),2===Math.abs(r)?i||(t.price=y):0===Math.abs(r)||4===Math.abs(r)?i||(t.index=e.index):0===Math.abs(r)||4===Math.abs(r)?i||(t.index=e.index):(s=Math.sqrt(g*g+n*n),a=g<0?-1:1,l=n<0?-1:1,c=Math.max(Math.abs(n),Math.abs(g)),h=c*Math.sqrt(2),u=h/s,c/=u,d=Math.round(f.coordinateToIndex(m+c*a)),p=Math.abs(f.indexToCoordinate(d)-m),_=v.coordinateToPrice(o+p*l),t.index=d,t.price=_)},n.prototype.createPriceAxisView=function(t){return new s(this,{pointIndex:t})},n.prototype.version=1,n.isLineTool=function(t){var e=TradingView[t];return!!e&&TradingView.isInherited(e,n)},n.prototype.alertId=function(){return this._alertId},n.prototype.setAlert=function(t,e){},n.prototype.flushAlert=function(){delete this._alertId,delete this._alert,this.hasAlert.setValue(!1),window.saver&&window.saver.saveChartSilently(null,!1)},n.prototype._processAlertHanders=function(t){var e,i,o,n=this
;("unsubscribe"!==(t="subscribe"===t?"subscribe":"unsubscribe")||n._alertCallbacks)&&(i="subscribe"===t?"on":"off",e=n.properties(),o=n._alertCallbacks||{flush:n.flushAlert.bind(n),hovered:function(t,e){e?n._model.setHoveredSource(n):n._model.hoveredSource()===n&&n._model.setHoveredSource(null)},selected:function(t,e){e&&n._model.setSelectedSource(n)},synchronizeSilently:function(t){n.synchronizeAlert(!1)}},n._alertCallbacks||(n._alertCallbacks=o),n.getAlert().done(function(r){r&&(r[i]("destroy",o.flush),r[i]("change:hovered",o.hovered),r[i]("change:selected",o.selected),e.extendLeft&&e.extendLeft[t](n,o.synchronizeSilently),e.extendRight&&e.extendRight[t](n,o.synchronizeSilently))}))},n.prototype.editAlert=function(){},n.prototype.getAlert=function(t){var e,i=this;return t=t||{},e=$.Deferred(),TradingView.alertsDispatcher?TradingView.alertsDispatcher.requestAlert(i._alertId,{success:e.resolve.bind(e),error:e.reject.bind(e),fromCache:t.fromCache}):m.logError("[Alerts] Can't get alert without alerts dispatcher"),e.promise()},n.prototype.synchronizeAlert=function(t){var e=this;e.hasAlert.value()&&setTimeout(function(){function i(){e._alertUndoMode=!0,s.undoToCheckpoint(e._undoCheckpointAlert),setTimeout(function(){e._alertUndoMode=!1,e.localAndServerAlersMismatch=!1},0)}function o(t){t.set("resolution",e.properties().interval.value()),t.get("extra").drawing(e),e.localAndServerAlersMismatch=!0}function n(t){TradingView.alertsDispatcher.restartAlert(t,{success:function(){e.localAndServerAlersMismatch=!1},error:i,complete:function(){delete e._undoCheckpointAlert}})}var r,s=e._model._undoModel;e._undoCheckpointAlert||e._alertUndoMode||(r=f.undoStack().pop(),e._undoCheckpointAlert=s.createUndoCheckpoint(),f.undoStack().push(r)),e.getAlert().done(function(e){o(e),t&&n(e)}).fail(i)},0)},n.prototype.stateForAlert=function(){var t,e;if(this.canHasAlert())return t=this.state(),t.id=this.idForAlert(),t.uniqueId=this.idForAlert(),t.title=this.title(),e=this._getAlertPlots(),e&&(t.plots=e),t},n.prototype._getAlertPlots=function(){return null},n.prototype._linePointsToAlertPlot=function(t,e,i,o){if(2!==t.length)return m.logError("[Drawing Alert] Wrong points"),null;var n=this._model.timeScale();return!n||n.isEmpty()?null:{type:"LinePlot",title:e||this.title(),timestamp:n.indexToTimePoint(0),offset1:t[0].index,offset2:t[1].index,price1:t[0].price,price2:t[1].price,extendBackward:i||!1,extendForward:o||!1}},n.prototype.getAlertIsActive=function(t){this.getAlert({fromCache:!0}).done(function(e){t(!!e&&e.get("active"))}).fail(function(){t(!1)})},n.prototype.geometry=function(){var t=this,e=function(e){var i=e.x/t._model.timeScale().width(),o=e.y/t.priceScale().height();return new r(i,o)};return this.points().map(function(i){var o=t.pointToScreenPoint(i)[0];return e(o)})},n.prototype.onlyYMoving=function(){return!1},n.prototype.model=function(){return this._model},n.prototype.isForcedDrawPriceAxisLabel=function(){return this.customization.forcePriceAxisLabel},n.prototype.getInputsPropertyPage=function(){
return v.LineToolInputsPropertyPage},n.prototype.getVisibilitiesPropertyPage=function(){return v.LineToolVisibilitiesPropertyPage},n.prototype.getSourceIcon=function(){var t=y[this.getType()];return void 0===t?null:{type:"svg",svgCode:t.icon}},n.prototype.destroy=function(){this.stop()},e.LineToolPriceAxisView=s,e.LineDataSource=n}).call(e,i(52))},function(t,e){"use strict";var i=function(){function t(t,e,i){this._result=t,this._data=e,this._eraseMarker=i}return t.prototype.result=function(){return this._result},t.prototype.data=function(){return this._data},t.prototype.eraseMarker=function(){return this._eraseMarker},t.MOVEPOINT_BACKGROUND=1,t.REGULAR=2,t.MOVEPOINT=3,t.CHANGEPOINT=4,t.CUSTOM=5,t.CUSTOM_MOVE=6,t}();t.exports=i},function(t,e,i){var o,n;(function(i){var r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b;!function(r){function s(t,e){return function(i,o){return t[i]=e?e(i,o):o}}var a="object"==typeof i?i:"object"==typeof self?self:"object"==typeof this?this:{};o=[e],void 0!==(n=function(t){r(s(a,s(t)))}.apply(e,o))&&(t.exports=n)}(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};r=function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)},s=Object.assign||function(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++){e=arguments[i];for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},a=function(t,e){var i,o,n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&(n[i[o]]=t[i[o]]);return n},l=function(t,e,i,o){var n,r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(r=t.length-1;r>=0;r--)(n=t[r])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},c=function(t,e){return function(i,o){e(i,o,t)}},h=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u=function(t,e,i,o){return new(i||(i=Promise))(function(n,r){function s(t){try{l(o.next(t))}catch(t){r(t)}}function a(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){t.done?n(t.value):new i(function(e){e(t.value)}).then(s,a)}l((o=o.apply(t,e||[])).next())})},d=function(t,e){function i(t){return function(e){return o([t,e])}}function o(i){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,r&&(s=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(s=s.call(r,i[1])).done)return s;switch(r=0,s&&(i=[0,s.value]),i[0]){case 0:case 1:s=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,r=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(s=l.trys,!(s=s.length>0&&s[s.length-1])&&(6===i[0]||2===i[0])){l=0;continue}
if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){l.label=i[1];break}if(6===i[0]&&l.label<s[1]){l.label=s[1],s=i;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(i);break}s[2]&&l.ops.pop(),l.trys.pop();continue}i=e.call(t,l)}catch(t){i=[6,t],r=0}finally{n=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var n,r,s,a,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a},p=function(t,e){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])},_=function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}},f=function(t,e){var i,o,n,r,s="function"==typeof Symbol&&t[Symbol.iterator];if(!s)return t;i=s.call(t),n=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)n.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}return n},m=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t},g=function(t){return this instanceof g?(this.v=t,this):new g(t)},v=function(t,e,i){function o(t){h[t]&&(c[t]=function(e){return new Promise(function(i,o){u.push([t,e,i,o])>1||n(t,e)})})}function n(t,e){try{r(h[t](e))}catch(t){l(u[0][3],t)}}function r(t){t.value instanceof g?Promise.resolve(t.value.v).then(s,a):l(u[0][2],t)}function s(t){n("next",t)}function a(t){n("throw",t)}function l(t,e){t(e),u.shift(),u.length&&n(u[0][0],u[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c,h=i.apply(t,e||[]),u=[];return c={},o("next"),o("throw"),o("return"),c[Symbol.asyncIterator]=function(){return this},c},y=function(t){function e(e,n){t[e]&&(i[e]=function(i){return(o=!o)?{value:g(t[e](i)),done:"return"===e}:n?n(i):i})}var i,o;return i={},e("next"),e("throw",function(t){throw t}),e("return"),i[Symbol.iterator]=function(){return this},i},b=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof _?_(t):t[Symbol.iterator]()},t("__extends",r),t("__assign",s),t("__rest",a),t("__decorate",l),t("__param",c),t("__metadata",h),t("__awaiter",u),t("__generator",d),t("__exportStar",p),t("__values",_),t("__read",f),t("__spread",m),t("__await",g),t("__asyncGenerator",v),t("__asyncDelegator",y),t("__asyncValues",b)})}).call(e,function(){return this}())},,function(t,e,i){var o=i(723),n={},r={},s={},a={init:function(){var t,e,i,l;Object.keys(o).forEach(function(i){t=o[i],e=t.subsets,Array.isArray(e)?e.forEach(function(t){n[t]=1}):e&&Object.keys(e).forEach(function(t){n[t]=1}),n[i]=1}),i=Object.keys(n),i.forEach(function(t){i.forEach(function(i){if(void 0!==(l=o[i])){if(!(e=l.subsets))return;r.hasOwnProperty(t)||(r[t]=[]),Array.isArray(e)&&~e.indexOf(t)?r[t].push(i):t in e&&r[t].push(i)}})}),
"undefined"!=typeof __initialDisabledFeaturesets&&__initialDisabledFeaturesets&&__initialDisabledFeaturesets.forEach(function(t){a.disable(t)}),"undefined"!=typeof __initialEnabledFeaturesets&&__initialEnabledFeaturesets&&__initialEnabledFeaturesets.forEach(function(t){a.enable(t)}),"undefined"!=typeof window&&(window.Featuresets=a),this.meta={_uniqueSetsNames:n,_setsReverseDependencies:r,_setsStates:s}},enabled:function(t){var e=function(t){var i,o,n=r.hasOwnProperty(t)?r[t]:[];if(!1===s[t])return!1;for(i=s[t],o=0;o<n.length;++o)i|=e(n[o]);return i};return!!e(t)},enable:function(t){s[t]=!0},disable:function(t){s[t]=!1},setEnabled:function(t,e){s[t]=!!e},_uniqueSets:function(){return Object.keys(n)}};a.init(),t.exports=a},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this._renderers=[],this._globalAlpha=1}return t.prototype.setGlobalAlpha=function(t){this._globalAlpha=t},t.prototype.append=function(t){this._renderers.push(t)},t.prototype.insert=function(t,e){this._renderers.splice(e,0,t)},t.prototype.draw=function(t){for(var e=0;e<this._renderers.length;e++)t.save(),t.globalAlpha=this._globalAlpha,this._renderers[e].draw(t),t.restore()},t.prototype.drawBackground=function(t){var e,i;for(t.save(),t.globalAlpha=this._globalAlpha,e=0;e<this._renderers.length;e++)i=this._renderers[e],i.drawBackground&&i.drawBackground(t);t.restore()},t.prototype.hitTest=function(t){var e,i,o=null;for(e=this._renderers.length-1;e>=0;e--)null!==(i=this._renderers[e].hitTest(t))&&(null===o||i.result()>o.result())&&(o=i);return o},t}();e.CompositeRenderer=i},function(t,e,i){"use strict";var o,n=i(13).getLogger("Chart.DataSourcePropertyPages");e.propertyPages={},o=e.propertyPages,setTimeout(function(){n.logNormal("Start loading property pages"),i.e(5,function(t){o.ChartStylesPropertyPage=i(746),o.LineToolABCDPatternStylesPropertyPage=i(758),o.LineToolArcStylesPropertyPage=i(759),o.LineToolArrowMarkStylesPropertyPage=i(760),o.LineToolBalloonStylesPropertyPage=i(761),o.LineToolBarsPatternStylesPropertyPage=i(762).LineToolBarsPatternStylesPropertyPage,o.LineToolBezierStylesPropertyPage=i(763),o.LineToolBrushStylesPropertyPage=i(764),o.LineToolCalloutStylesPropertyPage=i(765),o.LineToolCircleLinesStylesPropertyPage=i(766),o.LineToolDateAndPriceRangeStylesPropertyPage=i(767),o.LineToolDateRangeStylesPropertyPage=i(768),o.LineToolDisjointAngleStylesPropertyPage=i(769),o.LineToolElliottStylesPropertyPage=i(770),o.LineToolEllipseStylesPropertyPage=i(771),o.LineToolFibChannelStylesPropertyPage=i(772),o.LineToolFibCirclesStylesPropertyPage=i(773),o.LineToolFibRetracementStylesPropertyPage=i(267),o.LineToolFibSpeedResistanceArcsStylesPropertyPage=i(774),o.LineToolFibSpeedResistanceFanStylesPropertyPage=i(775),o.LineToolFibSpiralStylesPropertyPage=i(776),o.LineToolFibTimeZoneStylesPropertyPage=i(777),o.LineToolFibWedgeStylesPropertyPage=i(780),o.LineToolFlatBottomStylesPropertyPage=i(781),o.LineToolGannComplexStylesPropertyPage=i(782),o.LineToolGannFanStylesPropertyPage=i(783),
o.LineToolGannSquareStylesPropertyPage=i(784),o.LineToolGhostFeedInputsPropertyPage=i(399).LineToolGhostFeedInputsPropertyPage,o.LineToolGhostFeedStylesPropertyPage=i(399).LineToolGhostFeedStylesPropertyPage,o.LineToolHorzLineInputsPropertyPage=i(400).LineToolHorzLineInputsPropertyPage,o.LineToolHorzLineStylesPropertyPage=i(400).LineToolHorzLineStylesPropertyPage,o.LineToolIconStylesPropertyPage=i(785),o.LineToolInputsPropertyPage=i(81),o.LineToolLineTool5PointsPatternStylesPropertyPage=i(757),o.LineToolNotePropertyPage=i(786),o.LineToolParallelChannelStylesPropertyPage=i(787),o.LineToolPitchfanStylesPropertyPage=i(788),o.LineToolPitchforkStylesPropertyPage=i(789),o.LineToolPolylineStylesPropertyPage=i(790),o.LineToolPredictionStylesPropertyPage=i(791),o.LineToolPriceLabelStylesPropertyPage=i(792),o.LineToolProjectionStylesPropertyPage=i(793),o.LineToolRectangleStylesPropertyPage=i(795),o.LineToolRiskRewardInputsPropertyPage=i(401).LineToolRiskRewardInputsPropertyPage,o.LineToolRiskRewardStylesPropertyPage=i(401).LineToolRiskRewardStylesPropertyPage,o.LineToolTextStylesPropertyPage=i(796),o.LineToolTimeCyclesPropertyPage=i(797),o.LineToolTrendAngleInputsPropertyPage=i(402).LineToolTrendAngleInputsPropertyPage,o.LineToolTrendAngleStylesPropertyPage=i(402).LineToolTrendAngleStylesPropertyPage,o.LineToolTrendBasedFibExtensionStylesPropertyPage=i(778),o.LineToolTrendBasedFibTimeStylesPropertyPage=i(779),o.LineToolTrendLineStylesPropertyPage=i(798),o.LineToolTrianglePatternStylesPropertyPage=i(799),o.LineToolTriangleStylesPropertyPage=i(800),o.LineToolVertLineInputsPropertyPage=i(403).LineToolVertLineInputsPropertyPage,o.LineToolVertLineStylesPropertyPage=i(403).LineToolVertLineStylesPropertyPage,o.LineToolVisibilitiesPropertyPage=i(801),o.StudyCompareInputsPropertyPage=i(750),o.StudyDisplayPropertyPage=i(208).StudyDisplayPropertyPage,o.StudyInputsPropertyPage=i(271).StudyInputsPropertyPage,o.StudyLineDataSourcePropertyPage=i(811),o.StudyOverlayStylesPropertyPage=i(813),o.StudyStrategyPropertyPage=i(814),o.StudyStylesPropertyPage=i(208).StudyStylesPropertyPage,o.VolumePropertyPage=i(820),n.logNormal("Property pages loaded")})},5e3)},function(t,e,i){(function(t){"use strict";function o(t,e){this._model=e,this._bindings=[],this._property=t,this.supportThemeSwitcher=!1}function n(t){return t.toUpperCase()}function r(t){return function(e){return e<t?t:e}}function s(t){return function(e){return e>t?t:e}}function a(t){return function(e){var i=parseInt(e,10);return TradingView.isNaN(i)?t:i}}function l(t){var e=new O;return function(i){var o=e.parse(i);return TradingView.isNaN(o)?t:o}}function c(){return function(t){for(var e=t,i=t.replace(/[^\u0000-\u007F]/,"");i.length!==e.length;)e=i,i=e.replace(/[^\u0000-\u007F]/,"");return i}}function h(t){return function(e){return 0===e.length?t:e}}function u(t,e,i,o,n,r){z.call(this,t,e,o,n,r),this._transformFunction=i,this._attachToControl(t,o)}function d(t,e,i,o,n){u.call(this,t,e,l(e.value()),i,o,n),this.addFormatter(function(t){return(new O).format(t)})}function p(t,e,i,o,n,r){
this._subControlIds=e,z.call(this,t,i,o,n,r),this._forEachSubControl(function(t){this._attachToControl(t,o)})}function _(t,e,i,o,n,r,s){this._model=o,this._mainSeries=r,this._toIntTransformer=a(s),this._disabled=!1,z.call(this,t,e,i,o,n);var l=this;i&&t.change(function(){l.setValueToProperty(l.value())}),this._mainSeries.onBarReceived().subscribe(this,function(){l.setValue(this.property().value())})}function f(t,e,i,o,n){z.call(this,t,e,i,o,n),i&&t.on("accept-symbol",function(t,e){this.setValueToProperty(e)}.bind(this))}function m(t,e,i,o,n,r,s,a){z.call(this,t,e,o,n,r),this._transformFunction=i,this._propertyChangedHook=a,this._setter=s;var l=this;o&&t.change(function(){l._setter?l._setter.call(l,l.value()):l.setValueToProperty(l.value())})}function g(t,e){z.call(this,t,e)}function v(t,e,i,o,n,r){if(!t.is(":checkbox, :radio"))return new b(t,e,i,o,n);z.call(this,t,e,i,o,n),this._setter=r;var s=this;i&&t.change(function(){s._setter?s._setter.call(s,s.value()):s.setValueToProperty(s.value())})}function y(t,e,i,o,n,r){z.call(this,t,e,i,o,n),this._inverted=!0===r}function b(t,e,i,o,n){z.call(this,t,e,i,o,n);var r=this;i&&t.click(function(){var t=$(this).toggleClass("active").hasClass("active");r.setValueToProperty(t)})}function S(t,e,i,o,n,r){var s,a;s=t.is("input")?t:t.find("input"),z.call(this,s,e,i,o,n),this._transparencyProperty=r,this.applyOldTransparency(),a=this,i&&s.change(function(){a.setValueToProperty(a.value())})}function w(e,i,o,n,r,s){function a(t,e){var i=c.control().slider("option","min"),o=c.control().slider("option","max"),n=c._property.value();(i<=n&&n<=o||i<e.value&&e.value<o)&&c.setValueToProperty(e.value)}function l(t,e){c.setValueToProperty(e.value)}isNumber(i.value())||(F.logWarn("Property cannot be binded to control, bad value (expect number): "+i.value()),i=new t),z.call(this,e,i,o,n,r);var c=this;o&&(s?(e.bind("slidechange",a),e.bind("slide",a)):(e.bind("slidechange",l),e.bind("slide",l))),e.bind("slidestart",function(t,e){n.beginUndoMacro(r)}),e.bind("slidestop",function(t,e){n.endUndoMacro()})}function T(t,e,i,o,n,r){v.call(this,t,e,o,n,r),this._intervalProperty=i,this._intervalProperty.listeners().subscribe(this,this.onIntervalChanged),this.onIntervalChanged()}function x(t,e,i,o){this._control=t,this._wv=e,this._transformFunction=i,this._undoText=o,this._attachToControl(this._control),this._setValueBinded=this.setValue.bind(this)}function C(t,e,i,o,n){this._not=!!n,x.apply(this,arguments)}function P(t,e,i,o,n,r,s,a){this._propFrom=e[0],this._propTo=e[1],this._control=t,this._applyOnFly=o,this._undoModel=n,this._undoText=s,this._properties=e,this._inputsText=r,this._transformers=i;var l=this;t.slider({range:!0,min:i[0],max:i[1],values:[l._propFrom.value(),l._propTo.value()]}),this.$rangeHandleFrom=$(t.find(".ui-slider-handle")[0]).addClass("from"),this.$rangeHandleTo=$(t.find(".ui-slider-handle")[1]).addClass("to"),this.setValue(this._propFrom,0),this.setValue(this._propTo,1),a&&($(a).on("change",function(t){$(this).is(":checked")?(l._control.slider("enable"),
$(l._inputsText[0]).prop("disabled",!1),$(l._inputsText[1]).prop("disabled",!1)):(l._control.slider("disable"),$(l._inputsText[0]).prop("disabled",!0),$(l._inputsText[1]).prop("disabled",!0))}),$(a).is(":checked")?(l._control.slider("enable"),$(l._inputsText[0]).prop("disabled",!1),$(l._inputsText[1]).prop("disabled",!1)):(l._control.slider("disable"),$(l._inputsText[0]).prop("disabled",!0),$(l._inputsText[1]).prop("disabled",!0))),r&&($(r[0]).val(this._control.slider("values",0)),$(r[1]).val(this._control.slider("values",1)),t.slider({slide:function(t,e){$(r[0]).val(e.values[0]),$(r[1]).val(e.values[1])}}),$(r).each(function(){$(this).on("keydown",function(t){parseInt($(r[0]).val())<l._transformers[0]?$(r[0]).val(l._transformers[0]):parseInt($(r[1]).val())>l._transformers[1]&&$(r[1]).val(l._transformers[1]),-1!==$.inArray(t.keyCode,[46,8,9,27,13,110,190])||65===t.keyCode&&!0===t.ctrlKey||67===t.keyCode&&!0===t.ctrlKey||88===t.keyCode&&!0===t.ctrlKey||t.keyCode>=35&&t.keyCode<=39||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()})}),$(r[0]).on("keyup",function(t){parseInt($(this).val())<l._transformers[0]?$(this).val(l._transformers[0]):parseInt($(this).val())>l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())>parseInt($(r[1]).val())&&$(this).val(r[1].val()),l._control.slider("values",0,$(this).val()),P.prototype.setValueToProperty.call(l,l._control.slider("values"),"from")}),$(r[1]).on("keyup",function(t){parseInt($(this).val())<l._transformers[0]?$(this).val(l._transformers[0]):parseInt($(this).val())>l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())<$(r[0]).val()&&$(this).val(r[0].val()),l._control.slider("values",1,$(this).val()),P.prototype.setValueToProperty.call(l,l._control.slider("values"),"to")})),this._propFrom.listeners().subscribe(this,P.prototype.propertyChanged),this._propTo.listeners().subscribe(this,P.prototype.propertyChanged),o&&t.on("slide",function(t,e){l.setValueToProperty(l._control.slider("values"),e.handle)}),t.slider({stop:function(t,e){r&&($(r[0]).val(l._control.slider("values",0)),$(r[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)},start:function(t,e){r&&($(r[0]).val(l._control.slider("values",0)),$(r[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)}})}function L(t,e,i,o,n,r){z.call(this,t,e,i,o,n),this._separator=r||" ";var s=this;i&&t.change(function(){s.setValueToProperty(s.value())})}var I,k,A,M,E,V,D,O,B,R,z,F;i(285),I=i(21).ensureNotNull,k=i(53),A=k.rgba,M=k.rgbaToString,E=k.parseRgb,V=i(315).TimePointIndexSearchMode,D=i(76).UndoHistory,O=i(38).NumericFormatter,B=i(19),R=i(47).addColorPicker,z=i(406).Binding,F=i(13).getLogger("Chart.PropertyPage"),o.prototype.model=function(){return this._model},o.prototype.bindControl=function(t){return this._bindings.push(t),t},o.prototype.unbindControl=function(t){var e=this._bindings.indexOf(t);-1!==e&&this._bindings.splice(e,1)},
o.prototype.loadData=function(){var t,e,i;for(t=0;t<this._bindings.length;t++)e=this._bindings[t],e.properties?(i=e.properties(),e.setValue(i[0],0),e.setValue(i[1],1)):e.property&&(e.transparencyProperty&&e.transparencyProperty()?e.applyOldTransparency():e.setValue(e.property().value()))},o.prototype.saveData=function(){var t,e;for(this._model.beginUndoMacro(),t=0;t<this._bindings.length;t++)e=this._bindings[t],e.changed()&&this._model.setProperty(e.property(),e.value());this._model.endUndoMacro()},o.prototype.createColorPicker=function(t){return R(null,t)},o.prototype.createTextEditor=function(t,e){var i={};return t&&(i.width=t),e&&(i.height=e),$(document.createElement("textarea")).css(i).addClass("tv-control-input")},o.prototype.createCombo=function(t){var e=$(document.createElement("select")),i=t.reduce(function(t,e){return t.add($(document.createElement("option")).prop({value:e,text:e}))},$());return e.append(i)},o.prototype.createKeyCombo=function(t){var e=$(document.createElement("select"));return $.each(t||[],function(t,i){$(document.createElement("option")).prop({value:t,text:i}).appendTo(e)}),e},o.prototype.createFontEditor=function(t){var e=t||TradingView.factoryDefaults("chartproperties.editorFontsList");return this.createCombo(e)},o.prototype.createFontSizeEditor=function(t){var e=t||[10,11,12,14,16,20,24,28,32,40];return this.createCombo(e).addClass("tv-select-container-fontsize")},o.prototype.createSeriesMinTickEditor=function(){var t,e,i,o,n="<select><option value='default'>"+$.t("Default")+"</option>",r=[{priceScale:1,minMove:1,frac:!1},{priceScale:10,minMove:1,frac:!1},{priceScale:100,minMove:1,frac:!1},{priceScale:1e3,minMove:1,frac:!1},{priceScale:1e4,minMove:1,frac:!1},{priceScale:1e5,minMove:1,frac:!1},{priceScale:1e6,minMove:1,frac:!1},{priceScale:1e7,minMove:1,frac:!1},{priceScale:1e8,minMove:1,frac:!1},{priceScale:2,minMove:1,frac:!0},{priceScale:4,minMove:1,frac:!0},{priceScale:8,minMove:1,frac:!0},{priceScale:16,minMove:1,frac:!0},{priceScale:32,minMove:1,frac:!0},{priceScale:64,minMove:1,frac:!0},{priceScale:128,minMove:1,frac:!0},{priceScale:320,minMove:1,frac:!0}];for(t in r)e=r[t],i=e.priceScale+","+e.minMove+","+e.frac,o=e.minMove+"/"+e.priceScale,n+="<option value='"+i+"'>"+o+"</option>";return n+="</select>",$(n)},o.prototype.createPrecisionEditor=function(){var t,e="<select><option value='default'>"+$.t("Default")+"</option>";for(t=0;t<=8;t++)e+="<option value='"+t+"'>"+t+"</option>";return e+="</select>",$(e)},o.prototype.createLabeledCell=function(t,e,i){var o,n,r,s,a=null;return"number"==typeof t.valueOf()?(a=t,o=e,n=i):(o=t,n=e),o+="",r=this._labelToId(o),s=$("<td>"),$("<label>").html(o.length>0?$.t(o):"").attr("for",r).appendTo(s),a&&s.attr("colspan",a),n&&n.attr("id",r),s},o.prototype.createTableInTable=function(t){var e=$("<tr>").appendTo(t),i=$("<td>").appendTo(e);return $('<table cellpadding="0" cellspacing="0">').appendTo(i)},o.prototype._labelToId=function(t){return"control"+t.replace(/(^| )\w/g,function(t){return"-"+t.trim().toLowerCase()})+Math.floor(1e3*Math.random())},
o.prototype.addRow=function(t){return $(document.createElement("tr")).appendTo(t)},o.prototype.addLabeledRow=function(t,e,i,o){var n,r=e&&e.length>0?$.t(e):"",s=$(document.createElement("tr")),a=$(document.createElement("td")).html(r);return o&&a.attr("colspan",2),i&&(n=this._labelToId(e),i.attr("id",n),a.html('<label for="'+n+'">'+r+"</label>")),s.append(a).appendTo(t)},o.prototype.addEditorRow=function(t,e,i,o){var n=$(document.createElement("td"));return i.row=this.addLabeledRow(t,e,i,o),i.appendTo(n.appendTo(i.row)),i},o.prototype.addColorPickerRow=function(t,e){return this.addEditorRow(t,e,this.createColorPicker())},o.prototype.addOffsetEditorRow=function(t,e){var i=$("<input/>");return i.attr("type","text"),i.css("width","100px"),i.addClass("ticker"),this.addEditorRow(t,e,i)},o.prototype.addFontEditorRow=function(t,e){return this.addEditorRow(t,e,this.createFontEditor())},o.prototype.refreshStateControls=function(t,e,i){var o,n,r;for(o=0;o<e.length;o++){n=e[o],r=t[n.id];try{r.toggle(this.parseRule(n.visible,e,i))}catch(t){continue}r.attr("disabled",!this.parseRule(n.visible,e,i))}},o.prototype.parseRule=function(t,e,i){if(!t)return!0;var o=t.split("==");return!(o.length<2)&&i[o[0]].value()===o[1]},o.prototype.destroy=function(){for(var t=this._bindings.length;t--;)this._bindings[t].destroy();this._bindings.length=0},o.prototype.bindInteger=function(t,e,i,o,n){var l=[a(e.value())];void 0!==o&&l.push(r(1)),void 0!==n&&l.push(s(1e3)),this.bindControl(new u(t,e,l,!1,this.model(),i))},o.prototype.bindColor=function(t,e,i){this.bindControl(new S(t,e,!0,this.model(),i))},o.prototype.bindBoolean=function(t,e,i){this.bindControl(new v(t,e,!0,this.model(),i))},inherit(u,z),u.prototype.value=function(){var t,e=this._control.val();if(this._transformFunction)if(Array.isArray(this._transformFunction))for(t=0;t<this._transformFunction.length;t++)e=this._transformFunction[t](e);else e=this._transformFunction(e);return e},u.prototype.setValue=function(t){var e=this._control.val(),i=this._formatValue(t);e!==i&&this._control.val(i)},inherit(d,u),inherit(p,z),p.prototype._forEachSubControl=function(t){this._subControlIds.forEach(function(e){var i="#"+e,o=this.control().find(i);t.call(this,o)},this)},p.prototype._parseSessions=function(t){var e,i,o=t.split("-",2);return 2!==o.length&&(o=["0","0"]),e=parseInt(o[0]),i=parseInt(o[1]),[Math.floor(e/100),e%100,Math.floor(i/100),i%100]},p.prototype.value=function(){var t,e,i,o=[];return this._forEachSubControl(function(t){o.push(t.val())}),t=function(t,e){return e.forEach(function(e){t=e(t)}),("0"+t).slice(-2)},e=[a(0),r(0),s(23)],i=[a(0),r(0),s(59)],t(o[0],e)+t(o[1],i)+"-"+t(o[2],e)+t(o[3],i)},p.prototype.setValue=function(t){var e=this._parseSessions(t);this._forEachSubControl(function(t){var i=t.val(),o=("0"+e[0]).slice(-2);e.shift(),i!==o&&t.val(o)})},inherit(_,z),_.prototype.value=function(){var t,e,i;return this._disabled?(this._control.attr("disabled",!0),null):(t=this._control.val(),e=this._toIntTransformer(t),e<0&&(e=0),i=this._mainSeries.bars().size(),i<=e&&(e=i-1),
1e3*I(this._mainSeries.bars().valueAt(I(this._mainSeries.bars().lastIndex())-e))[TradingView.TIME_PLOT])},_.prototype.setValue=function(t){var e,i,o;return this._disabled||null==t?void this._control.attr("disabled",!0):t<0?(this._control.val(-t),void this._property.setValue(this.value())):null===(e=this._mainSeries.data().plotValueToTimePointIndex(t/1e3,TradingView.TIME_PLOT,V.FromRight))?void(this._disabled=!0):(i=I(this._mainSeries.bars().lastIndex()),o=i-e,void(this._control.val()!==""+o&&this._control.val(o)))},inherit(f,z),f.prototype.value=function(){return this._control.val()},f.prototype.setValue=function(t){var e=this.value();t&&e!==t&&this._control.val(t)},inherit(m,z),m.prototype.value=function(){var t=this._control.val();return this._transformFunction&&(t=this._transformFunction(t)),t},m.prototype.setValue=function(t){var e,i;if(this._control.val(t),this._control.selectbox)try{e=this._control.find("[value='"+t+"']"),e.length>0&&(i=e[0],this._control.selectbox("change",i.value,i.text))}catch(t){}},m.prototype.propertyChanged=function(t){var e=t.value();"function"==typeof this._propertyChangedHook&&(e=this._propertyChangedHook(e)),this.setValue(e)},inherit(g,z),g.prototype.value=function(){return this._property.value()},g.prototype.setValue=function(t){return this._control.html(t)},inherit(v,z),v.prototype.value=function(){return this.control().is(":checked")},v.prototype.setValue=function(t){var e,i,o,n;return this.control().is(".visibility-checker")&&(t?(this.control().closest("tr").find(".slider-range").slider("enable"),this.control().closest("tr").find('input[type="text"]').each(function(){$(this).prop("disabled",!1)})):(this.control().closest("tr").find(".slider-range").slider("disable"),this.control().closest("tr").find('input[type="text"]').each(function(){$(this).prop("disabled",!0)}))),this.control().is(".visibility-switch")&&(e={opacity:t?1:.5},i=t?"enable":"disable",o=this.control().data("hides"),o?o.closest("td").css(e):(n=this.control(),n.parent().parent().data("visible",t).find("td").filter(function(){var t=$(this);return!t.find("label").length&&t.find(":checkbox").attr("id")!==n.attr("id")}).each(function(){var o=$(this);o.children().each(function(){var n=$(this);n.is(".ui-slider")?n.slider(i):n.is("select")?(n.selectbox(i),o.css(e)):n.is(".custom-select")?(n.data(i)(),o.css(e)):n.is(".tvcolorpicker-container")?(n.find("input").prop("disabled",!t),o.css(e)):(n.prop("disabled",!t),o.css(e))})}))),this.control().attr("checked",!!t)},inherit(y,z),y.prototype.value=function(){return this.control().is(":disabled")},y.prototype.setValue=function(t){return t=!!t,this._inverted&&(t=!t),this.control().parents("label").toggleClass("disabled",t),this.control().attr("disabled",t)},inherit(b,z),b.prototype.value=function(){return this.control().hasClass("active")},b.prototype.setValue=function(t){return this.control().toggleClass("active",!!t)},inherit(S,z),S.prototype.applyOldTransparency=function(){var t,e,i
;this.transparencyProperty()&&(B.isHexColor(this.property().value())?(t=this.transparencyProperty().value?this.transparencyProperty().value():this.transparencyProperty(),e=E(this.property().value()),i=(100-t)/100,this.control().val(M(A(e,i)))):this.control().val(this.property().value()),this.control().change())},S.prototype.transparencyProperty=function(){return this._transparencyProperty},S.prototype.value=function(){return this._control.val()},S.prototype.setValue=function(t){this._control.val(t),this._control.change(),this._control.color&&this._control.color.fromString(t)},inherit(w,z),w.prototype.value=function(){return this._control.slider("option","value")},w.prototype.setValue=function(t){this._control.slider("option","value",t)},inherit(T,v),T.prototype.onIntervalChanged=function(){+this._intervalProperty.value()<1440?this._control.attr({disabled:!1,checked:!!this._property.value()}):this._control.attr({disabled:!0,checked:!1})},T.prototype.value=function(){return this._control.is(":disabled")?this._property.value():v.prototype.value.call(this)},T.prototype.setValue=function(t){if(!this._control.is(":disabled"))return v.prototype.setValue.call(this,t)},T.prototype.destroy=function(){this._intervalProperty.listeners().unsubscribe(this,this.onIntervalChanged),delete this._intervalProperty,v.prototype.destroy.call(this,arguments)},x.prototype._attachToControl=function(t){var e=this;this._wv.subscribe(this._setValueBinded,{callWithLast:!0}),$(this._control).on("change",function(){e.setValueToProperty(e.value())})},x.prototype.control=function(){return this._control},x.prototype.value=function(){var t=$(this._control).val();return this._transformFunction&&(t=this._transformFunction(t)),t},x.prototype.setValue=function(t){$(this._control).val(t)},x.prototype.setValueToProperty=function(t){D.setWatchedValue(this._wv,t,this._undoText)},x.prototype.watchedValue=function(){return this._wv},x.prototype.destroy=function(){this._wv.unsubscribe(this._setValueBinded)},inherit(C,x),C.prototype._attachToControl=function(t){var e=this;this._wv.subscribe(this.setValue.bind(this),{callWithLast:!0}),$(this._control).on("click",function(){e.setValueToProperty(e.value())})},C.prototype.value=function(){var t=$(this._control).attr("checked");return this._not&&(t=!t),this._transformFunction&&(t=this._transformFunction(t)),t},C.prototype.setValue=function(t){this._not&&(t=!t),$(this._control).attr("checked",!!t)},P.prototype.properties=function(){return this._properties},P.prototype.value=function(t){return this._control.slider("values",t)},P.prototype.setValue=function(t,e){this._control.slider("values",e,t.value()),this._inputsText&&$(this._inputsText[e]).val(t.value())},P.prototype.propertyChanged=function(t){this.setValue(t)},P.prototype.setValueToProperty=function(t,e){($(e).hasClass("from")||"from"===e)&&(this._undoModel.beginUndoMacro(this._undoText[0]),this._undoModel.setProperty(this._propFrom,t[0],this._undoText[0]),this._propFrom.setValue(t[0],0),this._undoModel.endUndoMacro()),
($(e).hasClass("to")||"to"===e)&&(this._undoModel.beginUndoMacro(this._undoText[1]),this._undoModel.setProperty(this._propTo,t[1],this._undoText[1]),this._propTo.setValue(t[1],1),this._undoModel.endUndoMacro())},P.prototype.destroy=function(){this._propFrom&&this._propTo&&(this._propFrom.listeners().unsubscribe(this,z.prototype.propertyChanged),this._propTo.listeners().unsubscribe(this,z.prototype.propertyChanged))},inherit(L,z),L.prototype.value=function(){var t=[];return this._control.each(function(){var e=$(this);e.is(":checked")&&t.push(e.attr("value"))}),t.join(this._separator)},L.prototype.setValue=function(t){var e=t.split(this._separator).filter(Boolean);this._control.each(function(){var t=$(this),i=-1!==e.indexOf(t.attr("value"));t.attr("checked",i),t.parents("label").toggleClass("active",i)})},e.PropertyPage=o,e.UppercaseTransformer=n,e.GreateTransformer=r,e.LessTransformer=s,e.ToIntTransformer=a,e.ToFloatTransformer=l,e.ToAsciiTransformer=c,e.ReplaceEmptyTransformer=h,e.SimpleStringBinder=u,e.FloatBinder=d,e.SessionBinder=p,e.BarTimeBinder=_,e.SymbolBinder=f,e.SimpleComboBinder=m,e.StaticContentBinder=g,e.BooleanBinder=v,e.DisabledBinder=y,e.ColorBinding=S,e.SliderBinder=w,e.CheckboxWVBinding=C,e.RangeBinder=P}).call(e,i(52))},function(t,e,i){"use strict";function o(t,e,i){this._defaultName=t;var n;i?n=e:(n=TradingView.clone(defaults(t)),e&&TradingView.merge(n,e)),r.call(this,n),this._defaultName=t,this.listeners().subscribe(this,o.prototype.onPropertyChanged),this._exclusions=[]}function n(t){o._saveDefaults=t}var r=i(52);inherit(o,r),o._saveDefaults=!1,o.prototype.addExclusion=function(t){this._exclusions.push(t)},o.prototype.restoreFactoryDefaults=function(){var t,e={};this._defaultName.startsWith("study_")&&(e=TradingView.clone(TradingView.factoryDefaults("study"))),this._defaultName.startsWith("linetool")&&(e=TradingView.clone(TradingView.factoryDefaults("linetoolvisibilities"))),t=TradingView.clone(TradingView.factoryDefaults(this._defaultName)),this._defaultName.startsWith("study_")&&t.inputs&&delete t.inputs.symbol,"linetoolicon"===this._defaultName&&(t.icon=defaults(this._defaultName).icon),~["linetooltext","linetooltextabsolute","linetoolnote","linetoolnoteabsolute","linetoolcallout","linetoolballoon","linetoolarrowmark","linetoolarrowmarkleft","linetoolarrowmarkup","linetoolarrowmarkright","linetoolarrowmarkdown","linetoolhorzline","linetoolhorzray"].indexOf(this._defaultName)&&delete t.text,this._exclusions.forEach(function(e){delete t[e]}),TradingView.merge(e,t),this.merge(e),this._defaultName.startsWith("study_")||TradingView.saveDefaults(this._defaultName,this.state(this._exclusions)),this.listeners().fire(this)},o.prototype.cleanupFactoryDefaults=function(){var t={};TradingView.saveDefaults(this._defaultName,t),this.listeners().fire(this)},o.prototype.onPropertyChanged=function(){o._saveDefaults&&!this._defaultName.startsWith("study_")&&this.saveDefaults()},o.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions))},
o.prototype.clone=function(t){return new o(this._defaultName,this.state(),t&&t.replaceByState)},e.DefaultProperty=o,e.saveDefaultProperties=n},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(1),r=i(102),s=i(4),a=i(74),l=function(){function t(t,e){this._invalidated=!0,this._points=[],this._floatPoints=[],this._middlePoint=null,this._source=t,this._model=e}return t.prototype.priceToCoordinate=function(t){var e,i,o=this._source.priceScale();return null===o?null:(o.isPercent()&&null!==(e=this._source.ownerSource())&&null!==(i=e.firstValue())&&void 0!==i&&(t=o.priceRange().convertToPercent(t,i)),o.priceToCoordinate(t))},t.prototype.currentPoint=function(){var t=this._model.crossHairSource();return new n.Point(t.x,t.y)},t.prototype.anchorColor=function(){return this._source.isBeingEdited()?"#D61AD3":this._model.isDark()?"#FFFFFF":"#606060"},t.prototype.isHoveredSource=function(){return this._source===this._model.hoveredSource()},t.prototype.isSelectedSource=function(){return this._source===this._model.selectedSource()},t.prototype.isAnchorsRequired=function(){return(this.isHoveredSource()||this.isSelectedSource())&&!this._model.isSnapshot()},t.prototype.update=function(){this._invalidated=!0},t.prototype.addAnchors=function(t){if(this.isAnchorsRequired()){var e=this._points;this._model.lineBeingCreated()===this._source&&(e=e.slice(0,-1)),t.append(this.createLineAnchor({points:e}))}},t.prototype.createLineAnchor=function(t){var e=r.CheckMobile.any();return new a.LineAnchor(o.__assign({},t,{color:this.anchorColor(),backgroundColor:this._model.backgroundColor(),currentPoint:this.currentPoint(),linePointBeingEdited:this._model.linePointBeingEdited(),hittestResult:s.CHANGEPOINT,radius:(e?15:7)+(this.isSelectedSource()?1:0),strokeWidth:(e?3:1)+(this.isSelectedSource()?1:0)}))},t.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a;if(this._points=[],this._floatPoints=[],t=this._source.priceScale(),e=this._model.timeScale(),t&&!t.isEmpty()&&!e.isEmpty()){for(i=this._source.points(),o=0;o<i.length;o++){if(n=i[o],!(r=this._source.pointToScreenPoint(n)))return;s=r[0],s.data=o,a=r[1],a.data=o,this._floatPoints.push(s),this._points.push(a)}2===this._points.length&&(this._middlePoint=this._source.calcMiddlePoint(this._points[0],this._points[1]))}},t.prototype._getSource=function(){return this._source},t.prototype._getPoints=function(){return this._points},t.prototype._getModel=function(){return this._model},t}(),e.LineSourcePaneView=l},function(t,e){(function(t){"use strict";function i(){return C}function o(){return P}function n(t){t=Math.max(f.ERROR,Math.min(f.DEBUG,t)),C=t,u()}function r(t,e){var i,o=0,n=0;for(i=t.length-1;i>=1&&(o+=8*(1+encodeURIComponent(t[i]).length),!(i-1>0&&(n=8*(1+encodeURIComponent(t[i-1]).length),o+n>e)));i--);return t.slice(i)}function s(t,e,i,o,n){var r={id:m,message:e,subSystemId:o,timestamp:+t};m+=1,i.unshift(r),void 0!==n&&i.length>n&&(i.length=n)}function a(t){var e,i=b.reduce(function(t,e){return t.concat(e)},[]);return i.sort(function(t,e){
return t.id-e.id}),"number"==typeof t&&(i=i.slice(-t)),e=i.map(function(t){return new Date(t.timestamp).toISOString()+":"+t.subSystemId+":"+t.message.replace(/"/g,"'")}),r(e,g)}function l(t,e,i,n){var r,a;if((e!==w||n.id!==T)&&(r=new Date,t<=f.NORMAL&&s(r,e,i,n.id,n.maxCount),t<=C&&(!n.highRate||o())&&(!S||n.id.match(S)))){switch(a=r.toISOString()+":"+n.id+":"+e,t){case f.DEBUG:console.debug(a);break;case f.INFO:case f.NORMAL:n.color?console.log("%c"+a,"color: "+n.color):console.log(a);break;case f.WARNING:console.warn(a);break;case f.ERROR:console.error(a)}w=e,T=n.id,x&&clearTimeout(x),x=setTimeout(function(){w=null,T=null,x=NaN},1e3)}}function c(t,e){function i(t){return function(e){return l(t,e,o,n)}}var o,n;return void 0===e&&(e={}),o=[],b.push(o),n=Object.assign(e,{id:t}),{logDebug:i(f.DEBUG),logError:i(f.ERROR),logInfo:i(f.INFO),logNormal:i(f.NORMAL),logWarn:i(f.WARNING)}}function h(){P=!!p&&"true"===localStorage.getItem(y);var t=parseInt(p?localStorage.getItem(v)||"":"");Number.isNaN(t)&&(t=f.WARNING),n(t),L.logNormal("Init with settings - level: "+C+", high-rate: "+P)}function u(){try{p&&(localStorage.setItem(y,P+""),localStorage.setItem(v,C+""))}catch(t){L.logWarn("Cannot save logger state (level: "+C+", high-rate: "+P+") to localStorage: "+t.message)}}var d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L;Object.defineProperty(e,"__esModule",{value:!0}),d="undefined"!=typeof window?window:t,p=!1;try{localStorage.getItem(""),p=!0}catch(t){}_="undefined"!=typeof TradingView?TradingView:{},function(t){t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INFO=3]="INFO",t[t.NORMAL=4]="NORMAL",t[t.DEBUG=5]="DEBUG"}(f=e.LOGLEVEL||(e.LOGLEVEL={})),m=0,g=75497472,v="tv.logger.loglevel",y="tv.logger.logHighRate",b=[],S=null,w=null,T=null,x=NaN,C=f.WARNING,P=!1,e.getLogLevel=i,e.isHighRateEnabled=o,e.setLogLevel=n,e.getLogHistory=a,e.getLogger=c,L=c("logger"),e.loggingOn=d.lon=_.loggingOn=function(t,e){n(f.DEBUG),L.logNormal("Debug logging enabled"),P=!!t,S=e||null,u()},e.loggingNormal=_.loggingNormal=function(){n(f.NORMAL),L.logNormal("Logging set to normal level")},e.loggingOff=d.loff=function(){n(f.INFO),L.logInfo("Debug logging disabled")},h()}).call(e,function(){return this}())},,,function(t,e,i){function o(){this._data=null,this._hittest=new n(n.MOVEPOINT)}var n,r,s,a;i(102),n=i(4),r=i(18).LineEnd,s=i(33).distanceToSegment,a=i(69).extendAndClipLineSegment,o.prototype.setData=function(t){this._data=t},o.prototype.setHitTest=function(t){this._hittest=t},o.prototype.drawArrow=function(t,e,i,o){var n,r,s,a,l,c,h,u,d;e.subtract(t).length()<1||(n=e.subtract(t).normalized(),r=5*o,s=n.scaled(r),a=e.subtract(s),l=n.transposed(),c=3*o,h=l.scaled(c),u=a.add(h),d=a.subtract(h),CanvasEx.drawLine(i,Math.round(u.x),Math.round(u.y),e.x,e.y),CanvasEx.drawLine(i,Math.round(d.x),Math.round(d.y),e.x,e.y))},o.prototype.extendAndClipLineSegment=function(t,e){return a(t,e,this._data.width,this._data.height,this._data.extendleft,this._data.extendright)},o.prototype.drawCircle=function(t,e,i,o){o=$.extend({fillStyle:"#000000"},o),e.save(),
e.fillStyle=o.fillStyle,e.beginPath(),e.arc(t.x,t.y,i,0,2*Math.PI,!1),e.fill(),o.strokeWidth&&(e.lineWidth=o.strokeWidth,e.stroke()),e.restore()},o.prototype.draw=function(t){var e,i,o,n,r;null===this._data||this._data.points&&this._data.points.length<2||this._data.floatPoints&&this._data.floatPoints.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.floatPoints||this._data.points,i=e[0],o=e[1],this._data.overlayLineEndings?n=[$.extend(!0,{},i),$.extend(!0,{},o)]:this.drawEnds(t,[i,o]),r=this.extendAndClipLineSegment(i,o),null!==r&&this._data.linewidth>0&&CanvasEx.drawLine(t,r[0].x,r[0].y,r[1].x,r[1].y),this._data.overlayLineEndings&&this.drawEnds(t,n))},o.prototype.drawEnds=function(t,e){var i=e[0],o=e[1];switch(this._data.leftend){case r.Arrow:this.drawArrow(o,i,t,t.lineWidth);break;case r.Circle:this.drawCircle(i,t,t.lineWidth,this._data.endstyle)}switch(this._data.rightend){case r.Arrow:this.drawArrow(i,o,t,t.lineWidth);break;case r.Circle:this.drawCircle(o,t,t.lineWidth,this._data.endstyle)}},o.prototype.hitTest=function(t){var e,i,o,n,r,a;return null===this._data||this._data.points&&this._data.points.length<2?null:this._data.floatPoints&&this._data.floatPoints.length<2?null:(e=TradingView.isMobile.any()?24:3,i=this._data.floatPoints||this._data.points,o=i[0],n=i[1],r=this.extendAndClipLineSegment(o,n),null!==r&&(a=s(r[0],r[1],t),a.distance<=e)?this._hittest:null)},e.TrendLineRenderer=o},,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Normal=0]="Normal",t[t.Arrow=1]="Arrow",t[t.Circle=2]="Circle"}(e.LineEnd||(e.LineEnd={}))},function(t,e,i){"use strict";function o(t,e,i){var o,n,s,a,c;if(e=e||0,!r(t))return i?l.rgbaToString(l.rgba(l.parseRgb(t),l.normalizeAlphaComponent(1-e/100))):t;if(e<0&&e>100)throw Error("invalid transparency");return o=l.parseRgb(t),n=o[0],s=o[1],a=o[2],c=l.normalizeAlphaComponent(1-e/100),l.rgbaToString([n,s,a,c])}function n(t){return r(t)?t:l.rgbaToString(l.rgba(l.parseRgb(t),l.normalizeAlphaComponent(1)))}function r(t){return 0===t.indexOf("#")}function s(t){var e=l.parseRgb(t).map(function(t){return t/=255,t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return+(.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3)}function a(t,e){return l.rgbaToString(l.blendRgba(l.parseRgba(t),l.parseRgba(e)))}Object.defineProperty(e,"__esModule",{value:!0});var l=i(53);e.generateColor=o,e.resetTransparency=n,e.isHexColor=r,e.getLuminance=s,e.blendColors=a},function(t,e,i){(function(t){"use strict";function e(){this._listeners=[]}i(13).getLogger("Common.Delegate");e.prototype.subscribe=function(t,e,i){var o={object:t,member:e,singleshot:!!i};this._listeners.push(o)},e.prototype.unsubscribe=function(t,e){var i,o;for(i=0;i<this._listeners.length;++i)if(o=this._listeners[i],o.object===t&&o.member.prototype===e.prototype){this._listeners.splice(i,1);break}},e.prototype.unsubscribeAll=function(t){var e,i;for(e=this._listeners.length-1;e>=0;--e)i=this._listeners[e],
i.object===t&&this._listeners.splice(e,1)},e.prototype.destroy=function(){delete this._listeners},e.prototype.fire=function(){var t,e,i=this._listeners.slice();for(t=0;t<i.length;++t)e=i[t],e.member.apply(e.object||null,arguments);for(t=this._listeners.length-1;t>=0;t--)this._listeners[t].singleshot&&this._listeners.splice(t,1)},"undefined"!=typeof window&&(window.Delegate=e),void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(78)(t))},function(t,e){"use strict";function i(t,e){if(!t)throw Error("Assertion failed"+(e?": "+e:""))}function o(t){if(void 0===t)throw Error("Value is undefined");return t}function n(t){if(null===t)throw Error("Value is null");return t}function r(t){return n(o(t))}Object.defineProperty(e,"__esModule",{value:!0}),e.assert=i,e.ensureDefined=o,e.ensureNotNull=n,e.ensure=r},,function(t,e,i){"use strict";function o(t){return t?(window._tv_languages||{})[t]||null:null}function n(){document.body&&document.body.dispatchEvent(new a.CustomEvent("tradingview-i18next-initialized"))}var r,s,a,l,c,h,u,d;i(1167),r=i(503),s=i(377),a=i(699),l={translate:r.translationFunction},window.__tradingviewI18nextInited||(c=window.language||null,h=o(c),c&&h||(console.error("No translation data"),c="en",h=o("en")),c&&h?(u={interpolation:{prefix:"__",suffix:"__"},keySeparator:":::",lng:c,nsSeparator:":::",resources:(d={},d[c]={translation:h},d)},s.init(u,n),l.translate=s.t.bind(s),r.addTranslationFunctionToWindow(l.translate),r.addTranslationFunctionToJQuery(l.translate)):n(),window.__tradingviewI18nextInited=!0),t.exports=l},,,,function(t,e,i){function o(t,e){this._linesMaxWidth=null,this._hittest=e||new n(n.MOVEPOINT),this._data={},this._fontSize=0,this.setData(t)}var n=i(4);o.prototype.setData=function(t){var e,i,o,n=this._data,r=this.fontStyle();this._data=t,this._fontSize=t.fontsize||t.fontSize||30,e=t.text===n.text,i=t.wordWrapWidth===n.wordWrapWidth,o=r===this.fontStyle(),e&&i&&o?(this._data.lines=n.lines,this._lines=n.lines):(this._linesMaxWidth=null,t.lines=this.wordWrap(t.text,t.wordWrapWidth),this._lines=t.lines)},function(){function t(){var t=document.createElement("canvas");t.width=0,t.height=0,e=t.getContext("2d"),t=null}var e;o.prototype.setPoints=function(t,e){this._data.points=t,this._hittest=e||new n(n.MOVEPOINT)},o.prototype._getLinesMaxWidth=function(){var i,o;if(null!==this._linesMaxWidth)return this._linesMaxWidth;if(e||t(),e.textBaseline="alphabetic",e.font=this.fontStyle(),this._data.wordWrapWidth)return this._data.wordWrapWidth;for(i=0,o=0;o<this._lines.length;o++)i=Math.max(i,e.measureText(this._lines[o]).width);return this._linesMaxWidth=i,i},o.prototype.measure=function(){var t=this._fontSize,e=this._getLinesMaxWidth(),i=t*this._lines.length,o=~~(t/6);return this._data.backgroundHorzInflate&&(e+=2*this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(i+=2*this._data.backgroundVertInflate),e=Math.ceil(e+2*o),i=Math.ceil(i+2*o),e%2!=0&&e++,this._data.padding&&(i+=this._data.padding),{width:e,height:i,textBgPadding:o}},o.prototype.wordWrap=function(i,o,n){var r,s,a,l,c,h,u,d,p
;if(e||t(),o=+o,i+="",r=i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/),r[r.length-1]||r.pop(),!isFinite(o)||o<=0)return r;for(e.font=n||this.fontStyle(),s=[],a=0;a<r.length;a++)if(l=r[a],(c=e.measureText(l).width)<=o)s.push(l);else for(h=l.split(/([-\)\]\},.!?:;])|(\s+)/);h.length;){if((u=~~(o/c*(h.length+2)/3))<=0||e.measureText(h.slice(0,3*u-1).join("")).width<=o)for(;e.measureText(h.slice(0,3*(u+1)-1).join("")).width<=o;)u++;else for(;u>0&&e.measureText(h.slice(0,3*--u-1).join("")).width>o;);if(u>0)s.push(h.slice(0,3*u-1).join("")),h.splice(0,3*u);else{if(d=h[0]+(h[1]||""),p=1===p?1:~~(o/e.measureText(d)*d.length),e.measureText(d.substr(0,p)).width<=o)for(;e.measureText(d.substr(0,p+1)).width<=o;)p++;else for(;p>1&&e.measureText(d.substr(0,--p)).width>o;);p<1&&(p=1),s.push(d.substr(0,p)),h[0]=d.substr(p),h[1]=""}if((c=e.measureText(h.join("")).width)<=o){s.push(h.join(""));break}}return s}}(),o.prototype._x=function(){return this._data.points[0].x+this._data.offsetX},o.prototype._y=function(){var t,e=this._fontSize*this._lines.length;switch(this._data.scaleY&&(e*=this._data.scaleY),t=this._data.points[0].y+this._data.offsetY+e,this._data.vertAlign){case"top":break;case"bottom":t-=e;break;case"middle":t-=e/2}return t},o.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p,_,f;if(0!==this._data.points.length){switch(e=this._x(),i=this._y(),o=this._fontSize,this._data.scaleY&&(o*=this._data.scaleY),i-=o*(this._lines.length-1),t.textBaseline="alphabetic",t.font=this.fontStyle(),this._data.horzAlign){case"left":t.textAlign="start";break;case"right":t.textAlign="end";break;case"center":t.textAlign="center"}if(t.translate(e+.5,i+.5),e=0,i=0,o=this._fontSize,this._data.scaleX&&this._data.scaleY&&(n=Math.min(this._data.scaleX,this._data.scaleY),t.scale(n,n)),r=this._getLinesMaxWidth(),s=0,this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){switch(a=e,this._data.horzAlign){case"left":break;case"right":a-=r;break;case"center":a-=r/2}l=o*this._lines.length,c=~~(o/6),this._data.backgroundHorzInflate&&(r+=2*this._data.backgroundHorzInflate,a-=this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(l+=2*this._data.backgroundVertInflate,i+=this._data.backgroundVertInflate),h={x:Math.floor(a-c),y:Math.floor(i-o),w:Math.ceil(r+2*c),h:Math.ceil(l+2*c)},h.w%2!=0&&h.w++,this._data.padding&&(h.h+=this._data.padding,s=this._data.padding),this._data.backgroundVertInflate&&(i+=this._data.backgroundVertInflate),this._data.backgroundRoundRect?(t.roundRect(h.x,h.y,h.w,h.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.fill()),this._data.borderColor&&(u=~~Math.max(o/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=u,t.stroke())):(this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.fillRect(h.x,h.y,h.w,h.h)),this._data.borderColor?(u=~~Math.max(o/12,1),
t.strokeStyle=this._data.borderColor,t.lineWidth=u,t.strokeRect(h.x-u/2,h.y-u/2,h.w+u,h.h+u)):this._data.highlightBorder&&(t.strokeStyle=this._data.color,t.lineWidth=1,t.beginPath(),_=[3,1],t.dashedLineTo(h.x-.5,p=h.y-.5,d=h.x+h.w+.5,p,_),t.dashedLineTo(d,p,d,p=h.y+h.h+.5,_),t.dashedLineTo(d=h.x-.5,p,h.x+h.w+.5,p,_),t.dashedLineTo(d,h.y-.5,d,p,_),t.stroke()))}for(this._data.backgroundVertInflate&&!this._data.backgroundColor&&(i+=2*this._data.backgroundVertInflate),t.fillStyle=this._data.color,f=0;f<this._lines.length;f++)t.fillText(this._lines[f],e,i),i+=o+s}},o.prototype.hitTest=function(t){var e,i,o,n,r,s;return 0===this._data.points.length?null:(e=this._fontSize,this._data.scaleY&&(e*=this._data.scaleY),i=this._getLinesMaxWidth(),this._data.scaleX&&(i*=this._data.scaleX),o=this._data.points[0].x+this._data.offsetX,n=this._data.points[0].y+this._data.offsetY,"bottom"===this._data.vertAlign&&(n-=this._lines.length*this._fontSize),"middle"===this._data.vertAlign&&(n-=this._lines.length*this._fontSize/2),"right"===this._data.horzAlign?o-=i:"center"===this._data.horzAlign&&(o-=i/2),r=this._data.backgroundColor||this._data.borderColor?~~(e/6):0,s=this._data.borderColor?~~Math.max(e/12,1):0,t.x>=o-r-s&&t.x<=o+i+r+s&&t.y>=n-s&&t.y<=n+this._lines.length*this._fontSize+2*r+s?this._hittest:null)},e.TextRenderer=o},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dur=350,e.easingFunc={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.color={black0:"#000",black30:"#FFFFFF",black70:"#4A4A4A",black80:"#535353",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",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"}},,,,,function(t,e){"use strict";function i(t,e,i){
var o=e.subtract(t),n=i.subtract(t),r=n.dotProduct(o)/o.dotProduct(o);return{coeff:r,distance:t.addScaled(o,r).subtract(i).length()}}function o(t,e,o){var n,r,s=i(t,e,o);return 0<=s.coeff&&s.coeff<=1?s:(n=t.subtract(o).length(),r=e.subtract(o).length(),n<r?{coeff:0,distance:n}:{coeff:1,distance:r})}Object.defineProperty(e,"__esModule",{value:!0}),e.distanceToLine=i,e.distanceToSegment=o},function(t,e,i){(function(t){function e(t){return"number"==typeof t&&isFinite(t)}function i(t){return"string"==typeof t?JSON.parse(t):t}function o(t){return null!==t&&void 0!==t&&t.constructor===Function}function n(t){return h(t)&&t.then}function r(t,e){t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),t.prototype.superclass=e}function s(t,e){for(var i in t.prototype)"function"==typeof t.prototype[i]&&t.prototype.hasOwnProperty(i)&&(t.prototype[i]=function(){throw Error(e+"::"+i+" is an interface member declaration and must be overloaded in order to be called")})}function a(t,e,i,o){for(var n in i.prototype)if("function"==typeof i.prototype[n]&&!t.prototype[n])throw Error("Interface implementation assertion failed: "+e+" does not implement "+o+"::"+n+" function")}var l,c=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},h=function(t){return"object"==typeof t&&null!==t},u=function(t){return h(t)&&-1!==(""+t.constructor).indexOf("function Object")};"undefined"!=typeof window?(l=window.TradingView=window.TradingView||{},window.isNumber=e,window.isFunction=o,window.inherit=r,window.isArray=c):l=this.TradingView=this.TradingView||{},l.isNaN=function(t){return!(t<=0||t>0)},l.isAbsent=function(t){return null===t||void 0===t},l.isExistent=function(t){return null!==t&&void 0!==t},Number.isNaN=Number.isNaN||function(t){return t!=t},l.isSameType=function(t,e){return Number.isNaN(t)||Number.isNaN(e)?Number.isNaN(t)===Number.isNaN(e):{}.toString.call(t)==={}.toString.call(e)},l.isInteger=function(t){return"number"==typeof t&&t%1==0},l.parseBool=function(t){return!0===t||"true"===t},l.isBoolean=function(t){return!0===t||!1===t},l.isString=function(t){return null!==t&&void 0!==t&&t.constructor===String},l.isInherited=function(t,e){return t===e||!(!t||!t.prototype)&&(void 0!==t.prototype.superclass&&null!==t.prototype.superclass&&(t.prototype.superclass===e||l.isInherited(t.prototype.superclass,e)))},l.TypeValidator=function(t){this.m_type=t},l.TypeValidator.prototype.check=function(t){return t.constructor===this.m_type||l.isInherited(t.constructor,this.m_type)},l.PredicateValidator=function(t){this.m_predicate=t},l.PredicateValidator.prototype.check=function(t){return this.m_predicate(t)},l.clone=function(t){var e,i,o;if(!t||"object"!=typeof t)return t;e="function"==typeof t.pop?[]:{};for(i in t)t.hasOwnProperty(i)&&(o=t[i],e[i]=o&&"object"==typeof o?l.clone(o):o);return e},l.deepEquals=function(t,e,i){var n,r,s,a,h;if(i||(i=""),t===e)return[!0,i];if(o(t)&&(t=void 0),o(e)&&(e=void 0),void 0===t&&void 0!==e)return[!1,i];if(void 0===e&&void 0!==t)return[!1,i]
;if(null===t&&null!==e)return[!1,i];if(null===e&&null!==t)return[!1,i];if("object"!=typeof t&&"object"!=typeof e)return[t===e,i];if(Array.isArray(t)&&Array.isArray(e)){if(n=t.length,r=e.length,n!==r)return[!1,i];for(s=0;s<n;s++)if(a=l.deepEquals(t[s],e[s],i+"["+s+"]"),!a[0])return a;return[!0,i]}if(c(t)||c(e))return[!1,i];for(h in t)if(a=l.deepEquals(t[h],e[h],i+"["+h+"]"),!a[0])return a;return[!0,i]},l.merge=function(t,e){for(var i in e)"object"==typeof e[i]&&t.hasOwnProperty(i)?l.merge(t[i],e[i]):t[i]=e[i];return t},l.mergeObj=function(t,e){for(var i in e)e[i].constructor===Object&&t.hasOwnProperty(i)?l.mergeObj(t[i],e[i]):t[i]=e[i];return t},l.mergeWithRules=function(t,e,i,o){var n,r;for(n in e)r=o?o+"."+n:n,i&&r in i?t[n]=i[r](t[n],e[n]):"object"==typeof e[n]&&t.hasOwnProperty(n)?l.merge(t[n],e[n],i,r):t[n]=e[n]},l.sortMultipleFunction=function(){var t=[].slice.call(arguments),e=t.length;return function(i,o){var n,r,s,a,l,c,h;for(h=0;h<e&&(c=0,s=t[h],a="string"==typeof s?s:s.name,n=i[a],r=o[a],"function"==typeof s.fn&&(n=s.fn(n),r=s.fn(r)),l=s.reverse?-1:1,n<r&&(c=-1*l),n>r&&(c=1*l),0===c);h++);return c}},void 0!==t&&t&&t.exports&&(t.exports={inherit:r,clone:l.clone,merge:l.merge,isNumber:e,isInteger:l.isInteger,isBoolean:l.isBoolean,isString:l.isString,isObject:h,isHashObject:u,isPromise:n,isNaN:l.isNaN,isAbsent:l.isAbsent,isExistent:l.isExistent,isSameType:l.isSameType,isArray:c,parseBool:l.parseBool,parseJSONorNot:i,deepEquals:l.deepEquals,declareClassAsPureInterface:s,requireFullInterfaceImplementation:a})}).call(e,i(78)(t))},,,function(t,e){"use strict";function i(t){this._invalidationLevel=t||i.UPDATE_CURSOR_ONLY,this._invalidatedPanes={}}i.UPDATE_CURSOR_ONLY=1,i.LIGHT_UPDATE=2,i.FULL_UPDATE=3,i.prototype.invalidatePane=function(t,e){this._invalidatedPanes[t]?this._invalidatedPanes[t]=Math.max(this._invalidatedPanes[t],e):this._invalidatedPanes[t]=e},i.prototype.invalidateAll=function(t){this._invalidationLevel=Math.max(this._invalidationLevel,t)},i.prototype.fullInvalidation=function(){return this._invalidationLevel},i.prototype.invalidateForPane=function(t){return this._invalidatedPanes[t]?Math.max(this._invalidatedPanes[t],this._invalidationLevel):this._invalidationLevel},i.prototype.merge=function(t){this.force=this.force||t.force,this._invalidationLevel=Math.max(this._invalidationLevel,t._invalidationLevel);for(var e in t._invalidatedPanes)this._invalidatedPanes[e]?this._invalidatedPanes[e]=Math.max(this._invalidatedPanes[e],t._invalidatedPanes[e]):this._invalidatedPanes[e]=t._invalidatedPanes[e]},i.prototype.exclude=function(t){this._invalidationLevel<=t&&(this._invalidationLevel=0);for(var e in this._invalidatedPanes)this._invalidatedPanes[e]<=t&&(this._invalidatedPanes[e]=0)},i.prototype.start=function(){this._timeStart=window.performance.now()},i.prototype.end=function(){this._timeEnd=window.performance.now()},t.exports=i},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(41),n=function(){function t(t){this._precision=t}return t.prototype.format=function(t){
return(void 0!==this._precision?t.toFixed(this._precision):t+"").replace(".",o.formatterOptions.decimalSign)},t.prototype.parse=function(t){var e=t.replace(o.formatterOptions.decimalSign,"."),i=parseFloat(e);return this._precision&&(i=+i.toFixed(this._precision)),i},t}(),e.NumericFormatter=n},,function(t,e,i){(function(e){"use strict";function o(t,e,i,o){this._map=$.extend({},this._map,o),e&&(e=this.unpackLevels(e)),r.call(this,t,e,i),this.updateCollectibleProperty()}var n=i(34).isSameType,r=i(11).DefaultProperty,s=i(825);inherit(o,r),o.prototype.state=function(t,i){t=t||[],t.push("__collectibleLines");var o=e.prototype.state.call(this,t);return i?o:this.packLevels(o)},o.prototype.clone=function(){var t=this.state();return this.__collectibleLines&&(t.__collectibleLines=this.__collectibleLines.state()),new o(this._defaultName,t)},o.prototype.merge=function(t){e.prototype.merge.call(this,this.unpackLevels(t)),this.updateCollectibleProperty()},o.prototype._map={prefixes:[""],range:[0,0],names:["coeff","color","visible","linestyle","linewidth"],typecheck:{pack:Object,unpack:Array}},o.prototype._packLvlTpl=function(){return[]},o.prototype._unpackLvlTpl=function(){return{}},o.prototype._packLvlFill=function(t,e,i,o){return o.push(i[e]),o},o.prototype._unpackLvlFill=function(t,e,i,o){return o[e]=i[t],o},o.prototype._iterateLevels=function(t,e){var i,o,r,s,a;for(i in this._map.prefixes)for(o=(this._map.prefixes[i]||"")+"level",r=this._map.range[0];r<=this._map.range[1];r++)if(t[o+r]&&n(t[o+r],e.typecheck())){s=e.tpl();for(a in this._map.names)s=e.fill(a,this._map.names[a],t[o+r],s);t[o+r]=s}return t},o.prototype.packLevels=function(t){return this._iterateLevels(t,{tpl:this._packLvlTpl,fill:this._packLvlFill,typecheck:this._map.typecheck.pack})},o.prototype.unpackLevels=function(t){return this._iterateLevels(t,{tpl:this._unpackLvlTpl,fill:this._unpackLvlFill,typecheck:this._map.typecheck.unpack})},o.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions,!0))},o.prototype.updateCollectibleProperty=function(){var t,e;this.__collectibleLines&&(t=this,e=[],this.__collectibleLines._childs.forEach(function(i){var o,n=t.__collectibleLines[i].value(),r=n.split("."),s=t[r[0]];for(o=1;o<r.length&&s;++o)s=s[r[o]];s&&e.push({property:s.color,defaultValue:s.color.value()})}),this.collectibleColors?this.collectibleColors.reloadProperties(e):this.collectibleColors=new s(e))},t.exports=o}).call(e,i(52))},function(t,e,i){"use strict";function o(t,e){if(!n.isNumber(t))return"n/a";if(!n.isInteger(e))throw new TypeError("invalid length");if(e<0||e>16)throw new TypeError("invalid length");return 0===e?""+t:("0000000000000000"+t).slice(-e)}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(23),n=i(34),r=i(13),s=r.getLogger("Chart.PriceFormatter"),e.customFormatters={dateFormatter:null,timeFormatter:null},e.formatterOptions={decimalSign:".",decimalSignFractional:"'"},a={custom:$.t("Price format is invalid."),fraction:$.t("Fraction part is invalid."),
secondFraction:$.t("Second fraction part is invalid.")},e.numberToStringWithLeadingZero=o,l=function(){function t(t,e,i,o){if(e||(e=1),n.isNumber(t)&&n.isInteger(t)||(t=100),t<0)throw new TypeError("invalid base");if(this._priceScale=t,this._minMove=e,this._minMove2=o,i&&void 0!==o&&o>0&&2!==o&&4!==o&&8!==o)return void s.logDebug("invalid minmove2");this._fractional=i,this.calculateDecimal()}return t.prototype.isFractional=function(){return!!this._fractional},t.prototype.state=function(){return{fractional:this._fractional,fractionalLength:this._fractionalLength,minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale}},t.prototype.calculateDecimal=function(){if(this._fractionalLength=0,this._priceScale>0&&this._minMove>0){var t=this._priceScale;for(this._fractional&&this._minMove2&&(t/=this._minMove2);t>1;)t/=10,this._fractionalLength++}},t.prototype.format=function(t,e,i,o){void 0===o&&(o=!0);var n="";return t<0?(n=!0===e?"−":!1===o?"":"-",t=-t):t&&!0===e&&(n="+"),this._fractional?n+this.formatAsFractional(t,i):n+this.formatAsDecimal(t,i)},t.prototype.formatAsDecimal=function(t,i){var n,r,s,a,l;return i=i||0,n=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,i)*this._priceScale/this._minMove,r=Math.floor(t),s=+(Math.round(t*n)-r*n).toFixed(this._fractionalLength),s>=n&&(s-=n,r+=1),a="",1!==n&&(l=void 0!==this._fractionalLength?this._fractionalLength:NaN,a=e.formatterOptions.decimalSign+o(+s.toFixed(this._fractionalLength)*this._minMove,l+i),a=this._removeEndingZeros(a,i)),""+r+a},t.prototype.formatAsFractional=function(t,i){var n,r,s,a,l,c,h,u,d,p=this._priceScale/this._minMove,_=Math.floor(t),f=i?Math.floor(t*p)-_*p:Math.round(t*p)-_*p;if(f===p&&(f=0,_+=1),n="",i&&(r=(t-_-f/p)*p,r=Math.round(r*Math.pow(10,i)),n=o(r,i),n=this._removeEndingZeros(n,i)),!this._fractionalLength)throw Error("_fractionalLength is not calculated");return s="",this._minMove2?(a=["0","5"],l=["0","2","5","7"],c=["0","1","2","3","4","5","6","7"],h=f%this._minMove2,f=(f-h)/this._minMove2,u=o(f,this._fractionalLength),d=2===this._minMove2?a[h]:8===this._minMove2?c[h]:l[h],s=u+e.formatterOptions.decimalSignFractional+d):s=o(f*this._minMove,this._fractionalLength),""+_+e.formatterOptions.decimalSignFractional+s+n},t.prototype.parse=function(t){return this._fractional?this._minMove2?this._parseAsDoubleFractional(t):this._parseAsSingleFractional(t):this._parseAsDecimal(t)},t.prototype.hasForexAdditionalPrecision=function(){return!this._fractional&&10===this._minMove2},t.prototype._removeEndingZeros=function(t,e){for(var i=0;i<e&&"0"===t[t.length-1];i++)t=t.substr(0,t.length-1);return t},t.prototype._parseAsDecimal=function(t){var i,o,n=RegExp(/^(\-?)[0-9]+$/),r=n.exec(t);return r?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^(-?)[0-9]+\\"+e.formatterOptions.decimalSign+"[0-9]*$"),r=o.exec(t),r?(i=parseFloat(t.replace(e.formatterOptions.decimalSign,".")),{price:i,res:!0,suggest:this.format(i)}):{error:a.custom,res:!1})},t.prototype._patchFractPart=function(t,e){var i={0:0,5:1},o={0:0,2:1,
5:2,7:3};return 2===e?void 0===i[t]?-1:i[t]:4===e?void 0===o[t]?-1:o[t]:t},t.prototype._parseAsSingleFractional=function(t){var i,o,n,r,s,l=RegExp(/^[0-9]+$/),c=l.exec(t);return c?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)$"),c=o.exec(t),c?(n=parseInt(c[1]),r=this._priceScale,(s=this._patchFractPart(parseInt(c[2]),r))>=r||s<0?{error:a.fraction,res:!1}:(i=n+s/r,{price:i,res:!0,suggest:this.format(i)})):{error:a.custom,res:!1})},t.prototype._parseAsDoubleFractional=function(t){var i,o,n,r,s,l,c,h,u=RegExp(/^[0-9]+$/),d=u.exec(t);return d?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)$"),d=o.exec(t),d?(n=parseInt(d[1]),r=void 0!==this._minMove2?this._minMove2:NaN,s=this._priceScale/r,l=this._minMove2,c=this._patchFractPart(parseInt(d[2]),s),h=this._patchFractPart(parseInt(d[3]),l),c>=s||c<0?{error:a.fraction,res:!1}:void 0!==l&&h>=l||h<0?{error:a.secondFraction,res:!1}:(i=void 0!==l?n+c/s+h/(s*l):NaN,{price:i,res:!0,suggest:this.format(i)})):{error:a.custom,res:!1})},t}(),e.PriceFormatter=l},function(t,e,i){"use strict";function o(t,e){var i,o;return null===t?e:null===e?t:(i=Math.min(t.min,e.min),o=Math.max(t.max,e.max),{min:i,max:o})}var n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),n=i(21),r=i(143),s=i(13),a=s.getLogger("Chart.PlotList"),function(t){t[t.NearestLeft=-1]="NearestLeft",t[t.Exact=0]="Exact",t[t.NearestRight=1]="NearestRight"}(l=e.PlotRowSearchMode||(e.PlotRowSearchMode={})),c=30,h=-2e6,u=function(){function t(t){void 0===t&&(t=[]),this._items=[],this._plotNames=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache={},this._rowSearchCache={},this._plotNames=t}return t.prototype.clear=function(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache={},this._rowSearchCache={}},t.prototype.plotNames=function(){return this._plotNames},t.prototype.first=function(){return this.size()>0?this._items[this._start]:null},t.prototype.last=function(){return this.size()>0?this._items[this._end-1]:null},t.prototype.firstIndex=function(){return this.size()>0?this._indexAt(this._start):null},t.prototype.lastIndex=function(){return this.size()>0?this._indexAt(this._end-1):null},t.prototype.size=function(){return this._end-this._start},t.prototype.isEmpty=function(){return 0===this.size()},t.prototype.contains=function(t){return null!==this._search(t)},t.prototype.valueAt=function(t){var e=this.search(t);return null!==e?e.value:null},t.prototype.add=function(t,e){var i,o;return this._shareRead?(a.logDebug("add: readonly collection modification attempt"),!1):(i={index:t,value:e},o=this._search(t),this._rowSearchCache={},null===o?(this._items.splice(this._lowerbound(t),0,i),this._start=0,this._end=this._items.length,!0):(this._items[o]=i,!1))},t.prototype.search=function(t,e){var i,o;return void 0===e&&(e=l.Exact),
this._rowSearchCache[t]&&this._rowSearchCache[t][e]?this._rowSearchCache[t][e]:null===(i=this._search(t,e))?null:(o={index:this._indexAt(i),value:this._valueAt(i)},this._rowSearchCache[t]=this._rowSearchCache[t]||{},this._rowSearchCache[t][e]=o,o)},t.prototype.fold=function(t,e){var i,o,n,r=e;for(i=this._start;i<this._end;++i)o=this._indexAt(i),n=this._valueAt(i),r=t(o,n,r);return r},t.prototype.findFirst=function(t,e){var i,o,n,r=void 0!==e&&Math.min(this._start+e,this._end)||this._end;for(i=this._start;i<r;++i)if(o=this._indexAt(i),n=this._valueAt(i),t(o,n))return{index:o,value:n};return null},t.prototype.findLast=function(t,e){var i,o,n,r=void 0!==e&&Math.max(this._end-e,this._start)||this._start;for(i=this._end-1;i>=r;--i)if(o=this._indexAt(i),n=this._valueAt(i),t(o,n))return{index:o,value:n};return null},t.prototype.each=function(t){var e,i,o;for(e=this._start;e<this._end&&(i=this._indexAt(e),o=this._valueAt(e),!t(i,o));++e);},t.prototype.reduce=function(t,e){var i,o,n,r=e;for(i=this._start;i<this._end;++i)o=this._indexAt(i),n=this._valueAt(i),r=t(r,o,n);return r},t.prototype.range=function(e,i){var o=new t;return o._items=this._items,o._start=this._lowerbound(e),o._end=Math.min(this._lowerbound(i)+1,o._items.length),o._shareRead=!0,o},t.prototype.minMaxOnRange2=function(t,e,i){var r,s,a,l,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x;if(this.isEmpty())return null;for(r=null,s=n.ensureNotNull(this.firstIndex()),a=n.ensureNotNull(this.lastIndex()),l=0,h=i;l<h.length;l++){for(u=h[l],d=t-u.offset,p=e-u.offset,d=Math.max(d,s),p=Math.min(p,a),_=Math.ceil(d/c)*c,f=Math.max(_,Math.floor(p/c)*c),m=this._lowerbound(d),g=this._upperbound(Math.min(p,_,e)),v=this._plotMinMax(m,g,u),r=o(r,v),this._minMaxCache[u.index]||(this._minMaxCache[u.index]={}),y=this._minMaxCache[u.index],b=Math.max(_+1,d);b<f;b+=c)S=Math.floor(b/c),w=y[S],void 0===w&&(T=S*c,x=(S+1)*c-1,w=this.minMaxOnRange(T,x,[u]),y[S]=w),r=o(r,w);m=this._lowerbound(f),g=this._upperbound(p),v=this._plotMinMax(m,g,u),r=o(r,v),void 0!==u.baseValue&&null!==r&&(r.min=r.min?Math.min(u.baseValue,r.min):r.min,r.max=r.min?Math.max(u.baseValue,r.max):r.max)}return r},t.prototype.minMaxOnRange=function(t,e,i){var n,r,s,a,l,c,h,u=this._lowerbound(t);Math.min(this._lowerbound(e)+1,this._items.length);for(this._items[this._end-1]&&this._items[this._end-1].index>e&&u,n=null,r=0,s=i;r<s.length;r++)a=s[r],l=this._lowerbound(t-a.offset),c=Math.min(this._lowerbound(e-a.offset)+1,this._items.length),this._items[this._end-1]&&this._items[c-1].index>e-a.offset&&(c=l),h=this._plotMinMax(l,c,a),n=o(n,h),void 0!==a.baseValue&&null!==n&&(n.min=n.min?Math.min(a.baseValue,n.min):n.min,n.max=n.max?Math.max(a.baseValue,n.max):n.max);return n},t.prototype.merge=function(t){var e,i,o,n;if(this._shareRead)return a.logDebug("merge: readonly collection modification attempt"),[];for(e=[],e.earliestRow=null,i=0,o=t;i<o.length;i++)n=o[i],this._invalidateCacheForRow(n),(null===e.earliestRow||e.earliestRow.index>n.index)&&(e.earliestRow=n),this.add(n.index,n.value)?e.push({insert:n}):e.push({update:n});return e},
t.prototype.addTail=function(t,e){var i,o,n,r;for(void 0===e&&(e=!1),i=0,e&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=t[0].value),o=i;o<t.length;++o){if(n=t[o],null===(r=this.lastIndex())){a.logError("Can't add tail to the empty plotlist");break}this.add(r+1,n.value)}this._rowSearchCache={}},t.prototype.move=function(t){var e,i,o,n,r,s,l,c;if(this._shareRead)return a.logDebug("move: readonly collection modification attempt"),[];for(e=[],e.earliestRow=null,i=0,o=t;i<o.length;i++)n=o[i],null!==(r=this._search(n.old))&&(s=this._items[r].value,l={index:n.old,value:s},this._items.splice(r,1),this._end=this._items.length,e.push({remove:l}),this._invalidateCacheForRow(l),n.new!==h&&(c={index:n.new,value:s},(null===e.earliestRow||e.earliestRow.index>c.index)&&(e.earliestRow=c),this.add(c.index,c.value)?e.push({insert:c}):e.push({update:c}),this._invalidateCacheForRow(c)));return this._rowSearchCache={},e},t.prototype.remove=function(t){var e,i,o,n,r,s;if(this._shareRead)return a.logDebug("remove: readonly collection modification attempt"),[];if(null===(e=this._search(t,l.NearestRight)))return[];if(i=[],o=this._items.splice(e),o.length>0)for(i.earliestRow=o[0],n=0,r=o;n<r.length;n++)s=r[n],i.push({remove:s});return this._end=this._items.length,this._minMaxCache={},this._rowSearchCache={},i},t.prototype.state=function(){return{columns:this._plotNames,start:this._start,end:this._end,data:this._items,shareread:this._shareRead}},t.prototype.restoreState=function(t){if(!t)return void this.clear();this._plotNames=t.columns,this._start=t.start,this._end=t.end,this._shareRead=t.shareread,this._items=t.data,this._minMaxCache={},this._rowSearchCache={}},t.prototype._indexAt=function(t){return this._items[t].index},t.prototype._valueAt=function(t){return this._items[t].value},t.prototype._length=function(){return this._items.length},t.prototype._search=function(t,e){var i,o=this._bsearch(t);return null===o&&e?e<0?(i=this._lowerbound(t),i>this._start&&(i-=1),i!==this._end&&this._indexAt(i)<t?i:null):(i=this._upperbound(t),i!==this._end&&t<this._indexAt(i)?i:null):o},t.prototype._bsearch=function(t){var e=this._lowerbound(t);return e===this._end||t<this._items[e].index?null:e},t.prototype._lowerbound=function(t){return r.lowerbound(this._items,t,function(t,e){return t.index<e},this._start,this._end)},t.prototype._upperbound=function(t){return r.upperbound(this._items,t,function(t,e){return e.index>t},this._start,this._end)},t.prototype._plotMinMax=function(t,e,i){var o,n,r,s=null;for(o=t;o<e;o++)n=this._items[o].value,void 0===(r=n[i.index])||null===r||Number.isNaN(r)||(null===s?s={min:r,max:r}:(r<s.min&&(s.min=r),r>s.max&&(s.max=r)));return s},t.prototype._invalidateCacheForRow=function(t){var e,i=Math.floor(t.index/c);for(e=0;e<this._plotNames.length;e++)this._minMaxCache[e]&&delete this._minMaxCache[e][i]},t}(),e.PlotList=u,e.mergeMinMax=o},function(t,e,i){"use strict";function o(t,e,i){h[t].unsubscribe(i,e)}function n(t,e,i){r(t,e,i)}function r(t,e,i,o){if(h.hasOwnProperty(t)||(h[t]=new c),
d[t])return void e.call(i);h[t].subscribe(i,e,o)}function s(t){u.push(t)}function a(t){var e,i,o=[];for(e=1;e<arguments.length;e++)o[e-1]=arguments[e];i=[t].concat(o),u.forEach(function(t){t.apply(null,i)}),h.hasOwnProperty(t)&&h[t].fire.apply(h[t],o)}function l(t){d[t]&&console.warn("Something went wrong: emitOnce called multiple times with same event ("+t+")"),d[t]=!0,a.apply(null,arguments)}var c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),c=i(20),h={},u=[],d={},e.unsubscribe=o,e.on=n,e.subscribe=r,e.subscribeToAll=s,e.emit=a,e.emitOnce=l},function(t,e,i){(function(e,o,n){"use strict";function r(t){return"cursor"===t||"arrow"===t||"dot"===t}function s(t){!t&&u&&u.stayInDrawingMode.value()||this.tool.setValue(this.cursorTool.value())}function a(t,e){return function(e){t.inFire||(t.inFire=!0,t.fire(e),t.inFire=!1)}}function l(){K||(g.setValue(TVSettings.getValue("chart.cursorPreference","cursor")),g.subscribe(function(t){r(t)&&v.setValue(t)},{callWithLast:!0}),v.subscribe(function(t){t&&TVSettings.setValue("chart.cursorPreference",t)}),u=new c("drawings"),d=new n,p=new n,_=new n,f=new n,d.setValue(!1),p.setValue(!1),_.setValue(!1),f.setValue(!1),g.subscribe(function(){h.emit("onSelectedLineToolChanged")}),K=!0)}var c=i(11).DefaultProperty,h=i(43),u=null,d=null,p=null,_=null,f=null,m=new e,g=new e,v=new e,y=new o,b=new o,S=new o,w=new o,T=new o,x=new o,C=new o,P=new o,L=new o,I=new o,k=new o,A=new o,M=new o,E=new o,V=new o,D=a(y),O=a(b),B=a(S),R=a(w),z=a(T),F=a(x),N=a(C),W=a(P),$=a(L),H=a(I),U=a(k),j=a(A),q=a(M),G=a(E),Y=a(V),K=!1;t.exports={tool:g,cursorTool:v,toolIsCursor:r,resetToCursor:s,init:l,createdLineTool:y,continuedLineTool:b,cancelledLineTool:S,createLineTool:D,continueLineTool:O,cancelLineTool:B,startedMovingLineTool:w,movedLineTool:T,finishedMovingLineTool:x,startMovingLineTool:R,moveLineTool:z,finishMovingLineTool:F,startedChangingLineTool:C,changedLineTool:P,finishedChangingLineTool:L,startChangingLineTool:N,changeLineTool:W,finishChangingLineTool:$,removedLineTool:I,removeLineTool:H,restoredLineTool:E,restoreLineTool:G,restoredLineToolState:V,restoreLineToolState:Y,finishedLineTool:k,finishLineTool:U,changedLineStyle:A,changeLineStyle:j,copiedLineTool:M,copyLineTool:q,properties:function(){return u},hideAllDrawings:function(){return d},hideMarksOnBars:function(){return _},lockDrawings:function(){return p},drawOnAllCharts:function(){return u.drawOnAllCharts},lockTimeAxis:function(){return f},lockTimeAxisTime:m}}).call(e,i(51),i(20),i(52))},function(t,e,i){(function(t,e){"use strict";function o(t){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}}),TradingView.merge(this,t);var e=t.fullId||t.id;TradingView.merge(this,o.parseIdString(e)),this.name=this.id}var n=i(21).assert,r=i(13).getLogger("Chart.Study.MetaInfo"),s=i(316).applyOverridesToStudyDefaults,a=null;o.VERSION_STUDY_ARG_SOURCE=41,o.METAINFO_FORMAT_VERSION_SOS_V2=42,o.VERSION_PINE_PROTECT_TV_4164=43,o.CURRENT_METAINFO_FORMAT_VERSION=45,o.CHILD_STUDY_ALLOWED_PLOT_TYPES=["line"],
o.CHILD_STUDY_EXCLUDE_IDS=["CorrelationCoefficient@tv-basicstudies"],o.CHILD_STUDY_PARENT_EXCLUDE_IDS=[],o.FilledArea={},o.FilledArea.TYPE_PLOTS="plot_plot",o.FilledArea.TYPE_HLINES="hline_hline",o.versionOf=function(t){var e="_metainfoVersion"in t&&isNumber(t._metainfoVersion)?t._metainfoVersion:0;return e<0&&r.logError("Metainfo format version cannot be negative: "+e),e>o.CURRENT_METAINFO_FORMAT_VERSION&&r.logWarn("Client doesn't support this version of metainfo format: "+e),e},o.parseIdString=function(t){var e,i,o,n,r={};if(-1===t.indexOf("@"))r.shortId=t,r.packageId="tv-basicstudies",r.id=t+"@"+r.packageId,r.version=1;else if(e=t.split("@"),r.shortId=e[0],i=e[1].split("-"),3===i.length)r.packageId=i.slice(0,2).join("-"),r.id=r.shortId+"@"+r.packageId,r.version=i[2];else if(1===i.length&&"decisionbar"===i[0])r.packageId="les-"+i[0],r.id=r.shortId+"@"+r.packageId,r.version=1;else{if(1!==i.length)throw Error("unexpected study id:"+t);r.packageId="tv-"+i[0],r.id=r.shortId+"@"+r.packageId,r.version=1}return r.fullId=r.id+"-"+r.version,"tv-scripting"===r.packageId?(o=r.shortId,0===o.indexOf("Script$")||0===o.indexOf("StrategyScript$")?(n=o.indexOf("_"),r.productId=n>=0?o.substring(0,n):r.packageId):r.productId=r.packageId):r.productId=r.packageId,r},o.getPackageName=function(t){return(/^[^@]+@([^-]+-[^-]+)/.exec(t||"")||[0,"tv-basicstudies"])[1]},o.cutFullId=function(t){return t.replace(/(@[^-]+-[^-]+).*$/,"$1")},o.cutDollarHash=function(t){var e,i,o=t.indexOf("$"),n=t.indexOf("@");return-1===o?t:(e=t.substr(0,o),i=n>=0?t.substr(n):"",e+i)},o.cutScriptIdPart=function(t){var e=t.indexOf("$"),i=t.indexOf("@");return e<0&&i>=0?"":t.substring(Math.max(e+1,0),i>=0?i:t.length)},o.hasUserIdSuffix=function(t){return/^USER;[\d\w]+;\d+$/.test(t)},o.getSourceIdByInputs=function(t,e){var i,n,r;if(!Array.isArray(t)||!e)return null;for(i=0;i<t.length;++i)if(n=t[i],o.isSourceInput(n)&&"string"==typeof e[n.id])return r=e[n.id],~r.indexOf("$")&&(r=r.split("$")[0]),r;return null},o.getSourceInputIds=function(t){var e,i,n=[],r=t.inputs;for(e=0;e<r.length;++e)i=r[e],o.isSourceInput(i)&&n.push(i.id);return n},o.setChildStudyMetaInfoPropertiesSourceId=function(e,i,n){var r,s,a,l;for(r=0;r<e.inputs.length;++r)s=e.inputs[r],o.isSourceInput(s)&&n instanceof t&&n.inputs&&n.inputs[s.id]&&(a=n.inputs[s.id].value(),a.indexOf("$")>0&&(l=a.replace(/^[^\$]+/,i),n.inputs[s.id].setValue(l)))},o.patchChildStudyMetaInfoState=function(t){function e(t){if("object"==typeof t)for(var i in t)"string"==typeof t[i]&&/^[^\$]+\$\d+$/.test(t[i])?t[i]=t[i].replace(/^[^\$]+/,"{pid}"):e(t[i])}t.state&&e(t.state.inputs),t.state.isChildStudy=!0},o.prototype.parseValue=function(t,e){return"bool"===t?TradingView.parseBool(e):e},o.prototype.defaultInputs=function(){var t,e=[];for(t=0;t<this.inputs.length;t++)e.push(this.inputs[t].defval);return e},o.prototype.state=function(t){var e,i={};for(e in this)this.hasOwnProperty(e)&&(i[e]=this[e],!0!==t&&"id"===e&&(i[e]+="-"+this.version));return i},o.findStudyMetaInfoByDescription=function(t,e){if(t){
for(var i=0;i<t.length;++i)if(t[i].description.toLowerCase()===e.toLowerCase())return t[i];throw Error("unexpected study id:"+e)}throw Error("There is no studies metainfo")},o._findStudyMetaInfo=function(t,e){for(var i=0;i<t.length;i+=1)if(t[i].id===e)return[i,t[i]];return[]},o.findStudyMetaInfo=function(t,e){if(!t)throw new ReferenceError("There is no studies metainfo");var i=o._findStudyMetaInfo(t,e)[1];if(!i)throw new ReferenceError("unexpected study id:"+e);return i},o.isParentSourceId=function(t){return"string"==typeof t&&/^[^\$]+\$\d+$/.test(t)},o.isSourceInput=function(t){return t.id&&(("source"===t.id||"src"===t.id)&&("text"===t.type||"source"===t.type)||"source"===t.type)},o.getChildSourceInputTitles=function(t,e,i){var n,r,s,a,l={};if(e.plots&&e.plots.length&&t.options&&t.options.length)for(n=0;n<t.options.length;++n)r=t.options[n],s=r&&+r.split("$")[1],(a=isFinite(s)&&e.plots[s])&&~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(a.type)&&(l[r]=e.styles&&e.styles[a.id]&&e.styles[a.id].title||a.id,i&&(l[r]=i+": "+l[r]));return l},o.removeStudyMetaInfo=function(t,e,i){var n=function(i){return void 0!==(i=void 0!==i?i:o._findStudyMetaInfo(t,e)[0])&&(t.splice(i,1),defaults.remove("study_"+e),!0)};if(t)return n(i);throw Error("There are no studies metainfo")},o.addOrReplaceStudyMetaInfo=function(t,e){var i,n,s,a=new o(e),l=o._findStudyMetaInfo(t,a.id),c=l[0],h=l[1];if(h){if(i=h.pine&&h.pine.version,!(null==(n=a.pine&&a.pine.version)||null==i||n>=i))return a;o.removeStudyMetaInfo(t,a.id,c)}else o.removeStudyMetaInfo(t,a.id,c)&&r.logDebug("Study with id="+a.id+" already exists in the model!");return t.push(a),a.defaults&&(s=TradingView.clone(a.defaults),s.precision="default",defaults.create("study_"+a.fullId,s)),a},o.overrideDefaults=function(t){null!==a&&0!==t.length&&s(a,t,function(t){return TradingView.defaultProperties["study_"+t]||null})},o.setDefaultsOverrides=function(t){a=t},o.createMetaInfoStub=function(t,e){var i,o,r;return n(TradingView.isExistent(t.scriptIdPart),"scriptIdPart is missing, study: "+JSON.stringify(t)),i=t.extra&&"strategy"===t.extra.kind||!0===t.isTVScriptStrategy,o=TVScript.createScriptStudyId(t.scriptIdPart,e,i),r={isTVScriptStubToCompile:!0,id:o,scriptIdPart:t.scriptIdPart,description:t.scriptName,TVScriptSourceCode:t.scriptSource,is_hidden_study:t.extra&&t.extra.is_hidden_study,extra:t.extra,version:e},r.pine={},r.pine.version=TradingView.isExistent(t.version)?t.version:-1,r.pine.access=TVScript.Access.MAP_ID_TO_NAME[t.access],r.pine.userHaveAccess=t.userHaveAccess,!0===i&&(r.isTVScriptStrategy=!0),r},o.isScriptStrategy=function(t){if(t.extra&&t.extra.kind)return t.extra.kind===TVScript.Kinds.STRATEGY;if(!0===t.isTVScriptStrategy)return!0;var e=t.TVScriptSourceCode||t.scriptSource;return!!e&&TVScript.isStrategy(e)},o.replaceWithFullStudyMetaInfoAsync=function(t,e){var i=$.Deferred();return e.isTVScriptStubToCompile||i.resolve(e),i.promise()},o.getOrderedInputIds=function(t){var e,i,o=[],n=t.inputs;for(e=0;e<n.length;++e)i=n[e],o.push(i.id);return o},o.canBeChild=function(t){var e,i,n
;if(t&&"string"==typeof t)return!0;if(!t||t.extra&&!o.isAllowedSourceInputsCount(t.extra.sourceInputsCount)||!0===t.canNotBeChild||!1===t.canBeChild||~o.CHILD_STUDY_EXCLUDE_IDS.indexOf(t.id)||t.isTVScriptStrategy||t.TVScriptSourceCode&&TVScript.isStrategy(t.TVScriptSourceCode))return!1;if(t.isTVScriptStubToCompile)return!0;for(e=t.inputs,i=0,n=0;n<e.length;++n)o.isSourceInput(e[n])&&++i;return o.isAllowedSourceInputsCount(i)},o.isAllowedSourceInputsCount=function(t){return 1===t},o.canHaveChildren=function(t){if(t){if(t.isTVScriptStrategy||t.TVScriptSourceCode&&TVScript.isStrategy(t.TVScriptSourceCode))return!1;if(t.id&&!~o.CHILD_STUDY_PARENT_EXCLUDE_IDS.indexOf(t.id)&&Array.isArray(t.plots))for(var e=0;e<t.plots.length;++e)if(~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(t.plots[e].type))return!0}return!1},TradingView.StudyMetaInfo=o,void 0!==e&&e&&e.exports&&(e.exports=o)}).call(e,i(52),i(78)(t))},,function(t,e,i){"use strict";function o(t){var e=s.parseRgb(t),i=e.map(function(t){return t>50?t-50:0});return s.rgbToString(i)}function n(t){var e,i,o,n=[];for(e=0,i=t;e<i.length;e++)o=i[e],null!==s.tryParseRgb(o)&&n.push(o);return n}function r(t,e){void 0===e&&(e={});var i=$('<span class="tvcolorpicker-container">');return null!==t&&i.appendTo(t),void 0!==e.addClass&&i.addClass(e.addClass),$('<div class="tvcolorpicker-transparency">').appendTo(i),$('<input class="colorpicker-widget">').tvcolorpicker({customColors:n(a.getJSON("pickerCustomColors",[])),direction:e.direction,hideTransparency:!!e.hideTransparency}).on("change",function(){$(this).css("border-color",o($(this).val()||l))}).bind("customcolorchange",function(t,e){a.setJSON("pickerCustomColors",e)}).appendTo(i),i}var s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(22),i(434),s=i(53),a=i(63),l="#727272",e.addColorPicker=r},function(t,e,i){"use strict";function o(t,e,i){var o,s,c,h,u,d;if(r.enabled("charting_library_base")){for(e=e||t||i||"",o="",s=0;s<l.length;s++)if((c=e.match(l[s]))&&3===c.length){e=c[1],o=c[2];break}return void n.emit(e.toLowerCase().replace(" ","_"),{category:t,label:i,value:o})}h=(t?t+":":"")+e,i&&(h+=" "+i),a.logNormal(h),u=window._gaq,window._UNIT_TESTS||void 0===u||(d=["_trackEvent",t,e],void 0!==i&&d.push(i),u.push(d))}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(43),r=i(7),s=i(13),a=s.getLogger("Common.TrackEvent"),l=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/],e.trackEvent=o,window.TradingView=window.TradingView||{},window.TradingView.trackEvent=o},function(t,e,i){"use strict";function o(t,e){var i=e.edge;return i.A*t.x+i.B*t.y+i.C>0===e.isPositive}function n(t,e,i,o){var n=e.add(i).scaled(.5),r=n.add(o).scaled(.5),s=l.intersectLineSegments(e,i,r,t);return null===s&&(null===(s=l.intersectLineSegments(i,o,r,t))&&null===(s=l.intersectLineSegments(o,e,r,t)))}function r(t,e,i){return t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y}function s(t,e){var i,o,n,r=e.length-1,s=!1,a=t.x,l=t.y;for(i=0;i<e.length;i++)o=e[i],n=e[r],
(o.y<l&&n.y>=l||n.y<l&&o.y>=l)&&o.x+(l-o.y)/(n.y-o.y)*(n.x-o.x)<a&&(s=!s),r=i;return s}function a(t,e,i){return(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)<=i*i}Object.defineProperty(e,"__esModule",{value:!0});var l=i(98);e.pointInHalfplane=o,e.pointInTriangle=n,e.pointInRectangle=r,e.pointInPolygon=s,e.pointInCircle=a},,function(t,e,i){(function(t){"use strict";function e(){}function i(t){if(!(this instanceof i))return new i(t);arguments.length>0&&(this._value=t),this._listeners=[]}i.prototype.value=function(){return this._owner?this._owner._value:this._value},i.prototype.setValue=function(t,e){var i,o,n,r=this._owner?this._owner:this;if("function"==typeof r.hook&&(t=r.hook(t)),r.writeLock)return r._value;if(!e&&r._value===t&&r.hasOwnProperty("_value"))return t;for(r._value=t,i=r._listeners.slice(),o=0,n=0;n<i.length;n++)i[n].once&&(r._listeners.splice(n-o,1),o++),i[n].cb(t);return t},i.prototype.deleteValue=function(){var t,e,i,o=this._owner?this._owner:this;if(o.hasOwnProperty("_value")){if(o.writeLock)return o._value;for(delete o._value,t=o._listeners.slice(),e=0,i=0;i<t.length;i++)t[i].once&&(o._listeners.splice(i-e,1),e++),t[i].cb()}},i.prototype.subscribe=function(t,e){var i,o,n;if("function"!=typeof t)throw new TypeError("callback must be a function");i=!!e&&!!e.once,o=!!e&&!!e.callWithLast,n=this._owner?this._owner:this,o&&n.hasOwnProperty("_value")&&(t(n._value),i)||n._listeners.push({cb:t,owner:this,once:!!e&&!!e.once})},i.prototype.unsubscribe=function(t){var e,i,o=this._owner?this._owner:this;for(void 0===t&&(t=null),e=o._listeners,i=e.length;i--;)e[i].owner!==this&&o!==this||e[i].cb!==t&&null!==t||e.splice(i,1)},i.prototype.listeners=function(){return(this._owner?this._owner:this)._listeners},i.prototype.readonly=function(){if(this._readonlyInstance)return this._readonlyInstance;var t=this._readonlyInstance=new e;return t.subscribe=this.subscribe.bind(this),t.unsubscribe=this.unsubscribe.bind(this),t.value=this.value.bind(this),t.when=this.when.bind(this),t.spawn=function(){return this.spawn().readonly()}.bind(this),t},i.prototype.spawn=function(){var t=new i;return delete t._listeners,t._owner=this._owner||this,t.destroy=function(){this.unsubscribe(),delete this._owner},t},i.prototype.when=function(t){var e,i=this;if(this.value())return void t();e=function(o){o&&(i.unsubscribe(e),t())},i.subscribe(e)},i.prototype.opposite=function(){var t,e;return this._opposite||(t=this,e=new i(!this.value()),this.subscribe(function(t){e.setValue(!t)}),e.subscribe(function(e){t.setValue(!e)}),this._opposite=e),this._opposite},"undefined"!=typeof window&&(window.WatchedValue=i),void 0!==t&&t&&t.exports&&(t.exports=i)}).call(e,i(78)(t))},function(t,e,i){(function(e){"use strict";function i(t){if(this._listeners=new e,this._childs=[],void 0!==t&&null!==t)if(this.isPrimitiveType(t))this._value=t;else for(var i in t)this.addProperty(i,t[i])}i.prototype.merge=function(t){var e,i
;if(null!=t)if(this.isPrimitiveType(t))this._value=t;else if(Array.isArray(t))for(e=0;e<t.length;e++)this[e]?this[e].merge(t[e]):this.addProperty(e,t[e]);else for(i in t)this[i]?this[i].merge(t[i]):this.addProperty(i,t[i])},i.prototype.state=function(t){var e,i,o,n,r,s=this._value;for(void 0===s&&(s={}),e=0;e<this._childs.length;e++)if(i=this._childs[e],!t||-1===t.indexOf(i))if(t){for(o=[],n=0;n<t.length;n++)r=t[n],r.startsWith(i+".")&&o.push(r.substr(i.length+1));s[i]=this[i].state(o)}else s[i]=this[i].state();return s},i.prototype.clone=function(t){return new i(this.state())},i.prototype.isPrimitiveType=function(t){return!!isNumber(t)||(!!new TradingView.TypeValidator(String).check(t)||TradingView.isBoolean(t))},i.prototype.value=function(){return this._value},i.prototype.listeners=function(){return this._listeners},i.prototype.childCount=function(){return this._childs.length},i.prototype.setValue=function(t,e){(this._value!==t||e)&&(this._value=t,this._listeners.fire(this))},i.prototype.setValueSilently=function(t){this._value=t},i.prototype.addProperty=function(t,e){var o=new i(e);this[t]=o,this._childs.push(t),o.listeners().subscribe(this,i.prototype.childChanged)},i.prototype.removeProperty=function(t){this[t].listeners().unsubscribe(this,i.prototype.childChanged),delete this[t],this._childs=this._childs.filter(function(e){return e!==t})},i.prototype.addChild=function(t,e){this[t]=e,-1===$.inArray(t,this._childs)&&this._childs.push(t),e.listeners().subscribe(this,i.prototype.childChanged)},i.prototype.childChanged=function(t,e){this.listeners().fire(this)},i.prototype.subscribe=function(t,e){this.listeners().subscribe(t,e)},i.prototype.unsubscribe=function(t,e){this.listeners().unsubscribe(t,e)},i.prototype.unsubscribeAll=function(t){this.listeners().unsubscribeAll(t)},t.exports=i}).call(e,i(20))},,,,function(t,e,i){"use strict";function o(t,e){return t<=e}function n(t,e){return t>=e}function r(t,e,i){return Math.min(Math.max(t,e),i)}function s(t){return t<0?-1:t>0?1:0}function a(t){if(t<0)return f.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(var e=t;e>1;e/=10)if(e%10!=0)return!1;return!0}function l(t,e,i){return e-t<=i}function c(t,e,i){return Math.abs(t-e)<i}function h(t){return t<=0?(f.logDebug("MathEx.log10: argument less or equal zero"),NaN):Math.log(t)/Math.log(10)}function u(t,e){return t<e?-1:t>e?1:0}function d(t,e){var i,o;if(void 0===e&&(e=u),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)<0&&(i=t[o]);return i}function p(t,e){var i,o;if(void 0===e&&(e=u),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)>0&&(i=t[o]);return i}var _,f;Object.defineProperty(e,"__esModule",{value:!0}),_=i(13),f=_.getLogger("Common.MathEx"),e.lessThan=o,e.greaterThan=n,e.clamp=r,e.sign=s,e.isBaseDecimal=a,e.greaterOrEqual=l,e.equal=c,e.log10=h,e.defComparator=u,e.min=d,e.max=p},function(t,e){"use strict";var i,o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),i={},o=RegExp("^([0-9]*)$"),n=RegExp("^(\\d*)([DWMS])$"),r=function(){
function t(e,i){if(void 0===i&&e!==t.INVALID)return t.parse(e);var o=e;o!==t.SECONDS&&o!==t.MINUTES&&o!==t.HOURS&&o!==t.DAYS&&o!==t.WEEKS&&o!==t.MONTHS&&o!==t.INVALID&&(o="invalid"),this._kind=o,this._multiplier=i}return t.prototype.kind=function(){return this._kind},t.prototype.multiplier=function(){return this._multiplier},t.prototype.isValid=function(){return this.kind()!==t.INVALID},t.prototype.isDWM=function(){return this.isValid()&&!this.isIntraday()},t.prototype.isIntraday=function(){return-1!==[t.SECONDS,t.MINUTES,t.HOURS].indexOf(this.kind())},t.prototype.letter=function(){return this.isValid()&&this.kind()!==t.MINUTES?this.kind()[0].toUpperCase():""},t.prototype.value=function(){return this.isValid()?this.kind()===t.MINUTES?this.multiplier()+"":this.multiplier()+this.letter():""},t.prototype.isEqualTo=function(e){if(!(e instanceof t))throw Error("Argument is not an Interval");return this.kind()!==t.INVALID&&e.kind()!==t.INVALID&&(this.kind()===e.kind()&&this.multiplier()===e.multiplier())},t.prototype.inMilliseconds=function(){if(!this.isValid()||this.kind()===t.MONTHS)return NaN;var e=this.multiplier();return void 0===e?NaN:i[this.kind()]*e},t.isEqual=function(e,i){return t.parse(e).isEqualTo(t.parse(i))},t.parse=function(e){var i,r;return e=(e+"").toUpperCase().split(",")[0],i={D:t.DAYS,W:t.WEEKS,M:t.MONTHS,H:t.HOURS,S:t.SECONDS},(r=o.exec(e))?new t(t.MINUTES,parseInt(e,10)):(r=n.exec(e),r?new t(i[r[2]],parseInt(r[1],10)?parseInt(r[1],10):1):new t(t.INVALID))},t.isDWM=function(e){return t.parse(e).isDWM()},t.kind=function(e){return t.parse(e).kind()},t.isValid=function(e){return t.parse(e).isValid()},t.SECONDS="seconds",t.MINUTES="minutes",t.HOURS="hours",t.DAYS="days",t.WEEKS="weeks",t.MONTHS="months",t.INVALID="invalid",t}(),e.Interval=r,i[r.SECONDS]=1e3,i[r.MINUTES]=60*i[r.SECONDS],i[r.HOURS]=60*i[r.MINUTES],i[r.DAYS]=24*i[r.HOURS],i[r.WEEKS]=7*i[r.DAYS]},,,,function(t,e,i){(function(e,o,n,r){"use strict";function s(t,e,i,o){this._study=t,this.m_series=e,this.m_model=i,this._plotName=o,this._visible=!1,this._points=[new Z(0,0)],this._invalidated=!0,this._lineRenderer=new x}function a(){return{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,plottype:at.PlotType.Line,histogramBase:0,transparency:50,trackPrice:!1,joinPoints:!1}}function l(t,e,i,o){var n,r;return o.isTVScriptStrategy?n="StudyStrategy":(r="study_"+(o.classId||o.shortId),n=r in TradingView?r:"Study"),new TradingView[n](t,e,i,o)}function c(t,e,i,o,n){return h(t,e,i,o,"study_"+t.id,n)}function h(t,e,i,o,n,r){var s,a,l,c,h,u=p(t,e,i,o);for(r instanceof v&&(s=st.getSourceInputIds(t),s.length>0&&(a=s[0],u.inputs[a]="{pid}$0")),l=new J(n,u,!0),l.addExclusion("visible"),l.addExclusion("precision"),l.addExclusion("minTick"),c=0;c<t.inputs.length;++c)h=t.inputs[c],h.isHidden&&(l.addExclusion("inputs."+c),l.addExclusion("inputs."+h.id));return l}function u(t,e,i,o,n,r){return d(t,e,i,o,n,"study_"+t.id,r)}function d(t,e,i,o,n,r,s){var a,l,c,h=_(t,e,i,o,n),u=new J(r,h,!0);for(u.addExclusion("visible"),
u.addExclusion("precision"),u.addExclusion("minTick"),a=e||t,l=0;l<a.inputs.length;++l)c=a.inputs[l],c.isHidden&&(u.addExclusion("inputs."+l),u.addExclusion("inputs."+c.id));return u}function p(t,o,n,r){var s,a,l,c,h,u,d,p=i(119);if(st.versionOf(t)<1)throw Error("This function cannot work with metainfo of the old format version. Required format version >= 1");return s=TradingView.clone(defaults("study")),f(s,t),a=TradingView.clone(defaults("study_"+t.id,r)),t.isTVScript&&t.TVScriptSourceCode!==a.TVScriptSourceCode&&(a=TradingView.clone(TradingView.factoryDefaults("study_"+t.id,r))),TradingView.merge(s,a),o&&(S(!(o instanceof e),"propsState should not be an instance of Property"),TradingView.merge(s,o)),l=TradingView.clone(t),c={},p.mergeInputsObjPart(c,l.defaults.inputs),p.mergeInputsObjPart(c,s.inputs),s.inputs=c,delete l.inputs,delete l.defaults.inputs,h={},TradingView.merge(h,l.defaults),TradingView.merge(h,TradingView.factoryDefaults("study_"+l.id)),TradingView.merge(h,s),TradingView.merge(h,l),delete h.defaults,s=h,u=null!==n?n.model().getStudyShiftColorStartOffset():void 0,d=m(n,t),TradingView.merge(s,g(s,d,u)),o&&TradingView.merge(s.styles,o.styles),s}function _(t,e,o,n,r){var s,a,l,c,h,u,d=i(119);return t.version&&o.version&&t.version!==o.version&&ct.logWarn("Serialized metaInfo version "+t.version+" is not equal to the saved state version "+o.version),s=TradingView.clone(defaults("study")),TradingView.merge(s,TradingView.factoryDefaults("study_"+t.id)),f(s,t),TradingView.merge(s,o),s=r.updateStudyState(s,t,e),a=TradingView.clone(e||t),a&&st.versionOf(a)>=1&&(l={},d.mergeInputsObjPart(l,a.defaults.inputs),d.mergeInputsObjPart(l,s.inputs),s.inputs=l,delete a.inputs,delete a.defaults.inputs,c={},TradingView.merge(c,a.defaults),TradingView.merge(c,TradingView.factoryDefaults("study_"+a.id)),TradingView.merge(c,s),delete a.defaults,TradingView.merge(c,a),s=c),h=null!==n?n.model().getStudyShiftColorStartOffset():void 0,u=m(n,a),TradingView.merge(s,g(s,u,h)),s}function f(t,e){var i,o,n,r;if(e.plots)for(i=0;i<e.plots.length;i++)o=e.plots[i].id,(n=e.plots[i].type)!==at.PlotTypes.COLORER&&(r=a(),n===at.PlotTypes.COLORER&&(r.transparency=0),r.plottype=n,r.title=o,t.styles&&o in t.styles&&TradingView.merge(r,t.styles[o]),t.styles[o]=r)}function m(t,e){var i,o,n,r,s=0;if(t)for(i=0;i<t.dataSources().length;i++)o=t.dataSources()[i],o.metaInfo&&o.metaInfo()&&(n=o.metaInfo().id===e.id,r=(o.metaInfo().pine&&o.metaInfo().pine.version)===(e.pine&&e.pine.version),n&&r&&s++);return s}function g(t,e,i){var o,n;if(!e)return t;for(o in t.styles)(n=t.styles[o].color)&&(t.styles[o].color=X(n,e,i));return t}function v(t,e,r,s){var a,l,c,h,u,d,p,_,f,m,g=i(213);for(this._titleCache={},this._resolvedSymbols={},this._priceAxisViewsBase=[],this._paneViews=[],this._hlinesPriceAsisViews=[],this._horizlinesPriceAsisViews=[],W.call(this,t),this.m_data=new ot,this._graphics=new q(s),this._plotOffsets={},this._plotOffsetsMetaInfoOverride={},this._model=t,this._chartApi=t._chartApi,
this._series=r instanceof TradingView.Series?r:this._model.mainSeries(),r instanceof v&&(this._source=r,this._isChildStudy=!0,this._source.setChild(this)),this._numericFormatter=new et,this._metaInfo=s,this._properties=e,this._properties.listeners().subscribe(this,this.changeStyles),this._properties.visible.listeners().subscribe(this,this.visibleChanged),this._properties.visible.listeners().subscribe(this,this.processHibernate),a=0;a<this._metaInfo.plots.length;a++)l=this._metaInfo.plots[a].id,null!=(c=this.properties().styles[l])&&null!=c.visible&&c.visible.listeners().subscribe(this,this.processHibernate);for(h in this._metaInfo.graphics)for(u in this._metaInfo.graphics[h])d=this._properties.graphics[h][u],d.visible&&d.visible.listeners().subscribe(this,this.processHibernate);if(this._showStudyArgumentsProperty=this.model().properties().paneProperties.legendProperties.showStudyArguments,this._turnaroundCounter=1,this._turnaround="st"+this._turnaroundCounter,this._status="",this._plotFields=[],p=this.metaInfo().plots)for(a=0,_=p.length;a<_;a++)u=p[a].id,this._plotFields.push(u);this.clearData(),this._studyModified=!1,this._tagsChanged=new o,this.createViews(),f=this,this._handler=function(t){f.onData(t)},this._handler.isTVScriptStrategy=this._metaInfo.isTVScriptStrategy,this._createFormatter(),f=this,this._properties.precision.listeners().subscribe(null,function(){f._createFormatter(),f._model.invalidate(new G(G.FULL_UPDATE))}),this._showStudyArgumentsProperty.listeners().subscribe(this,this.invalidateTitleCache),this._properties.description.listeners().subscribe(this,this.invalidateTitleCache),this._properties.shortDescription&&this._properties.shortDescription.listeners().subscribe(this,this.invalidateTitleCache),n.enabled("update_study_formatter_on_symbol_resolve")&&t.mainSeries().onSymbolResolved().subscribe(this,v.prototype._createFormatter),f=this,m={},this._simplePlotsCount=s.plots.filter(function(t,e){if(f.isLinePlot(e))return!0;if(f.isOHLCSeriesPlot(e)){var i=f.metaInfo().plots[e].target;return!m[i]&&(m[i]=i,!0)}return!1}).length,this._properties.showInDataWindow.listeners().subscribe(t,g.prototype.fullUpdate),this.hasBarColorer()&&this._properties.visible.listeners().subscribe(t.mainSeries(),TradingView.Series.prototype.invalidateBarStylesCache),this.onStart=new o,this._childStudyByRebind=new o}function y(t,e){return t&&t[e]&&t[e].hasOwnProperty("showLast")?t[e].showLast.value():null}
var b=i(21),S=b.assert,w=b.ensureNotNull,T=i(272).StudyBarColorer,x=i(122).HorizontalLineRenderer,C=i(822),P=C.BandPaneView,L=C.BandBackgroundPaneView,I=C.HlineFillPaneView,k=i(496).StudyPriceAxisView,A=i(118),M=A.StudyPaneView,E=A.StudyBackgroundPaneView,V=A.StudyPlotShapesPaneView,D=A.StudyPlotCharsPaneView,O=A.StudyPlotArrowsPaneView,B=A.StudyPlotBarsPaneView,R=A.StudyPlotCandlesPaneView,z=i(821),F=z.PlotFillPaneView,N=z.AreaBackgroundPaneView,W=i(62).PriceDataSource,H=i(217),U=i(214).StudyDataWindowView,j=i(215),q=i(282),G=i(37),Y=i(34).parseJSONorNot,K=i(388).ChartApiInterface,Z=i(1).Point,X=i(53).shiftColor,J=i(11).DefaultProperty,Q=i(41).PriceFormatter,tt=i(482).VolumeFormatter,et=i(38).NumericFormatter,it=i(42),ot=it.PlotList,nt=it.PlotRowSearchMode,rt=it.mergeMinMax,st=i(45),at=i(106),lt=i(9).propertyPages,ct=i(13).getLogger("Chart.Study");s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){this._visible=!1;var t=this._study.lastValueData(this._plotName,!0);t.noData||(this._visible=!0,this._points=[new Z(0,t.coordinate)],this._color=t.color)},s.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.width=this.m_model.timeScale().width(),t.height=this._study.priceScale().height(),t.points=this._points,t.color=this._color,t.linewidth=this._study.properties().styles[this._plotName].linewidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.visible=this._visible,this._lineRenderer.setData(t),this._lineRenderer},inherit(v,W),TradingView.Study=v,i(971),v.prototype.lastValueData=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return C;if(null===(o=this._model.timeScale().visibleBars()))return C;if(!this.properties().visible.value())return C;if(n=this.properties().styles,r=this.properties().ohlcPlots,n&&n[t]&&(s=n[t]),r&&r[t]&&(s=r[t]),!s||!s.visible.value())return C;if(a=this.offset(t),null==(l=this.nearestIndex(o.lastBar()-a,nt.NearestLeft))||void 0===l)return C;for(h=this.metaInfo().plots,c=0;c<h.length&&!(h[c].id===t||this.isOHLCClosePlot(c)&&h[c].target===t);c++);if(u=this._lastNonEmptyPlotRow(c),d=null!==u&&o.contains(u.index),p=null!==u?u.value:null,!(_=e||d?p:this.data().valueAt(l))||!isNumber(_[c+1]))return C;for(f={noData:!1},m=null,g=null,y=0;y<h.length;y++)h[y].target===t&&(this.isSelfColorerPlot(y)||this.isOHLCColorerPlot(y))&&(m=y,g=this.metaInfo().palettes[h[y].palette],v=this.properties().palettes[h[y].palette]);if(b=_[c+1],i&&(f.price=b),this.priceScale().properties().percentage.value()){if(!(S=this.firstValue(!0)))return C;b=this.priceScale().priceRange().convertToPercent(b,S)}return f.text=this.priceScale().formatter().format(b),w=s.color.value(),m&&_.length>m+1?(T=_[m+1],void 0!==T&&null!==T?(x=g.valToIndex?g.valToIndex[T]:T,f.color=v.colors[x].color.value()):f.color=w):f.color=w,f.floatCoordinate=this.priceScale().priceToCoordinate(b,!0),
f.coordinate=Math.round(f.floatCoordinate),f.item=_,f},v.prototype.series=function(){return this._series},v.prototype.model=function(){return this._model},v.prototype._invalidateLastNonEmptyPlotRowCache=function(){this._lastNonEmptyPlotRowCache={}},v.prototype.clearData=function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data=new ot(this._plotFields),this._graphics=new q(this._metaInfo),this._plotOffsets={}},v.prototype.onTagsChanged=function(){return this._tagsChanged},v.prototype.properties=function(){return this._properties},v.prototype.state=function(t){var e,i,o,n,r=TradingView.className(this.constructor),s={type:r,id:this.id(),state:this.properties().state(),zorder:this.zorder()};for(this.metaInfo()instanceof st?s.metaInfo=TradingView.clone(this.metaInfo().state()):(s.metaInfo=TradingView.clone(this.metaInfo()),s.metaInfo.id=st.parseIdString(s.metaInfo.id+(s.metaInfo.version?"-"+s.metaInfo.version:"")).fullId),t&&(s.data=this.m_data.state(),s.data.symbols=this._resolvedSymbols,s.data.graphics=this._graphics.graphics(),s.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(s.ownerSource=this.ownerSource().id()),e=0;e<this._metaInfo.inputs.length;e++)"bar_time"===this._metaInfo.inputs[e].type&&(i=this._metaInfo.inputs[e].id,(o=s.state.inputs[i])<0&&(n=this._rightOffsetToUnixTime(-o),s.state.inputs[i]=n&&n>=0?n:0));return this._isChildStudy&&st.patchChildStudyMetaInfoState(s),s},v.prototype._plotsForAlert=function(){var t=this,e=this._metaInfo,i=[at.PlotTypes.LINE,at.PlotTypes.SHAPES,at.PlotTypes.CHARS,at.PlotTypes.ARROWS,at.PlotTypes.OHLC_OPEN,at.PlotTypes.OHLC_HIGH,at.PlotTypes.OHLC_LOW,at.PlotTypes.OHLC_CLOSE];return e.plots.map(function(t,e){return t.pinePlotIndex=e,t}).filter(function(t){return-1!==i.indexOf(t.type)}).map(function(i){var o={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:t.offset(i.id)};return e.styles&&void 0!==e.styles[i.id]&&(o.title=e.styles[i.id].title||""),i.target&&e.ohlcPlots&&e.ohlcPlots[i.target]&&(o.ohlcTitle=e.ohlcPlots[i.target].title),o})},v.prototype.isSavedInStudyTemplates=function(){for(var t=0;t<this._metaInfo.inputs.length;t++)if("bar_time"===this._metaInfo.inputs[t].type)return!1;return!0},v.prototype.restoreData=function(t){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.restoreState(t),this._resolvedSymbols=t.symbols,this._graphics.setGraphics(t.graphics),this._postProcessGraphics(),this._plotOffsets=t.plotOffsets},v.prototype.restart=function(){this._restarting=!0,this.clearData(),n.enabled("stop_study_on_restart")&&this.stop(),setTimeout(this.start.bind(this),0)},v.prototype.stop=function(t){if(!0===t&&this._children)for(var e=0;e<this._children.length;++e)this._children[e].stop(!0);this._chartApi&&this._chartApi.connected()&&this._studyId&&this._chartApi.removeStudy(this._studyId,this._handler,this._isChildStudy),n.enabled("update_study_formatter_on_symbol_resolve")&&this._model.mainSeries().onSymbolResolved().unsubscribe(this,v.prototype._createFormatter),this._studyId=null,this.clearData(),this._unsubscribeExtendedHours(),
this.recalculate()},v.prototype._resolveSymbol=function(t){var e=function e(i,o){this._chartApi.resolveSymbol(this._makeNextSymbolId(),i,function(i){switch(i.method){case"symbol_resolved":this._resolvedSymbols[t]=i.params[1],this.invalidateTitleCache(!0),o.resolve(t);break;case"symbol_error":if("permission denied"===i.params[1]&&i.params[2])switch(i.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:break;case TradingView.Series.PD_REASON_SYMBOL:if(i.params[3])return void e(i.params[3],o);break;default:return void e(i.params[2],o)}o.reject(t)}}.bind(this))}.bind(this),i=$.Deferred();return e(t,i),i.promise()},v.prototype._allSymbolsAreResolved=function(){var t,e,i,o,n=$.Deferred(),r=[];for(t=0;t<this._metaInfo.inputs.length;t++)"symbol"===this._metaInfo.inputs[t].type&&(e=this._metaInfo.inputs[t].id,i=this._properties.inputs[e].value(),this._resolvedSymbols[i]||(o=this._resolveSymbol(i),r.push(o)));return r.length>0?$.when.apply($,r).done(function(){0!==this._studyId&&this.stop(!0),this.start(!0),n.resolve("All symbols are resolved now")}.bind(this)).fail(function(t){this._status=$.t("Invalid Symbol"),this.stop(!0),this._model.updateSource(this),n.reject("Invalid symbol, "+t)}.bind(this)):n.resolve("There are no symbols to resolve"),n.promise()},v.prototype._allInputsAreValid=function(){var t,e,i;for(t=0;t<this._metaInfo.inputs.length;t++)if("bar_time"===this._metaInfo.inputs[t].type&&(e=this._metaInfo.inputs[t].id,void 0===(i=this._properties.inputs[e].value())||null==i))return!1;return!0},v.prototype.sourceId=function(){return this._studyId},v.prototype.source=function(){return this._source||this._series},v.prototype.ownerSource=function(){return this._isChildStudy?this._source:W.prototype.ownerSource.call(this)},v.prototype.getAllOwnerSources=function(){for(var t=[],e=this.ownerSource();null!=e;)t.push(e),e=e.ownerSource();return t},v.prototype.isChildStudy=function(){return!!this._isChildStudy},v.prototype.setChild=function(t){t instanceof v&&t.source()===this&&(this._children||(this._children=[]),-1===this._children.indexOf(t)&&this._children.push(t))},v.prototype.unsetChild=function(t){if(t instanceof v&&t.source()===this&&this._children){var e=this._children.indexOf(t);~e&&this._children.splice(e,1)}},v.prototype.hasChildren=function(){return!(!this._children||!this._children.length)},v.prototype.getAllChildren=function(){var t,e,i,o;if(!Array.isArray(this._children))return[];for(t=this._children.slice(),e=0;e<t.length;++e)for(i=t[e].getAllChildren(),o=0;o<i.length;++o)~t.indexOf(i[o])||t.push(i[o]);return t},v.prototype._debugId=function(){var t=[];return this._studyId&&t.push(this._studyId),t.push(this._metaInfo.fullId),t.push(this._metaInfo.description),JSON.stringify({study:t})},v.prototype.isStarted=function(){return!!this._studyId},v.prototype.isRestarting=function(){return!!this._restarting},v.prototype.isVisible=function(){var t,e,i;if(!this.properties().visible.value())return!1;if(this._metaInfo.plots.length>0)return!0
;for(t in this._metaInfo.graphics)for(e in this._metaInfo.graphics[t])if(i=this.properties().graphics[t][e],!i.visible||i.visible.value())return!0;return!!this._metaInfo.isTVScriptStrategy},v.prototype.start=function(t,e){var i,o=this._model.mainSeries();if(!o.isStarted())return void o.onCompleted().subscribe(this,function(){this.start(t,e)},!0);this._isChildStudy&&this._source.isHibernated()&&this._source.start(),i=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible(),!this._chartApi||!this._chartApi.connected()||i&&!0!==e||this._allSymbolsAreResolved().done(function(i){this._startAfterSymbolsResolved(t,e)}.bind(this)).fail(function(t){ct.logError("ERROR: "+this._debugId()+" start failed, "+t),delete this._restarting}.bind(this))},v.prototype._getStudyIdWithLatestVersion=function(){var t=st.cutDollarHash(this._metaInfo.id),e=t;return["Script@tv-scripting","StrategyScript@tv-scripting","ESD@tv-scripting"].indexOf(t)>=0?e+="-72!":e+="-"+this._metaInfo.version,e},v.prototype._startAfterSymbolsResolved=function(t,e){var i,o;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);st.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=v.makeNextStudyId(),delete this._restarting,this._allInputsAreValid()&&(this._inputs=this.inputs(),i=this._getStudyIdWithLatestVersion(),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(this._studyId),!0===t&&this._children))for(o=0;o<this._children.length;++o)this._children[o].start(!0,e)}},v._nextSymbolId=0,v.prototype._makeNextSymbolId=function(){return"ss_"+ ++v._nextSymbolId},v._nextStudyId=0,v.makeNextStudyId=function(){return"st"+ ++v._nextStudyId},v.prototype._rightOffsetToUnixTime=function(t){var e;return this._series.bars().size()>=t&&(e=w(this._series.bars().lastIndex())-t,w(this._series.bars().valueAt(e))[TradingView.TIME_PLOT]),null},v.prototype.getSymbolString=function(t){return this._series&&this._series.extendedHours.value()?"="+JSON.stringify({symbol:t,session:"extended"}):t},v.prototype.inputsForGUI=function(){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1})},v.prototype.inputsForAlert=function(){var t=this.offset(),e=this.inputs();return t&&e.push(t),e},v.prototype.inputs=function(t){var e={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,asObject:!0};return TradingView.merge(e,t),this._buildInputs(e)},v.prototype._buildInputs=function(t){var e,i;S(!!t,"options not set"),e={};try{e=this._prepareInputs(t)}catch(t){ct.logWarn("Failed to prepare study inputs: "+t)}return t.asObject?(i={},Object.keys(e).forEach(function(t){null!=e[t]&&(i[t]=e[t])}),i):(i=[],
Object.keys(e).forEach(function(t){null!=e[t]&&i.push(e[t])}),i)},v.prototype._prepareInputs=function(t){var e,i,o,r;for(S(!!t,"options not set"),e={},i=0;i<this._metaInfo.inputs.length;i++)o=this._metaInfo.inputs[i],o.isFake&&t.skipFakeInputs||o.isHidden&&t.skipHiddenInputs||"bool"===o.type&&t.skipHiddenInputs&&n.enabled("dont_show_boolean_study_arguments")||(r=this._prepareInput(o,t),e[o.id]=TradingView.clone(r));return e},v.prototype._prepareInput=function(t,e){var i=this._prepareInputValue(t,e);return!t.isFake||e.fakeInputsForDisplay?i:e.onlyAtomValues?i:{v:i,f:!0,t:t.type}},v.prototype._prepareInputValue=function(t,e){var i,o,n,r,s=t.id;return"symbol"===t.type?(i=this._properties.inputs[s].value(),e&&e.symbolsForDisplay?this._resolvedSymbols&&this._resolvedSymbols[i]&&(i=this._resolvedSymbols[i].name+", "+this._resolvedSymbols[i].exchange):(this._resolvedSymbols&&this._resolvedSymbols[i]&&(o=this._resolvedSymbols[i],i=o.ticker||o.full_name),e&&e.symbolsForChartApi&&(i=this.getSymbolString(i))),i):"bar_time"===t.type?(n=this._properties.inputs[s].value(),n<0&&(r=this._rightOffsetToUnixTime(-n),n=r&&r>=0?r:n),n):this._metaInfo.isTVScript||this._metaInfo.pine?"text"===s?this._metaInfo.defaults.inputs.text:"pineId"===s?this._metaInfo.scriptIdPart:"pineVersion"===s?this._metaInfo.pine?this._metaInfo.pine.version:"-1":this._properties.inputs[s].value():this._properties.inputs[s].value()},v.prototype._rebindToSource=function(t,e){var i,o,n,r,s,a,l,c,h,u,d;if(this._isChildStudy){if(this._source.unsetChild(this),delete this._nonPriceParent,o=null,t===this._model.mainSeries()){for(n=this._model.studiesMetaData(),s=0;s<n.length;++s)if(this._metaInfo.id===n[s].id){r=n[s];break}if(!r)return void ct.logError("Can not find "+this._metaInfo.id+" meta info");delete this._source,delete this._isChildStudy,delete this._ownerSource,this._metaInfo=r.state(!0),i=this._series._seriesId,o=K.REBIND_STUDY_CHILD_TO_STANDALONE}else{if(!(t instanceof v))return ct.logError("Unable to rebind study to source of this type"),!1;this._ownerSource=t,this._source=t,i=this._source.sourceId(),this._source.setChild(this),this._source.isHibernated()&&this._source.start()}this._chartApi.rebindStudy(this._studyId,this._turnaround,i,this._studyName,e,this._handler,o)}else{if(!(t instanceof v))return ct.logError("Unable to rebind study to source of this type"),!1;if(a=t.isHibernated(),a&&t.start(),l=!1,this._canCreateStudyWithRebindType(K.REBIND_STUDY_STANDALONE_TO_CHILD)&&(l=this._chartApi.rebindStudy(this._studyId,this._turnaround,t.sourceId(),this._studyName,e,this._handler,K.REBIND_STUDY_STANDALONE_TO_CHILD)),!l)return a&&t.stop(),!1;this._metaInfo=TradingView.clone(this._metaInfo),this._isChildStudy=!0,this._ownerSource=t,this._source=t,this._source.setChild(this),this._childStudyByRebind.fire()}return c=this.m_priceScale,h=t.priceScale(),c!==h&&(u=this._model.paneForSource(this),d=this._model.paneForSource(t),u===d&&(~c.dataSources().indexOf(this)&&c.removeDataSource(this),h.addDataSource(this),this.setPriceScale(h))),!0},
v.prototype.childStudyByRebind=function(){return this._childStudyByRebind},v.prototype._changeInputsImpl=function(t,e){var i,o,n,r,s=this.source(),a=this._properties.inputs&&this._properties.inputs.state(),l=st.getSourceIdByInputs(this._metaInfo.inputs,a),c=!0;if(l)if("high"===l||"open"===l||"low"===l||"close"===l||"hl2"===l||"ohl3"===l||"ohlc4"===l)s=this._model.mainSeries();else for(i=this._model.dataSources(),o=0;o<i.length;++o)if(i[o]instanceof v&&i[o].sourceId()===l){s=i[o];break}if(s!==this.source()){if(!this._rebindToSource(s,t)&&a){for(n=null,r=null,o=0;o<e.length;++o)if(e[o]!==t[o]&&0===t[o].indexOf(l)){n=this._properties.inputs[a[o].id],r=e[o],c=!1;break}n&&n.setValue(r)}}else this._chartApi.modifyStudy(this._studyId,this._turnaround,t,this._handler);c&&(this._studyModified=c)},v.prototype._changeInputs=function(t){var e=TradingView.clone(this._inputs);this._studyId&&this._chartApi.connected()?(this._turnaround="st"+ ++this._turnaroundCounter,this._allInputsAreValid()?this._allSymbolsAreResolved().done(this._changeInputsImpl.bind(this,t,e)).fail(function(t){ct.logError("ERROR: "+this._debugId()+" _changeInputs: cannot modify study, "+t)}.bind(this)):this.stop()):(this.stop(!0),this.start(!0)),this._inputs=t,this._tagsChanged.fire(),this._titleCache={}},v.prototype.testInputValue=function(t,e){var i,o;return!st.canBeChild(this._metaInfo)||!st.isSourceInput(t)||(!(i=this._properties.inputs&&this._properties.inputs[t.id])||(o=v.getInputRebindType(t,i.value(),e),!!this._canCreateStudyWithRebindType(o)))},v.prototype._canCreateStudyWithRebindType=function(t){return t!==K.REBIND_STUDY_STANDALONE_TO_CHILD||this._chartApi.isCanCreateStudy(!0)},v.prototype.changeStyles=function(){var t,e=null!=this._metaInfo.inputs.filter(function(t){return"symbol"===t.type})[0];!this.isStarted()&&!e||this._restarting||(this._inputs?(t=this.inputs(),JSON.stringify(t)!==JSON.stringify(this._inputs)&&this._changeInputs(t)):this._chartApi&&this._chartApi.connected()&&this.restart(),this.hasBarColorer()&&this._model.mainSeries().invalidateBarStylesCache(),e&&this.invalidateBarStylesCache(),this.createViews(),this.recalculate(!0),this.updateAllViews())},v.prototype._isModifiedStudyInputs=function(t){if(void 0===this._oldStudyInputs)return this._oldStudyInputs=t,!0;var e=Object.keys(this._oldStudyInputs);return S(e.length===Object.keys(t).length,"keys quantity should be equal"),e.forEach(function(e){S(t.hasOwnProperty(e),"key '"+e+"' should existing in studyInputs"),this._oldStudyInputs[e]!==t[e]&&(this._oldStudyInputs=t)},this),this._oldStudyInputs===t},v.prototype.visibleChanged=function(){this._series instanceof TradingView.Series&&this._series.invalidateBarColorerCache()},v.prototype.invalidateBarStylesCache=function(){this.m_data.each(function(t,e){e[TradingView.STYLE_PLOT]=null})},v.prototype.processHibernate=function(){this.isHibernateAllowed()&&(!this._studyId&&this.isVisible()&&this.start(),this._studyId&&!this.isVisible()&&this.stop())},v.prototype.isHibernated=function(){return!this.isVisible()&&!this._studyId},
v.prototype.isHibernateAllowed=function(){return!this._isChildStudy&&!this.hasChildren()},v.prototype.lastPriceLabelFixedCoordinate=function(t){return this._priceAxisViewsCache[t]._fixedCoordinate},v.prototype.priceLabelText=function(t){var e,i,o,n;return 1===this._simplePlotsCount?this._metaInfo.shortDescription:(e=this._metaInfo.styles,i=this._metaInfo.ohlcPlots,e&&e[t]&&(o=e[t]),i&&i[t]&&(o=i[t]),n=o.title,this._metaInfo.is_price_study?this._metaInfo.shortDescription+":"+n:n)},v.prototype.createPlotLabels=function(t){for(var e=0;e<t.length;e++)this._paneViews.push(new H(this._model,this,t[e],"priceLabelText","showStudyPlotLabels"))},v.prototype.createViews=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p;if(this._priceAxisViewsBase=[],this._paneViews=[],t={},this._priceAxisViewsCache={},e=[],this.metaInfo().plots)for(i=0;i<this.metaInfo().plots.length;i++)if(!(this.isSelfColorerPlot(i)||this.isBarColorerPlot(i)||this.isBarColorerPlot(i)||this.isOHLCColorerPlot(i)))if(o=this.metaInfo().plots[i].id,this.isBgColorerPlot(i))this._paneViews.push(new E(this,this._series,this._model,o));else if(this.isPlotShapesPlot(i))this._paneViews.push(new V(this,this._series,this._model,o));else if(this.isPlotCharsPlot(i))this._paneViews.push(new D(this,this._series,this._model,o));else if(this.isPlotArrowsPlot(i))this._paneViews.push(new O(this,this._series,this._model,o));else if(this.isOHLCSeriesPlot(i)){if(n=this.metaInfo().plots[i].target,t[n])continue;t[n]=n,this.isOHLCBarsPlot(i)?this._paneViews.push(new B(this,this._series,this._model,n)):this.isOHLCCandlesPlot(i)&&this._paneViews.push(new R(this,this._series,this._model,n)),r=new k(this,{plotIndex:n}),this._priceAxisViewsCache[n]=r,this._priceAxisViewsBase.push(r),e.push(n)}else r=new k(this,{plotIndex:o}),this._priceAxisViewsCache[o]=r,this._priceAxisViewsBase.push(r),this._paneViews.push(new M(this,this._series,this._model,o)),this.properties().styles[o].trackPrice.value()&&this._paneViews.push(new s(this,this._series,this._model,o)),e.push(o);if(this._properties.bands)for(i=0;i<this._properties.bands.childCount();i++)this._properties.bands[i].visible.value()&&this._paneViews.push(new P(this._properties.bands[i],this));this._properties.bandsBackground&&this._paneViews.push(new L(this)),a=[],this.metaInfo().graphics&&(a=Object.keys(this.metaInfo().graphics),a.sort(function(t,e){return v.graphicsZOrderPriority(t)-v.graphicsZOrderPriority(e)}));for(l in a)c=a[l],h="_paneView"+c,u="StudyPaneView_"+c,TradingView.Study[u]&&(this[h]=new TradingView.Study[u](this,this._model),this._paneViews.push(this[h])),this._dataWindowView||"hhists"!==c||(this._dataWindowView=new TradingView.StudyHHistsDataWindowView(this,this._model));if(this._properties.areaBackground&&this._paneViews.push(new N(this)),this._properties.filledAreas&&this._metaInfo.filledAreas)for(i=0;i<this._metaInfo.filledAreas.length;++i)d=this._metaInfo.filledAreas[i],p=this._properties.filledAreasStyle[d.id],
d.type===st.FilledArea.TYPE_PLOTS||d.palette?this._paneViews.push(new F(this,d,p)):d.type===st.FilledArea.TYPE_HLINES?this._paneViews.push(new I(this,d,p)):ct.logWarn("Unsupported filledArea type: "+d.type);this.createPlotLabels(e),this._dataWindowView||(this._dataWindowView=new U(this,this._model)),this._statusView||(this._statusView=new j(this,this._model.properties())),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},v.prototype.recalculate=function(t){var e=this._model.paneForSource(this);this._model.recalculatePane(e,t),this._model.updateSource(this)},v.prototype.data=function(){return this.m_data},v.prototype.metaInfo=function(){return this._metaInfo},v.prototype.status=function(){return this._status},v.prototype.title=function(t,e,i){var o,n=JSON.stringify([t,e,i]);return this._titleCache[n]?this._titleCache[n]:(o=this._title(t,e,i||!this._showStudyArgumentsProperty.value()),this._titleCache[n]=o,o)},v.prototype._title=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f;if(o=t?this._metaInfo.shortDescription||this._properties.shortDescription&&this._properties.shortDescription.value()||"Study":this._metaInfo.description||this._properties.description&&this._properties.description.value()||"Study",e=e||{},o=$.t(o),!i&&(n=this.inputsForGUI()||[],n.length>0)){if(r={},this._isChildStudy)for(s=0;s<this._metaInfo.inputs.length;++s)if(a=this._metaInfo.inputs[s],st.isSourceInput(a)){l=a.id,c=this._properties.inputs[l].value(),c.indexOf("$")>=0&&this._source&&(h=this._source.metaInfo(),u=this._source.title(t,null,!0),1===h.plots.length?r[c]=u:(d=c.split("$")[1],p=h.plots[d].id,_=h.styles&&h.styles[p]&&h.styles[p].title||p,r[c]=u+": "+_));break}f=this,n=n.map(function(t){var i=isNumber(t)?f._numericFormatter.format(t):r&&r[t]||t;return e[i]&&(i=e[i]),i}),o+=" ("+n.join(", ")+")"}return o},v.prototype.invalidateTitleCache=function(t){if(this._titleCache={},!0===t&&this._children)for(var e=0;e<this._children.length;++e)this._children[e].invalidateTitleCache(t)},v.prototype.graphics=function(){return this._graphics.graphics()},v.prototype.turnaround=function(t){return!0===t?this.source().turnaround(!0)+"_"+this._turnaround:this._turnaround},v.prototype._checkTurnaround=function(t){return t===this._turnaround||t===this._model.mainSeries().turnaround()||t===this.turnaround(!0)},v.prototype._makeJSONForNSData=function(t,e){var i=""!==t.params.nonseries.d?Y(t.params.nonseries.d):e||"";return Promise.resolve(i)},v.prototype.onData=function(t){var e,i,o,n,r=this;switch(t.method){case"study_loading":this._status=$.t("loading..."),this._failed=!1,this._statusView.update(),this._model.updateSource(this),-1===["Plot splits","Plot earnings","Plot dividends"].indexOf(r._metaInfo.description)&&(r._loadingStartTime=(new Date).getTime());break;case"study_error":delete this._loadingStartTime,this._failed=!0,this.clearData(),t.params[2]?this._status=$.t(t.params[2].split(":",2)[0]):this._status="",this._statusView.update(),this._model.updateSource(this);break
;case"study_completed":if(!this._checkTurnaround(t.params[1]))return Promise.resolve();e="chartSession:"+r._chartApi._sessionid,i=(new Date).getTime()-this._loadingStartTime,ct.logDebug(e+", Study "+this._metaInfo.description+" loading took "+i+" ms"),delete this._loadingStartTime,this._status="",this._statusView.update(),o=this._model.paneForSource(this),this._model.recalculatePane(o),this._updateSources(),this._model.invalidate(new G(G.FULL_UPDATE));break;case"study_deleted":break;case"data_update":return this._checkTurnaround(t.params.turnaround)?(this._studyModified&&(this.clearData(),this._studyModified=!1),n=0===this.m_data.size()&&this._metaInfo.plots.length>0,S(!!t.params.nonseries,"data.params.nonseries is missing"),new Promise(function(e){r._makeJSONForNSData(t).then(function(i){var o,s;t.params.nonseries.d=i,r._processPlotOffsets(t.params),r.transformData(t.params.plots),o=r._mergeData(t.params.plots).earliestRow,r.hasBarColorer()&&(null!==o?r._model.mainSeries().invalidateBarStylesCache(o.index):ct.logNormal("ERROR: No earliestRow in studies plots, "+r._debugId())),r._graphics.process(t.params.nonseries),r._postProcessGraphics(),s=r._model.paneForSource(r),r._model.recalculatePane(s,n),r._updateSources(),e()})})):Promise.resolve()}return Promise.resolve()},v.prototype.transformData=function(t){},v.prototype.moveData=function(t){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.move(t)},v.prototype.replaceData=function(t,e,i){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.remove(t+1),this.m_data.addTail(i,e)},v.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},v.processPlotOffsets=function(t,e){if(!e.nonseries||"nochange"!==e.nonseries.indexes){var i=e.nonseries.d;if(!i||!i.indexes_replace)return i&&i.offsets?void(t._plotOffsets=i.offsets):void(t._plotOffsets={})}},v.prototype._processPlotOffsets=function(t){v.processPlotOffsets(this,t)},v.prototype._mergeData=function(t){return this._invalidateLastNonEmptyPlotRowCache(),this.m_data.merge(t)},v.prototype._postProcessGraphics=function(){var t=this,e=function(e){var i,o,n,r,s=t._graphics.graphics(),a=[];if(s&&s[e])for(n=s[e],i=0;i<n.length;i+=1)if(n[i].data)for(o=0;o<n[i].data.length;o+=1)r={line:n[i].data[o],styleId:n[i].styleId,lineType:e},a.push(new v.StudyPriceAxisView_hlines(t,r));return a};this._hlinesPriceAsisViews=e("hlines"),this._horizlinesPriceAsisViews=e("horizlines"),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},v.prototype._getNonPriceParent=function(){var t,e;if(this._nonPriceParent)return this._nonPriceParent;for(t=this.source();t instanceof v;){if(e=t.metaInfo(),!e.is_price_study||"Compare@tv-basicstudies"===e.id)return this._nonPriceParent=t,t;t=t.source()}},v.prototype.firstValue=function(t){var e,i,o,n,r,s
;return!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study?null===(e=this._model.timeScale().visibleBars())?null:(i=e.firstBar(),o=e.lastBar(),0===this.m_data.size()?null:(r=this,this.m_data.range(i,o).each(function(e,i){var o,s,a;for(o=1;o<i.length;++o)if(void 0!==i[o-1]&&null!==i[o-1]&&!r.isSelfColorerPlot(o-1)&&(s=r._metaInfo.plots[o-1].id,a=r.properties().styles[s],a.visible&&a.visible.value()&&!(t&&Math.abs(i[o])<1e-10||void 0===i[o]||null===i[o]||n)))return n=i[o],!0}),this._nonPriceFirstValue=n,n)):this._isChildStudy&&(s=this._getNonPriceParent())&&this.priceScale()===s.priceScale()?void 0!==s._nonPriceFirstValue?s._nonPriceFirstValue:s.firstValue():this._series.firstValue()},v.offset=function(t,e){var i=0;return t._plotOffsets&&void 0!==t._plotOffsets[e]&&(i+=t._plotOffsets[e]),void 0!==t._plotOffsetsMetaInfoOverride[e]?i+=t._plotOffsetsMetaInfoOverride[e]:t.properties().offsets&&void 0!==t.properties().offsets[e]&&(i+=t.properties().offsets[e].val.value()),t.properties().offset&&(i+=t.properties().offset.val.value()),i},v.prototype.offset=function(t){return v.offset(this,t)},v.prototype.priceRange=function(t,e){var i,o,n,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w;if(!TradingView.isInteger(t))return void ct.logDebug("priceRange: incorrect startBar");if(!TradingView.isInteger(e))return void ct.logDebug("priceRange: incorrect endBar");if(0===this.m_data.size())return null;if(i=null,o=this,n=o._metaInfo,0===n.plots.length)return null;for(a=[],c=0;c<n.plots.length;++c)if(!(o.isSelfColorerPlot(c)||o.isTextColorerPlot(c)||o.isBarColorerPlot(c)||o.isBgColorerPlot(c)||o.isOHLCColorerPlot(c))&&(h=n.plots[c].id,o.isOHLCSeriesPlot(c)?(d=n.plots[c].target,u=o.properties().ohlcPlots[d]):u=o.properties().styles[h],u.visible.value()&&(l=null,u.location&&(l=u.location.value()),s||(p=[CanvasEx.MARKLOC_ABSOLUTE,CanvasEx.MARKLOC_TOP,CanvasEx.MARKLOC_BOTTOM].indexOf(l)<0,_=o.isPlotShapesPlot(c)||o.isPlotCharsPlot(c),s=_&&p||o.isPlotArrowsPlot(c)),o.isLinePlot(c)||(o.isPlotShapesPlot(c)||o.isPlotCharsPlot(c))&&u.location.value()===CanvasEx.MARKLOC_ABSOLUTE||o.isOHLCSeriesPlot(c)))){if(f={index:c+1,offset:o.offset(h)},m=o.properties().styles[h].plottype.value(),!o.properties().skipHistogramBaseOnAutoScale&&[at.PlotType.Histogram,at.PlotType.Columns,at.PlotType.Area].indexOf(m)>=0){if(g=o.properties().styles[h].histogramBase.value(),!isNumber(g))continue;f.baseValue=g}a.push(f)}if(v=o.m_data.minMaxOnRange2(t,e,a),s&&(a=[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}],y=o.series().data().bars().minMaxOnRange2(t,e,a),v=rt(v,y)),null!==v&&(i=new r(v.min,v.max)),n.bands)for(c=0;c<n.bands.length;c++)if(o.properties().bands[c].visible.value()){if(g=o.properties().bands[c].value.value(),!isNumber(g))continue;i?i.apply(g,g):i=new r(g,g)}return i&&i.minValue()===i.maxValue()&&(b=.005*i.minValue(),i=new r(i.minValue()-b,i.maxValue()+b)),S=this.priceScale(),S&&S.properties().percentage.value()&&i?(w=this.firstValue(),
w?i.convertToPercents(w):null):S&&S.isLog()&&i?new r(o.priceScale().priceToLogical(i.minValue()),o.priceScale().priceToLogical(i.maxValue())):i},v.prototype.paneViews=function(t){return this.properties().visible.value()?this._paneViews:null},v.prototype.dataWindowView=function(){return this._dataWindowView},v.prototype.statusView=function(){return this._statusView},v.prototype.priceAxisViews=function(t,e){return this._model.paneForSource(this)===t&&e===this.priceScale()&&(this._showLastValueOnPriceScale()||this.properties().oldShowLastValue&&this.properties().oldShowLastValue.value())?this._priceAxisViews:null},v.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showStudyLastValue.value()},v.prototype.isLinePlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.LINE},v.isSelfColorerPlot=function(t,e){return t._metaInfo.plots[e].type===at.PlotTypes.COLORER},v.prototype.isSelfColorerPlot=function(t){return v.isSelfColorerPlot(this,t)},v.prototype.isTextColorerPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.TEXT_COLORER},v.prototype.isBarColorerPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.BAR_COLORER},v.prototype.isBgColorerPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.BG_COLORER},v.prototype.isPlotShapesPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.SHAPES},v.prototype.isPlotCharsPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.CHARS},v.prototype.isPlotArrowsPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.ARROWS},v.prototype.isOHLCBarsPlot=function(t){var e=this._metaInfo.plots[t].target,i=this.metaInfo().defaults.ohlcPlots[e];return i&&this.isOHLCSeriesPlot(t)&&i.plottype===at.OHLCType.BARS},v.prototype.isOHLCCandlesPlot=function(t){var e=this._metaInfo.plots[t].target,i=this.metaInfo().defaults.ohlcPlots[e];return i&&this.isOHLCSeriesPlot(t)&&i.plottype===at.OHLCType.CANDLES},v.prototype.isOHLCSeriesPlot=function(t){var e=this._metaInfo.plots[t].type;return e===at.PlotTypes.OHLC_OPEN||e===at.PlotTypes.OHLC_HIGH||e===at.PlotTypes.OHLC_LOW||e===at.PlotTypes.OHLC_CLOSE},v.prototype.isOHLCOpenPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_OPEN},v.prototype.isOHLCHighPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_HIGH},v.prototype.isOHLCLowPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_LOW},v.prototype.isOHLCClosePlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_CLOSE},v.prototype.isOHLCColorerPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_COLORER},v.prototype.isDataOffsetPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.DATAOFFSET},v.prototype.hasBarColorer=function(){for(var t=0;t<this._metaInfo.plots.length;++t)if(this.isBarColorerPlot(t))return!0;return!1},v.prototype.barColorer=function(){var t,e,i=null;for(t=0;t<this._metaInfo.plots.length;++t)this.isBarColorerPlot(t)&&(e=new T(this,t),
null==i?i=e:i.pushBackBarColorer(e));if(null==i)throw Error("Cannot create BarColorer: study doesn't have a bar_colorer plot!");return i},v.prototype.base=function(){return"Volume"===this._metaInfo.id?1:0},v.prototype._createFormatter=function(){var t,e,i;"default"===this.properties().precision.value()?this.metaInfo().defaults&&(t=parseInt(this.metaInfo().defaults.precision)):t=parseInt(this.properties().precision.value()),isFinite(t)||(t=-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(this._metaInfo.id)?0:1e4),e=this.series().symbolInfo(),0===t?(i=0,e&&e.volume_precision&&(i=e.volume_precision),this._formatter=new tt(i)):this._formatter=new Q(Math.pow(10,t)),this.priceScale()&&this.priceScale().updateFormatter()},v.prototype.formatter=function(){return this._formatter},v.prototype.nearestIndex=function(t,e){if(!TradingView.isInteger(t))return void ct.logDebug("nearestIndex: incorrect logicalPoint");var i=this._series.data().bars().search(t,e);return null!==i?i.index:void 0},v.prototype._lastNonEmptyPlotRow=function(t){var e,i;return TradingView.isInteger(t)?void 0!==this._lastNonEmptyPlotRowCache[t]?this._lastNonEmptyPlotRowCache[t]:(e=1e3,null===(i=this.data().findLast(function(e,i){return void 0!==i[t]},e))?null:(this._lastNonEmptyPlotRowCache[t]=i,this._lastNonEmptyPlotRowCache[t])):(ct.logDebug("_lastNonEmptyPlotRow: incorrect plotIndex"),null)},v.prototype.updateAllViews=function(){var t;for(t=0;t<this._paneViews.length;t++)this._paneViews[t].update();for(this._dataWindowView.update(),this._statusView.update(),t=0;t<this._priceAxisViews.length;t++)this._priceAxisViews[t].update()},v.prototype.tags=function(){return!this._metaInfo||!this._metaInfo.description||this._metaInfo.isTVScriptStub||this._metaInfo.is_hidden_study||this._metaInfo.isTVScript&&"tv-scripting"===this._metaInfo.productId?[]:[this._metaInfo.description]},v.isPointsBasedStudy=function(t){switch(t){case"VbPFixed@tv-volumebyprice":case"mtp_tsanalysis@mtp-mtpredictor":case"mtp_riskreward@mtp-mtpredictor":case"mtp_decisionpoint@mtp-mtpredictor":case"mtp_ew_main@mtp-mtpredictor":case"mtp_ew_major@mtp-mtpredictor":case"mtp_ew_minor@mtp-mtpredictor":case"mtp_wpt_down1ora@mtp-mtpredictor":case"mtp_wpt_down2orb@mtp-mtpredictor":case"mtp_wpt_down3@mtp-mtpredictor":case"mtp_wpt_down4@mtp-mtpredictor":case"mtp_wpt_down5@mtp-mtpredictor":case"mtp_wpt_downc@mtp-mtpredictor":case"mtp_wpt_up1ora@mtp-mtpredictor":case"mtp_wpt_up2orb@mtp-mtpredictor":case"mtp_wpt_up3@mtp-mtpredictor":case"mtp_wpt_up4@mtp-mtpredictor":case"mtp_wpt_up5@mtp-mtpredictor":case"mtp_wpt_upc@mtp-mtpredictor":return!0;default:return!1}},v.lineToolNameForPointsBasedStudy=function(t){switch(t){case"VbPFixed@tv-volumebyprice":return"LineToolVbPFixed";case"RegressionTrend@tv-basicstudies":return"LineToolRegressionTrend";case"mtp_tsanalysis@mtp-mtpredictor":return"LineStudyMtpAnalysis";case"mtp_riskreward@mtp-mtpredictor":return"LineStudyMtpRiskReward";case"mtp_decisionpoint@mtp-mtpredictor":return"LineStudyMtpDecisionPoint"
;case"mtp_ew_main@mtp-mtpredictor":return"LineStudyMtpElliotWaveMain";case"mtp_ew_major@mtp-mtpredictor":return"LineStudyMtpElliotWaveMajor";case"mtp_ew_minor@mtp-mtpredictor":return"LineStudyMtpElliotWaveMinor";case"mtp_wpt_down1ora@mtp-mtpredictor":return"LineStudyMtpDownWave1OrA";case"mtp_wpt_down2orb@mtp-mtpredictor":return"LineStudyMtpDownWave2OrB";case"mtp_wpt_down3@mtp-mtpredictor":return"LineStudyMtpDownWave3";case"mtp_wpt_down4@mtp-mtpredictor":return"LineStudyMtpDownWave4";case"mtp_wpt_down5@mtp-mtpredictor":return"LineStudyMtpDownWave5";case"mtp_wpt_downc@mtp-mtpredictor":return"LineStudyMtpDownWaveC";case"mtp_wpt_up1ora@mtp-mtpredictor":return"LineStudyMtpUpWave1OrA";case"mtp_wpt_up2orb@mtp-mtpredictor":return"LineStudyMtpUpWave2OrB";case"mtp_wpt_up3@mtp-mtpredictor":return"LineStudyMtpUpWave3";case"mtp_wpt_up4@mtp-mtpredictor":return"LineStudyMtpUpWave4";case"mtp_wpt_up5@mtp-mtpredictor":return"LineStudyMtpUpWave5";case"mtp_wpt_upc@mtp-mtpredictor":return"LineStudyMtpUpWaveC";default:throw Error("There is no line tool name, associated with study id "+t)}},v.isStudyLineTool=function(t){var e=i(136).StudyLineDataSource,o=TradingView[t];return"function"==typeof o&&o.prototype instanceof e},v.prototype.onExtendedHoursChanged=function(){this.restart()},v.prototype.hasSymbolInputs=function(){for(var t=this._metaInfo.inputs.length;t--;)if("symbol"===this._metaInfo.inputs[t].type)return!0;return!1},v.prototype._subscribeExtendedHours=function(){!this._isSubscribedToExtendedHours&&this.hasSymbolInputs()&&(this._series.extendedHours.listeners().subscribe(this,this.onExtendedHoursChanged),this._isSubscribedToExtendedHours=!0)},v.prototype._unsubscribeExtendedHours=function(){this._isSubscribedToExtendedHours&&(this._series.extendedHours.listeners().unsubscribe(this,this.onExtendedHoursChanged),delete this._isSubscribedToExtendedHours)},v.prototype.removeByRemoveAllStudies=function(){return!0},v.prototype.canHaveChildren=function(){return void 0===this._canHaveChildren&&(this._canHaveChildren=!!st.canHaveChildren(this._metaInfo)),this._canHaveChildren},v.getInputRebindType=function(t,e,i){var o=st.isSourceInput(t);return o&&!~e.indexOf("$")&&~i.indexOf("$")?K.REBIND_STUDY_STANDALONE_TO_CHILD:o&&~e.indexOf("$")&&!~i.indexOf("$")?K.REBIND_STUDY_CHILD_TO_STANDALONE:0},v.prototype.getPlotFields=function(){return this._plotFields},v.prototype.getMinFirstBarIndexForPlot=function(t){var e,i=y(this._properties.styles,t)||y(this._properties.ohlcPlots,t)||y(this._properties.filledAreasStyle,t);return null===i?-1/0:(e=this.data().lastIndex(),null===e?-1/0:e-i+1)},v.prototype.getInputsPropertyPage=function(){return lt.StudyInputsPropertyPage},v.prototype.getStylesPropertyPage=function(){return lt.StudyStylesPropertyPage},v.prototype.getDisplayPropertyPage=function(){return lt.StudyDisplayPropertyPage},t.exports={Study:v,createStudy:l,prepareStudyProperties:c,prepareStudyPropertiesForLoadChart:u,prepareStudyPropsStateForLoadChart:_}}).call(e,i(52),i(20),i(7),i(147))},function(t,e,i){(function(t){"use strict";function o(){
this._zorder=0,this.m_priceScale=null,this._id=s.randomHashN(6),this._ownerSource=null,this._userEditEnabled=!0,this.hasAlert=new t(!1)}function n(t){o.call(this),this._isOverlay=null,this._model=t}var r=i(11).DefaultProperty,s=i(64);o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i)},o.prototype.id=function(){return this._id},o.prototype.idForAlert=function(){return this._id},o.prototype.setId=function(t){this._id=t},o.prototype.zorder=function(){return this._zorder},o.prototype.setZorder=function(t){"number"==typeof t&&this._zorder!==t&&(this._zorder=t)},o.prototype.title=function(){throw Error("Implement this fun in a subclass")},o.prototype.priceScale=function(){return this.m_priceScale},o.prototype.setPriceScale=function(t){this.m_priceScale=t},o.prototype.ownerSource=function(){return this._ownerSource},o.prototype.setOwnerSource=function(t){this._ownerSource=t,t&&this.setPriceScale(t.priceScale())},o.prototype.isSavedInChart=function(t){return!0},o.prototype.isSavedInStudyTemplates=function(){return!0},o.prototype.isRemovedByStudyTemplates=function(){return!0},o.prototype.hasContextMenu=function(){return!0},o.prototype.showInObjectTree=function(){return!0},o.prototype.setUserEditEnabled=function(t){this._userEditEnabled=t},o.prototype.userEditEnabled=function(){return this._userEditEnabled},o.prototype.canBeHidden=function(){return this.userEditEnabled()},o.prototype.isUserDeletable=function(){return this.userEditEnabled()},o.prototype.canHasAlert=function(){return!1},o.prototype.properties=function(){throw Error("Implement this fun in a subclass")},o.prototype.statusView=function(){return null},o.prototype.dataWindowView=function(){return null},o.prototype.priceAxisViews=function(t,e){return null},o.prototype.updateAllViews=function(){},o.prototype.paneViews=function(t){return null},o.prototype.isChildStudy=function(){return!1},o.prototype.hasChildren=function(){return!1},o.prototype.canHaveChildren=function(){return!1},o.prototype.onClickOutside=function(){},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return null},o.prototype.getDisplayPropertyPage=function(){return null},o.prototype.getVisibilitiesPropertyPage=function(){return null},o.prototype.getStrategyPropertyPage=function(){return null},o.prototype.getSourceIcon=function(){return null},inherit(n,o),n.prototype.isNoScale=function(){return!!this._isOverlay},n.prototype.base=function(){return 0},n.prototype.formatter=function(){return null},n.prototype.model=function(){return this._model},n.prototype.priceRange=function(t,e){return null},n.prototype.isDraggable=function(){return!this._metaInfo||!this._metaInfo.linkedToSeries},n.prototype.priceLineColor=function(t){return t},e.DataSource=o,e.PriceDataSource=n}).call(e,i(51))},function(t,e,i){(function(t,e,o){"use strict";var n,r,s,a,l;i(102),n=i(319).regExpEscape,r=i(181).TVXWindowEvents,s=i(287).TVLocalStorage,a=["s.tradingview.com","betacdn.tradingview.com"],l=window.TVSettings=function(){function i(t){return V+"."+t}
function o(t,e){var i;return i=D[t],window.is_authenticated&&!W||null!=i||(i=D[t]),null==i?e:i}function c(t,e){var i=o(t,void 0);if(null==i)return e;try{return JSON.parse(i)}catch(i){return f(t),e}}function h(t,e){var i=o(t);return null==i?e:!(!i||"false"===i||0==+i)}function u(t,e,i){var n,r=o(t,void 0,i);if(null==r)return e;if(n=parseFloat(r),!isFinite(n))throw new TypeError('"'+r+'" is not float (key: "'+t+'")');return n}function d(t,e,i){var n,r=o(t,void 0,i);if(null==r)return e;if(n=parseInt(r,10),!isFinite(n))throw new TypeError('"'+r+'" is not int (key: "'+t+'")');return n}function p(t,e,i){i=i||{};var o=""+e;return D[t]!==o&&(D[t]=o,g(t)),i.forceFlush&&!R&&(R=setTimeout(function(){R=void 0,v()},E)),l}function _(t,e,i){return p(t,JSON.stringify(e),i),l}function f(t,e){return e=e||{},null!=D[t]&&(delete D[t],g(t)),e.forceFlush&&v(),l}function m(){B=void 0,O.length&&v()}function g(t){if(H)null==D[t]?H.removeValue(i(t)):H.setValue(i(t),D[t]);else if(!window.is_authenticated||W)try{null==D[t]?s.removeItem(i(t)):s.setItem(i(t),D[t])}catch(t){}else O.push(t),B||(B=setTimeout(m,M));r.emit("settings",JSON.stringify({key:t,value:D[t]}))}function v(e){var i,o,n,r,s;if(!t.enabled("widget")&&window.is_authenticated&&!W&&0!==O.length){for(i=O,O=[],o={},n=i.length;n--;)r=i[n],s=D[r],void 0===s&&(s=null),o[r]=s;$.ajax({url:"/savesettings/",type:"POST",data:{delta:JSON.stringify(o)},async:!e})}}function y(){var t,e,i;for(t=0;t<s.length;t++)e=s.key(t),i=V.length,e.substring(0,i+1)===V+"."&&(O=[],s.removeItem(e));$.post("/restoredefaults/",{},function(t){TVDialogs.showNotice("Success","Defaults has been successfully restored")}).error(function(t){})}function b(){return Object.keys(D)}function S(t,e){var i,o=b(e),r=[];for(t=RegExp("^"+n(t).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi"),i=o.length-1;i>=0;i--)t.test(o[i])&&r.push(o[i]),t.lastIndex=0;return r}function w(t){for(var e=0;e<z.length;++e)if(z[e].exec(t))return!0;return!1}function T(){var e,i,o,n,r;for(D={},e=V+".",i=!t.enabled("save_chart_properties_to_local_storage"),o=s.length;o--;)(n=s.key(o))&&n.substring(0,e.length)===e&&(r=n.substring(e.length),i&&!w(r)||(D[r]=s.getItem(n)))}function x(t){var e,i,o,n,r;for(D={},e=0===Object.keys(t).length,i=V+".",o=s.length;o--;)(n=s.key(o))&&n.substring(0,i.length)===i&&(e&&(r=n.substring(i.length),p(r,s.getItem(n))),s.removeItem(n));Object.keys(t).forEach(function(e){D[e]=t[e]+""})}function C(){var t,e,i,o;if(TradingView.onWidget()&&a.includes(window.location.host))for(t="tradingview.",e=s.length;e--;)i=s.key(e),0===i.indexOf(t)&&(o=i.replace(t,V+"."),s.setItem(o,s.getItem(i)),s.removeItem(i))}function P(t){H?x(H.initialSettings||{}):window.is_authenticated&&!W?x(t||{}):(C(),T()),F.fire()}function L(t){H=t}var I,k,A,M,E,V,D,O,B,R,z,F,N=!1,W=t.enabled("cqg_terminal"),H=null;try{N=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(t){}return N?(I={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},k=function(t,e,i){var o=I[t];return null==o?e:o},
A=function(){},{loaded:!1,loadedModel:!1,getValue:k,getJSON:k,getBool:k,getFloat:k,getInt:k,setValue:A,setJSON:A,remove:A,restoreDefaults:A,keys:function(){return Object.keys(I)},keysMask:function(){return[]},sync:A,onSync:{subscribe:function(){}}}):(M=12e4,E=10,"local"===window.environment&&(M=5e3),V=TradingView.onWidget()?"tradingview-widget":"tradingview",D={},O=[],z=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^domepanel.visible$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^ChartFavoriteDrawingToolbarWidget\.visible/,/^trading\.chart\.proterty$/,/^trading_floating_toolbar\.position$/],r.on("settings",function(t){var e=JSON.parse(t);null==e.value?delete D[e.key]:D[e.key]=e.value}),F=new e,document.addEventListener("visibilitychange",function(){"hidden"!==document.visibiltyState&&!0!==document.hidden||v()}),window.addEventListener("unload",function(){v(!0)}),{loaded:!1,loadedModel:!1,getValue:o,getJSON:c,getBool:h,getFloat:u,getInt:d,setValue:p,setJSON:_,remove:f,restoreDefaults:y,keys:b,keysMask:S,sync:P,onSync:F,setSettingsAdapter:L})}(),void 0!==o&&o&&o.exports&&(o.exports=l)}).call(e,i(7),i(20),i(78)(t))},function(t,e){"use strict";function i(){return r.replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function o(){return n(12)}function n(t){var e,i,o="";for(e=0;e<t;++e)i=Math.round(Math.random()*(s.length-1)),o+=s[i];return o}var r,s;Object.defineProperty(e,"__esModule",{value:!0}),r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",s="0123456789abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",e.guid=i,e.randomHash=o,e.randomHashN=n},,,function(t,e,i){"use strict";function o(t){var e,i,o,n,r,s;if(this._name=t,e=u[t],e||(e={time:[],offset:[]},this._invalid=!0),e.time.length!==e.offset.length&&(e={time:[],offset:[]},this._invalid=!0),!e.time_utc){for(i=e.time,o=e.offset,n=i.length,r=Array(n),s=0;s<n;s++)i[s]*=1e3,o[s]*=1e3,r[s]=i[s]-o[s];e.time_utc=r}this.tz=e}function n(t,e){var i,o,n,s=t.length;if(0===s)return-1;if(isNaN(e))throw Error("Key is NaN");for(i=0,o=s-1,n=r((i+o)/2);;){if(t[n]>e){if((o=n-1)<i)return n}else if(i=n+1,o<i)return n<s-1?n+1:-1;n=r((i+o)/2)}}var r,s,a,l,c,h,u=i(1103).tzData;o.prototype.offset_utc=function(t){return o._offset(this.tz.time_utc,this.tz.offset,t)},o.prototype.offset_loc=function(t){return o._offset(this.tz.time,this.tz.offset,t)},o.prototype.is_valid=function(){return!this._invalid},o._offset=function(t,e,i){var o=n(t,i);return-1===o?0:e[o]},r=function(t){return 0|t},s=function(t){return 60*t*1e3},a=function(t){return 1e3*t},l=function(t,e){return r((r(t/1e3)-r(e/1e3))/60)},c=function(t,e){return r(r(t/1e3)-r(e/1e3))},h={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,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:s(1440),get_minutes_from_hhmm:function(t){
return-1!==t.indexOf(":")&&(t=t.split(":").join("")),t%100+60*r(t/100)},get_year:function(t){return t.getUTCFullYear()},get_month:function(t){return t.getUTCMonth()},get_hours:function(t){return t.getUTCHours()},get_minutes:function(t){return t.getUTCMinutes()},get_seconds:function(t){return t.getUTCSeconds()},get_day_of_month:function(t){return t.getUTCDate()},get_day_of_week:function(t){return t.getUTCDay()+1},get_day_of_year:function(t){var e=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0);return r((t.getTime()-e)/h.secondsPerDay)+1},get_week_of_year:function(t){var e=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),i=h.clone(t);return h.set_hms(i,0,0,0,0),i.setUTCDate(i.getUTCDate()+4-(i.getUTCDay()||7)),r(((i.getTime()-e)/h.secondsPerDay+1)/7)},get_minutes_from_midnight:function(t){return 60*h.get_hours(t)+h.get_minutes(t)},set_hms:function(t,e,i,o,n){t.setUTCHours(e),t.setUTCMinutes(i),t.setUTCSeconds(o),t.setUTCMilliseconds(n)},add_days_considering_dst:function(t,e,i){var o,n=t.offset_utc(e),r=this.clone(e);return this.add_date(r,i),o=t.offset_utc(r),r.setTime(r.getTime()+n-o),r},add_date:function(t,e){t.setTime(t.getTime()+e*h.secondsPerDay)},clone:function(t){return new Date(t.getTime())},get_days_per_year:function(t){var e=t.getUTCFullYear();return this.days_per_year(e)},days_per_year:function(t){return t%4!=0||t%100==0&&t%400!=0?365:366},get_part:function(t,e){switch(e){case h.YEAR:return h.get_year(t);case h.MONTH:return h.get_month(t);case h.DAY_OF_MONTH:return h.get_day_of_month(t);case h.WEEK_OF_YEAR:return h.get_week_of_year(t);case h.DAY_OF_WEEK:return h.get_day_of_week(t);case h.HOUR_OF_DAY:return h.get_hours(t);case h.MINUTE:return h.get_minutes(t);case h.DAY_OF_YEAR:return h.get_day_of_year(t);case h.SECOND:return h.get_seconds(t);default:return t.getTime()}},time_minutes:s,time_seconds:a,time_minutes_diff:l,time_seconds_diff:c,utc_to_cal:function(t,e){var i=t.offset_utc(e);return new Date(e+i)},get_cal:function(t,e,i,o){var n=new Date(Date.UTC(e,i,o)),r=t.offset_utc(+n);return new Date(n.valueOf()-r)},get_cal_utc:function(t,e,i){return new Date(Date.UTC(t,e,i))},cal_to_utc:function(t,e){var i=e.getTime();return i-t.offset_loc(i)},get_timezone:function(t){return new o(t)},shift_day:function(t,e){var i=t-1;return i+=e,i>6?i%=7:i<0&&(i=(7+i%7)%7),i+1}},t.exports=h},function(t,e,i){"use strict";function o(t,e,i,o,n){this._wptStudyId=o,this._pointsCount=n,m.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i,"mtp_wpt_down1ora",2)}function r(t,e,i){o.call(this,t,e,i,"mtp_wpt_down2orb",2)}function s(t,e,i){o.call(this,t,e,i,"mtp_wpt_down3",3)}function a(t,e,i){o.call(this,t,e,i,"mtp_wpt_down4",2)}function l(t,e,i){o.call(this,t,e,i,"mtp_wpt_down5",5)}function c(t,e,i){o.call(this,t,e,i,"mtp_wpt_downc",3)}function h(t,e,i){o.call(this,t,e,i,"mtp_wpt_up1ora",2)}function u(t,e,i){o.call(this,t,e,i,"mtp_wpt_up2orb",2)}function d(t,e,i){o.call(this,t,e,i,"mtp_wpt_up3",3)}function p(t,e,i){o.call(this,t,e,i,"mtp_wpt_up4",2)}function _(t,e,i){o.call(this,t,e,i,"mtp_wpt_up5",5)}function f(t,e,i){
o.call(this,t,e,i,"mtp_wpt_upc",3)}var m=i(135).LineStudyMtp;inherit(o,m),o.prototype._studyInputs=function(){var t,e,i,o,n=this.points();if(n.length<this.pointsCount())return null;for(t=[this.properties().inputs.displayZoneLabels.value()],e=0;e<this.pointsCount();++e){if(i=n[e].index,null===(o=this._model.mainSeries().bars().valueAt(i)))return null;t.push(1e3*o[TradingView.TIME_PLOT])}return t},o.prototype._mtpStudyId=function(){return this._wptStudyId},o.prototype.pointsCount=function(){return this._pointsCount},inherit(n,o),n.getTooltipText=function(t){return"Down Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(r,o),r.getTooltipText=function(t){return"Down Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(s,o),s.getTooltipText=function(t){return"Down Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(a,o),a.getTooltipText=function(t){return"Down Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(l,o),l.getTooltipText=function(t){return"Down Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(c,o),c.getTooltipText=function(t){return"Down Wave C: Select Point "+((t?t._points.length:0)+1)},inherit(h,o),h.getTooltipText=function(t){return"Up Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(u,o),u.getTooltipText=function(t){return"Up Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(d,o),d.getTooltipText=function(t){return"Up Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(p,o),p.getTooltipText=function(t){return"Up Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(_,o),_.getTooltipText=function(t){return"Up Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(f,o),f.getTooltipText=function(t){return"Up Wave C: Select Point "+((t?t._points.length:0)+1)},e.LineStudyMtpDownWave1OrA=n,e.LineStudyMtpDownWave2OrB=r,e.LineStudyMtpDownWave3=s,e.LineStudyMtpDownWave4=a,e.LineStudyMtpDownWave5=l,e.LineStudyMtpDownWaveC=c,e.LineStudyMtpUpWave1OrA=h,e.LineStudyMtpUpWave2OrB=u,e.LineStudyMtpUpWave3=d,e.LineStudyMtpUpWave4=p,e.LineStudyMtpUpWave5=_,e.LineStudyMtpUpWaveC=f},function(t,e,i){"use strict";function o(t,e,i,o,n,r){var s,a,h,u;return l.equalPoints(t,e)?null:(s=new l.Point(0,0),a=new l.Point(i,o),n?r?(h=c.intersectLineAndRectangle(l.lineThroughPoints(t,e),s,a),Array.isArray(h)?h:null):(u=c.intersectRayAndRectangle(e,t,s,a),null===u||l.equalPoints(e,u)?null:l.lineSegment(e,u)):r?(u=c.intersectRayAndRectangle(t,e,s,a),null===u||l.equalPoints(t,u)?null:l.lineSegment(t,u)):(h=c.intersectLineSegmentAndRectangle(l.lineSegment(t,e),s,a),Array.isArray(h)?h:null))}function n(t){return.3*t}function r(t){return 2+.5*t}function s(t){return null!==t&&void 0!==t&&!h.isNaN(t)}function a(t,e){void 0!==e&&u.setLineStyle(t,e)}var l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),l=i(1),c=i(98),h=i(34),u=i(101),e.extendAndClipLineSegment=o,e.optimalBarWidth=n,e.selectionTolerance=r,e.coordinateIsValid=s,e.setValidLineStyle=a},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),
o=i(4),n=i(33),r=i(49),s=i(1),a=i(19),l=i(21),c=i(101),h=function(){function t(t,e,i){this._data=null,this._hitTestResult=t||new o(o.MOVEPOINT),this._backHitTestResult=e||new o(o.MOVEPOINT_BACKGROUND),this._forceOverrideTransparency=!!i}return t.prototype.setData=function(t){this._data=t},t.prototype.draw=function(t){var e,i,o,n;null===this._data||this._data.points.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&c.setLineStyle(t,this._data.linestyle),e=this._data.points,i=e[0],o=e[1],n=o.subtract(i),t.beginPath(),t.rect(i.x,i.y,n.x,n.y),this._data.linewidth>0&&t.stroke(),this._data.fillBackground&&(t.fillStyle=this.getColor(),t.fill()))},t.prototype.hitTest=function(t){var e,i,o,a,l,c,h,u,d,p;return null===this._data||this._data.points.length<2||this._data.nohittest?null:(e=this._data.points,i=e[0],o=e[1],a=new s.Point(o.x,i.y),l=new s.Point(i.x,o.y),c=n.distanceToSegment(i,a,t),c.distance<=3?this._hitTestResult:(c=n.distanceToSegment(a,o,t),c.distance<=3?this._hitTestResult:(c=n.distanceToSegment(o,l,t),c.distance<=3?this._hitTestResult:(c=n.distanceToSegment(l,i,t),c.distance<=3?this._hitTestResult:this._data.fillBackground&&(h=Math.min(i.x,o.x),u=Math.max(i.x,o.x),d=Math.min(i.y,o.y),p=Math.max(i.y,o.y),i=new s.Point(h,d),o=new s.Point(u,p),r.pointInRectangle(t,i,o))?this._backHitTestResult:null))))},t.prototype.getColor=function(){var t=l.ensure(this._data);return a.generateColor(t.backcolor,t.transparency,this._forceOverrideTransparency)},t}(),e.RectangleRenderer=h},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STATUS_OFFLINE=0,e.STATUS_RESOLVING=1,e.STATUS_LOADING=2,e.STATUS_READY=3,e.STATUS_INVALID_SYMBOL=4,e.STATUS_SNAPSHOT=5,e.STATUS_EOD=6,e.STATUS_PULSE=7,e.STATUS_DELAYED=8,e.STATUS_DELAYED_STREAMING=9,e.STATUS_NO_BARS=10,e.STATUS_REPLAY=11,e.STYLE_BARS=0,e.STYLE_CANDLES=1,e.STYLE_LINE=2,e.STYLE_LINE_TYPE_MARKERS=0,e.STYLE_LINE_TYPE_STEP=1,e.STYLE_LINE_TYPE_SIMPLE=2,e.STYLE_AREA=3,e.STYLE_RENKO=4,e.STYLE_KAGI=5,e.STYLE_PNF=6,e.STYLE_PB=7,e.STYLE_HEIKEN_ASHI=8,e.STYLE_HOLLOW_CANDLES=9,e.STYLE_BASELINE=10,e.STYLE_SHORT_NAMES={},e.STYLE_SHORT_NAMES[e.STYLE_BARS]="bar",e.STYLE_SHORT_NAMES[e.STYLE_CANDLES]="candle",e.STYLE_SHORT_NAMES[e.STYLE_HOLLOW_CANDLES]="hollowCandle",e.STYLE_SHORT_NAMES[e.STYLE_LINE]="line",e.STYLE_SHORT_NAMES[e.STYLE_AREA]="area",e.STYLE_SHORT_NAMES[e.STYLE_RENKO]="renko",e.STYLE_SHORT_NAMES[e.STYLE_PB]="pb",e.STYLE_SHORT_NAMES[e.STYLE_KAGI]="kagi",e.STYLE_SHORT_NAMES[e.STYLE_PNF]="pnf",e.STYLE_SHORT_NAMES[e.STYLE_HEIKEN_ASHI]="ha",e.STYLE_SHORT_NAMES[e.STYLE_BASELINE]="baseline",e.SYMBOL_STRING_DATA={},e.SYMBOL_STRING_DATA[e.STYLE_RENKO]={type:"BarSetRenko@tv-prostudies"},e.SYMBOL_STRING_DATA[e.STYLE_PB]={type:"BarSetPriceBreak@tv-prostudies"},e.SYMBOL_STRING_DATA[e.STYLE_KAGI]={type:"BarSetKagi@tv-prostudies"},e.SYMBOL_STRING_DATA[e.STYLE_PNF]={type:"BarSetPnF@tv-prostudies"},e.SYMBOL_STRING_DATA[e.STYLE_HEIKEN_ASHI]={type:"BarSetHeikenAshi@tv-basicstudies"}},,function(t,e,i){
(function(t){"use strict";function o(e){e||(e={}),this.checkable=e.checkable||!1,this.checked=e.checked||null,this.enabled=void 0===e.enabled||e.enabled,this.visible=e.visible||!0,this.active=!0,this.font=e.font||"Arial",this.icon=e.icon||null,this.iconText=e.iconText||null,this.iconVisibleInMenu=e.iconVisibleMenu||!0,this.deleteButton=e.deleteButton||null,this.shortcut=null,this.setShortCut(e.shortcut,e.doNotBindShortcut),this.statusTip=e.statusTip||null,this.text=e.text||null,this.toolTip=e.toolTip||null,this.htmlclass=e.htmlclass||null,this.statName=e.statName||null,this._callbackContext=e.callbackContext||this,this._callbacks=new t,this.subActions=e.subActions||[]}function n(){o.call(this),this.font=null,this.subActions=null,this.htmlclass="action-separator"}function r(t){o.call(this),this.deferred=t}var s=i(306);o.prototype.callbacks=function(){return this._callbacks},o.prototype.callbackContext=function(){return this._callbackContext},o.prototype.setCallbackContext=function(t){this._callbackContext=t},o.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length},o.prototype.setChecked=function(t){this.checked=t},o.prototype._toggleChecked=function(){this.checked=!this.checked},o.prototype.setVisible=function(t){this.visible=t},o.prototype.setEnabled=function(t){this.enabled=t},o.prototype.disable=function(){this.setEnabled(!1)},o.prototype.enable=function(){this.setEnabled(!0)},o.prototype.setActive=function(t){this.active!==t&&(this.active=t,this.shortcut&&!this.doNotBindShortcut&&(t?this._bindShortCut():this._unbindShortCut()))},o.prototype.setShortCut=function(t,e){t&&(this.shortcut=t,!0!==e&&this._bindShortCut())},o.prototype._bindShortCut=function(){s.bind(this.shortcut,function(t){if(t.preventDefault(),this.enabled)return this.executeCallback(),!1}.bind(this))},o.prototype._unbindShortCut=function(){s.unbind(this.shortcut)},o.prototype.setIconVisible=function(t){this.iconVisibleInMenu=t},o.prototype.executeCallback=function(t){this._lastEvent=t,this._toggleChecked(),this._callbacks.fire(this)},inherit(n,o),inherit(r,o),e.Action=o,e.ActionSeparator=n,e.ActionPlaceholder=r}).call(e,i(20))},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){this._data=t,this._model=e,this.radius=this._data.radius||n.OUTER_RADIUS}function r(t){o.call(this,t)}var s=i(4),a=i(278).PaneRendererArrowsUpDown;i(102),o.RADIUS=3.5,o.prototype.tolerance=2,o.prototype.draw=function(t){function e(t){return void 0===t.x||TradingView.isNaN(t.x)||null===t.x||void 0===t.y||TradingView.isNaN(t.y)||null===t.y}var i,o,n;if(this._data)for(t.strokeStyle="#6B6B6B",t.fillStyle="#D6D6D6",i=this._data.vertOffset||0,o=0;o<this._data.points.length;o++)n=this._data.points[o],e(n)||this._drawMarker(t,n,i)},o.prototype._drawMarker=function(t,e,i){t.beginPath(),t.arc(e.x+.5,e.y+.5+i,o.RADIUS,0,2*Math.PI,!0),t.closePath(),t.fill(),t.stroke()},o.prototype.hitTest=function(t){var e,i;if(!this._data)return null;for(e=0;e<this._data.points.length;e++)if(i=this._data.points[e],
i.subtract(t).length()<=o.RADIUS+this.tolerance)return new s(this._data.hittestResult,i.data);return null},n.OUTER_RADIUS=TradingView.isMobile.any()?16:8,n.prototype.tolerance=2,n.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h=this._data.currentPoint,u=this._data.outerStrokeWidth||1;for(e=0;e<this._data.points.length;e++)i=this._data.points[e],o=i.subtract(h).length(),n=TradingView.isInteger(i.data)&&this._data.linePointBeingEdited===i.data,r=this.radius,s=this._data.strokeWidth||2,a=o<=r+this.tolerance,l=a?1:0,r+=l,s+=l,n||(i.square?(t.fillStyle=this._data.backgroundColor,t.fillRect(i.x-r,i.y-r,2*r,2*r),t.fillStyle=this._data.color,c=r-u,t.fillRect(i.x-c,i.y-c,2*c,2*c),c=r-u-s,t.fillStyle=this._data.backgroundColor,t.fillRect(i.x-c,i.y-c,2*c,2*c)):(t.beginPath(),t.arc(i.x,i.y,r,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.backgroundColor,t.fill(),t.beginPath(),t.arc(i.x,i.y,r-u,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.color,t.fill(),t.beginPath(),t.arc(i.x,i.y,r-u-s,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.backgroundColor,t.fill()))},n.prototype.hitTest=function(t){var e,i,o;for(e=0;e<this._data.points.length;e++)if(i=this._data.points[e],o=i.subtract(t).length(),o<=this.radius+this.tolerance)return new s(this._data.hittestResult,i.data);return null},inherit(r,o),r.prototype._drawMarker=function(t,e,i){var n=e.isUp?1:-1,r=a.prototype._calculateVerticalOffset(this._data.barSpacing),s=a.prototype._calculateMinHeight(this._data.barSpacing),l=i+n*r+n*s;t.beginPath(),t.arc(e.x+.5,e.y+.5+l,o.RADIUS,0,2*Math.PI,!0),t.closePath(),t.fill(),t.stroke()},e.SelectionRenderer=o,e.LineAnchor=n,e.SelectionRendererArrowsUpDown=r},,function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(498),n=i(497),r=i(1148),s=i(13),a=s.getLogger("Common.UndoHistory"),e.UndoHistory=function(){function t(t){return f&&e(),f=new n.UndoMacroCommand(t)}function e(){if(f){var t=f;f=null,t.isEmpty()||l(t)}}function i(){if(m.isEmpty())return!1;var t=m.pop();return!!t&&(t.undo(),g.push(t),a.logNormal("UNDO: "+t.text()),!0)}function s(){if(g.isEmpty())return!1;var t=g.pop();return!!t&&(t.redo(),m.push(t),a.logNormal("REDO: "+t.text()),!0)}function l(t){var e,i,o;f?f.addCommand(t):(g.clear(),e=m.head(),i=e&&e.text(),m.push(t),""!==(o=t.text())&&o!==i&&a.logNormal("DO: "+o)),t.executeOnPush()&&t.redo()}function c(){return{lastActualCommand:m.isEmpty()?null:m.head()}}function h(t){for(;!m.isEmpty()&&t.lastActualCommand!==m.head();)m.pop().undo();g.clear()}function u(){return m}function d(){return g}function p(){m.clear(),g.clear()}function _(t,e,i){if(t.value()!==e){var o=new r.SetWatchedValueCommand(t,e,i);this.pushUndoCommand(o),o.redo()}}var f=null,m=new o.UndoStack,g=new o.UndoStack;return{beginUndoMacro:t,clearStack:p,createUndoCheckpoint:c,endUndoMacro:e,pushUndoCommand:l,redo:s,redoStack:d,setWatchedValue:_,undo:i,undoStack:u,undoToCheckpoint:h}}()},function(t,e,i){"use strict";function o(t){var e=t.className,i=t.icon,o=void 0===i?"":i,r=t.onClick,s=t.title
;return n.createElement("span",{title:s,className:e,dangerouslySetInnerHTML:{__html:o},onClick:r})}Object.defineProperty(e,"__esModule",{value:!0});var n=i(2);e.Icon=o},,,function(t,e,i){(function(e){"use strict";var o=i(143),n=1e-10,r=function(){function t(t,e,i,o,n){var r,s=n,a=0;if(isNaN(t.get(e-1)))return{index:NaN,value:NaN};for(r=0;r<e;++r)o(t.get(r),s)&&(a=r,s=t.get(r));return{index:a,value:s}}function r(t,e){return 100*t/e}function s(t,e,i,o,n){var r,s,a;this._areaRight=t,this._areaLeft=e,this._pivotType=i,this._series=o,this._currentIndex=n.new_var(0),this._currentValue=n.new_var(NaN),this._pivotIndex=n.new_var(-1),this._index=w.n(n),this._isNewBar=n.symbol.isNewBar,r=this._currentIndex.get(1),s=this._currentValue.get(1),a=this._pivotIndex.get(1),this._index>1&&(this._currentIndex.set(r),this._currentValue.set(s),this._pivotIndex.set(a))}function a(t,e,i){var o,n,r,a,l;this._deviation=t,o=i.new_var(w.high(i)),n=i.new_var(w.low(i)),o.get(2*e+1),n.get(2*e+1),this._pivotHigh=new s(e,e,s.HIGH,o,i),this._pivotLow=new s(e,e,s.LOW,n,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=w.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed,r=this._lastIndex.get(1),a=this._lastVal.get(1),l=this._lastType.get(1),this._index>1&&this.addPivot(r,a,l),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function l(t){this.symbol=t,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0}function c(t){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=t}function h(t,e){this.timezone=t||"America/New_York",this.session=e||"0000-0000"}function u(t,e,i,o,n){this.periodBase=i,this.tickerid=t,this.period=e,this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.session=new S.Session,this.other_sessions={},this.script=o,this.ticker=u.parseTicker(t);var r=u.parsePeriod(e);this.resolution=r.resolution,this.interval=r.interval,this.bb_cache={},this.minTick=n}function d(t,e,i,o,n,r,s,a,c){this.body=n,this.symbols=[],this.runner=o,this.inputCallback=s,this.out=r,this.nonseriesOut=c,this.ctx=new l(this.add_sym(t,e,i,a)),this.init()}function p(t){this.symbols=[],this.barsets=[],this.subscription=[],this.host=t,this.isRecalculated=!1,this.start()}function _(t){p.feed=t}function f(t){this.runner=new p(t)}function m(t,e){this.info=t,this.bars=e||[],this.isBarClosed=!0}function g(t,e){this.period=t,this.generateEmptyBars=!!e}function v(){}var y="undefined"!=typeof window?window:e,b=y.PineJsCalendar?y.PineJsCalendar:i(67),S=i(82),w={};return w.max_series_size=10001,w.n=function(t){return t.symbol.index+1},w.nz=function(t,e){return e=e||0,isFinite(t)?t:e},w.na=function(t){return 0===arguments.length?NaN:isNaN(t)?1:0},w.isZero=function(t){return Math.abs(t)<=1e-10},w.toBool=function(t){return isFinite(t)&&!w.isZero(t)},w.eq=function(t,e){return w.isZero(t-e)},w.neq=function(t,e){return!w.eq(t,e)},w.ge=function(t,e){
return w.isZero(t-e)||t>e},w.gt=function(t,e){return!w.isZero(t-e)&&t>e},w.lt=function(t,e){return!w.isZero(t-e)&&t<e},w.le=function(t,e){return w.isZero(t-e)||t<e},w.and=function(t,e){return isNaN(t)||isNaN(e)?NaN:w.isZero(t)||w.isZero(e)?0:1},w.or=function(t,e){return isNaN(t)||isNaN(e)?NaN:w.isZero(t)&&w.isZero(e)?0:1},w.not=function(t){return isNaN(t)?NaN:w.isZero(t)?1:0},w.greaterOrEqual=function(t,e){return e-t<n},w.lessOrEqual=function(t,e){return t-e<n},w.equal=function(t,e){return Math.abs(t-e)<n},w.greater=function(t,e){return t-e>n},w.less=function(t,e){return e-t>n},w.max=Math.max,w.min=Math.min,w.pow=Math.pow,w.abs=Math.abs,w.log=Math.log,w.log10=function(t){return Math.log(t)/Math.LN10},w.sqrt=Math.sqrt,w.sign=function(t){return isNaN(t)?NaN:w.isZero(t)?0:t>0?1:-1},w.exp=Math.exp,w.sin=Math.sin,w.cos=Math.cos,w.tan=Math.tan,w.asin=Math.asin,w.acos=Math.acos,w.atan=Math.atan,w.floor=Math.floor,w.ceil=Math.ceil,w.round=Math.round,w.avg=function(t,e,i,o,n,r){var s,a;if(2===arguments.length)return(t+e)/2;for(s=0,a=0;a<arguments.length;a++)s+=arguments[a];return s/arguments.length},w.open=function(t){return t.symbol.open},w.high=function(t){return t.symbol.high},w.low=function(t){return t.symbol.low},w.close=function(t){return t.symbol.close},w.hl2=function(t){return(t.symbol.high+t.symbol.low)/2},w.hlc3=function(t){return(t.symbol.high+t.symbol.low+t.symbol.close)/3},w.ohlc4=function(t){return(t.symbol.open+t.symbol.high+t.symbol.low+t.symbol.close)/4},w.volume=function(t){return t.symbol.volume},w.updatetime=function(t){return t.symbol.updatetime},w.time=function(t,e,i){return t.symbol.bartime(e,i)},w.period=function(t){return t.symbol.period},w.tickerid=function(t){return t.symbol.tickerid},w.ticker=function(t){return t.symbol.ticker},w.interval=function(t){return t.symbol.interval},w.isdwm=function(t){return t.symbol.isdwm()},w.isintraday=function(t){return!t.symbol.isdwm()},w.isdaily=function(t){return"D"===t.symbol.resolution},w.isweekly=function(t){return"W"===t.symbol.resolution},w.ismonthly=function(t){return"M"===t.symbol.resolution},w.year=function(t){return w.timepart(t.symbol,b.YEAR,arguments[1])},w.month=function(t){return w.timepart(t.symbol,b.MONTH,arguments[1])},w.weekofyear=function(t){return w.timepart(t.symbol,b.WEEK_OF_YEAR,arguments[1])},w.dayofmonth=function(t){return w.timepart(t.symbol,b.DAY_OF_MONTH,arguments[1])},w.dayofweek=function(t){return w.timepart(t.symbol,b.DAY_OF_WEEK,arguments[1])},w.hour=function(t){return w.timepart(t.symbol,b.HOUR_OF_DAY,arguments[1])},w.minute=function(t){return w.timepart(t.symbol,b.MINUTE,arguments[1])},w.second=function(t){return w.timepart(t.symbol,b.SECOND,arguments[1])},w.selectSessionBreaks=function(t,e){var i,o,n,r,s,a;if(w.isdwm(t)||void 0===t.symbol.session.timezone)return[];if(i=u.newBarBuilder(t.symbol.period,t.symbol.session),o=[],n=e.length,i.moveTo(e[n-1]),1===n&&i.sessionStart===e[0])o.push(e[0]);else{for(r=n-2;r>=0;--r)(s=e[r])>=i.sessionStart||(i.moveTo(s),a=e[r+1],o.push(a));o.reverse()}return o},w.iff=function(t,e,i){
return w.not(t)?i:e},w.rising=function(t,e){for(var i=1;i<e+1;++i)if(t.get(i)>t.get(0))return 0;return 1},w.falling=function(t,e){for(var i=1;i<e+1;++i)if(t.get(i)<t.get(0))return 0;return 1},w.timepart=function(t,e,i){var o=b.utc_to_cal(t.timezone,i||t.bartime());return b.get_part(o,e)},w.rsi=function(t,e){return w.isZero(e)?100:w.isZero(t)?0:100-100/(1+t/e)},w.sum=function(t,e,i){var o=i.new_var(),n=w.nz(t.get())+w.nz(o.get(1))-w.nz(t.get(e));return o.set(n),n},w.sma=function(t,e,i){var o=w.sum(t,e,i);return w.na(t.get(e-1))?NaN:o/e},w.rma=function(t,e,i){var o=w.sum(t,e,i),n=e-1,r=t.get(n),s=i.new_var(),a=s.get(1),l=t.get(),c=w.na(r)?NaN:w.na(a)?o/e:(l+a*n)/e;return s.set(c),c},w.fixnan=function(t,e){var i=e.new_var();return isNaN(t)?i.get(1):(i.set(t),t)},w.tr=function(t,e){var i,o,n;return 1===arguments.length&&(e=t,t=void 0),i=void 0!==t&&!!t,o=e.new_var(w.close(e)),n=o.get(1),i&&isNaN(n)&&(n=w.close(e)),w.max(w.max(w.high(e)-w.low(e),w.abs(w.high(e)-n)),w.abs(w.low(e)-n))},w.atr=function(t,e){var i=e.new_var(w.tr(e));return w.sma(i,t,e)},w.ema=function(t,e,i){var o=w.sum(t,e,i),n=i.new_var(),r=t.get(0),s=t.get(e-1),a=n.get(1),l=w.na(s)?NaN:w.na(a)?o/e:2*(r-a)/(e+1)+a;return n.set(l),l},w.wma=function(t,e,i){var o,n,r=0;for(e=Math.round(e),o=e;o>=0;o--)n=e-o,r+=n*t.get(o);return 2*r/(e*(e+1))},w.vwma=function(t,e,i){var o=i.new_var(w.volume(i)),n=i.new_var(t.get(0)*w.volume(i));return w.sma(n,e,i)/w.sma(o,e,i)},w.swma=function(t,e){return(t.get(0)+2*t.get(1)+2*t.get(2)+t.get(3))/6},w.lowestbars=function(e,i,o){return-t(e,i,o,function(t,e){return w.lt(t,e)},Number.MAX_VALUE).index},w.lowest=function(e,i,o){return t(e,i,o,function(t,e){return w.lt(t,e)},Number.MAX_VALUE).value},w.highestbars=function(e,i,o){return-t(e,i,o,function(t,e){return w.gt(t,e)},Number.MIN_VALUE).index},w.highest=function(e,i,o){return t(e,i,o,function(t,e){return w.gt(t,e)},Number.MIN_VALUE).value},w.cum=function(t,e){var i=e.new_var(),o=w.nz(i.get(1))+t;return i.set(o),o},w.accdist=function(t){var e=w.high(t),i=w.low(t),o=w.close(t),n=w.volume(t);return w.cum(o===e&&o===i||e===i?0:n*(2*o-i-e)/(e-i),t)},w.correlation=function(t,e,i,o){var n=w.sma(t,i,o),r=w.sma(e,i,o),s=o.new_var(t.get()*e.get());return(w.sma(s,i,o)-n*r)/Math.sqrt(w.variance2(t,n,i)*w.variance2(e,r,i))},w.stoch=function(t,e,i,o,n){var s=w.highest(e,o),a=w.lowest(i,o);return w.fixnan(r(t.get()-a,s-a),n)},w.tsi=function(t,e,i,o){var n=o.new_var(w.change(t)),r=o.new_var(w.abs(w.change(t))),s=o.new_var(w.ema(n,i,o)),a=o.new_var(w.ema(r,i,o));return w.ema(s,e,o)/w.ema(a,e,o)},w.cross=function(t,e,i){function o(t){return t<0?-1:0===t?0:1}if(isNaN(t)||isNaN(e))return!1;var n=i.new_var(o(t-e));return!isNaN(n.get(1))&&n.get(1)!==n.get()},w.linreg=function(t,e,i){var o,n,r,s,a,l,c=0,h=0,u=0,d=0;for(o=0;o<e;++o)n=t.get(o),r=e-1-o,s=r+1,c+=s,h+=n,u+=s*s,d+=n*s;return a=(e*d-c*h)/(e*u-c*c),l=h/e,l-a*c/e+a+a*(e-1-i)},w.sar=function(t,e,i,o){function n(e,i){var o=m.get();return g.set(e),m.set(i),v.set(1e3*t),y.set(o),o}
var r,s,a=w.high(o),l=w.low(o),c=w.close(o),h=o.new_var(a),u=o.new_var(l),d=o.new_var(c),p=d.get(1),_=u.get(1),f=h.get(1),m=o.new_var(),g=o.new_var(),v=o.new_var(),y=o.new_var(),b=y.get(1);if(isNaN(p))return NaN;if(r=1e-7,isNaN(b)&&(w.ge(c,p)?(g.set(1),m.set(Math.max(a,f)),b=Math.min(l,_)):(g.set(-1),b=Math.max(a,f),m.set(Math.min(l,_))),v.set(1e3*t)),1===g.get()){if(w.gt(a,m.get())&&(m.set(a),v.set(Math.min(v.get()+1e3*e,1e3*i))),w.le(l,b))return n(-1,l)}else if(w.lt(l,m.get())&&(m.set(l),v.set(Math.min(v.get()+1e3*e,1e3*i))),w.ge(a,b))return n(1,a);return s=b+v.get()*(m.get()-b)/1e3,1===g.get()?w.ge(s,l)&&(s=l-r):w.le(s,a)&&(s=a+r),y.set(s),s},w.alma=function(t,e,i,o){var n,r,s,a=Math.floor(i*(e-1)),l=e/o*(e/o),c=[],h=0;for(n=0;n<e;++n)r=Math.exp(-1*Math.pow(n-a,2)/(2*l)),h+=r,c.push(r);for(n=0;n<e;++n)c[n]/=h;for(s=0,n=0;n<e;++n)s+=c[n]*t.get(e-n-1);return s},w.wvap=function(t,e){return t.get()-t.get(1)},w.change=function(t){return t.get()-t.get(1)},w.roc=function(t,e){var i=t.get(e);return 100*(t.get()-i)/i},w.dev=function(t,e,i){var o=w.sma(t,e,i);return w.dev2(t,e,o)},w.dev2=function(t,e,i){var o,n,r,s=0;for(o=0;o<e;o++)n=t.get(o),r=w.abs(n-i),s+=r;return s/e},w.stdev=function(t,e,i){var o=w.variance(t,e,i);return w.sqrt(o)},w.variance=function(t,e,i){var o=w.sma(t,e,i);return w.variance2(t,o,e)},w.variance2=function(t,e,i){var o,n,r,s=0;for(o=0;o<i;o++)n=t.get(o),r=w.abs(n-e),s+=r*r;return s/i},w.percentrank=function(t,e){var i,o,n,r;if(w.na(t.get(e-1)))return NaN;for(i=0,o=t.get(),n=1;n<e;n++)r=t.get(n),w.ge(o,r)&&i++;return 100*i/e},w.createNewSessionCheck=function(t){var e=u.newBarBuilder(t.symbol.period,t.symbol.session);return function(t){return e.indexOfBar(t)===S.POST_SESSION&&(e.moveTo(t),!0)}},s.LOW=0,s.HIGH=1,s.prototype.isPivotFound=function(){return-1!==this._pivotIndex.get()},s.prototype.pivotIndex=function(){return this._pivotIndex.get()},s.prototype.currentValue=function(){return this._currentValue.get()},s.prototype.pivotType=function(){return this._pivotType},s.prototype.reset=function(){this._currentValue.set(NaN),this._currentIndex.set(0),this._pivotIndex.set(-1)},s.prototype.isRightSideOk=function(t){return t-this._currentIndex.get()===this._areaRight},s.prototype.isViolate=function(t,e){if(t<1||isNaN(this._currentValue.get()))return!0;var i=this._series.get(this._index-t);return!!isNaN(i)||(i===this._currentValue.get()?e:this._pivotType===s.HIGH?i>this._currentValue.get():i<this._currentValue.get())},s.prototype.processPoint=function(t){this.isViolate(t,!1)&&(this._currentValue.set(this._series.get()),this._currentIndex.set(t))},s.prototype.isRestartNeeded=function(t){return t-this._currentIndex.get()>this._areaRight},s.prototype.update=function(){var t,e;if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(-1===this._pivotIndex.get()){for(t=!0,e=0;e<this._areaLeft;++e)if(this.isViolate(this._currentIndex.get()-1-e,!0)){t=!1;break}t&&this._pivotIndex.set(this._currentIndex.get())}
}else-1!==this._pivotIndex.get()&&this._pivotIndex.set(-1);if(this.isRestartNeeded(this._index))for(this.reset(),e=0;e<=this._areaRight;++e)this.processPoint(this._index-this._areaRight+e)},a.prototype.addPivot=function(t,e,i){this._lastIndex.set(t),this._lastVal.set(e),this._lastType.set(i)},a.prototype.updatePivot=function(t,e){this._lastIndex.set(t),this._lastVal.set(e)},a.prototype.lastPrice=function(){return this._lastVal.get()},a.prototype.lastIndex=function(){return this._lastIndex.get()},a.prototype.addPoint=function(t,e,i){var o;return isNaN(this._lastVal.get())?void this.addPivot(t,e,i):(o=this._lastVal.get(),this._lastType.get()===i?void((i===s.HIGH?e>o:e<o)&&this.updatePivot(t,e)):void(Math.abs(o-e)/e>this._deviation&&this.addPivot(t,e,i)))},a.prototype.processPivot=function(t){t.update(),this._isBarClosed&&t.isPivotFound()&&this.addPoint(t.pivotIndex(),t.currentValue(),t.pivotType())},w.zigzag=function(t,e,i){return new a(t,e,i).lastPrice()},w.zigzagbars=function(t,e,i){var o=new a(t,e,i);return-1===o.lastIndex()?NaN:o.lastIndex()-w.n(i)},l.prototype.new_sym=function(t,e,i){return this.symbol.script.add_sym(t,e,i)},l.prototype.select_sym=function(t){this.symbol=this.symbol.script.get_sym(t)},l.prototype.new_var=function(t){var e,i=this.vars;return i.length<=this.vars_index&&i.push(new c(this.symbol)),e=i[this.vars_index++],arguments.length>0&&e.set(t),e},l.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new l(this.symbol)),this.ctx[this.ctx_index++]},l.prototype.prepare=function(t){var e,i;for(this.ctx_index=0,this.vars_index=0,e=0;e<this.vars.length;e++)this.vars[e].prepare(t);for(i=0;i<this.ctx.length;i++)this.ctx[i].prepare(t)},l.prototype.stop=function(){this.symbol=null,this.vars=null},c.prototype.valueOf=function(){return this.get(0)},c.prototype.get=function(t){return isNaN(t)&&(t=0),t=t||0,this.hist?t>=this.hist.length?(console.error("not enough depth: "+this),NaN):this._get(t):(this.mindepth=w.max(this.mindepth,t),NaN)},c.prototype._get=function(t){var e=this.hist_pos-t;return e<0&&(e+=this.hist.length),this.hist[e]},c.prototype.set=function(t){this.hist&&(this.hist[this.hist_pos]=t,this.modified=!0)},c.prototype.prepare=function(t){t===this.symbol&&(t.isNewBar?(this.original=this.get(0),!this.modified&&this.hist||this.add_hist()):this.set(this.original),this.modified=!1)},c.prototype.add_hist=function(){var t,e,i;if(!this.hist){for(t=w.na(this.mindepth)?w.max_series_size:w.min(this.mindepth+1,w.max_series_size),t=Math.round(t),e=Array(t),i=0;i<t;i++)e[i]=NaN;this.hist=e,this.hist_pos=-1}this.hist_pos=Math.min(this.hist_pos+1,this.hist.length),this.hist_pos===this.hist.length&&(this.hist_pos=this.hist.length-1,this.hist.shift(),this.hist.push(NaN)),this.hist[this.hist_pos]=this.original},c.prototype.adopt=function(t,e,i){var o,n,r,s;return this.hist||(this.mindepth=NaN),o=e.get(),n=t.indexOf(o),0!==i&&(r=e.get(1),w.na(r)||(s=t.indexOf(r),n=n===s?-1:n)),n<0?NaN:this._get(n)},c.prototype.indexOf=function(t){var e,i,n,r
;return this.hist?w.na(t)?-1:(e=this.hist.length,i=this.symbol.index+1,n=Math.min(e,i),r=o.upperbound_int(this.hist,t,0,n),0===r?-1:n-r):(this.mindepth=NaN,-1)},u.parseTicker=function(t){var e=t.indexOf(":");return-1===e?t:t.substr(e+1)},u.parsePeriod=function(t){var e,i,o,n,r,s,a,l;return t+="",e=t.slice(0),i=e.indexOf(",")>=0,i&&(n=e.split(","),o=u.parsePeriod(n[1]),e=n[0]),r=!1,s=!1,a=e[e.length-1],-1==="DWM".indexOf(a)&&("S"===a?s=!0:(r=!0,a="")),l=parseInt(r?e:e.length>1?e.slice(0,e.length-1):1),{resolution:a,interval:l,pureResolution:""+l+a,isIntraday:r,isSeconds:s,range:o}},u.newBarBuilder=function(t,e,i){var o=u.parsePeriod(t);return S.newBarBuilder(o.resolution,o.interval,e,i)},u.newSession=function(t,e){var i=b.get_timezone(t);return(new S.Session).init(i,e)},u.prototype.set_symbolinfo=function(t){t||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=t,this.timezone=b.get_timezone(t.timezone),this.session.init(this.timezone,t.session);for(var e in this.other_sessions)this.other_sessions.hasOwnProperty(e)&&this.other_sessions[e].init(this.timezone,e)},u.prototype.get_session=function(t){if(!t)return this.session;var e=this.other_sessions[t];return e||(e=new S.Session,this.other_sessions[t]=e),e},u.prototype.isdwm=function(){return""!==this.resolution&&"S"!==this.resolution},u.prototype.enable_dwm_aligning=function(t,e){this.dwm_aligner=u.newBarBuilder(this.period,t,e)},u.prototype.bartime=function(t,e){var i,o,n,r,s=this.time;return t&&(i=t,e&&(i+=e),o=this.bb_cache[i],o||(n=this.get_session(e),o=u.newBarBuilder(t,n),this.bb_cache[i]=o),s=o.alignTime(s)),!this.isdwm()||isNaN(s)?s:(r=b.utc_to_cal(this.timezone,s),this.session.spec.correctTradingDay(r,this.timezone),b.cal_to_utc(this.timezone,r))},u.prototype.lastbar=function(t){var e,i;isNaN(t.time)||(e=t.time,this.dwm_aligner&&(this.dwm_aligner.moveTo(e),e=this.dwm_aligner.startOfBar(0)),i=this.time!==e,i&&this.index>=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),this.time=e,this.open=t.open,this.high=t.high,this.low=t.low,this.close=t.close,this.volume=t.volume,this.updatetime=t.updatetime,this.isNewBar=i,this.isBarClosed=t.isBarClosed,this.isLastBar=t.isLastBar,this.isNewBar&&this.index++,this.script.calc(this))},d.prototype.calc=function(t){var e,i,o=this.ctx,n=this.body;o.prepare(t),e=n.main(o,this.inputCallback),i=this,!isNaN(o.symbol.time)&&this.out&&e&&(e.nonseries?("projection"===e.type&&(e.projectionTime=o.symbol.time),this.nonseriesOut(o.symbol,e)):e.bars?e.bars.forEach(function(t){i.out(o.symbol,t)}):this.out(o.symbol,e))},d.prototype.init=function(){var t=this.ctx,e=this.body;e.init&&e.init(t,this.inputCallback),e.main(t,this.inputCallback)},d.prototype.add_sym=function(t,e,i,o){var n=this.runner.add_sym(t,e,i,this,o);return this.symbols.push(n),n.isdwm()&&this.symbols.length>1&&n.enable_dwm_aligning(this.symbols[0].session,n.session),n},d.prototype.stop=function(){this.symbols=null,this.ctx.stop(),this.ctx=null},d.prototype.get_sym=function(t){return this.symbols[t]},
p.prototype.add_sym=function(t,e,i,o,n){var r=new u(t,e,i,o,n);return this.symbols.push(r),r},p.prototype.get_sym=function(t){return this.symbols[t]},p.prototype.out=function(t,e){if(this.nonseriesUpdate){var i=$.extend({},this.nonseriesUpdate);e.splice(0,0,t.time),i.lastBar=e,this.host.nonseriesOut(t,i)}else this.host.out(t,e)},p.prototype.start=function(){function t(t,o){var n=p.feed.subscribe(t.tickerid,t.period,t.periodBase,function(i){"series"==(i.nonseries?"nonseries":"series")?e.update(o,i):i.lastBar?(e.nonseriesUpdate=i,i.lastBar.isLastBar=!0,e.symbols[0].lastbar(i.lastBar),e.nonseriesUpdate=null):r.nonseriesOut(t,i)},r.onErrorCallback,r.symbolInfo,r.sessionId,r.rangeExtension);i.push(n)}var e,i,o,n,r=this.host;for(this._script=new d(r.tickerid,r.period,r.periodBase||r.period,this,r.body,this.out.bind(this),r.input,r.symbolInfo.minmov/r.symbolInfo.pricescale,r.nonseriesOut),e=this,i=[],o=this.symbols,n=0;n<o.length;n++)t(o[n],n);this.subscription=i},p.prototype.stop=function(){var t,e=this.subscription;if(!e&&!this._script)return void console.warn("Recurring script engine stop happened.");for(t=0;t<e.length;t++)p.feed.unsubscribe(e[t]);this.subscription=null,this._script.stop(),this._script=null,this.symbols=null},p.prototype.update=function(t,e){var i,o;if(!e)return void console.error("Unexpected barset = null");i=this.symbols[t],this.isRecalculated?(o=e.bar(e.count()-1),o.isBarClosed=e.isLastBarClosed(),o.isLastBar=!0,i.lastbar(o)):this.barsets[t]||(this.barsets[t]=e,i.set_symbolinfo(e.symbolinfo()),this.recalc())},p.prototype.recalc=function(){var t,e,i,o,n,r,s,a=this.symbols;for(t=0;t<a.length;t++)if(!this.barsets[t])return;for(e=a.length-1;e>=0;e--)for(i=a[e],o=this.barsets[e],n=o.count(),r=0;r<n;r++)s=o.bar(r),s.isLastBar=r===n-1,s.isBarClosed=!s.isLastBar||o.isLastBarClosed(),i.lastbar(s);this.isRecalculated=!0,this.barsets[0]&&this.barsets[0].endOfData&&this.host.setNoMoreData(),this.host.recalc(this,{endOfData:this.barsets[0].endOfData,nextTime:this.barsets[0].nextTime})},p.feed={subscribe:function(t,e,i,o){console.error("must be initialized with setupFeed")},unsubscribe:function(t){console.error("must be initialized with setupFeed")}},f.prototype.stop=function(){this.runner.stop()},m.prototype.symbolinfo=function(){return this.info},m.prototype.isLastBarClosed=function(){return this.isBarClosed},m.prototype.setLastBarClosed=function(t){this.isBarClosed=t},m.prototype.bar=function(t){return this.bars[t]},m.prototype.count=function(){return this.bars.length},m.prototype.add=function(t,e){var i=t,o=this.bars,n=o.length,r=i.time,s=0===n?NaN:o[n-1].time;0===n||s<r?o.push(i):s===r?o[n-1]=i:console.error("time order violation, prev: "+new Date(s).toUTCString()+", cur: "+new Date(r).toUTCString()),this.isBarClosed=!!e},g.prototype.init=function(t){this.bb=u.newBarBuilder(this.period,t.symbol.session),this.bbEmptyBars=this.generateEmptyBars?u.newBarBuilder(this.period,t.symbol.session):void 0},g.prototype.extrapolate=function(t,e){
return isNaN(t)||isNaN(e)?void 0:S.extrapolateBarsFrontToTime(this.bbEmptyBars,t,e)},g.prototype.main=function(t){var e=t.symbol.time,i=this.bb.alignTime(e),o=t.new_var(i),n=w.na(i),r=o.get(1),s=w.na(r)?1:w.neq(i,r),a=t.new_var(),l=t.new_var(),c=t.new_var(),h=t.new_var(),u=a.get(1),d=l.get(1),p=c.get(1),_=h.get(1),f=n?NaN:s?w.open(t):u,m=n?NaN:s?w.high(t):w.max(w.high(t),d),g=n?NaN:s?w.low(t):w.min(w.low(t),p),v=n?NaN:w.close(t),y=n?NaN:s?w.volume(t):w.volume(t)+_,b=n?NaN:e,S=t.symbol.isBarClosed&&this.bb.isLastBar(0,e),T=this.generateEmptyBars&&s?this.extrapolate(r,i):void 0,x=t.new_var(w.close(t)),C=x.get(1),P=T instanceof Array?C:NaN;return a.set(f),l.set(m),c.set(g),h.set(y),[i,f,m,g,v,y,b,S,T,P]},v.prototype.main=function(t){return[w.open(t),w.high(t),w.low(t),w.close(t),w.volume(t),w.updatetime(t)]},{Std:w,Series:c,Symbol:u,SymbolInfo:h,StudyEngine:f,BarSet:m,OHLCV:v,BarBuilder:g,setupFeed:_}}();t.exports=r}).call(e,function(){return this}())},,function(t,e,i){(function(e){"use strict";var o=i(480).ExchangeSession,n=function(){function t(t,e,i,o){return""===t?new h(60*e,i):"S"===t?new h(e,i):new u(i,o,e,n(t,i))}function n(t,e){switch(t){case"D":return new S(e);case"W":return new w(e);case"M":return new T(e)}return console.error("unknown dwm resolution: "+t),null}function r(t,e,i,o,n){var r,s,a,l,c,h,u,d=(new C).init("UTC",t),p=""!==e;return p?(s=i*E[e],r=E.D):(s=60*i*1e3,r=60*d.spec.findSessionEntry(0,0).length()*1e3),a=r/s,l=p?7:7-d.spec.weekEndsCount(),c=l*a,o<c?(h=o/a,n-h*E.D):(u=o/c,n-u*E.W)}function s(t,e,i,o){if("number"!=typeof i||"number"!=typeof e||isNaN(i)||isNaN(e))throw Error("Cannot extrapolate from "+e+" to "+i);return l(t,e,function(t,e){return e>i||o&&t.length>o})}function a(t,e,i){return l(t,e,function(t,e){return t.length>=i})}function l(t,e,i){var o,n,r,s,a,l=e;for(t.moveTo(l),o=[],n=0,r=0;!i(o,l);){if(n>5)throw console.trace(["0x10",new Date(e),"->",new Date(l)]),Error("Internal error 0x10 while extrapolating.");if((s=t.indexOfBar(l))===I)l=t.startOfBar(0);else if(s===k)l=t.startOfBar(k);else{if((a=t.startOfBar(s))!==e){if(r&&r===a)throw console.trace(["0x11",new Date(e),"->",new Date(a)]),Error("Internal error 0x11 while extrapolating.");r=a,n=0,o.push(a)}l=t.startOfBar(s+1)}t.moveTo(l),n++}return o}function c(t){if(isNaN(t))return NaN;var e=this.indexOfBar(t);return e===k&&(this.moveTo(t),e=this.indexOfBar(t)),e<0?NaN:this.startOfBar(e)}function h(t,e){this.period=t,this.session=e,this.sessionStart=Number.MIN_VALUE,this.sessionEnd=Number.MIN_VALUE}function u(t,e,i,o){this.period=i,this.sessionTgt=t,this.sessionSrc=e||t,this.builder=o,this.periodStart=-Number.MAX_VALUE,this.periodEnd=-Number.MAX_VALUE,this.periodLastBarStart=-Number.MAX_VALUE}function d(t,e,i){var o=M.clone(i);return e.alignToSessionStart(o,t),M.cal_to_utc(t,o)}function p(t,e){var i=M.get_day_of_week(e)-t.firstDayOfWeek();return i<0?i+7:i}function _(t,e){var i=e+t.firstDayOfWeek();return i>M.SATURDAY?i-M.SATURDAY:i}function f(t,e){var i=M.get_day_of_year(e)-1,o=p(t,e)-i%7;return 0===o?x(i/7):(o>=0&&(o-=7),x((o+i)/7))}
function m(t,e,i){var o,n=0;for(o=e;o<i;++o)n+=t.isWeekEnd(_(t,o))?1:0;return n}function g(t,e){var i=new Date(Date.UTC(e,11,31,23,59)),o=M.days_per_year(e)-v(t,i);return M.get_day_of_week(i)!==M.SUNDAY&&M.get_day_of_week(i)!==M.SATURDAY||o--,o}function v(t,e){var i,o,n=M.get_day_of_year(e)-1,r=p(t,e),s=r-n%7;return s<0&&(s+=7),i=0,n<7-s?i+=m(t,s,r):(o=0===s?0:m(t,s,7),i+=m(t,0,r)+o),i+f(t,e)*t.weekEndsCount()}function y(){}function b(t){this.sessionsSpec=t}function S(t){this.session=t}function w(t){this.session=t}function T(t){this.session=t}function x(t){return 0|t}function C(){}function P(t,e,i){var o,n,r,s,a=t.length;if(0===a)return-1;for(o=0,n=a-1,r=x((o+n)/2);;){if(0===(s=i(t[r],e))||s>0){if((n=r-1)<o)return r}else if(o=r+1,n<o)return r<a-1?r+1:-1;r=x((o+n)/2)}}function L(t,e){var i=M.utc_to_cal(e.timezone,+t),o=M.get_day_of_week(i),n=M.get_minutes_from_midnight(i),r=e.spec.findSessionEntry(o,n);return r.isOvernight()&&n>r.start()+r.length()&&o===r.dayOfWeek()-1&&(o++,n-=1440),o===r.dayOfWeek()&&n>=r.start()&&n<r.start()+r.length()}var I=-1,k=-2,A="undefined"!=typeof window?window:e,M=A.PineJsCalendar?A.PineJsCalendar:i(67),E={S:1e3,D:864e5,W:6048e5,M:2592e6};return h.prototype.alignTime=c,h.prototype.alignTimeIfPossible=function(t){var e=this.alignTime(t);return isNaN(e)?t:e},h.prototype.indexOfBar=function(t){return t<this.sessionStart?I:t>=this.sessionEnd?k:x(M.time_seconds_diff(t,this.sessionStart)/this.period)},h.prototype.startOfBar=function(t){if(t===k)return this.sessionEnd;if(t<0)throw Error("Negative offset is not supported");return this.sessionStart+M.time_seconds(this.period*t)},h.prototype.isLastBar=function(t,e){return e>=this.sessionStart+M.time_seconds(this.period*(t+1)-1)},h.prototype.moveTo=function(t){var e=this.session.timezone,i=M.utc_to_cal(e,t),o=this.session.spec,n=o.alignToSessionStart(i,this.session.timezone);this.sessionStart=M.cal_to_utc(e,i),this.sessionEnd=this.sessionStart+M.time_minutes(n)},u.prototype.alignTime=c,u.prototype.alignTimeIfPossible=function(t){return this.tradingDayToSessionStart(t)},u.prototype.tradingDayToSessionStart=function(t){return this.moveTo(t),this.startOfBar(0)},u.prototype.indexOfBar=function(t){return t<this.periodStart?I:t>=this.periodEnd?k:0},u.prototype.startOfBar=function(t){if(t===k||t>0)return this.periodEnd;if(t===I)throw Error("PRE_SESSION is not supported");return this.periodStart},u.prototype.isLastBar=function(t,e){return e>=this.periodLastBarStart},u.prototype.moveTo=function(t){var e,i,o,n,r,s,a,l,c=M.utc_to_cal(this.sessionSrc.timezone,t);c=this.sessionSrc.spec.correctTradingDay(c,this.sessionSrc.timezone),e=this.sessionTgt.timezone,i=this.builder.indexOfPeriod(c,e),o=x(i/this.period)*this.period,n=M.get_year(c),r=this.sessionTgt.spec,s=this.builder.startOfPeriod(e,o,n),this.periodStart=d(e,r,s),a=o+this.period,l=this.builder.startOfPeriod(e,a,n),this.periodEnd=d(e,r,l),M.add_date(l,-1),this.moveToPrevWorkDay(r,l),this.periodLastBarStart=d(e,r,l),
(this.periodLastBarStart<this.periodStart||this.periodLastBarStart===this.periodEnd)&&(this.periodLastBarStart=this.periodStart)},u.prototype.moveToPrevWorkDay=function(t,e){for(;t.isWeekEnd(M.get_day_of_week(e));)M.add_date(e,-1)},y.prototype.indexOfPeriod=function(t){return M.get_day_of_year(t)-1},y.prototype.startOfPeriod=function(t,e,i){var o=M.get_cal(t,i,M.JANUARY,1),n=M.add_days_considering_dst(t,o,e);return M.utc_to_cal(t,+n)},b.prototype.uber=new y,b.prototype.indexOfPeriod=function(t){return this.uber.indexOfPeriod(t)-v(this.sessionsSpec,t)},b.prototype.startOfPeriod=function(t,e,i){function o(t,e){this.weekEnds=m(t,e,7),this.calendarDays=7-e,this.businessDays=this.calendarDays-this.weekEnds}function n(t,e){var i,o=0;for(i=t;i<7&&(s.sessionsSpec.isWeekEnd(_(s.sessionsSpec,i))||!(--e<0));++i)o++;return o}function r(t,e,i){var o,n,r,a,l,c,h=0,u=i%(7-s.sessionsSpec.weekEndsCount());for(o=0,n=u-(0===t?0:e.businessDays);o<7&&n>0;++o)r=s.sessionsSpec.isWeekEnd(_(s.sessionsSpec,o)),h+=r?1:0,n-=r?0:1;return a=e.weekEnds+h,l=x((i-e.businessDays)/(7-s.sessionsSpec.weekEndsCount())),c=a+s.sessionsSpec.weekEndsCount()*l,i+c}var s,a,l,c,h;return e>=g(this.sessionsSpec,i)&&(i++,e=0),s=this,a=new Date(Date.UTC(i,M.JANUARY,1)),l=p(this.sessionsSpec,a),c=new o(this.sessionsSpec,l),h=e<c.businessDays?n(l,e):r(l,c,e),this.uber.startOfPeriod(t,h,i)},S.prototype.indexOfPeriod=function(t){return this.builder().indexOfPeriod(t)},S.prototype.startOfPeriod=function(t,e,i){return this.builder().startOfPeriod(t,e,i)},S.prototype.builder=function(){return this._builder||(this._builder=this.session.spec.hasWeekEnds()?new b(this.session.spec):new y),this._builder},w.prototype.indexOfPeriod=function(t,e){var i=f(this.session.spec,t);return 0===i&&t<this.startOfPeriod(e,0,M.get_year(t))&&(i=-1),i},w.prototype.startOfPeriod=function(t,e,i){var o,n,r=new Date(Date.UTC(i,M.JANUARY,1)),s=p(this.session.spec,r),a=0===s?7*e:7*(e+1)-s,l=M.get_days_per_year(r);return a>l?this.startOfPeriod(t,0,i+x(a/l)):(o=M.get_cal(t,i,M.JANUARY,1),n=M.add_days_considering_dst(t,o,a),M.utc_to_cal(t,+n))},T.prototype.indexOfPeriod=function(t){return M.get_month(t)},T.prototype.startOfPeriod=function(t,e,i){var o,n,r,s;return e<0?(o=x((11-e)/12),i-=o,e+=12*o):e>M.DECEMBER&&(i++,e=M.JANUARY),n=M.get_cal_utc(i,e,1),r=p(this.session.spec,n),r>4&&(s=7-r,M.add_date(n,s)),n},C.prototype.init=function(t,e){return this.timezone="string"==typeof t?M.get_timezone(t):t,this.spec=new o(e),this},{PRE_SESSION:I,POST_SESSION:k,LASTBAR_SESSION:-3,newBarBuilder:t,Session:C,alignPeriodsBack:r,extrapolateBarsFrontByCount:a,extrapolateBarsFrontToTime:s,lower_bound:P,isTradingNow:L,numberOfFullWeeks:f,numberOfWeekEndsSinceYearStart:v,BusinessDaysBuilder:b,alignExchangeTimeToSessionStartAndReturnUTC:d}}();t.exports=n}).call(e,function(){return this}())},function(t,e,i){"use strict";for(var o={LineToolFibRetracement:i(871).LineToolFibRetracement,LineToolFibChannel:i(867).LineToolFibChannel,LineToolFibSpeedResistanceArcs:i(873).LineToolFibSpeedResistanceArcs,
LineToolProjection:i(918).LineToolProjection,LineToolTrendBasedFibExtension:i(936).LineToolTrendBasedFibExtension,LineToolElliott:i(134).LineToolElliott,LineToolFibCircles:i(869).LineToolFibCircles,LineToolTrading:i(277),LineStudyMtp:i(135).LineStudyMtp,LineToolVertLine:i(946).LineToolVertLine,LineToolBarsPattern:i(843).LineToolBarsPattern,LineToolTrendBasedFibTime:i(938).LineToolTrendBasedFibTime,LineToolFibTimeZone:i(879).LineToolFibTimeZone,LineToolCircleLines:i(853).LineToolCircleLines,LineToolDateRange:i(859).LineToolDateRange,LineToolPriceRange:i(916).LineToolPriceRange,LineToolDateAndPriceRange:i(857).LineToolDateAndPriceRange,LineToolParallelChannel:i(903).LineToolParallelChannel,LineToolTrendAngle:i(934).LineToolTrendAngle,LineToolTrendLine:i(211).LineToolTrendLine,LineToolArrowMark:i(163).LineToolArrowMark,LineToolExecution:i(413).LineToolExecution,LineToolPitchfan:i(905).LineToolPitchfan,LineToolGannSquare:i(886).LineToolGannSquare,LineToolFibSpeedResistanceFan:i(875).LineToolFibSpeedResistanceFan,LineToolGannComplex:i(1136).LineToolGannComplex,LineToolGannFan:i(884).LineToolGannFan,LineToolFibWedge:i(415).LineToolFibWedge,LineToolPitchfork:i(210).LineToolPitchfork,LineToolDisjointAngle:i(861).LineToolDisjointAngle,LineToolFlatBottom:i(882).LineToolFlatBottom,LineToolIcon:i(896).LineToolIcon,LineToolRotatedRectangle:i(924).LineToolRotatedRectangle,LineToolFibSpiral:i(877).LineToolFibSpiral,LineToolHeadAndShoulders:i(890).LineToolHeadAndShoulders,LineToolTriangle:i(943).LineToolTriangle,LineToolTrianglePattern:i(941).LineToolTrianglePattern,LineTool5PointsPattern:i(411).LineTool5PointsPattern,LineToolThreeDrivers:i(930).LineToolThreeDrivers,LineToolABCD:i(835).LineToolABCD,LineToolRiskReward:i(276).LineToolRiskReward,LineToolPolyline:i(908).LineToolPolyline,LineToolPrediction:i(912).LineToolPrediction,LineToolPriceLabel:i(914).LineToolPriceLabel,LineToolNote:i(417).LineToolNote,LineToolNoteAbsolute:i(417).LineToolNoteAbsolute,LineToolBrush:i(849).LineToolBrush,LineToolArc:i(837).LineToolArc,LineToolCallout:i(851).LineToolCallout,LineToolBalloon:i(840).LineToolBalloon,LineToolText:i(419).LineToolText,LineToolHorzLine:i(892).LineToolHorzLine,LineToolHorzRay:i(894).LineToolHorzRay,LineToolRectangle:i(921).LineToolRectangle,LineToolEllipse:i(863).LineToolEllipse,LineToolTimeCycles:i(932).LineToolTimeCycles,LineToolSineLine:i(928).LineToolSineLine,LineToolGhostFeed:i(888).LineToolGhostFeed,LineToolBezierQuadro:i(847).LineToolBezierQuadro,LineToolBezierCubic:i(845).LineToolBezierCubic,LineToolArrow:i(838).LineToolArrow,LineToolRay:i(919).LineToolRay,LineToolExtended:i(865).LineToolExtended,LineToolSchiffPitchfork:i(925).LineToolSchiffPitchfork,LineToolSchiffPitchfork2:i(926).LineToolSchiffPitchfork2,LineToolInsidePitchfork:i(897).LineToolInsidePitchfork,LineToolTextAbsolute:i(419).LineToolTextAbsolute,LineToolArrowMarkLeft:i(163).LineToolArrowMarkLeft,LineToolArrowMarkRight:i(163).LineToolArrowMarkRight,LineToolArrowMarkUp:i(163).LineToolArrowMarkUp,LineToolArrowMarkDown:i(163).LineToolArrowMarkDown,
LineToolFlagMark:i(880).LineToolFlagMark,LineToolCypherPattern:i(855).LineToolCypherPattern,LineToolElliottImpulse:i(134).LineToolElliottImpulse,LineToolElliottTriangle:i(134).LineToolElliottTriangle,LineToolElliottTripleCombo:i(134).LineToolElliottTripleCombo,LineToolElliottCorrection:i(134).LineToolElliottCorrection,LineToolElliottDoubleCombo:i(134).LineToolElliottDoubleCombo,LineToolRiskRewardLong:i(276).LineToolRiskRewardLong,LineToolRiskRewardShort:i(276).LineToolRiskRewardShort,LineToolPosition:i(910).LineToolPosition,LineToolOrder:i(901).LineToolOrder},n=Object.keys(o),r=n.length;r--;)TradingView[n[r]]=o[n[r]];t.exports=o},function(t,e,i){"use strict";function o(t){this.items=t.items,this.height=t.height||t.width,this.width=t.width||t.height,this._color=t.color,this._borderColor=t.borderColor,this._vertOffset=t.vertOffset||0,t.textCache&&(this._textCache=t.textCache,this._textColor=t.textColor,this._textVertOffset=this._vertOffset>0?this.height:-this.height,this._textImageWidth=this._textCache.textImageWidth,this._textImageHeight=this._textCache.textImageHeight)}var n=i(1).Point,r=i(4);o.prototype.draw=function(t){this.drawShape(t),this.drawText(t)},o.prototype.drawShape=function(t){throw Error("Not implemented")},o.prototype.drawText=function(t){var e,i,o,n,r,s;if(this._textCache)for(e=0,i=this.items.length;e<i;e++)o=this.items[e],n=o.x,r=o.y+this._vertOffset+this._textVertOffset,s=o.style&&null!=o.style.textColor?o.style.textColor:this._textColor,this._textCache.paintTo(t,s,n,r,"center",this._vertOffset>0?"top":"bottom")},o.prototype.hitTest=function(t,e){var i,o,s,a,l,c,h,u,d,p,_,f,m,g=Math.max(this.height,this.width),v=this._vertOffset,y=this._textVertOffset;for(e=e||r.REGULAR,o=0;o<this.items.length;++o)if(s=this.items[o]){if(i=new n(s.x,s.y+v),i.subtract(t).length()<=g)return new r(e,{});if(this._textCache&&(a=this._textImageWidth/2,l=s.y+v+y,c=v>0?0:-this._textImageHeight,h=v>0?this._textImageHeight:0,u=t.x,d=t.y,p=s.x-a,_=l+c,f=s.x+a,m=l+h,u>p&&u<f&&d>_&&d<m))return new r(e,{})}return null},e.PaneRendererAbstractShape=TradingView.PaneRendererAbstractShape=o},function(t,e,i){(function(e,o,n,r){"use strict";function s(t){this._series=t,this._model=t.m_model,this._points=[new R(0,0)],this._invalidated=!0,this._lineRenderer=new k}function a(t){this._series=t,this._model=t.m_model,this._points=[new R(0,0)],this._invalidated=!0,this._lineRenderer=new k}function l(){return{count:TradingView.DEFAULT_BAR_COUNT}}function c(t,n,r){var h,m=i(213);M.call(this,t),this._boxSizeChanged=new e,this._tagsChanged=new e,this._symbolIntervalChanged=new e,this._symbolResolved=new e,this._symbolError=new e,this._symbolNotPermitted=new e,this._symbolGroupNotPermitted=new e,this._intervalChanged=new e,this._extendedHoursChanged=new e,this._extendedHoursNotPermitted=new e,this.chartTypeNotPermitted=new e,this.intradaySpreadNotPermitted=new e,this.intradayExchangeNotPermitted=new e,this.customIntervalNotPermitted=new e,this.chartWidgetInitialized=new e,this._startLoading=new e,this._dataLoaded=new e,
this._tickmarksRangeChanged=new e,this._barReceived=new e,this._onStyleChanged=new e,this._onCompleted=new e,this._onStatusChanged=new e,this._onRestarted=new e,this._onSessionsStudyCreated=new e,this.requestingIntradayWhenNotSupported=new e,this.requestingResolutionWhenNotSupported=new e,this.priceScaleChanged=new e,this._onInReplayStateChanged=new e,this._requestOptions=r||l(),this.m_model=t,this._chartApi=t._chartApi,this.m_data=new O(["time","open","high","low","close","adt","style"]),this.setProperties(n),this._prevChartStyle=n.style.value(),this.createPaneView(),this._dataWindowView=new f(this,t),this._statusView=new u(this,t.properties()),this._priceAxisViews=[new d(this,t),new _(this,{model:t}),new p(this,{model:t})],this._symbolInfo=null,this._status=c.STATUS_OFFLINE,this._syncModel=null,this._replaySubscriber=null,h=this,this._turnaroundCounter=1,this._turnaround="s"+this._turnaroundCounter,this._handler=function(t){h.onData(t)},this._haStyle={studyId:"BarSetHeikenAshi@tv-basicstudies-60"},this._renkoStyle={studyId:"BarSetRenko@tv-prostudies-15"},this._pbStyle={studyId:"BarSetPriceBreak@tv-prostudies-15"},this._kagiStyle={studyId:"BarSetKagi@tv-prostudies-15"},this._pnfStyle={studyId:"BarSetPnF@tv-prostudies-15"},this._properties.addExclusion&&this._properties.addExclusion("visible"),this._base=100,this._formatter=new F(this._base),this._predictBars=0,this._futureBarsPaneView=null,this._properties.showInDataWindow.listeners().subscribe(t,m.prototype.fullUpdate),this.marketStatus=new o,this._seriesLoaded=!1,this.properties().minTick.listeners().subscribe(this,c.prototype._recreateFormatter),h=this,this.properties().minTick.listeners().subscribe(null,function(){h.m_model.invalidate(new B(B.FULL_UPDATE))}),this._prevClosePriceLineView=new a(this),this._priceLineView=new s(this),this._gotoDateView=new A(this),this.bindStyleChange(),this.bindJapChartsInputs(),this._createIsPrevClosePriceAvailableProperty(),this.createExtendedHoursProperty(),this.extendedHours.listeners().subscribe(this,function(){this._extendedHoursChanged.fire()}),this._extendedHoursNotPermitted.subscribe(this,function(){this._properties.extendedHours.setValue(!1)}),this._extendedHoursChanged.subscribe(this,function(){this._status!==c.STATUS_SNAPSHOT&&this.restart()}),this._symbolIntervalChanged.subscribe(this,this.checkInterval),this.properties().showCountdown.listeners().subscribe(this,c.prototype._onChangeShowCountdown),this._onChangeShowCountdown(this.properties().showCountdown),this._recreateFormatter(),this._isDWMCached=null}var h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E,V,D,O,B,R,z,F,N,W,$,H,U,j,q,G,Y,K,Z,X,J,Q,tt;TradingView.DEFAULT_BAR_COUNT=300,TradingView.TIME_PLOT=0,TradingView.OPEN_PLOT=1,TradingView.HIGH_PLOT=2,TradingView.LOW_PLOT=3,TradingView.CLOSE_PLOT=4,TradingView.ADT_PLOT=6,TradingView.STYLE_PLOT=7,h=i(21).ensureNotNull,u=i(967),d=i(1143).PrevCloseSeriesPriceAxisView,p=i(1142).ProjectionSeriesPriceAxisView,_=i(495).SeriesPriceAxisView,f=i(966),m=i(425),g=m.SeriesAreaPaneView,v=m.SeriesLinePaneView,
y=m.SeriesHollowCandlesPaneView,b=m.SeriesCandlesPaneView,S=m.SeriesBarsPaneView,w=m.SeriesHeikenAshiPaneView,T=m.SeriesBaselinePaneView,x=m.SeriesBaselineLinePaneView,C=i(7),P=i(9).propertyPages,L=i(479).BarsRange,I=i(272).SeriesBarColorer,k=i(122).HorizontalLineRenderer,A=i(832),M=i(62).PriceDataSource,E=i(217),V=i(968).FutureBarsPaneView,D=i(57).Interval,O=i(315).SeriesData,B=i(37),R=i(1).Point,z=i(393),F=i(41).PriceFormatter,N=i(42),W=N.PlotList,$=N.PlotRowSearchMode,H=N.mergeMinMax,U=i(45),j=i(429).SyncModel,q=i(48).trackEvent,G=i(178).translatedIntervalString,Y=i(64),K=i(13),Z=K.getLogger("Chart.Series"),X=K.getLogger("Chart.Series.Updates",{highRate:!0}),J=i(71),Q=i(397),tt=i(1144),s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){if(this._visible=!1,this._series.properties().showPriceLine.value()){var t=this._series.lastValueData(TradingView.CLOSE_PLOT,!0);t.noData||(this._visible=!0,this._points=[new R(0,t.coordinate)],this._color=this._series.priceLineColor(t.color))}},s.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.width=this._model.timeScale().width(),t.height=this._series.priceScale().height(),t.points=this._points,t.color=this._color,t.linewidth=this._series.properties().priceLineWidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.visible=this._visible,this._lineRenderer.setData(t),this._lineRenderer},a.prototype.update=function(){this._invalidated=!0},a.prototype._updateImpl=function(){if(this._visible=!1,this._series.properties().showPrevClosePriceLine.value()&&!this._series.isDWM()){var t=this._series.prevClose();null!==t&&(this._visible=!0,this._points=[new R(0,t.coordinate)],this._color=this._series.properties().prevClosePriceLineColor.value())}},a.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={};return t.width=this._model.timeScale().width(),t.height=this._series.priceScale().height(),t.points=this._points,t.color=this._color,t.linewidth=this._series.properties().prevClosePriceLineWidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.visible=this._visible,this._lineRenderer.setData(t),this._lineRenderer},inherit(c,M),c.prototype.styleStudyInfos=function(){return{haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle}},c.prototype.styleStudyInfo=function(t){return this.styleStudyInfos()[t]},c.prototype.priceLineColor=function(t){return this.properties().priceLineColor.value()||t},c.prototype.endOfData=function(){return this._endOfData},c.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},c.prototype._onChangeShowCountdown=function(t){var e=this;t.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){e.isDWM()||(e._priceAxisViews[0].update(),e.m_model.invalidate(new B(B.LIGHT_UPDATE)))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)},c.prototype.lastValueData=function(t,e,i){
var o,n,r,s,a,l,c,h,u,d,p={noData:!0};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return p;if(null===(o=this.m_model.timeScale().visibleBars()))return p;if(e){if(null===(s=this.data().bars().last()))return p;n=s.value,r=s.index}else{if(null===(a=this.data().bars().search(o.lastBar(),$.NearestLeft)))return p;n=this.data().bars().valueAt(a.index),r=a.index}return l={noData:!1},c=n[t],i&&(l.price=c),this.priceScale().properties().percentage.value()&&(h=this.firstValue(),c=this.priceScale().priceRange().convertToPercent(c,h)),l.text=this.priceScale().formatter().format(c),u=this.barColorer(),d=u.barStyle(r,!1),l.color=d.barColor,l.floatCoordinate=this.priceScale().priceToCoordinate(c,!0),l.coordinate=Math.round(l.floatCoordinate),l.index=r,l},c.prototype.prevClose=function(){var t,e;return this.priceScale().isEmpty()||this.data().isEmpty()||!this.quoteData?null:null==(t=this.quoteData.prev_close_price)?null:(this.priceScale().properties().percentage.value()&&(e=this.firstValue(),t=this.priceScale().priceRange().convertToPercent(t,e)),{coordinate:this.priceScale().priceToCoordinate(t),floatCoordinate:this.priceScale().priceToCoordinate(t,!0),text:this.priceScale().formatter().format(t)})},c.prototype._createIsPrevClosePriceAvailableProperty=function(){this._isPrevClosePriceAvailable=new n(!this.isDWM()),this._onRestarted.subscribe(this,function(){this._isPrevClosePriceAvailable.setValue(!this.isDWM())})},c.prototype.isPrevClosePriceAvailable=function(){return this._isPrevClosePriceAvailable},c.prototype._prepareChartApiParams=function(){return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||TradingView.DEFAULT_BAR_COUNT},c.prototype._nextSymbolId=1,c.prototype._nextSeriesId=1,Object.assign(c,J),c.PERMISSION_DENIED="permission denied",c.PD_REASON_SYMBOL="symbol",c.PD_REASON_EXTENDED_HOURS="extended_hours",c.PD_REASON_GROUP_PERMISSION="group",c.STUDY_NOT_AUTH="study_not_auth",c.prototype.model=function(){return this.m_model},c.prototype.fixLastBar=function(t){this._futureBarsPaneView||(this._futureBarsPaneView=new V(this,this.data().bars().lastIndex(),t))},c.prototype.clearData=function(){this.data().clear()},c.prototype.data=function(){return this.m_data},c.prototype.symbolId=function(){return this._symbolId},c.prototype.isPulse=function(){return this._symbolInfo&&this._symbolInfo.resolutions.length>0},c.prototype.onTagsChanged=function(){return this._tagsChanged},c.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},c.prototype.onSymbolResolved=function(){return this._symbolResolved},c.prototype.onSymbolError=function(){return this._symbolError},c.prototype.onSymbolNotPermitted=function(){
return this._symbolNotPermitted},c.prototype.onSymbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},c.prototype.onIntervalChanged=function(){return this._intervalChanged},c.prototype.onExtendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},c.prototype.onStartLoading=function(){return this._startLoading},c.prototype.onDataLoaded=function(){return this._dataLoaded},c.prototype.onStatusChanged=function(){return this._onStatusChanged},c.prototype.onTickmarksRangeChanged=function(){return this._tickmarksRangeChanged},c.prototype.onBarReceived=function(){return this._barReceived},c.prototype.onStyleChanged=function(){return this._onStyleChanged},c.prototype.onCompleted=function(){return this._onCompleted},c.prototype.onRestarted=function(){return this._onRestarted},c.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},c.prototype.status=function(){return this._status},c.prototype.isDWM=function(){var t,e;return null!==this._isDWMCached?this._isDWMCached:(t=new D(this._properties.interval.value()),t.isDWM()?this._isDWMCached=!0:(e=t.kind()===D.SECONDS?t.multiplier():60*t.multiplier(),this._isDWMCached=!(e<216e3)),this._isDWMCached)},c.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},c.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._baseLineView=null,this._symbolLabelView=new E(this.m_model,this,TradingView.CLOSE_PLOT,"firstShortName","showSymbolLabels");var t=this._properties.style.value();switch(t){case c.STYLE_BARS:this._paneView=new S(this,this.m_model);break;case c.STYLE_CANDLES:this._paneView=new b(this,this.m_model);break;case c.STYLE_LINE:this._paneView=new v(this,this._properties.lineStyle.priceSource.value(),this.m_model);break;case c.STYLE_AREA:this._paneView=new g(this,this._properties.areaStyle.priceSource.value(),this.m_model);break;case c.STYLE_HEIKEN_ASHI:this._paneView=new w(this,this.m_model);break;case c.STYLE_HOLLOW_CANDLES:this._paneView=new y(this,this.m_model);break;case c.STYLE_BASELINE:this._paneView=new T(this,this._properties.baselineStyle.priceSource.value(),this.m_model),this._baseLineView=new x(this,this.m_model);break;default:throw Error("Unknown chart style assigned: "+t)}},c.prototype._clearStylePlot=function(t,e){var i,o;0!==t.size()&&(i=e||h(t.firstIndex()),o=h(t.lastIndex())+1,t.range(i,o).each(function(t,e){e[TradingView.STYLE_PLOT]=null}))},c.prototype.invalidateBarStylesCache=function(t){Z.logDebug("Invalidate style cache starting from "+t),this._clearStylePlot(this.m_data.m_bars,t),this._clearStylePlot(this.m_data.m_nsBars)},c.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},c.prototype.barColorer=function(){var t,e,i,o;if(this._barColorerCache)return this._barColorerCache;for(t=null,e=this.m_model.dataSources().length-1;e>=0;e--)i=this.m_model.dataSources()[e],
i.metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()&&(o=i.barColorer(),null===t?t=o:t.pushBackBarColorer(o));return null===t?t=new I(this):t.pushBackBarColorer(new I(this)),this._barColorerCache=t,this._barColorerCache},c.prototype.properties=function(){return this._properties},c.prototype._barsState=function(t){var e=t.state();return e.columns=e.columns.filter(function(t){return"style"!==t}),e.data.forEach(function(t){t.value.splice(7,1)}),e},c.prototype.state=function(t){var e=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),i={type:e,id:this.id(),state:this.properties().state(),zorder:this.zorder(),haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle};return this._symbolInfo&&this._symbolInfo.ticker&&(i.state.symbol=this._symbolInfo.ticker),t&&(i.bars=this._barsState(this.m_data.m_bars),i.nsBars=this._barsState(this.m_data.m_nsBars),i.symbolInfo=this._symbolInfo,i.rtPrice=this.data().lastProjectionPrice),i.boxSize=this.data().boxSize,i.reversalAmount=this.data().reversalAmount,i},c.prototype.restoreData=function(t,e,i,o,n,r){this._status=c.STATUS_SNAPSHOT,this.m_data.m_bars.restoreState(t),this.m_data.m_nsBars.restoreState(e),this.updateSymbolInfo(i),this.m_data.lastProjectionPrice=o,this.m_data.boxSize=n,n||(this.properties().style.value()===c.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===c.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=r,r||this.properties().style.value()===c.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value())},c.prototype.setProperties=function(t){t.timeframe||t.merge({timeframe:""}),t.shortName||t.merge({shortName:""}),this._properties=t,this._properties.symbol.listeners().subscribe(this,c.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,c.prototype.changeInterval),this._properties.timeframe.listeners().subscribe(this,c.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,c.prototype.changeProperties)},c.prototype.changeSymbol=function(){this.setSymbolIntervalDelayed(),this.m_model.checkLineToolSelection()},c.prototype.changeInterval=function(){this.setSymbolIntervalDelayed()},c.prototype.changeTimeFrame=function(){q("GUI","Change timeframe")},c.prototype.title=function(){return this.properties().symbol.value()+", "+G(this.properties().interval.value())},c.prototype.changeProperties=function(t){t!==this._properties.symbol&&t!==this._properties.interval&&t!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this))},c.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},c.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},c.prototype.onData=function(t){
var e,i,o,n,r,s,a,l,u,d,p,_,f,m,g,v,y,b=this;switch(t.method){case"symbol_resolved":if(t.params[0]!==this._symbolId){Z.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0]);break}this.updateSymbolInfo(t.params[1]),this.m_model.updateSource(this),this._symbolResolved.fire(this._symbolInfo),this.m_model.realignLineTools(),TradingView.onWidget()||q("Symbol",t.params[1].listed_exchange,t.params[1].name),e=this.symbolInfo().minmov/this.symbolInfo().pricescale,i=this.properties(),i.style.value()===c.STYLE_RENKO&&i.renkoStyle.inputs.boxSize.value()<e?i.renkoStyle.inputs.merge({boxSize:e}):i.style.value()===c.STYLE_PNF&&i.pnfStyle.inputs.boxSize.value()<e?i.pnfStyle.inputs.merge({boxSize:e}):i.style.value()===c.STYLE_KAGI&&i.kagiStyle.inputs.reversalAmount.value()<e&&i.kagiStyle.inputs.merge({reversalAmount:e});break;case"symbol_error":if(t.params[0]!==this._symbolId){Z.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0]);break}if(this._setStatus(c.STATUS_INVALID_SYMBOL),this._properties.shortName.setValue(this._properties.symbol.value()),this.m_model.clearAllStudies(),this.updateAllViews(),this.m_model.updateSource(this),t.params[1]===c.PERMISSION_DENIED)switch(t.params[2]){case c.PD_REASON_EXTENDED_HOURS:this._extendedHoursNotPermitted.fire();break;case c.PD_REASON_SYMBOL:this._symbolNotPermitted.fire(t.params[3]);break;case c.PD_REASON_GROUP_PERMISSION:this._symbolGroupNotPermitted.fire(t.params[3]);break;default:this._symbolNotPermitted.fire(t.params[2])}else this.m_model.resetTimeScale(),this._symbolError.fire();this.m_model.realignLineTools();break;case"series_timeframe":if(t.params[1]!==this._turnaround)break;o=t.params[2],n=t.params[3],r=t.params[4],s=void 0!==r&&r?n:n+10,this.m_model.setTimeViewport(o,s);break;case"series_error":a=t.params[2],delete this._loadingStartTime,C.enabled("charting_library_debug_mode")&&Z.logNormal("Error reason: "+a),this._setStatus(C.enabled("no_bars_status")&&this._symbolInfo?c.STATUS_NO_BARS:c.STATUS_INVALID_SYMBOL),a&&a.startsWith("study_not_auth:")?(l=a.split(":",2)[1].split("@",2)[0],l in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this.chartTypeNotPermitted.fire(l):"BarSetSpread"===l&&this.intradaySpreadNotPermitted.fire()):"resolution_not_entitled"===a?this.intradayExchangeNotPermitted.fire():"custom_resolution"===a&&this.customIntervalNotPermitted.fire(),this._seriesLoaded=!0;break;case"series_loading":if(t.params[1]!==this._turnaround)break;if(t.params[0]!==this._seriesId){Z.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}this._setStatus(c.STATUS_LOADING),b._loadingStartTime=(new Date).getTime();break;case"series_completed":if(t.params[2]!==this._turnaround)break;if(t.params[0]!==this._seriesId){Z.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}switch(u="chartSession:"+b._chartApi._sessionid,d=(new Date).getTime()-this._loadingStartTime,
Z.logDebug(u+", Series loading took "+d+" ms, eod:"+this._endOfData),delete this._loadingStartTime,p=t.params[1],"pulsed"===p&&(p="delayed"),p){case"streaming":this._setStatus(c.STATUS_READY);break;case"endofday":this._setStatus(c.STATUS_EOD);break;case"delayed":this._setStatus(c.STATUS_DELAYED);break;case"pulsed":this._setStatus(c.STATUS_PULSE);break;case"replay":this._setStatus(c.STATUS_REPLAY)}p.match(/delayed_streaming/)&&this._setStatus(c.STATUS_DELAYED_STREAMING),_=this.m_model.paneForSource(this),_.recalculatePriceScale(this.priceScale()),this.m_model.invalidate(new B(B.FULL_UPDATE)),this.m_data.size()&&this._tickmarksRangeChanged.fire({start:h(this.data().first()).value[TradingView.TIME_PLOT],end:h(this.data().last()).value[TradingView.TIME_PLOT]}),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0),this.model().recalcStudyBasedLineTools(),!this.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),f=this.model().timeScale().visibleBars(),this.priceScale().setPriceRange(this.priceRange(f.firstBar(),f.lastBar()))),this._seriesLoaded=!0,this._onCompleted.fire(this._endOfData),this.requestMoreData();break;case"series_deleted":break;case"data_update":if(t.params.customId!==this._seriesId){Z.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}if(t.params.turnaround!==this._turnaround){Z.logNormal("command for old series turnaround. Expected:"+this._turnaround+", actual"+t.params.turnaround);break}if(this._setSymbolIntervalDelay){if(this._willSymbolIntervalChanged())return void Z.logNormal("command comes during symbol/interval changing");Z.logNormal("data_update comes when symbol interval delay present but symbol/interval should not be changed")}if(this.status()===c.STATUS_INVALID_SYMBOL)break;t.params.plots.length?(m=this.m_data.bars().size(),g=this.m_data.bars().firstIndex(),v=this.m_data.bars().merge(t.params.plots),(null===g||v.earliestRow.index<g)&&(this._endOfData=!1),y="Merge bars. Changes:{length:"+v.length+", earliestRow:"+v.earliestRow.index+"} ",y+="bars state:{firstBar:"+h(this.m_data.bars().firstIndex())+",lastBar:"+h(this.m_data.bars().lastIndex())+",size:"+this.m_data.bars().size()+"}",X.logDebug(y),m!==this.bars().size()&&(this._barReceived.fire(v),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0))):(this.m_data.clear(),this._startLoading.fire()),new Promise(function(e){var i=b.properties().style.value();t.params.nonseries&&tt.isJapaneseStyle(i)?b.parseJapProjBars(t.params.nonseries).then(function(t){b.m_data.m_nsBars=t.nsBars,b.m_data.lastProjectionPrice=t.lastPrice;var i=b.m_data.boxSize!==t.boxSize;b.m_data.boxSize=t.boxSize,b.m_data.reversalAmount=t.reversalAmount,i&&b._boxSizeChanged.fire(b.m_data.boxSize),e()}):(t.params.nonseries||(b.m_data.m_nsBars.clear(),b.m_data.lastProjectionPrice=void 0),e(),e())}).then(function(){b._statusView.invalidate();var t=b.m_model.paneForSource(b)
;b.m_model.updateAllVolumeStudies(),b.m_model.recalculatePane(t),b.m_model.updateSource(b),b.m_model.updateLineTools(),b.m_model.updateCrossHair()})}this._dataLoaded.fire(t)},c.prototype.fixBoxSize=function(){var t=this.model().timeScale(),e=this.priceScale();e.isEmpty()||t.isEmpty()||(this.m_data.boxSize=Math.abs(e.coordinateToPrice(t.barSpacing())-e.coordinateToPrice(0)))},c.prototype.parseJapProjBars=function(t){var e,i,o,n=new W(["time","open","high","low","close","adt","style"]),r=this.model().timeScale(),s=this.properties().style.value(),a=this;return new Promise(function(l){t.d&&""!==t.d?TradingView.Study.prototype._makeJSONForNSData.call(a,{params:{nonseries:t}}).then(function(a){var h,u,d,p,_=a.data;for(e=_.price,i=_.boxSize,o=_.reversalAmount,h=_.bars,u=0;h&&u<h.length;u++)d=[],p=t.indexes[h[u].time],d.push(r.points().valueAt(p)),d.push(h[u].open),d.push(h[u].high),d.push(h[u].low),d.push(h[u].close),d.push(h[u].volume),s===c.STYLE_KAGI?d.push(h[u].additionalPrice):s===c.STYLE_PNF&&d.push(h[u].factor),n.add(p,d);l({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})}):l({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})})},c.prototype.disconnect=function(){this._seriesId&&this._chartApi.removeSeries(this._seriesId),this._symbolId=null,this._seriesId=null,this._predictBars=0,this._status=c.STATUS_OFFLINE},c.prototype.isStarted=function(){return!!this._symbolId},c.prototype.restart=function(){var t,e=i(213);this._onRestarted.fire(),this._setStatus(c.STATUS_RESOLVING),this.m_data=new O(["time","open","high","low","close","adt","style"]),this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),t=this._properties.interval.value(),this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._onBeforeModifySeries(this.getSymbolString(),t),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),!1===this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)&&(this._seriesId=void 0)),this._properties.showInDataWindow.listeners().subscribe(this.m_model,e.prototype.fullUpdate),this.m_symbol=this._properties.symbol.value(),this.m_interval=this._properties.interval.value()},c.prototype._generateTimeframe=function(t,e){var i,o=e.right(1),n=t;return"ytd"===e?n+=",YTD":"d"===o?(i=e.left(e.length-1),n+=","+i,C.enabled("daily_timeframe_suffix")&&(n+="D")):"m"===o?(i=e.left(e.length-1),n+=","+i+"M"):"all"===e&&(n+=",ALL"),n},c.prototype.hasDelayedSymbolIntervalChange=function(){return!!this._setSymbolIntervalDelay},c.prototype.setSymbolIntervalDelayed=function(){this._isDWMCached=null,this._willSymbolIntervalChanged()&&(this._setSymbolIntervalDelay&&(Z.logNormal("Clear timeout to change symbol/interval #"+this._setSymbolIntervalDelay),
clearTimeout(this._setSymbolIntervalDelay)),this._setSymbolIntervalDelay=setTimeout(function(){Z.logNormal("Timeout #"+this._setSymbolIntervalDelay+' fired, new symbol will be "'+this._properties.symbol.value()+'"'),delete this._setSymbolIntervalDelay,this._setSymbolInterval(this._properties.symbol.value(),this._properties.interval.value())}.bind(this),30),Z.logNormal("Started timeout #"+this._setSymbolIntervalDelay+' to change symbol/interval from "'+this.m_symbol+'" to "'+this._properties.symbol.value()+'"'))},c.prototype._willSymbolIntervalChanged=function(){var t=this._checkIntervalWillChanged(this._parseInterval(this._properties.interval.value()).interval);return this._checkSymbolWillChanged(this._properties.symbol.value())||t},c.prototype._checkSymbolWillChanged=function(t){return!this.symbolSameAsCurrent(t)||C.enabled("same_data_requery")},c.prototype._checkIntervalWillChanged=function(t){return this.m_interval!==t||C.enabled("same_data_requery")},c.prototype._parseInterval=function(t){var e=(t+"").split(",");return{interval:2===e.length?e[0]:t,timeframe:2===e.length?e[1]:0}},c.prototype.rerequestData=function(){this._setSymbolInterval(this.m_symbol,this.m_interval,!0)},c.prototype._setSymbolInterval=function(t,e,i){var o,n,r,s,a,l;delete this._gotoDateResult,o=this._parseInterval(e),n=o.interval,r=o.timeframe,s=this._checkSymbolWillChanged(t),a=this._checkIntervalWillChanged(n),(s||a||i)&&(this._syncModel=null,this.m_symbol=t,this.m_interval=n,this.m_timeframe=r,this._symbolId&&!s||this.updateSymbolInfo(null),this.m_model.realignLineTools(),this._status!==c.STATUS_SNAPSHOT&&(this._setStatus(c.STATUS_RESOLVING),this._symbolIntervalChanged.fire(),a&&(l={timeframe:this._pendingTimeRange},this._intervalChanged.fire(this.m_interval,l),this._pendingTimeRange=l.timeframe&&l.timeframe.toLowerCase()),this._onRestarted.fire(),this._seriesLoaded=!1,this._chartApi&&this._chartApi.connected()&&(this._symbolId&&!s||(this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler)),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._pendingTimeRange&&(e=this._generateTimeframe(e,this._pendingTimeRange),delete this._pendingTimeRange),this._onBeforeModifySeries(this.getSymbolString(),e),this._predictBars=0,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler,this._prevSymbolId)):(this._onBeforeModifySeries(this.getSymbolString(),e),this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,e,this._prepareChartApiParams(),this._handler)))))},c.prototype.setDefaultTimeframe=function(t){this._pendingTimeRange=t},c.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().full_name:this.symbol()},c.prototype.proSymbol=function(){return this.symbolInfo()?this.symbolInfo().pro_name:this.symbol()},c.prototype.symbol=function(){return this.properties().symbol.value()},c.prototype.interval=function(){
return this.properties().interval.value()},c.prototype.isIntradayInterval=function(){return!!/^\d*$/.test(this.interval())&&this.interval()<=1440},c.prototype.bars=function(){return this.m_data.m_bars},c.prototype.nsBars=function(){return this.m_data.m_nsBars},c.prototype.open=function(t){return this.m_data.valueAt(t)[TradingView.OPEN_PLOT]},c.prototype.high=function(t){return this.m_data.valueAt(t)[TradingView.HIGH_PLOT]},c.prototype.low=function(t){return this.m_data.valueAt(t)[TradingView.LOW_PLOT]},c.prototype.close=function(t){return this.m_data.valueAt(t)[TradingView.CLOSE_PLOT]},c.prototype.hl2=function(t){return(this.high(t)+this.low(t))/2},c.prototype.hlc3=function(t){return(this.high(t)+this.low(t)+this.close(t))/3},c.prototype.ohlc4=function(t){return(this.open(t)+this.high(t)+this.low(t)+this.close(t))/4},c.prototype.priceRange=function(t,e){var i,o,n,s,a,l,c,h;return TradingView.isInteger(t)?TradingView.isInteger(e)?this.data().isEmpty()?null:(o=this.data().boxSize,this.isLockScale()?(void 0===o&&this.fixBoxSize(),n=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/this.data().boxSize),s=this.data().search(e,$.NearestLeft),a=(s.value[TradingView.HIGH_PLOT]+s.value[TradingView.LOW_PLOT])/2,i=new r(a-.5*n,a+.5*n),l=this.data().search(t,$.NearestRight),this.priceScale().isPercentage()?i.convertToPercents(l.value[TradingView.CLOSE_PLOT]):i):(c=this.data().bars().minMaxOnRange2(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),h=this.data().nsBars().minMaxOnRange(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),c=H(c,h),i=null!==c?c.min===c.max?new r(c.min-.5,c.max+.5):new r(c.min,c.max):new r(-.5,.5),this.priceScale().isPercent()?(l=this.data().search(t,$.NearestRight),null===l?null:i.convertToPercents(l.value[TradingView.CLOSE_PLOT])):this.priceScale().isLog()?new r(this.priceScale().priceToLogical(i.minValue()),this.priceScale().priceToLogical(i.maxValue())):i)):(Z.logDebug("Series.priceRange: incorrect endBar"),null):(Z.logDebug("Series.priceRange: incorrect startBar"),null)},c.prototype.nearestData=function(t,e){if(!TradingView.isInteger(t))return void Z.logDebug("Series.nearestData: incorrect logicalPoint");var i=this.data().search(t,e);return null!==i?i:void 0},c.prototype.nearestIndex=function(t,e){var i=this.nearestData(t,e);return i?i.index:void 0},c.prototype.paneViews=function(t){if(!this.properties().visible.value())return null;var e=[this._paneView];return this._futureBarsPaneView&&e.push(this._futureBarsPaneView),this._projectionBarsPaneView&&e.push(this._projectionBarsPaneView),null!==this._baseLineView&&e.push(this._baseLineView),e.push(this._prevClosePriceLineView),e.push(this._priceLineView),e.push(this._symbolLabelView),e.push(this._gotoDateView),e},c.prototype.dataWindowView=function(){return this._dataWindowView},c.prototype.statusView=function(){return this._statusView},c.prototype.priceAxisViews=function(t,e){
return this.m_model.paneForSource(this)===t&&e===this.priceScale()&&(this.m_model.properties().scalesProperties.showSeriesLastValue.value()||this.properties().showCountdown.value())?this._priceAxisViews:null},c.prototype.base=function(){return this._base},c.prototype.formatter=function(){return this._formatter},c.prototype.purgeSymbolInfo=function(){this._symbolInfo=null},c.prototype.symbolInfo=function(){return this._symbolInfo},c.prototype._recreateFormatter=function(){var t,e,i,o;"default"===this.properties().minTick.value()?this._formatter=new F(this._symbolInfo?this._symbolInfo.pricescale:100,this._symbolInfo?this._symbolInfo.minmov:1,!!this._symbolInfo&&this._symbolInfo.fractional,this._symbolInfo?this._symbolInfo.minmove2:void 0):(t=this.properties().minTick.value().split(","),e=parseInt(t[0]),i=parseInt(t[1]),o="true"===t[2],this._formatter=new F(e,i,o)),this.priceScale()&&this.priceScale().updateFormatter()},c.prototype.updateSymbolInfo=function(t){var e,i,o=this,n=t&&(t.pro_name||t.full_name||t.name);C.enabled("charting_library_single_symbol_request")&&this.m_symbol&&(n=this.m_symbol),this._symbolInfo=t,t&&(this._properties.shortName.setValue(t.name),e=this._properties.symbol.value(),i=n,C.enabled("uppercase_instrument_names")&&(e=e.toUpperCase(),i=i.toUpperCase()),n&&e!==i&&this._properties.symbol.setValue(n)),this._base=t?t.pricescale/t.minmov:100,this._recreateFormatter(),this._statusView.update(),this.priceScale().updateFormatter(),"undefined"!=typeof quoteSessionMultiplexerInstance&&this._quoteSessionSymbol!==n&&(this._quoteSessionClientId||(this._quoteSessionClientId="series-"+Y.guid()),this._quoteSessionSymbol&&(quoteSessionMultiplexerInstance.full.unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=void 0),n&&(this._quoteSessionSymbol=n,quoteSessionMultiplexerInstance.full.subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,function(t,e){o.quoteData=t&&t.values||null,e&&e.values&&e.values.current_session&&o.marketStatus.setValue(e.values.current_session)}))),this.checkInterval()},c.prototype.symbolSameAsCurrent=function(t){if(this.m_symbol===t)return!0;var e=this._symbolInfo;if(e){if(e.full_name===t||e.pro_name===t)return!0;if(e.ticker===t)return!0;if(e.aliases&&-1!==e.aliases.indexOf(t))return!0;if(e.alternatives&&-1!==e.alternatives.indexOf(t))return!0;if(0===t.indexOf("FRA:")&&e.pro_name===t.replace("FRA:","FWB:"))return!0}return!1},c.prototype.updateAllViews=function(){var t,e;for(this._paneView.update(),this._dataWindowView.update(),this._statusView.update(),t=this._priceAxisViews.length,e=0;e<t;e++)this._priceAxisViews[e].update();this._futureBarsPaneView&&this._futureBarsPaneView.update(),this._projectionBarsPaneView&&this._projectionBarsPaneView.update(),null!==this._baseLineView&&this._baseLineView.update(),this._prevClosePriceLineView.update(),this._priceLineView.update(),this._gotoDateView.update(),this._symbolInfo&&this._symbolLabelView.update()},c.prototype._setStatus=function(t){this._status=t,this._statusView.update(),
this.m_model.updateSource(this),this._onStatusChanged.fire()},c.prototype.requestMoreData=function(t){var e,i,o,n;this._status!==c.STATUS_READY&&this._status!==c.STATUS_PULSE&&this._status!==c.STATUS_DELAYED&&this._status!==c.STATUS_DELAYED_STREAMING&&this._status!==c.STATUS_EOD&&this._status!==c.STATUS_REPLAY||this.m_model.timeScale().isEmpty()||null!==(e=this.m_model.timeScale().visibleBars())&&0!==this.bars().size()&&(i=t||e.lastBar()-h(this.data().last()).index,this._predictBars<i&&(this._predictBars=i,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreTickmarks(this._seriesId,i,this._handler)),this._endOfData||(o=h(this.bars().firstIndex()),(n=t||o-e.firstBar())<=0||(this._endOfData=!0,this._chartApi&&this._chartApi.connected()&&(this._chartApi.requestMoreData(this._seriesId,n,this._handler),C.enabled("charting_library_base")&&(this._predictBars=0)),this._setStatus(c.STATUS_LOADING))))},c.prototype.bindStyleChange=function(){var t=this;["candleStyle","hollowCandleStyle","haStyle","barStyle","lineStyle","areaStyle","renkoStyle","pbStyle","kagiStyle","pnfStyle"].forEach(function(e){t._properties[e].listeners().subscribe(t,c.prototype.invalidateBarStylesCache)})},c.prototype.bindJapChartsInputs=function(){this._properties.style.listeners().subscribe(this,this.onChartStyleChanged),this._properties.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.wicks.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.lb.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.sources.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);var t=this;this._properties.lockScale.listeners().subscribe(this,function(e){e.value()&&t.model().timeScale().recalcLockedScale()})},c.prototype.createExtendedHoursProperty=function(){function t(){var t="undefined"!=typeof ProductFeatures&&C.enabled(ProductFeatures.EXTENDED_SESSION),i=e.model().readOnly(),o=e._properties.extendedHours.value(),n=C.enabled("widget");!o||n||i||t||(e._extendedHoursNotPermitted.fire(),o=!1),o&&!e.isIntradayInterval()&&(o=!1),e.extendedHours.setValue(o)}var e=this;e.extendedHours=new n,
e._properties.extendedHours.listeners().subscribe(null,t),e._properties.interval.listeners().subscribe(null,t),e.chartWidgetInitialized.subscribe(null,t),t()},c.prototype.isNeedRestart=function(t){if(void 0===t&&(t=this.properties().style.value()),this._prevChartStyle!==t){var e=[c.STYLE_BARS,c.STYLE_CANDLES,c.STYLE_HOLLOW_CANDLES,c.STYLE_LINE,c.STYLE_AREA,c.STYLE_BASELINE];if(!(e.indexOf(this._prevChartStyle)>-1&&e.indexOf(t)>-1))return!0}return!1},c.prototype.onChartStyleChanged=function(){this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart()),this._prevChartStyle=this.properties().style.value(),this._onStyleChanged.fire(this.properties().style.value()),this.invalidateBarStylesCache()},c.prototype.style=function(){return this.properties().style.value()},c.prototype.isJapaneseStyle=function(){return tt.isJapaneseStyle(this.style())},c.prototype.onInputChanged=function(){this.restart()},c.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged},c.prototype.getSymbolString=function(){var t,e,i;return t=C.enabled("pay_attention_to_ticker_not_symbol")&&this._symbolInfo?this._symbolInfo.ticker:this.actualSymbol(),this.extendedHours.value()&&(t={symbol:t,session:"extended"}),c.SYMBOL_STRING_DATA.hasOwnProperty(this._properties.style.value())&&(e=this.styleStudyInfo(this.getStyleShortName()+"Style").studyId,i=this.getInputsProperties(),t={symbol:t,type:e+"!",inputs:i.state()}),"string"!=typeof t&&(t="="+JSON.stringify(t)),t},c.prototype._getResolvingSymbolString=function(){return this.getSymbolString()},c.prototype.getStyleShortName=function(){var t=this._properties.style.value();if(c.STYLE_SHORT_NAMES.hasOwnProperty(t))return c.STYLE_SHORT_NAMES[t];throw Error("Missed short name for style "+t)},c.prototype.getStyleProperties=function(){return this._properties[this.getStyleShortName()+"Style"]},c.prototype.getInputsProperties=function(){return this.getStyleProperties().inputs||new n},c.prototype.getRealVisibleRange=function(){var t,e,i=this.model().timeScale().visibleBars();return null===i?null:(t=this.data().search(i.firstBar(),$.NearestRight),e=this.data().search(i.lastBar(),$.NearestLeft),null===t||null===e?null:new L(t.index,e.index))},c.prototype.isLockScale=function(){return this.properties().lockScale.value()},c.prototype.firstValue=function(){var t=this.firstBar();return null===t?null:t[TradingView.CLOSE_PLOT]},c.prototype.firstBar=function(){var t,e,i=this.model().timeScale().visibleBars();return null===i?null:(t=i.firstBar(),e=this.data().search(t,$.NearestRight),null!==e?e.value:null)},c.prototype.sessionsStudy=function(){var t,e,i,o;if(this._sessionsStudy)return this._sessionsStudy;for(t=this.model().paneForSource(this),e=t.dataSources(),i=0;i<e.length;i++)if((o=e[i])instanceof TradingView.Study&&"Sessions"===o.metaInfo().shortId)return this._sessionsStudy=o,this._sessionsStudy;return!1},c.prototype.clearSessionStudy=function(){this._sessionsStudy=null},c.prototype.createSessStudy=function(){if(!this.sessionsStudy()){
var t=U.findStudyMetaInfo(this.model().studiesMetaData(),"Sessions@tv-basicstudies");this.model().insertStudy(t,!1,!0),this._onSessionsStudyCreated.fire()}},c.prototype.checkSessStudy=function(){C.enabled("charting_library_base")||(this.sessionsStudy()||this.createSessStudy(),this.sessionsStudy().start())},c.prototype.isSpread=function(){return"spread"===this._symbolInfo.type},c.prototype.firstSymbol=function(){return this._symbolInfo?this._symbolInfo.legs[0]:""},c.prototype.firstShortName=function(){return z.ticker(this.firstSymbol())},c.prototype.onSessionsStudyCreated=function(){return this._onSessionsStudyCreated},c.prototype.loadDataTo=function(t){this._turnaround="s"+ ++this._turnaroundCounter;var e=this._properties.interval.value();e=this._generateTimeframe(e,t),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler)},c.prototype.checkInterval=function(){if(this._symbolInfo&&(D.kind(this.interval())!==D.MINUTES||this._symbolInfo.has_intraday||this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){var t=this._properties.interval.value();-1===this._symbolInfo.supported_resolutions.indexOf(t)&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}},c.prototype.setPriceScale=function(t){this.m_priceScale!==t&&(this.m_priceScale=t,this.priceScaleChanged.fire(t))},c.prototype.setGotoDateResult=function(t){this._gotoDateResult=t},c.prototype.gotoDateResult=function(){return this._gotoDateResult};c.prototype.syncModel=function(){var t,e;if(!this._syncModel){if(t=this.symbolInfo(),e=this.interval(),!t||!e)return null;this._syncModel=new j(t,e)}return this._syncModel},c.prototype.turnaround=function(){return this._turnaround},c.prototype.getStylesPropertyPage=function(){return C.enabled("show_chart_property_page")?P.ChartStylesPropertyPage:null},c.prototype.getSourceIcon=function(){return{type:"svg",svgCode:Q[this.properties().style.value()]}},c.prototype.isStyleSupported=function(t){return!0},c.prototype._onBeforeModifySeries=function(t,e){},TradingView.Series=c,t.exports=c}).call(e,i(20),i(51),i(52),i(147))},,,,,,,,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(22),i(23),e.lineToolsInfo={LineTool5PointsPattern:{icon:i(1329),localizedName:$.t("XABCD Pattern")},LineToolABCD:{icon:i(1240),localizedName:$.t("ABCD Pattern")},LineToolArc:{icon:i(1243),localizedName:$.t("Arc")},LineToolArrow:{icon:i(1291),localizedName:$.t("Arrow")},LineToolArrowMarkDown:{icon:i(1244),localizedName:$.t("Arrow Mark Down")},LineToolArrowMarkLeft:{icon:i(1245),localizedName:$.t("Arrow Mark Left")},LineToolArrowMarkRight:{icon:i(1246),localizedName:$.t("Arrow Mark Right")},LineToolArrowMarkUp:{icon:i(1247),localizedName:$.t("Arrow Mark Up")},LineToolBalloon:{icon:i(1249),localizedName:$.t("Balloon")},LineToolBarsPattern:{icon:i(1250),localizedName:$.t("Bars Pattern")},LineToolBezierCubic:{icon:i(1261),localizedName:$.t("Double Curve")},LineToolBezierQuadro:{icon:i(1254),
localizedName:$.t("Curve")},LineToolBrush:{icon:i(1251),localizedName:$.t("Brush")},LineToolCallout:{icon:i(1252),localizedName:$.t("Callout")},LineToolCircleLines:{icon:i(1255),localizedName:$.t("Cyclic Lines")},LineToolCypherPattern:{icon:i(1256),localizedName:$.t("Cypher Pattern")},LineToolDateAndPriceRange:{icon:i(1257),localizedName:$.t("Date and Price Range")},LineToolDateRange:{icon:i(1258),localizedName:$.t("Date Range")},LineToolDisjointAngle:{icon:i(1259),localizedName:$.t("Disjoint Angle")},LineToolElliottCorrection:{icon:i(1264),localizedName:$.t("Elliott Correction Wave (ABC)")},LineToolElliottDoubleCombo:{icon:i(1265),localizedName:$.t("Elliott Double Combo Wave (WXY)")},LineToolElliottImpulse:{icon:i(1266),localizedName:$.t("Elliott Impulse Wave (12345)")},LineToolElliottTriangle:{icon:i(1267),localizedName:$.t("Elliott Triangle Wave (ABCDE)")},LineToolElliottTripleCombo:{icon:i(1268),localizedName:$.t("Elliott Triple Combo Wave (WXYXZ)")},LineToolEllipse:{icon:i(1269),localizedName:$.t("Ellipse")},LineToolExtended:{icon:i(1271),localizedName:$.t("Extended")},LineToolFibChannel:{icon:i(1272),localizedName:$.t("Fib Channel")},LineToolFibCircles:{icon:i(1273),localizedName:$.t("Fib Circles")},LineToolFibRetracement:{icon:i(1274),localizedName:$.t("Fib Retracement")},LineToolFibSpeedResistanceArcs:{icon:i(1275),localizedName:$.t("Fib Speed Resistance Arcs")},LineToolFibSpeedResistanceFan:{icon:i(1276),localizedName:$.t("Fib Speed Resistance Fan")},LineToolFibSpiral:{icon:i(1277),localizedName:$.t("Fib Spiral")},LineToolFibTimeZone:{icon:i(1278),localizedName:$.t("Fib Time Zone")},LineToolFibWedge:{icon:i(1279),localizedName:$.t("Fib Wedge")},LineToolFlagMark:{icon:i(1280),localizedName:$.t("Flag Mark")},LineToolFlatBottom:{icon:i(1281),localizedName:$.t("Flat Top/Bottom")},LineToolGannComplex:{icon:i(1285),localizedName:$.t("Gann Square")},LineToolGannFan:{icon:i(1284),localizedName:$.t("Gann Fan")},LineToolGannSquare:{icon:i(1283),localizedName:$.t("Gann Box")},LineToolGhostFeed:{icon:i(1286),localizedName:$.t("Ghost Feed")},LineToolHeadAndShoulders:{icon:i(1287),localizedName:$.t("Head & Shoulders")},LineToolHorzLine:{icon:i(1288),localizedName:$.t("Horizontal Line")},LineToolHorzRay:{icon:i(1289),localizedName:$.t("Horizontal Ray")},LineToolIcon:{icon:"icon",localizedName:$.t("Font Icons")},LineToolInsidePitchfork:{icon:i(1290),localizedName:$.t("Inside Pitchfork")},LineToolNote:{icon:i(1297),localizedName:$.t("Note")},LineToolNoteAbsolute:{icon:i(1241),localizedName:$.t("Anchored Note")},LineToolParallelChannel:{icon:i(1299),localizedName:$.t("Parallel Channel")},LineToolPitchfan:{icon:i(1300),localizedName:$.t("Pitchfan")},LineToolPitchfork:{icon:i(1301),localizedName:$.t("Pitchfork")},LineToolPolyline:{icon:i(1302),localizedName:$.t("Polyline")},LineToolPrediction:{icon:i(1282),localizedName:$.t("Forecast")},LineToolPriceLabel:{icon:i(1303),localizedName:$.t("Price Label")},LineToolPriceRange:{icon:i(1304),localizedName:$.t("Price Range")},LineToolProjection:{icon:i(1305),
localizedName:$.t("Projection")},LineToolRay:{icon:i(1306),localizedName:$.t("Ray")},LineToolRectangle:{icon:i(1307),localizedName:$.t("Rectangle")},LineToolRegressionTrend:{icon:i(1308),localizedName:$.t("Regression Trend")},LineToolRiskRewardLong:{icon:i(1293),localizedName:$.t("Long Position")},LineToolRiskRewardShort:{icon:i(1312),localizedName:$.t("Short Position")},LineToolRotatedRectangle:{icon:i(1310),localizedName:$.t("Rotated Rectangle")},LineToolSchiffPitchfork:{icon:i(1296),localizedName:$.t("Modified Schiff Pitchfork")},LineToolSchiffPitchfork2:{icon:i(1311),localizedName:$.t("Schiff Pitchfork")},LineToolSineLine:{icon:i(1313),localizedName:$.t("Sine Line")},LineToolText:{icon:i(1316),localizedName:$.t("Text")},LineToolTextAbsolute:{icon:i(1242),localizedName:$.t("Anchored Text")},LineToolThreeDrivers:{icon:i(1317),localizedName:$.t("Three Drives Pattern")},LineToolTimeCycles:{icon:i(1318),localizedName:$.t("Time Cycles")},LineToolTrendAngle:{icon:i(1323),localizedName:$.t("Trend Angle")},LineToolTrendBasedFibExtension:{icon:i(1324),localizedName:$.t("Trend-Based Fib Extension")},LineToolTrendBasedFibTime:{icon:i(1325),localizedName:$.t("Trend-Based Fib Time")},LineToolTrendLine:{icon:i(1292),localizedName:$.t("Trend Line")},LineToolTriangle:{icon:i(1327),localizedName:$.t("Triangle")},LineToolTrianglePattern:{icon:i(1326),localizedName:$.t("Triangle Pattern")},LineToolVertLine:{icon:i(1328),localizedName:$.t("Vertical Line")},SyncDrawing:{icon:i(1315),iconActive:i(1314),localizedName:$.t("Sync drawings to all charts")},arrow:{icon:i(1248),localizedName:$.t("Arrow")},cursor:{icon:i(1253),localizedName:$.t("Cross")},dot:{icon:i(1260),localizedName:$.t("Dot")},drawginmode:{icon:i(1263),iconActive:i(1262),localizedName:$.t("Stay in Drawing Mode")},eraser:{icon:i(1270),localizedName:$.t("Eraser")},group:{icon:i(1209),localizedName:$.t("Show Hidden Tools")},hideAllDrawings:{icon:i(1322),iconActive:i(1319),localizedName:$.t("Hide All Drawing Tools")},lockAllDrawings:{icon:i(1321),iconActive:i(1320),localizedName:$.t("Lock All Drawing Tools")},magnet:{icon:i(1294),localizedName:$.t("Magnet Mode")},measure:{icon:i(1295),localizedName:$.t("Measure (Shift + Click on the chart)")},removeAllDrawingTools:{icon:i(1309),localizedName:$.t("Remove All Drawing Tools")},showObjectsTree:{icon:i(1298),localizedName:$.t("Show Objects Tree")},zoom:{icon:i(1330),localizedName:$.t("Zoom In")},"zoom-out":{icon:i(1331),localizedName:$.t("Zoom Out")}}},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(41),r=function(t){function e(e){return void 0===e&&(e=100),t.call(this,e)||this}return o.__extends(e,t),e.prototype.state=function(){var t=n.PriceFormatter.prototype.state.call(this);return t.percent=!0,t},e.prototype.format=function(e,i,o,n){return t.prototype.format.call(this,e,i,o,n)+"%"},e}(n.PriceFormatter),e.PercentageFormatter=r},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(53),n=i(1141),r=function(){function t(){this._rendererData={
text:"",coordinate:0,fixedCoordinate:0,color:"#FFF",background:"#000",visible:!1},this._renderer=new n.PriceAxisViewRenderer(this._rendererData),this._invalidated=!0}return t.prototype.text=function(){return this._rendererData.text},t.prototype.background=function(){return this._rendererData.background},t.prototype.color=function(){return this.generateTextColor(this.background())},t.prototype.generateTextColor=function(t){return"black"===o.rgbToBlackWhiteString(o.parseRgb(t),160)?"white":"black"},t.prototype.coordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.coordinate},t.prototype.floatCoordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.floatCoordinate||this._rendererData.coordinate},t.prototype.update=function(){this._invalidated=!0},t.prototype.height=function(t,e){return void 0===e&&(e=!1),this._renderer.height(t,e)},t.prototype.getFixedCoordinate=function(){return this._rendererData.fixedCoordinate||0},t.prototype.setFixedCoordinate=function(t){this._rendererData.fixedCoordinate=t},t.prototype.isVisible=function(){return this._rendererData.visible},t.prototype.renderer=function(){return this._updateRendererDataIfNeeded(),this._renderer.setData(this._rendererData),this._renderer},t.prototype._updateRendererDataIfNeeded=function(){this._invalidated&&(this._updateRendererData(this._rendererData),this._invalidated=!1)},t}(),e.PriceAxisView=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(1155);e.createDialog=o.createDialog},function(t,e,i){"use strict";var o,n,r=i(51),s=i(7);!function(t){t[t.NotBound=0]="NotBound",t[t.BoundToWidget=1]="BoundToWidget",t[t.BoundToModel=2]="BoundToModel"}(o||(o={})),n=function(){function t(){this._watchedSymbol=new r,this._seriesShortSymbol=new r,this._proSymbol=new r,this._watchedInterval=new r,this._watchedIntraday=new r,this._watchedSupportedResolutions=new r,this._symbolNamesList=new r,this._chartWidgetBindingState=o.NotBound,this._activeChartWidget=null,this._watchedSymbolListenerBound=this._watchedSymbolListener.bind(this),this._watchedIntervalListenerBound=this._watchedIntervalListener.bind(this),this._onSymbolLinkBound=this._onSymbolLink.bind(this),this._searchCharts=null,this._selfEmit=!1,this._preventFeedBySymbol=!1}return Object.defineProperty(t.prototype,"symbol",{get:function(){return this._watchedSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"proSymbol",{get:function(){return this._proSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"symbolNamesList",{get:function(){return this._symbolNamesList},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"seriesShortSymbol",{get:function(){return this._seriesShortSymbol.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"interval",{get:function(){return this._watchedInterval},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"intraday",{get:function(){return this._watchedIntraday.readonly()},enumerable:!0,configurable:!0
}),Object.defineProperty(t.prototype,"supportedResolutions",{get:function(){return this._watchedSupportedResolutions.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preventFeedBySymbol",{get:function(){return this._preventFeedBySymbol},enumerable:!0,configurable:!0}),t.prototype.bindToChartWidget=function(t){var e,i;if(this.unbindFromChartWidget(),this._activeChartWidget=t,e=t.model())return void this._onChartModelCreated(e);t.modelCreated().subscribe(this,this._onChartModelCreated),this._chartWidgetBindingState=o.BoundToWidget,i=t.properties().mainSeriesProperties,this._watchedSymbol.setValue(i.symbol.value()),this._watchedInterval.setValue(i.interval.value())},t.prototype.unbindFromChartWidget=function(){switch(this._chartWidgetBindingState){case o.BoundToWidget:if(!this._activeChartWidget)throw Error("ChartWidget is undefined");this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated);break;case o.BoundToModel:this._symbolProperty().unsubscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.unsubscribe(this._watchedSymbolListenerBound),this._mainSeries().onSymbolResolved().unsubscribe(this,this._updateSeriesSymbolInfo),this._mainSeries().onSymbolError().unsubscribe(this,this._updateSeriesSymbolInfo),this._intervalProperty().unsubscribe(this,this._onIntervalPropertyChange),this._watchedInterval.unsubscribe(this._watchedIntervalListenerBound),delete this._watchedSymbol.hook,delete this._watchedSymbol.writeLock}this._activeChartWidget=null,this._chartWidgetBindingState=o.NotBound},t.prototype.getChartWidget=function(){return this._activeChartWidget},t.prototype.bindToChartWidgetCollection=function(t){var e=this;this._chartWidgetCollection=t,this.unbindFromChartWidget(),t.activeChartWidget.subscribe(function(t){e.unbindFromChartWidget(),e.bindToChartWidget(t)},{callWithLast:!0})},t.prototype.bindToSearchCharts=function(t){this.unbindFromSearchCharts(),this._searchCharts=t,t.onSearchBySymbol.subscribe(this,this._onSearchBySymbol),this._watchedSymbol.subscribe(this._onSymbolLinkBound)},t.prototype.unbindFromSearchCharts=function(){this._searchCharts&&(this._searchCharts.onSearchBySymbol.unsubscribe(this,this._onSearchBySymbol),this._watchedSymbol.unsubscribe(this._onSymbolLinkBound),this._searchCharts=null)},t.prototype.setPreventFeedBySymbol=function(t){this._preventFeedBySymbol=t},t.prototype._onSearchBySymbol=function(t){if(!t.resolved_symbol)throw Error("no resolved_symbol");this._selfEmit=!0,this._watchedSymbol.setValue(t.resolved_symbol),this._selfEmit=!1},t.prototype._onSymbolLink=function(t){if(!this._selfEmit){if(!this._searchCharts)throw Error("No search charts defined");this._preventFeedBySymbol||this._searchCharts.feedBySymbol(t)}},t.prototype._mainSeries=function(){if(!this._activeChartWidget)throw Error("ChartWidget is undefined");return this._activeChartWidget.model().mainSeries()},t.prototype._properties=function(){return this._mainSeries().properties()},t.prototype._symbolProperty=function(){return this._properties().symbol},
t.prototype._intervalProperty=function(){return this._properties().interval},t.prototype._watchedSymbolListener=function(t){(s.enabled("same_data_requery")||this._symbolProperty().value()!==t)&&this._chartWidgetCollection.setSymbol(t)},t.prototype._onSymbolPropertyChange=function(){this._watchedSymbol.setValue(this._symbolProperty().value())},t.prototype._onSymbolResolved=function(t){this._proSymbol.setValue(t.pro_name||s.enabled("trading_terminal")&&(t.full_name||t.name)||""),t.aliases&&this._symbolNamesList.setValue(t.aliases)},t.prototype._updateSeriesSymbolInfo=function(){this._seriesShortSymbol.setValue(this._properties().shortName.value());var t=this._mainSeries().symbolInfo();t?(this._onSymbolResolved(t),t.hasOwnProperty("supported_resolutions")?this._watchedSupportedResolutions.setValue(t.supported_resolutions):this._watchedSupportedResolutions.setValue(void 0),this._watchedIntraday.setValue(!!t.has_intraday)):(this._watchedIntraday.deleteValue(),this._proSymbol.deleteValue())},t.prototype._watchedIntervalListener=function(t){(s.enabled("same_data_requery")||this._intervalProperty().value()!==t)&&this._chartWidgetCollection.setResolution(t)},t.prototype._onIntervalPropertyChange=function(){this._watchedInterval.setValue(this._intervalProperty().value())},t.prototype._onChartModelCreated=function(t){var e,i,n;if(!this._activeChartWidget)throw Error("ChartWidget is undefined");this._chartWidgetBindingState=o.BoundToModel,this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated),e=this._symbolProperty(),e.subscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.setValue(e.value()),this._watchedSymbol.subscribe(this._watchedSymbolListenerBound),i=this._mainSeries(),i.onSymbolResolved().subscribe(this,this._onSymbolResolved),this._watchedSymbol.hook=function(t){return i.symbolSameAsCurrent(t)&&(t=i.symbol()),t},i.onSymbolResolved().subscribe(this,this._updateSeriesSymbolInfo),i.onSymbolError().subscribe(this,this._updateSeriesSymbolInfo),i.onSymbolNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.onSymbolGroupNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.onExtendedHoursNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo(),n=this._intervalProperty(),n.subscribe(this,this._onIntervalPropertyChange),this._watchedInterval.setValue(n.value()),this._watchedInterval.subscribe(this._watchedIntervalListenerBound),this._activeChartWidget.readOnly()&&(this._watchedSymbol.writeLock=!0)},t}(),window.TradingView=window.TradingView||{},window.TradingView.Linking=new n,t.exports=window.TradingView.Linking},function(t,e,i){"use strict";function o(t,e,i){function o(t,e,i,o,n,r){var s=0;return t<i?s|=1:t>n&&(s|=2),e<o?s|=4:e>r&&(s|=8),s}for(var n,r,s,a=t[0].x,l=t[0].y,c=t[1].x,h=t[1].y,u=e.x,d=e.y,p=i.x,_=i.y,f=o(a,l,u,d,p,_),g=o(c,h,u,d,p,_),v=!1,y=0;;){if(y>1e3)throw Error("Cohen - Sutherland algorithm: infinity loop");if(y++,!(f|g)){v=!0;break}if(f&g)break;n=f||g,r=void 0,s=void 0,8&n?(r=a+(c-a)*(_-l)/(h-l),
s=_):4&n?(r=a+(c-a)*(d-l)/(h-l),s=d):2&n?(s=l+(h-l)*(p-a)/(c-a),r=p):(s=l+(h-l)*(u-a)/(c-a),r=u),n===f?(a=r,l=s,f=o(a,l,u,d,p,_)):(c=r,h=s,g=o(c,h,u,d,p,_))}return v?m.equalPoints(m.point(a,l),m.point(c,h))?m.point(a,l):m.lineSegment(m.point(a,l),m.point(c,h)):null}function n(t,e){var i,o,n=t.A,r=e.A,s=t.B,a=e.B,l=t.C,c=e.C,h=n*a-r*s;return Math.abs(h)<1e-6?null:(i=(s*c-a*l)/h,o=(r*l-n*c)/h,new m.Point(i,o))}function r(t,e,i,o){var n,r=e.subtract(t),s=o.subtract(i),a=r.x*s.y-r.y*s.x;return Math.abs(a)<1e-6?null:(n=t.subtract(i),(n.y*s.x-n.x*s.y)/a)}function s(t,e,i,o){var n,s,a,l=r(t,e,i,o);return null===l?null:(n=e.subtract(t),s=n.scaled(l).add(t),a=g.distanceToSegment(i,o,s),Math.abs(a.distance)<1e-6?l:null)}function a(t,e){return-(t.C+t.B*e)/t.A}function l(t,e){return-(t.C+t.A*e)/t.B}function c(t,e){var i,o,n;for(i=0,o=t;i<o.length;i++)if(n=o[i],m.equalPoints(n,e))return!1;return t.push(e),!0}function h(t,e,i){var o,n,r,s,h,u=e.x,d=e.y,p=i.x,_=i.y;if(0===t.A)return o=-t.C/t.B,d<=o&&o<=_?m.lineSegment(m.point(u,o),m.point(p,o)):null;if(0===t.B)return n=-t.C/t.A,u<=n&&n<=p?m.lineSegment(m.point(n,d),m.point(n,_)):null;switch(r=[],s=function(e){var i=l(t,e);d<=i&&i<=_&&c(r,new m.Point(e,i))},h=function(e){var i=a(t,e);u<=i&&i<=p&&c(r,new m.Point(i,e))},s(u),h(d),s(p),h(_),r.length){case 0:return null;case 1:return r[0];case 2:return m.equalPoints(r[0],r[1])?r[0]:m.lineSegment(r[0],r[1])}return f.assert(!1,"We should have at most two intersection points"),null}function u(t,e,i,o){var n,r=s(t,e,i,new m.Point(o.x,i.y)),a=s(t,e,new m.Point(o.x,i.y),o),l=s(t,e,o,new m.Point(i.x,o.y)),c=s(t,e,new m.Point(i.x,o.y),i),h=[];return null!==r&&r>=0&&h.push(r),null!==a&&a>=0&&h.push(a),null!==l&&l>=0&&h.push(l),null!==c&&c>=0&&h.push(c),0===h.length?null:(h.sort(function(t,e){return t-e}),n=v.pointInRectangle(t,i,o)?h[0]:h[h.length-1],t.addScaled(e.subtract(t),n))}function d(t,e){return!(t.length>0&&m.equalPoints(t[t.length-1],e))&&(t.push(e),!0)}function p(t,e){var i,o,r,s,a,l=[];for(i=0;i<t.length;++i)o=t[i],r=t[(i+1)%t.length],s=m.lineThroughPoints(o,r),v.pointInHalfplane(o,e)?(d(l,o),v.pointInHalfplane(r,e)||null!==(a=n(s,e.edge))&&d(l,a)):v.pointInHalfplane(r,e)&&null!==(a=n(s,e.edge))&&d(l,a);return l.length>=3?l:null}function _(t,e){var i,o,n,r,s,a=t;for(i=0;i<e.length&&null!==a;++i)o=e[i],n=e[(i+1)%e.length],r=e[(i+2)%e.length],s=m.lineThroughPoints(o,n),a=p(a,m.halfplaneThroughPoint(s,r));return a}var f,m,g,v;Object.defineProperty(e,"__esModule",{value:!0}),f=i(21),m=i(1),g=i(33),v=i(49),e.intersectLineSegmentAndRectangle=o,e.intersectLines=n,e.intersectLineSegments=s,e.intersectLineAndRectangle=h,e.intersectRayAndRectangle=u,e.intersectPolygonAndHalfplane=p,e.intersectPolygons=_},,,function(t,e,i){"use strict";var o,n,r,s;i(432),o=i(56),n=o.greaterThan,r=o.lessThan,s=window.CanvasEx=i(115),TradingView.resizeCanvas=function(t,e,i){var o,n,r,s,a,l=t.prop("height"),c=t.prop("width");l&&c&&(l/=window.hidpiCanvasRatio||1,c/=window.hidpiCanvasRatio||1,l<1&&(l=1),c<1&&(c=1),o=$("<canvas>").prop("width",c).prop("height",l),
n=o.get(0).getContext("2d"),r=Math.min(c,e),s=Math.min(l,i),r&&s&&n.drawImage(t.get(0),0,0,r,s,0,0,r,s),t.prop("height",i).prop("width",e),a=t.get(0).getContext("2d"),r&&s&&a.drawImage(o.get(0),0,0,r,s,0,0,r,s),o.remove())},s.computeDashPattern=function(t){return[[t.lineWidth,2*t.lineWidth],[5*t.lineWidth,6*t.lineWidth],[6*t.lineWidth,6*t.lineWidth],[t.lineWidth,4*t.lineWidth]][t.lineStyle-1]},s.drawLine=function(t,e,i,o,n){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(n)&&(t.lineStyle===s.LINESTYLE_DASHED||t.lineStyle===s.LINESTYLE_DOTTED||t.lineStyle===s.LINESTYLE_SPARSE_DOTTED?t.drawDashedLine(t,e,i,o,n):s.drawSolidLine(t,e,i,o,n))},s.drawArrow=function(t,e,i,o,n){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(n)&&(t.beginPath(),t.moveTo(o,n),t.lineTo(e,i),t.moveTo(e+2,i+2),t.lineTo(e-2,i+2),t.moveTo(e-1,i+1),t.lineTo(e+1,i+1),t.stroke())},s.drawSolidLine=function(t,e,i,o,n){t.beginPath(),t.moveTo(e,i),t.lineTo(o,n),t.stroke()},s.setLineStyle=function(t,e){t.lineStyle=e;var i=[];e!==s.LINESTYLE_SOLID&&(i=s.computeDashPattern(t)),"function"==typeof t.setLineDash?t.setLineDash(i):void 0!==t.mozDash?t.mozDash=i:void 0!==t.webkitLineDash&&(t.webkitLineDash=i)},s.drawPoly=function(t,e,i){var o,n;for(t.beginPath(),t.moveTo(e[0].x,e[0].y),o=0;o<e.length;o++)n=e[o],t.lineTo(n.x,n.y);t.closePath(),t.stroke(),i&&t.fill()},s.lineStyles=[],"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(t){if(this.font!==t)try{this.font=t}catch(t){}},CanvasRenderingContext2D.prototype.lineStyle=s.LINESTYLE_SOLID,s.originalSave=CanvasRenderingContext2D.prototype.save,s.originalRestore=CanvasRenderingContext2D.prototype.restore,CanvasRenderingContext2D.prototype.save=function(){s.lineStyles.push(this.lineStyle),s.originalSave.call(this)},CanvasRenderingContext2D.prototype.restore=function(){s.lineStyles.length>0&&(this.lineStyle=s.lineStyles.pop(),s.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(t,e,i,o,n){t.save();var r=s.computeDashPattern(t);if(t.beginPath(),"function"==typeof t.setLineDash)t.setLineDash(r);else if(void 0!==t.mozDash)t.mozDash=r;else{if(void 0===t.webkitLineDash)return t.dashedLineTo(e,i,o,n,r),t.stroke(),void t.restore();t.webkitLineDash=r}t.moveTo(e,i),t.lineTo(o,n),t.stroke(),t.restore()},CanvasRenderingContext2D.prototype.dashedLineTo=function(t,e,i,o,s){var a,l,c,h,u,d,p={thereYet:n,cap:Math.min},_={thereYet:n,cap:Math.min};for(e-o>0&&(_.thereYet=r,_.cap=Math.max),t-i>0&&(p.thereYet=r,p.cap=Math.max),this.moveTo(t,e),a=t,l=e,c=0,h=!0;!p.thereYet(a,i)||!_.thereYet(l,o);)u=Math.atan2(o-e,i-t),d=s[c],a=p.cap(i,a+Math.cos(u)*d),l=_.cap(o,l+Math.sin(u)*d),h?this.lineTo(a,l):this.moveTo(a,l),c=(c+1)%s.length,h=!h},CanvasRenderingContext2D.prototype.roundRect=function(t,e,i,o,n){this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-n,e),this.arcTo(t+i,e,t+i,e+n,n),this.lineTo(t+i,e+o-n),this.arcTo(t+i,e+o,t+i-n,e+o,n),this.lineTo(t+n,e+o),this.arcTo(t,e+o,t,e+o-n,n),this.lineTo(t,e+n),this.arcTo(t,e,t+n,e,n)}),t.exports=s
},function(t,e,i){(function(e){"use strict";var i=window.TradingView=window.TradingView||{};i.className=function(t){for(var e in this)if(i[e]===t)return e;return null},i.isOnFeaturePage=/on-features-page=1/i.test(window.location.search),i.wrapUrl=function(t){return e.enabled("charting_library_base")&&(t=t.replace("","")),t},i.isMobile=function(){var t=/Android/i.test(navigator.userAgent),e=/BlackBerry/i.test(navigator.userAgent),i=/iPhone|iPad|iPod/i.test(navigator.userAgent),o=/Opera Mini/i.test(navigator.userAgent),n=t||e||i||o;return{Android:function(){return t},BlackBerry:function(){return e},iOS:function(){return i},Opera:function(){return o},any:function(){return n}}}(),i.supportTouch=function(){return Modernizr.touch||i.isMobile.any()},i.onWidget=function(){var t,e,i=["^widgetembed/?$","^cmewidgetembed/?$","^([0-9a-zA-Z-]+)/widgetembed/?$","^([0-9a-zA-Z-]+)/widgetstatic/?$","^([0-9a-zA-Z-]+)?/?miniwidgetembed/?$","^([0-9a-zA-Z-]+)?/?mediumwidgetembed/?$","^embed(-static)?/([0-9a-zA-Z]{8})/?$","^widgetpopup/?$","^extension/?$","^chatwidgetembed/?$","^ideaswidgetembed/?$","^ideas-widget/?$","^view-idea-widget/([0-9a-zA-Z]{8})/?$","^user-info-widget/?$","^user-info-widget-get/(.+?)?/?$","^embed-quotes-provider/?$","^idea-popup/?$","^hotlistswidgetembed/?$","^marketoverviewwidgetembed/?$","^([0-9a-zA-Z-]+)/marketoverviewwidgetembed/?$","^eventswidgetembed/?$","^tickerswidgetembed/?$","^forexcrossrateswidgetembed/?$","^forexheatmapwidgetembed/?$","^marketquoteswidgetembed/?$","^screenerwidget/?$","^([0-9a-zA-Z-]+)/marketquoteswidgetembed/?$"],o=window.location.pathname.replace(/^\//,"");for(e=i.length-1;e>=0;e--)if(t=RegExp(i[e]),t.test(o))return!0;return!1},i.onOrder=function(){return"/order/"===window.location.pathname},t.exports.CheckMobile=i.isMobile,t.exports.supportTouch=i.supportTouch,t.exports.onWidget=i.onWidget}).call(e,i(7))},function(t,e,i){"use strict";var o,n=function(t,e,o){var r,s,a,l,c,h;t=$(t),o=o||{},o.activeClass=o.activeClass||"",r=(o.event||"click")+".popup-menu",o.hideEvent&&(s=o.hideEvent+".popup-menu"),a=function(){},l=a,c={},h=function(r,s,h){function u(e){var i=$(e.target).parents().andSelf();i.is(f)||i.is(t)||i.is(".charts-popup-tab-headers, .charts-popup-itemheader")||l()}function d(t){var e=$(t.target).parents().andSelf();e.is(".charts-popup-tab-headers, .charts-popup-itemheader")||o.notCloseOnButtons&&e.is(".icon-delete")||l()}function p(e,r,s){var a,l,c,h,u,d,_,m,g,v,y,b,S,w,T,x;if(e instanceof n.TabGroup){if(!e.tabs||!e.tabs.length)return;return 1!==e.tabs.length||e.tabs[0].title?(a=$('<div class="charts-popup-tab-group"></div>').appendTo(s),l=$('<div class="charts-popup-tab-headers"></div>').appendTo(a),c=null,void $.each(e.tabs||[],function(t,i){var o,n;i.items&&i.items.length&&(o=$('<div class="charts-popup-tab"></div>').hide().appendTo(a),$.each(i.items,function(){p(this,void 0,o)}),n=$('<span class="charts-popup-tab-header">').append($('<a href="javascript://" class="charts-popup-tab-header-label">').text(i.name)).appendTo(l),n.on("click",function(t){
n.is(".active")||(l.find(".charts-popup-tab-header.active").removeClass("active"),n.addClass("active"),a.find(".charts-popup-tab").hide(),o.show(),t&&t.preventDefault(),"function"==typeof e.onChange&&e.onChange.call(e,i.name))}),c&&!i.active||(c=n,l.find(".charts-popup-tab-header.active").removeClass("active"),n.addClass("active"),a.find(".charts-popup-tab").hide(),o.show()))})):void $.each(e.tabs[0].items,function(){p(this,void 0,s)})}return e instanceof n.Group?(h=$('<div class="charts-popup-group"></div>').appendTo(s),e.title&&(u=$('<div class="charts-popup-itemheader"></div>').text(e.title).prepend($('<span class="charts-popup-itemheader-icon"></span>')),e.collapsible&&(h.addClass("charts-popup-group-collapsible"),h.toggleClass("collapsed",e.collapsed),u.on("click",function(){h.toggleClass("collapsed"),"function"==typeof e.onChange&&e.onChange(h.hasClass("collapsed")),f.height()===parseInt(f.css("max-height"))?f.addClass("popup-menu-scroll-y"):f.height()<parseInt(f.css("max-height"))&&f.removeClass("popup-menu-scroll-y")})),h.append(u)),void $.each(e.items,function(t){p(this,1,h)})):e instanceof n.Header?void s.append($('<div class="charts-popup-itemheader"></div>').text(e.title)):e.separator?(d=$('<span class="separator"></span>'),void s.append(d)):(d=$('<a class="item" href="#">'),e.url&&d.attr("href",e.url),e.target&&d.attr("target",e.target),r||d.addClass("first"),"function"==typeof e.active?e.active(e)&&d.addClass("active"):e.active&&d.addClass("active"),e.addClass&&d.addClass(e.addClass),e.addData&&d.data(e.addData),e.disabled&&d.addClass("disabled"),"function"==typeof e.action&&(_=e.action,m=function(t){$(t.target).parents().andSelf().is(w)||(_.apply(d,arguments),!e.url&&t&&"function"==typeof t.preventDefault&&t.preventDefault())},o.upAction?d.bind("mouseup",m):d.bind("click",m)),e.date?(g=$('<span class="title"></span>').appendTo(d),$('<span class="date"></span>').text(e.date||"").appendTo(d)):e.icon&&!o.svg?(v=$('<span class="icon"></span>').appendTo(d),v.css("background-image",e.icon.image||""),e.icon.offset&&v.css("background-position","string"==typeof e.icon.offset?e.icon.offset:e.icon.offset.x+"px "+e.icon.offset.y+"px"),g=$('<span class="title"></span>').appendTo(d)):!0===o.svg&&e.svg?(o.wrapIcon?d.append($('<span class="icon-wrap">').addClass(e.iconClass).append(e.svg)):d.append(e.svg),g=$('<span class="title"></span>').appendTo(d)):e.iconClass?(d.append($('<span class="icon"></span>').addClass(e.iconClass)),g=$('<span class="title"></span>').appendTo(d)):g=$('<span class="title-expanded"></span>').appendTo(d),e.html?g.html(e.html):g.text(TradingView.clean(e.title,!0)||""),y=$('<span class="shortcut"></span>').appendTo(d),e.shortcut&&y.text(e.shortcut.keys),"function"==typeof e.deleteAction&&(b=e.deleteAction,S=e.deleteAction.title||$.t("Delete"),w=$('<span class="icon-delete">'),w.html(i(109)),w.attr("title",S),w.on("click",function(t){b.apply(d,arguments),t.preventDefault()}),d.append(w)),e.buttons instanceof Array&&e.buttons.length&&e.buttons.forEach(function(t){
t.el instanceof $||(t.el=$(t.el)),t.el.appendTo(d),t.handler&&t.el.on("click",function(e){t.handler.apply(d,arguments)})}),void 0!==e.counter&&("function"==typeof e.counter?(T=$('<span class="counter"></span>').html(e.counter()),T.appendTo(d)):(x=e.counterBlue?"blue":"",$('<span class="counter"></span>').text(e.counter+"").addClass(x).appendTo(d))),s.append(d),void t.data("popup-menu",s))}var _,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E,V,D,O,B,R,z,F,N=s||e;if("function"==typeof N&&(N=N()),$(this).hasClass("open")||$(this).hasClass("active"))return r.preventDefault(),l(),void(_=c.scrollTop);switch(l=function(){c.scrollTop=f.scrollTop(),f.remove(),t.removeClass("active open "+o.activeClass),t.data("popup-menu",null),$(document).off("click",d),$(document).off("mousedown",u),Modernizr.touch&&$(document).off("touchstart.chartgui",u),$(document).off("selectstart.popup-menu"),l=a,o.onRemove&&o.onRemove()},t.addClass("active open "+o.activeClass),f=$('<div class="charts-popup-list">'),o.addClass&&f.addClass(o.addClass),o.zIndex&&f.css("z-index",o.zIndex),m=f,o.listInner&&(m=$('<div class="list-inner">').appendTo(m)),o.listTable&&(m=$('<div class="list-table">').appendTo(m)),$.each(N,function(t){p(this,t,m)}),setTimeout(function(){$(document).on("click",d),$(document).on("mousedown",u),Modernizr.touch&&$(document).on("touchstart.chartgui",u)},0),o.upAction&&$(document).on("selectstart.popup-menu",function(){return!1}),f.appendTo(document.body),g=$(window).width(),v=Math.min($(window).height(),$("body").height()),y=t.outerWidth(),b=t.outerHeight(),S=t.offset(),_=$(window).scrollTop()||0,S.top-=_,S.top=Math.round(S.top),S.left=Math.round(S.left),w=f.outerWidth(),T=f.outerHeight(),x=void 0!==o.viewportSpacing?o.viewportSpacing:10,C=o.popupSpacing?~~o.popupSpacing:1,P=o.popupDrift?~~o.popupDrift:0,L=T-f.height(),I="down",o.direction&&(I="function"==typeof o.direction?o.direction():o.direction),k=!!o.reverse,"down"===I?(A=v-S.top-b-C-x-L,M=S.top-C-x-L,A<Math.max(T||0,100)&&M>A&&(I="up")):"right"===I&&(E=g-S.left-y-C-x-L,V=S.left-C-x-L,E<Math.max(w||0,100)&&V>E&&(I="left")),I){case"down":case"up":"down"===I?f.css("top",S.top+b+C+"px"):f.css("bottom",v-S.top+C+"px").css("top","auto"),k?f.css("left",Math.max(S.left+P+y-w,x)+"px").css("right","auto"):f.css("left",S.left+P+"px").css("right","auto");break;case"right":case"left":C=Math.max(C,4),"right"===I?f.css("left",Math.floor(S.left+y+C)+"px").css("right","auto"):f.css("left",Math.floor(Math.max(S.left-w-C,x))+"px").css("right","auto"),k?f.css("top",Math.floor(Math.max(S.top+P+b-T,x))+"px"):f.css("top",Math.floor(S.top+P)+"px")}for(f.show(),D=S.top,"up"===I||{left:1,right:1}[I]&&k?"up"!==I?D+=b:D-=b+C+L+x:D=v-D-b-2*C-L,f.height()>D&&f.addClass("popup-menu-scroll-y"),f.css("max-height",D+"px"),o.careRightBorder&&(O=g+$(window).scrollLeft(),parseInt(f.css("left"))+f.width()+x>O&&f.css("left",O-f.width()-x+"px").css("right","auto")),o.careBottomBorder&&parseInt(f.css("top"))+f.height()+x>v+_&&f.css("top",v-f.height()-x+_+"px"),R=t.parents().andSelf(),
z=R.size();z--;)if("fixed"===R.eq(z).css("position")){B=R.eq(z);break}B&&(F=f.offset(),f.css({position:"fixed",left:F.left-$(document).scrollLeft(),right:"auto"})),f[0].scrollHeight>f.height()&&f.addClass("popup-with-scroll"),r&&r.preventDefault()},r&&t.bind(r,h),s&&t.bind(s,function(){l()}),o.runOpened&&h()};n.TabGroup=function t(e){if(!(this instanceof t))return new t(e);e=e||{},this.tabs=[],"function"==typeof e.onChange&&(this.onChange=e.onChange)},n.TabGroup.prototype.appendTab=function(t,e,i){if(null==t?t="":t+="",e||(e=[]),i||(i={}),!Array.isArray(e))throw new TypeError("items must be an array");return this.tabs.push({name:t,items:e,active:!!i.active}),e},n.Header=function t(e){if(!(this instanceof t))return new t(e);this.title=e},n.Group=function t(e){if(!(this instanceof t))return new t(e);e=e||{},this.items=[],this.title=null==e.title?"":e.title+"",this.collapsible=!!e.collapsible,this.collapsed=!!e.collapsed,"function"==typeof e.onChange&&(this.onChange=e.onChange)},n.Group.prototype.push=function(){this.items.push.apply(this.items,arguments)},e.bindPopupMenu=n,o=function(t){t=$(t),t.unbind(".popup-menu"),t.removeData("popup-menu")},e.unbindPopupMenu=o},function(t,e,i){(function(e){"use strict";function o(){if("undefined"==typeof tradingService)return null;var t=tradingService();return t&&t.connectStatus()===CONNECTSTATUSES.CONNECTED?t.activeBroker():null}function n(){var t=o();return t&&t.metainfo().configFlags.supportSymbolSearch&&t.metainfo().id.toLowerCase()}var r=i(286),s=i(97),a=i(816),l=i(180),c=i(232).unifiedSpinner,h=i(177),u=i(319).regExpEscape,d=i(1145),p=i(219).isFeatureEnabled,_=i(158),f=function(){function t(i){var o,n,r,s;if(!(this instanceof t))throw new TypeError("SymbolSearch is a constructor");if(i=i||{},o=!i.dontUseInputParser&&e.enabled("symbol_search_parser_mixin")&&t.canShowSpreadActions(),this._inputParserMixin=o?new SymbolSearchInputParserMixin(this):void 0,this._inputElement=$(i.input).get(0),!this._inputElement)throw new TypeError("options.input must be a DOM element, jQuery object or selector");if(this.$list=$(i.list).eq(0),0===this.$list.size()&&delete this.$list,void 0!==i.callback){if("function"!=typeof i.callback)throw new TypeError("options.callback must be function");this._callback=i.callback}if(void 0!==i.onValueChanged){if("function"!=typeof i.onValueChanged)throw new TypeError("options.onValueChanged must be function");this._onValueChanged=i.onValueChanged}if(void 0!==i.onEmptyApply){if("function"!=typeof i.onEmptyApply)throw new TypeError("options.onEmptyApply must be function");this._onEmptyApply=i.onEmptyApply}if(i.ignoreInterval&&(this._ignoreInterval=!0),t.resetStoredInterval(),i.hidePro&&(this._hidePro=!0),i.allowMultipleSymbols&&(this._allowMultipleSymbols=!0),void 0!==i.onParse){if("function"!=typeof i.onParse)throw new TypeError("options.onParse must be function");this._onParse=i.onParse}for(this._state={},this._resolveViaSymbolSearchId=null,this.acceptEmpty=!!i.acceptEmpty,$(this._inputElement).data("symbol-search-instance",this),
n=this._boundListener=this._eventListener.bind(this),r=this.boundTimeoutListener=function(t){setTimeout(function(){n(t)},0)},s=0;s<w.length;s++)w[s].immediate?$(this._inputElement).on(w[s].name,n):$(this._inputElement).on(w[s].name,r);this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnKeyPress=this._onKeyPress.bind(this),$(this._inputElement).on("keydown",this._boundOnKeyDown).on("keypress",this._boundOnKeyPress),this._eventListener(),i.autoFocus&&t.registerAutoFocus(this)}function o(t,e){var i,o=ChartApiInstance.supportedSymbolsTypes();return n()&&(o=o.filter(function(t){return"quandl"!==t.value&&"economic"!==t.value})),i=TVSettings.getValue("symboledit.filter"),!o.some(function(t){return t.value===i})&&o.length>0&&(i=o[0].value),0!==o.length&&(o.forEach(function(o){var n=o.value,r=$('<a class="type-filter">').attr("href","#"+n).text($.t(o.name));n===i&&r.addClass("active"),r.on("click",function(i){i.preventDefault(),e.find(".type-filter").removeClass("active"),$(this).addClass("active"),t.typeFilter(n),TVSettings.setValue("symboledit.filter",n)}),r.appendTo(e)}),t.typeFilter(i),!0)}function f(t,i){var o,n,r,s=ChartApiInstance.supportedExchangesList();if(s=a.displayedExchangesFilter(s),s=a.sortExchangesListByFlagIfNeeded(s),o=TVSettings.getValue("symboledit.exchangefilter"),"bovespa"!==TradingView.widgetCustomer)return!s.some(function(t){return t.value===o})&&s.length>0&&(o=s[0].value),0!==s.length&&(n=$('<div id="exchange-filter" class="exchange-filter">').appendTo(i),r=$("<select>").appendTo(n),s.forEach(function(t){var e=t.value,i=t.name||e,n=t.desc||i,s=$("<option>").addClass("filter-item").attr("value",e).text($.t(i)).data("custom-option-text",$.t(n)).appendTo(r);t.value===o&&s.attr("selected",!0)}),r.change(function(){var e=$(this).val()||"";TVSettings.setValue("symboledit.exchangefilter",e),t.setExchangeFilter(e)}),r.selectbox({speed:0,useCustomPrependWithSelector:"after",customPrependSelectorClass:"exchange-with-flag",classHolder:"tv-unstyled-select-container tv-symbol-select",classOptions:e.enabled("symbol_search_three_columns_exchanges")?"sbOptions three-column-filter":"sbOptions"}),t.setExchangeFilter(o),!0)}function m(t){var e=f(t,t.$filterContainer);return t.selectExchangeFilter(),e}function g(t){var e,i,n,r,s,a,l,c,h,u,d=$('<div class="symbol-edit-popup">').appendTo(document.body),p=$('<div class="filter">').appendTo(d);return t.$filterContainer=p,o(t,p),m(t,p),e=$('<div class="table-wrapper">').appendTo(d),i=$(t._inputElement),n=i.offset(),r=0,s=Math.max(0,Math.min(n.left+r,$(window).width()-d.outerWidth())),d.css("left",s+"px"),d.css("top",n.top+i.outerHeight()+1),a=p.outerHeight(),l=$(window).scrollTop(),c=i.height(),h=TradingView.isMobile.any()?parseInt(window.screen.height,10):parseInt($(window).height(),10),u=h-(n.top-l)-c/2,e.css("maxHeight",u-c-a+"px"),{popup:d,listWrapper:e}}function v(t){return!t.ctrlKey&&(!t.metaKey&&(!!t.charCode&&(!(!t.which||t.which<=32)&&(!/^(input|textarea)$/i.test(t.target.tagName)&&!TVDialogs.modalDialog))))}function y(t,e,i){this._container=t,
this._tickerRegExp=e,this._translationCache=i,this._roots={},this._itemsByTicker={}}var b,S,w=[{name:"input",immediate:!0},{name:"sync",immediate:!0},{name:"keypress"},{name:"keydown"},{name:"keyup"},{name:"mousedown"},{name:"mouseup"},{name:"cut"},{name:"paste"}],T=p("symbol_search_server_highlight");return T=!1,b=[/^e\-m/i],S=/<\/?[^>]+(>|$)/g,t.registerAutoFocus=function(e){if(e instanceof jQuery&&(e=e.data("symbol-search-instance")),!(e instanceof t))throw new TypeError("arg must be an SymbolSearch instance of jQuery input with bound SymbolSearch object");l.registerListener("symbolEdit",function(t){if(v(t)){t.preventDefault(),this.resetState(),this._skipAutoFocus=!0,this._inputElement.focus();var e=String.fromCharCode(t.charCode);"function"==typeof this._setInputValue?this._setInputValue(e):this._inputElement.value=e,this._eventListener()}}.bind(e))},t.prototype.searchRequestDelay=0,t.setSearchRequestDelay=function(e){t.prototype.searchRequestDelay=e},t.prototype.resetState=function(){this._state={}},t.prototype.typeFilter=function(t){if(!(arguments.length>0))return this._state.typeFilter;t!==this._state.typeFilter&&(null==t?delete this._state.typeFilter:this._state.typeFilter=t+"",delete this._state.keepListFor,this._onSelectionChanged(),this.selectExchangeFilter())},t.prototype.setExchangeFilter=function(t){t!==this._state.exchangeFilter&&(null==t?delete this._state.exchangeFilter:this._state.exchangeFilter=t+"",delete this._state.keepListFor,this._onSelectionChanged())},t.prototype.setTradableFilter=function(t){t!==this._state.tradableFilter&&(this._state.tradableFilter=t,this._onSelectionChanged())},t.prototype.getExchangeFilter=function(){return this._state.exchangeFilter},t.prototype.destroy=function(){$(this._inputElement).off(),$(this._inputElement).removeData("symbol-search-instance")},t.prototype._moveSelection=function(t,e){var i,o,n,r,s,a,l,c,h;this.$list&&(i=this.$list.find("table.symbol-edit-popup"),o=i.find("tr:not(.hidden)"),n=i.find("tr.symbol-edit-popup-active").removeClass("symbol-edit-popup-active"),r=0!==n.length?o.index(n):-1,s=1===t?n.get(0)===o.get(-1)?0:r+t:Math.max(-1,r+t),r!==s&&(a=o.get(s))&&(l=this._getItemByElement(a),c=y.isRoot(l),c?(h=a.getAttribute("data-root"),a.classList.add("symbol-edit-popup-active"),this._scrollHighlightIntoView(),h?(this._state.highlightedItem=null,this._selectedGroupRoot=h):(this._state.highlightedItem=l,this._replaceCurrentSymbol(e))):(delete this._selectedGroupRoot,this._highlightItem(l,!0,e))))},t.prototype._groupToggleCollapsed=function(t,e){this._groupListHandler&&this._groupListHandler.toggleCollapsed(t,e)},t.prototype._onKeyDown=function(t){t.keyCode!==_.DOWN_ARROW&&t.keyCode!==_.UP_ARROW||(this._moveSelection(t.keyCode===_.DOWN_ARROW?1:-1,!0),t.preventDefault()),!this._selectedGroupRoot||t.keyCode!==_.LEFT_ARROW&&t.keyCode!==_.RIGHT_ARROW||(this._groupToggleCollapsed(this._selectedGroupRoot,t.keyCode===_.LEFT_ARROW),t.preventDefault())},t.prototype._onKeyPress=function(t){if(t.keyCode===_.DOWN_ARROW||t.keyCode===_.UP_ARROW){if(t.charCode)return
;if(this._boundOnKeyDown)return $(this._inputElement).off("keydown",this._boundOnKeyDown),delete this._boundOnKeyDown,void t.preventDefault();this._moveSelection(t.keyCode===_.DOWN_ARROW?1:-1),t.preventDefault()}t.keyCode===_.ENTER&&(this._selectedGroupRoot?(this._groupToggleCollapsed(this._selectedGroupRoot,!1),t.preventDefault()):this.acceptTypeIn())},t.prototype._eventListener=function(t,i){var o,n,r,s,a,l=this._inputElement,c=this._getInputValue();e.enabled("uppercase_instrument_names")&&(c=c.toUpperCase()),o=!1,n=!1,this._state.value!==c&&(ChartApiInstance._symbolSearchRequest&&ChartApiInstance._symbolSearchRequest.abort(),this._state.hasOwnProperty("value")&&this._onValueChanged&&this._onValueChanged(c),this._state.value=c,o=!0,this._inputParserMixin&&this._inputParserMixin.parse()),this._fixIntervalCase(),r=this._limitInputSelectionValue("selectionStart"),this._state.selectionStart!==r&&(this._state.selectionStart=r,n=!0),s=this._limitInputSelectionValue("selectionEnd"),this._state.selectionEnd!==s&&(this._state.selectionEnd=s,n=!0),this._state.selectionDirection!==l.selectionDirection&&(this._state.selectionDirection=l.selectionDirection,n=!0),(o||n&&this._inputParserMixin)&&(this._onSelectionChanged(void 0,i),a=!1,this._getInputValue()!==this._state.value&&(this._setInputValue(this._state.value),a=!0),(a||this._state.selectionStart!==this._limitInputSelectionValue("selectionStart")||this._state.selectionEnd!==this._limitInputSelectionValue("selectionEnd"))&&l.setSelectionRange&&l.setSelectionRange(this._state.selectionStart,this._state.selectionEnd,this._state.selectionDirection))},t.prototype._fixIntervalCase=function(){if(this._selectionInsideInterval()){var e=t.detachInterval(this._inputElement.value);/[a-z]/.test(e.detached)&&(this._inputElement.value=e.rest+e.detached.toUpperCase())}},t.prototype._selectionInsideInterval=function(e){if(this._ignoreInterval)return!1;var i=t.detachInterval(this._inputElement.value);return!!i&&("string"==typeof e?this._inputElement[e]>i.rest.length:this._inputElement.selectionStart>i.rest.length&&this._inputElement.selectionEnd>i.rest.length)},t.prototype._limitInputSelectionValue=function(e){return this._selectionInsideInterval(e)?t.detachInterval(this._inputElement.value).rest.length:e in this._inputElement?this._inputElement[e]:this._inputElement.value.length},t.prototype._getInputValue=function(){if(this._ignoreInterval)return this._inputElement.value;var e=t.detachStoreInterval(this._inputElement.value);return $(this._inputElement).toggleClass("interval-error",t.intervalError()),e},t.prototype._setInputValue=function(e){this._ignoreInterval?this._inputElement.value=e:this._inputElement.value=t.recallAttachInterval(e)},t.prototype._onSelectionChanged=function(t,e){function i(t,e,i,o,r){n._state.contextTicker=t,n._state.contextExchange=e,n._state.contextType=i,n._state.contextTradable=r,n._state.keepListFor&&n._state.keepListFor===o||(n._getSuggestList(),delete n._state.keepListFor)}var o,n=this;!b.some(function(t){return t.test(n._state.value)
})&&(this._isSpreadInInput()||this._inputParserMixin&&!0!==e)?this._inputParserMixin.onSelectionChanged(i):this.$list&&(this._state._selectedTicker=null,o=this._state.value,this._isSpreadInInput()&&this._state.contextToken&&(o=this._state.contextToken.value),i(o,this.getExchangeFilter(),this._state.typeFilter,o,this._state.tradableFilter))},t.prototype._clearSelectionState=function(){delete this._state.contextTicker,delete this._state.contextExchange,delete this._state.contextType,delete this._state.contextToken,delete this._state.keepListFor},t.prototype._clearSearchTimeout=function(){this._searchTimeout&&(clearTimeout(this._searchTimeout),this._searchTimeout=null)},t.prototype._doGetSuggestList=function(){var t,e,i,o,r,s,a;this._clearSearchTimeout(),t=n(),e=this._state.contextTicker||"",i=this._state.contextExchange||this.getExchangeFilter()||"",o=this._state.typeFilter||"",r=t&&this._state.tradableFilter,t&&tradingService().trackEvent("Symbol Search Tradable checkbox",r?"on":"off"),s=window.language||"",this._showLoading(),a=this,ChartApiInstance.searchSymbols(e,i,o,s,T,!1,t,r,function(t){e!==(a._state.contextTicker||"")||i!==(a._state.contextExchange||a.getExchangeFilter()||"")||o!==(a._state.typeFilter||"")||(o===d.types.QUANDL&&(t=a._processQuandlResponse(t)),a._renderSuggestList(t),a._onResponse(t))})},t.prototype._getSuggestList=function(){this._clearSearchTimeout(),this._searchTimeout=setTimeout(this._doGetSuggestList.bind(this),t.prototype.searchRequestDelay)},t.prototype._showLoading=function(){if(this.$list&&!this._spinner){this._clearSuggestList();var t=$('<div class="symbol-search-loading">').appendTo(this.$list);this._spinner=c("medium").spin(t.get(0))}},t.prototype._groupContracts=function(t){var e,i,o,n,r,s=ChartApiInstance.futuresRegex(),a={},l=[];for(e=0;e<t.length;++e){if(i=t[e],i.prefix||Array.isArray(i.contracts))return t;"futures"===i.type?(o=s.exec(i.symbol),o?(n=o[1],n in a?r=a[n]:(r=l.length,a[n]=r,l.push({type:i.type,symbol:n,exchange:i.exchange,description:i.description,full_name:i.exchange+":"+n,contracts:[]})),l[r].contracts.push(i)):l.push(i)):l.push(i)}return l},t.prototype._renderSuggestList=function(i){var o,n,r,s,a,l,c,h,d,p;if(this.$list){if(i=this._groupContracts(i),o=this,n=this._state,this._clearSuggestList(),r=u(n.contextTicker).trim(),s=RegExp(r.replace(" ","|"),"i"+(r.length>1?"g":"")),delete n.highlightedItem,this._hidePro&&(i=i.filter(function(t){return!t.params||-1===t.params.indexOf("pro")})),0===i.length)return void this.$list.html('<div style="text-align: center; padding: 7px 0; font-style: italic;">'+$.t("No symbols matched your criteria")+"</div>");for(a=document.createElement("table"),a.setAttribute("class","symbol-edit-popup"),l={},c=new t.GroupListHandler(a,s,l),h=null,this._renderedResponse=[],d=0;d<i.length;d++)p=i[d],c.append(p),h||p.ticker!==n.contextTicker||p.exchange!==n.contextExchange||(h=p),this._renderedResponse.push(p);e.enabled("expand_symbolsearch_items")||c.collapse(),this._groupListHandler=c,h&&this._highlightItem(p),$(a).on("click","tr",function(t){
if(!t.isDefaultPrevented()){t.preventDefault();var e=o._getItemByElement(this);e&&e.full_name&&(o._isSpreadInInput()?o._highlightItem(e,!0,!1):o.accept(e.full_name,e.ticker))}}).appendTo(this.$list)}},t.prototype._isSpreadInInput=function(){return this._inputParserMixin&&this._state.parsed.length>1},t.prototype._getItemByElement=function(t){return this._renderedResponse&&this._groupListHandler?this._groupListHandler.getItemByTicker(t.getAttribute("data-item-ticker")):null},t.prototype._getElementByItem=function(t){return this._renderedResponse&&this.$list?this.$list.get(0).querySelector('tr[data-item-ticker="'+(t.ticker||t.full_name)+'"]'):null},t.prototype._highlightItem=function(t,e,i){var o,n,r=this._state;r.highlightedItem&&(o=this._getElementByItem(r.highlightedItem))&&$(o).removeClass("symbol-edit-popup-active"),r.highlightedItem=t,n=this._getElementByItem(r.highlightedItem),n&&($(n).addClass("symbol-edit-popup-active"),this._scrollHighlightIntoView()),e&&this._replaceCurrentSymbol(i)},t.prototype._scrollHighlightIntoView=function(){var t=this.$list.find("tr.symbol-edit-popup-active");t.length&&(t.offset().top<this.$list.offset().top?this.$list.scrollTop(this.$list.scrollTop()-(this.$list.offset().top-t.offset().top)):t.offset().top+t.outerHeight()>this.$list.offset().top+this.$list.outerHeight()&&this.$list.scrollTop(this.$list.scrollTop()+(t.offset().top+t.outerHeight()-(this.$list.offset().top+this.$list.outerHeight()))))},t.prototype._clearSuggestList=function(){this._renderedResponse=null,this._spinner&&(this._spinner.stop(),delete this._spinner),this.$list&&this.$list.empty()},t.prototype._showErrorNotice=function(){this.$list&&(this._clearSuggestList(),this.$list.text("Invalid expression"))},t.prototype._replaceCurrentSymbol=function(t){var e,i,o,n,r=this._state;if(r.highlightedItem){if(e=r.highlightedItem,i="",o=0,this._isSpreadInInput()||this._inputParserMixin&&!0!==t){if(n=this._inputParserMixin.replaceCurrentSymbol(e),!n.ok)return;i=n.newValue,o=n.newCaretPos,r.keepListFor=n.keepListFor}else this._state._selectedTicker=e.ticker||e.symbol,r.keepListFor=this._state._selectedTicker,i=!0===t&&e.full_name&&this._inputParserMixin?e.full_name:e.symbol,o=i.length;this._setInputValue(T?i.replace(S,""):i),this._inputElement.setSelectionRange?this._inputElement.setSelectionRange(o,o):this._inputElement.select(),this._eventListener(void 0,t)}},t.prototype.splitAndAcceptUserInput=function(){var t,e=this._getInputValue().split(",");for(t=0;t<e.length;t++)this.acceptSymbolIn(e[t])},t.prototype.acceptSymbolIn=function(t){var e,i;this._inputParserMixin?e=this._inputParserMixin.parseSymbol(t):(e=t,i=this._state._selectedTicker||t),this.accept(e,i)},t.prototype.acceptTypeIn=function(){this._allowMultipleSymbols?this.splitAndAcceptUserInput():this.acceptSymbolIn(this._getInputValue())},t.prototype.accept=function(e,i){var o=this;!function(){if((i=i||e)||""===i&&o.acceptEmpty){delete o._state.keepListFor;var n=o._ignoreInterval?void 0:t.getInterval(!0);o._inputElement.value=e,o._eventListener(),
o._callback&&o._callback(i,n),$(o._inputElement).trigger("accept-symbol",[i])}}()},t.prototype.bindListWrapper=function(t){if(t=$(t).eq(0),0===t.size())throw new TypeError("element must be a DOM element, jQuery object or selector");this.$list=t,this._clearSelectionState(),this._eventListener()},t.prototype.removeListWrapper=function(){delete this.$list,this._clearSuggestList(),this._clearSelectionState(),this._eventListener()},t.prototype.selectExchangeFilter=function(){this.$filterContainer.find(".exchange-filter").hide(),this._state.typeFilter===d.types.QUANDL?this.$filterContainer.find("#quandl-filter").show():this._state.typeFilter!==d.types.ECONOMIC&&this.$filterContainer.find("#exchange-filter").show()},t.prototype._onResponse=function(t){if(t.length>0){this._state.typeFilter===d.types.QUANDL&&this._showNotification()}},t.prototype._showNotification=function(){var t,e,i;TVSettings.getBool("symboledit.show_quandl_notification",!0)&&(t=$.t("Quandl is a huge financial database that we have connected to TradingView. Most of its data is EOD and is not updated in real-time, however the information may be extremely useful for fundamental analysis.")+' <a target="_blank" href="'+("ru"===window.locale?"http://blog.tradingview.com/?p=1530&lang=ru":"http://blog.tradingview.com/?p=1530")+'">'+$.t("Read our blog for more info!")+"</a>",e=$('<div class="symbol-edit-notification">').prependTo(this.$list),e.html(t),e.find("a").click(function(t){t.preventDefault();var e=$(this).attr("href");window.open(e,"_blank")}),i=$('<a class="close">').appendTo(e),i.click(function(){TVSettings.setValue("symboledit.show_quandl_notification",!1),e.remove()}))},t.prototype._processQuandlResponse=function(t){return t.datasets.filter(function(t){return!t.premium}).map(function(t){return{description:t.name,exchange:t.database_code,full_name:"QUANDL:"+t.database_code+"/"+t.dataset_code,params:["eod"],symbol:t.dataset_code,type:"quandl"}})},t.createSuggestListRow=function(e,i,o,n){var r,s,a,l,c,h,u,d,p,_,f;if(n||(n={}),r=document.createElement("tr"),s="symbol-edit-popup",n.addClass&&(s+=" "+n.addClass),r.setAttribute("class",s),a=!T||"quandl"===e.type,l=document.createElement("td"),l.setAttribute("class","symbol-edit-popup-td name apply-overflow-tooltip"),c=a?e.symbol.replace(i,"<strong>$&</strong>"):e.symbol,h=n.nameContent||c,e.broker_symbol&&(h=h+" ("+(a?e.broker_symbol.replace(i,"<strong>$&</strong>"):e.broker_symbol)+")"),l.innerHTML=h,u=document.createElement("td"),u.setAttribute("class","symbol-edit-popup-td desc apply-overflow-tooltip"),u.innerHTML=!a||i.test(e.symbol)?e.description:e.description.replace(i,"<strong>$&</strong>"),d=document.createElement("td"),d.setAttribute("class","symbol-edit-popup-td type apply-overflow-tooltip"),p="",n.typeContent)p=n.typeContent;else switch(e.params&&~e.params.indexOf("eod")&&(p='<i class="eod">eod</i>&nbsp;'),e.type in o||(o[e.type]=$.t(e.type)),e.type){case"index":p+=o[e.type];break;default:
e.exchange?e.exchange.startsWith("CHXEUR_")?p+=o[e.type]+" - "+e.exchange.split("_")[0]:p+=o[e.type]+" - "+e.exchange:p+=o[e.type]}return d.innerHTML=p,_=document.createElement("td"),_.setAttribute("class","symbol-edit-popup-td flag apply-overflow-tooltip"),_.innerHTML=t.getItemFlag(e),f=_.getElementsByTagName("svg")[0],f&&f.setAttribute("class","flag"),r.appendChild(l),r.appendChild(u),r.appendChild(d),r.appendChild(_),r},t.getItemFlag=function(t){return""},t.showDialog=function(e){var n,r,s,a,l,c,h,u,d,p,_,f,g=i(220);if(e=e||{},n="Symbol Search",!TVDialogs.get(n))return r=TVDialogs.createDialog(n,{hideTitle:!0,hideCloseCross:!0,dragHandle:".filter",width:"750px",dragOptions:{cancel:".sbOptions"},content:g.dialogs.symbolSearch}),TVDialogs.positionDialog(r),s=r.find("._tv-dialog-content").addClass("symbol-search-dialog"),a=s.find(".results"),a.mousewheel(function(t,e){var i=$(this);e>0?i.scrollTop(i.scrollTop()-15):i.scrollTop(i.scrollTop()+15)}),l=s.find("input").get(0),e.initialValue&&(l.value=e.initialValue),"selectionStart"in l&&(l.selectionStart=l.selectionEnd=l.value.length),l.focus(),this.canShowSpreadActions()&&(e.ignoreInterval||(h=t.getInputValueGetter(l),u=t.getInputValueSetter(l)),c=SymbolSearchInputParserMixin.addSpreadActions(s.find(".spread-actions"),l,h,u)),d=new t({input:l,list:s.find(".results").get(0),callback:function(t,i){e.callback&&e.callback(t,i),TVDialogs.destroy(n)},onParse:c,ignoreInterval:e.ignoreInterval}),p=s.find(".filter"),d.$filterContainer=p,_=o(d,p),f=m(d,p),_||f||p.attr("style","display: none"),TVDialogs.resizeContent(r.height(),a),TVDialogs.applyHandlers(r),TVDialogs.positionDialog(r),r.on("destroy",function(){TVSettings.setValue("symboledit.dialog_last_entry",l.value)}),r},t.bindToInput=function(i,o){function n(){m&&(w.removeListWrapper(),m.off(),m.remove(),m=null,h.hide(),"function"==typeof o.onPopupClose&&o.onPopupClose())}function r(t){t.preventDefault()}function a(){var t,i,n,s;if(m||(t=g(w),m=t.popup,w.bindListWrapper(t.listWrapper),m.on("focus",r),m.on("click",r),m.on("mousedown",r),m.on("focus","*",r),m.on("click","*",r),m.on("mousedown","*",r),"function"==typeof o.onPopupOpen&&o.onPopupOpen(t.popup)),e.enabled("charting_library_base")&&(i=this._state,i.keepListFor)){if(!i.highlightedItem)return void delete this._state.keepListFor;n=i.highlightedItem,s=this._getInputValue(),e.enabled("uppercase_instrument_names")&&(s=s.toUpperCase()),n.symbol!==s&&delete this._state.keepListFor}}function l(t,e){var i;return e?(RegExp("^"+d.types.QUANDL,"i").test(t)?(i=t.split(/\//),i.length&&(t=i[i.length-1])):t=s.seriesShortSymbol.value()||t,t):t}function c(t){var e=s.symbol.value()||"";e=l(e,t),i.val(e),w.resetState()}var u,p,f,m,v,y,b,S,w,T,x,C;return o=o||{},i=$(i).eq(0),u=o.callback,p=null,f=null,m=null,y=o.spreadActions&&$(o.spreadActions).eq(0),y&&y.size()&&this.canShowSpreadActions()&&(o.ignoreInterval||(b=t.getInputValueGetter(i.get(0)),S=t.getInputValueSetter(i.get(0))),v=SymbolSearchInputParserMixin.addSpreadActions(y,i.get(0),b,S)),w=new t({input:i,onValueChanged:a,
callback:function(t,e){n(),"function"==typeof f&&f(t,e)||("function"==typeof u&&u(t,e),"function"==typeof p&&p(t,e)),o.clearAfterAccept&&i.val(""),o.keepFocus?i.get(0).focus():i.get(0).blur(),w.resetState()},hidePro:o.hidePro,autoFocus:o.autoFocus,onEmptyApply:o.onEmptyApply,onParse:v,acceptEmpty:o.acceptEmpty,dontUseInputParser:o.dontUseInputParser,allowMultipleSymbols:o.allowMultipleSymbols,ignoreInterval:o.ignoreInterval}),T=!1,x=!0,TradingView.isMobile.iOS()&&$("body").css("cursor","pointer"),i.on("focus",function(t,e){T=!0,w._skipAutoFocus?delete w._skipAutoFocus:setTimeout(function(){T&&i.get(0).select()},0)}),i.on("blur",function(t){var e,o,r,s,a=this;if(m&&(e=document.activeElement,o=m.is(e),r=m.has(e).length>0,(-1!==navigator.userAgent.indexOf("Trident")||-1!==navigator.userAgent.indexOf("MSIE"))&&(o||r)))return t.preventDefault(),t.stopImmediatePropagation(),void setTimeout(function(){i.focus()},0);TradingView.isMobile.iOS()&&x&&(x=!1,T=!0),TradingView.isMobile.iOS()&&T&&null===t.relatedTarget?(s=function(t){$(a).is($(t.target))||(T=!1,setTimeout(function(){n()},0),$(document).off("click","body",s))},$(document).on("click","body",s)):T=!1,setTimeout(function(){T||n()},0)}),o.syncWithChartWidget&&(c(!0),s.seriesShortSymbol.subscribe(function(){c(!0)}),p=function(t,e){t&&s.symbol.setValue(t),e&&s.interval.setValue(e)},f=function(t,e){return!e&&(t===s.symbol.value()||(t===s.seriesShortSymbol.value()||void 0))},C=function(){i.get(0).blur(),c(!1)},i.on("keypress",function(t){t.keyCode===_.ESC&&C()}),i.on("keydown",function(t){t.keyCode===_.ESC&&C()})),w},y.isRoot=function(t){return!(!t||!Array.isArray(t.contracts))},y.prototype.addRoot=function(t,e){var i,o;this._currentTbody=null,i=document.createElement("tbody"),this._container.appendChild(i),o=this,e.addEventListener("click",function(i){i.preventDefault(),e.classList.contains("collapsed")?o.expand(t):o.collapse(t)}),e.setAttribute("data-root",t),i.appendChild(e),this._roots[t]={titleRow:e,tbody:i}},y.prototype.append=function(e){var i,o,n,r,s,a=null,l=null;if(y.isRoot(e))for(i=e.symbol,o=(e.exchange||"unknown")+"_"+i,this._translationCache[e.type]||(this._translationCache[e.type]=$.t(e.type)),a=t.createSuggestListRow(e,this._tickerRegExp,this._translationCache,{nameContent:"<div>"+(T?i:i.replace(this._tickerRegExp,"<strong>$&</strong>"))+"</div>",typeContent:this._translationCache[e.type]+(e.exchange&&" - "+e.exchange||""),addClass:"group-title"}),this._roots[o]||this.addRoot(o,a),n=0;n<e.contracts.length;++n)r=e.contracts[n],s=t.createSuggestListRow(r,this._tickerRegExp,this._translationCache),l=r.ticker||r.full_name,this._itemsByTicker[l]=r,s.setAttribute("data-item-ticker",l),this._roots[o].tbody.appendChild(s);else this._currentTbody||(this._currentTbody=document.createElement("tbody"),this._container.appendChild(this._currentTbody)),a=t.createSuggestListRow(e,this._tickerRegExp,this._translationCache),this._currentTbody.appendChild(a);l=e.ticker||e.full_name,this._itemsByTicker[l]=e,a.setAttribute("data-item-ticker",l)},
y.prototype.toggleCollapsed=function(t,e){var i;if(t)(i=this._roots[t])&&($(i.titleRow).toggleClass("collapsed",!!e),$(i.tbody).find("tr:not(.group-title)").toggleClass("hidden",!!e));else for(t in this._roots)this.toggleCollapsed(t,e)},y.prototype.collapse=function(t){this.toggleCollapsed(t,!0)},y.prototype.expand=function(t){this.toggleCollapsed(t,!1)},y.prototype.getItemByTicker=function(t){return this._itemsByTicker[t]||null},t.GroupListHandler=y,t.isIntervalInit=function(t){return/[\d,]/.test(t)&&e.enabled("show_interval_dialog_on_key_press")},t.isIntervalChar=function(t){return e.enabled("seconds_resolution")?/[\dhdwms]/i.test(t):/[\dhdwm]/i.test(t)},t.parseIntervalValue=function(t){var e=/^[,\s]*(\d*)\s*([hdwms]?)\s*$/i.exec(t)||[],i=~~e[1],o=e[2]&&e[2].toUpperCase(),n={qty:!i&&o?1:i,unit:o||null};return n.error=!i&&!o,n.intraday=!(n.error||n.unit&&"H"!==n.unit),n},t.sanitizeIntervalValue=function(e){var i=t.parseIntervalValue(e),o=i.qty,n=i.unit;return i.error?null:("H"===n&&(o*=60,n=null),o&&!n?o+"":n&&(!o||1===o&&"S"!==n)?n:o+n)},t.detachInterval=function(t){var e=/,[^,]*$/i.exec(t)||[];if(e[0])return{rest:t.substr(0,t.length-e[0].length),detached:e[0]}},t.intervalIsSupported=function(i){var o,n,a;return e.enabled("allow_supported_resolutions_set_only")?null!==(o=this.sanitizeIntervalValue(i))&&r.isAvailable(o):(n=t.parseIntervalValue(i),!n.error&&(n.intraday?s.intraday.value():!(a=s.supportedResolutions.value())||!!~a.indexOf(n.unit)))},function(){var e="",i=null;t.resetStoredInterval=function(){e="",i=null},t.detachStoreInterval=function(o){var n=t.detachInterval(o);return n?(e=n.detached,i=t.sanitizeIntervalValue(e),n.rest):(t.resetStoredInterval(),o)},t.recallAttachInterval=function(t){return t+e},t.getInterval=function(e){var o=i;return!0===e&&t.resetStoredInterval(),o},t.getInputValueGetter=function(e){return function(){return t.detachStoreInterval(e.value)}},t.getInputValueSetter=function(e){return function(i){e.value=t.recallAttachInterval(i)}},t.intervalError=function(){return!(!e||/^,\s*$/.test(e))&&!i}}(),t.activateKeyPressHandler=function(){l.pushBackListener("symbolEdit",this._keyPressHandler)},t._keyPressHandler=function(o){var n,r=i(265);if(v(o))if(o.preventDefault(),n=String.fromCharCode(o.charCode),t.isIntervalInit(n))new r({callback:function(t){s.interval.setValue(t)}}).show(n);else{if(!e.enabled("symbol_search_hot_key"))return;t.showDialog({initialValue:n,callback:function(t,e){s.symbol.setValue(t),e&&s.interval.setValue(e)}})}},t.canShowSpreadActions=function(){return"undefined"!=typeof SymbolSearchInputParserMixin&&"cme"!==TradingView.widgetCustomer&&"bovespa"!==TradingView.widgetCustomer},t}();t.exports=f}).call(e,i(7))},,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(23),function(t){t.LINE="line",t.COLORER="colorer",t.BAR_COLORER="bar_colorer",t.BG_COLORER="bg_colorer",t.TEXT_COLORER="text_colorer",t.OHLC_COLORER="ohlc_colorer",t.SHAPES="shapes",t.CHARS="chars",t.ARROWS="arrows",t.DATAOFFSET="dataoffset",t.OHLC_OPEN="ohlc_open",t.OHLC_HIGH="ohlc_high",
t.OHLC_LOW="ohlc_low",t.OHLC_CLOSE="ohlc_close"}(e.PlotTypes||(e.PlotTypes={})),function(t){t.BARS="ohlc_bars",t.CANDLES="ohlc_candles"}(e.OHLCType||(e.OHLCType={})),function(t){t[t.Line=0]="Line",t[t.Histogram=1]="Histogram",t[t.Cross=3]="Cross",t[t.Area=4]="Area",t[t.Columns=5]="Columns",t[t.Circles=6]="Circles",t[t.LineWithBreaks=7]="LineWithBreaks",t[t.AreaWithBreaks=8]="AreaWithBreaks"}(e.PlotType||(e.PlotType={})),function(t){t[t.Right=0]="Right",t[t.Left=1]="Left",t[t.None=2]="None"}(e.ScaleType||(e.ScaleType={})),e.plotShapesData={shape_arrow_down:{guiName:$.t("Arrow Down"),id:"shape_arrow_down",paneRendererClass:"PaneRendererArrowDown",pineName:"shape.arrowdown"},shape_arrow_up:{guiName:$.t("Arrow Up"),id:"shape_arrow_up",paneRendererClass:"PaneRendererArrowUp",pineName:"shape.arrowup"},shape_circle:{guiName:$.t("Circle"),id:"shape_circle",paneRendererClass:"PaneRendererCircleShape",pineName:"shape.circle"},shape_cross:{guiName:$.t("Cross"),id:"shape_cross",paneRendererClass:"PaneRendererCrossShape",pineName:"shape.cross"},shape_diamond:{guiName:$.t("Diamond"),id:"shape_diamond",paneRendererClass:"PaneRendererDiamond",pineName:"shape.diamond"},shape_flag:{guiName:$.t("Flag"),id:"shape_flag",paneRendererClass:"PaneRendererFlagShape",pineName:"shape.flag"},shape_label_down:{guiName:$.t("Label Down"),id:"shape_label_down",paneRendererClass:"PaneRendererLabelDown",pineName:"shape.labeldown"},shape_label_up:{guiName:$.t("Label Up"),id:"shape_label_up",paneRendererClass:"PaneRendererLabelUp",pineName:"shape.labelup"},shape_square:{guiName:$.t("Square"),id:"shape_square",paneRendererClass:"PaneRendererSquare",pineName:"shape.square"},shape_triangle_down:{guiName:$.t("Triangle Down"),id:"shape_triangle_down",paneRendererClass:"PaneRendererTriangleApexDown",pineName:"shape.triangledown"},shape_triangle_up:{guiName:$.t("Triangle Up"),id:"shape_triangle_up",paneRendererClass:"PaneRendererTriangleApexUp",pineName:"shape.triangleup"},shape_xcross:{guiName:$.t("X Cross"),id:"shape_xcross",paneRendererClass:"PaneRendererXCross",pineName:"shape.xcross"}}},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(2),r=i(55),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleOutsideEvent=function(t){e.props.handler&&!r.findDOMNode(e).contains(t.target)&&e.props.handler(t)},e}return o.__extends(e,t),e.prototype.componentDidMount=function(){this.props.click&&document.addEventListener("click",this._handleOutsideEvent,!1),this.props.mouseDown&&document.addEventListener("mousedown",this._handleOutsideEvent,!1),this.props.touchEnd&&document.addEventListener("touchend",this._handleOutsideEvent,!1),this.props.touchStart&&document.addEventListener("touchstart",this._handleOutsideEvent,!1)},e.prototype.componentWillUnmount=function(){this.props.click&&document.removeEventListener("click",this._handleOutsideEvent,!1),this.props.mouseDown&&document.removeEventListener("mousedown",this._handleOutsideEvent,!1),
this.props.touchEnd&&document.removeEventListener("touchend",this._handleOutsideEvent,!1),this.props.touchStart&&document.removeEventListener("touchstart",this._handleOutsideEvent,!1)},e.prototype.render=function(){var t=this.props,e=(t.click,t.handler,t.mouseDown,t.touchEnd,t.touchStart,t.ctor),i=void 0===e?"span":e,r=o.__rest(t,["click","handler","mouseDown","touchEnd","touchStart","ctor"]);return n.createElement(i,o.__assign({},r))},e}(n.Component),e.OutsideEvent=s},,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M5.182 6.596l-3.889-3.889-.707-.707 1.414-1.414.707.707 3.889 3.889 3.889-3.889.707-.707 1.414 1.414-.707.707-3.889 3.889 3.889 3.889.707.707-1.414 1.414-.707-.707-3.889-3.889-3.889 3.889-.707.707-1.414-1.414.707-.707 3.889-3.889z"/></svg>'},function(t,e,i){var o;!function(e){"use strict";function n(){}function r(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function s(t){return function(){return this[t].apply(this,arguments)}}function a(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&a(t.listener)}var l=n.prototype,c=e.EventEmitter;l.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},l.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},l.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},l.addListener=function(t,e){var i,o,n;if(!a(e))throw new TypeError("listener must be a function");i=this.getListenersAsObject(t),o="object"==typeof e;for(n in i)i.hasOwnProperty(n)&&-1===r(i[n],e)&&i[n].push(o?e:{listener:e,once:!1});return this},l.on=s("addListener"),l.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},l.once=s("addOnceListener"),l.defineEvent=function(t){return this.getListeners(t),this},l.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},l.removeListener=function(t,e){var i,o,n=this.getListenersAsObject(t);for(o in n)n.hasOwnProperty(o)&&-1!==(i=r(n[o],e))&&n[o].splice(i,1);return this},l.off=s("removeListener"),l.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},l.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},l.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},l.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},l.removeAllListeners=s("removeEvent"),l.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t)
;for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),n=0;n<i.length;n++)o=i[n],!0===o.once&&this.removeListener(t,o.listener),o.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,o.listener);return this},l.trigger=s("emitEvent"),l.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},l.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},l._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},l._getEvents=function(){return this._events||(this._events={})},n.noConflict=function(){return e.EventEmitter=c,n},void 0!==(o=function(){return n}.call(e,i,e,t))&&(t.exports=o)}(this||{})},,,,,function(t,e,i){(function(t){var e={};e.LINESTYLE_SOLID=0,e.LINESTYLE_DOTTED=1,e.LINESTYLE_DASHED=2,e.LINESTYLE_LARGE_DASHED=3,e.LINESTYLE_SPARSE_DOTTED=4,e.TEXTPOS_TOPLEFT=0,e.TEXTPOS_TOPCENTER=1,e.TEXTPOS_TOPRIGHT=2,e.TEXTPOS_MIDDLELEFT=3,e.TEXTPOS_MIDDLECENTER=4,e.TEXTPOS_MIDDLERIGHT=5,e.TEXTPOS_BOTTOMLEFT=6,e.TEXTPOS_BOTTOMCENTER=7,e.TEXTPOS_BOTTOMRIGHT=8,e.SIZE_AUTO="auto",e.SIZE_TINY="tiny",e.SIZE_SMALL="small",e.SIZE_NORMAL="normal",e.SIZE_LARGE="large",e.SIZE_HUGE="huge",e.MARKLOC_ABOVEBAR="AboveBar",e.MARKLOC_BELOWBAR="BelowBar",e.MARKLOC_TOP="Top",e.MARKLOC_BOTTOM="Bottom",e.MARKLOC_RIGHT="Right",e.MARKLOC_LEFT="Left",e.MARKLOC_ABSOLUTE="Absolute",e.MARKLOC_ABSOLUTEUP="AbsoluteUp",e.MARKLOC_ABSOLUTEDOWN="AbsoluteDown",e.HHISTLOC_RELATIVE="relative",e.HHISTLOC_ABSOLUTE="absolute",e.HHISTDIR_LEFTTORIGHT="left_to_right",e.HHISTDIR_RIGHTTOLEFT="right_to_left",void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(78)(t))},function(t,e,i){"use strict";function o(){this._registeredSources={},this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=0,this._actualWidth=1,this._numericFormatter=new r,this._percentageFormatter=new n}var n=i(94).PercentageFormatter,r=i(38).NumericFormatter;o.prototype.levelsCount=function(){return 0},o.prototype.topByRow=function(t){return t*o.ROW_HEIGHT},o.prototype.rowHeight=function(t){return o.ROW_HEIGHT},o.prototype.canvas=function(){if(!this._canvas){this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this._canvas.prop("width",100).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0);this._canvas.get(0).getContext("2d").font="12px Verdana"}return this._canvas},o.ROW_HEIGHT=14,o.prototype.points=function(t){return[t.points()[0],t.points()[1]]},o.prototype.startPoint=function(t,e){return e?t.points()[0]:t.points()[1]},o.prototype.priceRange=function(t,e){var i=this.points(t),o=i[0],n=i[1];return e?n.price-o.price:o.price-n.price},o.prototype.sourceIsReady=function(t){return t.points().length>=2},o.prototype._calculateWidth=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T;if(!this.sourceIsReady(t))return null;if(e=this.canvas().get(0).getContext("2d"),e.font="12px Verdana",i=!!t.properties().showPrices&&t.properties().showPrices.value(),
o=!!t.properties().coeffsAsPercents&&t.properties().coeffsAsPercents.value(),n=t.properties().showCoeffs.value(),r=t.priceScale().formatter(),s=this.points(t),a=s[0],l=s[1],!a||!l)return null;if(c=!1,h=t.properties(),h.reverse&&h.reverse.value()&&(c=h.reverse.value()),u=this.priceRange(t,c),d=this.startPoint(t,c).price,t.priceScale().isPercent()&&null===(p=t.ownerSource().firstValue()))return 0;for(_=0,f=[],m=1;m<=this.levelsCount();m++)g="level"+m,v=h[g],y=v.coeff.value(),b=d+y*u,t.priceScale().isPercent()&&(b=t.priceScale().priceRange().convertToPercent(b,p)),S="",n&&(S+=o?this._percentageFormatter.format(Math.round(1e4*y)/100):this._numericFormatter.format(y)),i&&(S+="("+r.format(b)+")"),w=e.measureText(S).width,T={text:S,left:_,width:w+4},f.push(T),_+=T.width;return{totalWidth:_,cells:f}},o.prototype._effectiveState=function(t){var e,i,o,n,r,s,a={},l=t.properties();for(l.showPrices&&(a.showPrices=l.showPrices.value()),l.coeffsAsPercents&&(a.coeffsAsPercents=l.coeffsAsPercents.value()),a.showCoeffs=l.showCoeffs.value(),t.priceScale()&&t.priceScale().formatter().state&&(a.formatter=t.priceScale().formatter().state()),l.reverse&&(a.reverse=l.reverse.value()),a.p1=t.points()[0],a.p2=t.points()[1],3===t.points().length&&(a.p3=t.points()[2]),a.items=[],e=1;e<=this.levelsCount();e++)i="level"+e,o=l[i],n=o.coeff.value(),r=o.color.value(),s={coeff:n,color:r},a.items.push(s);return a},o.prototype._findEmptyRow=function(t){for(var e,i=0;this._rowsToSources[i];)i++;return this._rowsToSources[i]=t,i>=this._actualCapacity&&(this._actualCapacity++,e=this.canvas(),TradingView.resizeCanvas(e,this._actualWidth,o.ROW_HEIGHT*this._actualCapacity)),i},o.prototype._repaintSource=function(t,e,i){var n,r,s=o.ROW_HEIGHT*i.row,a=this.canvas().get(0).getContext("2d");for(a.clearRect(0,s,this._actualWidth,o.ROW_HEIGHT),a.textBaseline="bottom",a.font="12px Verdana",s+=o.ROW_HEIGHT,n=0;n<t.cells.length;n++)r=t.cells[n],a.fillStyle=e.items[n].color,a.fillText(r.text,r.left,s)},o.prototype.removeSource=function(t){var e,i;this._sourcesToRow[t]&&(e=this._sourcesToRow[t].row,i=this.canvas().get(0).getContext("2d"),i.save(),i.clearRect(0,this.topByRow(e),this._actualWidth,o.ROW_HEIGHT),i.restore(),delete this._sourcesToRow[t],delete this._rowsToSources[e])},o.prototype._effectiveStatesEquals=function(t,e){var i,o=function(t,e){return!(!t&&!e)&&(!(!t||e)||(!(t||!e)||(t.minMove!==e.minMove||(t.minMove2!==e.minMove2||(t.fractional!==e.fractional||t.fractionalLength!==e.fractionalLength)))))},n=function(t,e){return!(!t&&!e)&&(!(!t||e)||(!(t||!e)||(t.index!==e.index||t.price!==e.price)))},r=function(t,e){return t.coeff!==e.coeff||t.color!==e.color};if(t&&!e)return!1;if(!t&&e)return!1;if(t.showPrices!==e.showPrices)return!1;if(t.coeffsAsPercents!==e.coeffsAsPercents)return!1;if(t.showCoeffs!==e.showCoeffs)return!1;if(t.reverse!==e.reverse)return!1;if(o(t.formatter,e.formatter))return!1;if(n(t.p1,e.p1))return!1;if(n(t.p2,e.p2))return!1;if(n(t.p3,e.p3))return!1;if(t.items.length!==e.items.length)return!1
;for(i=0;i<t.items.length;i++)if(r(t.items[i],e.items[i]))return!1;return!0},o.prototype.updateSource=function(t){var e,i,n,r,s=t.properties().symbol.value();return this._currentSymbol!==s&&(this._currentSymbol=s,this._sourcesToRow={},this._rowsToSources={}),this._sourcesToRow[t.id()]||(e=this._findEmptyRow(t.id()),this._sourcesToRow[t.id()]={effectiveState:null,row:e}),i=this._sourcesToRow[t.id()].effectiveState,n=this._effectiveState(t),this._effectiveStatesEquals(i,n)||(r=this._calculateWidth(t),r?(this._sourcesToRow[t.id()].effectiveState=n,r.totalWidth>this._actualWidth&&(TradingView.resizeCanvas(this.canvas(),r.totalWidth,o.ROW_HEIGHT*this._actualCapacity),this._actualWidth=r.totalWidth),e=this._sourcesToRow[t.id()],this._repaintSource(r,n,e),this._sourcesToRow[t.id()].effectiveState=n,this._sourcesToRow[t.id()].preparedCells=r):this._sourcesToRow[t.id()].effectiveState=null),this._sourcesToRow[t.id()]},t.exports=o},,function(t,e,i){"use strict";function o(t,e,i,o){var n,r;for(this.m_study=t,this.m_series=e,this.m_model=i,this._plotName=o,this.m_items=[],this._invalidated=!0,this._isMarkersEnabled=U.enabled("source_selection_markers"),n=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._plotIndex=0,r=0;r<n.length;r++)n[r].id===this._plotName&&(this._plotIndex=r),this.m_study.isSelfColorerPlot(r)&&n[r].target===this._plotName&&(this._colorer=r,this._palette=this.m_study.metaInfo().palettes[n[r].palette],this._paletterProps=this.m_study.properties().palettes[n[r].palette])}function n(t,e,i,o){var n,r;for(this._study=t,this._series=e,this._model=i,this._plotName=o,this._items=[],this._invalidated=!0,this._isMarkersEnabled=U.enabled("source_selection_markers"),n=this._study.metaInfo().plots,r=0;r<n.length;r++)n[r].id===this._plotName&&(this._plotIndex=r,d(this._study.isBgColorerPlot(r),"Plot '"+this._plotName+"' is not a background colorer!"))}function r(t,e,i,o){var n,r;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_items=[],this.m_invalidated=!0,this._isMarkersEnabled=U.enabled("source_selection_markers"),this.m_selectionData=null,this.m_plotIndex=null,n=this.m_study.metaInfo().plots,r=0;r<n.length;r++)if(n[r].id===this.m_plotName){this.m_plotIndex=r;break}for(n=this.m_study.metaInfo().plots,this._colorer=null,this._textColorer=null,this._palette=null,this._textPalette=null,this._paletterProps=null,this._textPaletterProps=null,this._plotIndex=0,r=0;r<n.length;r++)n[r].id===this.m_plotName&&(this._plotIndex=r),this.m_study.isSelfColorerPlot(r)&&n[r].target===this.m_plotName&&(this._colorer=r,this._palette=this.m_study.metaInfo().palettes[n[r].palette],this._paletterProps=this.m_study.properties().palettes[n[r].palette]),this.m_study.isTextColorerPlot(r)&&n[r].target===this.m_plotName&&(this._textColorer=r,this._textPalette=this.m_study.metaInfo().palettes[n[r].palette],this._textPaletterProps=this.m_study.properties().palettes[n[r].palette])}function s(t,e,i,o){r.call(this,t,e,i,o)}function a(t,e,i,o){s.call(this,t,e,i,o)}
function l(t,e,i,o){r.call(this,t,e,i,o),this._maxAbsValue=0}function c(t,e,i,o){var n,r;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=U.enabled("source_selection_markers"),n=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._ohlcPlotIndexes={},r=0;r<n.length;r++)n[r].target===this.m_plotName&&(this.m_study.isOHLCOpenPlot(r)&&(this._ohlcPlotIndexes[TradingView.OPEN_PLOT]=r),this.m_study.isOHLCHighPlot(r)&&(this._ohlcPlotIndexes[TradingView.HIGH_PLOT]=r),this.m_study.isOHLCLowPlot(r)&&(this._ohlcPlotIndexes[TradingView.LOW_PLOT]=r),this.m_study.isOHLCClosePlot(r)&&(this._ohlcPlotIndexes[TradingView.CLOSE_PLOT]=r),this.m_study.isOHLCColorerPlot(r)&&(this._colorer=r,this._palette=this.m_study.metaInfo().palettes[n[r].palette],this._paletterProps=this.m_study.properties().palettes[n[r].palette]))}function h(t,e,i,o){c.call(this,t,e,i,o)}function u(t,e,i,o){c.call(this,t,e,i,o)}var d=i(21).assert,p=i(1).Point,_=i(53),f=_.rgbToHsl,m=_.hslToRgb,g=_.rgbToHexString,v=_.parseRgb,y=_.parseRgba,b=i(4),S=i(74),w=S.SelectionRenderer,T=S.SelectionRendererArrowsUpDown,x=i(421).PaneRendererBars,C=i(960).PaneRendererHistogram,P=i(955).PaneRendererColumns,L=i(212).PaneRendererLine,I=i(420).PaneRendererArea,k=i(279).PaneRendererCandles,A=i(956).PaneRendererCross,M=i(954).PaneRendererCircles,E=i(278).PaneRendererArrowsUpDownItem,V=i(278).PaneRendererArrowsUpDown,D=i(422).PaneRendererUnicodeChar,O=i(952).PaneRendererBackground,B=i(408),R=i(8).CompositeRenderer,z=i(424),F=i(56).clamp,N=i(106),W=i(709),$=i(19),H=i(42).PlotRowSearchMode,U=i(7);i(951),i(953),i(957),i(958),i(959),i(961),i(962),i(964),i(965),o.isIndexValid=function(t,e){return null!==t&&t>=0&&t<e._length()},o.prototype.items=function(){return this.m_items},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,n,r,s,a,l,c,h,u,d,_,f,m,g,v,y,S,w,T,x,C,P,L,I,k;if(this._histogramBase=null,this.m_items=[],!(this.m_model.timeScale().isEmpty()||this.m_study.priceScale().isEmpty()||null===(t=this.m_model.timeScale().visibleBars())||(e=this.m_series.nearestIndex(t.firstBar(),H.NearestRight),i=this.m_series.nearestIndex(t.lastBar(),H.NearestLeft),n=this.m_study.offset(this._plotName),n>0?(e-=n,i+=n):(e+=n,i-=n),(r=this.m_study.getMinFirstBarIndexForPlot(this._plotName))>i))){if(e=Math.max(r,e),s=this.m_study.properties().styles[this._plotName],a=s.plottype.value(),l=[N.PlotType.Line,N.PlotType.Area,N.PlotType.Circles,N.PlotType.Cross].indexOf(a)>=0,c=this.m_study.data(),h=this.m_study.firstValue(),l&&c._length()>0){for(u=c._bsearch(e);o.isIndexValid(u,c)&&void 0===c._valueAt(u)[this._plotIndex+1];)u-=1;for(e=o.isIndexValid(u,c)?c._indexAt(u):e,d=c._bsearch(i);o.isIndexValid(d,c)&&void 0===c._valueAt(d)[this._plotIndex+1];)d+=1;i=o.isIndexValid(d,c)?c._indexAt(d):i}if(_=c.range(e,i),f=this.m_study.priceScale(),m=f.properties().percentage.value(),g=F(this._getTranspValue(),0,100),v={},y=function(t,e){var i=t+"@"+e
;return v[i]||(this._plotName&&"vol"===this._plotName?v[i]=$.generateColor(t,e):v[i]=$.generateColor(t,e,!0)),v[i]}.bind(this),_.each(function(t,e){var i,o,r,a,c,u,d,_,f;return t+=n,t=Math.floor(t),i=e[this._plotIndex+1],o=void 0===i||null===i,i=o?NaN:i,m&&!o&&(i=100*(i-h)/h),(!l||!o)&&(r=new p(t,i),a=void 0!==e[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&a&&(i=e[this._colorer+1],r.style={},null!=i?(c=this._palette.valToIndex?this._palette.valToIndex[i]:i,u=this._paletterProps.colors[c],d=u.color.value(),r.style.color=$.isHexColor(d)?y(d,g):d):(d=s.color.value(),r.style.color=y(d,100)),_=void 0!==c?u.width.value():s.linewidth.value(),f=void 0!==c?u.style.value():s.linestyle.value(),r.style.width=_,r.style.style=f),this.m_items.push(r),!1)}.bind(this)),f.pricesToCoordinates(this.m_items),this.m_model.timeScale().indexesToCoordinates(this.m_items),s.histogramBase&&(this._histogramBase=this.m_study.priceScale().priceToCoordinate(s.histogramBase.value())),this.m_study===this.m_model.selectedSource())for(S=z(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=b.REGULAR,w=0;w<S.length;w++)T=S[w],x=this.m_study.data().valueAt(T),T+=n,null!==x&&(C=x[this._plotIndex+1],f.isPercentage()&&(C=100*(C-h)/h),P=this.m_model.timeScale().indexToCoordinate(Math.floor(T)),L=this.m_study.priceScale().priceToCoordinate(C),this._selectionData.points.push(new p(P,L)));I=s,this._lineColor=$.generateColor(I.color.value(),g),this._lineWidth=I.linewidth.value(),k=I.color.value(),this._colorer&&null!=(C=this._paletterProps.colors[0])&&(k=C.color.value(),this._lineWidth=C.width.value(),this._lineColor=$.generateColor(C.color.value(),g)),this._color2=$.generateColor(k,g),this._color1=$.generateColor(o.addHueForColor(k),g)}},o.addHueForColor=W(function(t){var e=f(v(t)),i=e[0]+.05;return e[0]=i-Math.floor(i),g(m(e))}),o.prototype._getTranspValue=function(){var t=this.m_study.properties(),e=t.styles[this._plotName],i=0,o=0,n=this.m_study.metaInfo();return"Volume@tv-basicstudies"===n.id&&n.version<=46&&"transparency"in t?(i=t.transparency.value(),i=isNumber(i)?i:o):(e.transparency&&(i=e.transparency.value(),i=isNumber(i)?i:o),i)},o.prototype.renderer=function(){var t,e,i,o,n=this.m_study.properties().styles[this._plotName];if(n.visible.value()&&this.m_study.priceScale()){switch(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.barSpacing=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.histogramBase=this._histogramBase?this._histogramBase:this.m_study.priceScale().height(),t.lineIndex=0,t.lineStyle=n.linestyle.value(),t.lineColor=this._lineColor,t.lineWidth=this._lineWidth,t.lineWidth=isNumber(t.lineWidth)?t.lineWidth:1,t.color1=this._color1,t.color2=this._color2,t.bottom=t.histogramBase,this._colorer||(t.simpleMode=!0),e=new R,i=!!n.joinPoints&&n.joinPoints.value(),n.plottype.value()){case N.PlotType.Line:case N.PlotType.LineWithBreaks:e.append(new L(t));break;case N.PlotType.Area:case N.PlotType.AreaWithBreaks:e.append(new I(t));break;case N.PlotType.Histogram:
e.append(new C(t));break;case N.PlotType.Columns:e.append(new P(t));break;case N.PlotType.Cross:e.append(new A(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.forceLineWidth=!0,e.append(new L(o)));break;case N.PlotType.Circles:e.append(new M(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.ignorePaletteLineWidth=!0,e.append(new L(o)));break;default:e.append(new L(t))}return this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new w(this._selectionData)),e}},n.prototype.items=function(){return this._items},n.prototype.update=function(){this._invalidated=!0},n.prototype._scalesReady=function(){var t=this._model.timeScale(),e=this._study.priceScale();return t&&e&&!t.isEmpty()&&!e.isEmpty()},n.prototype._getTranspValue=function(){var t=this._study.properties(),e=t.styles[this._plotName],i=0;return e.transparency&&(i=e.transparency.value(),i=isNumber(i)?i:40),i},n.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,_;this._items=[],d(this._scalesReady(),"Scales must be ready!"),null!==(t=this._model.timeScale().visibleBars())&&(e=this._study.metaInfo().plots,i=e[this._plotIndex].palette,o=this._study.properties().palettes[i],n=o.colors,r=this._study.metaInfo().palettes[i],s=this._getTranspValue(),a=this._series.nearestIndex(t.firstBar(),H.NearestRight),l=this._series.nearestIndex(t.lastBar(),H.NearestLeft),c=this._study.offset(this._plotName),c>0?(a-=c,l+=c):(a+=c,l-=c),(h=this._study.getMinFirstBarIndexForPlot(this._plotName))>l||(a=Math.max(h,a),u=this._study.data(),_=u.range(a,l),_.each(function(t,e){var i,o,a,l;return t+=c,i=e[this._plotIndex+1],o=new p(Math.floor(t)-.5),a=isNumber(s)?s:50,a=Math.min(a,100),a=Math.max(a,0),null!=i?(l=r.valToIndex?r.valToIndex[i]:i,o.color=$.generateColor(n[l].color.value(),a)):o.color=null,this._items.push(o),!1}.bind(this)),this._model.timeScale().indexesToCoordinates(this._items)))},n.prototype.renderer=function(){var t,e;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),t={items:this._items,y:0,h:this._study.priceScale().height(),w:Math.ceil(this._model.timeScale().barSpacing())},e=new R,e.append(new O(t)),e},r.prototype.items=function(){return this.m_items},r.prototype.update=function(){this.m_invalidated=!0},r.prototype._scalesReady=function(){var t=this.m_model.timeScale(),e=this.m_study.priceScale();return t&&e&&!t.isEmpty()&&!e.isEmpty()},r.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g;this.m_items=[],this._scalesReady()&&(t=this.m_model.timeScale(),e=this.m_study.priceScale(),null!==(i=t.visibleBars())&&(o=this.m_series.nearestIndex(i.firstBar(),H.NearestRight),n=this.m_series.nearestIndex(i.lastBar(),H.NearestLeft),r=this.m_study.offset(this.m_plotName),r>0?(o-=r,n+=r):(o+=r,n-=r),(s=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName))>n||(o=Math.max(s,o),a=this.m_study.data(),l=this.m_study.firstValue(),c=a.range(o,n),
h=e.properties().percentage.value(),u=this._getTranspValue(),d=z(o,n),p=this.m_study===this.m_model.selectedSource(),this.m_selectionData=p?{points:[],hittestResult:b.REGULAR,vertOffset:0}:null,_=this.m_series.properties().style.value(),f=_===TradingView.Series.STYLE_LINE?"lineStyle":_===TradingView.Series.STYLE_AREA?"areaStyle":null,f?(m=this.m_series.properties()[f].priceSource.value(),g=m):(m="high",g="low"),this._topCoord=e.coordinateToPrice(e.height()*e.topMargin()),this._bottomCoord=e.coordinateToPrice(e.height()*(1-e.bottomMargin())),c.each(function(t,e){var i,o,n,s,a,c,_,f=Math.floor(t+r),v=e[this.m_plotIndex+1];return null!==v&&void 0!==v&&(i=this._createItem(f,v,m,g,h,l),void 0!==i&&null!==i?(o=void 0!==e[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&o&&(v=e[this._colorer+1],i.style={},null!=v?(s=this._palette.valToIndex?this._palette.valToIndex[v]:v,n=this._paletterProps.colors[s].color.value(),i.style.color=$.generateColor(n,u)):(n=this.m_study.properties().styles[this.m_plotName].color.value(),i.style.color=$.generateColor(n,100)),a=u>9?u-10:0,i.style.borderColor=$.generateColor(n,a)),c=void 0!==e[this._textColorer+1]||this._textPalette&&this._textPalette.addDefaultColor,this._textColorer&&c&&(v=e[this._textColorer+1],i.style||(i.style={}),null!=v?(s=this._textPalette.valToIndex?this._textPalette.valToIndex[v]:v,_=this._textPaletterProps.colors[s].color.value(),i.style.textColor=$.generateColor(_,u)):(_=this.m_study.properties().styles[this.m_plotName].textColor.value(),i.style.textColor=$.generateColor(_,100))),p&&-1!==d.indexOf(t)&&this.m_selectionData.points.push(i),this.m_items.push(i),!1):void 0)}.bind(this)),this._convertItemsToCoordinates())))},r.prototype._getSeriesVal=function(t,e){var i;t=t||"close",i=null;try{i=this.m_series[t](e)}catch(t){}return i},r.prototype._getTranspValue=function(){var t,e=0;return this.m_study.properties().transparency&&(e=this.m_study.properties().transparency.value(),e=isNumber(e)?e:50),t=this.m_study.properties().styles[this.m_plotName],t.transparency&&(e=t.transparency.value(),e=isNumber(e)?e:50),F(e,0,100)},r.prototype._createItem=function(t,e,i,o,n,r){var s,a,l,c=this.m_study.properties().styles[this.m_plotName].location.value();if(!e&&c!==CanvasEx.MARKLOC_ABSOLUTE)return null;switch(c){case CanvasEx.MARKLOC_ABOVEBAR:if(void 0===(s=this._getSeriesVal(i,t))||null==s)return null;a=s;break;case CanvasEx.MARKLOC_BELOWBAR:if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l;break;case CanvasEx.MARKLOC_TOP:a=this._topCoord;break;case CanvasEx.MARKLOC_BOTTOM:a=this._bottomCoord;break;case CanvasEx.MARKLOC_ABSOLUTE:a=e;break;default:throw Error("Bad value: "+c)}return n&&c!==CanvasEx.MARKLOC_TOP&&c!==CanvasEx.MARKLOC_BOTTOM&&(a=100*(a-r)/r),new p(t,a)},r.prototype._convertItemsToCoordinates=function(){var t=this.m_model.timeScale(),e=this.m_study.priceScale();t.indexesToCoordinates(this.m_items),e.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e})},
r.prototype._calculateVerticalOffset=function(t,e){var i=0;switch(t){case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BOTTOM:i=-e;break;case CanvasEx.MARKLOC_BELOWBAR:case CanvasEx.MARKLOC_TOP:i=e}return i},r.prototype._calculateShapeHeight=function(t,e){var i=t;switch(e){case CanvasEx.SIZE_TINY:i=.3*t;break;case CanvasEx.SIZE_SMALL:i=.6*t;break;case CanvasEx.SIZE_NORMAL:i=t;break;case CanvasEx.SIZE_LARGE:i=1.5*t;break;case CanvasEx.SIZE_HUGE:i=2*t}return i},r.prototype.renderer=function(){var t,e,i,o,n,r,s,a,l,c;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),n=this._calculateShapeHeight(o),r=this.m_study.properties().styles[this.m_plotName].location.value(),s=this._calculateVerticalOffset(r,n+n/2),e.barSpacing=o,e.items=this.m_items,e.color=$.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),i),e.height=n,e.vertOffset=s,a=this.m_study.properties().styles[this.m_plotName].plottype.value(),l=N.plotShapesData[a],c=new R,l&&c.append(new TradingView[l.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=s,c.append(new w(this.m_selectionData))),c},inherit(s,r),s.prototype.renderer=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b=this.m_study.properties().styles[this.m_plotName];if(b.visible&&b.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),b.size?(r=b.size.value(),n=this._calculateShapeHeight(25,r)):n=Math.round(o/2),s=b.location.value(),a=$.generateColor(b.color.value(),i),l=i>19?i-10:0,c=this._calculateVerticalOffset(s,Math.round(1.5*n)),e.barSpacing=o,e.items=this.items(),e.color=a,e.borderColor=$.generateColor(b.color.value(),l),e.height=n,e.vertOffset=c,h=b.plottype.value(),u=N.plotShapesData[h],d=new R,p=b.text?b.text.value():void 0,void 0!==p&&""!==p.trim()&&(_=p.trim().replace(/\\n/gm,"\n"),_=TradingView.cleanButAmpersand(_,!0),f=!1,m=!1,g="Arial",v=12,e.textCache=new B(_,f,m,g,v),y=b.textColor?b.textColor.value():void 0,e.textColor=y?$.generateColor(y,i):a),null!=u&&d.append(new TradingView[u.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=c,d.append(new w(this.m_selectionData))),d},inherit(a,s),a.prototype.renderer=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g=this.m_study.properties().styles[this.m_plotName];if(g.visible&&g.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),g.size?(r=g.size.value(),n=this._calculateShapeHeight(50,r)):n=Math.round(o),
s=g.location.value(),a=$.generateColor(g.color.value(),i),l=this._calculateVerticalOffset(s,n),e.items=this.items(),e.char=g.char.value(),e.height=n,e.vertOffset=l,e.color=a,c=new R,h=g.text?g.text.value():void 0,void 0!==h&&""!==h.trim()&&(u=h.trim().replace(/\\n/gm,"\n"),u=TradingView.cleanButAmpersand(u,!0),d=!1,p=!1,_="Arial",f=12,e.textCache=new B(u,d,p,_,f),m=g.textColor?g.textColor.value():void 0,e.textColor=m?$.generateColor(m,i):a),c.append(new D(e)),this.m_study===this.m_model.selectedSource()&&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 t,e,i,o,n,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),t={},e=F(this._getTranspValue(),0,100),i=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.barSpacing=i,t.colorup=$.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),e),t.colordown=$.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),e),o=y(t.colorup),n=o?100*(1-o[3]):0,r=y(t.colordown),s=r?100*(1-r[3]):0,t.colorBorderUp=$.generateColor("#000000",n),t.colorBorderDown=$.generateColor("#000000",s),t.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value(),t.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value(),a=new R,a.append(new V(t)),this.m_study===this.m_model.selectedSource()&&null!==this.m_selectionData&&(l=this.m_selectionData,l.barSpacing=i,a.append(new T(l))),a},l.prototype._createItem=function(t,e,i,o,n,r){var s,a,l,c;if(0!==e){if(Math.abs(e)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(e)),s=e>0){if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l}else{if(void 0===(c=this._getSeriesVal(i,t))||null==c)return null;a=c}return n&&(a=100*(a-r)/r),new E(t,a,e,s)}},l.prototype._convertItemsToCoordinates=function(){var t,e,i,o,n,r,s,a,l,c=this.m_model.timeScale(),h=this.m_study.priceScale();for(c.indexesToCoordinates(this.m_items),h.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e}),t=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value()),e=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value()),t>e&&(i=t,t=e,e=i),o=e-t,n=o/this._maxAbsValue,r=this.m_items,s=0;s<r.length;s++)a=r[s],l=Math.abs(a.height),a.height=l*n+t},c.prototype.update=function(){this._invalidated=!0},c.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,_,y,S,w,T,x,C;if(this.m_bars.length=0,!(this.m_model.timeScale().isEmpty()||this.m_study.priceScale().isEmpty()||null===(t=this.m_model.timeScale().visibleBars())||(e=this.m_series.nearestIndex(t.firstBar(),H.NearestRight),i=this.m_series.nearestIndex(t.lastBar(),H.NearestLeft),(o=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName))>i||(e=Math.max(o,e),
n=this.m_study.data(),r=this.m_study.firstValue(),s=n.range(e,i),a=this.m_study.priceScale(),l=a.properties().percentage.value(),c=0,h=this.m_study.properties().ohlcPlots[this.m_plotName],u={},d=function(t,e){var i=t+"@"+e;return u[i]||(u[i]=$.generateColor(t,e)),u[i]},s.each(function(t,e){var i,o,n,s,a,u,p,_,y,b,S,w,T,x,C,P;for(t=Math.floor(t),i=!0,o={},n=TradingView.OPEN_PLOT;n<=TradingView.CLOSE_PLOT;++n){if(void 0===(s=e[this._ohlcPlotIndexes[n]+1])||null===s){i=!1;break}o[n]=s}return!!i&&(a=o[TradingView.OPEN_PLOT],u=o[TradingView.CLOSE_PLOT],p=Math.max(a,o[TradingView.HIGH_PLOT],o[TradingView.LOW_PLOT],u),_=Math.min(a,o[TradingView.HIGH_PLOT],o[TradingView.LOW_PLOT],u),y={},y.time=Math.round(t),l?(y.open=100*(a-r)/r,y.high=100*(p-r)/r,y.low=100*(_-r)/r,y.close=100*(u-r)/r):(y.open=a,y.high=p,y.low=_,y.close=u),b=h.color.value(),S=void 0!==e[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&S&&null!=(s=e[this._colorer+1])&&(w=this._palette.valToIndex?this._palette.valToIndex[s]:s,T=this._paletterProps.colors[w],b=T.color.value()),y.color=d(b,c),x=f(v(b)),C=x[2]>.25?x[2]-.26:x[2]+.75,P=m(x[0],x[1],C),y.borderColor=d(g(P),c),y.hollow=null,this.m_bars.push(y),!1)}.bind(this)),a.barPricesToCoordinates(this.m_bars),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_study!==this.m_model.selectedSource()))))for(_=z(e,i),this._selectionData={points:[],hittestResult:b.REGULAR},y=0;y<_.length;y++)S=_[y],null!==(w=this.m_study.data().valueAt(S))&&(T=w[this._plotIndex+1],a.properties().percentage.value()&&(T=100*(T-r)/r),x=this.m_model.timeScale().indexToCoordinate(Math.floor(S)),C=this.m_study.priceScale().priceToCoordinate(T),this._selectionData.points.push(new p(x,C)))},c.prototype.items=function(){return this.m_bars},inherit(h,c),h.prototype.renderer=function(){var t,e;if(this.m_study.properties().ohlcPlots[this.m_plotName].visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value(),e=new R,e.append(new x(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new w(this._selectionData)),e},inherit(u,c),u.prototype.renderer=function(){var t,e,i,o=this.m_study.properties().ohlcPlots[this.m_plotName];if(o.visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=o.drawWick.value(),t.drawBorder=o.drawBorder.value(),e=o.wickColor.value(),t.borderColor=e,t.wickColor=e,i=new R,i.append(new k(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&i.append(new w(this._selectionData)),i},e.StudyPaneView=o,e.StudyBackgroundPaneView=n,e.StudyPlotShapesPaneView=s,e.StudyPlotCharsPaneView=a,e.StudyPlotArrowsPaneView=l,e.StudyPlotCandlesPaneView=u,e.StudyPlotBarsPaneView=h},function(t,e,i){"use strict";function o(t,e){var o,n,r,a,l,c,h,u,d
;if(!t)throw Error("No studies metainfo");if(o=i(427),this._studiesMetainfo=t,!e)throw Error("No studies migrations");for(this._studiesMigrations=e,this._migrations={},n=0;n<this._studiesMigrations.length;n++)for(r=this._studiesMigrations[n],a=r.versFrom,l=r.versTo,c=0;c<r.studyMigrations.length;c++)h=r.studyMigrations[c],u=h.studyId,0!==h.rules.length?(d=u in this._migrations?this._migrations[u]:new o(u),d.addMigration(a,l,h.rules),this._migrations[u]=d):s.logError("Study Migration should have at least one convertion rule");this._clientMigrations=[function(t,e){var i,o,n,r,s;if(0===this._studiesMetainfo.length||!t.isTVScript||t.version>=22)return e;for(i={},o=0,n=0;void 0!==(r=e[n]);)s=e[r.id],r.isFake&&(r.id="in_"+o++),i[n]=r,i[r.id]=s,n++;return i}]}var n=i(21).assert,r=i(470).Version,s=i(13).getLogger("Chart.Study.Versioning"),a=i(1160),l=i(45);o.prototype.updateMetaInfo=function(t){var e,i,o;if(!t)return t;for(n(!t.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync"),e=null,i=this._studiesMetainfo,o=0;o<i.length;o++)if(i[o].id===t.id){e=i[o];break}return TradingView.clone(e)},o.prototype.updateMetaInfoAsync=function(t,e){var i,o,n,r,s,a=$.Deferred(),c=a.promise();if(!t)return a.reject("No old metaInfo was given"),c;if(e)return a.resolve(null),c;if(i=t.isTVScript&&t.scriptIdPart&&TVScript.pineType(t.scriptIdPart)===TVScript.PineType.Addon,o=l.versionOf(t),t.isTVScript&&!t.pine&&!i&&o<l.VERSION_PINE_PROTECT_TV_4164);else if((t.isTVScript||t.isTVScriptStubToCompile)&&t.pine&&!i);else{for(n=null,r=this._studiesMetainfo,s=0;s<r.length;s++)if(r[s].id===t.id){n=r[s];break}n?a.resolve(TradingView.clone(n)):a.resolve(null)}return c},o.prototype.updateStudyInputs=function(t,e,i,o,n){var a,l,c,h,u,d,p=TradingView.clone(o);if(t in this._migrations&&(a=r.parse(e),l=r.parse(i),c=this._migrations[t],h=c.updateInputs(a,l,p),p=h),null==n)return p;for(u in n)u in p||(p[u]=n[u]);for(u in p)u in n||(d=p[u],s.logWarn("Extra input detected, studyId="+t+", versionFrom="+e+", inputId="+u+", inputValue="+d+", removing it and continue..."),delete p[u]);return p},o.prototype.updateStudyState=function(t,e,i){var o,n,r,a,c,h,u,d,p,_,f,m,g,v;if(null==t||null==e||null==i)return t;for(t=TradingView.clone(t),o=e.isTVScript||!!e.pine,o||e.version===i.version||(n=i&&i.defaults.inputs,r=this.updateStudyInputs(e.id,e.version,i.version,t.inputs,n),t.inputs=r),a=0;a<this._clientMigrations.length;++a)r=this._clientMigrations[a].call(this,e,t.inputs),Object.keys(r).length===Object.keys(t.inputs).length?t.inputs=r:s.logWarn("StudyVersioning._clientMigrations application returned bad result. Skipping it...");if(c=l.versionOf(e),e.isTVScript&&e.TVScriptSourceCode&&c>=12&&c<=26){for(h={},a=0;a<e.plots.length;++a)u=e.plots[a],d=i.plots[a],h[u.id]=d.id;for(p=Object.keys(t.styles),a=0;a<p.length;++a)_=p[a],f=t.styles[_],delete t.styles[_],m=h[_],t.styles[m]=f;for(g=Object.keys(t.plots),a=0;a<g.length;++a)v=g[a],_=t.plots[v].id,t.plots[v].id=h[_]}return t},
o.prototype.patchPointsBasedStudyState=function(t){return o._fixInputsMaxValue(t.state,t.metaInfo),t},o.prototype.patchPointsBasedStudyData=function(t,e){if(!a.isProd())return e;if(!t||!e)return e;var i=TradingView.clone(e);return"VbPFixed@tv-volumebyprice"===t.id&&t.version&&t.version<=4&&o._patchOldVolumeProfiles(0,i),i},o.prototype.patchStudyData=function(t,e,i,n){var r,s,c,h,u,d,p;if(!a.isProd())return{data:e,nsData:i,indexes:n};if(r=TradingView.clone(e),s=TradingView.clone(i),c=TradingView.clone(n),"VbPVisible@tv-volumebyprice"===t.id&&t.version&&t.version<=4&&o._patchOldVolumeProfiles(0,r.graphics),"VbPSessions@tv-volumebyprice"===t.id&&t.version&&t.version<=4&&o._patchOldVolumeProfiles(0,r.graphics),h=l.versionOf(t),t.isTVScript&&t.TVScriptSourceCode&&h>=12&&h<=26)for(u=r.columns,r.columns=[],d=0;d<u.length;++d)p="plot_"+d,r.columns.push(p);return{data:r,nsData:s,indexes:c}},o._patchOldVolumeProfiles=function(t,e){var i,o=e.hhists[t].data,n=[];for(i in o)n=n.concat(o[i]);e.hhists[0].data=n},o._fixInputsOrder=function(t,e){var i,n,r,s,a=l.getOrderedInputIds(e),c=o.splitInputs(t.inputs),h=c.arr,u=c.obj,d=TradingView.merge({},u);for(i=0;i<a.length;++i)n=a[i],null!==(r=o.findInputKeyById(h,n))&&(s=h[r],d[i]=s);t.inputs=d},o.INPUT_MAX_VALUE=1e12,o._verifyInputsMaxValue=function(t){var e,i,n=o.INPUT_MAX_VALUE;if(t.inputs)for(e=0;e<t.inputs.length;e++)i=t.inputs[e],"integer"===i.type&&i.max&&i.max>n&&s.logWarn("Bad integer input max value in metaInfo id="+t.id+" title="+t.description)},o._fixInputsMaxValue=function(t,e){var i,n,r,s,a,l;if(!TradingView.isAbsent(e)){if(i=o.INPUT_MAX_VALUE,e.inputs)for(n=0;n<e.inputs.length;n++)r=e.inputs[n],"integer"===r.type&&r.max&&r.max>i&&(r.max=i);if(t&&t.inputs){s=o.splitInputs(t.inputs),a=s.arr;for(l in a)r=a[l],"integer"===r.type&&r.max&&r.max>i&&(r.max=i);t.inputs=TradingView.merge(s.obj,s.arr)}}},o.prototype.patchPropsStateAndMetaInfo=function(t,e,i){var n,r,s,a,c,h,u,d,p,_,f,m,g,v,y,b,S,w;if("Script$BOOKER"!==e.productId||e.alerts||delete t.alerts,o._fixInputsOrder(t,e),o._fixInputsMaxValue(t,e),n=o.splitInputs(t.inputs),t.inputs=n.obj,l.versionOf(e)<l.METAINFO_FORMAT_VERSION_SOS_V2&&e.isChildStudy&&(t.isChildStudy=e.isChildStudy),r=60,e.isTVScript&&e.version<r&&("Script$TV_EARNINGS@tv-scripting"!==e.id&&"Script$TV_DIVIDENDS@tv-scripting"!==e.id&&"Script$TV_SPLITS@tv-scripting"!==e.id||delete e.TVScriptSourceCode),"Volume"!==e.id&&"Volume@tv-basicstudies"!==e.id||0!==e.inputs.length||(e.inputs=[{id:"length",type:"integer",defval:20,min:1,max:1e3}],e.plots.push({id:"vol_ma",type:"line"})),"Volume@tv-basicstudies"===e.id&&e.version&&e.version<=46&&(t.styles.vol.transparency=t.transparency||87),"PivotPointsStandard@tv-basicstudies"===e.id&&(0===e.inputs.length?(t.inputs={kind:"Traditional",showHistoricalPivots:!0},e.inputs=[{defval:"Traditional",id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]):1===e.inputs.length&&(t.inputs={kind:"Traditional"},e.inputs=[{defval:"Traditional",
id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]),void 0===t._hardCodedDefaultsVersion&&(t._hardCodedDefaultsVersion=1,s=t.color,delete t.color,t.levelsStyle={colors:{P:s,"S1/R1":s,"S2/R2":s,"S3/R3":s,"S4/R4":s,"S5/R5":s}})),"CMF"===e.shortId&&2===e.inputs.length&&(t.inputs={length:t.inputs["length fast"]},e.inputs=e.inputs.splice(0,1),e.inputs[0].id="length"),e.defaults&&void 0===e.defaults.precision&&(-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(e.id)?e.defaults.precision=0:e.defaults.precision=4),a=60,e.version<a)for(c=["TV_DIVIDENDS","TV_SPLITS","TV_EARNINGS"],h=6,u=0;u<c.length;u++)e.id.startsWith("Script$"+c[u]+"@tv-scripting")&&(e.fullId="ESD"+e.fullId.substring(h),e.id="ESD"+e.id.substring(h),e.name="ESD"+e.name.substring(h),e.shortId="ESD"+e.shortId.substring(h),e.productId="ESD"+e.productId.substring(h));if(l.versionOf(e)<l.VERSION_PINE_PROTECT_TV_4164&&(d={"StrategyScript$STD;Consecutive%1Ups/Downs%1Strategy":{pineId:"STD;Consecutive%1Ups%1Downs%1Strategy",className:"StrategyScript"},Script$EDGR_NET_INCOME_FROM_CONTINUING_OPERATIONS_APPLICABLE_TO_COMMON_V2:{pineId:"Script$EDGR_NET_INCOME_FROM_CONTINUING_OPS_APPLICABLE_TO_COMMON_V2",className:"Script"}},e.shortId in d&&(p=d[e.shortId].className+"$"+d[e.shortId].pineId,_={scriptIdPart:d[e.shortId].pineId,fullId:e.fullId.replace(e.shortId,p),id:e.id.replace(e.shortId,p),name:e.name.replace(e.shortId,p),shortId:p},TradingView.merge(e,_),TradingView.merge(t,_)),f=TradingView.StudyMetaInfo.cutScriptIdPart(e.fullId),(m=f.match(/^(USER)(_\d+)(;)(.*)$/))&&(g=m[0],v=m[1]+m[3]+m[2]+m[4],_={scriptIdPart:v,fullId:e.fullId.replace(g,v),id:e.id.replace(g,v),name:e.name.replace(g,v),shortId:e.shortId.replace(g,v)},TradingView.merge(e,_),TradingView.merge(t,_))),"MA"===e.id){switch(y=new l({id:"MAExp",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgExp",type:"line"}],palettes:{}}),b=new l({id:"MASimple",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgSimple",type:"line"}],palettes:{}}),S=new l({id:"MAVolumeWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgVolumeWeighted",type:"line"}],palettes:{}}),w=new l({id:"MAWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgWeighted",type:"line"}],palettes:{}}),t.inputs.type){case"exp":e=y
;break;case"simple":e=b;break;case"weighted":e=w;break;case"volume weighted":e=S}t.styles[e.plots[0].id]=t.styles.MovAvg,delete t.styles.MovAvg,delete t.inputs.type}return i.oldShowStudyLastValueProperty&&(t.oldShowLastValue=t.showLastValue),delete t.showLastValue,delete t.showStudyArguments,{propsState:t,metaInfo:e}},o.isVersionTesting=function(t){var e;return!!t&&(t=""+t,e=RegExp("\\d+.\\d+"),e.exec(t)===t)},o.isVersionHead=function(t){var e;return!!t&&(t=""+t,e=RegExp("\\d+"),e.exec(t)===t)},o.mergeInputs=function(t,e){o.mergeInputsArrPart(t,e),o.mergeInputsObjPart(t,e)},o.mergeInputsArrPart=function(t,e){var i,n,r=o.splitInputs(e);for(i in r.arr)n=o.findInputKeyById(t,r.arr[i].id),n?TradingView.merge(t[n],r.arr[i]):o.appendInputInfoToArr(t,r.arr[i])},o.mergeInputsObjPart=function(t,e){var i=o.splitInputs(e);TradingView.merge(t,i.obj)},o.appendInputInfoToArr=function(t,e){var i,o,n=-1;for(i in t)o=parseInt(i,10),isNumber(o)&&o>n&&(n=o);t[n+1]=e},o.splitInputs=function(t){var e,i={},o={};for(e in t)isNumber(parseInt(e,10))?i[e]=t[e]:o[e]=t[e];return{arr:i,obj:o}},o.findInputKeyById=function(t,e){var i,o=null;for(i in t)if(isNumber(parseInt(i,10))&&t[i].id===e){o=i;break}return o},o.getInputKeyById=function(t,e){var i=o.findInputKeyById(t,e);if(!i)throw Error("Cannot find input with id: "+e);return i},t.exports=o},,,function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(4),n=i(101),r=function(){function t(){this._data=null,this._hitTest=new o(o.REGULAR)}return t.prototype.setData=function(t){this._data=t},t.prototype.setHitTest=function(t){this._hitTest=t},t.prototype.draw=function(t){var e,i;null!==this._data&&0!==this._data.points.length&&!1!==this._data.visible&&((e=this._data.points[0].y)<0||e>this._data.height||(i=this._data.width,t.lineCap="square",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&n.setLineStyle(t,this._data.linestyle),n.drawLine(t,0,e,i,e)))},t.prototype.hitTest=function(t){return null===this._data||!1===this._data.visible?null:0===this._data.points.length?null:Math.abs(t.y-this._data.points[0].y)<=5?this._hitTest:null},t}(),e.HorizontalLineRenderer=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(1154);e.createConfirmDialog=o.createConfirmDialog},,,,,,,,function(t,e,i){"use strict";var o=i(395),n={instances:[],createMenu:function(t,e,i){var n=new o(t,e,i);return this.instances.push(n),n},hideAll:function(){for(var t in this.instances)this.instances[t].hide()}};t.exports=n},function(t,e,i){"use strict";var o=i(37),n={_fontHeightCache:{},_parsedColorCache:{}};n._parseColor=function(t){var e,i,o;return this._parsedColorCache[t]?this._parsedColorCache[t]:(e=document.createElement("div"),e.style.color=t,i=e.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||e.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d*\.?\d+)\s*\)$/i),o={r:i[1],g:i[2],b:i[3],a:i[4]||"1"},this._parsedColorCache[t]=o,o)},n.getColorFromProperties=function(t,e){
var i=1-e.value()/100,o=this._parseColor(t.value());return"rgba("+o.r+","+o.g+","+o.b+","+i+")"},n.setColorToProperties=function(t,e,i){var o,n=this._parseColor(t);e.setValue("rgb("+n.r+","+n.g+","+n.b+")"),o=100*(1-n.a),i.setValue(Math.max(0,Math.min(o,100)))},n._parseFont=function(t){var e,i,o=document.createElement("div");return o.style.font=t,e=o.style.fontSize.match(/(\d+)pt/),i=e&&e[0]===o.style.fontSize,{family:o.style.fontFamily,size:i?e[1]:"",bold:"bold"===o.style.fontWeight,italic:"italic"===o.style.fontStyle}},n.getFontFromProperties=function(t,e,i,o){return[i.value()?"bold":"",o.value()?"italic":"",e.value()+"pt",t.value()].join(" ")},n.setFontToProperties=function(t,e,i,o,n){var r=this._parseFont(t);r.family.length>0&&e.setValue(r.family),r.size.length>0&&i.setValue(r.size),o.setValue(r.bold),n.setValue(r.italic)},n.fontHeight=function(t){var e,i;return this._fontHeightCache[t]||(e=document.createElement("span"),e.appendChild(document.createTextNode("height")),document.body.appendChild(e),e.style.cssText="font: "+t+"; white-space: nowrap; display: inline;",i=e.offsetHeight,document.body.removeChild(e),this._fontHeightCache[t]=Math.ceil(i)),this._fontHeightCache[t]},n.drawPolyHoverOrPress=function(t,e,i,o){o?(t.save(),t.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(t,e,!0),t.restore()):i&&(t.save(),t.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(t,e,!0),t.restore())},n.repaint=function(t){var e=new o(o.LIGHT_UPDATE);e.force=!0,t.invalidate(e)},n.roundToMinTick=function(t,e){var i=t.mainSource().base(),o=1/i;return o*Math.round(e/o)},t.exports=n},function(t,e,i){(function(t,o,n){"use strict";function r(e,i){var r,a=e._undoModel._chartWidget,l=a.onWidget(),c=!1;c=l?a._options&&!a._options.hideIdeas:!!t.enabled("bars_marks")&&TVSettings.getBool("BarsMarksContainer.visibile",!1),i?i.merge({visible:c,frozen:!1}):i=new o({visible:c,frozen:!1}),r=this,i.visible.listeners().subscribe(null,function(e){l||a._containsData||!t.enabled("bars_marks")||TVSettings.setValue("BarsMarksContainer.visibile",!!e.value()),r._tooltip&&r._tooltip.removeAll()}),s.call(this,e,i),this.onNeedRepaint=new n,this._requests=[],this._marks={},this._loadedRange=null,this._getDataTimeout=null,this._collectedRange=null,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks),this._model.mainSeries().onSymbolResolved().subscribe(this,this.clearMarks),this._model.mainSeries().onTickmarksRangeChanged().subscribe(this,this.getData),this._initialize(),this.pinnedTooltips={},this._tooltip=new h(this._createTooltip.bind(this),this)}var s=i(3).LineDataSource,a=i(34).isNumber,l=i(273).BarsMarksContainerPaneView,c=i(273).BarsMarksContainerRenderer,h=i(841).TooltipRenderer,u=i(13).getLogger("Chart.BarsMarksContainer");inherit(r,s),r.prototype._constructor="Child class must override this member",r.prototype._initialize=function(t){throw Error("Child class must override this member")},r.prototype.onClicked=function(){throw Error("Child class must override this member")},r.prototype._getData=function(t){
throw Error("Child class must override this member")},r.prototype._createTooltip=function(){throw Error("Child class must override this member")},r.prototype.updateDotData=function(t,e){return e},r.prototype.updatePlateData=function(t,e){},r.prototype._plateViewData=function(t){return{}},r.prototype.pinTooltip=function(t,e){this.pinnedTooltips[t]=e},r.prototype.timeScale=function(){return this._model.timeScale()},r.prototype.getIntervalInTicks=function(){function t(t){if((t=parseInt(t))!=t)throw new TypeError("Unexpected interval");return 60*t}var e=t(1440),i=7*e,o=31*e,n=this._model.mainSeries().properties().interval.value();switch(n){case"M":return o;case"W":return i;case"D":return e;default:return t(n)}},r.prototype._maxDate=Math.round(new Date(2037,0,1).getTime()/1e3),r.prototype.getVisibleTickmarksRange=function(){var t,e;return this.timeScale().isEmpty()?{start:0,end:0}:(t=this.timeScale().visibleBars(),t.lastBar()>this.timeScale().points().firstIndex()&&t.firstBar()<this.timeScale().points().lastIndex()?(e=t.lastBar()<this.timeScale().points().lastIndex()?this.timeScale().indexToTimePoint(t.lastBar()):this._maxDate,t={start:this.timeScale().indexToTimePoint(Math.max(t.firstBar(),this.timeScale().points().firstIndex())),end:e},{start:t.start?t.start:void 0,end:t.end?t.end:void 0}):{start:0,end:0})},r.prototype.getVisibleRangePlates=function(){var t=[],e=this.getVisibleTickmarksRange(),i=this.getIntervalInTicks();return $.each(this._marks,function(o,n){var r=n.tickmark;r>=e.start&&r<=e.end+i&&t.push(n)}),t},r.prototype.getPublishedPlates=function(){var t={},e=this;return is_authenticated?($.each(this.getVisibleRangePlates(),function(i,o){o.is_public&&(e.pinnedTooltips[o.id]||o.user__id===user.id)&&(t[o.id]=o)}),t):t},r.prototype._maxPlatesPerBar=10,r.prototype.filterDisplayedPlates=function(t){return t=t.reduce(function(t,e){var i=this._getIndex(e.tickmark);return t[i]=t[i]||[],t[i].push(e),t}.bind(this),{}),t=Object.keys(t).reduce(function(e,i){var o=t[i];return o=o.sort(function(t,e){return e.views_count-t.views_count}),o=o.slice(0,this._maxPlatesPerBar),e.concat(o)}.bind(this),[])},r.prototype._layout=function(t){switch(t){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(t){switch(t){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(t,e){var i;switch(t){default:case"up":i=e[TradingView.HIGH_PLOT];break;case"down":i=e[TradingView.LOW_PLOT]}return this.priceScale().isPercent()&&(i=this.priceScale().priceRange().convertToPercent(i,this.ownerSource().firstValue())),this.priceScale().priceToCoordinate(i)},r.prototype._getIndex=function(t){return this.timeScale().timePointToIndex(t)},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 t,e,i,o,n,r;if(this._model.mainSeries().data().isEmpty())return[];t=this.filterDisplayedPlates(this.getVisibleRangePlates()),e=this,i={},o=this._model.lastHittestData(),t=t.map(function(t){var n,r,s,a,l,c,h=this._getIndex(t.tickmark),u=this._getBar(h);return null!==u&&(n=this._layout(t.direction),r=this._theme(t.direction),s=o&&o.id===t.id,a=this.timeScale().indexToCoordinate(h),l=this._offset(n,u),c=0,h in i||(i[h]={up:0,down:0}),c=i[h][n]++,TradingView.merge({id:t.id,x:a,y:l,order:c,direction:n,theme:r,hovered:s,pinned:!0===e.pinnedTooltips[t.id],user__id:t.user__id,label:t.label,labelFontColor:t.labelFontColor||"#444",minSize:t.minSize||0},this._plateViewData(t)))}.bind(this)),t=t.filter(function(t){return!!t}),n=t.filter(function(t){return!0===t.hovered});for(r=0;r<t.length;r++)null!=n[0]&&t[r].user__id===n[0].user__id&&(t[r].highlightByAuthor=!0);return t.sort(function(t,e){return t.hovered&&!e.hovered?1:0}),t},r.prototype._getBar=function(t){return this._model.mainSeries().data().valueAt(t)},r.prototype.paneViews=function(t){var e=this;return this._properties.visible.value()?[new l(this,t,function(t){return new c(t.getViewData(),e)})]:[]},r.prototype.dataWindowView=function(){return null},r.prototype.priceAxisViews=function(){return null},r.prototype.statusView=function(){return null},r.prototype.updateAllViews=function(){},r.prototype.pointsCount=function(){return 0},r.prototype.properties=function(){return this._properties},r.prototype._rangeDifference=function(t){return t=$.extend({},t),this._loadedRange&&(t.start<this._loadedRange.start?t.end=this._loadedRange.start:t.end>this._loadedRange.end&&(t.start=this._loadedRange.end)),t},r.prototype._rangeUnion=function(t,e){return t=$.extend({},t),e&&(t.start=Math.min(e.start,t.start),t.end=Math.max(e.end,t.end)),t},r.prototype._pushGetDataStack=function(t){if(!a(t.start)||!a(t.end))return void u.logError("Wrong tickmark range");this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._collectedRange=this._rangeUnion(t,this._collectedRange),this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange),this._getDataTimeout=this._collectedRange=null}.bind(this),300)},r.prototype.roundRange=function(t){return{start:Math.round(t.start),end:Math.round(t.end)}},r.prototype.refreshData=function(){this.getData(this._lastRange)},r.prototype.getData=function(t){if(!a(t.start)||!a(t.end))return void u.logError("Wrong range");this._lastRange=t;var t=$.extend({},t);t.end=this._maxDate,this._pushGetDataStack(t)},r.prototype._abortAllRequests=function(){this._requests.forEach(function(t){t.abort()}),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null},r.prototype.clearMarks=function(){this._abortAllRequests(),this._marks={},this._loadedRange=null},e.BarsMarksContainer=r}).call(e,i(7),i(52),i(20))},function(t,e,i){"use strict";function o(t,e){var o=e||new p("linetoolelliott");u.call(this,t,o),i.e(1,function(t){var e=i(274).ElliottLabelsPaneView
;this._setPaneViews([new e(this,this._model)])}.bind(this))}function n(t,e){var o=e||new p("linetoolelliott");u.call(this,t,o),this.version=n.version,i.e(1,function(t){var e=i(274).ElliottLabelsPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}function r(t,e){this._constructor="LineToolElliottImpulse";var i=e||new p("linetoolelliottimpulse");n.call(this,t,i)}function s(t,e){this._constructor="LineToolElliottTriangle";var i=e||new p("linetoolelliotttriangle");n.call(this,t,i)}function a(t,e){this._constructor="LineToolElliottTripleCombo";var i=e||new p("linetoolelliotttriplecombo");n.call(this,t,i)}function l(t,e){var o=e||new p("linetoolelliott");u.call(this,t,o),this.version=l.version,i.e(1,function(t){var e=i(274).ElliottLabelsPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}function c(t,e){this._constructor="LineToolElliottCorrection";var i=e||new p("linetoolelliottcorrection");l.call(this,t,i)}function h(t,e){this._constructor="LineToolElliottLineToolElliottDoubleCombo";var i=e||new p("linetoolelliottdoublecombo");l.call(this,t,i)}var u=i(3).LineDataSource,d=i(73).Action,p=i(11).DefaultProperty,_=i(9).propertyPages;inherit(o,u),o.migrateState=function(t){var e={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottMinor"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottCircle"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottMinorRetr"===t.type&&(t.type="LineToolElliottCorrection",t.state.degree=i[t.state.wavesize]),"LineToolElliottMajorRetr"===t.type&&(t.type="LineToolElliottCorrection",t.state.degree=i[t.state.wavesize])},o.prototype.title=function(){return"Elliott Labels"},o.degrees=[$.t("Supermillennium"),$.t("Millennium"),$.t("Submillennium"),$.t("Grand Supercycle"),$.t("Supercycle"),$.t("Cycle"),$.t("Primary"),$.t("Intermediate"),$.t("Minor"),$.t("Minute"),$.t("Minuette"),$.t("Subminuette"),$.t("Micro"),$.t("Submicro"),$.t("Miniscule")],o.prototype.additionalActions=function(t){var e=new d({text:$.t("Degree")}),i=this;return e.subActions=o.degrees.map(function(e,o){var n=new d({text:e,checkable:!0,checked:i.properties().degree.value()===o});return n.callbacks().subscribe(null,function(){t.setProperty(i.properties().degree,o,"Change Elliott Degree")}),n}),[e]},o.prototype.label=function(t){var e=o.degrees.length-this.properties().degree.value()-1,i=Math.floor(e/3),n=e%3;return{fontIncrease:4*Math.floor(i),bold:!!(i%2),decoration:["","brackets","circle"][n],label:this.labelsGroup()[i][t]}},o.prototype.getStylesPropertyPage=function(){return _.LineToolElliottStylesPropertyPage},o.prototype.getDegrees=function(){return o.degrees},inherit(n,o),n.version=3,n.prototype.pointsCount=function(){return 6},n.prototype.migrateVersion=function(t,e,i){if(1===t){var o=$.extend({},this._timePoint[0]);this._timePoint.unshift(o),
this._points.length>0&&(o=$.extend({},this._points[0]),this._points.unshift(o))}},inherit(r,n),r._labelsGroups=[["0","1","2","3","4","5"],["0","i","ii","iii","iv","v"],["0","1","2","3","4","5"],["0","I","II","III","IV","V"],["0","1","2","3","4","5"]],r.prototype.labelsGroup=function(){return r._labelsGroups},inherit(s,n),s._labelsGroups=[["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"]],s.prototype.labelsGroup=function(){return s._labelsGroups},inherit(a,n),a._labelsGroups=[["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"]],a.prototype.labelsGroup=function(){return a._labelsGroups},inherit(l,o),l.version=3,l.prototype.pointsCount=function(){return 4},l.prototype.migrateVersion=function(t,e,i){if(1===t){var o=$.extend({},this._timePoint[0]);this._timePoint.insert(o,0),this._points.length>0&&(o=$.extend({},this._points[0]),this._points.insert(o,0))}},inherit(c,l),c._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],c.prototype.labelsGroup=function(){return c._labelsGroups},inherit(h,l),h._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],h.prototype.labelsGroup=function(){return h._labelsGroups},e.LineToolElliott=o,e.LineToolElliottImpulse=r,e.LineToolElliottTriangle=s,e.LineToolElliottTripleCombo=a,e.LineToolElliottCorrection=c,e.LineToolElliottDoubleCombo=h},function(t,e,i){"use strict";function o(t,e,i){var o=this._mtpStudyId()+"@mtp-mtpredictor",n=i||p.findStudyMetaInfo(t.studiesMetaData(),o),s=e||l(n,null,null,t.studyVersioning()),a=c.lineToolNameForPointsBasedStudy(o);r.call(this,t,s,a),this._setPaneViews(this.createPaneViews(t)),this._doNotNeedLine=!0,this._turnaroundCounter=0,this._nextTurnaround(),this._metaInfo=n,this._graphics=new u(n),this._formatter=new d}var n=i(136),r=n.StudyLineDataSource,s=n.StudyLineDataSourcePaneView,a=i(61),l=a.prepareStudyProperties,c=a.Study,h=i(3).LineDataSource,u=i(282),d=i(482).VolumeFormatter,p=i(45);inherit(o,r),o.prototype.series=function(){return TradingView.isInherited(this._ownerSource.constructor,TradingView.Series)?this._ownerSource:this._ownerSource.series()},o.prototype.calcIsActualSymbol=function(){return h.prototype.calcIsActualSymbol.call(this)},o.prototype._nextTurnaround=function(){this._turnaround=this._mtpStudyId()+"_"+ ++this._turnaroundCounter},o.prototype.createPaneViews=function(t){return[new s(this,t),new c.StudyPaneView_textmarks(this,t),new c.StudyPaneView_polygons(this,t),new c.StudyPaneView_lines(this,t)]},o.prototype.onData=function(t){var e=this;if("data_update"===t.method&&t.params.customId==="pointset_"+this._currentPointsetId)h.prototype.onData.call(this,t),this._points.length===this.pointsCount()&&this._requestStudy();else if("data_update"===t.method&&t.params.customId===this._studyId){if(!this._checkTurnaround(t.params.turnaround))return
;c.prototype._makeJSONForNSData.call(this,t).then(function(i){t.params.nonseries.d=i,""!==t.params.nonseries.d&&e._graphics.process(t.params.nonseries),t.params.nonseries.indexes.length>0&&(e._indexes=t.params.nonseries.indexes),e.updateAllViews(),e._model.updateSource(e)})}},o.prototype._requestStudy=function(){var t=this,e=function(e){t.onData(e)},i=this._studyInputs();i&&(this._studyId?(this._nextTurnaround(),this._model.chartApi().modifyStudy(this._studyId,this._turnaround,i,e)):(this._studyId=c.makeNextStudyId(),this._model.chartApi().createStudy(this._studyId,this._turnaround,this._model.mainSeries()._seriesId,this._metaInfo.fullId+"!",i,e)))},e.LineStudyMtp=o},function(t,e,i){"use strict";function o(t,e,i){a.call(this,t,e),this.properties().listeners().subscribe(this,o.prototype.changeStyles),this._beingCreatedPaneView=new n(this,t),this._constructor=i,this._studyId=null,this._nonseriesdata=null,this._indexes=null,this._metaInfo=null,this._graphics=null,this._inputs=null}function n(t,e){l.call(this,t,e),this._lineRenderer1=new c,this._lineRenderer2=new c,this._medianRenderer=new h}function r(t,e){l.call(this,t,e)}var s=i(21).ensureNotNull,a=i(3).LineDataSource,l=i(12).LineSourcePaneView,c=i(146).VerticalLineRenderer,h=i(16).TrendLineRenderer,u=i(74).SelectionRenderer,d=i(8).CompositeRenderer,p=i(282),_=i(42).PlotList,f=i(45),m=i(9).propertyPages,g=i(18).LineEnd;inherit(o,a),o.prototype.pointsCount=function(){throw Error("Reimplement this in a child class")},o.prototype.title=function(){return this._metaInfo.description},o.prototype.studyId=function(){return this._metaInfo.id},o.prototype._requestStudy=function(){throw Error("Reimplement this in a child class")},o.prototype.changeStyles=function(){var t,e,o,n=i(119);if(this._inputs){t=n.splitInputs(this.properties().inputs.state()),e=t.obj;for(o in e)if(e[o]!==this._inputs[o]){this._inputs=e,this._requestStudy(),this._properties.lastUpdateTime.setValue((new Date).valueOf());break}}else t=n.splitInputs(this.properties().inputs.state()),this._inputs=TradingView.clone(t.obj),this._requestStudy(),this._properties.lastUpdateTime.setValue((new Date).valueOf())},o.prototype._checkTurnaround=function(t){return t===this._turnaround||t===this._model.mainSeries()._turnaround||t===this._model.mainSeries()._turnaround+"_"+this._turnaround},o.prototype.stop=function(){a.prototype.stop.call(this),this._studyId&&(this._model.chartApi().removeStudy(this._studyId),this.disconnect())},o.prototype.onData=function(t){throw Error("Reimplement this in a child class")},o.prototype._correctedPoint=function(t){var e=s(this._model.mainSeries().bars().firstIndex()),i=s(this._model.mainSeries().bars().lastIndex());return t.index=Math.max(t.index,e),t.index=Math.min(t.index,i),t},o.prototype.addPoint=function(t){return a.prototype.addPoint.call(this,this._correctedPoint(t))},o.prototype.setLastPoint=function(t){return a.prototype.setLastPoint.call(this,this._correctedPoint(t))},o.prototype.move=function(t){},o.prototype.clearData=function(){
void 0!==this.m_data&&(this.m_data=new _(this._plotFields)),this._nonseriesdata=null,this._indexes=null,this._graphics=new p(this._metaInfo),this.updateAllViews()},o.prototype.state=function(t){var e=a.prototype.state.call(this,t);return t&&(void 0!==this.m_data&&(e.data=this.m_data.state()),e.nonseriesdata=this._nonseriesdata,e.nonseriesindexes=this._indexes,e.graphics=this._graphics.graphics()),this.metaInfo()instanceof f?e.metaInfo=this.metaInfo().state():(e.metaInfo=$.extend({},this.metaInfo()),e.metaInfo.id=f.parseIdString(e.metaInfo.id+(e.metaInfo.version?"-"+e.metaInfo.version:"")).fullId),e},o.prototype.restoreData=function(t){void 0!==this.m_data&&void 0!==t.data&&this.m_data.restoreState(t.data),this._nonseriesdata=t.nonseriesdata?t.nonseriesdata:null,this._indexes=t.nonseriesindexes?t.nonseriesindexes:null,this._graphics.setGraphics(t.graphics?t.graphics:p.emptyGraphics())},o.prototype.setPoint=function(t,e){this._nonseriesdata=null,this._indexes=null,a.prototype.setPoint.call(this,t,this._correctedPoint(e))},o.prototype.disconnect=function(){this._studyId=0},o.prototype.graphics=function(){return this._graphics.graphics()},o.prototype.firstValue=function(){return this._model.mainSeries().firstValue()},o.prototype.metaInfo=function(){return this._metaInfo},o.prototype.getMinFirstBarIndexForPlot=function(){return-1/0},o.prototype.getInputsPropertyPage=function(){return m.StudyLineDataSourcePropertyPage},o.prototype.getStylesPropertyPage=function(){return m.StudyStylesPropertyPage},o.prototype.paneViews=function(t){var e=a.prototype.paneViews.call(this,t);return null!==e&&e.unshift(this._beingCreatedPaneView),e},inherit(n,l),n.prototype.renderer=function(){var t,e,i,o,n,r,s,a;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new d,this._points.length<2?t:this._source._nonseriesdata?t:this._source._graphics&&!this._source._graphics.isEmpty()?t:(e=this._points[0],i=this._points[1],o=this._model.timeScale().width(),n=this._source.priceScale().height(),r={},r.width=o,r.height=n,r.points=[e],r.color="#808080",r.linewidth=this._source._doNotNeedLine?0:1,r.linestyle=CanvasEx.LINESTYLE_SOLID,this._lineRenderer1.setData(r),t.append(this._lineRenderer1),s={},s.width=o,s.height=n,s.points=[i],s.color="#808080",s.linewidth=this._source._doNotNeedLine?0:1,s.linestyle=CanvasEx.LINESTYLE_SOLID,this._lineRenderer2.setData(s),t.append(this._lineRenderer2),a={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:"#808080",linewidth:this._source._doNotNeedLine?0:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:g.Normal,rightend:g.Normal},this._medianRenderer.setData(a),t.append(this._medianRenderer),t)},inherit(r,l),r.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t=new d;return this.isAnchorsRequired()&&(t.append(new u({points:this._points})),t.append(this.createLineAnchor({points:this._points}))),t},e.StudyLineDataSource=o,e.StudyLineDataSourcePaneView=r},,,,,,function(t,e,i){"use strict"
;function o(t){if(t=Math.abs(t),!a.isInteger(t)&&t>1&&(t=parseFloat((""+t).replace(/^.+\./,"0."))),0<t&&t<1){var e=(""+t).length-2;return Math.pow(10,e)}return 1}function n(t,e){var i,n,r,s,l,c;t.trigger("tvticker-beforechange"),i=t.data("TVTicker"),n=i&&i.step,r=0,r=i.parser?i.parser(t.val()):a.isInteger(n)?parseInt(t.val(),10):parseFloat(t.val()),isNaN(r)&&(r=0),s=o(n),l=Math.max(s,o(r)),c=e(r,l),i.formatter&&(c=i.formatter(c)),t.val(c),t.change()}function r(t){var e=t.data("TVTicker"),i=e&&e.step,o=e&&e.max;n(t,function(t,e){var n=(Math.round(t*e)+Math.round(i*e))/e;return void 0!==o&&null!==o&&o<n&&(n=t),n})}function s(t){var e=t.data("TVTicker"),i=e&&e.step,o=e&&e.min;n(t,function(t,e){var n=(Math.round(t*e)-Math.round(i*e))/e;return void 0!==o&&null!==o&&n<o&&(n=t),n})}var a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(22),i(433),a=i(34),l=i(1187),$.fn.TVTicker=function(t){return void 0===t&&(t={}),this.each(function(){var e,i,o,n=!1,a=$(this),c=a.data("TVTicker");c?n=!0:c={step:+a.data("step")||1},"step"in t&&(c.step=+t.step||c.step),"min"in t&&(c.min=t.min),"max"in t&&(c.max=t.max),"formatter"in t&&(c.formatter=t.formatter),"parser"in t&&(c.parser=t.parser),a.data("TVTicker",c),n||(e=$('<div class="tv-ticker">').appendTo(a.parent()),i=$('<div class="tv-ticker__btn tv-ticker__btn--up">').html(l).appendTo(e),o=$('<div class="tv-ticker__btn tv-ticker__btn--down">').html(l).appendTo(e),e.on("mousedown",function(t){t.preventDefault(),a.focus()}),i.click(function(){a.is(":disabled")||r(a)}),o.click(function(){a.is(":disabled")||s(a)}),a.keydown(function(t){a.is(":disabled")||(38===t.keyCode?i.addClass("i-active"):40===t.keyCode&&o.addClass("i-active"))}),a.keyup(function(t){a.is(":disabled")||(38===t.keyCode?(r(a),i.removeClass("i-active")):40===t.keyCode&&(s(a),o.removeClass("i-active")))}),a.mousewheel(function(t,e){e>0?i.click():o.click()}))})}},function(t,e){"use strict";function i(t,e){return t<e}function o(t,e,i,o,n){var r,s,a;for(void 0===o&&(o=0),void 0===n&&(n=t.length),r=n-o;0<r;)s=r>>1,a=o+s,i(t[a],e)?(o=a+1,r-=s+1):r=s;return o}function n(t,e,n,r){return void 0===n&&(n=0),void 0===r&&(r=t.length),o(t,e,i,n,r)}function r(t,e,i,o,n){var r,s,a;for(void 0===o&&(o=0),void 0===n&&(n=t.length),r=n-o;0<r;)s=r>>1,a=o+s,i(e,t[a])?r=s:(o=a+1,r-=s+1);return o}function s(t,e,o,n){return void 0===o&&(o=0),void 0===n&&(n=t.length),r(t,e,i,o,n)}function a(t,e,i,o,n){var r,s;for(void 0===o&&(o=0),void 0===n&&(n=t.length-1);o<=n;)if(r=o+n>>>1,(s=i(t[r],e))>0)o=r+1;else{if(!(s<0))return r;n=r-1}return-1}Object.defineProperty(e,"__esModule",{value:!0}),e.lowerbound=o,e.lowerbound_int=n,e.upperbound=r,e.upperbound_int=s,e.bSearch=a},function(t,e,i){"use strict";function o(t,e){var i=t.offset();e.localX=e.pageX-i.left,e.localY=e.pageY-i.top}function n(t,e,i,o){new c(t,e,i,o)}var r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),i(22),i(90),r=i(364),s=i(21),a=2,l=!1,c=function(){function t(t,e,i,o){this._clickCount=0,this._clickTimeoutId=null,this._touchContextMenuTimeout=null,this._lastTouchPosition={x:0,y:0
},this._mouseMoveStartPosition=null,this._cancelClick=!1,this._$target=t,this._handler=e,this._originalPreventDefault=i,this._preventDefault=!o&&i,this._verticalTouchScroll=o,this._init()}return t.prototype._mouseEnterHandler=function(t){this._$target.off("mousemove.chartgui"),this._$target.on("mousemove.chartgui",this._mouseMoveHandler.bind(this)),Modernizr.touch&&this._mouseMoveHandler(t),this._processEvent(t,this._handler.mouseEnterEvent),this._preventDefaultIfNeeded(t)},t.prototype._resetClickTimeout=function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null},t.prototype._mouseMoveHandler=function(t){l&&!Modernizr.touch||(this._processEvent(t,this._handler.mouseMoveEvent),this._preventDefaultIfNeeded(t))},t.prototype._mouseMoveWithDownHandler=function(t){var e,i,o,n,r,l,c;void 0===t.button&&(t.button=0),e=!1,i=Modernizr.touch||t.originalEvent.touches,i&&(this._fixMouseTouchEvent(t,t.originalEvent),t.clientX=t.pageX,t.clientY=t.pageY,this._verticalTouchScroll&&(o=Math.abs(.5*(t.pageX-this._lastTouchPosition.x)),n=Math.abs(t.pageY-this._lastTouchPosition.y),o<=n?(e=!0,this._preventDefault=!1):this._preventDefault=this._originalPreventDefault),this._lastTouchPosition.x=t.pageX,this._lastTouchPosition.y=t.pageY),r=s.ensure(this._mouseMoveStartPosition),l=Math.abs(r.x-t.pageX),c=Math.abs(r.y-t.pageY),l+c>5&&(this._cancelClick=!0,i&&this._clearContextMenuTimeout()),t.button===a||e||this._processEvent(t,this._handler.pressedMouseMoveEvent),this._preventDefaultIfNeeded(t)},t.prototype._mouseUpHandler=function(t){void 0===t.button&&(t.button=0),(Modernizr.touch||t.originalEvent.touches)&&(t.pageX=this._lastTouchPosition.x,t.pageY=this._lastTouchPosition.y,t.localX=this._lastTouchPosition.x,t.localY=this._lastTouchPosition.y,this._clearContextMenuTimeout()),this._mouseMoveStartPosition=null,l=!1,$(document.body).off("mousemove.chartgui"),$(document.body).off("mouseup.chartgui"),Modernizr.touch||t.originalEvent.touches?($(document.body).off("touchmove.chartgui"),$(document.body).off("touchend.chartgui"),this._mouseLeaveHandler(t)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui")),t.button!==a&&(this._processEvent(t,this._handler.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1?(this._processEvent(t,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()):this._cancelClick||this._processEvent(t,this._handler.mouseClickEvent)),this._preventDefaultIfNeeded(t),Modernizr.touch&&this._mouseLeaveHandler(t)},t.prototype._clearContextMenuTimeout=function(){null!==this._touchContextMenuTimeout&&(clearTimeout(this._touchContextMenuTimeout),this._touchContextMenuTimeout=null)},t.prototype._mouseDownHandler=function(t){if(void 0===t.button&&(t.button=0),this._cancelClick=!1,(Modernizr.touch||t.originalEvent.touches)&&(this._fixMouseTouchEvent(t,t.originalEvent),this._lastTouchPosition.x=t.pageX,this._lastTouchPosition.y=t.pageY,this._mouseEnterHandler(t)),
this._mouseMoveStartPosition={x:t.pageX,y:t.pageY},Modernizr.touch?($(document.body).off("touchmove.chartgui"),$(document.body).off("touchend.chartgui"),$(document.body).on("touchmove.chartgui",this._mouseMoveWithDownHandler.bind(this)),$(document.body).on("touchend.chartgui",this._mouseUpHandler.bind(this)),this._clearContextMenuTimeout(),this._touchContextMenuTimeout=setTimeout(this._contextMenuHandler.bind(this,t),500)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui"),$(document.body).on("mousemove.chartgui touchmove.chartgui",this._mouseMoveWithDownHandler.bind(this)),$(document.body).on("mouseup.chartgui touchend.chartgui",this._mouseUpHandler.bind(this))),l=!0,t.button!==a&&(this._processEvent(t,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500))),this._preventDefaultIfNeeded(t),this._preventDefault)try{window.focus()}catch(t){}},t.prototype._init=function(){var t=this;this._$target.mouseenter(this._mouseEnterHandler.bind(this)),this._$target.on("touchcancel",this._clearContextMenuTimeout.bind(this)),this._$target.on("touchstartoutside mousedownoutside",function(e){t._handler.mouseDownOutsideEvent&&t._handler.mouseDownOutsideEvent(e,t._$target)}),this._$target.mouseleave(this._mouseLeaveHandler.bind(this)),this._$target.contextMenu&&this._$target.contextMenu(this._contextMenuHandler.bind(this)),Modernizr.touch?(this._$target.on("touchstart.chartgui",this._mouseDownHandler.bind(this)),this._initGestureEvents()):this._$target.on("mousedown.chartgui touchstart.chartgui",this._mouseDownHandler.bind(this))},t.prototype._mouseLeaveHandler=function(t){this._$target.off("mousemove.chartgui touchmove.chartgui"),this._processEvent(t,this._handler.mouseLeaveEvent),this._preventDefaultIfNeeded(t)},t.prototype._contextMenuHandler=function(t){this._processEvent(t,this._handler.contextMenuEvent),this._preventDefaultIfNeeded(t),this._cancelClick=!0},t.prototype._processEvent=function(t,e){e&&(o(this._$target,t),e.call(this._handler,t,this._$target))},t.prototype._preventDefaultIfNeeded=function(t){this._preventDefault&&t.preventDefault()},t.prototype._initGestureEvents=function(){var t=this,e=new r(this._$target.get(0));e.get("pinch").set({enable:!0}),e.on("pinchstart",function(e){t._handler.gestureStartEvent&&t._handler.gestureStartEvent(e,t._$target),t._clearContextMenuTimeout()}),e.on("pinchmove",function(e){t._handler.gestureChangeEvent&&t._handler.gestureChangeEvent(e,t._$target)}),e.on("pinchend pinchcancel",function(e){t._handler.gestureEndEvent&&t._handler.gestureEndEvent(e,t._$target)})},t.prototype._fixMouseTouchEvent=function(t,e){var i=e.touches[0].pageX,o=e.touches[0].pageY;t.pageX=i,t.pageY=o,t.localX=i,t.localY=o},t}(),e.setMouseEventHandler=n},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(41),r=function(t){function e(e,i,o,n){var r=this;return i||(i=1),
"forex"!==o&&"cfd"!==o||!n?(r=t.call(this,1)||this,r._isForex=!1):(r=t.call(this,n)||this,r._isForex=!0),r._pipPriceScale=e,r._pipMinMove=i,r._pipMinMove2=n,r}return o.__extends(e,t),e.prototype.format=function(e,i,o){var n=this._isForex?this._pipMinMove2:this._pipMinMove;return void 0===n&&(n=NaN),t.prototype.format.call(this,e*this._pipPriceScale/n,i,o)},e}(n.PriceFormatter),e.PipFormatter=r},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(4),n=i(101),r=function(){function t(){this._data=null,this._hitTest=null}return t.prototype.setData=function(t){this._data=t},t.prototype.setHitTest=function(t){this._hitTest=t},t.prototype.draw=function(t){if(null!==this._data&&0!==this._data.points.length&&!(this._data.linewidth<=0)){var e=this._data.points[0].x;e<0||e>this._data.width||(t.translate(1,0),t.lineCap="square",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&n.setLineStyle(t,this._data.linestyle),n.drawLine(t,e,0,e,this._data.height))}},t.prototype.hitTest=function(t){if(null===this._data||0===this._data.points.length)return null;var e=this._hitTest||new o(o.MOVEPOINT);return Math.abs(t.x-this._data.points[0].x)<=3?e:null},t}(),e.VerticalLineRenderer=r},function(t,e,i){"use strict";var o=i(34),n=i(13),r=n.getLogger("Chart.PriceRange"),s=function(){function t(t,e){var i,o;null!==t&&"object"==typeof t?(i=t,this._minValue=i.m_minValue,this._maxValue=i.m_maxValue):(o=t,this._minValue=o,void 0!==e&&(this._maxValue=e))}return t.prototype.equals=function(t){return this._minValue===t._minValue&&this._maxValue===t._maxValue},t.prototype.clone=function(){return new t(this._minValue,this._maxValue)},t.prototype.minValue=function(){return this._minValue},t.prototype.setMinValue=function(t){this._minValue=t},t.prototype.maxValue=function(){return this._maxValue},t.prototype.setMaxValue=function(t){this._maxValue=t},t.prototype.length=function(){return this._maxValue-this._minValue},t.prototype.isEmpty=function(){return this._maxValue===this._minValue||this._maxValue!==this._maxValue||this._minValue!==this._minValue},t.prototype.serialize=function(){return{m_maxValue:this._maxValue,m_minValue:this._minValue}},t.prototype.state=function(){return{max:this._maxValue,min:this._minValue}},t.prototype.merge=function(e){return new t(Math.min(this.minValue(),e.minValue()),Math.max(this.maxValue(),e.maxValue()))},t.prototype.apply=function(t,e){this._minValue=Math.min(this._minValue,t),this._maxValue=Math.max(this._maxValue,e)},t.prototype.set=function(t,e){this._minValue=t,this._maxValue=e},t.prototype.scaleAroundCenter=function(t){var e,i,n,s;if(!o.isNumber(t))return void r.logDebug("PriceRange.scaleAroundCenter: invalid coeff");0!==(e=this._maxValue-this._minValue)&&(i=.5*(this._maxValue+this._minValue),n=this._maxValue-i,s=this._minValue-i,n*=t,s*=t,this._maxValue=i+n,this._minValue=i+s)},t.prototype.shift=function(t){if(!o.isNumber(t))return void r.logDebug("PriceRange.shift: invalid coeff");this._maxValue+=t,this._minValue+=t},
t.prototype.convertToPercent=function(t,e){return 100*(t-e)/e},t.prototype.convertFromPercent=function(t,e){return t/100*e+e},t.prototype.convertToPercents=function(e){return new t(100*(this._minValue-e)/e,100*(this._maxValue-e)/e)},t.prototype.convertFromPercents=function(e){return new t(this._minValue/100*e+e,this._maxValue/100*e+e)},t}();t.exports=s},,,,,,,,,,,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LEFT_ARROW=37,e.UP_ARROW=38,e.RIGHT_ARROW=39,e.DOWN_ARROW=40,e.ENTER=13,e.ESC=27,e.SPACE=32},,,function(t,e,i){"use strict";t.exports=i(389)},,function(t,e,i){"use strict";function o(t,e){var o=e||new c("linetoolarrowmark");l.call(this,t,o),i.e(1,function(e){var o=i(418).TextPaneView,n=i(416).MarkPaneView,r=[new n(this,t,this.image,this.width,this.height,this.offsetX,this.offsetY)],s=this._createTextPaneView(o);null!==s&&r.push(s),this._setPaneViews(r)}.bind(this))}function n(t,e){this._constructor="LineToolArrowMarkLeft",o.call(this,t,e)}function r(t,e){this._constructor="LineToolArrowMarkUp",o.call(this,t,e)}function s(t,e){this._constructor="LineToolArrowMarkRight",o.call(this,t,e)}function a(t,e){this._constructor="LineToolArrowMarkDown",o.call(this,t,e)}var l=i(3).LineDataSource,c=i(11).DefaultProperty,h=i(9).propertyPages;inherit(o,l),o.prototype.width=21,o.prototype.height=21,o.prototype.offsetX=0,o.prototype.offsetY=0,o.prototype.paneViews=function(t){var e=l.prototype.paneViews.call(this,t);return null!==e&&this._textPaneView&&e.push(this._textPaneView),e},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Arrow Mark"},o.prototype.getStylesPropertyPage=function(){return h.LineToolArrowMarkStylesPropertyPage},o.prototype._createTextPaneView=function(t){return null},inherit(n,o),n.prototype.image=new Image,n.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==",n.prototype.offsetX=1,n.prototype.offsetY=-10,n.prototype.title=function(){return"Arrow Mark Left"},n.prototype._createTextPaneView=function(t){var e=new t(this,this._model,22,-3,"middle","left");return e.disableSelection(),e},inherit(r,o),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"Arrow Mark Up"},r.prototype._createTextPaneView=function(t){var e=new t(this,this._model,0,18,"top","center");return e.disableSelection(),e},inherit(s,o),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"Arrow Mark Right"},s.prototype._createTextPaneView=function(t){var e=new t(this,this._model,-22,-3,"middle","right");return e.disableSelection(),e},inherit(a,o),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"Arrow Mark Down"},
a.prototype._createTextPaneView=function(t){var e=new t(this,this._model,0,-23,"bottom","center");return e.disableSelection(),e},s.prototype.version=n.prototype.version=a.prototype.version=r.prototype.version=2,e.LineToolArrowMark=o,e.LineToolArrowMarkLeft=n,e.LineToolArrowMarkRight=s,e.LineToolArrowMarkUp=r,e.LineToolArrowMarkDown=a},function(t,e,i){"use strict";function o(t){this._data=null,this._hittest=t||new a(a.MOVEPOINT),this._backHittest=new a(a.MOVEPOINT_BACKGROUND),this._points=[]}var n=i(49).pointInPolygon,r=i(33).distanceToSegment,s=i(16).TrendLineRenderer,a=i(4),l=i(19),c=i(18).LineEnd;o.prototype.setData=function(t){this._data=t,this._points=t.points},o.prototype.draw=function(t){var e,i,o;if(null!==this._data&&0!==this._points.length){for(t.beginPath(),t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._points[0],t.moveTo(e.x,e.y),i=0;i<this._points.length;i++)o=this._points[i],t.lineTo(o.x,o.y);this._data.filled&&this._data.fillBackground&&(t.fillStyle=l.generateColor(this._data.backcolor,this._data.transparency),t.fill()),this._data.filled&&!this._data.skipClosePath&&t.closePath(),this._data.linewidth>0&&t.stroke(),this._points.length>1&&(this._data.leftend===c.Arrow&&s.prototype.drawArrow(this._points[1],this._points[0],t,t.lineWidth),this._data.rightend===c.Arrow&&s.prototype.drawArrow(this._points[this._points.length-2],this._points[this._points.length-1],t,t.lineWidth))}},o.prototype.hitTest=function(t){var e,i,o,s,a;if(null===this._data||void 0!==this._data.mouseTouchable&&!this._data.mouseTouchable)return null;for(e=TradingView.isMobile.any()?24:3,i=1;i<this._points.length;i++)if(o=this._points[i-1],s=this._points[i],a=r(o,s,t),a.distance<=e)return this._hittest;return this._data.filled&&this._data.fillBackground&&this._points.length>0&&(o=this._points[0],s=this._points[this._points.length-1],a=r(o,s,t),a.distance<=e)?this._hittest:this._data.filled&&this._data.fillBackground&&n(t,this._data.points)?this._backHittest:null},t.exports=o},,,,,,function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(34),String.prototype.left=function(t){if(!o.isInteger(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(0,t)},String.prototype.right=function(t){if(!o.isInteger(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(this.length-t,this.length)},String.prototype.trimmed=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")},String.prototype.startsWith=function(t){return!(t.length>this.length)&&this.left(t.length)===t},n=/{(\w+)}/g,r=/{(\d+)}/g,String.prototype.format=function(){var t,e,i,s,a=[];for(t=0;t<arguments.length;t++)a[t]=arguments[t];return e=o.isObject(a[0]),i=e?n:r,s=e?function(t,e){var i=a[0];return void 0!==i[e]?i[e]:t}:function(t,e){var i=parseInt(e,10),o=a[i];return void 0!==o?o:t},this.replace(i,s)}},function(t,e,i){"use strict";function o(t,e){t.width=e.w,t.height=e.h
;var i=t.getContext("2d");i&&i.translate(.5,.5)}function n(t,e){t.width=0,o(t,e)}function r(t,e,i,o,n,r){t.save(),t.translate(-.5,-.5),t.fillStyle=r,t.fillRect(e,i,o,n),t.restore()}function s(t,e){var i=document.createElement("canvas");return t.append(i),o(i,e),i}Object.defineProperty(e,"__esModule",{value:!0}),i(22);var a=function(){function t(t,e){this.w=t,this.h=e}return t.prototype.equals=function(t){return this.w===t.w&&this.h===t.h},t}();e.Size=a,e.resizeCanvas=o,e.hardResizeCanvas=n,e.clearRect=r,e.addCanvasTo=s},function(t,e,i){"use strict";function o(t,e,o,n){return new Promise(function(r){i.e(9,function(s){var a=i(396),l=new a(t,e,n);l.show(o),r(l)})})}Object.defineProperty(e,"__esModule",{value:!0}),e.showEditObjectDialog=o},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(174),n=i(228),r=function(){function t(t){void 0===t&&(t=!1),this._dwm=t}return t.prototype.format=function(t){var e=(new n.DateFormatter).format(t);return this._dwm||(e+=" "+(new o.TimeFormatter).format(t)),e},t.prototype.formatLocal=function(t){var e=(new n.DateFormatter).formatLocal(t);return this._dwm||(e+=" "+(new o.TimeFormatter).formatLocal(t)),e},t}(),e.DateTimeFormatter=r},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(41),n=function(){function t(t){this._formatStr=t||"%h:%m:%s"}return t.prototype.format=function(t){return o.customFormatters.timeFormatter?o.customFormatters.timeFormatter.format(t):this._formatStr.replace("%h",o.numberToStringWithLeadingZero(t.getUTCHours(),2)).replace("%m",o.numberToStringWithLeadingZero(t.getUTCMinutes(),2)).replace("%s",o.numberToStringWithLeadingZero(t.getUTCSeconds(),2))},t.prototype.formatLocal=function(t){return o.customFormatters.timeFormatter?o.customFormatters.timeFormatter.formatLocal?o.customFormatters.timeFormatter.formatLocal(t):o.customFormatters.timeFormatter.format(t):this._formatStr.replace("%h",o.numberToStringWithLeadingZero(t.getHours(),2)).replace("%m",o.numberToStringWithLeadingZero(t.getMinutes(),2)).replace("%s",o.numberToStringWithLeadingZero(t.getSeconds(),2))},t}(),e.TimeFormatter=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(23);var o=function(){function t(){}return t.prototype.format=function(t){var e,i,o,n,r=t<0;return t=Math.abs(t),e=Math.floor(t/86400),t-=86400*e,i=Math.floor(t/3600),t-=3600*i,o=Math.floor(t/60),t-=60*o,n="",e&&(n+=e+$.t("d",{context:"dates"})+" "),i&&(n+=i+$.t("h",{context:"dates"})+" "),o&&(n+=o+$.t("m",{context:"dates"})+" "),t&&(n+=t+$.t("s",{context:"dates"})+" "),r&&(n="-"+n),n.trim()},t}();e.TimeSpanFormatter=o},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){void 0===e&&(e=!0),this._customFlags={},this._text=t,this._executeOnPush=e}return t.prototype.text=function(){return this._text},t.prototype.executeOnPush=function(){return this._executeOnPush},t.prototype.customFlag=function(t){return this._customFlags[t]},t.prototype.setCustomFlag=function(t,e){
this._customFlags[t]=e},t}();e.UndoCommand=i},function(t,e,i){"use strict";function o(t,e){var i,o,n;return void 0===e&&(e=!1),i=t.data("commonTooltipText")||"",o=t.attr("title"),i||o||e?(i=s(t),n={h:t.outerHeight(),w:t.outerWidth(),x:t.offset().left-$(window).scrollLeft(),y:t.offset().top-$(window).scrollTop()},{above:t.hasClass("common-tooltip-above"),below:t.hasClass("common-tooltip-below"),html:t.hasClass("common-tooltip-html"),otl:t.hasClass("common-tooltip-otl"),otr:t.hasClass("common-tooltip-otr"),fixed:t.hasClass("common-tooltip-fixed"),rect:n,text:i,vertical:t.hasClass("common-tooltip-vertical"),tooltipDelay:parseInt(t.attr("data-tooltip-delay"))}):null}function n(t){var e=-1!==g.indexOf(t)?m[t]:"";d.removeClass(g.filter(function(t){return!!t}).map(function(t){return m[t]}).join(" ")),e&&!d.hasClass(e)&&d.addClass(e)}function r(t){var e,i,o,n,r=t.rect;r&&(d.attr("class","common-tooltip-wrapper").css({bottom:"auto",left:"auto",right:"auto",top:"auto"}),Modernizr.pointerevents||d.addClass("no-pointer-events"),d.toggleClass("pointer-events-auto",!!t.pointerEventsAuto),p.css({left:"0",width:"auto"}),p.width(p.width()+2),e=$(window).width(),i=$(window).height(),o=t.vertical,(o&&r.w<20||!o&&r.h<20)&&d.addClass("farther"),n="",o?(d.addClass("vertical").css({left:r.x+r.w,top:r.y-(d.outerHeight()-r.h)/2}),n=t.otr?"otr":t.otl||p.offset().left+p.outerWidth()+u>e?"otl":"otr","otl"===n?d.addClass("otl").css({left:"auto",right:e-r.x}):d.addClass("otr")):(d.css({bottom:i-r.y,left:r.x-(d.outerWidth()-r.w)/2}),n=t.above?"above":t.below||p.offset().top-$(window).scrollTop()<u?"below":"above","below"===n?d.addClass("below").css({bottom:"auto",top:r.y+r.h}):d.addClass("above"),p.offset().left-u<0?p.css("left",Math.abs(p.offset().left)+u):p.offset().left+p.outerWidth()+u>e&&(t.fixed||p.css("left",e-(p.offset().left+p.outerWidth()+u)))))}function s(t){var e=t.data("commonTooltipText")||"",i=t.attr("title");return void 0!==i&&(e=i,t.data("commonTooltipText",e),t.removeAttr("title")),e}function a(){clearTimeout(_),clearTimeout(f),document.body.contains(d[0])&&(d.css("opacity","0"),f=setTimeout(d.detach.bind(d),h/2))}function l(t,e){var i,n;void 0===e&&(e={}),i=$(t),0!==i.length&&(n=!(!e.text&&!e.$inner),e=$.extend({},o(i,n),e),$.isEmptyObject(e)||""===e.text&&!e.$inner||c(e))}function c(t){var e=document.body.contains(d[0]);if(clearTimeout(_),clearTimeout(f),!e)return void(_=setTimeout(function(){d.appendTo(document.body),c(t)},"number"!=typeof t.tooltipDelay||isNaN(t.tooltipDelay)?h:t.tooltipDelay));p.toggleClass("common-tooltip-body--width_wide",!!t.wide),t.$inner?p.empty().append(t.$inner):t.html?p.html(t.text||""):p.text(t.text||""),r(t),n(t.colorTheme||"default"),d.addClass(t.addClass||""),d.css("opacity","1"),t.forceHideOnMove&&$(document).on("mousemove.common-tooltip-force-hide",function(){$(document).off("mousemove.common-tooltip-force-hide"),a()})}var h,u,d,p,_,f,m,g;Object.defineProperty(e,"__esModule",{value:!0}),i(649),i(22),i(90),h=500,u=10,d=$("<div>").css("opacity","0"),
p=$('<div class="common-tooltip-body">').appendTo(d),_=0,f=0,m={default:"",white:"theme-white"},g=Object.keys(m),e.updateTooltipText=s,e.hide=a,e.showOnElement=l,e.show=c,Modernizr.touch||$(document).on("mouseenter",".apply-common-tooltip",function(t){var e,i,o,n=t.originalEvent;if("buttons"in n){if(1&n.buttons)return}else if(1===t.which)return;e=$(this),i=function(){l(e)},i(),o=function(){e.off("common-tooltip-update",i),e.off("mouseleave mousedown",o),$(document).off("scroll",o),a()},e.on("common-tooltip-update",i),e.on("mouseleave mousedown",o),$(document).on("scroll",o)})},function(t,e,i){"use strict";function o(t){var e=(""+t).match(/(.*)([DWM])/);return e?e[1]+$.t(e[2],{context:"interval_short"}):t}Object.defineProperty(e,"__esModule",{value:!0}),i(23),e.translatedIntervalString=o},function(t,e,i){"use strict";function o(t){return t in $.fn?Promise.resolve():(r||(r=new Promise(function(t){i.e(8,function(e){i(502),t()})})),r)}function n(t){return new s(t)}var r,s;Object.defineProperty(e,"__esModule",{value:!0}),i(22),s=function(){function t(t){this._$elem=t}return t.prototype.draggable=function(){var t=arguments,e=this._$elem;return o("draggable").then(function(){return e.draggable.apply(e,t)})},t.prototype.resizable=function(){var t=arguments,e=this._$elem;return o("resizable").then(function(){return e.resizable.apply(e,t)})},t.prototype.sortable=function(){var t=arguments,e=this._$elem;return o("sortable").then(function(){return e.sortable.apply(e,t)})},t.prototype.datepicker=function(){var t=arguments,e=this._$elem;return o("datepicker").then(function(){return e.datepicker.apply(e,t)})},t}(),e.LazyJqueryUI=s,e.lazyJqueryUI=n},function(t,e,i){"use strict";function o(t){for(var e=0;e<c.length;e++)if(c[e].name===t)return e;return-1}function n(t,e){var i={name:t,func:e},n=o(i.name);n>-1?c[n]=i:c.push(i)}function r(t){c.forEach(function(e,i){e.name===t&&c.splice(i,1)})}function s(t,e){var i={name:t,func:e},n=o(i.name);n>-1&&c.splice(n,1),c.unshift(i)}function a(){h=!0}function l(){h=!1}var c,h;Object.defineProperty(e,"__esModule",{value:!0}),i(22),c=[],h=!1,$(window).on("keypress",function(t){if(!h)for(var e=c.length-1;e>=0&&!0!==c[e].func(t);e--);}),e.registerListener=n,e.removeListener=r,e.pushBackListener=s,e.disable=a,e.enable=l},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(170);!function(t){function e(t,e){s[t]||(s[t]=[]),s[t].push(e)}function i(t,e){if(s[t]){var i=s[t].indexOf(e);-1!==i&&(1===s[t].length?delete s[t]:s[t].splice(i,1))}}function o(t){return TVLocalStorage.getItem(r+t)}function n(t,e){void 0===e&&(e=(new Date).valueOf()),e!==TVLocalStorage.getItem(r+t)&&TVLocalStorage.setItem(r+t,e)}var r="tvxwevents.",s={};window.addEventListener("storage",function(t){if(null!==t.newValue){var e=t.key;e&&e.startsWith(r)&&(e=e.substr(r.length),s[e]&&s[e].forEach(function(e){e.call(t.newValue,t.newValue)}))}}),t.on=e,t.off=i,t.current=o,t.emit=n}(e.TVXWindowEvents||(e.TVXWindowEvents={}))},,,,,,,,,function(t,e,i){"use strict";function o(){v.fire()}
var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y;Object.defineProperty(e,"__esModule",{value:!0}),n=i(5),i(90),r=i(2),s=i(288),a=i(26),l=i(20),c=i(107),h=i(1180),u=i(672),function(t){t[t.ToLeft=0]="ToLeft",t[t.ToRight=1]="ToRight",t[t.None=2]="None"}(d=e.DirectionHorz||(e.DirectionHorz={})),function(t){t[t.ToTop=0]="ToTop",t[t.ToBottom=1]="ToBottom",t[t.None=2]="None"}(p=e.DirectionVert||(e.DirectionVert={})),_=0,f=d.ToRight,m=p.ToBottom,g=5,v=new l,e.globalClosePopupMenu=o,y=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClose=function(){i.props.onClose()},i._handleClickOutside=function(t){var e=i.props,o=e.closeOnClickOutside,n=e.onClickOutside;n&&n(t),o&&i._handleClose()},i._handleMeasure=function(t){var e=t.height,o=t.width,n=i.props,r=n.directionHorz,s=void 0===r?f:r,a=n.directionVert,l=void 0===a?m:a,c=n.position,h=window.innerHeight,u=window.innerWidth,_=h-2*g,v="function"==typeof c?c():c,y=Math.max(g,v.x-Math.max(0,o-(s===d.ToLeft?0:u-v.x-g))),b=Math.max(g,v.y-Math.max(0,e-(l===p.ToTop?0:h-v.y-g)));i.setState({appearingContentHeight:e,appearingDirectionHorz:s,appearingDirectionVert:e>_?p.None:l,appearingMenuHeight:Math.min(e,_),appearingPosition:{x:y,y:b},isMeasureValid:!0})},i._key=_+++"",i.state={appearingContentHeight:0,appearingMenuHeight:0},i}return n.__extends(e,t),e.prototype.componentWillReceiveProps=function(t){this.props.isOpened&&!t.isOpened&&this.setState({isMeasureValid:void 0})},e.prototype.componentDidUpdate=function(t,e){t.isOpened&&!this.props.isOpened&&v.unsubscribe(this,this._handleClose),!t.isOpened&&this.props.isOpened&&v.subscribe(this,this._handleClose)},e.prototype.componentWillUnmount=function(){v.unsubscribe(this,this._handleClose)},e.prototype.render=function(){var t,e=this.props,i=e.isOpened,o=e.items,l=e.minWidth,h=e.directionHorz,_=void 0===h?f:h,g=e.directionVert,v=void 0===g?m:g,y=e.positionType,b=this.state,S=b.appearingContentHeight,w=b.appearingDirectionHorz,T=void 0===w?_:w,x=b.appearingDirectionVert,C=void 0===x?v:x,P=b.appearingMenuHeight,L=b.appearingPosition,I=b.isMeasureValid,k="to"+(T!==d.None?d[T].replace("To",""):"")+(C!==p.None?p[C].replace("To",""):"");return this._wrapOrNot(i?r.createElement("div",{key:this._key,className:a(u.menuWrap,u[k],(t={},t[u.isMeasuring]=!I,t)),style:n.__assign({position:y},I?{left:L&&L.x,top:L&&L.y,height:P}:{})},r.createElement(c.OutsideEvent,{handler:this._handleClickOutside,mouseDown:!0,touchStart:!0},r.createElement("div",{className:u.menu,style:{height:I&&P,minWidth:l,overflowY:I&&(S||0)>(P||0)?"scroll":"auto"}},r.createElement(s,{onMeasure:this._handleMeasure,shouldMeasure:!I,whitelist:["height","width"]},r.createElement("div",{className:u.menuBox},o.map(function(t,e){return t&&r.cloneElement(t,{key:e})})))))):null)},e.prototype._wrapOrNot=function(t){return"fixed"!==this.props.positionType||this.props.testingModeNoOutsideRender?t:r.createElement(h.OutsideRenderWrap,null,t)},e.defaultProps={closeOnClickOutside:!0,directionHorz:f,directionVert:m,positionType:"fixed"},e}(r.PureComponent),e.PopupMenu=y},,,function(t,e,i){
"use strict";function o(){return[[1,0,0],[0,1,0],[0,0,1]]}function n(t,e){var i,o,n,r=[[0,0,0],[0,0,0],[0,0,0]];for(i=0;i<3;i++)for(o=0;o<3;o++)for(n=0;n<3;n++)r[i][o]+=t[i][n]*e[n][o];return r}function r(t){var e=Math.cos(t),i=Math.sin(t);return[[e,-i,0],[i,e,0],[0,0,1]]}function s(t,e){return[[t,0,0],[0,e,0],[0,0,1]]}function a(t,e){return[[1,0,t],[0,1,e],[0,0,1]]}function l(t,e){var i,o,n=[e.x,e.y,1],r=[0,0,0];for(i=0;i<3;i++)for(o=0;o<3;o++)r[i]+=n[o]*t[i][o];return new c.Point(r[0],r[1])}Object.defineProperty(e,"__esModule",{value:!0});var c=i(1);e.identityMatrix=o,e.multiplyMatrices=n,e.rotationMatrix=r,e.scalingMatrix=s,e.translationMatrix=a,e.transformPoint=l},,,,,,,function(t,e){},,,function(t,e,i){"use strict";function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.createDialog)(n({},s,t))}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},e.createNoticeDialog=o,r=i(96),s={width:400,destroyOnClose:!0,title:$.t("Notification"),content:$.t("You are notified"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',actions:[{name:"ok",type:"primary",text:$.t("Ok"),method:"close",key:[13,32]}]}},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(703),Object.defineProperty(e,"AutocompleteField",{enumerable:!0,get:function(){return o.AutocompleteField}}),n=i(704),Object.defineProperty(e,"CheckboxField",{enumerable:!0,get:function(){return n.CheckboxField}}),r=i(706),Object.defineProperty(e,"InputField",{enumerable:!0,get:function(){return r.InputField}}),s=i(705),Object.defineProperty(e,"InputFieldRegExp",{enumerable:!0,get:function(){return s.InputFieldRegExp}}),a=i(707),Object.defineProperty(e,"SaveRenameDialog",{enumerable:!0,get:function(){return a.SaveRenameDialog}})},function(t,e,i){"use strict";var o=i(206),n=i(144).setMouseEventHandler,r={};r.createLabel=function(t,e,i){return o.create("label",$.extend(i,{html:e,for:t}))},r.unbindContextMenu=function(t){t.contextMenu(function(t){return!1})},r.offsetX=function(t,e){return t.width()+e.pageX},r.offsetY=function(t,e){return t.height()+e.pageY},r.isElementInViewport=function(t){"function"==typeof jQuery&&t instanceof jQuery&&(t=t[0]);var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)},r.isVisible=function(t,e,i){var o,n,r;for("function"==typeof jQuery&&t instanceof jQuery&&(t=t[0]),o=.01,e||(e=1),i||(i=1),n=t.getBoundingClientRect(),r=[];t.parentElement;)r.push(t.parentElement.getBoundingClientRect()),t=t.parentElement;return r.every(function(t){
var r=Math.min(n.right,t.right)-Math.max(n.left,t.left),s=Math.min(n.bottom,t.bottom)-Math.max(n.top,t.top),a=r/n.width*100,l=s/n.height*100;return a+o>e&&l+o>i})},r.checkObjIsOutOfWindowX=function(t,e){var i,o=$(window).width()-r.offsetX(t,e);return o<0?(i=e.pageX+o,i>0?i:0):e.pageX},r.checkObjIsOutOfWindowY=function(t,e){var i,o=$(window).height()-r.offsetY(t,e);return o<0?(i=e.pageY+o,i>0?i:0):e.pageY},r.checkObjIsOutOfWindow=function(t,e){return{left:r.checkObjIsOutOfWindowX(t,e),top:r.checkObjIsOutOfWindowY(t,e)}},r.setAttr=function(t,e,i){return t.attr?t.attr(e,i):t[e]=i,t},r.removeAttr=function(t,e){return t.removeAttr?t.removeAttr(e):t.removeAttribute(e),t},r.notNull=function(t){return-1===$.inArray(t,[null,void 0,"false","null","undefined",0])},r.hideControl=function(t){return t.css({position:"absolute",top:-1e3,left:-1e3})},r.createPopup=function(t,e,i){return new r.Popup(t,e,i).render()},r.Popup=function(t,e,i){if(void 0!==t.selector?this.jqDiv=t:t.nodeType?this.jqDiv=$(t):this.jqDiv=o.create("div",t),i){var r=this;$.each(i,function(t,e){r[t]=e})}n(this.jqDiv,this),this._callback=e},r.Popup.prototype.render=function(){return this.jqDiv},r.Popup.prototype.show=function(){this.jqDiv.show()},r.Popup.prototype.hide=function(){this.jqDiv.hide()},r.Popup.prototype.setVisible=function(t){t?this.show():this.hide()},r.Popup.prototype.isVisible=function(){return this.jqDiv.is(":visible")},r.Popup.prototype.contextMenuEvent=function(t){return!1},r.Popup.prototype.mouseDownOutsideEvent=function(t){if(this.isVisible()){if(this._callback&&!this._callback())return;this.hide()}},t.exports=r},function(t,e){"use strict";var i={};i.renderAttributes=function(t){var e,i="";for(e in t)t[e]&&(i+=" "+e+'="'+t[e]+'"');return i},i.create=function(t,e){var i=$(document.createElement(t));return e&&(e.html&&(i.html(e.html),delete e.html),i.attr(e)),i},i.validAttributes=["abbr","accept-charset","accept","accesskey","action","align","alink","alt","archive","axis","background","bgcolor","border","cellpadding","cellspacing","char","charoff","charset","checked","cite","class","classid","clear","code","codebase","codetype","color","cols","colspan","compact","content","coords","data","datetime","declare","defer","dir","disabled","enctype","face","for","frame","frameborder","headers","height","href","hreflang","hspace","http-equiv","id","ismap","label","lang","language","link","longdesc","marginheight","marginwidth","maxlength","media","method","multiple","name","nohref","noresize","noshade","nowrap","object","onblur","onchange","onclick","ondblclick","onfocus","onkeydown","onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onreset","onselect","onsubmit","onunload","profile","prompt","readonly","rel","rev","rows","rowspan","rules","scheme","scope","scrolling","selected","shape","size","span","src","standby","start","style","summary","tabindex","target","text","title","type","usemap","valign","value","valuetype","version","vlink","vspace","width"],i.validAttribute=function(t){
return-1!==jQuery.inArray(t,i.validAttributes)},i.cleanAttributes=function(t){return jQuery.each(t,function(e,o){i.validAttribute(e)||delete t[e]}),t},t.exports=i},function(t,e,i){(function(t){"use strict";function o(e,i,o){var n,r,s,a,l,c,h=this;if(this._options=$.extend({},this._defaultOptions,o||{}),this._$wrapper=e,this._$content=i,this._scroll_speed=40,this._shadow_offset=10,this._header_height=this._options.headerHeight,this._scroll_margin_top=this._options.scrollMarginTop,this.scrolled=new t,this.scrolltoend=new t,this.scrolltostart=new t,this.visibilityCallbacks=[],n=navigator.platform.toLowerCase(),r=navigator.userAgent.toLowerCase(),s=r.indexOf("firefox")>-1,a=n.indexOf("android")>-1||r.indexOf("android")>-1,this._touch=Modernizr.touch||navigator.msMaxTouchPoints||s&&a,this._touch)return this._$content.css("position","relative"),void this._$wrapper.css({"overflow-y":"auto","-webkit-overflow-scrolling":"touch","-ms-overflow-style":"-ms-autohiding-scrollbar"}).scroll(this._onScroll.bind(this));this._$wrapper.css("overflow","hidden"),this._$wrapper.on("mouseenter.sidebar-scroll",function(){h._bottomFixed||h._dragging||(h._options.alwaysVisible||h._$scrollBar.addClass("active"),h._onScroll())}).on("mouseleave.sidebar-scroll",function(){h._bottomFixed||h._dragging||(h._options.alwaysVisible||h._$scrollBar.removeClass("active"),h._onScroll())}).on("mousewheel.sidebar-scroll",function(t,e){if(!t.isDefaultPrevented())return h.scroll(e,"MozMousePixelScroll"===t.originalEvent.type?2:null)}),!1!==this._options.showTopShadow&&(this._$shadowTop=$('<div class="sb-inner-shadow top i-invisible">').appendTo(this._$wrapper)),!1!==this._options.showBottomShadow&&(this._$shadowBottom=$('<div class="sb-inner-shadow">').appendTo(this._$wrapper)),this._$shadowTop&&this._header_height&&this._$shadowTop.css("top",this._header_height-this._shadow_offset),l=this._options.additionalClass?" "+this._options.additionalClass:"",c=this._options.alwaysVisible?" active-always":"",this._$scrollBarWrapper=$('<div class="sb-scrollbar-wrap">').appendTo(this._$wrapper),this._$scrollBar=$('<div class="sb-scrollbar sb-scrollbar-body'+l+c+'"></div>').appendTo(this._$scrollBarWrapper),this._onScroll()}var n=i(179).lazyJqueryUI;o.prototype.isTouch=function(){return this._touch},o.prototype.getScrollBar=function(){return this._$scrollBar},o.prototype._defaultOptions={headerHeight:0,additionalClass:"",alwaysVisible:!1,showBottomShadow:!0,scrollMarginTop:1,bubbleScrollEvent:!1},o.prototype.initDraggable=function(){if(this._dragInitialized)return this;var t=this;return n(this._$scrollBar).draggable({axis:"y",containment:this._$scrollBarWrapper,start:function(){t._dragging=!0},stop:function(){t._dragging=!1},drag:function(e,i){t.updateScroll()}}),this._dragInitialized=!0,this},o.prototype.updateScroll=function(){var t,e,i,o,n;return this._touch?this:(t=1,e=Math.ceil(this._$scrollBar.position().top-this._scroll_margin_top-this._header_height),i=this.getContainerHeightWithoutHeader(),o=this._$content.outerHeight(),n=o-i-t,
i<=0?this:(this._scroll_target_top=n<=0?this._header_height:Math.min(-e*o/i+this._header_height,this._header_height),e+this._$scrollBar.height()+2>=i?this.scrollToEnd():(this._$content.css("top",this._scroll_target_top+"px"),this._onScroll()),this))},o.prototype.getContainerHeightWithoutHeader=function(){return this._$wrapper[0].getBoundingClientRect().height-this._header_height},o.prototype.getContainerHeight=function(){return this._$wrapper[0].getBoundingClientRect().height},o.prototype.getContentHeight=function(){return this._$content[0].getBoundingClientRect().height},o.prototype.updateScrollBar=function(){var t,e,i,o,n,r,s,a,l;return this._touch?this:(t=1,e=this._$content.position().top,i=this.getContentHeight(),o=this.getContainerHeight(),n=this.getContainerHeightWithoutHeader(),r=t+this._header_height,s=n-2*t,a=(Math.abs(e)-this._header_height)*s/i,l=o*o/i,this.isContentShort()?(this._$scrollBar.addClass("js-hidden"),this._$wrapper.removeClass("sb-scroll-active")):(this._$scrollBar.removeClass("js-hidden").height(l).css("top",r+a),this._$wrapper.addClass("sb-scroll-active"),this.initDraggable()),this)},o.prototype.scroll=function(t,e){var i,o,n,r,s;return this._touch?this:(i=this._$content.position().top,o=this._$content.outerHeight(),n=this.getContainerHeightWithoutHeader(),r=o-n-1,s=e||this._scroll_speed,r<=0||(this._scroll_target_top=Math.max(-r+this._header_height,Math.min(this._header_height,i+t*s)),this.setContentTop(this._scroll_target_top),this._onScroll()))},o.prototype.animateTo=function(t){var e,i,o;return this._touch?this:(e=this._$content.outerHeight(),i=this.getContainerHeightWithoutHeader(),(o=e-i-1)<=0||(this._scroll_target_top=Math.max(-o+this._header_height,Math.min(this._header_height,-t)),void this._$content.animate({top:this._scroll_target_top},500,function(){this._onScroll()}.bind(this))))},o.prototype.resize=function(){var t,e;if(!this._bottomFixed){if(t=this._$content.outerHeight(),e=this._$wrapper.outerHeight(),!this._options.vAlignBottom&&t<e)return void(this.atStart()||this.scrollToStart());this.atEnd()?this.scrollToEnd():"number"==typeof this._stickyBottom&&this.setContentTop(Math.min(0,this._stickyBottom+this._$wrapper.outerHeight()-this._$content.outerHeight()))}},o.prototype.resizeHeader=function(t){var e=t-this._header_height;this._header_height=t,this._scroll_target_top+=e,this._$shadowTop&&this._$shadowTop.css("top",this._header_height-this._shadow_offset),this.resize()},o.prototype.scrollTo=function(t,e){var i,o,n,r,s,a;if(e=$.extend({position:"visible",areaHeight:t instanceof $?t.height():0},e),t instanceof $&&(t=e.offsetTop||t.position().top),i=this._$content.position().top,o=this._$content.outerHeight(),n=this.getContainerHeightWithoutHeader(),o-n-1<=0)return!0;if(r=-1*(i-this._header_height),s=r+n,a=0,"visible"===e.position){if(t>r&&t+e.areaHeight<s)return!1;a=t+e.areaHeight>s?s-t-e.areaHeight:r-t}else"top"===e.position&&(a=r-t);return this.scroll(a,1),this._onScroll(),!1},o.prototype.scrollToEnd=function(){
var t=this._$content.position().top,e=this._$content.outerHeight(),i=this._$wrapper.outerHeight(),o=e+t;return this.setContentTop(t+(i-o)+1),this._onScroll(),this},o.prototype.scrollToStart=function(){return this.setContentTop(this._header_height),this._onScroll(),this},o.prototype.currentPosition=function(){return Math.round(this._$content.position().top)},o.prototype.atStart=function(){return Math.round(this._$content.position().top)>=this._header_height},o.prototype.atEnd=function(t){var e,i,o,n;return"number"==typeof t&&isFinite(t)||(t=0),e=1,i=Math.round(this._$content.position().top),o=this._$content.outerHeight(),n=this._$wrapper.outerHeight(),o-Math.abs(i)-e<=n+t},o.prototype._onScroll=function(t){var e,i;return this._touch||this._$content.css("bottom","auto"),this.scrolled.fire(),this._dragging&&!0!==t||this.updateScrollBar(),e=this.atStart(),i=this.atEnd(),this._$shadowTop&&this._$shadowTop.toggleClass("i-invisible",!!e),this._$shadowBottom&&this._$shadowBottom.toggleClass("i-invisible",!!i),this._onContentVisible(),!this._atStart&&e?(this._atStart=!0,this.scrolltostart.fire()):this._atStart&&!e&&delete this._atStart,!this._atEnd&&i?(this._atEnd=!0,this.scrolltoend.fire()):this._atEnd&&!i&&delete this._atEnd,this._options.vAlignBottom&&(this._stickyBottom=this._$content.outerHeight()-Math.abs(this._$content.position().top)-this._$wrapper.outerHeight()),!(!this._atStart&&!this._atEnd||("function"==typeof this._options.bubbleScrollEvent?!this._options.bubbleScrollEvent():!this._options.bubbleScrollEvent))},o.prototype.checkContentVisibility=function(){this._onContentVisible()},o.prototype.subscribeToContentVisible=function(t,e,i){this.visibilityCallbacks.push({id:t,$el:e,callback:i})},o.prototype.triggerVisibilityCallbacks=function(t){this._onContentVisible(t)},o.prototype._contentIsVisible=function(t){return t.$el.position().top>-1*this.currentPosition()},o.prototype._onContentVisible=function(t){var e,i,o;this.visibilityCallbacks.length&&(e=t||this._contentIsVisible.bind(this),i=[],o=this.visibilityCallbacks.filter(function(t,o){if(!$.contains(this._$content,t.$el[0]))return!1;var n=e(t);return n&&i.push(o),!n},this),i.forEach(function(e){this.visibilityCallbacks[e].callback(!!t)},this),delete this.visibilityCallbacks,this.visibilityCallbacks=o)},o.prototype.save=function(){return this._saved={top:this._$content.position().top,height:this._$content.outerHeight()},this},o.prototype.restore=function(){if(this._saved){if(this._saved.top===this._$content.position().top&&this._saved.height===this._$content.outerHeight())return delete this._saved,this;this._options.vAlignBottom&&(this._saved.top-=this._$content.outerHeight()-this._saved.height,this._saved.top>this._header_height&&(this._saved.top=this._header_height)),this.setContentTop(this._saved.top),delete this._saved,this._onScroll(!0)}return this},o.prototype.fixBottom=function(){var t,e;return this._bottomFixed?this:(this._touch?(t=this._$content.outerHeight(),e=this._$wrapper.scrollTop(),this._tempIntervalID=setInterval(function(){
this._$wrapper.scrollTop(e+(this._$content.outerHeight()-t))}.bind(this),0)):this._$content.css({top:"auto",bottom:this._$wrapper.outerHeight()-this._$content.position().top-this._$content.outerHeight()}),this._bottomFixed=!0,this)},o.prototype.releaseBottom=function(){return this._bottomFixed?(this._touch?clearInterval(this._tempIntervalID):this._$content.css({top:this._$content.position().top,bottom:"auto"}),delete this._bottomFixed,this._onScroll(),this):this},o.prototype.setContentTop=function(t){return this._touch?this._options.vAlignBottom&&this._$content.outerHeight()<this._$wrapper.outerHeight()?(this._$wrapper.css("overflow-y","visible"),this._$content.css({position:"absolute",bottom:0})):(this._$content.css({position:"relative",bottom:"auto"}),this._$wrapper.css("overflow-y","auto"),this._$wrapper.scrollTop(-t)):this._$content.css("top",t),this},o.prototype.isContentShort=function(){return this.getContentHeight()<=this.getContainerHeightWithoutHeader()},o.prototype.destroy=function(){this._$scrollBarWrapper.remove(),this._$shadowBottom&&this._$shadowBottom.remove(),this._$shadowTop&&this._$shadowTop.remove(),this._$wrapper.attr("style","").off("mouseenter.sidebar-scroll").off("mouseleave.sidebar-scroll").off("mousewheel.sidebar-scroll"),this._$content.attr("style","")},e.SidebarCustomScroll=o}).call(e,i(20))},,function(t,e){"use strict";function i(t,e){this.m_title=t,this.m_value=e,this._visible=!0,this._color=void 0}function o(){this._header="",this._title="",this._items=[]}i.prototype.title=function(){return this.m_title},i.prototype.text=function(){return this.m_value},i.prototype.visible=function(){return this._visible},i.prototype.color=function(){return this._color},i.prototype.setVisible=function(t){this._visible=t},i.prototype.setValue=function(t){this.m_value=t},i.prototype.setColor=function(t){this._color=t},i.prototype.value=function(){return this.m_value},o.prototype.header=function(){return this._header},o.prototype.title=function(){return this._title},o.prototype.items=function(){return this._items},o.prototype.update=function(){},e.DataWindowItem=i,e.DataWindowView=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPitchfork";var i=e||this.createPropertiesObject("linetoolpitchfork");n.call(this,t,i),this._properties.style.listeners().subscribe(this,o.prototype._recreatePaneView),this._recreatePaneView()}var n=i(3).LineDataSource,r=i(40),s=i(73).Action,a=i(9).propertyPages,l=i(486).LineToolPitchforkStyle,c=null;inherit(o,n),o.prototype.additionalActions=function(){var t,e,i=[],o=["Original","Modified Schiff","Inside","Schiff"];for(t=0;t<4;t++)e=new s({checked:this.properties().style.value()===t,checkable:!0,text:$.t(o[t]),callbackContext:{target:this,value:t}}),e.callbacks().subscribe(null,function(t){var e=t.callbackContext(),i=e.target,o=e.value;i.properties().style.setValue(o),i.updateAllViews(),i._model.updateSource(i)}),i.push(e);return[i[0],i[3],i[1],i[2]]},o.prototype._recreatePaneView=function(){if(null===c)return void i.e(1,function(t){null===c&&(c=i(906)),
this._recreatePaneView()}.bind(this));var t=[];this._properties.style.value()===l.Original?t=[new c.PitchforkLinePaneView(this,this._model)]:this._properties.style.value()===l.Schiff?t=[new c.SchiffPitchforkLinePaneView(this,this._model)]:this._properties.style.value()===l.Schiff2?t=[new c.SchiffPitchfork2LinePaneView(this,this._model)]:this._properties.style.value()===l.Inside&&(t=[new c.InsidePitchforkLinePaneView(this,this._model)]),this._setPaneViews(t)},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return $.t("Pitchfork")},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[0,8]})},o.prototype.getStylesPropertyPage=function(){return a.LineToolPitchforkStylesPropertyPage},e.LineToolPitchfork=o},function(t,e,i){"use strict";function o(){var t,e,i,o;this._registeredSources={},this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=0,this._actualWidth=0,this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this._currentWidth=400,this._canvas.prop("width",this._currentWidth).prop("height",1).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0),this._ctx=this._canvas.get(0).getContext("2d"),this._ctx.font=u.fontSize+"px"+u.font,t=u.fontSize,e=u.lineSpacing,i=t+e,o=3,this._padding=8,this._rowHeight=i*o-e+2*this._padding+2}function n(t,e){this._constructor="LineToolTrendLine";var n=e||new a("linetooltrendline");s.call(this,t,n),t._trendLineStatsCache||(t._trendLineStatsCache=new o),i.e(1,function(t){var e=i(939).TrendLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(1).Point,s=i(3).LineDataSource,a=i(11).DefaultProperty,l=i(9).propertyPages,c=i(13).getLogger("Chart.LineToolTrendLine"),h=i(423).TrendLineStatsRenderer,u=i(313).LabelSettings;o.prototype.canvas=function(){return this._canvas},o.prototype.topByRow=function(t){return t*this._rowHeight},o.prototype.rowHeight=function(t){return this._rowHeight},o.prototype.rowWidth=function(t){var e=this._rowsToSources[t];return this._sourcesToRow[e].width},o.prototype.currentWidth=function(){return this._currentWidth},o.prototype._findEmptyRow=function(t){for(var e=0;this._rowsToSources[e];)e++;return this._rowsToSources[e]=t,e>=this._actualCapacity&&(this._actualCapacity++,TradingView.resizeCanvas(this._canvas,this._currentWidth,this._rowHeight*this._actualCapacity),this._ctx=this._canvas.get(0).getContext("2d"),c.logDebug("TrendLineCache. Expanging cache to "+this._actualCapacity+" items")),e},o.prototype._effectiveState=function(t){var e,i={};return i.p1=$.extend({},t.points()[0]),i.p2=$.extend({},t.points()[1]),e=t.properties(),i.showBars=e.showBarsRange.value(),i.showTimeRange=e.showDateTimeRange.value(),i.showDistance=e.showDistance.value(),i.showPriceRange=e.showPriceRange.value(),i.showAngle=e.showAngle.value(),i.color=e.textcolor.value(),
i.showAngle&&(i.priceRange=t.priceScale().priceRange().state(),i.barSpacing=t._model.timeScale().barSpacing()),i},o.prototype._effectiveStatesEquals=function(t,e){var i=function(t,e){return!(!t&&!e)&&(!(!t||e)||(!(t||!e)||(t.index!==e.index||t.price!==e.price)))};if(t&&!e)return!1;if(!t&&e)return!1;if(i(t.p1,e.p1))return!1;if(i(t.p2,e.p2))return!1;if(t.color!==e.color)return!1;if(t.showBars!==e.showBars)return!1;if(t.showTimeRange!==e.showTimeRange)return!1;if(t.showDistance!==e.showDistance)return!1;if(t.showPriceRange!==e.showPriceRange)return!1;if(t.showAngle!==e.showAngle)return!1;if(t.showAngle){if(t.priceRange.min!==e.priceRange.min)return!1;if(t.priceRange.max!==e.priceRange.max)return!1;if(t.barSpacing!==e.barSpacing)return!1}return!0},o.prototype.removeSource=function(t){if(this._sourcesToRow[t]){var e=this._sourcesToRow[t].row;this._ctx.save(),this._ctx.clearRect(0,this.topByRow(e),this._currentWidth,this.rowHeight(e)),this._ctx.restore(),delete this._sourcesToRow[t],delete this._rowsToSources[e]}},o.prototype._repaintSource=function(t,e,i){var o,n;this._ctx.save(),this._ctx.translate(0,this.topByRow(e)+.5),i.points[0]=new r(0,0),i.offsetX=0,i.offsetY=0,delete i.horzAlign,delete i.vertAlign,this._ctx.clearRect(0,0,this._currentWidth,this.rowHeight(e)),o=new h(i,{}),n=o.draw(this._ctx),this._sourcesToRow[t].width=n.width,this._ctx.restore()},o.prototype.updateSource=function(t,e){var i,o,n,r,s,a=t.properties().symbol.value();return this._currentSymbol!==a&&(c.logDebug("TrendLineCache. Clearing canvas because of changing symbol from "+this._currentSymbol+" to "+a),this._currentSymbol=a,this._sourcesToRow={},this._rowsToSources={}),i=t.id(),this._sourcesToRow[i]||(o=this._findEmptyRow(i),this._sourcesToRow[i]={effectiveState:null,row:o}),n=this._sourcesToRow[t.id()].effectiveState,r=this._effectiveState(t),this._effectiveStatesEquals(n,r)||(o=this._sourcesToRow[t.id()],s=e(),this._repaintSource(i,o.row,s),this._sourcesToRow[i].effectiveState=r),this._sourcesToRow[i]},inherit(n,s),n.prototype.stop=function(){s.prototype.stop.call(this),this._model._trendLineStatsCache.removeSource(this.id())},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Trend Line"},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},n.prototype.getStylesPropertyPage=function(){return l.LineToolTrendLineStylesPropertyPage},e.LineToolTrendLine=n},function(t,e,i){"use strict";function o(t){this.items=t.items,this._simpleMode=t.simpleMode,this.barSpacing=t.barSpacing,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth,this.lineStyle=t.lineStyle,this.withMarkers=t.withMarkers,this.withSteps=t.withSteps,this.hittest=t.hittest,this.ignorePaletteLineWidth=t.ignorePaletteLineWidth,this.forceLineColor=!!t.forceLineColor}var n=i(1).Point,r=i(33).distanceToSegment,s=i(69),a=i(4);o.prototype.draw=function(t){t.lineCap="square",
t.lineJoin=this.withMarkers?"round":"miter",t.strokeStyle=this.lineColor,t.fillStyle=this.lineColor,t.lineWidth=this.lineWidth,t.lineStyle=this.lineStyle,s.setValidLineStyle(t,this.lineStyle),this._simpleMode?this._drawSimpleMode(t):this._drawLines(t)},o.prototype._drawSimpleMode=function(t){var e,i,o,n;if(t.beginPath(),this.walkLine(t,this.items),t.stroke(),this.withMarkers){for(e=this.lineWidth+2,i=2*Math.PI,t.beginPath(),n=this.items.length;n--;)(o=this.items[n])&&(t.moveTo(o.x,o.y),t.arc(o.x,o.y,e,0,i));t.fill()}},o.prototype.walkLine=function(t,e,i,o){var n,r,a,l,c,h,u,d,p,_,f;if(e){for(n=.25*this.barSpacing,u=s.coordinateIsValid,d=0,p=e.length;d<p;d++)if(_=e[d],u(_.y)){a=_,r=d;break}if(void 0!==r&&a)for(f=this.withSteps&&this.lineWidth&&this.lineWidth%2==0?.5:0,d=r,p=e.length;d<p;d++){if(c=e[d],h=e[d+1]||{},u(c.y))if(l&&u(l.y))this.withSteps&&t.lineTo(l.x+f,c.y+f),t.lineTo(c.x+f,c.y+f),i&&!u(h.y)&&t.lineTo(c.x+f,o);else if(h&&u(h.y))i?(d!==r&&t.lineTo(c.x+f,o),t.lineTo(c.x+f,c.y+f)):t.moveTo(c.x+f,c.y+f);else if(i){if(0===d)continue;d!==r&&t.lineTo(c.x-n+f,o),t.lineTo(c.x-n+f,c.y+f),t.lineTo(c.x+n+f,c.y+f),t.lineTo(c.x+n+f,o)}else t.moveTo(c.x-n+f,c.y+f),t.lineTo(c.x+n+f,c.y+f);l=c}}},o.prototype._drawLines=function(t){function e(e,i,o){a(i.y)&&(a(e.y)?t.lineTo(i.x,i.y):o&&a(o.y)?t.moveTo(i.x,i.y):(t.moveTo(i.x-r,i.y),t.lineTo(i.x+r,i.y)))}var i,o,n,r,a,l,c,h,u,d,p,_,f,m;if(this.items.length){for(r=.25*this.barSpacing,a=s.coordinateIsValid,t.beginPath(),l=this.items[0],l&&t.moveTo(l.x,l.y),c=t.strokeStyle,h=t.lineWidth,u=t.lineStyle,d=1;d<this.items.length;++d)i=this.items[d-1],o=this.items[d],n=this.items[d+1],o.style&&!this.forceLineColor?(p=o.style.color,_=o.style.width,f=o.style.style):(p=this.lineColor,_=this.lineWidth,f=this.lineStyle),this.ignorePaletteLineWidth&&(_=this.lineWidth),m=p!==c||_!==h||f!==u,m&&(c=p,h=_,u=f,t.stroke(),t.beginPath(),t.strokeStyle=p,t.lineWidth=_,s.setValidLineStyle(t,f),t.moveTo(i.x,i.y)),e(i,o,n);t.stroke()}},o.prototype.hitTest=function(t){for(var e,i,o,l,c,h,u,d,p=s.selectionTolerance(this.lineWidth),_=0,f=this.items.length-1;f-_>2;)h=Math.round((f+_)/2),u=this.items[h],u.x<=t.x?_=h:f=h;for(_=Math.max(1,_-1),f=Math.min(this.items.length-1,f+1),d=_;d<=f;++d)if(e=this.items[d-1],i=this.items[d],o=e.x,l=i.x,c=r(new n(o,e.y),new n(l,i.y),new n(t.x,t.y)),c.distance<=p)return this.hittest?this.hittest:new a(a.REGULAR);return null},e.PaneRendererLine=TradingView.PaneRendererLine=o},function(t,e,i){"use strict";var o,n=i(21).assert,r=i(53),s=r.rgba,a=r.rgbaToString,l=r.parseRgb,c=i(823),h=i(281),u=i(216),d=i(275),p=i(3).LineDataSource,_=i(136).StudyLineDataSource,f=i(83).LineToolBarsPattern,m=i(83).LineToolCallout,g=i(61),v=g.Study,y=g.prepareStudyPropsStateForLoadChart,b=g.prepareStudyPropertiesForLoadChart,S=g.createStudy,w=i(85),T=i(71),x=i(11).DefaultProperty,C=i(45),P=i(7),L=i(13).getLogger("Chart.Serialization"),I=i(83).LineToolParallelChannel,k=i(83).LineToolTrendAngle,A=i(83).LineToolGhostFeed,M=i(83).LineToolElliott,E=i(62).PriceDataSource,V=i(280),D=i(37),O=i(19)
;c.version=2,c.prototype.state=function(t,e){var i,o,n,r={};for(r.panes=[],i=0;i<this.panes().length;i++)r.panes.push(this.panes()[i].state(!0,t,!1,e));return r.timeScale=this.m_timeScale.state(t),o=null,n=this.properties(),r.chartProperties={paneProperties:n.paneProperties.state(),scalesProperties:n.scalesProperties.state(),publishedChartsTimelineProperties:o?o.state(t):void 0,chartEventsSourceProperties:n.chartEventsSourceProperties.state()},n.chartEventsSourceProperties&&(r.chartProperties.chartEventsSourceProperties=n.chartEventsSourceProperties.state()),r.version=c.version,r.timezone=this.timezone(),r},c.prototype.chartPropertiesTransparencyMigrate=function(t){var e,i,o;t.chartProperties.paneProperties.crossHairProperties&&(o=t.chartProperties.paneProperties.crossHairProperties,O.isHexColor(o.color)&&(i=o.transparency/100,e=l(o.color),o.color=a(s(e,i)))),t.chartProperties.paneProperties.dataWindowProperties&&(o=t.chartProperties.paneProperties.dataWindowProperties,O.isHexColor(o.color)&&(i=o.transparency/100,e=l(o.color),o.color=a(s(e,i))))},c.prototype.resetDeferredStudies=function(){new o(this).reset()},c.prototype._getExceedingChildStudies=function(t){var e,i,o,n,r,s,a,l,c=[];for(e=0;e<t.length;++e)c=c.concat(t[e].sources||[]);for(i=0,o=1,n=[],r={},s=0,a=1e6;c.length&&--a;)l=c[s],(l.ownerSource&&r[l.ownerSource]||!l.ownerSource)&&(r[l.id]=l,c.splice(c.indexOf(l),1),l.ownerSource&&"Study"===l.type&&l.state&&l.state.isChildStudy&&++i>o&&n.push(l)),s=(s+1)%c.length;return n},c.prototype.restoreState=function(t,e){var i,n,r,s,a,l,c,h,u,d,_,f;if(new o(this).reset(),i={},!t.panes)return void L.logDebug("ChartModel.restoreState: invalid state");if(!Array.isArray(t.panes))return void L.logDebug("ChartModel.restoreState: invalid state");if(t.panes.length<1)return void L.logDebug("ChartModel.restoreState: invalid state");if(t.chartProperties&&!t.chartProperties.timezone&&(t.chartProperties.timezone=t.timezone),t.chartProperties&&(n=TradingView.factoryDefaults("chartproperties").scalesProperties,TradingView.merge(n,t.chartProperties.scalesProperties),!("showLastValue"in n)||"showSeriesLastValue"in n||"showStudyLastValue"in n||(n.showSeriesLastValueProperty=n.showLastValue,n.showStudyLastValueProperty=n.showLastValue),"showSeriesLastValue"in n&&(i.showSeriesLastValueProperty=!0),"showStudyLastValue"in n&&(i.showStudyLastValueProperty=!0),t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||TradingView.clone(t.chartProperties.paneProperties.gridProperties),t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||TradingView.clone(t.chartProperties.paneProperties.gridProperties),this._properties.paneProperties.merge(t.chartProperties.paneProperties),this._properties.scalesProperties.merge(n),t.chartProperties.timezone&&this._properties.timezone.setValue(t.chartProperties.timezone),
t.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.merge(t.chartProperties.chartEventsSourceProperties),this.m_timeScale.restoreState(t.timeScale,e)),t.timeScale&&this.m_timeScale.restoreState(t.timeScale,e),!this.readOnly()&&(r=this._getExceedingChildStudies(t.panes),r.length))for(s=t.panes.length-1;s>=0;--s){for(a=t.panes[s],l=a.sources.length-1;l>=0;--l)c=a.sources[l],~r.indexOf(c)&&a.sources.splice(l,1);a.sources.length||t.panes.splice(s,1)}for(h=t.panes,this.panes()[0].restoreState(h[0],e,t.version,i),s=1;s<t.panes.length;s++)a=this.panes()[s]||this.createPane(),a.restoreState(t.panes[s],e,t.version,i);for(this._invalidateBarColorerCaches(),u=this.dataSources(),d=0,s=0;s<u.length;s++)_=u[s],TradingView.isInherited(_.constructor,p)&&(d++,_.calcIsActualSymbol());return this._version=t.version,this.timeScale().recalcLockedScale(),this.updateTimeScaleBaseIndex(),this.recalculateAllPanes(),this.invalidate(new D(D.FULL_UPDATE)),f=TVLocalStorage.getItem("linetools_limit")||1e3,window.is_authenticated&&window.user&&window.user.settings&&(f=window.user.settings.linetools_limit||f),d>f?{lines_limit_exceeded:!0,line_tools_count:d}:{}},c.prototype.restoreAxisState=function(t){var e,i;if(!t.panes)return void L.logDebug("ChartModel.restoreAxisState: invalid state");if(!Array.isArray(t.panes))return void L.logDebug("ChartModel.restoreAxisState: invalid state");if(t.panes.length<1)return void L.logDebug("ChartModel.restoreAxisState: invalid state");for(this.m_timeScale.restoreState(t.timeScale,!1,!0),e=0;e<t.panes.length;e++)i=this.panes()[e],i.m_leftPriceScale.restoreState(t.panes[e].leftAxisState),i.m_rightPriceScale.restoreState(t.panes[e].rightAxisState);this.recalculateAllPanes(),this.invalidate(new D(D.FULL_UPDATE))},V.prototype.state=function(t,e,i,o){function n(t){return i&&!t.isSavedInStudyTemplates()||!t.state||!t.state()||!t.isSavedInChart(e)||o&&t.isActualSymbol&&!t.isActualSymbol()}var r,s,a={};if(t)for(a.sources=[],r=0;r<this.m_dataSources.length;r++)n(this.m_dataSources[r])||a.sources.push(this.m_dataSources[r].state(e));for(a.leftAxisState=this.m_leftPriceScale.state(),a.leftAxisSources=[],r=0;r<this.m_leftPriceScale.dataSources().length;r++)n(this.m_leftPriceScale.dataSources()[r])||a.leftAxisSources.push(this.m_leftPriceScale.dataSources()[r].id());for(a.rightAxisState=this.m_rightPriceScale.state(),a.rightAxisSources=[],r=0;r<this.m_rightPriceScale.dataSources().length;r++)n(this.m_rightPriceScale.dataSources()[r])||a.rightAxisSources.push(this.m_rightPriceScale.dataSources()[r].id());for(a.overlayPriceScales={},r=0;r<this.m_dataSources.length;r++)s=this.m_dataSources[r],this.isOverlay(s)&&s.isSavedInChart(e)&&(a.overlayPriceScales[s.id()]=s.priceScale().state());return a.stretchFactor=this._stretchFactor,this.m_mainDataSource&&(a.mainSourceId=this.m_mainDataSource.id()),a},V.prototype.sourceById=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e]
;return null},V.prototype.isESDStudy=function(t){return"Script$TV_EARNINGS@tv-scripting"===t.id||"Script$TV_DIVIDENDS@tv-scripting"===t.id||"Script$TV_SPLITS@tv-scripting"===t.id||"ESD$TV_EARNINGS@tv-scripting"===t.id||"ESD$TV_DIVIDENDS@tv-scripting"===t.id||"ESD$TV_SPLITS@tv-scripting"===t.id},V.prototype.isStudyToSkip=function(t){return!!this.isESDStudy(t)},V.prototype.restoreState=function(t,e,i,o){var n,r,s,a,l,c,u,d,_,f,m,g,y,b,S;if(o=o||{},!t.leftAxisState||!t.rightAxisState)throw Error("invalid state");if(!t.leftAxisSources||!t.rightAxisSources)throw Error("invalid state");if(t.stretchFactor&&(this._stretchFactor=t.stretchFactor),n={},t.sources)for(r=-1!==this.m_dataSources.indexOf(this._model.mainSeries()),this.clearSeries(),this.m_mainDataSource=null,r&&this.m_dataSources.push(this._model.mainSeries()),s=this.getZOrderMinMax(),a=s.minZOrder,l=s.maxZOrder,c=0;c<t.sources.length;c++)u=t.sources[c],d=u.type,Math.abs(u.zorder)>1e200?(_=a-1,L.logWarn("Datasource zorder has bad value: "+u.zorder+" Resetting it to "+_),u.zorder=_):this.isZOrderAvailable(u.zorder)||r&&"MainSeries"===d&&this._model.mainSeries().zorder()===u.zorder||(u.zorder=l+1),f=u.id,n[f]=u.ownerSource,d&&("MainSeries"===d?this._restoreMainSeries(u,e,r,o):d.toLowerCase().startsWith("study")?this._restoreStudy(u,e,o):TradingView.isInherited(TradingView[d],p)?this._restoreLineTool(u,e):TradingView[d]&&TradingView[d].createFromState&&this._restoreSpecialSource(u,e)),a=Math.min(a,u.zorder),l=Math.max(l,u.zorder);for(this.m_leftPriceScale.dataSources().splice(0,1/0),this.m_leftPriceScale._hasSeries=!1,m=defaults("chartproperties").paneProperties.leftAxisProperties,TradingView.merge(m,t.leftAxisState),this.m_leftPriceScale.restoreState(m),c=0;c<t.leftAxisSources.length;c++)(g=this.dataSourceForId(t.leftAxisSources[c]))&&(void 0!==m.m_showSymbolLabels&&g instanceof w&&this.model().properties().scalesProperties.showSymbolLabels.setValue(m.m_showSymbolLabels),g.setPriceScale(this.m_leftPriceScale),this.m_leftPriceScale.addDataSource(g));for(this.m_rightPriceScale.dataSources().splice(0,1/0),this.m_rightPriceScale._hasSeries=!1,m=defaults("chartproperties").paneProperties.rightAxisProperties,TradingView.merge(m,t.rightAxisState),this.m_rightPriceScale.restoreState(m),c=0;c<t.rightAxisSources.length;c++)(g=this.dataSourceForId(t.rightAxisSources[c]))&&(void 0!==m.m_showSymbolLabels&&g instanceof w&&this.model().properties().scalesProperties.showSymbolLabels.setValue(m.m_showSymbolLabels),g.setPriceScale(this.m_rightPriceScale),this.m_rightPriceScale.addDataSource(g));for(c=0;c<this.m_dataSources.length;c++)g=this.m_dataSources[c],-1===this.m_rightPriceScale.dataSources().indexOf(g)&&-1===this.m_leftPriceScale.dataSources().indexOf(g)?(g._isOverlay=!0,y=new h(this._properties.overlayPropreties,this._model.properties().scalesProperties),y.setHeight(this.m_height),y.setTopMargin(this.m_rightPriceScale.topMargin()),y.setBottomMargin(this.m_rightPriceScale.bottomMargin()),y.addDataSource(g),
t.overlayPriceScales&&t.overlayPriceScales[g.id()]&&(m=t.overlayPriceScales[g.id()],m.m_isAutoScale=!0,m.m_isLog=!1,m.m_isPercentage=!1,y.restoreState(m)),g.setPriceScale(y)):g._isOverlay=!1;for(f in n)(b=n[f])&&(g=this.sourceById(f))&&this.sourceById(f).setOwnerSource(this.sourceById(b));if(t.mainSourceId&&!this.m_mainDataSource&&(this.m_mainDataSource=this.dataSourceForId(t.mainSourceId)),!this.m_mainDataSource)for(c=0;c<this.m_dataSources.length;c++)if(g=this.m_dataSources[c],TradingView.isInherited(g.constructor,E)){this.m_mainDataSource=g;break}for(c=0;c<this.m_dataSources.length;c++)g=this.m_dataSources[c],TradingView.isInherited(g.constructor,p)?(g.ownerSource()||g.setOwnerSource(this.mainDataSource()),g.isFixed()&&g.restoreFixedPoints(),1===i&&g.priceScale().isPercent()&&!g.isFixed()&&g.correctPricesToPercents(),g.fixAfterRestorePriceAxis&&g.fixAfterRestorePriceAxis()):TradingView.isInherited(g.constructor,v)&&(S=g.properties(),S.linkedToSeries&&S.linkedToSeries.value()&&(g.ownerSource()||g.setOwnerSource(this.model().mainSeries())));this._updateMargins(),this._cachedOrderedSoruces=null,this._cachedHitTestSources=null},V.prototype._restoreMainSeries=function(t,e,i,o){var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b=t.id,S=t.state,x=t.zorder;if(S&&["candleStyle","hollowCandleStyle","haStyle"].forEach(function(t){S[t]&&(S[t].wickUpColor=S[t].wickUpColor||S[t].wickColor,S[t].wickDownColor=S[t].wickDownColor||S[t].wickColor)}),i||(n=this._model.paneForSource(this._model.mainSeries()),n.removeDataSource(this._model.mainSeries()),this.m_dataSources.push(this._model.mainSeries())),this.m_mainDataSource=this._model.mainSeries(),r=S&&S.style?S.style:void 0,s=r===w.STYLE_PNF&&S.pnfStyle.lockScale,S&&!S.lockScale&&(S.lockScale=s),r===w.STYLE_PNF&&"ATR"===this._model.mainSeries().properties().pnfStyle.inputs.style.value()?this._model.mainSeries().properties().pnfStyle.inputs.style._value="Traditional":r===w.STYLE_RENKO&&"ATR"===this._model.mainSeries().properties().renkoStyle.inputs.style.value()&&(this._model.mainSeries().properties().renkoStyle.inputs.style._value="Traditional"),S&&!S.hasOwnProperty("showSessions")&&(S.showSessions=!1),S&&!S.extendedHours&&(S.extendedHours=!1),S&&e&&(S.showCountdown=!1),S&&(e&&!("showSeriesLastValueProperty"in o)&&"showLastValue"in S&&this._model.properties().scalesProperties.showSeriesLastValue.setValue(S.showLastValue),delete S.showLastValue),S)for(a={haStyle:"BarSetHeikenAshi@tv-basicstudies-60",renkoStyle:"BarSetRenko@tv-prostudies-15",pbStyle:"BarSetPriceBreak@tv-prostudies-15",kagiStyle:"BarSetKagi@tv-prostudies-15",pnfStyle:"BarSetPnF@tv-prostudies-15"},l=this._model.studyVersioning(),c=this._model.mainSeries().styleStudyInfos(),h=Object.keys(T.SYMBOL_STRING_DATA),u=0;u<h.length;u++)r=h[u],d=T.STYLE_SHORT_NAMES[r]+"Style",p=d in t?t[d].studyId:a[d],null!=(r=S[d])&&(_=r.inputs,f=C.parseIdString(p),m=c[d].studyId,g=C.parseIdString(m),v=l.updateStudyInputs(f.id,f.version,g.version,_,null),r.inputs=v);this._model.mainSeries().clearSessionStudy(),this._model.mainSeries().properties().merge(S),
this._model.mainSeries()._prevChartStyle=this._model.mainSeries().properties().style.value(),this._model.mainSeries().createPaneView(),this._model.mainSeries().setId(b),e&&this._model.mainSeries().restoreData(t.bars,t.nsBars,t.symbolInfo,t.rtPrice,t.boxSize,t.reversalAmount),void 0!==x&&this._model.mainSeries().setZorder(x),this._model.mainSeries().properties().extendedHours.listeners().fire(this._model.mainSeries().properties().extendedHours),(y=this._model.mainSeries().symbolInfo())&&this._model.mainSeries().onSymbolResolved().fire(this._model.mainSeries().symbolInfo())},V.prototype._restoreStudy=function(t,e,i){var n,r,s,a,l,c,h,d,p,_;return e&&void 0===t.data&&void 0===t.nonSeriesData&&void 0===t.indexes?void L.logError("Cannot restore (skipping) study without data "+t.id+", "+t.metaInfo.id):(n=t.id,r=t.state,s=t.zorder,a=t.ownerSource,l=TradingView.clone(t.metaInfo),$.extend(l,C.parseIdString(l.id)),this.isStudyToSkip(l)&&!e?void L.logNormal("Skipping study "+l.id):(c=r,h=this._model.studyVersioning(),d=h.patchPropsStateAndMetaInfo(c,l,{oldShowStudyLastValueProperty:e&&!i.showStudyLastValueProperty}),c=d.propsState,l=d.metaInfo,p=new u(this._model,t,l.shortDescription),p.setId(n),_=this,h.updateMetaInfoAsync(l,e).done(function(i){function r(o){var r,a=b(l,i,c,null,h,o),d=S(_._model,a,o||_._model.mainSeries(),s);d.setId(n),e&&(r=h.patchStudyData(l,t.data,t.nonSeriesData,t.indexes),d.restoreData(r.data,r.nsData,r.indexes)),_._model.replaceStudyStub(p,d)||(p=d),u.add(n,d)}var s,u,d;p.setStatus(""),s=i||l,u=new o(_._model),d=a&&t.state.isChildStudy,d?u.get(a).done(r):r()}).fail(function(t){p.setStatus("error: "+t),p.setFailed(!0)}),p&&this.m_dataSources.push(p),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,p&&void 0!==s&&p.setZorder(s),p))},V.prototype._restoreLineTool=function(t,e,i){var o,r,s,a,l,c,h,g,v,b,S,w,T,L,E,V,D,O,B,R,z,F,N;for(i=void 0===i||i,M.migrateState(t),o=t.type,r=t.id,s=t.state,a=i?t.zorder:this._newZOrderForLineTool(),l=TradingView[o],n(TradingView.isInherited(l,p),"invalid data source type:"+o+" (expected to be a Line Tool)"),c=t.points,h=!1,g=0;g<c.length;g++)if(Math.abs(c[g].offset)>1e4){h=!0;break}if(!h){if(v=null,b=TradingView.factoryDefaults("linetool"),TradingView.isInherited(l,_)){if(v=this._model.studyVersioning(),t=v.patchPointsBasedStudyState(t),TradingView.merge(b,s),T=t.metaInfo,$.extend(T,C.parseIdString(T.fullId)),!e&&(L=T.productId,!pro.hasPackage(L)))return E=new u(this._model,t,T.shortDescription),E.setId(r),this.m_dataSources.push(E),void 0!==a&&E.setZorder(a),E.setStatus($.t("not authorized")),void E.setFailed(!0);V=v.updateMetaInfo(T),D=V||T,b=y(D,T,b,null,v),e?TradingView.merge(b,{fixedSize:!1}):TradingView.merge(b,{fixedSize:!0}),w=new x("study_"+D.id,b,!0),S=d.create(o,this._model,w,D,this.mainDataSource())}else O=o.toLowerCase(),TradingView.merge(b,TradingView.factoryDefaults(O)),w=TradingView[o].prototype.createPropertiesObject(O,b),w.merge(s),e?w.merge({fixedSize:!1}):w.merge({fixedSize:!0}),S=new TradingView[o](this._model,w,!0);return S.setId(r),
S.linkKey=t.linkKey,B=t.alertId,B&&"function"==typeof S.setAlert&&P.enabled("alerts")&&!this._model.readOnly()&&!this._model.isJustClonedChart()&&S.setAlert(B,{noChartSave:!0}),R=t.indexes?t.indexes:[],R=R.slice(0,t.points.length),S.isFixed()?S.restorePositionPercents(t.positionPercents):S.restorePoints(t.points,R,e),S instanceof f||S instanceof m||S instanceof k||S instanceof A||S instanceof I?S.restoreData(t):e&&S.restoreData&&(z=t,v&&(z.graphics=v.patchPointsBasedStudyData(z.metaInfo,z.graphics)),S.restoreData(z)),F=null==t.version?1:t.version,N=null==S.version?1:S.version,F!==N&&"function"==typeof S.migrateVersion&&S.migrateVersion(F,N,{pane:this,model:this._model,properties:w}),this.m_dataSources.push(S),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,void 0!==a&&S.setZorder(a),S}},V.prototype._restoreSpecialSource=function(t,e){var i,o=TradingView[t.type];o&&o.createFromState&&(i=o.createFromState(t,e,this._model))&&(i.setId(t.id),this.m_dataSources.push(i),i.zorder&&i.setZorder(i.zorder))},c.prototype.studyTemplate=function(t){var e,i,o,n,r={};for(r.panes=[],e=0;e<this.panes().length;e++)i=!0,o=!1,n=!0,r.panes.push(this.panes()[e].state(i,o,n));return t&&(r.interval=this.mainSeries().interval()),r.version=c.version,r},c.prototype.restoreStudyTemplate=function(t,e){this._undoModel.studyLoadTemplate(this._undoModel,this.studyTemplate(),t,e)},c.prototype.theme=function(){var t={};return t.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.state(),symbolWatermarkProperties:this.properties().symbolWatermarkProperties.state()},t.mainSourceProperties=this.mainSeries().state().state,delete t.mainSourceProperties.symbol,delete t.mainSourceProperties.interval,delete t.chartProperties.paneProperties.topMargin,delete t.chartProperties.paneProperties.bottomMargin,t.version=c.version,t},c.prototype.restoreTheme=function(t){var e,i,o={hollowCandle:{related:"candle"}};for(e in o)t.mainSourceProperties[e+"Style"]||(i=t.mainSourceProperties[o[e].related+"Style"],t.mainSourceProperties[e+"Style"]=TradingView.clone(i));this._undoModel.chartLoadTheme(this,t)},o=function(){function t(o){var n=e.indexOf(o);return~n?i[n]:this instanceof t?(this._source=o,this._studies={},this._deferreds={},e.push(o),void i.push(this)):new t(o)}var e=[],i=[];return t.prototype.add=function(t,e){this._deferreds[t]&&(this._deferreds[t].resolve(e),delete this._deferreds[t]),this._studies[t]=e},t.prototype.get=function(t){return this._studies[t]?$.Deferred().resolve(this._studies[t]):(this._deferreds[t]||(this._deferreds[t]=$.Deferred()),this._deferreds[t].promise())},t.prototype.reset=function(){var t=e.indexOf(this._source);~t&&(e.splice(t,1),i.splice(t,1))},t}(),t.exports=c},function(t,e,i){(function(t){"use strict";function o(t,e){var i,o,n,r,l;if(s.call(this),this._study=t,this._model=e,i=t.metaInfo().plots){
for(o=0;o<i.length;++o)if(!(this._study.isSelfColorerPlot(o)||this._study.isBarColorerPlot(o)||this._study.isBgColorerPlot(o)||this._study.isDataOffsetPlot(o)||this._study.isOHLCColorerPlot(o))){if(n=i[o].id,"Compare@tv-basicstudies"===this._study.metaInfo().id)r=new a(this._study.inputsForGUI()[1],"");else{l=this._study.title();try{l=this._study.properties().styles[n].title.value()}catch(t){}r=new a(l,"")}r.plotId=n,r.plotIndex=o,this._items.push(r)}this.update(),this._invalidated=!0}}function n(t,e){o.call(this,t,e)}var r=i(209),s=r.DataWindowView,a=r.DataWindowItem,l=i(42).PlotRowSearchMode;inherit(o,s),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var e,i,o,n,r,s,a,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x=!0;for(this._header=this._study.title(x),this._title=this._study.title(),e=this._study.isVisible()?$.t("n/a"):"",i=0;i<this._items.length;++i)this._items[i].setValue(e);if(t.enabled("hide_last_na_study_output")&&this._items.length&&this._items[this._items.length-1].setValue(""),!this._model.timeScale().isEmpty()){if(o=this._study.metaInfo().plots,n=null,r={},o)for(i=0;i<o.length;i++)(this._study.isSelfColorerPlot(i)||this._study.isOHLCColorerPlot(i))&&(r[o[i].target]={index:i},r[o[i].target].palette=this._study.metaInfo().palettes[o[i].palette],r[o[i].target].paletterProps=this._study.properties().palettes[o[i].palette]);for(s=this._study.data().size()-1,a=this._model.crossHairSource().appliedIndex(),c=this._study.formatter(),h={},i=0;i<this._items.length;++i)u=this._items[i],d=u.plotId,p=u.plotIndex,_=this._study.offset(d),void 0!==(f=isNumber(a)?this._study.nearestIndex(a-_,l.NearestLeft):s)&&(m=h[d],void 0===m&&(m=this._study.getMinFirstBarIndexForPlot(d),h[d]=m),m>f||(g=this._study.data().last(),null!==(v=this._study.data().valueAt(f)||(null!==g?g.value:null))&&(y=v[p+1],isNumber(y)&&(u.setValue(c.format(y)),b=this._study.properties().styles[d].color.value(),this._study.isOHLCSeriesPlot(p)&&(d=o[p].target,b=this._study.properties().ohlcPlots[d].color.value()),r[d]&&v.length>r[d].index+1?(S=v[r[d].index+1],void 0!==S&&null!==S?(n=r[d].palette,w=r[d].paletterProps,T=n.valToIndex?n.valToIndex[S]:S,this._items[i].setColor(w.colors[T].color.value())):this._items[i].setColor(b)):this._items[i].setColor(b)))))}},o.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},inherit(n,o),e.StudyDataWindowView=o,e.DataVendorStudyDataWindowView=n}).call(e,i(7))},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._study=t,this._inputValueReplacements={NONE:"Default"}}var n=i(426);inherit(o,n),o.prototype.color=function(){return this._study._failed||this._study.metaInfo&&this._study.metaInfo().isTVScriptStub?"#ff0000":n.prototype.color.call(this)},o.prototype.update=function(){this._study._failed?this._text=this._study.title(!0,this._inputValueReplacements)+": "+this._study.status():this._text=this._study.title(!0,this._inputValueReplacements)+" "+this._study.status()},t.exports=o},function(t,e,i){(function(e){"use strict"
;function o(t,i,o){r.call(this,t),this._origState=i,this._title=o;var a={visible:!0};this._properties=new e(a),this._statusView=new n(this,t.properties()),this._status=$.t("compiling..."),this._statusView.setText(this._title+" "+this._status),this._formatter=new s(Math.pow(10,2)),this._failed=!1}var n=i(215),r=i(62).PriceDataSource,s=i(41).PriceFormatter;inherit(o,r),o.prototype.properties=function(){return this._properties},o.prototype.statusView=function(){return this._statusView},o.prototype.state=function(t){return this._origState},o.prototype.setStatus=function(t){this._status=t,this._statusView.setText(this._title+" "+this._status)},o.prototype.formatter=function(){return this._formatter},o.prototype.title=function(){return this._title},o.prototype.setFailed=function(t){this._failed=t},o.prototype.start=function(t){},o.prototype.firstValue=function(t){return null},t.exports=o}).call(e,i(52))},function(t,e,i){(function(e){"use strict";function o(t){this._data=t,this._textWidthCache=new l}function n(t,e,i,o,n){this._model=t,this._source=e,this._plotIndex=i,this._getterName=o||"symbol",this._propertyName=n,this._cache={},this._invalidated=!0,this._rendererData={}}var r=i(53),s=r.parseRgb,a=r.rgbToBlackWhiteString,l=i(218),c=i(8).CompositeRenderer,h=i(231).makeFont,u=i(19);o.prototype.hitTest=function(t){return null},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h;this._data.visible&&(this._textWidthCache.font!==this._data.font&&(this._textWidthCache.reset(),this._textWidthCache.font=this._data.font),t.font=this._data.font,e=this._data.fontSize,i=Math.floor(e/4.5),o=Math.ceil(e/4.5),n=Math.ceil(e/3),r=Math.ceil(this._textWidthCache.measureText(t,this._data.text)),s=Math.round(e/10),a=e+i+o,l=r+2*n,c=this._data.x-.5,"right"===this._data.align&&(c-=l),h=this._data.y-Math.floor(e/2)-i-.5,t.fillStyle=u.resetTransparency(this._data.backColor),t.fillRect(c,h,l,a),t.fillStyle=this._data.color,t.textAlign="left",t.fillText(this._data.text,c+n,h+i+e-s))},n.prototype.isPropertyEnabled=function(){return this._model.properties().scalesProperties[this._propertyName].value()},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,i,o,n,r,l,u,d,p=this._rendererData;if(p.visible=!1,p.text="",this.isPropertyEnabled()&&this._source.properties().visible.value()&&(t=this._source.lastValueData(this._plotIndex,e.enabled("price_scale_always_last_bar_value")),!t.noData)){if(i=this._model.paneForSource(this._source),o="right",i.leftPriceScale()===this._source.priceScale()&&(o="left"),n=this._model.properties(),r=!i.leftPriceScale().mainSource()||!i.rightPriceScale().mainSource(),r&&n.scalesProperties.showLeftScale.value()&&!n.scalesProperties.showRightScale.value()&&(o="left"),!r){if("left"===o&&!n.scalesProperties.showLeftScale.value())return new c;if("right"===o&&!n.scalesProperties.showRightScale.value())return new c}l=t.coordinate,u=this._source.m_data.m_series&&this._source.m_data.m_series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI,
this._source.lastPriceLabelFixedCoordinate&&!u&&"showSymbolLabels"===!this._propertyName&&(l=this._source.lastPriceLabelFixedCoordinate(this._plotIndex)||l),p.visible=!0,t.color!==p.backColor&&(p.backColor=this._source.priceLineColor(t.color),d=a(s(p.backColor),160),p.color="black"===d?"white":"black"),p.text=this._source[this._getterName](this._plotIndex),p.align=o,p.x="right"===o?this._model.timeScale().width():0,p.y=l,p.fontSize=this._model.properties().scalesProperties.fontSize.value(),p.font=h(p.fontSize,"Arial","")}},n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._renderer||(this._renderer=new o(this._rendererData)),this._renderer},t.exports=n}).call(e,i(7))},function(t,e){"use strict";function i(t){this._maxSize=t||50,this.reset()}var o=/[2-9]/g;i.prototype.measureText=function(t,e,i){var n,r,s=i||o,a=(e+"").replace(s,"0");return this._cache[a]?this._cache[a].width:(this._actualSize===this._maxSize&&(n=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[n],this._oldestTick++,this._actualSize--),0===(r=t.measureText(a).width)&&e.length?0:(this._cache[a]={width:r,tick:this._usageTick},this._tick2Labels[this._usageTick]=a,this._actualSize++,this._usageTick++,r))},i.prototype.reset=function(){this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}},t.exports=i},function(t,e,i){"use strict";var o=i(287).TVLocalStorage;i(102),TradingView.FeatureToggle={force_prefix:"forcefeaturetoggle.",enableFeature:function(t){o.setItem(this.force_prefix+t,"true")},disableFeature:function(t){o.setItem(this.force_prefix+t,"false")},resetFeature:function(t){o.removeItem(this.force_prefix+t)}},TradingView.isFeatureEnabled=function(t){function e(e){return o.setItem(n+e,Math.random()<=t[e]),o.getItem(n+e)}function i(t){return-1===["address-autocomplete-google-key","black_friday","black_friday_popup","ios_app_info","symbol_search_server_highlight","paper_practice_account","paper_login_test","text_notes","multiple-sos","datawindow"].indexOf(t)&&-1===t.indexOf("-maintenance")}var n="featuretoggle.";return function(r){var s,a;return!(!s&&"local"!==window.environment||!i(r))||(!t[r]||-1!==t[r])&&(!!("true"===o.getItem(TradingView.FeatureToggle.force_prefix+r)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"true"===user.settings[TradingView.FeatureToggle.force_prefix+r])||!("false"===o.getItem(TradingView.FeatureToggle.force_prefix+r)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"false"===user.settings[TradingView.FeatureToggle.force_prefix+r])&&(!!t[r]&&(1===t[r]||(a=o.getItem(n+r),void 0===a||null===a?e(r):"true"===a))))}}(window.featureToggleState||{}),e.FeatureToggle=TradingView.FeatureToggle,e.isFeatureEnabled=TradingView.isFeatureEnabled},function(t,e,i){"use strict";i(170),t.exports=TradingView.templates={dialogs:{},lists:{},
onChartMessage:'<div class="onchart-message"><span class="onchart-message-close"></span><div class="onchart-message-top"><div class="onchart-message-copy"></div></div><div class="onchart-message-bottom"><div class="onchart-message-ear"></div></div></div>',miniWidgetWizardAddSymbol:'<tr class="tv-external-tools__symbol-item"><td class="tv-external-tools__symbol-item-cell">{{symbol}}</td><td class="tv-external-tools__symbol-item-cell{{#descriptionShortening}} apply-common-tooltip" title="{{description}}"{{/descriptionShortening}}">{{#descriptionShortening}}{{descriptionShortening}}{{/descriptionShortening}}{{^descriptionShortening}}{{description}}{{/descriptionShortening}}</td>{{#timeframeSelectAllow}}<td class="tv-external-tools__symbol-item-cell">{{timeframe}}</td>{{/timeframeSelectAllow}}<td class="tv-external-tools__remove-cell"><div class="tv-external-tools__remove-symbol"></div></td></tr>',textNotesWidgetLayout:'<div class="notes-block"><div class="textnotes-search-header"><div class="search-input-block">'+i(1201)+'<div class="search-clean"></div><input type="text" class="search-input" placeholder="'+$.t("Search Note")+'" maxlength="1000" autocomplete="off"></div><div class="new-note-btn">'+i(1189)+$.t("NEW")+'</div></div><div class="notes-wrapper"><div class="notes"></div></div></div><div class="notes-desc-block"><div class="notes-desc-wrapper"><div class="notes-desc-inner"><div class="remove-note-btn" title="'+$.t("Delete Text Note")+'">'+i(1336)+'</div><div class="title-wrap"><input type="text" maxlength="100" value="" class="title"></div><div class="date"><span class="created">'+$.t("Created ")+'<span class="created-val"></span>. </span><span class="modified">'+$.t("Last edited ")+'<span class="modified-val"></span></span></div><textarea></textarea></div></div></div>',textNotesWidgetItem:'<div class="note"><div class="note-header"><div {{#symbol}}title="'+$.t("Open {{symbol}} Text Note")+'"{{/symbol}} class="title {{#symbol}}title_with-badge{{/symbol}}">{{title}}</div>{{#symbol}}<div class="symbol-badge">'+i(1191)+'<span class="symbol">{{symbol}}</span></div>{{/symbol}}</div><div class="note-desc">{{description}}</div><span class="favorite"></span></div>',tvDataTable:'<table class="tv-data-table {{className}}"><thead class="tv-data-table__thead"><tr class="tv-data-table__stroke">{{#columns}}<th class="tv-data-table__cell tv-data-table__cell--bold {{className}}"><span class="tv-data-table__cell-text{{^notSortable}} tv-data-table__sortable{{/notSortable}}{{#help}} apply-common-tooltip{{/help}}{{#htmlHelp}} common-tooltip-html{{/htmlHelp}}" {{#help}}title="{{help}}"{{/help}}>{{{label}}}</span></th>{{/columns}}</tr></thead>{{#bodies}}<tbody class="tv-data-table__tbody {{className}}">{{#strokes}}<tr class="tv-data-table__stroke">{{#cells}}<td class="tv-data-table__cell {{className}}"{{#colspan}}colspan="{{colspan}}"{{/colspan}}>{{#contain}}{{{contain}}}{{/contain}}</td>{{/cells}}</tr>{{/strokes}}</tbody>{{/bodies}}</table>',
tvDataTableRow:'<tr class="tv-data-table__stroke {{rowClassName}}">{{#columns}}<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>{{/columns}}</tr>',tvDataTableCell:'<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>'}},,,,,,function(t,e,i){"use strict";function o(t){for(var i=0;i<e.availableTimezones.length;i++)if(t===e.availableTimezones[i].id)return!0;return!1}var n,r,s;for(Object.defineProperty(e,"__esModule",{value:!0}),i(23),n=i(499),e.availableTimezones=[{id:"Etc/UTC",title:$.t("UTC")},{id:"exchange",title:$.t("Exchange")},{id:"Pacific/Honolulu",title:$.t("Honolulu")},{id:"America/Vancouver",title:$.t("Vancouver")},{id:"America/Los_Angeles",title:$.t("Los Angeles")},{id:"America/Phoenix",title:$.t("Phoenix")},{id:"America/El_Salvador",title:$.t("San Salvador")},{id:"America/Mexico_City",title:$.t("Mexico City")},{id:"America/Chicago",title:$.t("Chicago")},{id:"America/Bogota",title:$.t("Bogota")},{id:"America/Toronto",title:$.t("Toronto")},{id:"America/New_York",title:$.t("New York")},{id:"America/Caracas",title:$.t("Caracas")},{id:"America/Argentina/Buenos_Aires",title:$.t("Buenos Aires")},{id:"America/Sao_Paulo",title:$.t("Sao Paulo")},{id:"Europe/London",title:$.t("London")},{id:"Europe/Madrid",title:$.t("Madrid")},{id:"Europe/Paris",title:$.t("Paris")},{id:"Europe/Rome",title:$.t("Rome")},{id:"Europe/Berlin",title:$.t("Berlin")},{id:"Europe/Zurich",title:$.t("Zurich")},{id:"Europe/Warsaw",title:$.t("Warsaw")},{id:"Europe/Athens",title:$.t("Athens")},{id:"Europe/Istanbul",title:$.t("Istanbul")},{id:"Europe/Moscow",title:$.t("Moscow")},{id:"Asia/Tehran",title:$.t("Tehran")},{id:"Asia/Dubai",title:$.t("Dubai")},{id:"Asia/Ashkhabad",title:$.t("Ashkhabad")},{id:"Asia/Kolkata",title:$.t("Kolkata")},{id:"Asia/Almaty",title:$.t("Almaty")},{id:"Asia/Bangkok",title:$.t("Bangkok")},{id:"Asia/Taipei",title:$.t("Taipei")},{id:"Asia/Singapore",title:$.t("Singapore")},{id:"Asia/Shanghai",title:$.t("Shanghai")},{id:"Asia/Hong_Kong",title:$.t("Hong Kong")},{id:"Asia/Seoul",title:$.t("Seoul")},{id:"Asia/Tokyo",title:$.t("Tokyo")},{id:"Australia/Brisbane",title:$.t("Brisbane")},{id:"Australia/Adelaide",title:$.t("Adelaide")},{id:"Australia/Sydney",title:$.t("Sydney")},{id:"Pacific/Auckland",title:$.t("New Zealand")},{id:"Pacific/Fakaofo",title:$.t("Tokelau")},{id:"Pacific/Chatham",title:$.t("Chatham Islands")}],r=0;r<e.availableTimezones.length;r++)-1===["Etc/UTC","exchange"].indexOf(e.availableTimezones[r].id)&&(s=n.parseTzOffset(e.availableTimezones[r].id).string,e.availableTimezones[r].title="("+s+") "+e.availableTimezones[r].title);e.timezoneIsAvailable=o,e.monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e.futuresRoots=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{
d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}]},function(t,e,i){"use strict";function o(t){var e,i=t.activeClass,o=t.children,a=t.className,l=t.icon,c=t.isActive,h=t.isBgFull,u=t.isGrayed,d=t.isHidden,p=t.isTransparent,_=t.onClick,f=t.title;return n.createElement("div",{className:r(s.button,a,c?i:"","apply-common-tooltip common-tooltip-vertical",(e={},e[s.isActive]=c,e[s.isBgFull]=h,e[s.isGrayed]=u,e[s.isHidden]=d,e[s.isTransparent]=p,e)),onClick:_,title:f},n.createElement("div",{className:s.bg},l&&("string"==typeof l?n.createElement("span",{className:s.icon,dangerouslySetInnerHTML:{__html:l}}):l),o))}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(26),s=i(664),e.ToolButton=o},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(41),n=function(){function t(){}return t.prototype.format=function(t){return o.customFormatters&&o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.format(t):o.numberToStringWithLeadingZero(t.getUTCFullYear(),4)+"-"+o.numberToStringWithLeadingZero(t.getUTCMonth()+1,2)+"-"+o.numberToStringWithLeadingZero(t.getUTCDate(),2)},t.prototype.formatLocal=function(t){return o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.formatLocal?o.customFormatters.dateFormatter.formatLocal(t):o.customFormatters.dateFormatter.format(t):o.numberToStringWithLeadingZero(t.getFullYear(),4)+"-"+o.numberToStringWithLeadingZero(t.getMonth()+1,2)+"-"+o.numberToStringWithLeadingZero(t.getDate(),2)},t}(),e.DateFormatter=n},,,function(t,e){"use strict";function i(t,e,i){return i&&(i+=" "),(i||"")+t+"px "+e}Object.defineProperty(e,"__esModule",{value:!0}),e.makeFont=i},function(t,e,i){"use strict";function o(t,e){var i,o={className:"spinner",color:r.color.spinner,corners:1,direction:1,fps:20,hwaccel:!1,left:"50%",length:0,lines:17,opacity:0,radius:20,rotate:0,scale:1,shadow:!1,speed:1.5,top:"50%",trail:60,width:3,zIndex:2e9},a=t?s[t]:null;return a&&(o=$.extend(o,a)),i=$.extend({},o,e),new n(i)}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),i(22),n=i(305),r=i(28),s={medium:{lines:14,scale:.8},micro:{lines:12,scale:.2},mini:{lines:14,scale:.4},xlarge:{lines:16,scale:1.6}},e.unifiedSpinner=o},,function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(2),r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleKeyDown=function(t){t.keyCode===e.props.keyCode&&e.props.handler(t)},e}return o.__extends(e,t),e.prototype.componentDidMount=function(){document.addEventListener("keydown",this._handleKeyDown,!1)},e.prototype.componentWillUnmount=function(){document.removeEventListener("keydown",this._handleKeyDown,!1)},e.prototype.render=function(){return null},e}(n.PureComponent),e.KeyboardDocumentListener=r},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 9" width="11px" height="9px"><path fill="none" fill-rule="evenodd" stroke-width="2" d="M1 3.22l3.415 3.496L10 1"/></svg>'
},,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";function o(t){if(t)return function(e,i,o){function n(e,i){return i?t[e](a,i):t[e](a)}var r,s,a=$(this);return"get"===e?(r=i,"function"==typeof t[r]?n(r,o):t[r]):t[e]?a.each(function(){return n(e,s)}):a}}function n(t,e){function i(t,e,i){return void 0===i?t[e]():t[e](i)}if(t&&e)return t=""+t,function(o,n,a){var l,c,h;return"get"===o?l=n:(c=n,"object"===(void 0===o?"undefined":r(o))&&void 0===n?(c=o,o="init"):"string"!=typeof o&&(o="init")),"getInstance"===o?$(this).eq(0).data(t):"destroy"===o?(h=$(this).eq(0).data(t))?void("function"==typeof h.destroy?(i(h,"destroy",c),$(this).eq(0).removeData(t)):s.logError("[Block Plugin] "+t+" does not support destroy command")):void console.warn("[Block Plugin] Trying to execute destroy method of "+t+" but it has not been inited"):"get"===o?(h=$(this).eq(0).data(t),h?"function"==typeof h[l]?i(h,l,a):h[l]:void console.warn("[Block Plugin] Trying to get prop or execute method of "+t+" but it has not been inited")):$(this).each(function(){var n=$(this),r=n.data(t);void 0===r&&(r=void 0===c?e(n):e(n,c),n.data(t,r)),"init"!==o&&("function"==typeof r[o]?i(r,o,c):s.logError("[Block Plugin] "+t+" does not support command "+o))})}}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=i(13).getLogger("CommonUI.CreateTVBlockPlugin");t.exports.createTvBlockPlugin=o,t.exports.createTvBlockWithInstance=n},function(t,e,i){(function(o){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(261),i(359),a=i(13).getLogger("Ui.TvControlCheckbox"),l={labelWrapper:'{{#hasLabel}}<label>{{#labelLeft}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelLeft}}</span>{{/labelLeft}}{{> inputWrapper }}{{#labelRight}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelRight}}</span>{{/labelRight}}</label>{{/hasLabel}}{{^hasLabel}}{{> inputWrapper }}{{/hasLabel}}',inputWrapper:'<{{ tag }} class="{{ customClass }}{{#disabled}} i-disabled{{/disabled}}">{{^hasCheckbox}}{{> checkbox }}{{/hasCheckbox}}{{> box }}{{> ripple }}</{{ tag }}>',checkbox:'<input{{#id}} id="{{ id }}"{{/id}} class="{{> checkboxClass }}" type="checkbox"{{#name}} name="{{ name }}"{{/name}}{{#checked}} checked{{/checked}}{{#disabled}} disabled{{/disabled}}>',checkboxClass:"{{ customClass }}__input",box:'<span class="{{ customClass }}__box {{#boxAddClass}}{{boxAddClass}}{{/boxAddClass}}">'+i(235)+"</span>",ripple:'<span class="{{ customClass }}__ripple js-ripple"></span>'},
c="i-inited",h=function(){function t(e){var i,o=e.customClass,r=void 0===o?"tv-control-checkbox":o,s=e.$checkbox,l=e.tag,h=e.id,u=e.name,d=e.checked,p=e.disabled,_=e.labelLeft,f=e.labelRight,m=e.labelAddClass,g=e.boxAddClass;if(n(this,t),this.$el=null,void 0===l&&(l=_||f?"span":"label"),i=s instanceof $&&!!s.length){if(!s.is("input[type=checkbox]"))return void a.logError("`$checkbox` need to be input[type=checkbox]");if(s.hasClass(c))return;this._setInputId(s,h),this._setInputClass(s,r),this._setInputName(s,u),this._setInputChecked(s,d),this._setInputDisabled(s,p),d=!!s.prop("checked"),p=!!s.attr("disabled")}this.$el=this.render({$checkbox:s,hasCheckbox:i,customClass:r,tag:l,id:h,name:u,checked:d,disabled:p,labelLeft:_,labelRight:f,hasLabel:_||f,labelAddClass:m,boxAddClass:g}),this.$checkbox=i?s:this.$el.find("input[type=checkbox]")}return r(t,[{key:"_setInputId",value:function(t,e){void 0!==e&&t.attr("id",e)}},{key:"_setInputClass",value:function(t,e){var i=o.render(l.checkboxClass,{customClass:e});t.addClass(i)}},{key:"_setInputName",value:function(t,e){void 0!==e&&t.attr("name",e)}},{key:"_setInputChecked",value:function(t,e){void 0!==e&&t.prop("checked",!!e)}},{key:"_setInputDisabled",value:function(t,e){void 0!==e&&(e?t.setAttribute("disabled","disabled"):t.removeAttr("disabled"))}},{key:"render",value:function(t){var e,i=t.$checkbox,n=$(o.render(l.labelWrapper,t,l));return t.hasCheckbox&&(n.insertBefore(i),e=n.find("."+t.customClass).andSelf().filter("."+t.customClass).eq(0),e.prepend(i.detach()),i.addClass(c)),n}},{key:"checked",set:function(t){this._setInputChecked(this.$checkbox,!!t)},get:function(){return!!this.$checkbox.prop("checked")}}]),t}(),$.fn.tvControlCheckbox=(0,s.createTvBlockWithInstance)("tv-control-checkbox",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new h(TradingView.mergeObj(e,{$checkbox:t}))}),e.default=h,t.exports=e.default}).call(e,i(54))},function(t,e,i){(function(o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(){var t,e,i=h.width();for(d.width=i,d.height=h.height(),t=0;t<p.length;t++)if(i<=d.breakpoints[p[t]]){d.device!==p[t]&&(e=d.device,d.device=p[t],d.trigger("changeDevice",[p[t],e]));break}return d}var s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),s=i(110),a=n(s),l=i(1162),c=$("body"),h=$(window),u=0,d={width:null,height:null,device:null,checkDevice:r,isMobileSafari:!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)||!!navigator.userAgent.match("CriOS"),getScrollbarWidth:function(){var t=void 0;return function(){var e,i,o,n;return void 0===t&&(e=document.createElement("div"),e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e),i=e.offsetWidth,e.style.overflow="scroll",o=document.createElement("div"),o.style.width="100%",e.appendChild(o),n=o.offsetWidth,e.parentNode.removeChild(e),t=i-n),t}}(),hasScroll:function(t){return t.get(0).scrollHeight>t.height()},breakpoints:l.breakpoints,widgetbarBreakpoint:1064,
setFixedBodyState:function(t){var e,i,o;t&&1==++u?("hidden"!==$(document.body).css("overflow").toLowerCase()&&document.body.scrollHeight>document.body.offsetHeight&&($(".widgetbar-wrap").css("right",d.getScrollbarWidth()),c.css("padding-right",parseInt(c.css("padding-right").replace("px",""))+d.getScrollbarWidth()+"px").data("wasScroll",!0)),!TradingView.isMobile.any()&&d.isMobileSafari?c.addClass("i-no-scroll-safari"):c.css("top",-h.scrollTop()).addClass("i-no-scroll")):!t&&u>0&&0==--u&&(!TradingView.isMobile.any()&&d.isMobileSafari?c.removeClass("i-no-scroll-safari"):(e=-parseInt(c.css("top").replace("px","")),c.removeClass("i-no-scroll").css("top",""),h.scrollTop(e)),c.data("wasScroll")&&(i=c.get(0),$(".widgetbar-wrap").css("right",0),o=$(".widgetbar-wrap").width()||0,i.scrollHeight<=i.clientHeight&&(o-=d.getScrollbarWidth()),c.css("padding-right",(o<0?0:o)+"px").data("wasScroll",void 0)))}},p=Object.keys(d.breakpoints).sort(function(t,e){return d.breakpoints[t]-d.breakpoints[e]}),o.extend(d,a.default.prototype),r(),$(r),h.on("resize",r),e.default=d,t.exports=e.default}).call(e,i(192))},function(t,e,i){"use strict";var o=i(80);JSServer.studyLibrary=[{name:"Accumulation/Distribution",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Accumulation/Distribution",shortDescription:"Accum/Dist",is_price_study:!1,inputs:[],id:"Accumulation/Distribution@tv-basicstudies-1",scriptIdPart:"",name:"Accumulation/Distribution"},constructor:function(){this.f_0=function(t,e,i,n){return o.Std.or(o.Std.and(o.Std.eq(t,e),o.Std.eq(t,i)),o.Std.eq(e,i))?0:(2*t-i-e)/(e-i)*n},this.main=function(t,e){var i,n,r;return this._context=t,this._input=e,i=this.f_0(o.Std.close(this._context),o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),n=o.Std.cum(i,this._context),r=n,[r]}}},{name:"Accumulative Swing Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#3C78D8"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ASI",histogramBase:0,joinPoints:!1}},description:"Accumulative Swing Index",shortDescription:"ASI",is_price_study:!1,inputs:[{id:"in_0",name:"Limit Move Value",defval:10,type:"float",min:.1,max:1e5}],id:"Accumulative Swing Index@tv-basicstudies-1",scriptIdPart:"",name:"Accumulative Swing Index"},constructor:function(){this.f_0=function(t,e){
var i=e.new_var(o.Std.open(e)),n=e.new_var(o.Std.high(e)),r=e.new_var(o.Std.low(e)),s=e.new_var(o.Std.close(e)),a=o.Std.abs(n-s.get(1)),l=o.Std.abs(r-s.get(1)),c=o.Std.abs(n-r),h=o.Std.abs(s.get(1)-i.get(1)),u=o.Std.max(a,l),d=o.Std.iff(a>=o.Std.max(l,c),a-.5*l+.25*h,o.Std.iff(l>=o.Std.max(a,c),l-.5*a+.25*h,c+.25*h));return o.Std.iff(0===d,0,(s-s.get(1)+.5*(s-i)+.25*(s.get(1)-i.get(1)))/d*u/t*50)},this.f_1=function(t,e){var i=this.f_0(t,e);return o.Std.cum(i,e)},this.main=function(t,e){var i,o;return this._context=t,this._input=e,i=this._input(0),o=this.f_1(i,this._context),[o]}}},{name:"Advance/Decline",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Advance/Decline",shortDescription:"AD",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Advance/Decline@tv-basicstudies-1",scriptIdPart:"",name:"Advance/Decline"},constructor:function(){this.f_0=function(t,e){return o.Std.gt(t,e)},this.f_1=function(t,e){return o.Std.lt(t,e)},this.f_2=function(t,e){return 0===e?t:t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.open(this._context)),r=this._context.new_var(n),s=o.Std.sum(r,i,this._context),a=this.f_1(o.Std.close(this._context),o.Std.open(this._context)),l=this._context.new_var(a),c=o.Std.sum(l,i,this._context),h=this.f_2(s,c),u=h,[u]}}},{name:"Arnaud Legoux Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:.85,in_2:6}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Arnaud Legoux Moving Average",shortDescription:"ALMA",is_price_study:!0,inputs:[{id:"in_0",name:"Window Size",defval:9,type:"integer",min:0,max:5e3},{id:"in_1",name:"Offset",defval:.85,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"Sigma",defval:6,type:"float",min:-1e12,max:1e12}],id:"Arnaud Legoux Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Arnaud Legoux Moving Average"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=o.Std.alma(a,n,r,s),[l]}}},{name:"Aroon",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF6A00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0094FF"}},precision:4,inputs:{in_0:14}},plots:[{
id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Aroon",shortDescription:"Aroon",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Aroon@tv-basicstudies-1",scriptIdPart:"",name:"Aroon"},constructor:function(){this.f_0=function(t,e){return 100*(t+e)/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.high(this._context),r=i+1,s=this._context.new_var(n),a=o.Std.highestbars(s,r,this._context),l=this.f_0(a,i),c=o.Std.low(this._context),h=this._context.new_var(c),u=o.Std.lowestbars(h,r,this._context),d=this.f_0(u,i),p=l,_=d,[p,_]}}},{name:"Average Directional Index",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ADX",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Average Directional Index",shortDescription:"ADX",is_price_study:!1,inputs:[{id:"in_0",name:"ADX Smoothing",defval:14,type:"integer",min:-1e12,max:1e12},{id:"in_1",name:"DI Length",defval:14,type:"integer",min:-1e12,max:1e12}],id:"average_directional_Index@tv-basicstudies-1",scriptIdPart:"",name:"Average Directional Index"},constructor:function(){this.f_0=function(t){var e=this._context.new_var(o.Std.high(this._context)),i=o.Std.change(e),n=this._context.new_var(o.Std.low(this._context)),r=-o.Std.change(n),s=this._context.new_var(o.Std.tr(void 0,this._context)),a=o.Std.rma(s,t,this._context),l=this._context.new_var(o.Std.and(o.Std.gt(i,r),o.Std.gt(i,0))?i:0),c=o.Std.fixnan(100*o.Std.rma(l,t,this._context)/a,this._context),h=this._context.new_var(o.Std.and(o.Std.gt(r,i),o.Std.gt(r,0))?r:0);return[c,o.Std.fixnan(100*o.Std.rma(h,t,this._context)/a,this._context)]},this.f_1=function(t,e){var i=this.f_0(t),n=i[0],r=i[1],s=n+r,a=this._context.new_var(o.Std.abs(n-r)/(o.Std.eq(s,0)?1:s));return[100*o.Std.rma(a,e,this._context)]},this.main=function(t,e){return this._context=t,this._input=e,this.f_1(this._input(0),this._input(1))}}},{name:"Average True Range",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Average True Range",shortDescription:"ATR",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Average True Range@tv-basicstudies-1",scriptIdPart:"",name:"Average True Range"},constructor:function(){this.main=function(t,e){var i,n,r,s;return this._context=t,this._input=e,i=this._input(0),n=o.Std.tr(this._context),r=this._context.new_var(n),
s=o.Std.rma(r,i,this._context),[s]}}},{name:"Awesome Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Awesome Oscillator",shortDescription:"AO",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[],id:"Awesome Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Awesome Oscillator"},constructor:function(){this.f_0=function(t,e){return t-e},this.f_1=function(t){return o.Std.le(t,0)?0:1},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=o.Std.hl2(this._context),n=this._context.new_var(i),r=o.Std.sma(n,5,this._context),s=this._context.new_var(i),a=o.Std.sma(s,34,this._context),l=this.f_0(r,a),c=l,h=this._context.new_var(l),u=o.Std.change(h),d=this.f_1(u),[c,d]}}},{name:"Balance of Power",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Balance of Power",shortDescription:"Balance of Power",is_price_study:!1,inputs:[],id:"Balance of Power@tv-basicstudies-1",scriptIdPart:"",name:"Balance of Power"},constructor:function(){this.f_0=function(t,e,i,o){return(t-e)/(i-o)},this.main=function(t,e){return this._context=t,this._input=e,[this.f_0(o.Std.close(this._context),o.Std.open(this._context),o.Std.high(this._context),o.Std.low(this._context))]}}},{name:"Bollinger Bands",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands",shortDescription:"BB",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,
max:50}],id:"Bollinger Bands@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands"},constructor:function(){this.f_0=function(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.stdev(l,n,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=a,_=u,f=d,[p,_,f]}}},{name:"Bollinger Bands %B",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:1},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],filledAreasStyle:{fill_0:{color:"#008080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands %B",shortDescription:"BB %B",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands %B@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands %B"},constructor:function(){this.f_0=function(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.f_3=function(t,e,i){return(t-e)/(i-e)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.stdev(l,n,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=this.f_3(i,d,u),_=p,[_]}}},{name:"Bollinger Bands Width",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands Width",shortDescription:"BBW",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands Width@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands Width"},constructor:function(){this.f_0=function(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.f_3=function(t,e,i){return(t-e)/i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=o.Std.close(this._context),
n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.stdev(l,n,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=this.f_3(u,d,a),_=p,[_]}}},{name:"Chaikin Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Money Flow",shortDescription:"CMF",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Chaikin Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Money Flow"},constructor:function(){this.f_0=function(t,e,i,n){return o.Std.or(o.Std.and(o.Std.eq(t,e),o.Std.eq(t,i)),o.Std.eq(e,i))?0:(2*t-i-e)/(e-i)*n},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),r=this._context.new_var(n),s=o.Std.sum(r,i,this._context),a=o.Std.volume(this._context),l=this._context.new_var(a),c=o.Std.sum(l,i,this._context),h=this.f_1(s,c),u=h,[u]}}},{name:"Chaikin Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:3,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Oscillator",shortDescription:"Chaikin Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"short",defval:3,type:"integer",min:1,max:2e3},{id:"in_1",name:"long",defval:10,type:"integer",min:1,max:2e3}],id:"Chaikin Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Oscillator"},constructor:function(){this.f_0=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.accdist(this._context),s=this._context.new_var(r),a=o.Std.ema(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Chande Kroll Stop",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10,in_1:1,in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Long",
histogramBase:0,joinPoints:!1},plot_1:{title:"Short",histogramBase:0,joinPoints:!1}},description:"Chande Kroll Stop",shortDescription:"Chande Kroll Stop",is_price_study:!0,inputs:[{id:"in_0",name:"p",defval:10,type:"integer",min:1,max:4999},{id:"in_1",name:"x",defval:1,type:"integer",min:1,max:1e12},{id:"in_2",name:"q",defval:9,type:"integer",min:1,max:1e12}],id:"Chande Kroll Stop@tv-basicstudies-1",scriptIdPart:"",name:"Chande Kroll Stop"},constructor:function(){this.f_0=function(t,e,i){return t-e*i},this.f_1=function(t,e,i){return t+e*i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.high(this._context),a=this._context.new_var(s),l=o.Std.highest(a,i,this._context),c=o.Std.atr(i,this._context),h=this.f_0(l,n,c),u=this._context.new_var(s),d=o.Std.lowest(u,i,this._context),p=this.f_1(d,n,c),_=this._context.new_var(h),f=o.Std.highest(_,r,this._context),m=this._context.new_var(p),g=o.Std.lowest(m,r,this._context),v=g,y=f,[v,y]}}},{name:"Chande Momentum Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chande Momentum Oscillator",shortDescription:"ChandeMO",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:2e3}],id:"Chande Momentum Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chande Momentum Oscillator"},constructor:function(){this.f_0=function(t){return o.Std.ge(t,0)?t:0},this.f_1=function(t){return o.Std.ge(t,0)?0:-t},this.f_2=function(t,e){return 100*t/e},this.f_3=function(t,e){return this.f_2(t-e,t+e)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.change(r),a=this.f_0(s),l=this.f_1(s),c=this._context.new_var(a),h=o.Std.sum(c,i,this._context),u=this._context.new_var(l),d=o.Std.sum(u,i,this._context),p=this.f_3(h,d),_=p,[_]}}},{name:"Chop Zone",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#34dddd",width:1,style:0},1:{color:"#006400",width:1,style:0},2:{color:"#98fb98",width:1,style:0},3:{color:"#00FF00",width:1,style:0},4:{color:"#8B0000",width:1,style:0},5:{color:"#FF0000",width:1,style:0},6:{color:"#FF7F00",width:1,style:0},7:{color:"#ffc04c",width:1,style:0},8:{color:"#FFFF00",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Chop Zone",shortDescription:"Chop Zone",is_price_study:!1,
palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"},2:{name:"Color 2"},3:{name:"Color 3"},4:{name:"Color 4"},5:{name:"Color 5"},6:{name:"Color 6"},7:{name:"Color 7"},8:{name:"Color 8"}},valToIndex:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8}}},inputs:[],id:"chop_zone@tv-basicstudies-1",scriptIdPart:"",name:"Chop Zone"},constructor:function(){this.f_0=function(){var t=o.Std.close(this._context),e=o.Std.hlc3(this._context),i=this._context.new_var(o.Std.high(this._context)),n=o.Std.highest(i,30,this._context),r=o.Std.lowest(i,30,this._context),s=25/(n-r)*r,a=this._context.new_var(t),l=this._context.new_var(o.Std.ema(a,34,this._context)),c=(l.get(1)-l.get(0))/e*s,h=o.Std.sqrt(1+c*c),u=o.Std.round(180*o.Std.acos(1/h)/3.141592653589793),d=o.Std.iff(o.Std.gt(c,0),-u,u),p=o.Std.and(o.Std.gt(d,-2.14),o.Std.le(d,-.71))?7:8,_=o.Std.and(o.Std.gt(d,-3.57),o.Std.le(d,-2.14))?6:p,f=o.Std.and(o.Std.gt(d,-5),o.Std.le(d,-3.57))?5:_,m=o.Std.le(d,-5)?4:f,g=o.Std.and(o.Std.lt(d,2.14),o.Std.ge(d,.71))?3:m,v=o.Std.and(o.Std.lt(d,3.57),o.Std.ge(d,2.14))?2:g,y=o.Std.and(o.Std.lt(d,5),o.Std.ge(d,3.57))?1:v;return[1,o.Std.ge(d,5)?0:y]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Choppiness Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:61.8},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:38.2}],filledAreasStyle:{fill_0:{color:"#008000",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Choppiness Index",shortDescription:"CHOP",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Choppiness Index@tv-basicstudies-1",scriptIdPart:"",name:"Choppiness Index"},constructor:function(){this.f_0=function(t,e,i,n){return 100*o.Std.log10(t/(e-i))/n},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=this._input(0),n=o.Std.atr(1,this._context),r=this._context.new_var(n),s=o.Std.sum(r,i,this._context),a=o.Std.high(this._context),l=this._context.new_var(a),c=o.Std.highest(l,i,this._context),h=o.Std.low(this._context),u=this._context.new_var(h),d=o.Std.lowest(u,i,this._context),p=o.Std.log10(i),_=this.f_0(s,c,d,p),f=_,[f]}}},{name:"Commodity Channel Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:100},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-100}],
filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Commodity Channel Index",shortDescription:"CCI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Commodity Channel Index@tv-basicstudies-1",scriptIdPart:"",name:"Commodity Channel Index"},constructor:function(){this.f_0=function(t,e,i){return(t-e)/(.015*i)},this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=o.Std.hlc3(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.sma(r,n,this._context),a=this._context.new_var(i),l=o.Std.dev(a,n,this._context),c=this.f_0(i,s,l),h=c,[h]}}},{name:"Connors RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:3,in_1:2,in_2:100}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"CRSI",histogramBase:0,joinPoints:!1}},description:"Connors RSI",shortDescription:"CRSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"RSI Length",defval:3,type:"integer",min:1},{id:"in_1",name:"UpDown Length",defval:2,type:"integer",min:1},{id:"in_2",name:"ROC Length",defval:100,type:"integer",min:1}],id:"Connors RSI@tv-basicstudies-1",scriptIdPart:"",name:"Connors RSI"},constructor:function(){this.f_1=function(t,e,i){var n=i.new_var(o.Std.max(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.f_2=function(t,e,i){var n=i.new_var(-o.Std.min(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.f_3=function(){var t=0;return function(e){var i=e.get(0),n=e.get(1);return t=i===n?0:i>n?o.Std.nz(t)<=0?1:o.Std.nz(t)+1:o.Std.nz(t)>=0?-1:o.Std.nz(t)-1,this._context.new_var(t)}}(),this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),r=this._input(0),s=this._input(1),a=this._input(2),l=o.Std.rsi(this.f_1(n,r,this._context),this.f_2(n,r,this._context)),c=this.f_3(n),h=o.Std.rsi(this.f_1(c,s,this._context),this.f_2(c,s,this._context)),u=this._context.new_var(o.Std.roc(n,1)),d=o.Std.percentrank(u,a),p=o.Std.avg(l,h,d),[p]}}},{name:"Coppock Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,
visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:14,in_2:11}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Coppock Curve",shortDescription:"Coppock Curve",is_price_study:!1,inputs:[{id:"in_0",name:"WMA Length",defval:10,type:"integer",min:-1e12,max:5e3},{id:"in_1",name:"Long RoC Length",defval:14,type:"integer",min:1,max:4999},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:1,max:4999}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve"},constructor:function(){this.f_0=function(t,e){return t+e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=this._context.new_var(s),l=o.Std.roc(a,n),c=this._context.new_var(s),h=o.Std.roc(c,r),u=this.f_0(l,h),d=this._context.new_var(u),p=o.Std.wma(d,i,this._context),_=p,[_]}}},{name:"Correlation Coeff",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:40,visible:!0,color:"#800080"}},precision:4,inputs:{in_0:"AAPL",in_1:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Correlation Coefficient",shortDescription:"CC",is_price_study:!1,inputs:[{id:"in_0",name:"sym",defval:"AAPL",type:"symbol"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Correlation Coeff@tv-basicstudies-1",scriptIdPart:"",name:"Correlation Coeff"},constructor:function(){this.init=function(t,e){this._context=t,this._input=e,this._context.new_sym(this._input(0),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=this._context.new_var(this._context.symbol.time),this._input(0),o.Std.period(this._context),n=o.Std.close(this._context),r=this._input(1),this._context.select_sym(1),s=this._context.new_var(this._context.symbol.time),a=o.Std.close(this._context),l=this._context.new_var(a),this._context.select_sym(0),c=l.adopt(s,i,0),h=this._context.new_var(n),u=this._context.new_var(c),d=o.Std.correlation(h,u,r,this._context),[d]}}},{name:"Detrended Price Oscillator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:21,in_1:!1}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"DPO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Detrended Price Oscillator",shortDescription:"DPO",is_price_study:!1,is_hidden_study:!1,id:"detrended_price_oscillator@tv-basicstudies-1",bands:[{id:"hline_0",name:"Zero",isHidden:!1}],inputs:[{id:"in_0",name:"Period",defval:21,type:"integer",min:1,max:1e12},{id:"in_1",name:"isCentered",defval:!1,type:"bool"}],scriptIdPart:"",
name:"Detrended Price Oscillator"},constructor:function(){this.f_0=function(){var t=this._input(0),e=this._input(1),i=Math.floor(t/2+1),n=this._context.new_var(o.Std.close(this._context)),r=this._context.new_var(o.Std.sma(n,t,this._context)),s=this._context.new_var(o.Std.close(this._context)),a=s.get(i)-r,l=o.Std.close(this._context)-r.get(i),c=e?a:l,h=-i;return[c,e?h:0]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_0();return[{value:i[0],offset:i[1]}]}}},{name:"Directional Movement Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"ADX",histogramBase:0,joinPoints:!1}},description:"Directional Movement",shortDescription:"DMI",is_price_study:!1,inputs:[{id:"in_0",name:"DI Length",defval:14,type:"integer",min:1,max:2e3},{id:"in_1",name:"ADX Smoothing",defval:14,type:"integer",min:1,max:50}],id:"Directional Movement Index@tv-basicstudies-1",scriptIdPart:"",name:"Directional Movement Index"},constructor:function(){this.f_0=function(t){return-t},this.f_1=function(t,e){return o.Std.and(o.Std.gt(t,e),o.Std.gt(t,0))?t:0},this.f_2=function(t,e){return 100*t/e},this.f_3=function(t,e){return t+e},this.f_4=function(t,e,i){return o.Std.abs(t-e)/(o.Std.eq(i,0)?1:i)},this.f_5=function(t){return 100*t},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.high(this._context),s=this._context.new_var(r),a=o.Std.change(s),l=o.Std.low(this._context),c=this._context.new_var(l),h=o.Std.change(c),u=this.f_0(h),d=o.Std.tr(this._context),p=this._context.new_var(d),_=o.Std.rma(p,i,this._context),f=this.f_1(a,u),m=this._context.new_var(f),g=o.Std.rma(m,i,this._context),v=this.f_2(g,_),y=o.Std.fixnan(v,this._context),b=this.f_1(u,a),S=this._context.new_var(b),w=o.Std.rma(S,i,this._context),T=this.f_2(w,_),x=o.Std.fixnan(T,this._context),C=this.f_3(y,x),P=this.f_4(y,x,C),L=this._context.new_var(P),I=o.Std.rma(L,n,this._context),k=this.f_5(I),A=y,M=x,E=k,[A,M,E]}}},{name:"Donchian Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,filledAreasStyle:{
fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Lower",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Basis",histogramBase:0,joinPoints:!1}},description:"Donchian Channels",shortDescription:"DC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_0",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=o.Std.low(this._context),r=this._context.new_var(n),s=o.Std.lowest(r,i,this._context),a=o.Std.high(this._context),l=this._context.new_var(a),c=o.Std.highest(l,i,this._context),h=o.Std.avg(c,s),u=s,d=c,p=h,[u,d,p]}}},{name:"Double Exponential Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double EMA",shortDescription:"DEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Double Exponential Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Double Exponential Moving Average"},constructor:function(){this.f_0=function(t,e){return 2*t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.ema(r,i,this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this.f_0(s,l),h=c,[h]}}},{name:"Ease of Movement",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:1e4,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Ease Of Movement",shortDescription:"EOM",is_price_study:!1,inputs:[{id:"in_0",name:"Divisor",defval:1e4,type:"integer",min:1,max:1e9},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement"},constructor:function(){this.f_0=function(t,e,i,o,n){return t*e*(i-o)/n},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.hl2(this._context),s=this._context.new_var(r),a=o.Std.change(s),l=this.f_0(i,a,o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),c=this._context.new_var(l),h=o.Std.sma(c,n,this._context),u=h,[u]}}},{name:"Elders Force Index",metainfo:{
_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Elder's Force Index",shortDescription:"EFI",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:13,type:"integer",min:1,max:2e3}],id:"Elders Force Index@tv-basicstudies-1",scriptIdPart:"",name:"Elders Force Index"},constructor:function(){this.f_0=function(t,e){return t*e},this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.change(r),a=this.f_0(s,o.Std.volume(this._context)),l=this._context.new_var(a),c=o.Std.ema(l,i,this._context),h=c,[h]}}},{name:"EMA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"EMA Cross",shortDescription:"EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"EMA Cross"},constructor:function(){this.f_0=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.ema(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=a,u=c,d=o.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"Envelope",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20,in_1:10,in_2:!1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},
plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Envelope",shortDescription:"Env",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"percent",defval:10,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"exponential",defval:!1,type:"bool"}],id:"Envelope@tv-basicstudies-1",scriptIdPart:"",name:"Envelope"},constructor:function(){this.f_0=function(t,e,i){return t?e:i},this.f_1=function(t,e){return t*(1+e)},this.f_2=function(t,e){return t*(1-e)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=o.Std.ema(a,n,this._context),c=this._context.new_var(i),h=o.Std.sma(c,n,this._context),u=this.f_0(s,l,h),d=r/100,p=this.f_1(u,d),_=this.f_2(u,d),f=u,m=p,g=_,[f,m,g]}}},{name:"Fisher Transform",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,bands:[{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:1.5},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:0},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:-1.5}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Fisher",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Trigger",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Fisher Transform",shortDescription:"Fisher",is_price_study:!1,bands:[{id:"hline_0",name:"Level",isHidden:!1},{id:"hline_1",name:"Level",isHidden:!1},{id:"hline_2",name:"Level",isHidden:!1},{id:"hline_3",name:"Level",isHidden:!1},{id:"hline_4",name:"Level",isHidden:!1}],inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e12}],id:"fisher_transform@tv-basicstudies-1",scriptIdPart:"",name:"Fisher Transform"},constructor:function(){this.f_0=function(t){var e=o.Std.lt(t,-.99)?-.999:t;return[o.Std.gt(t,.99)?.999:e]},this.f_1=function(){var t,e,i,n=this._input(0),r=this._context.new_var(o.Std.hl2(this._context)),s=o.Std.highest(r,n,this._context),a=this._context.new_var(o.Std.hl2(this._context)),l=o.Std.lowest(a,n,this._context),c=this._context.new_var(),h=this.f_0(.66*((o.Std.hl2(this._context)-l)/o.Std.max(s-l,.001)-.5)+.67*o.Std.nz(c.get(1)));return c.set(h[0]),t=this._context.new_var(),t.set(.5*o.Std.log((1+c.get(0))/o.Std.max(1-c.get(0),.001))+.5*o.Std.nz(t.get(1))),e=t.get(1),i=t.get(0),[i,e]},this.main=function(t,e){return this._context=t,this._input=e,this.f_1()}}},{name:"Historical Volatility",
metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Historical Volatility",shortDescription:"HV",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:1e12}],id:"historical_volatility@tv-basicstudies-1",scriptIdPart:"",name:"Historical Volatility"},constructor:function(){this.f_0=function(){var t=this._input(0),e=o.Std.or(o.Std.isintraday(this._context),o.Std.and(o.Std.isdaily(this._context),o.Std.eq(o.Std.interval(this._context),1)))?1:7,i=this._context.new_var(o.Std.close(this._context)),n=this._context.new_var(o.Std.log(o.Std.close(this._context)/i.get(1)));return[100*o.Std.stdev(n,t,this._context)*o.Std.sqrt(365/e)]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Hull MA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Hull Moving Average",shortDescription:"HMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Hull MA@tv-basicstudies-1",scriptIdPart:"",name:"Hull MA"},constructor:function(){this.f_0=function(t,e){return 2*t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=n/2,s=this._context.new_var(i),a=o.Std.wma(s,r,this._context),l=this._context.new_var(i),c=o.Std.wma(l,n,this._context),h=this.f_0(a,c),u=o.Std.sqrt(n),d=o.Std.round(u),p=this._context.new_var(h),_=o.Std.wma(p,d,this._context),f=_,[f]}}},{name:"Ichimoku Cloud",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0496ff"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#991515"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"},plot_3:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_4:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#008000",width:1,style:0},1:{color:"#FF0000",width:1,style:0}}}},filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:9,in_1:26,in_2:52,in_3:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",type:"line"},{id:"plot_4",type:"line"},{id:"plot_5",palette:"palette_0",target:"fill_0",type:"colorer"}],styles:{
plot_0:{title:"Conversion Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Base Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Lagging Span",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Lead 1",histogramBase:0,joinPoints:!1,isHidden:!1},plot_4:{title:"Lead 2",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ichimoku Cloud",shortDescription:"Ichimoku",is_price_study:!0,is_hidden_study:!1,id:"Ichimoku Cloud@tv-basicstudies-1",palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},filledAreas:[{id:"fill_0",objAId:"plot_3",objBId:"plot_4",type:"plot_plot",title:"Plots Background",isHidden:!1,palette:"palette_0"}],inputs:[{id:"in_0",name:"Conversion Line Periods",defval:9,type:"integer",min:1,max:1e12},{id:"in_1",name:"Base Line Periods",defval:26,type:"integer",min:1,max:1e12},{id:"in_2",name:"Lagging Span 2 Periods",defval:52,type:"integer",min:1,max:1e12},{id:"in_3",name:"Displacement",defval:26,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"Ichimoku Cloud"},constructor:function(){this.donchian=function(t){var e=this._context.new_var(o.Std.low(this._context)),i=this._context.new_var(o.Std.high(this._context));return o.Std.avg(o.Std.lowest(e,t,this._context),o.Std.highest(i,t,this._context))},this.f_1=function(){var t=this._input(0),e=this._input(1),i=this._input(2),n=this._input(3),r=this.donchian(t),s=this.donchian(e),a=o.Std.avg(r,s),l=this.donchian(i);return[r,s,o.Std.close(this._context),a,l,-n,n,n,o.Std.gt(a,l)?0:1]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_1();return[i[0],i[1],{value:i[2],offset:i[5]},{value:i[3],offset:i[6]},{value:i[4],offset:i[7]},i[8]]}}},{name:"Keltner Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:!0,in_1:20,in_2:1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Middle",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Keltner Channels",shortDescription:"KC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"useTrueRange",defval:!0,type:"bool"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"mult",defval:1,type:"float",min:-1e12,max:1e12}],id:"Keltner Channels@tv-basicstudies-1",scriptIdPart:"",name:"Keltner Channels"},constructor:function(){this.f_0=function(t,e,i,o){return t?e:i-o},this.f_1=function(t,e,i){return t+e*i},
this.f_2=function(t,e,i){return t-e*i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=o.Std.ema(a,r,this._context),c=this.f_0(n,o.Std.tr(this._context),o.Std.high(this._context),o.Std.low(this._context)),h=this._context.new_var(c),u=o.Std.ema(h,r,this._context),d=this.f_1(l,u,s),p=this.f_2(l,u,s),_=d,f=l,m=p,[_,f,m]}}},{name:"Klinger Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Klinger Oscillator",shortDescription:"Klinger Oscillator",is_price_study:!1,inputs:[],id:"Klinger Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Klinger Oscillator"},constructor:function(){this.f_0=function(t,e){return o.Std.ge(t,0)?e:-e},this.f_1=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=o.Std.hlc3(this._context),n=this._context.new_var(i),r=o.Std.change(n),s=this.f_0(r,o.Std.volume(this._context)),a=this._context.new_var(s),l=o.Std.ema(a,34,this._context),c=this._context.new_var(s),h=o.Std.ema(c,55,this._context),u=this.f_1(l,h),d=this._context.new_var(u),p=o.Std.ema(d,13,this._context),_=u,f=p,[_,f]}}},{name:"Know Sure Thing",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:10,in_1:15,in_2:20,in_3:30,in_4:10,in_5:10,in_6:10,in_7:15,in_8:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"KST",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Know Sure Thing",shortDescription:"KST",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"roclen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"roclen2",defval:15,type:"integer",min:1,max:2e3},{id:"in_2",name:"roclen3",defval:20,type:"integer",min:1,max:2e3},{id:"in_3",name:"roclen4",defval:30,type:"integer",min:1,max:2e3},{id:"in_4",name:"smalen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_5",name:"smalen2",defval:10,type:"integer",min:1,max:2e3},{id:"in_6",name:"smalen3",defval:10,type:"integer",min:1,max:2e3},{id:"in_7",name:"smalen4",defval:15,type:"integer",min:1,max:2e3},{id:"in_8",name:"siglen",defval:9,type:"integer",min:1,
max:2e3}],id:"Know Sure Thing@tv-basicstudies-1",scriptIdPart:"",name:"Know Sure Thing"},constructor:function(){this.f_0=function(t,e,i,o){return t+2*e+3*i+4*o},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E,V,D,O,B,R,z,F,N,W;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=this._input(3),a=this._input(4),l=this._input(5),c=this._input(6),h=this._input(7),u=this._input(8),d=o.Std.close(this._context),p=i,_=this._context.new_var(d),f=o.Std.roc(_,p),m=a,g=this._context.new_var(f),v=o.Std.sma(g,m,this._context),y=n,b=this._context.new_var(d),S=o.Std.roc(b,y),w=l,T=this._context.new_var(S),x=o.Std.sma(T,w,this._context),C=r,P=this._context.new_var(d),L=o.Std.roc(P,C),I=c,k=this._context.new_var(L),A=o.Std.sma(k,I,this._context),M=s,E=this._context.new_var(d),V=o.Std.roc(E,M),D=h,O=this._context.new_var(V),B=o.Std.sma(O,D,this._context),R=this.f_0(v,x,A,B),z=this._context.new_var(R),F=o.Std.sma(z,u,this._context),N=R,W=F,[N,W]}}},{name:"Least Squares Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:25,in_1:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Least Squares Moving Average",shortDescription:"LSMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:25,type:"integer",min:1,max:1e12},{id:"in_1",name:"Offset",defval:0,type:"integer",min:-1e12,max:1e12}],id:"Least Squares Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Least Squares Moving Average"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.linreg(s,i,n),l=a,[l]}}},{name:"Linear Regression Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Linear Regression Curve",shortDescription:"LRC",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3}],id:"Linear Regression Curve@tv-basicstudies-1",scriptIdPart:"",name:"Linear Regression Curve"},constructor:function(){this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.linreg(r,n,0),a=s,[a]}}},{name:"MA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"
},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA Cross",shortDescription:"MA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"MA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA Cross"},constructor:function(){this.f_0=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.sma(s,i,this._context),l=this._context.new_var(r),c=o.Std.sma(l,n,this._context),h=a,u=c,d=o.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"MA with EMA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"MA",histogramBase:0,joinPoints:!1},plot_1:{title:"EMA",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA with EMA Cross",shortDescription:"MA/EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Length MA",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Length EMA",defval:10,type:"integer",min:1,max:2e3}],id:"MA with EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA with EMA Cross"},constructor:function(){this.f_0=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.sma(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=a,u=c,d=o.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"Mass Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Mass Index",shortDescription:"Mass Index",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Mass Index@tv-basicstudies-1",scriptIdPart:"",name:"Mass Index"},
constructor:function(){this.f_0=function(t,e){return t-e},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.high(this._context),o.Std.low(this._context)),r=this._context.new_var(n),s=o.Std.ema(r,9,this._context),a=this._context.new_var(s),l=o.Std.ema(a,9,this._context),c=this.f_1(s,l),h=this._context.new_var(c),u=o.Std.sum(h,i,this._context),d=u,[d]}}},{name:"McGinley Dynamic",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"McGinley Dynamic",shortDescription:"McGinley Dynamic",is_price_study:!0,is_hidden_study:!1,id:"mcginley_dynamic@tv-basicstudies-1",inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"McGinley Dynamic"},constructor:function(){this.f_0=function(){var t,e=this._input(0),i=o.Std.close(this._context),n=this._context.new_var(i),r=o.Std.ema(n,e,this._context),s=this._context.new_var(),a=s.get(1)+(i-s.get(1))/(e*o.Std.pow(i/s.get(1),4));return s.set(o.Std.na(s.get(1))?r:a),t=s.get(0),[t]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Momentum",metainfo:{_metainfoVersion:30,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:10,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Mom",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Momentum",shortDescription:"Mom",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"Momentum@tv-basicstudies-1",scriptIdPart:"",name:"Momentum"},constructor:function(){this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=this._input(0),n=o.Std[this._input(1)](this._context),r=this._context.new_var(n),s=r.get(i),a=s?n-s:null,[a]}}},{name:"Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"}},precision:4,bands:[{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#9915ff",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Money Flow",shortDescription:"MFI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",
type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Money Flow"},constructor:function(){this.f_0=function(t,e,i){return t*(o.Std.le(e,0)?0:i)},this.f_1=function(t,e,i){return t*(o.Std.ge(e,0)?0:i)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.hlc3(this._context),r=this._context.new_var(n),s=o.Std.change(r),a=this.f_0(o.Std.volume(this._context),s,n),l=this._context.new_var(a),c=o.Std.sum(l,i,this._context),h=this.f_1(o.Std.volume(this._context),s,n),u=this._context.new_var(h),d=o.Std.sum(u,i,this._context),p=o.Std.rsi(c,d),_=p,[_]}}},{name:"Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average",shortDescription:"MA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),r=this._input(2),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=a,[{value:l,offset:r}]}}},{name:"Moving Average Channel",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#CC0000"}},precision:4,filledAreasStyle:{fill_0:{color:"#A2C4C9",transparency:90,visible:!0}},inputs:{in_0:20,in_1:20,in_2:0,in_3:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_1",type:"plot_plot",title:"Plots Background"}],description:"Moving Average Channel",shortDescription:"MAC",is_price_study:!0,inputs:[{id:"in_0",name:"Upper Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"Lower Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_2",name:"Upper Offset",defval:0,type:"integer",min:-1e4,max:1e4},{id:"in_3",name:"Lower Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Channel@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Channel"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,
i=o.Std.high(this._context),n=o.Std.low(this._context),r=this._input(0),s=this._input(1),a=this._input(2),l=this._input(3),c=this._context.new_var(i),h=this._context.new_var(n),u=o.Std.sma(c,r,this._context),d=o.Std.sma(h,s,this._context),[{value:u,offset:a},{value:d,offset:l}]}}},{name:"Moving Average Convergence/Divergence",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:12,in_1:26,in_3:"close",in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Histogram",histogramBase:0,joinPoints:!1},plot_1:{title:"MACD",histogramBase:0,joinPoints:!1},plot_2:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"MACD",shortDescription:"MACD",is_price_study:!1,inputs:[{id:"in_0",name:"fastLength",defval:12,type:"integer",min:1,max:2e3},{id:"in_1",name:"slowLength",defval:26,type:"integer",min:1,max:2e3},{id:"in_3",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"signalLength",defval:9,type:"integer",min:1,max:50}],id:"Moving Average Convergence/Divergence@tv-basicstudies-1",scriptIdPart:"",name:"MACD"},constructor:function(){this.f_0=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g;return this._context=t,this._input=e,i=o.Std[this._input(2)](this._context),n=this._input(0),r=this._input(1),s=this._input(3),a=this._context.new_var(i),l=o.Std.ema(a,n,this._context),c=this._context.new_var(i),h=o.Std.ema(c,r,this._context),u=this.f_0(l,h),d=this._context.new_var(u),p=o.Std.sma(d,s,this._context),_=this.f_0(u,p),f=_,m=u,g=p,[f,m,g]}}},{name:"Moving Average Exponential",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Exponential",shortDescription:"EMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Exponential@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Exponential"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),r=this._input(2),s=this._context.new_var(i),a=o.Std.ema(s,n,this._context),l=a,[{value:l,offset:r}]
}}},{name:"Moving Average Weighted",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Weighted",shortDescription:"WMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Weighted@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Weighted"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),r=this._input(2),s=this._context.new_var(i),a=o.Std.wma(s,n,this._context),l=a,[{value:l,offset:r}]}}},{name:"Net Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Net Volume",shortDescription:"Net Volume",is_price_study:!1,inputs:[],id:"Net Volume@tv-basicstudies-1",scriptIdPart:"",name:"Net Volume"},constructor:function(){this.f_0=function(t,e,i){return o.Std.gt(t,0)?e:o.Std.lt(i,0)?-e:0*e},this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),r=o.Std.change(n),s=this.f_0(r,o.Std.volume(this._context),r),a=s,[a]}}},{name:"On Balance Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"On Balance Volume",shortDescription:"OBV",is_price_study:!1,inputs:[],id:"On Balance Volume@tv-basicstudies-1",scriptIdPart:"",name:"On Balance Volume"},constructor:function(){this.f_0=function(t,e,i){return o.Std.gt(t,0)?e:o.Std.lt(i,0)?-e:0*e},this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),r=o.Std.change(n),s=this.f_0(r,o.Std.volume(this._context),r),a=o.Std.cum(s,this._context),l=a,[l]}}},{name:"Parabolic SAR",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:.02,in_1:.02,in_2:.2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},
description:"Parabolic SAR",shortDescription:"SAR",is_price_study:!0,inputs:[{id:"in_0",name:"start",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_1",name:"increment",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"maximum",defval:.2,type:"float",min:-1e12,max:1e12}],id:"Parabolic SAR@tv-basicstudies-1",scriptIdPart:"",name:"Parabolic SAR"},constructor:function(){this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.sar(i,n,r,this._context),a=s,[a]}}},{name:"Price Channel",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0080"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0496FF"}},precision:4,inputs:{in_0:20,in_1:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Highprice Line",histogramBase:0,joinPoints:!1},plot_1:{title:"Lowprice Line",histogramBase:0,joinPoints:!1},plot_2:{title:"Centerprice Line",histogramBase:0,joinPoints:!1}},description:"Price Channel",shortDescription:"PC",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"Offset Length",defval:0,type:"integer",min:1,max:2e3}],id:"Price Channel@tv-basicstudies-1",scriptIdPart:"",name:"Price Channel"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=o.Std.high(this._context),n=this._context.new_var(i),r=o.Std.low(this._context),s=this._context.new_var(r),a=this._input(0),l=this._input(1),c=o.Std.highest(n,a,this._context),h=o.Std.lowest(s,a,this._context),u=o.Std.avg(c,h),[{value:c,offset:l},{value:h,offset:l},{value:u,offset:l}]}}},{name:"Price Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10,in_1:21}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Price Oscillator",shortDescription:"PPO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:21,type:"integer",min:1,max:2e3}],id:"Price Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Price Oscillator"},constructor:function(){this.f_0=function(t,e){return(t-e)/e*100},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.sma(l,r,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Price Volume Trend",metainfo:{_metainfoVersion:42,isTVScript:!1,
isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"PVT",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Price Volume Trend",shortDescription:"PVT",is_price_study:!1,is_hidden_study:!1,id:"price_volume_trend@tv-basicstudies-1",inputs:[],scriptIdPart:"",name:"Price Volume Trend"},constructor:function(){this.f_0=function(){var t=this._context.new_var(o.Std.close(this._context));return[o.Std.cum(o.Std.change(t)/t.get(1)*o.Std.volume(this._context),this._context)]},this.main=function(t,e){return this._context=t,this._input=e,[this.f_0()[0]]}}},{name:"Rate Of Change",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ROC",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Rate Of Change",shortDescription:"ROC",is_price_study:!1,bands:[{id:"hline_0",name:"Zero Line",isHidden:!1}],inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e12}],id:"rate_of_change@tv-basicstudies-1",scriptIdPart:"",name:"Rate Of Change"},constructor:function(){this.main=function(t,e){var i,n,r;return this._context=t,this._input=e,i=this._context.new_var(o.Std.close(this._context)),n=this._input(0),r=100*(i.get(0)-i.get(n))/i.get(n),[r]}}},{name:"Relative Strength Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Strength Index",shortDescription:"RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Relative Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Strength Index"},constructor:function(){this.f_0=function(t){return o.Std.max(t,0)},this.f_1=function(t){return-o.Std.min(t,0)},this.f_2=function(t,e){return o.Std.eq(t,0)?100:o.Std.eq(e,0)?0:100-100/(1+e/t)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.change(r),a=this.f_0(s),l=this._context.new_var(a),c=o.Std.rma(l,n,this._context),
h=this.f_1(s),u=this._context.new_var(h),d=o.Std.rma(u,n,this._context),p=this.f_2(d,c),_=p,[_]}}},{name:"Relative Vigor Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"RVGI",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Relative Vigor Index",shortDescription:"RVGI",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Vigor Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Vigor Index"},constructor:function(){this.f_0=function(t,e){return t-e},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.open(this._context)),r=this._context.new_var(n),s=o.Std.swma(r,this._context),a=this._context.new_var(s),l=o.Std.sum(a,i,this._context),c=this.f_0(o.Std.high(this._context),o.Std.low(this._context)),h=this._context.new_var(c),u=o.Std.swma(h,this._context),d=this._context.new_var(u),p=o.Std.sum(d,i,this._context),_=this.f_1(l,p),f=this._context.new_var(_),m=o.Std.swma(f,this._context),g=_,v=m,[g,v]}}},{name:"Relative Volatility Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Volatility Index",shortDescription:"RVI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Volatility Index"},constructor:function(){this.f_0=function(t,e){return o.Std.le(t,0)?0:e},this.f_1=function(t,e){return o.Std.gt(t,0)?0:e},this.f_2=function(t,e){return t/(t+e)*100},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.stdev(r,i,this._context),a=this._context.new_var(n),l=o.Std.change(a),c=this.f_0(l,s),h=this._context.new_var(c),u=o.Std.ema(h,14,this._context),d=this.f_1(l,s),p=this._context.new_var(d),
_=o.Std.ema(p,14,this._context),f=this.f_2(u,_),m=f,[m]}}},{name:"SMI Ergodic Indicator/Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:5,in_1:20,in_2:5}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Indicator",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1},plot_2:{title:"Oscillator",histogramBase:0,joinPoints:!1}},description:"SMI Ergodic Indicator/Oscillator",shortDescription:"SMIIO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"siglen",defval:5,type:"integer",min:1,max:2e3}],id:"SMI Ergodic Indicator/Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"SMI Ergodic Indicator/Oscillator"},constructor:function(){this.f_0=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=this._context.new_var(s),l=o.Std.tsi(a,i,n,this._context),c=this._context.new_var(l),h=o.Std.ema(c,r,this._context),u=this.f_0(l,h),d=l,p=h,_=u,[d,p,_]}}},{name:"Smoothed Moving Average",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Smoothed Moving Average",shortDescription:"SMMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"smoothed_moving_average@tv-basicstudies-1",scriptIdPart:"",name:"Smoothed Moving Average"},constructor:function(){this.f_0=function(){var t,e=this._input(0),i=o.Std[this._input(1)](this._context),n=this._context.new_var(i),r=o.Std.sma(n,e,this._context),s=this._context.new_var(),a=(s.get(1)*(e-1)+i)/e;return s.set(o.Std.na(s.get(1))?r:a),t=s.get(0),[t]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Stochastic",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,
visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:75,visible:!0}},inputs:{in_0:14,in_1:1,in_2:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic",shortDescription:"Stoch",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"smoothK",defval:1,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=o.Std.high(this._context),l=o.Std.low(this._context),c=this._context.new_var(s),h=this._context.new_var(a),u=this._context.new_var(l),d=o.Std.stoch(c,h,u,i,this._context),p=this._context.new_var(d),_=o.Std.sma(p,n,this._context),f=this._context.new_var(_),m=o.Std.sma(f,r,this._context),g=_,v=m,[g,v]}}},{name:"Stochastic RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:80,visible:!0}},inputs:{in_0:14,in_1:14,in_2:3,in_3:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic RSI",shortDescription:"Stoch RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"lengthRSI",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"lengthStoch",defval:14,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothK",defval:3,type:"integer",min:1,max:1e4},{id:"in_3",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic RSI@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic RSI"},constructor:function(){this.f_1=function(t,e,i){var n=i.new_var(o.Std.max(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.f_2=function(t,e,i){var n=i.new_var(-o.Std.min(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y;return this._context=t,this._input=e,
i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._input(3),l=this._context.new_var(i),c=o.Std.rsi(this.f_1(l,n,this._context),this.f_2(l,n,this._context)),h=this._context.new_var(c),u=this._context.new_var(c),d=this._context.new_var(c),p=o.Std.stoch(h,u,d,r,this._context),_=this._context.new_var(p),f=o.Std.sma(_,s,this._context),m=this._context.new_var(f),g=o.Std.sma(m,a,this._context),v=f,y=g,[v,y]}}},{name:"TRIX",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:18}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"TRIX",histogramBase:0,joinPoints:!1}},description:"TRIX",shortDescription:"TRIX",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:18,type:"integer",min:1,max:2e3}],id:"TRIX@tv-basicstudies-1",scriptIdPart:"",name:"TRIX"},constructor:function(){this.f_0=function(t){return o.Std.log(t)},this.f_1=function(t){return 1e4*t},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context)),r=this._context.new_var(n),s=o.Std.ema(r,i,this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this._context.new_var(l),h=o.Std.ema(c,i,this._context),u=this._context.new_var(h),d=o.Std.change(u),p=this.f_1(d),_=p,[_]}}},{name:"Triple EMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Triple EMA",shortDescription:"TEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Triple EMA@tv-basicstudies-1",scriptIdPart:"",name:"Triple EMA"},constructor:function(){this.f_0=function(t,e,i){return 3*(t-e)+i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.ema(r,i,this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this._context.new_var(l),h=o.Std.ema(c,i,this._context),u=this.f_0(s,l,h),d=u,[d]}}},{name:"True Strength Indicator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:25,in_1:13,in_2:13}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",
histogramBase:0,joinPoints:!1},plot_1:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"True Strength Indicator",shortDescription:"True Strength Indicator",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"long",defval:25,type:"integer",min:1,max:4999},{id:"in_1",name:"short",defval:13,type:"integer",min:1,max:4999},{id:"in_2",name:"siglen",defval:13,type:"integer",min:1,max:4999}],id:"True Strength Indicator@tv-basicstudies-1",scriptIdPart:"",name:"True Strength Indicator"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=this._context.new_var(s),l=o.Std.tsi(a,n,i,this._context),c=l,h=this._context.new_var(c),[c,o.Std.ema(h,r,this._context)]}}},{name:"Ultimate Oscillator",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:14,in_2:28}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"UO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ultimate Oscillator",shortDescription:"UO",is_price_study:!1,inputs:[{id:"in_0",name:"length7",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"length14",defval:14,type:"integer",min:1,max:1e12},{id:"in_2",name:"length28",defval:28,type:"integer",min:1,max:1e12}],id:"ultimate_oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Ultimate Oscillator"},constructor:function(){this.f_0=function(t,e,i){var n=this._context.new_var(t),r=this._context.new_var(e);return[o.Std.sum(n,i,this._context)/o.Std.sum(r,i,this._context)]},this.f_1=function(){var t=this._input(0),e=this._input(1),i=this._input(2),n=this._context.new_var(o.Std.close(this._context)),r=o.Std.max(o.Std.high(this._context),n.get(1)),s=this._context.new_var(o.Std.close(this._context)),a=o.Std.min(o.Std.low(this._context),s.get(1)),l=o.Std.close(this._context)-a,c=r-a,h=this.f_0(l,c,t),u=this.f_0(l,c,e),d=this.f_0(l,c,i);return[100*(4*h[0]+2*u[0]+d[0])/7]},this.main=function(t,e){return this._context=t,this._input=e,this.f_1()}}},{name:"VWAP",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:0,transparency:0,visible:!0,color:"#3A6CA8"}},precision:4},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"VWAP",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"VWAP",shortDescription:"VWAP",is_price_study:!0,inputs:[],id:"VWAP@tv-basicstudies-1",scriptIdPart:"",name:"VWAP"},constructor:function(){this.f_1=function(t){t.hist=null,t.add_hist()},this.init=function(t,e){this._isNewSession=o.Std.createNewSessionCheck(t)},this.main=function(t,e){var i,n,r,s;return this._context=t,this._input=e,i=t.new_var(),n=t.new_var(),this._context.symbol.time&&(r=this._context.symbol.time,this._isNewSession(r)&&(this.f_1(i),this.f_1(n))),
i.set(o.Std.nz(i.get(1))+o.Std.hlc3(this._context)*o.Std.volume(this._context)),n.set(o.Std.nz(n.get(1))+o.Std.volume(this._context)),s=i.get(0)/n.get(0),[s]}}},{name:"VWMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"VWMA",shortDescription:"VWMA",is_price_study:!0,inputs:[{id:"in_0",name:"len",defval:20,type:"integer",min:1,max:1e4}],id:"VWMA@tv-basicstudies-1",scriptIdPart:"",name:"VWMA"},constructor:function(){this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.vwma(r,n,this._context),a=s,[a]}}},{name:"Volume Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Volume Oscillator",shortDescription:"Volume Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:4999},{id:"in_1",name:"longlen",defval:10,type:"integer",min:1,max:4999}],id:"Volume Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Volume Oscillator"},constructor:function(){this.f_0=function(t,e){return 100*(t-e)/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.volume(this._context),s=this._context.new_var(r),a=o.Std.ema(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Vortex Indicator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"VI +",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"VI -",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Vortex Indicator",shortDescription:"VI",is_price_study:!1,is_hidden_study:!1,id:"vortex_indicator@tv-basicstudies-1",inputs:[{id:"in_0",name:"Period",defval:14,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Vortex Indicator"},constructor:function(){this.f_0=function(){
var t=this._input(0),e=this._context.new_var(o.Std.low(this._context)),i=this._context.new_var(o.Std.abs(o.Std.high(this._context)-e.get(1))),n=o.Std.sum(i,t,this._context),r=this._context.new_var(o.Std.high(this._context)),s=this._context.new_var(o.Std.abs(o.Std.low(this._context)-r.get(1))),a=o.Std.sum(s,t,this._context),l=this._context.new_var(o.Std.atr(1,this._context)),c=o.Std.sum(l,t,this._context);return[n/c,a/c]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Willams %R",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-20},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-80}],filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Williams %R",shortDescription:"%R",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Willams %R@tv-basicstudies-1",scriptIdPart:"",name:"Willams %R"},constructor:function(){this.f_0=function(t,e,i){return 100*(t-e)/(e-i)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=o.Std.high(this._context),r=this._context.new_var(n),s=o.Std.highest(r,i,this._context),a=o.Std.low(this._context),l=this._context.new_var(a),c=o.Std.lowest(l,i,this._context),h=this.f_0(o.Std.close(this._context),s,c),u=h,[u]}}},{name:"Williams Alligator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:21,in_1:13,in_2:8}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Jaw",histogramBase:0,joinPoints:!1},plot_1:{title:"Teeth",histogramBase:0,joinPoints:!1},plot_2:{title:"Lips",histogramBase:0,joinPoints:!1}},description:"Williams Alligator",shortDescription:"Alligator",is_price_study:!0,inputs:[{id:"in_0",name:"jawLength",defval:21,type:"integer",min:1,max:2e3},{id:"in_1",name:"teethLength",defval:13,type:"integer",min:1,max:2e3},{id:"in_2",name:"lipsLength",defval:8,type:"integer",min:1,max:2e3}],id:"Williams Alligator@tv-basicstudies-1",scriptIdPart:"",name:"Williams Alligator"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,
i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.hl2(this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this._context.new_var(s),h=o.Std.ema(c,n,this._context),u=this._context.new_var(s),d=o.Std.ema(u,r,this._context),p=l,_=h,f=d,[{value:p,offset:8},{value:_,offset:5},{value:f,offset:3}]}}},{name:"Williams Fractals",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{plottype:"shape_triangle_down",visible:!0,location:"BelowBar",transparency:0,color:"#800000"},plot_1:{plottype:"shape_triangle_up",visible:!0,location:"AboveBar",transparency:0,color:"#808000"}},precision:4,inputs:{in_0:2}},plots:[{id:"plot_0",type:"shapes"},{id:"plot_1",type:"shapes"}],styles:{plot_0:{title:"Shapes",isHidden:!1},plot_1:{title:"Shapes",isHidden:!1}},description:"Williams Fractal",shortDescription:"Fractals",is_price_study:!0,is_hidden_study:!1,id:"Williams Fractals@tv-basicstudies-1",inputs:[{id:"in_0",name:"Periods",defval:2,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Williams Fractals",isCustomIndicator:!0},constructor:function(){this.f_0=function(){var t=this._input(0),e=this._context.new_var(o.Std.high(this._context)),i=o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t+2),e.get(t)),o.Std.lt(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))),o.Std.or(o.Std.or(o.Std.and(o.Std.lt(e.get(t+3),e.get(t)),o.Std.and(o.Std.and(o.Std.lt(e.get(t+2),e.get(t)),o.Std.eq(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t))))),o.Std.and(o.Std.and(o.Std.lt(e.get(t+4),e.get(t)),o.Std.lt(e.get(t+3),e.get(t))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))))),o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t+5),e.get(t)),o.Std.and(o.Std.lt(e.get(t+4),e.get(t)),o.Std.eq(e.get(t+3),e.get(t)))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t))))),o.Std.and(o.Std.and(o.Std.and(o.Std.lt(e.get(t+6),e.get(t)),o.Std.lt(e.get(t+5),e.get(t))),o.Std.and(o.Std.eq(e.get(t+4),e.get(t)),o.Std.le(e.get(t+3),e.get(t)))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))))))),n=this._context.new_var(o.Std.low(this._context))
;return[o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t+2),n.get(t)),o.Std.gt(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))),o.Std.or(o.Std.or(o.Std.and(o.Std.gt(n.get(t+3),n.get(t)),o.Std.and(o.Std.and(o.Std.gt(n.get(t+2),n.get(t)),o.Std.eq(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t))))),o.Std.and(o.Std.and(o.Std.gt(n.get(t+4),n.get(t)),o.Std.gt(n.get(t+3),n.get(t))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))))),o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t+5),n.get(t)),o.Std.and(o.Std.gt(n.get(t+4),n.get(t)),o.Std.eq(n.get(t+3),n.get(t)))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t))))),o.Std.and(o.Std.and(o.Std.and(o.Std.gt(n.get(t+6),n.get(t)),o.Std.gt(n.get(t+5),n.get(t))),o.Std.and(o.Std.eq(n.get(t+4),n.get(t)),o.Std.ge(n.get(t+3),n.get(t)))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))))))),i]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_0();return[{value:i[0],offset:-2},{value:i[1],offset:-2}]}}}]},function(t,e,i){"use strict";function o(t){this._options=t||{},this._setInput(),this._caption=$('<i class="interval-caption">').html("&nbsp;"),this._helpTooltipTrigger=$('<i class="help-tooltip-trigger apply-common-tooltip common-tooltip-below">').text("?").attr("title",$.t("Type the interval number for munute charts (i.e. 5 if it is going to be a five minute chart). Or number plus letter for H (Hourly), D (Daily), W (Weekly), M (Monthly) intervals (i.e. D or 2H)")),this._dialogTitle=$.t("Change Interval")}var n=i(97),r=i(104);o.prototype._setInput=function(){this._input=$('<input type="text" class="change-interval-input" autocomplete="off" maxlength="4">'),this._input.on("keypress",this._handleInput.bind(this)).on("input",function(){this._validate(),this._updateCaption()}.bind(this)).on("blur",function(){setTimeout(this._submit.bind(this),0)}.bind(this))},o.prototype._validate=function(){var t=this._input.val();this._parsed=r.parseIntervalValue(t),this._valid=!this._parsed.error,this._supported=!this._parsed.error&&r.intervalIsSupported(t),!this._supported||this._parsed.unit&&"H"!==this._parsed.unit||this._parsed.qty*("H"===this._parsed.unit?60:1)>1440&&(this._supported=!1)},o.prototype._updateCaption=function(){var t,e,i;this._valid&&this._supported?(e=this._parsed.qty||1,i=this._parsed.unit?{H:"hour",D:"day",W:"week",M:"month",S:"second"}[this._parsed.unit]:"minute",t=e+" "+$.t(i,{count:e}),this._input.add(this._caption).removeClass("error")):(t=this._parsed.error?"&nbsp;":$.t("Not applicable"),this._input.add(this._caption).addClass("error")),this._caption.html(t)},o.prototype._handleInput=function(t){if(13===t.which)return void this._submit()
;t.ctrlKey||t.metaKey||!t.charCode||!t.which||t.which<=32||r.isIntervalChar(String.fromCharCode(t.charCode))||t.preventDefault()},o.prototype._submit=function(){var t,e;TVDialogs.isOpen(this._dialogTitle)&&(this._valid&&this._supported&&(t=r.sanitizeIntervalValue(this._input.val()),e=n.interval.value(),t&&e!==t&&"function"==typeof this._options.callback&&this._options.callback(t)),TVDialogs.destroy(this._dialogTitle))},o.prototype._setInitialValue=function(t){var e,i;t=t||this._options.initialValue,e="",i=!1,t&&","!==t?e=r.sanitizeIntervalValue(t)||"":(t=n.interval.value(),e=t,i=!0),this._input.val(e),i&&this._input.select()},o.prototype.isValid=function(){return!!this._valid},o.prototype.show=function(t){var e=TVDialogs.createDialog(this._dialogTitle,{hideCloseCross:!0,addClass:"change-interval-dialog"}),i=e.find("._tv-dialog-content");return e.css("min-width",0),i.css("min-width",0).mousedown(function(t){this._input.is(t.target)||t.preventDefault()}.bind(this)).append(this._input.add(this._caption).add(this._helpTooltipTrigger)),TVDialogs.applyHandlers(e),TVDialogs.positionDialog(e),this._setInitialValue(t),this._validate(),this._updateCaption(),e},t.exports=o},function(t,e){"use strict";var i=function(){function t(t){switch(t){case"c67":case"m67":case"c45":return"copy";case"c86":case"m86":case"s45":return"paste";case"c88":case"m88":case"s46":return"cut"}}function e(t){var e=[];return t.shiftKey&&e.push("s"),t.ctrlKey&&e.push("c"),t.metaKey&&e.push("m"),t.altKey&&e.push("a"),e.push(t.keyCode),e.join("")}function i(t){var e=$.Event(u+":"+t);return $(window).trigger(e,{AppClipboard:_}),e}function o(o){var n,r,s;if((document.activeElement===document.body||document.activeElement===document.documentElement)&&(n=e(o),r=t(n))){if("keydown"===o.type)d[n]=!0;else if(d[n])return;if(document.getSelection){if(!document.getSelection().isCollapsed)return}else if(document.selection&&"None"!==document.selection.type)return;o.isDefaultPrevented()||(s=i(r),s.isDefaultPrevented()&&o.preventDefault())}}function n(t){t=t.originalEvent||t,t.key===h&&i("change")}function r(){p||($(document).on("keypress keydown",o),$(window).on("storage",n),p=!0)}function s(){$(document).off("keypress keydown",o),$(window).off("storage",n),$(window).off(u+":copy"),$(window).off(u+":paste"),$(window).off(u+":cut"),$(window).off(u+":change"),p=!1}function a(){try{return JSON.parse(TVLocalStorage.getItem(h))}catch(t){return null}}function l(t){if(null==t)return c();var e=JSON.stringify(t);e!==TVLocalStorage.getItem(h)&&(TVLocalStorage.setItem(h,e),i("change"))}function c(){TVLocalStorage.getItem(h)&&(TVLocalStorage.removeItem(h),i("change"))}var h="application-clipboard",u="appclip",d={},p=!1,_={init:r,set:l,get:a,clear:c,destroy:s};return _}();t.exports=i},,function(t,e,i){(function(e){"use strict";function o(t,i,o){var n={saveAsText:$.t("Save As..."),applyDefaultText:$.t("Apply Defaults")};this._toolName=t,this._applyTemplate=i,this._options=$.extend(n,o||{}),this._list=[],e.enabled("charting_library_base")||(this.templatesDeferred=this.loadData())}
var n=i(103).bindPopupMenu,r=i(204),s=r.SaveRenameDialog,a=r.InputField,l=i(123).createConfirmDialog,c=i(13).getLogger("Chart.LineToolTemplatesList");o._cache={},o.prototype.getData=function(){return this._list},o.prototype.loadData=function(){var t=this;return this._toolName in o._cache?(this._list=o._cache[this._toolName],$.Deferred().resolve()):$.get("/drawing-templates/"+this._toolName+"/",function(e){t._list=e,o._cache[t._toolName]=e}).error(function(){c.logWarn("Failed to load drawing template: "+t._toolName)})},o.prototype.templatesLoaded=function(){return this.templatesDeferred},o.prototype.invalidateToolCache=function(){delete o._cache[this._toolName]},o.prototype.createButton=function(t){var e,i=this;return t=$.extend({},t,i._options),e=$("<a></span></a>").addClass(t.buttonClass?t.buttonClass:"_tv-button").html(t.buttonInner?t.buttonInner:$.t("Template")+'<span class="icon-dropdown">'),n(e,null,{event:"button-popup",zIndex:t.popupZIndex,activeClass:t.popupActiveClass,direction:t.popupDirection}),e.bind("click",function(e){var o,n,r;e.stopPropagation(),$(this).is("active")||(o=[],"function"==typeof t.getDataForSaveAs&&(n=function(e){var o=JSON.stringify(t.getDataForSaveAs());i.saveTemplate(e,o)},o.push({title:t.saveAsText,action:i.showSaveDialog.bind(i,n),addClass:"special"})),"function"==typeof t.defaultsCallback&&o.push({title:t.applyDefaultText,action:t.defaultsCallback,addClass:"special"}),r=[],$.each(i._list,function(e,o){r.push({title:o,action:function(){i.loadTemplate.call(i,o,t.loadTemplateCallback)},deleteAction:function(){runOrSignIn(function(){var t=$.t("Do you really want to delete Drawing Template '{0}' ?").format(o),e=l({type:"modal",content:t});e.on("action:yes",function(t){i.removeTemplate.call(i,o),t.close()}),e.open()},{source:"Delete line tool template"})}})}),r.length&&(r.sort(function(t,e){return t=t.title.toUpperCase(),e=e.title.toUpperCase(),t===e?0:t>e?1:-1}),o.push({separator:!0}),o=o.concat(r)),$(this).trigger("button-popup",[o]))}),e},o.prototype.loadTemplate=function(t,e){var i=this;return $.get("/drawing-template/"+this._toolName+"/?templateName="+encodeURIComponent(t),function(t){i._applyTemplate(JSON.parse(t.content)),e&&e()}).error(function(t){c.logWarn(t.responseText)})},o.prototype.removeTemplate=function(t){if(t){var e=this;$.post("/remove-drawing-template/",{name:t,tool:e._toolName}).error(function(t){c.logWarn(t.responseText)}),e.invalidateToolCache(),e._list=$.grep(e._list,function(e){return e!==t})}},o.prototype.saveTemplate=function(t,e){var i,o,n,r,s=this;t&&e&&(t=TradingView.clean(t),i=-1!==$.inArray(t,s._list),o=function(){var o={name:t,tool:s._toolName,content:e},n=function(){i||s._list.push(t)};$.post("/save-drawing-template/",o,n).error(function(t){c.logWarn(t.responseText)}),s.invalidateToolCache()},i?(n=$.t("Drawing Template '{0}' already exists. Do you really want to replace it?").format(t),r=l({type:"modal",content:n}),r.on("action:yes",function(t){o(),t.close()}),r.open()):o())},o.prototype.deleteAction=function(t){var e=t,i=this;runOrSignIn(function(){
var t=$.t(" Do you really want to delete Drawing Template '{0}' ?").format(e),o=l({type:"modal",content:t});o.on("action:yes",function(t){i.removeTemplate.call(i,e),t.close()}),o.open()},{source:"Delete line tool template"})},o.prototype.showSaveDialog=function(t){var e="text",i=new s({fields:[new a({name:e,label:$.t("Template name")+":",maxLength:64,error:$.t("Please enter template name")})],title:$.t("Save Drawing Template As")});runOrSignIn(function(){i.show().then(function(i){t(i[e])})},{source:"Save line tool template",sourceMeta:"Chart"})},t.exports=o}).call(e,i(7))},function(t,e,i){(function(e){"use strict";function o(t,e,i){this.pane=t,this._isLeft=o.isLeft(e),this._properties=t.chart().properties().scalesProperties,this._disableContextMenu=!!i,this.jqCell=$(document.createElement("td")),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("price-axis"),this.jqCell.width(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=m(this._dv,new g(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=m(this._dv,new g(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._textWidthCache=new r,this.restoreDefaultCursor(),this.update(),v(this.jqCell,this,!0),this.dialog=this.pane.chart().dialog,this.contextMenu=null,this.actions={},this._isVisible=!0,this.priceScale().onMarksChanged.subscribe(this,this.onMarksChanged)}var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w;i(628),n=i(3).LineDataSource,r=i(218),s=i(73),a=s.Action,l=s.ActionSeparator,c=i(131),h=i(755),u=i(37),d=i(171),p=d.resizeCanvas,_=d.hardResizeCanvas,f=d.clearRect,m=d.addCanvasTo,g=d.Size,v=i(144).setMouseEventHandler,y=i(48).trackEvent,b=i(231).makeFont,S=i(270).ActionBinder,w=i(13).getLogger("Chart.PriceAxisWidget"),o.prototype._BORDER_SIZE=1,o.prototype._OFFSET_SIZE=1,o.prototype._TICK_LENGTH=3,o.LHS=1,o.RHS=2,o.isLeft=function(t){return t===o.LHS||t!==o.RHS&&(w.logDebug("PriceAxisWidget.isLeft: wrong side"),!1)},o.prototype.backgroundColor=function(){return this.pane.chart().properties().paneProperties.background.value()},o.prototype.lineColor=function(){return this._properties.lineColor.value()},o.prototype.textColor=function(){return this._properties.textColor.value()},o.prototype.fontSize=function(){return this._properties.fontSize.value()},o.prototype.baseFont=function(){return b(this.fontSize(),"Arial","")},o.prototype.rendererOptions=function(){var t,e,i;return this._rendererOptions||(this._rendererOptions={isLeft:this._isLeft,width:0,height:0,borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new r,_tickmarksCache:new h(11,"Arial","","#000"),
color:""}),t=this._rendererOptions,e=!1,t.color!==this.textColor()&&(t.color=this.textColor(),e=!0),t.fontSize!==this.fontSize()&&(i=this.fontSize(),t.fontSize=i,t.font=this.baseFont(),t.paddingTop=Math.floor(i/4.5),t.paddingBottom=Math.ceil(i/4.5),t.paddingInner=Math.max(Math.ceil(i/3-t.tickLength/2),0),t.paddingOuter=Math.ceil(i/3),t.baselineOffset=Math.round(i/10),t.widthCache.reset(),e=!0),e&&t._tickmarksCache.reset(t.fontSize,"Arial","",t.color),this.size&&(t.width=this.size.w,t.height=this.size.h),this._rendererOptions},o.prototype.mouseDownEvent=function(t){var i,o;!this.priceScale().isEmpty()&&e.enabled("chart_zoom")&&(i=this.pane.chart().model(),o=this.pane.state(),this._mousedown=!0,this.setCursor("ns-resize"),i.startScalePrice(o,this.priceScale(),t.localY))},o.prototype.pressedMouseMoveEvent=function(t){var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();e.scalePriceTo(i,o,t.localY)},o.prototype.mouseDownOutsideEvent=function(t){var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();this._mousedown&&(this._mousedown=!1,e.endScalePrice(i,o),this.restoreDefaultCursor())},o.prototype.mouseUpEvent=function(t){var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();this._mousedown=!1,e.endScalePrice(i,o),this.restoreDefaultCursor()},o.prototype._initActions=function(t){var e,i,n,r;this.pane.state()&&(e=this,this.actions.reset=new a({text:$.t("Reset Scale"),shortcut:"Alt+R",statName:"ResetScale"}),this.actions.reset.callbacks().subscribe(this,o.prototype.reset),i=function(t){this._undoModel.setLockScaleProperty(this._property,t.checked,e.priceScale().mainSource(),this._undoText)},delete this.actions.setLockScale,this.priceScale().mainSource()instanceof TradingView.Series&&(this.actions.setLockScale=new a({text:$.t("Lock Scale"),checkable:!0,checked:this.priceScale().mainSource().properties().lockScale.value(),statName:"ToggleLockScale"}),this._lockScaleBinding=new S(this.actions.setLockScale,this.priceScale().mainSource().properties().lockScale,this.pane.chart().model(),"Lock Scale",i),this._lockScaleBinding.setValue(this.priceScale().mainSource().properties().lockScale.value())),n=function(){this._undoModel.setAutoScaleProperty(this._property,this.value(),e.priceScale(),this._undoText)},this.actions.setAutoScale=new a({text:$.t("Auto Scale"),checkable:!0,checked:!0,statName:"ToggleAutoScale"}),this._autoScaleBinding=new S(this.actions.setAutoScale,this.priceScale().properties().autoScale,this.pane.chart().model(),"Undo AutoScale",n),this._autoScaleBinding.setValue(this._autoScaleBinding.property().value()),this.actions.setPercentage=new a({text:$.t("Percentage",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePercantage"}),r=function(){this._undoModel.setPercentProperty(this._property,this.value(),e.priceScale(),this._undoText)},this.actions.setPercentage.binding=new S(this.actions.setPercentage,this.priceScale().properties().percentage,this.pane.chart().model(),"Undo Percentage",r),this.actions.setLog=new a({text:$.t("Log Scale",{
context:"scale_menu"}),checkable:!0,checked:!1,statName:"ToggleLogScale"}),this.actions.setLog.binding=new S(this.actions.setLog,this.priceScale().properties().log,this.pane.chart().model(),"Undo Log Scale"),this.actions.alignLabels=new a({text:$.t("No Overlapping Labels",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePreciseLabels"}),this.actions.alignLabels.binding=new S(this.actions.alignLabels,this.priceScale().properties().alignLabels,this.pane.chart().model(),"No Overlapping Labels"),this._updateScalesActions())},o.prototype._updateScalesActions=function(){var t=this.priceScale(),e=t.mainSource()instanceof TradingView.Series,i=t.mainSource().properties();this.actions.setPercentage.setEnabled(!(t.isLog()||e&&i.lockScale.value()||e&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setLog.setEnabled(!(t.isPercent()||e&&i.lockScale.value()||e&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setAutoScale.setChecked(t._properties.autoScale.value()),this.actions.setAutoScale.setEnabled(!t.properties().autoScaleDisabled.value())},o.prototype.mouseClickEvent=function(t){},o.prototype.mouseDoubleClickEvent=function(t){this.reset(),y("GUI","Double click price scale")},o.prototype.contextMenuEvent=function(t,i){!this._disableContextMenu&&e.enabled("scales_context_menu")&&this._createContextMenu().show(t)},o.prototype._createContextMenu=function(){return c.createMenu(this.getContextMenuActions(),{statName:"PriceScaleContextMenu"})},o.prototype.getContextMenuActions=function(){var t,i;return this._initActions(),t=this.pane.chart().actions(),i=[],i.push(this.actions.reset,new l,t.showLeftAxis,t.showRightAxis,new l,this.actions.setAutoScale),this.actions.setLockScale&&i.push(this.actions.setLockScale),i.push(t.scaleSeriesOnly,new l,this.actions.setPercentage,this.actions.setLog,new l),e.enabled("fundamental_widget")||i.push(t.showSymbolLabelsAction,t.showSeriesLastValue,t.showSeriesPrevCloseValue),i.push(t.showStudyPlotNamesAction,t.showStudyLastValue),e.enabled("countdown")&&i.push(t.showCountdown),i.push(this.actions.alignLabels),!TradingView.onWidget()&&e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_scales")&&t.scalesProperties&&i.push(new l,t.scalesProperties),i},o.prototype.backLabels=function(t){var e,i,o,n,r,s=[],a=this.priceScale().orderedSources().slice(),l=this.pane,c=l.chart().model(),h=l.state(),u=[],d=c.sourceBeingMoved()||c.lineBeingEdited()||c.lineBeingCreated();if(d&&u.push(d),c.selectedSource()&&u.push(c.selectedSource()),c.hoveredSource()&&u.push(c.hoveredSource()),this.priceScale()===h.defaultPriceScale())for(e=this.pane.state().dataSources(),i=0;i<e.length;i++)h.isOverlay(e[i])&&a.push(e[i]);for(i=0;i<a.length;++i)if(o=a[i],(t||-1===u.indexOf(o))&&(n=o.priceAxisViews(h,o.priceScale())))for(r=0;r<n.length;r++)s.push(n[r]);return s},o.prototype.optimalWidth=function(){var t,e,i,o,n,r,s;if(!this.isVisible())return 0;if(t=0,e=this.rendererOptions(),this.pane.state())for(i=this.ctx,o=this.priceScale().marks(),i.setFont(this.baseFont()),
o.length>0&&(t=Math.max(e.widthCache.measureText(i,o[0].label),e.widthCache.measureText(i,o[o.length-1].label))),n=this.backLabels(!0),r=n.length;r--;)(s=e.widthCache.measureText(i,n[r].text()))>t&&(t=s);return Math.ceil(e.offsetSize+e.borderSize+e.tickLength+e.paddingInner+e.paddingOuter+t)},o.prototype.setSize=function(t){this.size&&this.size.equals(t)||(this.size=t,p(this.canvas,t),p(this.top_canvas,t),this.jqCell.css({width:t.w,"min-width":t.w,height:t.h}))},o.prototype.update=function(){},o.prototype._hightlightBackground=function(t,e,i){var o,n,r,s,a,l,c=e[0].price,h=e[0].price;for(o=1;o<e.length;o++)c=Math.min(c,e[o].price),h=Math.max(h,e[o].price);n=this.priceScale(),n.isPercent()&&i&&(r=i.firstValue(),c=n.priceRange().convertToPercent(c,r),h=n.priceRange().convertToPercent(h,r)),s=this.priceScale().priceToCoordinate(c),a=this.priceScale().priceToCoordinate(h),l="rgba(109, 158, 235, 0.3)",f(t,1,s,this.size.w-1,a-s,l)},o.prototype.drawBackground=function(t){var e,i,o,r;if(f(t,0,0,this.size.w,this.size.h,this.backgroundColor()),e=this.pane.chart().model(),(i=e.model().selectedSource())&&i.priceScale()===this.priceScale()&&i instanceof n){if(o=i.axisPoints(),0===o.length)return;this._hightlightBackground(t,o,i.ownerSource())}r=e.model().crossHairSource(),r.startMeasurePoint()&&this._hightlightBackground(t,r.measurePoints(),this.pane.state().mainDataSource())},o.prototype.drawBorder=function(t){var e,i,o;t.save(),t.fillStyle=this.lineColor(),e=this.size.h,this._isLeft?(t.translate(-.5,-.5),i=this.size.w-this._BORDER_SIZE-1,o=this.size.w-1):(t.translate(.5,-.5),i=0,o=i+this._BORDER_SIZE),t.fillRect(i,0,o-i,e),t.restore()},o.prototype.drawTickMarks=function(t){var e,i,o,n,r,s;if(t.save(),t.strokeStyle=this.lineColor(),e=this.priceScale().marks(),t.fillStyle=this.textColor(),t.setFont(this.baseFont()),i=this,t.translate(-.5,-.5),o=this.rendererOptions(),i._isLeft){for(t.fillStyle=i.lineColor(),t.beginPath(),n=this.size.w-i._OFFSET_SIZE-i._BORDER_SIZE-i._TICK_LENGTH,r=e.length;r--;)t.rect(n,e[r].coord,i._TICK_LENGTH,1);for(t.fill(),r=e.length;r--;)o._tickmarksCache.paintTo(t,e[r].label,n-o.paddingInner,e[r].coord,"right")}else{for(t.fillStyle=i.lineColor(),t.beginPath(),s=i._BORDER_SIZE+i._OFFSET_SIZE,r=e.length;r--;)t.rect(s,e[r].coord,i._TICK_LENGTH,1);for(t.fill(),r=e.length;r--;)o._tickmarksCache.paintTo(t,e[r].label,s+i._TICK_LENGTH+o.paddingInner,e[r].coord,"left")}t.restore()},o.prototype._alignLabels=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f=this.size.h/2,m=[],g=this.priceScale().orderedSources().slice(),v=this.pane,y=v.state(),b=this.rendererOptions();if(this.priceScale()===y.defaultPriceScale())for(t=this.pane.state().dataSources(),e=0;e<t.length;e++)y.isOverlay(t[e])&&g.push(t[e]);for(i=this.priceScale().mainSource(),e=0;e<g.length;++e)if(o=g[e],n=o.priceAxisViews(y,o.priceScale())){for(r=0;r<n.length;r++)s=n[r],s.isVisible()&&m.push(s);i===o&&n.length>0&&(f=n[0].floatCoordinate())}for(a=m.filter(function(t){return t.floatCoordinate()<=f}),l=m.filter(function(t){return t.floatCoordinate()>f}),
a.sort(function(t,e){return e.floatCoordinate()-t.floatCoordinate()}),a.length&&l.length&&l.push(a[0]),l.sort(function(t,e){return t.floatCoordinate()-e.floatCoordinate()}),c=m.length,e=0;e<c;e++)s=m[e],s.setFixedCoordinate(s.coordinate());if(h=this.priceScale().properties(),h.alignLabels&&h.alignLabels.value()){for(e=1;e<a.length;e++)s=a[e],u=a[e-1],d=u.height(b,!1),p=s.coordinate(),_=u.getFixedCoordinate(),(p||_)&&p>_-d&&s.setFixedCoordinate(_-d);for(r=1;r<l.length;r++)s=l[r],u=l[r-1],d=u.height(b,!0),p=s.coordinate(),_=u.getFixedCoordinate(),(p||_)&&p<_+d&&s.setFixedCoordinate(_+d)}},o.prototype.drawBackLabels=function(t){var e,i,o,n;for(t.save(),e=this.backLabels(),i=this.rendererOptions(),o=0;o<e.length;o++)n=e[o],n.renderer().draw(t,i);t.restore()},o.prototype.drawCrossHairLabel=function(t){var e,i,o,n,r,s,a=this.pane.chart().model().model(),l=[],c=a.sourceBeingMoved()||a.lineBeingEdited()||a.lineBeingCreated();for(c&&l.push({source:c,scale:c.priceScale()}),a.selectedSource()&&l.push({source:a.selectedSource(),scale:a.selectedSource().priceScale()}),a.hoveredSource()&&l.push({source:a.hoveredSource(),scale:a.hoveredSource().priceScale()}),l.push({source:a.crossHairSource(),scale:this.priceScale()}),e=this.pane.state(),i=0;i<l.length;i++)if(o=l[i],n=o.source.priceAxisViews(e,o.scale))for(r=0;r<n.length;r++)s=n[r],t.save(),s.renderer().draw(t,this.rendererOptions()),t.restore()},o.prototype.priceScale=function(){var t=this.pane.state(),e=[];return e=this._isLeft?[t.leftPriceScale(),t.rightPriceScale()]:[t.rightPriceScale(),t.leftPriceScale()],null===e[0].mainSource()?null===e[1].mainSource()?e[0]:e[1]:e[0]},o.prototype.isVisible=function(){return this._isVisible},o.prototype.setVisible=function(t){(t=!!t)!==this._isVisible&&(t?this.jqCell.css("display","table-cell"):this.jqCell.css("display","none"),this._isVisible=t)},o.prototype.setAutoScale=function(t){var e=this.pane.state,i=this.priceScale();this.pane.chart().model().setPriceAutoScale(e,i,t)},o.prototype.reset=function(){var t=this.pane.state(),e=this.priceScale();this.pane.chart().model().resetPriceScale(t,e)},o.prototype.hardResetCanvas=function(){this.size&&(_(this.canvas,this.size),_(this.top_canvas,this.size))},o.prototype.paint=function(t){this._isVisible&&t&&(t===u.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx)):(this._alignLabels(),this.drawBackground(this.ctx),this.drawBorder(this.ctx),this.pane.state()&&(this.drawTickMarks(this.ctx),this.drawBackLabels(this.ctx),this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx))))},o.prototype.restoreDefaultCursor=function(){this.setCursor("")},o.prototype.setCursor=function(t){var e="";"grabbing"!==t&&"ns-resize"!==t||(e="price-axis--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),e&&this.jqCell.addClass(e),this._currentCursorClassName=e,this.jqCell.css("cursor"))},o.prototype.image=function(){var t={}
;return t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t},o.prototype.onMarksChanged=function(){var t,e=this.optimalWidth();this._prevOptimalWidth<e&&(t=this,this.updateTimeout||(this.updateTimeout=setTimeout(function(){t.pane&&t.pane.chart&&t.pane.chart()&&t.pane.chart().model().model().fullUpdate(),t.updateTimeout=null},100))),this._prevOptimalWidth=e},t.exports=o}).call(e,i(7))},function(t,e,i){function o(t,e,i,s,a){if(!i)return void r.logDebug("Missed undo model");n.call(this,t,e,!0,i,s),a?t.callbacks().subscribe(this,a):t.callbacks().subscribe(this,o.prototype.onActionCallback)}var n=i(406).Binding,r=i(13).getLogger("Chart.PropertyPage.ActionBinder");inherit(o,n),o.prototype.onActionCallback=function(t){this._undoModel.setProperty(this._property,this.value(),this._undoText)},o.prototype.value=function(){return this.control().checked},o.prototype.setValue=function(t){return this.control().checked=!!t},e.ActionBinder=o},function(t,e,i){(function(t){function o(t,e,i,o,n){c.call(this,t,e),this._study=i,this._showOnlyConfirmInputs=o,this._symbolSearchZindex=n,this.prepareLayout(),this._$symbolSearchPopup=null}var n=i(10),r=n.UppercaseTransformer,s=n.SymbolBinder,a=n.BarTimeBinder,l=n.SessionBinder,c=n.PropertyPage,h=n.GreateTransformer,u=n.LessTransformer,d=n.ToIntTransformer,p=n.ToFloatTransformer,_=n.SimpleComboBinder,f=n.BooleanBinder,m=n.SimpleStringBinder,g=i(104),v=i(38).NumericFormatter,y=i(45),b=i(13).getLogger("Chart.Study.PropertyPage.Inputs");inherit(o,c),o.prototype.i18nCache=[window.t("open"),window.t("high"),window.t("low"),window.t("close"),window.t("hl2"),window.t("hlc3"),window.t("ohlc4")],o.prototype._addSessionEditor=function(t,e,i,o){var n,r,s,a,c,h;if("session"!==i.type)return void b.logError("Session editor adding FAILED: wrong input type.");n=function(t,e){var i,o=$("<td/>");o.appendTo(t),o.css("padding-left","0px"),o.css("padding-right","0px"),i=$("<input>"),i.attr("type","text"),i.addClass("ticker"),i.css("width","40px"),i.attr("id",e),i.appendTo(o)},r=function(t,e,i){var o,n=$("<td/>");n.css("padding-left",i),n.css("padding-right",i),n.appendTo(t),o=$("<div/>"),o.appendTo(n),o.append(e),o.css("font-size","150%")},s=$("<table/>"),s.appendTo(t),a=$("<tr/>"),a.appendTo(s),c=["start_hours","start_minutes","end_hours","end_minutes"],n.call(this,a,c[0]),r.call(this,a,":",0),n.call(this,a,c[1]),r.call(this,a,"-",4),n.call(this,a,c[2]),r.call(this,a,":",0),n.call(this,a,c[3]),h=!1,this.bindControl(new l(a,c,e,h,this.model(),o))},o.prototype.prepareLayoutImpl=function(e,i){function o(t){return(new v).format(t)}function n(t){return function(e){var i,o,n,r=this,s=null;if(0===e.indexOf("#")){if(i=e.slice(1,e.indexOf("$")),null===(o=tt._model.model().getStudyById(i)))return void b.logError("Can not get Study by id "+i);if(o.isStarted()||o.start(null,!0),!(n=o.sourceId()))return void b.logError("Can not get source id for "+o.metaInfo().id);s=e.replace(/^[^\$]+/,n)}!~e.indexOf("$")&&!~e.indexOf("#")||tt._study.isStarted()||tt._study.start(null,!0),
tt._study.testInputValue(t,e)?r.setValueToProperty(s||r.value()):r.setValue(tt._property.inputs[t.id].value())}}function l(t){return function(e){var i,o,n,r;if(t.hasOwnProperty(e)||0===e.indexOf("#")||!~e.indexOf("$"))return e;for(i=e.slice(0,e.indexOf("$")),o=tt._model.model().allStudies(),n=0;n<o.length;++n)if(r=o[n],r.sourceId()===i){e=e.replace(/^[^\$]+/,"#"+r.id());break}return e}}var c,S,w,T,x,C,P,L,I,k,A,M,E,V,D,O,B,R,z,F,N,W,H,U,j,q,G,Y,K,Z,X,J,Q,tt=this;for(c=0;c<e.inputs.length;c++)if(S=e.inputs[c],"first_visible_bar_time"!==(w=S.id)&&"last_visible_bar_time"!==w&&"time"!==S.type&&!S.isHidden&&(!this._showOnlyConfirmInputs||S.confirm)&&void 0===S.groupId){if(T=S.name||w.toLowerCase().replace(/\b\w/g,function(t){return t.toUpperCase()}),x="Change "+T,C=$("<tr/>"),C.appendTo(i),P=$("<td/>"),P.appendTo(C),P.addClass("propertypage-name-label"),P.text($.t(T,{context:"input"})),L=$("<td/>"),L.appendTo(C),I=null,k=null,A=null,"resolution"===S.type)I=$('<select><option value="1">1</option><option value="3">3</option><option value="5">5</option><option value="15">15</option><option value="30">30</option><option value="45">45</option><option value="60">1'+$.t("h",{context:"interval_short"})+'</option><option value="120">2'+$.t("h",{context:"interval_short"})+'</option><option value="180">3'+$.t("h",{context:"interval_short"})+'</option><option value="D">1'+$.t("D",{context:"interval_short"})+'</option><option value="W">1'+$.t("W",{context:"interval_short"})+"</option></select>");else if("symbol"===S.type)I=$('<input class="symbol-edit single">'),g.bindToInput(I,{onPopupOpen:function(t){this._$symbolSearchPopup=t,this._symbolSearchZindex&&t.css("z-index",this._symbolSearchZindex)}.bind(this),onPopupClose:function(){this._$symbolSearchPopup=null}.bind(this)});else if("session"===S.type)this._addSessionEditor(L,this._property.inputs[w],S,x);else if("source"===S.type){for(M={},E=["open","high","low","close","hl2","hlc3","ohlc4"],V=0;V<E.length;++V)M[E[V]]||(M[E[V]]=E[V]);if(D=this._study&&this._study.isChildStudy()){O=this._study.source(),B=O.title(!0,null,!0),R=y.getChildSourceInputTitles(S,this._study.source().metaInfo(),B);for(z in M)R[z]&&(M[z]=1===Object.keys(R).length?B:R[z])}if(t.enabled("study_on_study")&&this._study&&y.isSourceInput(S)&&(D||y.canBeChild(this._study.metaInfo()))){for(F=[this._study],F=F.concat(this._study.getAllChildren()),N=this._model.model().allStudies(),W=0;W<N.length;++W)if(H=N[W],-1===F.indexOf(H)&&H.canHaveChildren())if(U=H.title(!0,null,!0),j=H.sourceId()||"#"+H.id(),q=H.metaInfo(),G=q.styles,Y=q.plots||[],1===Y.length)M[j+"$0"]=U;else for(V=0;V<Y.length;++V)K=Y[V],~y.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(K.type)&&(M[j+"$"+V]=U+": "+(G&&G[K.id]&&G[K.id].title||K.id));k=n(S),A=l(M)}I=$(document.createElement("select"));for(Z in M)$("<option>").attr("value",Z).text(M[Z]).appendTo(I);L.addClass("js-value-cell")}else if(S.options)for(I=$("<select/>"),W=0;W<S.options.length;W++)Z=S.options[W],$("<option value='"+Z+"'>"+Z+"</option>").appendTo(I);else I=$("<input/>"),
"bool"===S.type?I.attr("type","checkbox"):I.attr("type","text");I&&(I.appendTo(L),I.is(":checkbox")||I.css("width","100px")),S.options?this.bindControl(new _(I,this._property.inputs[w],null,!0,this.model(),x,k,A)):"bar_time"===S.type?(X=10,this.bindControl(new a(I,this._property.inputs[w],!0,this.model(),x,this.model().mainSeries(),X)),I.addClass("ticker")):"integer"===S.type?(J=[d(S.defval)],(0===S.min||S.min)&&J.push(h(S.min)),(0===S.max||S.max)&&J.push(u(S.max)),this.bindControl(new m(I,this._property.inputs[w],J,!1,this.model(),x)),I.addClass("ticker"),isFinite(S.step)&&S.step>0&&I.attr("data-step",S.step)):"float"===S.type?(J=[p(S.defval)],(0===S.min||S.min)&&J.push(h(S.min)),(0===S.max||S.max)&&J.push(u(S.max)),Q=new m(I,this._property.inputs[w],J,!1,this.model(),x),Q.addFormatter(o),this.bindControl(Q),I.addClass("ticker"),isFinite(S.step)&&S.step>0&&I.attr("data-step",S.step)):"text"===S.type?this.bindControl(new m(I,this._property.inputs[w],null,!1,this.model(),x)):"bool"===S.type?this.bindControl(new f(I,this._property.inputs[w],!0,this.model(),x)):"resolution"===S.type?this.bindControl(new _(I,this._property.inputs[w],r,!0,this.model(),"Change Interval")):"symbol"===S.type&&this.bindControl(new s(I,this._property.inputs[w],!0,this.model(),"Change Symbol"))}this._property.offset&&(T=this._property.offset.title?this._property.offset.title.value():$.t("Offset"),I=this.addOffsetEditorRow(i,T),J=[d(this._property.offset.val)],J.push(h(this._property.offset.min)),J.push(u(this._property.offset.max)),this.bindControl(new m(I,this._property.offset.val,J,!1,this.model(),"Undo "+T))),this._property.offsets&&$.each(e.plots,function(t,e){var o,n,r,s;this._property.offsets[e.id]&&(o=this._property.offsets[e.id],void 0!==o.isHidden&&o.isHidden.value()||(n=o.title.value(),r=this.addOffsetEditorRow(i,n),s=[d(o.val)],s.push(h(o.min)),s.push(u(o.max)),this.bindControl(new m(r,o.val,s,!1,this.model(),"Undo "+n))))}.bind(this))},o.prototype.prepareLayout=function(){this._table=$("<table/>"),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2");var t=this._study.metaInfo();this.prepareLayoutImpl(t,this._table),this.loadData()},o.prototype.symbolSearchPopup=function(){return this._$symbolSearchPopup},o.prototype.widget=function(){return this._table},e.StudyInputsPropertyPage=o}).call(e,i(7))},function(t,e,i){"use strict";function o(){this.backColorers=[]}function n(t){o.call(this),this._series=t}function r(t,e){o.call(this),this._study=t,this._plotIndex=e}var s=i(42).PlotRowSearchMode;o.prototype.barStyle=function(t,e,i){var o,n={};for(o=this.backColorers.length-1;o>=0;o--)this.backColorers[o].applyBarStyle(t,e,n,i);return this.applyBarStyle(t,e,n,i),n},o.prototype.pushBackBarColorer=function(t){this.backColorers.push(t)},o.prototype.applyBarStyle=function(t,e,i){throw Error("This function is supposed to be reimplemented in a subclass")},inherit(n,o),n.prototype.applyBarStyle=function(t,e,i,o){var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;switch(i||(i={}),i.barColor=null,
i.barBorderColor=null,i.barWickColor=null,i.isBarHollow=null,i.isBarUp=null,i.upColor=null,i.downColor=null,i.isTwoColorBar=null,n=this._series.properties(),n.style.value()){case TradingView.Series.STYLE_LINE:i.barColor=n.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:i.barColor=n.areaStyle.linecolor.value();break;case TradingView.Series.STYLE_BARS:r=n.barStyle.upColor.value(),s=n.barStyle.downColor.value(),a=r,l=s,c=this.findBar(t,!1,o),n.barStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(t,!1,o),i.barColor=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?r:s,i.barBorderColor=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?a:l):(i.barColor=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?r:s,i.barBorderColor=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?a:l);break;case TradingView.Series.STYLE_CANDLES:r=n.candleStyle.upColor.value(),s=n.candleStyle.downColor.value(),a=n.candleStyle.borderUpColor?n.candleStyle.borderUpColor.value():n.candleStyle.borderColor.value(),l=n.candleStyle.borderDownColor?n.candleStyle.borderDownColor.value():n.candleStyle.borderColor.value(),u=n.candleStyle.wickUpColor?n.candleStyle.wickUpColor.value():n.candleStyle.wickColor.value(),d=n.candleStyle.wickDownColor?n.candleStyle.wickDownColor.value():n.candleStyle.wickColor.value(),c=this.findBar(t,!1,o),n.candleStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(t,!1,o),p=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]):p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d;break;case TradingView.Series.STYLE_HOLLOW_CANDLES:r=n.hollowCandleStyle.upColor.value(),s=n.hollowCandleStyle.downColor.value(),a=n.hollowCandleStyle.borderUpColor?n.hollowCandleStyle.borderUpColor.value():n.hollowCandleStyle.borderColor.value(),l=n.hollowCandleStyle.borderDownColor?n.hollowCandleStyle.borderDownColor.value():n.hollowCandleStyle.borderColor.value(),u=n.hollowCandleStyle.wickUpColor?n.hollowCandleStyle.wickUpColor.value():n.hollowCandleStyle.wickColor.value(),d=n.hollowCandleStyle.wickDownColor?n.hollowCandleStyle.wickDownColor.value():n.hollowCandleStyle.wickColor.value(),c=this.findBar(t,!1,o),h=this.findPrevBar(t,!1,o),h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?(i.barColor=r,i.barBorderColor=a,i.barWickColor=u):(i.barColor=s,i.barBorderColor=l,i.barWickColor=d),c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?i.isBarHollow=!0:i.isBarHollow=!1;break;case TradingView.Series.STYLE_HEIKEN_ASHI:r=n.haStyle.upColor.value(),s=n.haStyle.downColor.value(),a=n.haStyle.borderUpColor.value(),l=n.haStyle.borderDownColor.value(),u=n.haStyle.wickUpColor.value(),d=n.haStyle.wickDownColor.value(),c=this.findBar(t,e,o),n.haStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(t,e,o),p=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]):p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d;break;case TradingView.Series.STYLE_RENKO:c=this.findBar(t,e,o),
p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],r=e?n.renkoStyle.upColorProjection.value():n.renkoStyle.upColor.value(),s=e?n.renkoStyle.downColorProjection.value():n.renkoStyle.downColor.value(),a=e?n.renkoStyle.borderUpColorProjection.value():n.renkoStyle.borderUpColor.value(),l=e?n.renkoStyle.borderDownColorProjection.value():n.renkoStyle.borderDownColor.value(),u=n.renkoStyle.wickUpColor.value(),d=n.renkoStyle.wickDownColor.value(),i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d,i.isBarUp=p;break;case TradingView.Series.STYLE_PB:c=this.findBar(t,e,o),p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],r=e?n.pbStyle.upColorProjection.value():n.pbStyle.upColor.value(),s=e?n.pbStyle.downColorProjection.value():n.pbStyle.downColor.value(),a=e?n.pbStyle.borderUpColorProjection.value():n.pbStyle.borderUpColor.value(),l=e?n.pbStyle.borderDownColorProjection.value():n.pbStyle.borderDownColor.value(),i.barColor=p?r:s,i.barBorderColor=p?a:l,i.isBarUp=p;break;case TradingView.Series.STYLE_KAGI:i.upColor=e?n.kagiStyle.upColorProjection.value():n.kagiStyle.upColor.value(),i.downColor=e?n.kagiStyle.downColorProjection.value():n.kagiStyle.downColor.value(),_=null,c=this.findBar(t,e,o),c[TradingView.LOW_PLOT]<c[TradingView.ADT_PLOT]&&c[TradingView.ADT_PLOT]<c[TradingView.HIGH_PLOT]?(_=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],i.isTwoColorBar=!0):(_=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?c[TradingView.OPEN_PLOT]===c[TradingView.ADT_PLOT]:c[TradingView.OPEN_PLOT]!==c[TradingView.ADT_PLOT],i.isTwoColorBar=!1),i.barColor=_?i.upColor:i.downColor,i.isBarUp=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT];break;case TradingView.Series.STYLE_PNF:c=this.findBar(t,e,o),p=c[TradingView.ADT_PLOT]>0,r=e?n.pnfStyle.upColorProjection.value():n.pnfStyle.upColor.value(),s=e?n.pnfStyle.downColorProjection.value():n.pnfStyle.downColor.value(),i.isBarUp=p,i.barColor=p?r:s;break;case TradingView.Series.STYLE_BASELINE:c=this.findBar(t,e,o),f=n.baselineStyle,m=this._series.priceScale(),g=Math.round(m.height()*(Math.abs(100-f.baseLevelPercentage.value())/100)),v=m.coordinateToPrice(g),c[TradingView.CLOSE_PLOT]>v?i.barColor=n.baselineStyle.topLineColor.value():i.barColor=n.baselineStyle.bottomLineColor.value()}return i},n.prototype.getSeriesBars=function(t){return t?this._series.nsBars():this._series.bars()},n.prototype._findBarFieldValue=function(t,e,i){var o=this.getSeriesBars(i).valueAt(t);if(null!==o)return o[e]},n.prototype.findBar=function(t,e,i){return i?i.value:this.getSeriesBars(e).valueAt(t)||[]},n.prototype.findPrevBar=function(t,e,i){var o,n;return i&&i.previousValue?i.previousValue:(o=this._series.bars(),n=o._search(t,s.Exact),null!==n&&n>0?this._series.bars()._valueAt(n-1):[])},inherit(r,o),r.prototype.applyBarStyle=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f;return i||(i={}),e?i:(o=this._study.properties(),o.visible.value()?(n=this._study.metaInfo(),(r=this._study.data())&&0!==r.size()?(s=n.plots[this._plotIndex],this._study.getMinFirstBarIndexForPlot(s.id)>t?i:(a=o.styles[s.id],
a.visible&&!a.visible.value()?i:(l=this._study.offset(s.id),null===(c=r.valueAt(t-l))?i:null==(h=c[this._plotIndex+1])?i:(h=Math.round(h),u=n.plots[this._plotIndex].palette,d=o.palettes,p=d[u],_=n.palettes[u].valToIndex?n.palettes[u].valToIndex[h]:h,f=p.colors[_].color.value(),i.barColor=f,i.upColor=f.color,i.downColor=f.color,i)))):i):i)},e.SeriesBarColorer=n,e.StudyBarColorer=r},function(t,e,i){"use strict";function o(t,e,i){this.source=t,this.pane=e,this._rendererFactory=i}function n(t,e){this._barWidth=t.barWidth,this._plates=t.plates,this._tooltip=t.tooltip,this._model=e}function r(){this._layout=[],this._currentId=void 0,this.tooltipHovered=!1}var s=i(1).Point,a=i(49).pointInCircle,l=i(4);o.prototype.update=function(){},o.prototype.renderer=function(){return this._rendererFactory(this.source)},n.prototype.draw=function(t){t.save();for(var e=0;e<this._plates.length;e++)if(this._plates[e].highlightByAuthor){this._highlightByAuthor=!0;break}this._plates.forEach(this._drawItem.bind(this,t)),this._tooltip.draw(this._plates.map(function(t){return this._plateTransform(t)}.bind(this)),t),this._tooltip.endDraw(),t.restore()},n.prototype._drawItem=function(t,e){t.save(),this._highlightByAuthor&&!e.highlightByAuthor&&(t.globalAlpha=.4);var i=this._dotTransform(e);i.mine?this._drawTriangle(t,i):this._drawDot(t,i),t.restore()},n.prototype._commonTransform=function(t){var e=Math.max(1.4*t.minSize,this._barWidth+4),i=t.y+{up:-1,down:1}[t.direction]*(e*(t.order+.6)+.25*e),o=TradingView.clone(t.overridedTheme||this.themes[t.theme]);return o.dotBorderWidth=t.hovered||t.highlightByAuthor?4:2,{id:t.id,theme:o,themeName:t.theme,x:Math.round(t.x+1),y:Math.round(i),pinned:t.pinned,hovered:t.hovered}},n.prototype._dotTransform=function(t){var e=this._commonTransform(t);return e.radius=Math.max(t.minSize/2,.4*this._barWidth),e.label=t.label,e.labelFontColor=t.labelFontColor,e.labelFontSize=Math.ceil(Math.max(10,Math.min(e.radius,20))),this._model.updateDotData(t,e)},n.prototype._plateTransform=function(t){var e=this._commonTransform(t);return this._model.updatePlateData(t,e)},n.THEMES=["green","red","neutral","yellow","blue"],n.prototype.themes={green:{border:"#78C143",background:"#8DDD54"},red:{border:"#CC4545",background:"#ED5A5A"},neutral:{border:"#EAC300",background:"#FFD400"},yellow:{border:"#EAC300",background:"#FFD400"},blue:{border:"#047ACE",background:"#0496FF"}},n.prototype._drawTriangle=function(t,e){var i,o,n,r;t.strokeStyle=e.theme.border,t.fillStyle=e.theme.background,t.lineWidth=e.theme.dotBorderWidth,i=e,o=e.radius,n=Math.cos(Math.PI/6)*o,r=Math.sin(Math.PI/6)*o,t.translate(i.x,i.y),"up"===e.direction&&t.rotate(Math.PI),e.public||(t.lineWidth/=2),t.beginPath(),t.moveTo(0,-o),t.lineTo(n,r),t.lineTo(-n,r),t.lineTo(0,-o),t.closePath(),t.stroke(),e.public&&t.fill()},n.prototype._drawDot=function(t,e){t.strokeStyle=e.theme.border,t.fillStyle=e.theme.background,t.lineWidth=e.theme.dotBorderWidth,t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI,!0),t.closePath(),t.stroke(),t.fill(),e.label&&e.radius>6&&(t.textAlign="center",
t.textBaseline="middle",t.font="bold "+e.labelFontSize+"px Arial",t.fillStyle=e.labelFontColor,t.fillText(e.label,e.x,e.y))},n.prototype.hitTest=function(t){var e,i;for(i=this._plates.length-1;i>=0;--i)if(e=this._hitTestDot(this._plates[i],t))return e;return null},n.prototype._hitTestDot=function(t,e){var i=this._dotTransform(t),o=new s(i.x,i.y);return a(e,o,Math.max(i.radius,8))?new l(l.REGULAR,t):null},r.prototype._createLayout=function(){throw Error("Child class must override this member")},r.prototype._updatePlate=function(t){throw Error("Child class must override this member")},r.prototype._getContainer=function(t){return this._container&&this._context===t||(this._context=t,this._container=$(t.canvas).parent()),this._container},r.prototype._plateArrowSize=14,r.prototype.showPlate=function(t,e){var i,o,n,r,s,a,l,c;this._currentId===t.id&&this._layout&&0!==this._layout.length&&null!=this._layout[0].parentNode||(this._currentId=t.id,this._createLayout(),this._getContainer(e).append(this._layout),i=this,this._layout.hover(function(){i.tooltipHovered=!0,$(this).stop(!0).fadeTo(0,1)},function(){i.tooltipHovered=!1})),o=Math.round(t.barWidth/2),o>15&&(o=15),o<10&&(o=10),this._updatePlate(t),n=e.canvas.getBoundingClientRect(),r=t.x-this._layout.outerWidth()<this._plateArrowSize,s=n.width-t.x+Math.round(t.barWidth/2+o),r&&(s-=this._layout.outerWidth()+2*this._plateArrowSize),a=n.height,l=20,c=10,this._layout.toggleClass("right",r),this._layout.css({top:Math.min(Math.max(t.y,l),a-this._layout.outerHeight()-c),right:s,fontSize:o+"px",display:"block"})},r.prototype._removeLayout=function(){this.tooltipHovered||(this._layout.stop(!0),this._layout.remove())},r.prototype._toggleLayout=function(t){this._layout.toggle(t)},r.prototype.hide=function(t){this.tooltipHovered?this._layout.stop(!0).fadeTo(0,1):this._layout.fadeOut(400,function(){$(this).remove(),t()})},r.prototype.setSource=function(t){this.source=t},e.BarsMarksContainerPaneView=o,e.BarsMarksContainerRenderer=n,e.BarMarkTooltip=r},,function(t,e,i){"use strict";function o(){}var n=i(21).assert,r=i(83),s=i(977);o.isValid=function(t){return!(!r[t]&&!s[t])},o.create=function(t,e,i,a,l){var c;return n(o.isValid(t),"Unknown line tool: "+t),c=r[t]||s[t],"LineToolVbPFixed"===t?new c(e,i,a,l):"LineToolRegressionTrend"===t?new c(e,i,a):["LineStudyMtpAnalysis","LineStudyMtpDecisionPoint","LineStudyMtpRiskReward","LineStudyMtpElliotWaveMain","LineStudyMtpElliotWaveMajor","LineStudyMtpElliotWaveMinor","LineStudyMtpDownWave1OrA","LineStudyMtpDownWave2OrB","LineStudyMtpDownWave3","LineStudyMtpDownWave4","LineStudyMtpDownWave5","LineStudyMtpDownWaveC","LineStudyMtpUpWave1OrA","LineStudyMtpUpWave2OrB","LineStudyMtpUpWave3","LineStudyMtpUpWave4","LineStudyMtpUpWave5","LineStudyMtpUpWaveC"].indexOf(t)>=0?new c(e,i,a):new c(e,i)},t.exports=o},function(t,e,i){(function(t){"use strict";function o(e,n){var r,s,c,d,p,_,f,m,g,v,y=n||new h("linetoolriskreward");a.call(this,e,y),this._properties.addExclusion&&(this._properties.addExclusion("stopLevel"),
this._properties.addExclusion("profitLevel")),n.stopLevel||n.profitLevel||(r=e.timeScale().visibleBars(),s=r.firstBar(),c=r.lastBar(),d=e.mainSeries().priceRange(s,c),p=e.mainSeries().priceScale(),p.isLog()&&(_=p.logicalToPrice(d.minValue()),f=p.logicalToPrice(d.maxValue()),d=new t(_,f)),p.isPercent()&&(m=e.mainSeries().firstValue(),_=p.priceRange().convertFromPercent(d.minValue(),m),f=p.priceRange().convertFromPercent(d.maxValue(),m),d=new t(_,f)),d&&!d.isEmpty()&&(g=Math.round(.2*d.length()*e.mainSeries().base()),y.merge({stopLevel:g,profitLevel:g}))),v=this,y.stopLevel.listeners().subscribe(this,this.recalculate),y.stopLevel.listeners().subscribe(null,function(){v.properties().stopPrice._listeners.fire(v.properties().stopPrice)}),y.profitLevel.listeners().subscribe(this,this.recalculate),y.profitLevel.listeners().subscribe(null,function(){v.properties().targetPrice._listeners.fire(v.properties().targetPrice)}),y.addChild("entryPrice",new o.PriceProperty(this,0)),y.addChild("stopPrice",new o.StopPriceProperty(this)),y.addChild("targetPrice",new o.TargetPriceProperty(this)),y.addProperty("riskSize",250),y.addProperty("qty",0),y.addProperty("amountTarget",y.accountSize.value()),y.addProperty("amountStop",y.accountSize.value()),this._riskInPercentsFormatter=new u(2),this._riskInMoneyFormatter=new u,y.risk.subscribe(this,this._recalculateRiskSize),y.accountSize.subscribe(this,this._recalculateRiskSize),y.riskDisplayMode.subscribe(this,this._recalculateRisk),y.riskDisplayMode.subscribe(this,this._recalculateRiskSize),y.entryPrice.subscribe(this,this._recalculateRiskSize),y.stopPrice.subscribe(this,this._recalculateRiskSize),y.profitLevel.subscribe(this,this._recalculateRiskSize),y.stopLevel.subscribe(this,this._recalculateRiskSize),y.qty.subscribe(this,this._recalculateRiskSize),"percents"===y.riskDisplayMode.value()&&y.risk.value()>100&&y.riskDisplayMode.setValueSilently("money"),this.version=o.version,this._entryPriceAxisView=new l(this,{colorProperty:y.linecolor,priceProperty:y.entryPrice}),this._stopPriceAxisView=new l(this,{colorProperty:y.stopBackground,priceProperty:y.stopPrice}),this._profitPriceAxisView=new l(this,{colorProperty:y.profitBackground,priceProperty:y.targetPrice}),i.e(1,function(t){var e=i(922).RiskRewardPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}function n(t,e){var i,n;this._constructor="LineToolRiskRewardShort",i=e||new h("linetoolriskrewardshort"),o.call(this,t,i),n=this.properties(),n.entryPrice.subscribe(this,this._recalculateQty),n.stopPrice.subscribe(this,this._recalculateQty),n.riskSize.subscribe(this,this._recalculateQty),n.entryPrice.subscribe(this,this._recalculateAmount),n.profitLevel.subscribe(this,this._recalculateAmount),n.stopLevel.subscribe(this,this._recalculateAmount),n.accountSize.subscribe(this,this._recalculateAmount),n.riskSize.subscribe(this,this._recalculateAmount),n.qty.subscribe(this,this._recalculateAmount)}function r(t,e){var i,n;this._constructor="LineToolRiskRewardLong",i=e||new h("linetoolriskrewardlong"),o.call(this,t,i),n=this.properties(),
n.entryPrice.subscribe(this,this._recalculateQty),n.stopPrice.subscribe(this,this._recalculateQty),n.riskSize.subscribe(this,this._recalculateQty),n.entryPrice.subscribe(this,this._recalculateAmount),n.profitLevel.subscribe(this,this._recalculateAmount),n.stopLevel.subscribe(this,this._recalculateAmount),n.accountSize.subscribe(this,this._recalculateAmount),n.riskSize.subscribe(this,this._recalculateAmount),n.qty.subscribe(this,this._recalculateAmount)}var s=i(21).ensureNotNull,a=i(3).LineDataSource,l=i(1137).LineToolRiskRewardPriceAxisView,c=i(44),h=i(11).DefaultProperty,u=i(38).NumericFormatter,d=i(9).propertyPages,p=i(488).RiskRewardPointIndex;inherit(o,a),o.prototype.riskFormatter=function(t){return"percents"===t?this._riskInPercentsFormatter:this._riskInMoneyFormatter},o.prototype.getRiskStep=function(t){return"percents"===t?.01:1},o.prototype._roundValue=function(t){return parseFloat(t.toFixed(2))},o.prototype._recalculateRisk=function(){var t=this.properties(),e=t.riskDisplayMode.value(),i=t.riskSize.value(),o=t.accountSize.value(),n=t.risk.value();n="percents"===e?this._roundValue(i/o*100):this._roundValue(o/100*n),this._riskInChange=!0,t.risk.setValue(this.riskFormatter(e).format(n)),this._riskInChange=!1},o.prototype._recalculateRiskSize=function(){var t,e,i,o;this._riskInChange||(t=this.properties(),e=t.risk.value(),i=t.riskDisplayMode.value(),o=t.accountSize.value(),"percents"===i?t.riskSize.setValue(e/100*o):e>o?(t.risk.setValue(o),t.riskSize.setValue(o)):t.riskSize.setValue(e))},o.version=2,o.prototype.i18nCache={title:$.t("Risk/Reward")},o.prototype.lastBarData=function(){var t,e,i,o,n,r=this._model.mainSeries().bars().firstIndex(),a=this._model.mainSeries().bars().lastIndex();return null===r||null===a||isNaN(r)||isNaN(a)?null:(t=this.points(),4===t.length?(e=t[p.ActualClose],e.index<r?null:{closePrice:e.price,index:Math.min(a,e.index)}):(i=t[p.Close],i.index<r?null:(o=Math.min(a,i.index),n=s(this._model.mainSeries().bars().valueAt(o)),{closePrice:n[TradingView.CLOSE_PLOT],index:o})))},o.prototype.migrateVersion=function(t,e,i){var o,n,r,s;1===t&&this._points.length>=1&&(o=[],o.push(this._points[0]),n=this._points[0],n={price:n.price,index:n.index+50},o.push(n),this._points[1]&&o.push(this._points[1]),this._points[2]&&o.push(this._points[2]),this._points=o,this._timePoint.length>=1&&(r=[],n=this._timePoint[0],r.push(n),s={price:n.price,time_t:n.time_t,offset:n.offset+50},r.push(s),this._timePoint[1]&&o.push(this._points[1]),this._timePoint[2]&&o.push(this._points[2]),this._timePoint=r))},o.prototype.checkAlert=function(){this.recalculate()},o.prototype.priceAxisViews=function(t,e){return this._isActualSymbol?e!==this.priceScale()||this._model.paneForSource(this)!==t?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]:null},o.prototype.updateAllViews=function(){this._isActualSymbol&&this._properties.visible.value()&&(c.hideAllDrawings().value()&&this.userEditEnabled()||(a.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),
this._profitPriceAxisView.update()))},o.prototype.setPoint=function(t,e){var i,o=this.priceScale();switch(o.isPercent()&&(i=this.ownerSource().firstValue(),e.price=o.priceRange().convertFromPercent(e.price,i)),t){case 0:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),a.prototype.setPoint.call(this,t,e),this.recalculate();break;case 1:this.properties().stopPrice.setValue(this.preparseStopPrice(e.price));break;case 2:this.properties().targetPrice.setValue(this.preparseProfitPrice(e.price));break;case 3:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),a.prototype.setPoint.call(this,1,e),this.recalculate()}},o.PriceProperty=function(t,e){a.PointPriceProperty.call(this,t,e)},inherit(o.PriceProperty,a.PointPriceProperty),o.PriceProperty.prototype.setValue=function(t){var e=this._lineSource.points()[this._pointIndex];e.price=parseFloat(t),this._lineSource.setPoint(this._pointIndex,e),this._lineSource.recalculate(),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(),this._lineSource._syncMultichartState()},o.StopPriceProperty=function(t){o.PriceProperty.call(this,t,1)},inherit(o.StopPriceProperty,o.PriceProperty),o.StopPriceProperty.prototype.value=function(){var t=this._lineSource.stopPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},o.StopPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().stopLevel.setValue(e),this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)},o.TargetPriceProperty=function(t){o.PriceProperty.call(this,t,2)},inherit(o.TargetPriceProperty,o.PriceProperty),o.TargetPriceProperty.prototype.value=function(){var t=this._lineSource.profitPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},o.TargetPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().profitLevel.setValue(e),this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel)},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return this.i18nCache.title},o.prototype.addPoint=function(t){var e,i;return t.price=this._roundPrice(t.price),a.prototype.addPoint.call(this,t,null,!0),e={price:t.price,index:t.index+50},a.prototype._addPointIntenal.call(this,e,null,!0),i=this.calculateActualEntry(t,e),i&&(a.prototype._addPointIntenal.call(this,i,null,!0),(e=this.findClosePoint(i,e))&&a.prototype._addPointIntenal.call(this,e,null,!0)),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},o.prototype._roundPrice=function(t){var e=this._model.mainSeries().base();return Math.round(t*e)/e},
o.prototype.recalculate=function(){var t,e,i,o,n;this.properties().interval.value()===this._model.mainSeries().interval()&&0!==this.points().length&&(t=this.properties().targetPrice.value(),e=this.properties().stopPrice.value(),i=[this._points[0],this._points[1]],o=this.calculateActualEntry(this.points()[0],this.points()[1]),o&&(i.push(o),(n=this.findClosePoint(o,this.points()[1]))&&i.push(n)),this._points=i,t!==this.properties().targetPrice.value()&&this.properties().targetPrice._listeners.fire(this.properties().targetPrice),e!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice))},o.prototype.start=function(){a.prototype.start.call(this),this.recalculate()},o.prototype.startMoving=function(t){t.price=this._roundPrice(t.price),a.prototype.startMoving.call(this,t)},o.prototype.move=function(t){t.price=this._roundPrice(t.price),a.prototype.move.call(this,t),this.recalculate(),this._entryPriceAxisView.update()},o.prototype.correctPoints=function(t){return a.prototype.correctPoints.call(this,[t[0],t[1]])},o.prototype.entryPrice=function(){return this.points()[0].price},o.prototype.findClosePoint=function(t,e){var i,o,n,r=this._model.mainSeries().bars(),a=s(r.firstIndex()),l=Math.max(t.index,a),c=s(r.lastIndex());for(i=l;i<=Math.min(c,e.index);i++)if(o=s(r.valueAt(i)),null!=(n=this.checkStopPrice(o)))return{index:i,price:n};return null},o.prototype.calculateActualEntry=function(t,e){var i,o,n=this._model.mainSeries().bars(),r=s(n.firstIndex()),a=Math.max(t.index,r),l=t.price,c=s(n.lastIndex());for(i=a;i<=Math.min(c,e.index);i++)if(o=s(n.valueAt(i)),o[TradingView.HIGH_PLOT]>=l&&o[TradingView.LOW_PLOT]<=l)return{index:i,price:l};return null},o.prototype.axisPoints=function(){var t,e,i;if(!this._points[p.ActualEntry])return[];if(t=this._points[p.ActualEntry],e=null,4===this._points.length)e=this._points[p.ActualClose];else{if(!(i=this.lastBarData()))return[];e={index:i.index,price:i.closePrice}}return[t,e]},o.prototype.getInputsPropertyPage=function(){return d.LineToolRiskRewardInputsPropertyPage},o.prototype.getStylesPropertyPage=function(){return d.LineToolRiskRewardStylesPropertyPage},inherit(n,o),n.prototype.i18nCache={title:$.t("Risk/Reward short")},n.prototype._recalculateQty=function(){var t,e,i,o,n;0!==this.points().length&&(t=this.properties(),e=t.entryPrice.value(),i=t.stopPrice.value(),o=t.riskSize.value(),n=Math.floor(o/Math.abs(i-e)),t.qty.setValue(n))},n.prototype._recalculateAmount=function(){var t,e,i,o,n,r,s,a;0!==this.points().length&&(t=this.properties(),e=t.accountSize.value(),i=t.entryPrice.value(),o=t.qty.value(),n=t.stopPrice.value(),r=t.targetPrice.value(),s=this._roundValue(e+(i-r)*o),a=this._roundValue(e-(n-i)*o),t.amountTarget.setValue(s),t.amountStop.setValue(a))},n.prototype.title=function(){return this.i18nCache.title},n.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this._model.mainSeries().base()},n.prototype.profitPrice=function(){
return this.entryPrice()-this.properties().profitLevel.value()/this._model.mainSeries().base()},n.prototype.calculatePL=function(t){return this.entryPrice()-t},n.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},n.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},n.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.HIGH_PLOT]>=e?this.stopPrice():t[TradingView.LOW_PLOT]<=i?this.profitPrice():null},r.prototype.i18nCache={title:$.t("Risk/Reward long")},inherit(r,o),r.prototype._recalculateQty=function(){var t,e,i,o,n;0!==this.points().length&&(t=this.properties(),e=t.entryPrice.value(),i=t.stopPrice.value(),o=t.riskSize.value(),n=Math.floor(o/Math.abs(e-i)),t.qty.setValue(n))},r.prototype._recalculateAmount=function(){var t,e,i,o,n,r,s,a;0!==this.points().length&&(t=this.properties(),e=t.accountSize.value(),i=t.entryPrice.value(),o=t.qty.value(),n=t.stopPrice.value(),r=t.targetPrice.value(),s=this._roundValue(e+(r-i)*o),a=this._roundValue(e-(i-n)*o),t.amountTarget.setValue(s),t.amountStop.setValue(a))},r.prototype.stopPrice=function(){return this.entryPrice()-this.properties().stopLevel.value()/this._model.mainSeries().base()},r.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this._model.mainSeries().base()},r.prototype.calculatePL=function(t){return t-this.entryPrice()},r.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},r.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},r.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.LOW_PLOT]<=e?this.stopPrice():t[TradingView.HIGH_PLOT]>=i?this.profitPrice():null},r.prototype.title=function(){return this.i18nCache.title},e.LineToolRiskReward=o,e.LineToolRiskRewardLong=r,e.LineToolRiskRewardShort=n}).call(e,i(147))},function(t,e,i){"use strict";function o(t,e){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0},n.call(this,t,e)}var n=i(3).LineDataSource;inherit(o,n),o.POINTS_COUNT=1,o.prototype.pointsCount=function(){return o.POINTS_COUNT},o.prototype.hasContextMenu=function(){return!1},o.prototype.state=function(){return null},o.prototype.startMoving=function(){n.prototype.startMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.endMoving=function(){n.prototype.endMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.correctPoints=function(t){var e,i,o,n,r;for(this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1,e=this.priceScale(),i=e.mainSource().base(),o=1/i,n=0;n<t.length;n++)r=t[n],
this._cursorMoved&&(r.price=this._currentMovingPoint.price),r.price=o*Math.round(r.price/o),t[n]=r},o.prototype.userEditEnabled=function(){return!0},o.prototype.canBeHidden=function(){return!1},o.prototype.isUserDeletable=function(){return!1},o.prototype.showInObjectTree=function(){return!1},o.prototype.getInputsPropertyPage=function(){return null},t.exports=o},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.colorUp=t.colorup,this.colorDn=t.colordown,this.colorBorderUp=t.colorBorderUp,this.colorBorderDown=t.colorBorderDown,this.width=this._calculateWidth(t.barSpacing),this.minHeight=t.minHeight,this.vertOffset=this._calculateVerticalOffset(t.barSpacing)}function n(t,e,i,o){this.x=t,this.y=e,this.height=i,this.isUp=o}var r=i(1).Point,s=i(4);o.prototype._calculateVerticalOffset=function(t){return Math.round((t||0)/4)},o.prototype._calculateMinHeight=function(t){return this.width||this._calculateWidth(t)},o.prototype._calculateWidth=function(t){var t=t||this.barSpacing;return Math.round(t/2)},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l=this.width,c=l<4,h=Math.max(parseInt(l/2),1),u=Math.round(this.width/2),d=Math.round(this.width);for(t.translate(1,1),e=0,i=this.items.length;e<i;e++)o=this.items[e],n=o.isUp?-1:1,r=Math.abs(o.height),s=o.y-n*this.vertOffset,t.beginPath(),t.translate(o.x,s),c?(t.moveTo(0,0),t.lineTo(-u,-u*n),t.moveTo(0,0),t.lineTo(u,-u*n),t.moveTo(0,0),t.lineTo(0,-r*n),t.moveTo(-u,-r*n),t.lineTo(u,-r*n),t.lineWidth=h,t.strokeStyle=o.isUp?this.colorUp:this.colorDn,t.stroke()):(t.moveTo(0,0),r<d?(t.lineTo(l,-r*n),t.lineTo(-l,-r*n)):(t.lineTo(l,-d*n),t.lineTo(u,-d*n),t.lineTo(u,-r*n),t.lineTo(-u,-r*n),t.lineTo(-u,-d*n),t.lineTo(-l,-d*n)),t.lineTo(0,0),a=o.isUp?this.colorBorderUp:this.colorBorderDown,t.strokeStyle=a,t.stroke(),t.fillStyle=o.isUp?this.colorUp:this.colorDn,t.fill()),t.translate(-o.x,-s);t.translate(-1,-1)},o.prototype.hitTest=function(t){var e,i,o,n,r,a,l,c,h,u=Math.round(this.width/2),d=Math.round(this.width);for(e=0;e<this.items.length;++e)if((i=this.items[e])&&void 0!==i.x&&null!==i.x&&!TradingView.isNaN(i.x)&&void 0!==i.y&&null!==i.y&&!TradingView.isNaN(i.y)&&(o=Math.abs(i.height),n=i.isUp?-1:1,r=o+d,a=i.y-n*this.vertOffset,l=a-n*r,c=i.x-u,h=i.x+u,c<t.x&&t.x<h&&(i.isUp?a<t.y&&t.y<l:l<t.y&&t.y<a)))return new s(s.REGULAR);return null},inherit(n,r),e.PaneRendererArrowsUpDown=TradingView.PaneRendererArrowsUpDown=o,e.PaneRendererArrowsUpDownItem=TradingView.PaneRendererArrowsUpDownItem=n},function(t,e,i){"use strict";function o(t){this._data=t,this.bars=t.bars,this._barWidth=n.optimalBarWidth(t.barSpacing),this._barBorderWidth=1}var n=i(69),r=i(4);o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p,_,f=this.bars,m=this._data.barSpacing,g=this._data.drawWick,v=this._data.drawBorder,y=this._data.wickColor,b=this._barBorderWidth,S=this._barWidth;if(t.lineCap="square",t.lineStyle=this._data.lineStyle,m<1){if(g){for(t.strokeStyle=y,t.lineWidth=1,t.beginPath(),h=f.length;h-- >0;)u=f[h],t.moveTo(u.time,u.low),t.lineTo(u.time,u.high);t.stroke()
}for(t.lineWidth=1,d="",p=!1,t.beginPath(),h=f.length;h-- >0;)u=f[h],c=u.time,d!==u.color&&(p&&(t.stroke(),t.beginPath(),p=!1),t.strokeStyle=u.color,d=u.color),t.moveTo(u.time,u.open),t.lineTo(u.time,u.close),p=!0;p&&t.stroke()}else{if(f=f.slice().sort(function(t,e){return t.color>e.color?-1:t.color<e.color?1:0}),t.translate(-.5,-.5),t.lineWidth=b,g)for(_=y,t.fillStyle=y,h=f.length;h--;)u=f[h],c=u.time,e=u.open,i=u.high,o=u.low,n=u.close,u.wickColor&&u.wickColor!==_&&(t.fillStyle=u.wickColor,_=u.wickColor),a=Math.min(e,n),l=Math.max(e,n),u.hollow?(t.fillRect(c,i,1,a-i),t.fillRect(c,l,1,o-l)):t.fillRect(c,i,1,o-i);if(v)for(h=f.length;h--;)u=f[h],f[h+1]&&u.borderColor===f[h+1].borderColor||(t.fillStyle=u.borderColor),u.hollow||(c=u.time,e=u.open,n=u.close,r=Math.round(c-S),s=Math.round(c+S),a=Math.min(e,n),l=Math.max(e,n),t.fillRect(r,a,s-r+1,l-a+1));for(h=f.length;h--;)u=f[h],c=u.time,e=u.open,i=u.high,o=u.low,n=u.close,r=Math.round(c-S),s=Math.round(c+S),a=Math.min(e,n),l=Math.max(e,n),f[h+1]&&u.color===f[h+1].color||(t.strokeStyle=u.color),t.fillStyle=u.color,Math.abs(a-l)<=1&&(t.fillStyle=u.borderColor),u.hollow?(t.translate(-.5,-.5),t.strokeRect(r+1,a+1,s-r,l-a),t.translate(.5,.5)):(v&&(r+=1,a+=1,s-=1,l-=1),t.fillRect(r,a,s-r+1,l-a+1))}},o.prototype.hitTest=function(t){var e,i,o,s,a=this.bars,l=.5*this._data.barSpacing;if(0===a.length)return null;if(t.x<a[0].time-l)return null;if(t.x>a[a.length-1].time+l)return null;for(e=null,i=0;i<a.length;++i)if(o=a[i],t.x<=o.time+l){e=o;break}return s=n.selectionTolerance(this._barBorderWidth),e&&e.high-s<=t.y&&t.y<=e.low+s?this._data.hittest||new r(r.REGULAR):null},e.PaneRendererCandles=TradingView.PaneRendererCandles=o},function(t,e,i){(function(e,o){"use strict";function n(t,i,r){var s,a;this.m_timeScale=t,s=i.rightAxisProperties.state(),s.autoScale=!0,this.m_rightPriceScale=new c(new e(s),r.properties().scalesProperties),a=i.leftAxisProperties.state(),a.autoScale=!0,this.m_leftPriceScale=new c(new e(a),r.properties().scalesProperties),this.m_dataSources=[],this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=r,this._tagsChanged=new o,i.topMargin.listeners().subscribe(this,n.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,n.prototype._updateMargins),this._updateMargins(),this._stretchFactor=n.DEFAULT_STRETCH_FACTOR,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,this._maximized=!1,this._isMainPane=!1}var r=i(413).ExecutionsPositionController,s=i(3).LineDataSource,a=i(62).PriceDataSource,l=i(13).getLogger("Chart.Pane"),c=i(281);n.DEFAULT_STRETCH_FACTOR=1e3,n.PANE_ANIMATION_DURATION=500,n.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,ChartEventsSource:1,"ESD$TV_DIVIDENDS@tv-scripting":2,"ESD$TV_SPLITS@tv-scripting":3,"ESD$TV_EARNINGS@tv-scripting":4,LineToolOrder:5,LineToolPosition:6,LineToolExecution:7},n.prototype.destroy=function(){this._properties.topMargin.listeners().unsubscribe(this,n.prototype._updateMargins),
this._properties.bottomMargin.listeners().unsubscribe(this,n.prototype._updateMargins)},n.prototype.setPaneSize=function(t){var e={large:1,medium:.6,small:.3,tiny:.15};if(!e[t])throw Error("Unknown size enum value: "+t);this._stretchFactor=e[t]*n.DEFAULT_STRETCH_FACTOR},n.sortSources=function(t){return t.map(function(t){var e,i,o=t._constructor;return isFunction(t.metaInfo)&&(o=t.metaInfo().id),i=n.sortSourcesPreOrdered[o]||0,e=i>0?1/0:i<0?-1/0:t.zorder(),[t,i,e]}).sort(function(t,e){return t[1]-e[1]||t[2]-e[2]}).map(function(t){return t[0]})},n.prototype._updateMargins=function(){var t,e,i=.01*this._properties.topMargin.value(),o=.01*this._properties.bottomMargin.value();for(this.m_leftPriceScale.setTopMargin(i),this.m_leftPriceScale.setBottomMargin(o),this.m_rightPriceScale.setTopMargin(i),this.m_rightPriceScale.setBottomMargin(o),t=0;t<this.m_dataSources.length;t++)(e=this.m_dataSources[t])instanceof TradingView.Study&&this.isOverlay(e)&&"Volume"!==e.metaInfo().shortId&&e.priceScale()&&e.priceScale()!==this.m_leftPriceScale&&e.priceScale()===this.m_rightPriceScale&&(e.priceScale().setTopMargin(i),e.priceScale().setBottomMargin(o),this.recalculatePriceScale(e.priceScale()));this.recalculatePriceScale(this.m_leftPriceScale),this.recalculatePriceScale(this.m_rightPriceScale),this.updateAllViews()},n.prototype.model=function(){return this._model},n.prototype.width=function(){return this.m_width},n.prototype.height=function(){return this.m_height},n.prototype.setWidth=function(t){this.m_width=t,this.updateAllViews()},n.prototype.setHeight=function(t){var e,i;for(this.m_height=t,this.m_leftPriceScale.setHeight(t),this.m_rightPriceScale.setHeight(t),e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],this.isOverlay(i)&&i.priceScale()&&i.priceScale().setHeight(t);this.updateAllViews()},n.prototype.leftPriceScale=function(){return this.m_leftPriceScale},n.prototype.rightPriceScale=function(){return this.m_rightPriceScale},n.prototype.timeScale=function(){return this.m_timeScale},n.prototype.dataSources=function(){return this.m_dataSources},n.prototype.isOverlay=function(t){return t._isOverlay},n.prototype._processMainSourceChange=function(){var t,e,i,o,r,l,c;if(null===this.m_mainDataSource)for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&!this.isOverlay(i)&&(!i.properties().linkedToSeries||!i.properties().linkedToSeries.value())){this.m_mainDataSource=i,t=!0;break}if(this.m_mainDataSource&&t){for(o=[],e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],TradingView.isInherited(i.constructor,s)&&o.push(i);for(o=n.sortSources(o),e=0;e<o.length;e++)this.move(o[e],this.m_mainDataSource.priceScale(),!0)}else if(!this.m_mainDataSource||this.isOverlay(this.m_mainDataSource)&&0===this.nonOverlayPricesSourcesCount())for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&this.isOverlay(i)&&i.showInObjectTree()){for(this.m_mainDataSource=i,this.m_rightPriceScale.addDataSource(i),
i.setPriceScale(this.m_rightPriceScale),r=this._model.children(i),c=0;c<r.length;c++)l=r[c],this.m_rightPriceScale.addDataSource(l),l.setPriceScale(this.m_rightPriceScale),l._isOverlay=!1;this.recalculatePriceScale(this.m_rightPriceScale),i._isOverlay=!1;break}},n.prototype._newZOrderForLineTool=function(){var t,e,i,o=null;for(t=0;t<this.m_dataSources.length;++t)(e=this.m_dataSources[t])instanceof s&&(i=e.zorder(),(null===o||i>o)&&(o=i));return null===o&&(o=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(t){t.zorder()>o&&t.setZorder(t.zorder()+1)}),o+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(t,e,i){var o;t instanceof s&&!i?(o=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=o)):o=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(t,e,o)},n.prototype.insertDataSource=function(t,i,o){var r,s,l;this.m_dataSources.push(t),r=!1,t===this._model.mainSeries()?(this.m_mainDataSource=t,r=!0):null===this.m_mainDataSource&&(this.m_mainDataSource=t,r=!0),t._isOverlay=!1,null!==i||this.canHaveMoreNoScaleSources()||(i=this.rightPriceScale()),null===i&&(s=this.m_rightPriceScale.topMargin(),l=this.m_rightPriceScale.bottomMargin(),t.metaInfo&&"Volume@tv-basicstudies"===t.metaInfo().id&&(s=.75,l=0),i=new c(new e(this._properties.overlayPropreties.state()),this._model.properties().scalesProperties),i.setHeight(this.m_height),i.setTopMargin(s),i.setBottomMargin(l),t._isOverlay=!0),i.addDataSource(t,this._isInInsertManyDataSourcesState),t.setPriceScale(i),t.onTagsChanged&&t.onTagsChanged().subscribe(this,n.prototype.onSourceTagsChanged),t.setZorder(o),r&&this._processMainSourceChange(),this._tagsChanged.fire(),TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},n.prototype.removeDataSource=function(t,e){var i,o=this.m_dataSources.indexOf(t);if(-1===o)return void l.logDebug("removeDataSource: invalid data source");t._isOverlay=!1,this.m_dataSources.splice(o,1),t!==this.m_mainDataSource||e||(this.m_mainDataSource=null),i=null,-1!==this.m_leftPriceScale.dataSources().indexOf(t)?(this.m_leftPriceScale.removeDataSource(t),i=this.m_leftPriceScale):-1!==this.m_rightPriceScale.dataSources().indexOf(t)&&(this.m_rightPriceScale.removeDataSource(t),i=this.m_rightPriceScale),t.onTagsChanged&&t.onTagsChanged().unsubscribe(this,n.prototype.onSourceTagsChanged),TradingView.isInherited(t.constructor,a)&&this._processMainSourceChange(),this._tagsChanged.fire(),i&&TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},n.prototype.startScalePrice=function(t,e){t.startScale(e)},n.prototype.scalePriceTo=function(t,e){t.scaleTo(e),this.updateAllViews()},
n.prototype.endScalePrice=function(t){t.endScale()},n.prototype.startScrollPrice=function(t,e){t.startScroll(e)},n.prototype.scrollPriceTo=function(t,e){t.scrollTo(e),this.updateAllViews()},n.prototype.endScrollPrice=function(t){t.endScroll()},n.prototype.setPriceAutoScale=function(t,e){if(t.setAutoScale(e),this.timeScale().isEmpty())return void t.setPriceRange(null);this.recalculatePriceScale(t)},n.prototype.restorePriceScaleState=function(t,e){t.restoreState(e),this.updateAllViews()},n.prototype.updateAllViews=function(){for(var t=0;t<this.m_dataSources.length;t++)this.m_dataSources[t].updateAllViews()},n.prototype.defaultPriceScale=function(){var t=this.m_mainDataSource?this.m_mainDataSource.priceScale():this.rightPriceScale();return void 0===t&&(t=new c(new e(this._properties.overlayPropreties.state()),this._model.properties().scalesProperties)),t},n.prototype._priceScaleIsPrice=function(t){var e=t.mainSource();return!!e&&(!!TradingView.isInherited(e.constructor,TradingView.Series)||!!TradingView.isInherited(e.constructor,TradingView.Study)&&e.metaInfo().is_price_study)},n.prototype.findSuitableScale=function(t){if(TradingView.isInherited(t.constructor,TradingView.Study)&&"Volume@tv-basicstudies"===t.metaInfo().id)return this.m_rightPriceScale.mainSource()||this.m_leftPriceScale.mainSource()?null:this.m_rightPriceScale;var e=!1;if(TradingView.isInherited(t.constructor,TradingView.Study)?e=t.metaInfo().is_price_study:TradingView.isInherited(t.constructor,TradingView.Series)&&(e=!0),e){if(this._priceScaleIsPrice(this.m_rightPriceScale))return this.m_rightPriceScale;if(this._priceScaleIsPrice(this.m_leftPriceScale))return this.m_leftPriceScale}return this.m_rightPriceScale.mainSource()?this.m_leftPriceScale.mainSource()?null:this.m_leftPriceScale:this.m_rightPriceScale},n.prototype.mainDataSource=function(){return this.m_mainDataSource},n.prototype.recalculatePriceScale=function(t){if(t){if(t.isAutoScale()&&!this.timeScale().isEmpty()){var e=this.timeScale().visibleBars();t.recalculatePriceRange(e)}t.updatePaneViews()}},n.prototype.resetPriceScale=function(t){var e=this.timeScale().visibleBars();t.mainSource()instanceof TradingView.Series&&t.mainSource().isLockScale()||t.setAutoScale(!0),t.recalculatePriceRange(e),this.updateAllViews()},n.prototype.recalculate=function(){var t,e;for(this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale),t=0;t<this.m_dataSources.length;t++)e=this.m_dataSources[t],!this.isOverlay(e)||e instanceof s||this.recalculatePriceScale(e.priceScale());this.updateAllViews(),this._model.updatePane(this)},n.prototype.isEmpty=function(){return null===this.m_mainDataSource},n.prototype.move=function(t,e,i){var o=this.m_dataSources.slice(),n=null!==e;this.removeDataSource(t,n),this.addDataSource(t,e,i),this.m_dataSources=o,this.invalidateSourcesCache()},n.prototype.dataSourceForId=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},n.prototype.priceScaleForSource=function(t){
return-1!==this.rightPriceScale().dataSources().indexOf(t)?this.rightPriceScale():-1!==this.leftPriceScale().dataSources().indexOf(t)?this.leftPriceScale():null},n.prototype.sourceById=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},n.prototype.containsMainSeries=function(){return-1!==this.m_dataSources.indexOf(this._model.mainSeries())},n.prototype.priceScaleByName=function(t){return"left"===t?this.m_leftPriceScale:"right"===t?this.m_rightPriceScale:null},n.prototype.priceScaleName=function(t){return t===this.m_leftPriceScale?"left":t===this.m_rightPriceScale?"right":""},n.prototype.hitTestSources=function(){var t,e,i,o,n;if(this._cachedHitTestSources)return this._cachedHitTestSources;for(t=this.orderedSources(),e=[],i=[this._model.crossHairSource()],o=0;o<t.length;o++)n=t[o],TradingView.isInherited(n.constructor,s)?e.push(n):i.push(n);return this._cachedHitTestSources=i.concat(e),this._cachedHitTestSources},n.prototype.orderedSources=function(){var t,e,i,o;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(t=[],e=0,i=this.m_dataSources.length;e<i;e++)o=this.m_dataSources[e],TradingView.isInherited(o.constructor,s)&&!o.isActualSymbol()||t.push(o);return t=n.sortSources(t),this._cachedOrderedSoruces=t,t},n.prototype.createDrawingsCaches=function(){r.recreateOrderedByBarsSourcesCache(this)},n.prototype.clearDrawingCaches=function(){r.clearOrderedByBarsSourcesCache()},n.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null,this._cachedHitTestSources=null,this.m_leftPriceScale.invalidateSourcesCache(),this.m_rightPriceScale.invalidateSourcesCache()},n.prototype.getZOrderMinMax=function(){var t,e,i,o,n=this.orderedSources();if(0===n.length)return{minZOrder:0,maxZOrder:0};for(t=n[0].zorder(),e=n[0].zorder(),i=1;i<n.length;i++)o=n[i],o.zorder()<t&&(t=o.zorder()),o.zorder()>e&&(e=o.zorder());return{minZOrder:t,maxZOrder:e}},n.prototype.isZOrderAvailable=function(t){var e,i;for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],i.zorder()===t)return!1;return!0},n.prototype.sendToBack=function(t){var e,i=this.getZOrderMinMax().minZOrder,o=Math.abs(t.zorder()-i);for(e=0;e<o;e++)this.changeZOrder(t,-1)},n.prototype.bringToFront=function(t){var e,i=this.getZOrderMinMax().maxZOrder,o=Math.abs(t.zorder()-i);for(e=0;e<o;e++)this.changeZOrder(t,1)},n.prototype.changeZOrder=function(t,e){var i,o,n,r,s,a=this.orderedSources().filter(function(t){return t.showInObjectTree()}),l=0;for(i=0,o=a.length;i<o;i++)if(a[i]===t){l=i;break}l>0&&e<0?(n=a[l-1].zorder(),r=t.zorder(),a[l-1].setZorder(r),t.setZorder(n)):l<a.length-1&&e>0&&(s=a[l+1].zorder(),r=t.zorder(),a[l+1].setZorder(r),t.setZorder(s)),this.invalidateSourcesCache()},n.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},n.prototype.onTagsChanged=function(){return this._tagsChanged},n.prototype.dumpPriceScale=function(t){var e,i,o,n=t.dataSources(),r=[]
;for(e=0;e<n.length;e++)if(i=n[e].priceAxisViews(this,t))for(o=0;o<i.length;o++)r.push(i[o].dump());return r},n.prototype.dumpViews=function(){var t,e,i,o,n,r={};for(r.paneViews={},t=this.orderedSources(),e=0;e<t.length;e++)if(i=t[e],r.paneViews[e]=[],o=i.paneViews())for(n=0;n<o.size();n++)r.paneViews[e].push(o.item(e).dump());return r.leftAxis=this.dumpPriceScale(this.m_leftPriceScale),r.rightAxis=this.dumpPriceScale(this.m_rightPriceScale),r},n.prototype.clearSeries=function(){for(var t=this.m_dataSources.length-1;t>=0;t--)TradingView.isInherited(this.m_dataSources[t].constructor,TradingView.Series)&&this.m_dataSources.splice(t,1)},n.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter(function(t){return(!t.properties().linkedToSeries||!t.properties().linkedToSeries.value())&&(TradingView.isInherited(t.constructor,a)&&t.showInObjectTree()&&!t.isNoScale())}).length},n.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},n.prototype.actionNoScaleIsEnabled=function(t){return!(!this.isOverlay(t)&&TradingView.isInherited(t.constructor,a))||this.canHaveMoreNoScaleSources()},n.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new r(this,this._model.timeScale())),this._executionsPositionController},n.prototype.isLast=function(){var t=this._model.panes();return t[t.length-1]===this},n.prototype.setMaximized=function(t){this._maximized=t},n.prototype.isMaximized=function(){return this._maximized},n.prototype.isMainPane=function(){var t=this._model.mainSeries(),e=!1;return this.m_dataSources.forEach(function(i){e||(e=i===t)}),this._isMainPane=e,e},n.prototype.properties=function(){return this._properties},t.exports=n}).call(e,i(52),i(20))},function(t,e,i){(function(e,o){"use strict";function n(t,e){if(this.m_base=t,this.m_integralDividers=e,this.m_fractionalDividers=[],l.isBaseDecimal(this.m_base))this.m_fractionalDividers=[2,2.5,2];else for(var i=this.m_base;1!==i;){if(i%2==0)this.m_fractionalDividers.push(2),i/=2;else{if(i%5!=0)throw new RangeError("unexpected base");this.m_fractionalDividers.push(2),this.m_fractionalDividers.push(2.5),i/=5}if(this.m_fractionalDividers.length>100)throw Error("something wrong with base")}}function r(t,e,i){this.m_marks=[],this.m_base=e,this.m_priceScale=t,this._formatter=i,i&&(this._cache=new c(function(t){return i.format(t)})),this._currentFormatBase=0}function s(t){for(var e=1;t*e!==Math.round(t*e);)e*=10;return e}function a(t,i){function n(){var t,e,i=s.m_dataSources;for(t=0;t<i.length;t++)e=i[t],e.priceScaleChanged&&e.priceScaleChanged.fire(s)}this._properties=t,this._scalesProperties=i,this.m_height=0,this.m_priceRange=null,this._priceRangeChanged=new e,this.m_dataSources=[],this.m_topMargin=0,this.m_bottomMargin=0,this._studyTopMargin=0,this._studyBottomMargin=0,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_priceRangeSnapshot=null,this._invalidatedForRange={isValid:!0},this.onMarksChanged=new e,
this.m_markBuilder=new r(this,100,new _(100)),this._properties.percentage.listeners().subscribe(this,a.prototype.updateFormatter);var s=this;this._properties.log.listeners().subscribe(null,function(t){var e,i,n,r,a;s.m_priceRange&&(e=s.m_priceRange,t.value()?(i=s.m_priceRange,n=new o(s._toLog(e.minValue()),s._toLog(e.maxValue())),s.m_priceRange=n,s._priceRangeChanged.fire(i,n)):(r=s._fromLog(e.minValue()),a=s._fromLog(e.maxValue()),isFinite(r)&&isFinite(a)?(i=s.m_priceRange,n=new o(r,a),s.m_priceRange=n,s._priceRangeChanged.fire(i,n)):s.properties().autoScale.setValue(!0)))}),this._properties.percentage.listeners().subscribe(null,function(){s._properties.autoScale.setValue(!0)}),this._properties.percentage.listeners().subscribe(null,function(){var t,e,i;s._properties.autoScaleDisabled.setValue(s._properties.percentage.value()),t=s.priceRange(),!s.mainSource()||s.mainSource().model().timeScale().isEmpty()||s.mainSource().data().isEmpty()||s.mainSource()instanceof d&&!s.mainSource().properties().lockScale.value()||!t||(e=s.mainSource().model().timeScale().visibleBars(),i=s.mainSource().data().search(e.firstBar(),p.NearestRight).value[TradingView.CLOSE_PLOT],null!=t&&void 0!==i&&(s._properties.percentage.value()?s.setPriceRange(t.convertToPercents(i)):s.setPriceRange(t.convertFromPercents(i))))}),this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._hasSeries=!1,this._properties.percentage.listeners().subscribe(null,n),this._properties.log.listeners().subscribe(null,n),this._properties.listeners().subscribe(null,function(){s.mainSource()&&s.mainSource().model()&&s.mainSource().model().fullUpdate()})}var l=i(56),c=i(410),h=i(3).LineDataSource,u=i(62).PriceDataSource,d=i(85),p=i(42).PlotRowSearchMode,_=i(41).PriceFormatter,f=i(94).PercentageFormatter;n.prototype.TICK_SPAN_EPSILON=1e-9,n.prototype.tickSpan=function(t,e,i){var o,n=0===this.m_base?0:1/this.m_base,r=this.TICK_SPAN_EPSILON,s=Math.pow(10,Math.max(0,Math.ceil(l.log10(t-e)))),a=0;for(a=0,o=this.m_integralDividers[0];s>n+r&&l.greaterOrEqual(s,n,r)&&l.greaterOrEqual(s,i*o,r)&&l.greaterOrEqual(s,1,r);++a,o=this.m_integralDividers[a%this.m_integralDividers.length])s/=o;if(s<=n+r&&(s=n),s=Math.max(1,s),this.m_fractionalDividers.length>0&&l.equal(s,1,r))for(a=0,o=this.m_fractionalDividers[0];s>n+r&&l.greaterOrEqual(s,i*o,r);++a,o=this.m_fractionalDividers[a%this.m_fractionalDividers.length])s/=o;return s},r.prototype.TICK_DENSITY=2.5,r.prototype.base=function(){return this.m_base},r.prototype.setBase=function(t){if(t<0)throw new RangeError("base < 0");this.m_base=t},r.prototype.fontHeight=function(){return this.m_priceScale.fontSize()},r.prototype.tickSpan=function(t,e){var i,o,r,s,a,c,h;if(t<e)throw new RangeError("high < low");return i=this.m_priceScale.height(),o=this.tickMarkHeight(),r=(t-e)*o/i,s=new n(this.m_base,[2,2.5,2]),a=new n(this.m_base,[2,2,2.5]),c=new n(this.m_base,[2.5,2,2]),h=[],h.push(s.tickSpan(t,e,r)),h.push(a.tickSpan(t,e,r)),h.push(c.tickSpan(t,e,r)),l.min(h)},r.prototype.tickMarkHeight=function(){
return Math.ceil(this.fontHeight()*this.TICK_DENSITY)},r.prototype.rebuildTickMarks=function(){var t,e,i,o,n,r,a,l,h,u,d,p,f;if(null===this.m_priceScale)throw new TypeError("scale is null");if(this.m_priceScale.isEmpty())return void(this.m_marks=[]);if(t=this.m_priceScale.height(),e=this.m_priceScale.coordinateToPrice(t-1),i=this.m_priceScale.coordinateToPrice(0),o=i>=e?1:-1,n=Math.max(i,e),r=Math.min(i,e),i=n,e=r,i!==e)for(a=this.tickSpan(i,e),l=i%a,l+=l<0?a:0,this.m_marks=[],this._formatter||(h=s(a),this._cache&&this._currentFormatBase===h||(u=new _(h),this._cache=new c(function(t){return u.format(t)}))),d=null,p=i-l;p>e;p-=a)f=this.m_priceScale.priceToCoordinate(p),null!==d&&Math.abs(f-d)<this.tickMarkHeight()||(this.m_marks.push({coord:f,label:this._cache.format(p)}),d=f,this.m_priceScale.isLog()&&(a=this.tickSpan(p*o,e)))},r.prototype.marks=function(){return this.m_marks},a.prototype.isLog=function(){return this._properties.log.value()},a.prototype.isPercent=function(){return this._properties.percentage.value()},a.prototype.isPercentage=function(){return this._properties.percentage.value()},a.prototype.properties=function(){return this._properties},a.prototype.fontSize=function(){return this._scalesProperties.fontSize.value()},a.prototype.height=function(){return this.m_height},a.prototype.setHeight=function(t){var e=this.m_height;this.m_height=t,this._internalHeightCache=void 0,this._marksCache=null,e!==t&&this.mainSource()instanceof d&&this.mainSource().isLockScale()&&this.mainSource().model().timeScale().recalcLockedScale()},a.prototype.topMargin=function(){return Math.max(this.m_topMargin,this._studyTopMargin)},a.prototype.setTopMargin=function(t){if(!isNumber(t))throw new TypeError("invalid margin");if(t<0||t>30)throw new RangeError("invalid margin");this.m_topMargin=t,this._internalHeightCache=void 0,this._marksCache=null},a.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)},a.prototype.setBottomMargin=function(t){if(!isNumber(t))throw new TypeError("invalid margin");if(t<0||t>30)throw new RangeError("invalid margin");this.m_bottomMargin=t,this._internalHeightCache=void 0,this._marksCache=null},a.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var t=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=t,t},a.prototype.priceRange=function(){return this.makeSureItIsValid(),this.m_priceRange},a.prototype.setPriceRange=function(t){if(!(t instanceof o))throw new TypeError("incorrect price range");var e=this.m_priceRange;null!==e&&e.equals(t)||(this.m_priceRange=t,this._marksCache=null,this._priceRangeChanged.fire(e,t))},a.prototype.priceRangeChanged=function(){return this._priceRangeChanged},a.prototype.isEmpty=function(){return this.makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()},a.prototype.invertedCoordinate=function(t){return this.height()-1-t},a._logicalOffset=4,a._coordOffset=1e-4,a.prototype.log10=function(t){
return Math.log(t)/Math.log(10)},a.prototype._toLog=function(t){var e,i=Math.abs(t);return i<1e-6?0:(e=this.log10(i+a._coordOffset)+a._logicalOffset,t<0?-e:e)},a.prototype.priceToLogical=function(t){return this.isLog()&&t?this._toLog(t):t},a.prototype._fromLog=function(t){var e,i=Math.abs(t);return i<1e-6?0:(e=Math.pow(10,i-a._logicalOffset)-a._coordOffset,t<0?-e:e)},a.prototype.logicalToPrice=function(t){return this.isLog()?this._fromLog(t):t},a.prototype.priceToCoordinate=function(t,e){var i,o;return this.makeSureItIsValid(),this.isEmpty()?0:(t=this.priceToLogical(t),i=this.bottomMargin()*this.height()+(this.internalHeight()-1)*(t-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue()),o=this.invertedCoordinate(i),e?o:Math.round(o))},a.prototype.pricesToCoordinates=function(t){this.pricesToCoordinatesEx(t,function(t){return t.y},function(t,e){t.y=e})},a.prototype.pricesToCoordinatesEx=function(t,e,i){var o,n,r,s,a,l,c,h,u;if(this.makeSureItIsValid(),o=this.bottomMargin()*this.height(),n=this.priceRange().minValue(),r=this.priceRange().maxValue(),s=this.internalHeight()-1,a=s/(r-n),this.isLog())for(l=0;l<t.length;l++)c=e(t[l]),i(t[l],this.priceToLogical(c));for(l=0;l<t.length;l++)c=e(t[l]),TradingView.isNaN(c)||void 0===c||null===c||(h=o+a*(c-n),u=this.m_height-1-h,i(t[l],Math.round(u)))},a.prototype.pointsArrayToCoordinates=function(t){var e,i,o,n,r,s,a,l,c;if(this.makeSureItIsValid(),e=this.bottomMargin()*this.height(),i=this.priceRange().minValue(),o=this.priceRange().maxValue(),n=this.internalHeight()-1,r=n/(o-i),this.isLog())for(s=0;s<t.length;s++)t[s].y=this.priceToLogical(t[s].y);for(s=0;s<t.length;s++)a=t[s].y,TradingView.isNaN(a)||void 0===a||null===a||(l=e+r*(a-i),c=this.m_height-1-l,t[s].y=Math.round(c))},a.prototype.pricesArrayToCoordinates=function(t){var e,i,o,n,r,s,a,l,c;if(this.makeSureItIsValid(),e=this.bottomMargin()*this.height(),i=this.priceRange().minValue(),o=this.priceRange().maxValue(),n=this.internalHeight()-1,r=n/(o-i),this.isLog())for(s=0;s<t.length;s++)t[s]=this.priceToLogical(t[s]);for(s=0;s<t.length;s++)void 0!==(a=t[s])&&null!==a&&(l=e+r*(a-i),c=this.m_height-1-l,t[s]=Math.round(c))},a.prototype.barPricesToCoordinates=function(t){var e,i,o,n,r,s,a,l,c,h,u;if(this.makeSureItIsValid(),e=t,i=this.bottomMargin()*this.height(),o=this.priceRange().minValue(),n=this.priceRange().maxValue(),r=this.internalHeight()-1,s=r/(n-o),this.isLog())for(a=0;a<e.length;a++)e[a]&&(e[a].open=this.priceToLogical(e[a].open),e[a].high=this.priceToLogical(e[a].high),e[a].low=this.priceToLogical(e[a].low),e[a].close=this.priceToLogical(e[a].close),e[a].additionalPrice&&(e[a].additionalPrice=this.priceToLogical(e[a].additionalPrice)));for(a=0;a<e.length;a++)(l=e[a])&&(c=l.open,h=i+s*(c-o),u=this.m_height-1-h,l.open=Math.round(u),c=l.high,h=i+s*(c-o),u=this.m_height-1-h,l.high=Math.round(u),c=l.low,h=i+s*(c-o),u=this.m_height-1-h,l.low=Math.round(u),c=l.close,h=i+s*(c-o),u=this.m_height-1-h,l.close=Math.round(u),l.additionalPrice&&(c=l.additionalPrice,h=i+s*(c-o),
u=this.m_height-1-h,l.additionalPrice=Math.round(u)))},a.prototype.coordinateToPrice=function(t){var e,i;return this.makeSureItIsValid(),this.isEmpty()?0:(e=this.invertedCoordinate(t),i=this.priceRange().minValue()+(this.priceRange().maxValue()-this.priceRange().minValue())*((e-this.bottomMargin()*this.height())/(this.internalHeight()-1)),this.logicalToPrice(i))},a.prototype.dataSources=function(){return this.m_dataSources},a.prototype.orderedSources=function(){var t,e,o,n;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(t=[],e=0;e<this.m_dataSources.length;e++)o=this.m_dataSources[e],null==o.zorder()&&o.setZorder(e+1),t.push(o);return n=i(280),t=n.sortSources(t),this._cachedOrderedSoruces=t,this._cachedOrderedSoruces},a.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null},a.prototype.hasSeries=function(){return this._hasSeries},a.prototype.addDataSource=function(t,e){if(e||-1===this.m_dataSources.indexOf(t)){TradingView.isInherited(t.constructor,d)&&(this._hasSeries=!0);var i=this;t.properties().visible.listeners().subscribe(null,function(){i._sourcesForAutoscale=null}),this.m_dataSources.push(t),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.initScaleProperties(),this.invalidateSourcesCache()}},a.prototype.initScaleProperties=function(){var t=this.mainSource()instanceof d&&this.mainSource().properties().lockScale.value();t&&(this.properties().percentage.setValue(!1),this.properties().log.setValue(!1),this.properties().autoScale.setValue(!1)),this.properties().percentageDisabled.setValue(t),this.properties().logDisabled.setValue(t),this.properties().autoScaleDisabled.setValue(this.properties().percentage.value()),this.properties().percentage.value()&&this.properties().log.setValue(!1)},a.prototype.removeDataSource=function(t){var e=this.m_dataSources.indexOf(t);if(-1===e)throw Error("source is not attached to scale");this.m_dataSources.splice(e,1),TradingView.isInherited(t.constructor,d)&&(this._hasSeries=!1),this.mainSource()||this.setAutoScale(!0),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.invalidateSourcesCache()},a.prototype.isAutoScale=function(){return this._properties.autoScale.value()&&!(this.mainSource()instanceof d&&this.mainSource().isLockScale())},a.prototype.setAutoScale=function(t){this._properties.autoScale.setValue(t)},a.prototype.isScaled=function(){return"number"==typeof this.m_scaleStartPoint},a.prototype.startScale=function(t){this.isPercentage()||null===this.m_scaleStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scaleStartPoint=this.m_height-t,this.m_priceRangeSnapshot=this.priceRange().clone()))},a.prototype.marks=function(){return this._marksCache?this._marksCache:(this.m_markBuilder.rebuildTickMarks(),this._marksCache=this.m_markBuilder.marks(),this.onMarksChanged.fire(),this._marksCache)},a.prototype.scaleTo=function(t){var e,i,o;this.isPercentage()||(this._marksCache=null,
null!==this.m_scaleStartPoint&&(this.setAutoScale(!1),t=this.m_height-t,t<0&&(t=0),e=(this.m_scaleStartPoint+.2*(this.m_height-1))/(t+.2*(this.m_height-1)),e=Math.max(e,.1),i=this.m_priceRange,o=this.m_priceRangeSnapshot.clone(),o.scaleAroundCenter(e),this.m_priceRange=o,this._priceRangeChanged.fire(i,o),this.recalcLockedScale(i)))},a.prototype.recalcLockedScale=function(t){var e,i,n,r;if(this.mainSource()instanceof d&&this.mainSource().properties().lockScale.value()){if(e=this.mainSource().model().timeScale(),i=this.mainSource().data().boxSize,(void 0===i||isNaN(i))&&this.mainSource().fixBoxSize(),void 0===i||isNaN(i))return;this.properties().percentage.value()&&(n=this.mainSource().data().search(this.mainSource().getRealVisibleRange().firstBar()).value[TradingView.CLOSE_PLOT],i=o.prototype.convertToPercent.call(null,n+i,n)-o.prototype.convertToPercent.call(null,n,n)),r=this.internalHeight()/this.priceRange().length()*i,r<.5||r>50?this.m_priceRange=t:(e.setBarSpacing(r),e._correctOffset()),this.mainSource().model().mainSeries().requestMoreData()}},a.prototype.endScale=function(){this.isPercentage()||null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this.m_priceRangeSnapshot=null)},a.prototype.startScroll=function(t){this.isAutoScale()||null===this.m_scrollStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scrollStartPoint=t,this.m_priceRangeSnapshot=this.priceRange().clone()))},a.prototype.scrollTo=function(t){var e,i,o,n,r;this._marksCache=null,this.isAutoScale()||null!==this.m_scrollStartPoint&&(e=this.priceRange().length()/(this.height()-1),i=t-this.m_scrollStartPoint,o=i*e,n=this.m_priceRange,r=this.m_priceRangeSnapshot.clone(),r.shift(o),this.m_priceRange=r,this._priceRangeChanged.fire(n,r))},a.prototype.endScroll=function(){this.isAutoScale()||null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this.m_priceRangeSnapshot=null)},a.prototype.state=function(){var t={};return t.m_priceRange=this.priceRange()?this.priceRange().serialize():null,t.m_isAutoScale=this.isAutoScale(),t.m_isPercentage=this._properties.percentage.value(),t.m_isLog=this._properties.log.value(),t.m_height=this.m_height,t.m_topMargin=this.m_topMargin,t.m_bottomMargin=this.m_bottomMargin,t},a.prototype.restoreState=function(t){var e,i,n=t.m_priceRange;if(void 0===n)throw new TypeError("invalid state");if(void 0===t.m_isAutoScale)throw new TypeError("invalid state");void 0!==t.m_isPercentage&&this._properties.percentage.setValue(t.m_isPercentage),void 0!==t.m_isLog&&this._properties.log.setValue(t.m_isLog),e=this.m_priceRange,i=n?new o(n):null,(null!==e&&(null===i||!i.equals(e))||null===e&&null!==i)&&(this.m_priceRange=i,this._priceRangeChanged.fire(e,i)),void 0!==t.m_height&&(this.m_height=Math.max(0,t.m_height)),this.setAutoScale(t.m_isAutoScale),void 0!==t.m_topMargin&&(this.m_topMargin=t.m_topMargin),void 0!==t.m_bottomMargin&&(this.m_bottomMargin=t.m_bottomMargin),this._mainSource=void 0,this._scaleSeriesOnly=!1},a.prototype.mainSource=function(){var t,e
;if(void 0!==this._mainSource)return this._mainSource;for(t=void 0,e=0;e<this.m_dataSources.length;e++){if(TradingView.isInherited(this.m_dataSources[e].constructor,d)){t=this.m_dataSources[e];break}!t&&TradingView.isInherited(this.m_dataSources[e].constructor,u)&&(t=this.m_dataSources[e])}return this._mainSource=t,this._mainSource||null},a.prototype.formatter=function(){return this._formatter||this.updateFormatter(),this._formatter},a.prototype.updateFormatter=function(){var t,e;this._marksCache=null,t=this.mainSource(),e=100,t&&(e=t.base()),this._formatter=null,this.properties().percentage.value()?this._formatter=new f:this._formatter=t?t.formatter():new _(100,1),this.m_markBuilder=new r(this,e,this._formatter),this.m_markBuilder.rebuildTickMarks()},a.prototype._recalculateSourcesForAutoscale=function(){var t,e;this._mainSource&&(this._scaleSeriesOnly=this._scalesProperties.scaleSeriesOnly.value()),t=this._scaleSeriesOnly&&this._hasSeries,e=function(e){return!!(e.properties().visible.value()||e instanceof d)&&(t?TradingView.isInherited(e.constructor,d):TradingView.isInherited(e.constructor,u))},this._sourcesForAutoscale=this.m_dataSources.filter(e)},a.prototype.sourcesForAutoscale=function(){return this._mainSource&&this._scaleSeriesOnly!==this._scalesProperties.scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null),this._sourcesForAutoscale||this._recalculateSourcesForAutoscale(),this._sourcesForAutoscale},a.prototype.recalculatePriceRange=function(t){this._invalidatedForRange={visibleBars:t,isValid:!1}},a.prototype.makeSureItIsValid=function(){this._invalidatedForRange.isValid||(this._invalidatedForRange.isValid=!0,this.recalculatePriceRangeImpl())},a.prototype.recalculatePriceRangeImpl=function(){var t,e,i,n,r,s,a,l,c,h,u=this._invalidatedForRange.visibleBars;if(null!==u){for(t=null,e=this.sourcesForAutoscale(),i=0,n=0,r=0;r<e.length;r++)s=e[r],s.properties().visible.value()&&(a=u.firstBar(),l=u.lastBar(),c=s.priceRange(a,l),null===t&&c?t=c:c&&(t=t.merge(c)),s.margins&&(h=s.margins(),i=Math.max(h[0],i),n=Math.max(h[1],n)));(Math.abs(n-this._studyBottomMargin)>.01||Math.abs(i-this._studyTopMargin)>.01)&&(this._studyBottomMargin=n,this._studyTopMargin=i,this._marksCache=null,this._internalHeightCache=null),t?(t.minValue()===t.maxValue()&&(t=new o(t.minValue()-.5,t.maxValue()+.5)),this.setPriceRange(t)):this.m_priceRange||this.setPriceRange(new o(-.5,.5)),this._invalidatedForRange.isValid=!0}},a.prototype.sourcesToUpdateViews=function(){var t,e;if(!this._sourcesToUpdateViews)for(this._sourcesToUpdateViews=[],t=0;t<this.m_dataSources.length;t++)e=this.m_dataSources[t],TradingView.isInherited(e.constructor,h)&&!e.isActualSymbol()||this._sourcesToUpdateViews.push(e);return this._sourcesToUpdateViews},a.prototype.updatePaneViews=function(){var t,e=this.sourcesToUpdateViews();for(t=0;t<e.length;t++)e[t].updateAllViews()},a.prototype.priceRangeInPrice=function(){var t,e,i,o,n,r;return this.isEmpty()?null:this.isPercent()?(t=this.mainSource().model().timeScale().visibleBars(),
e=this.mainSource().data().search(t.firstBar(),p.NearestRight).value[TradingView.CLOSE_PLOT],i=this.priceRange().convertFromPercents(e),{from:i.minValue(),to:i.maxValue()}):(o=this.height(),n=this.coordinateToPrice(o-1),r=this.coordinateToPrice(0),{from:n,to:r})},t.exports=a}).call(e,i(20),i(147))},function(t,e,i){"use strict";function o(t){this._graphics=o.emptyGraphics(),n(!!t,"Study metaInfo is absent!"),this._metaInfo=t}var n=i(21).assert,r=i(13).getLogger("Chart.StudyGraphics");o.emptyGraphics=function(){return{indexes:[]}},o.prototype.isEmpty=function(){var t=Object.keys(this._graphics).length>1;return 0===this._graphics.indexes.length&&!t},o.prototype.graphics=function(){return this._graphics},o.prototype.setGraphics=function(t){this._graphics=t,this._postProcessGraphicsData()},o.prototype.process=function(t){if(""!==t.d)return t.d.indexes_replace?void this.replaceIndexes(t):void(t.d.graphicsCmds&&(this.processEraseCmds(t.d.graphicsCmds.erase),this.processCreateCmds(t.d.graphicsCmds.create,t.indexes)))},o.prototype.replaceIndexes=function(t){""!==t.d&&(n(!!t.d.indexes_replace),this._graphics.indexes=t.indexes)},o.prototype.processEraseCmds=function(t){var e,i,r,s,a;if(t)for(n(!!this._graphics,"_graphics object doesn't exist in the study!"),n(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!"),e=0;e<t.length;++e)if(i=t[e],"all"===i.action)this._graphics=o.emptyGraphics();else{if("one"!==i.action)throw Error("Unknown graphics command "+i.action);for(r in this._graphics[i.type])s=this._graphics[i.type][r],(a=o._findGraphicsObjIndexById(s.data,i.id))>=0&&s.data.splice(a,1)}},o._findGraphicsObjIndexById=function(t,e){for(var i=0;i<t.length;++i)if(t[i].id===e)return i;return-1},o.prototype.processCreateCmds=function(t,e){var i,o,r,s,a,l;if(t){n(!!e,"indexes are missing in the study nonseries response!"),n(!!this._graphics,"_graphics object doesn't exist in the study!"),n(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!");for(i in t){n(i in this._metaInfo.graphics,"There is a '"+i+"' in study response, but it doesn't present in metaInfo!");for(o=0;o<t[i].length;++o){r=t[i][o],s=r.styleId,n(s in this._metaInfo.graphics[i]),this._graphics[i]||(this._graphics[i]=[]),a=null;for(l=0;l<this._graphics[i].length;++l)if(this._graphics[i][l].styleId===s){a=this._graphics[i][l];break}null===a&&(a={styleId:s,data:[]},this._graphics[i].push(a)),a.data=a.data.concat(r.data)}}"nochange"===e||(n(Array.isArray(e)),this._graphics.indexes=e),this._postProcessGraphicsData()}},o.prototype._postProcessGraphicsData=function(){this._graphics&&this._splitHHistItems()},o.prototype._splitHHistItems=function(){var t,e,i,n,r,s,a,l,c,h,u,d;if(void 0!==this._graphics.hhists){for(t in this._graphics.hhists)e=this._graphics.hhists[t],o._sortHHistItemsByPrice(e.data),i=this._graphics.indexes,e.dataObj=o._splitHHistItemsBySession(e.data,i);if(n=this._graphics.hhists[0],r=this._graphics.hhists[1],n&&r&&n.dataObj&&r.dataObj)for(s in n.dataObj)if(a=n.dataObj[s],l=r.dataObj[s],a&&l){for(c=l[0],
h=l[l.length-1],u=0;u<a.length;u++)d=a[u],(d.priceHigh>=c.priceHigh||d.priceLow>=c.priceLow)&&(d.priceHigh<=h.priceHigh||d.priceLow<=h.priceLow)&&(d.va=!0);n.shortDataObj||(n.shortDataObj={}),n.shortDataObj[s]=a.slice()}}},o._sortHHistItemsByPrice=function(t){t.sort(function(t,e){return t.priceLow-e.priceLow})},o._splitHHistItemsBySession=function(t,e){var i,o,n,s={};for(i=0;i<t.length;++i)o=t[i],n=e[o.firstBarTime],void 0!==n?(n in s||(s[n]=[]),s[n].push(o)):r.logError("Cannot find index "+o.firstBarTime+" in study timescale indexes");return s},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){a.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i)}function r(t,e,i){o.call(this,t,e,i)}function s(t,e,i){o.call(this,t,e,i)}var a=i(135).LineStudyMtp;inherit(o,a),o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t,e,i=this.points();return i.length<this.pointsCount()?null:(t=i[0].index,e=this._model.mainSeries().bars().valueAt(t),null===e?null:[this.properties().inputs.displayZoneLabels.value(),1e3*e[TradingView.TIME_PLOT]])},inherit(n,o),n.prototype._mtpStudyId=function(){return"mtp_ew_main"},inherit(r,o),r.prototype._mtpStudyId=function(){return"mtp_ew_major"},inherit(s,o),s.prototype._mtpStudyId=function(){return"mtp_ew_minor"},e.LineStudyMtpElliotWaveMinor=s,e.LineStudyMtpElliotWaveMajor=r,e.LineStudyMtpElliotWaveMain=n,e.LineStudyMtpElliotWave=o},function(t,e){"use strict";function i(){this._data=null}var o=/[1-9]/g;i.prototype.setData=function(t){this._data=t},i.prototype.draw=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S;null!=this._data&&!1!==this._data.visible&&0!==this._data.text.length&&(t.font=e.font,(i=Math.round(e.widthCache.measureText(t,this._data.text,o)))<=0||(n=e.paddingHorizontal,r=i+2*n,s=r/2,a=this._data.width,l=this._data.coordinate,c=Math.floor(l-s)+.5,c<0?(l+=Math.abs(0-c),c=Math.floor(l-s)+.5):c+r>a&&(l-=Math.abs(a-(c+r)),c=Math.floor(l-s)+.5),h=c,u=h+r,d=u,p=Math.round(this._data.coordinate+1),_=p,f=.5,m=f+e.borderSize+e.tickLength+e.paddingTop+e.fontSize+e.paddingBottom,g=m,v=f,y=v,b=y+e.borderSize+e.tickLength,S=m-e.baselineOffset-e.paddingBottom,t.fillStyle=this._data.background,t.lineWidth=1,t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(c,f),t.lineTo(h,m),t.lineTo(u,g),t.lineTo(d,v),t.fill(),t.beginPath(),t.moveTo(p,y),t.lineTo(_,b),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,c+n,S)))},t.exports=i},function(t,e){!function(t,e){var i=5;t.widget("ui.slider",t.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var e=this,o=this.options;if(this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),o.disabled&&this.element.addClass("ui-slider-disabled ui-disabled"),this.range=t([]),
o.range&&(!0===o.range?(this.range=t("<div></div>"),o.values||(o.values=[this._valueMin(),this._valueMin()]),o.values.length&&2!==o.values.length&&(o.values=[o.values[0],o.values[0]])):this.range=t("<div></div>"),this.range.appendTo(this.element).addClass("ui-slider-range"),"min"!==o.range&&"max"!==o.range||this.range.addClass("ui-slider-range-"+o.range),this.range.addClass("ui-widget-header")),0===t(".ui-slider-handle",this.element).length&&t("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle"),o.values&&o.values.length)for(;t(".ui-slider-handle",this.element).length<o.values.length;)t("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=t(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all"),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(t){t.preventDefault()}).hover(function(){o.disabled||t(this).addClass("ui-state-hover")},function(){t(this).removeClass("ui-state-hover")}).focus(function(){o.disabled?t(this).blur():(t(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),t(this).addClass("ui-state-focus"))}).blur(function(){t(this).removeClass("ui-state-focus")}),this.handles.each(function(e){t(this).data("index.ui-slider-handle",e)}),this.handles.keydown(function(o){var n,r,s,a=!0,l=t(this).data("index.ui-slider-handle");if(!e.options.disabled){switch(o.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(a=!1,!e._keySliding&&(e._keySliding=!0,t(this).addClass("ui-state-active"),!1===e._start(o,l)))return}switch(s=e.options.step,n=r=e.options.values&&e.options.values.length?e.values(l):e.value(),o.keyCode){case t.ui.keyCode.HOME:r=e._valueMin();break;case t.ui.keyCode.END:r=e._valueMax();break;case t.ui.keyCode.PAGE_UP:r=e._trimAlignValue(n+(e._valueMax()-e._valueMin())/i);break;case t.ui.keyCode.PAGE_DOWN:r=e._trimAlignValue(n-(e._valueMax()-e._valueMin())/i);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===e._valueMax())return;r=e._trimAlignValue(n+s);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===e._valueMin())return;r=e._trimAlignValue(n-s)}return e._slide(o,l,r),a}}).keyup(function(i){var o=t(this).data("index.ui-slider-handle");e._keySliding&&(e._keySliding=!1,e._stop(i,o),e._change(i,o),t(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(e){var i,o,n,r,s,a,l,c,h=this.options;return!h.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},o=this._normValueFromMouse(i),
n=this._valueMax()-this._valueMin()+1,s=this,this.handles.each(function(e){var i=Math.abs(o-s.values(e));n>i&&(n=i,r=t(this),a=e)}),!0===h.range&&this.values(1)===h.min&&(a+=1,r=t(this.handles[a])),!1!==this._start(e,a)&&(this._mouseSliding=!0,s._handleIndex=a,r.addClass("ui-state-active").focus(),l=r.offset(),c=!t(e.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=c?{left:0,top:0}:{left:e.pageX-l.left-r.width()/2,top:e.pageY-l.top-r.height()/2-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,o),this._animateOff=!0,!0))},_mouseStart:function(t){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,o,n,r;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),o=i/e,o>1&&(o=1),o<0&&(o=0),"vertical"===this.orientation&&(o=1-o),n=this._valueMax()-this._valueMin(),r=this._valueMin()+o*n,this._trimAlignValue(r)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var o,n,r;this.options.values&&this.options.values.length?(o=this.values(e?0:1),2===this.options.values.length&&!0===this.options.range&&(0===e&&i>o||1===e&&i<o)&&(i=o),i!==this.values(e)&&(n=this.values(),n[e]=i,r=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),o=this.values(e?0:1),!1!==r&&this.values(e,i,!0))):i!==this.value()&&!1!==(r=this._trigger("slide",t,{handle:this.handles[e],value:i}))&&this.value(i)},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("change",t,i)}},value:function(t){return arguments.length&&(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0)),this._value()},values:function(e,i){var o,n,r;if(arguments.length>1&&(this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e)),!arguments.length)return this._values()
;if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(o=this.options.values,n=arguments[0],r=0;r<o.length;r+=1)o[r]=this._trimAlignValue(n[r]),this._change(null,r);this._refreshValue()},_setOption:function(e,i){var o,n=0;switch(t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"disabled":i?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.attr("disabled","disabled"),this.element.addClass("ui-disabled")):(this.handles.removeAttr("disabled"),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),o=0;o<n;o+=1)this._change(null,o);this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,o;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);for(i=this.options.values.slice(),o=0;o<i.length;o+=1)i[o]=this._trimAlignValue(i[o]);return i},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e;return alignValue=t-i,2*Math.abs(i)>=e&&(alignValue+=i>0?e:-e),parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,o,n,r,s=this.options.range,a=this.options,l=this,c=!this._animateOff&&a.animate,h={};this.options.values&&this.options.values.length?this.handles.each(function(o,n){e=(l.values(o)-l._valueMin())/(l._valueMax()-l._valueMin())*100,h["horizontal"===l.orientation?"left":"bottom"]=e+"%",t(this).stop(1,1)[c?"animate":"css"](h,a.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===o&&l.range.stop(1,1)[c?"animate":"css"]({left:e+"%"},a.animate),1===o&&l.range[c?"animate":"css"]({width:e-i+"%"},{queue:!1,duration:a.animate})):(0===o&&l.range.stop(1,1)[c?"animate":"css"]({bottom:e+"%"},a.animate),1===o&&l.range[c?"animate":"css"]({height:e-i+"%"},{queue:!1,duration:a.animate}))),i=e}):(o=this.value(),n=this._valueMin(),r=this._valueMax(),e=r!==n?(o-n)/(r-n)*100:0,h["horizontal"===l.orientation?"left":"bottom"]=e+"%",this.handle.stop(1,1)[c?"animate":"css"](h,a.animate),"min"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},a.animate),"max"===s&&"horizontal"===this.orientation&&this.range[c?"animate":"css"]({width:100-e+"%"},{queue:!1,duration:a.animate}),"min"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},a.animate),"max"===s&&"vertical"===this.orientation&&this.range[c?"animate":"css"]({
height:100-e+"%"},{queue:!1,duration:a.animate}))}}),t.extend(t.ui.slider,{version:"@VERSION"})}(jQuery)},function(t,e,i){"use strict";function o(){}var n=i(57).Interval,r=i(97);o.isAvailable=function(t){var e,i=r.supportedResolutions.value(),o=!1;return o=void 0===i||-1!==i.indexOf(t),e=r.intraday.value(),e?o:n.isDWM(t)&&o},t.exports=o},function(t,e){"use strict";var i,o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(t){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 t,e;if(this.isAvailable)this.length=this.localStorage.length;else{t=0;for(e in this.localStorage)this.localStorage.hasOwnProperty(e)&&t++;this.length=t}},o.prototype.key=function(t){return this.isAvailable?this.localStorage.key(t):Object.keys(this.localStorage)[t]},o.prototype.getItem=function(t){return this.isAvailable?this.localStorage.getItem(t):this.localStorage[t]},o.prototype.setItem=function(t,e){this.isAvailable?this.localStorage.setItem(t,e):this.localStorage[t]=e,this._updateLength()},o.prototype.removeItem=function(t){this.isAvailable?this.localStorage.removeItem(t):delete this.localStorage[t],this._updateLength()},o.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()},i=function(t){this.storage=t},i.prototype.getItem=function(t){return Promise.resolve(this.storage.getItem(t))},i.prototype.setItem=function(t,e){return Promise.resolve(this.storage.setItem(t,e))},window.TVLocalStorage=new o,window.TVLocalStorageAsync=new i(window.TVLocalStorage),t.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},,,,,,,,,,,,,,,,,,function(t,e,i){var o,n;!function(r,s){"object"==typeof t&&t.exports?t.exports=s():(o=s,void 0!==(n="function"==typeof o?o.call(e,i,e,t):o)&&(t.exports=n))}(0,function(){"use strict";function t(t,e){var i,o=document.createElement(t||"div");for(i in e)o[i]=e[i];return o}function e(t){for(var e=1,i=arguments.length;e<i;e++)t.appendChild(arguments[e]);return t}function i(t,e,i,o){var n=["opacity",e,~~(100*t),i,o].join("-"),r=.01+i/o*100,s=Math.max(1-(1-t)/e*(100-r),t),a=c.substring(0,c.indexOf("Animation")).toLowerCase(),l=a&&"-"+a+"-"||"";return p[n]||(h.insertRule("@"+l+"keyframes "+n+"{0%{opacity:"+s+"}"+r+"%{opacity:"+t+"}"+(r+.01)+"%{opacity:1}"+(r+e)%100+"%{opacity:"+t+"}100%{opacity:"+s+"}}",h.cssRules.length),p[n]=1),n}function o(t,e){var i,o,n=t.style;if(e=e.charAt(0).toUpperCase()+e.slice(1),void 0!==n[e])return e;for(o=0;o<d.length;o++)if(i=d[o]+e,void 0!==n[i])return i}function n(t,e){for(var i in e)t.style[o(t,i)||i]=e[i];return t}function r(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)void 0===t[o]&&(t[o]=i[o])}return t}function s(t,e){return"string"==typeof t?t:t[e%t.length]}function a(t){this.opts=r(t||{},a.defaults,_)}function l(){
function i(e,i){return t("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',i)}h.addRule(".spin-vml","behavior:url(#default#VML)"),a.prototype.lines=function(t,o){function r(){return n(i("group",{coordsize:h+" "+h,coordorigin:-c+" "+-c}),{width:h,height:h})}function a(t,a,l){e(d,e(n(r(),{rotation:360/o.lines*t+"deg",left:~~a}),e(n(i("roundrect",{arcsize:o.corners}),{width:c,height:o.scale*o.width,left:o.scale*o.radius,top:-o.scale*o.width>>1,filter:l}),i("fill",{color:s(o.color,t),opacity:o.opacity}),i("stroke",{opacity:0}))))}var l,c=o.scale*(o.length+o.width),h=2*o.scale*c,u=-(o.width+o.length)*o.scale*2+"px",d=n(r(),{position:"absolute",top:u,left:u});if(o.shadow)for(l=1;l<=o.lines;l++)a(l,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(l=1;l<=o.lines;l++)a(l);return e(t,d)},a.prototype.opacity=function(t,e,i,o){var n=t.firstChild;o=o.shadow&&o.lines||0,n&&e+o<n.childNodes.length&&(n=n.childNodes[e+o],n=n&&n.firstChild,(n=n&&n.firstChild)&&(n.opacity=i))}}var c,h,u,d=["webkit","Moz","ms","O"],p={},_={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",opacity:.25,rotate:0,direction:1,speed:1,trail:100,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"absolute"};return a.defaults={},r(a.prototype,{spin:function(e){var i,o,r,s,a,l,h,u,d,p;return this.stop(),i=this,o=i.opts,r=i.el=t(null,{className:o.className}),n(r,{position:o.position,width:0,zIndex:o.zIndex,left:o.left,top:o.top}),e&&e.insertBefore(r,e.firstChild||null),r.setAttribute("role","progressbar"),i.lines(r,i.opts),c||(s=0,a=(o.lines-1)*(1-o.direction)/2,h=o.fps,u=h/o.speed,d=(1-o.opacity)/(u*o.trail/100),p=u/o.lines,function t(){s++;for(var e=0;e<o.lines;e++)l=Math.max(1-(s+(o.lines-e)*p)%u*d,o.opacity),i.opacity(r,e*o.direction+a,l,o);i.timeout=i.el&&setTimeout(t,~~(1e3/h))}()),i},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=void 0),this},lines:function(o,r){function a(e,i){return n(t(),{position:"absolute",width:r.scale*(r.length+r.width)+"px",height:r.scale*r.width+"px",background:e,boxShadow:i,transformOrigin:"left",transform:"rotate("+~~(360/r.lines*h+r.rotate)+"deg) translate("+r.scale*r.radius+"px,0)",borderRadius:(r.corners*r.scale*r.width>>1)+"px"})}for(var l,h=0,u=(r.lines-1)*(1-r.direction)/2;h<r.lines;h++)l=n(t(),{position:"absolute",top:1+~(r.scale*r.width/2)+"px",transform:r.hwaccel?"translate3d(0,0,0)":"",opacity:r.opacity,animation:c&&i(r.opacity,r.trail,u+h*r.direction,r.lines)+" "+1/r.speed+"s linear infinite"}),r.shadow&&e(l,n(a("#000","0 0 4px #000"),{top:"2px"})),e(o,e(l,a(s(r.color,h),"0 0 1px rgba(0,0,0,.1)")));return o},opacity:function(t,e,i){e<t.childNodes.length&&(t.childNodes[e].style.opacity=i)}}),"undefined"!=typeof document&&(h=function(){var i=t("style",{type:"text/css"});return e(document.getElementsByTagName("head")[0],i),i.sheet||i.styleSheet}(),u=n(t("group"),{behavior:"url(#default#VML)"}),
!o(u,"transform")&&u.adj?l():c=o(u,"animation")),a})},function(t,e,i){"use strict";function o(t){return"."+t.replace("+","")}function n(t,e){var i=o(t);c.unbind("keydown"+i).bind("keydown"+i,t,function(t){$(t.target).is("input[type=password]")||h||e.apply(null,Array.prototype.slice.call(arguments))}),l[t]=e}function r(t){c.unbind("keydown"+o(t)),delete l[t]}function s(){h=!0}function a(){h=!1}var l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),i(22),l={},c=$(document),h=!1,e.bind=n,e.unbind=r,e.disable=s,e.enable=a},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(90),n=i(2),r=i(55),s=i(26),a=i(77),l=i(190),c=i(227),h=i(665),u=i(512),d=function(t){function e(e){var i=t.call(this,e)||this;return i._toggleDropdown=function(t){i.setState({isOpened:void 0!==t?t:!i.state.isOpened})},i._handleClose=function(){i._toggleDropdown(!1)},i._getDropdownPosition=function(){if(!i._control)return{x:0,y:0};var t=i._control.getBoundingClientRect();return{x:t.left+t.width+5,y:t.top-6}},i._handleClickArrow=function(){i._toggleDropdown()},i._handleClickOutside=function(t){i.state.isOpened&&!r.findDOMNode(i).contains(t.target)&&i._toggleDropdown(!1)},i._handleTouchStart=function(){i.props.onClickButton(),i._toggleDropdown()},i._handlePressStart=function(){if(Modernizr.touch)i._longPressDelay||i.props.onClickButton();else{if(i._doubleClickDelay)return clearTimeout(i._doubleClickDelay),delete i._doubleClickDelay,void i._toggleDropdown(!0);i._doubleClickDelay=setTimeout(function(){delete i._doubleClickDelay,i._longPressDelay||i.props.onClickButton()},175)}i._longPressDelay=setTimeout(function(){delete i._longPressDelay,i._toggleDropdown(!0)},300)},i._handlePressEnd=function(){i._longPressDelay&&(clearTimeout(i._longPressDelay),delete i._longPressDelay,i.state.isOpened?i._toggleDropdown(!1):i.state.isOpened||!i.props.isActive||Modernizr.touch||i._toggleDropdown(!0))},i.state={isOpened:!1},i}return o.__extends(e,t),e.prototype.render=function(){var t,e=this,i=this.props,o=i.buttonActiveClass,r=i.buttonClass,d=i.buttonIcon,p=i.buttonTitle,_=i.isActive,f=i.isGrayed,m=i.menuItems,g=i.onClickWhenGrayed,v=this.state.isOpened;return n.createElement("div",{className:s(h.dropdown,"apply-common-tooltip common-tooltip-vertical",(t={},t[h.isGrayed]=f,t[h.isActive]=_,t[h.isOpened]=v,t)),onClick:f?g:void 0,title:p,"data-tooltip-delay":1500},n.createElement("div",{ref:function(t){return e._control=t},className:h.control},n.createElement("div",{className:h.buttonWrap,onMouseDown:f||Modernizr.touch?void 0:this._handlePressStart,onMouseUp:f||Modernizr.touch?void 0:this._handlePressEnd,onClick:!f&&Modernizr.touch?this._handleTouchStart:void 0},n.createElement(c.ToolButton,{activeClass:o,className:r,icon:d,isActive:_,isGrayed:f,isTransparent:!0})),!f&&!Modernizr.touch&&n.createElement("div",{className:h.arrow,onClick:this._handleClickArrow},n.createElement(a.Icon,{className:h.arrowIcon,icon:u}))),!f&&n.createElement(l.PopupMenu,{closeOnClickOutside:!1,isOpened:v,items:m,
onClickOutside:this._handleClickOutside,onClose:this._handleClose,position:this._getDropdownPosition}))},e}(n.PureComponent),e.ToolDropdown=d},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.layouts={s:{title:"1 chart",count:1,sizer:function(t,e,i,o){return{width:e.width-o-o,height:e.height-o-o,top:o,left:o}}}}},function(t,e,i){"use strict";function o(t){return"alwaysOn"===t||"alwaysOff"===t?t:"visibleOnMouseOver"}function n(){if(!c){var t="NavigationButtons.visibility";c=new a,c.setValue(o(l.getValue(t))),c.subscribe(c,function(e){l.setValue(t,o(e.value()))})}return c}function r(){return[{value:"visibleOnMouseOver",title:window.t("Visible on Mouse Over")},{value:"alwaysOn",title:window.t("Always Visible")},{value:"alwaysOff",title:window.t("Always Invisible")}]}function s(){var t,e;return h||(h=new a,t=n(),e=function(){var e=t.value();"alwaysOn"!==e&&"alwaysOff"!==e&&(e=Modernizr.touch?"alwaysOn":"visibleOnMouseOver"),h&&h.setValue(e)},t.subscribe(h,e),e()),h}var a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),i(23),i(90),a=i(52),l=i(63),e.property=n,e.availableValues=r,e.actualBehavior=s},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(21),n=i(51),i(22),r=function(){function t(t){var e=this;this._alive=new n,this._body=new n,this._width=new n,this._height=new n,this._fullscreen=new n,this._detachable=new n,this._visible=new n,this._availWidth=new n,this._availHeight=new n,this._owner=new n,this._ownersStack=[],this.owner=this._owner.readonly(),this._bridge={alive:this._alive.readonly(),body:this._body.readonly(),width:this._width.readonly(),height:this._height.readonly(),fullscreen:this._fullscreen.readonly(),detachable:this._detachable.readonly(),visible:this._visible.readonly(),availWidth:this._availWidth.readonly(),availHeight:this._availHeight.readonly(),remove:function(){var t=e._owner.value();t&&t.remove&&t.remove()},negotiateWidth:function(t){var i=e._owner.value();i&&i.negotiateWidth&&i.negotiateWidth(t)},negotiateHeight:function(t){var i=e._owner.value();i&&i.negotiateHeight&&i.negotiateHeight(t)},requestFullscreen:function(){var t=e._owner.value();t&&t.requestFullscreen&&t.requestFullscreen()},exitFullscreen:function(){var t=e._owner.value();t&&t.exitFullscreen&&t.exitFullscreen()},detach:function(t){var i=e._owner.value();i&&i.detach&&i.detach(t)},attach:function(){var t=e._owner.value();t&&t.attach&&t.attach()}},t&&this.pushOwner(t)}return t.prototype.bridge=function(){return this._bridge},t.prototype.pushOwner=function(t){var e,i,o,n;if(t.alive.value()){for(e=0,i=this._ownersStack;e<i.length;e++)o=i[e],this._unsubscribeOwner(o);n={owner:t},this._ownersStack.push(n),this._subscribeOwner(n)}},t.prototype._subscribeOwner=function(t){var e,i,o=this,n=t.owner;t.deathWatcher||(this._alive.setValue(!0),t.deathWatcher=n.alive.spawn(),t.deathWatcher.subscribe(function(e){e||o._deadHandler(t)})),t.subscriptions||(e=t.subscriptions=[],this._visible.setValue(!1),i=function(t,i){if(t){var o=t.spawn();e.push(o),
o.subscribe(function(t){i.setValue(t)},{callWithLast:!0})}else i.deleteValue()},i(n.body,this._body),i(n.width,this._width),i(n.height,this._height),i(n.fullscreen,this._fullscreen),i(n.detachable,this._detachable),i(n.availWidth,this._availWidth),i(n.availHeight,this._availHeight),i(n.visible,this._visible)),this._owner.setValue(n)},t.prototype._unsubscribeOwner=function(t,e){var i,o,n;if(t.subscriptions){for(i=0,o=t.subscriptions;i<o.length;i++)n=o[i],n.unsubscribe();t.subscriptions=null}e&&t.deathWatcher&&(t.deathWatcher.unsubscribe(),t.deathWatcher=null)},t.prototype._deadHandler=function(t){var e,i=this._ownersStack.indexOf(t);for(o.assert(-1!==i,"sanitized owner should be in stack"),e=this._ownersStack.length-1;e>=i;e--)this._unsubscribeOwner(this._ownersStack[e],!0);this._ownersStack.length=i,i>0?this._subscribeOwner(this._ownersStack[i-1]):(this._alive.setValue(!1),this._owner.deleteValue())},t}(),e.ResizerDetacherState=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Bars=0]="Bars",t[t.Line=1]="Line",t[t.OpenClose=2]="OpenClose",t[t.LineOpen=3]="LineOpen",t[t.LineHigh=4]="LineHigh",t[t.LineLow=5]="LineLow",t[t.LineHL2=6]="LineHL2"}(e.LineToolBarsPatternMode||(e.LineToolBarsPatternMode={}))},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(95),r=i(34),s=function(t){function e(e,i){var o=t.call(this)||this;return o._activeBackground="#0F6DBF",o._background="#5592C9",o._active=!1,o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype.setActive=function(t){this._active=t},e.prototype.setBackground=function(t){this._background=t},e.prototype._updateRendererData=function(t){var e,i,o,n,s,a,l,c;if(t.visible=!1,e=this._source.model(),e.timeScale()&&!e.timeScale().isEmpty()&&null!==(i=this._source.priceScale())&&!i.isEmpty()&&(e.selectedSource()===this._source||this._source.isForcedDrawPriceAxisLabel())&&null!==e.timeScale().visibleBars()&&(o=this._source.axisPoints(),n=this._data.pointIndex,!(o.length<=n)&&(s=o[n],isFinite(s.price)))){if(i.isPercent()){if(!(a=this._source.ownerSource()))return;if(l=a.firstValue(),!r.isNumber(l))return;s.price=i.priceRange().convertToPercent(s.price,l)}c=this._active?this._activeBackground:this._background,this._data.backgroundProperty&&(c=this._data.backgroundProperty.value()),t.background=c,t.borderColor="#2E84A6",t.color=this.generateTextColor(c),t.coordinate=i.priceToCoordinate(s.price),t.text=i.formatter().format(s.price),t.visible=!0}},e}(n.PriceAxisView),e.LineToolPriceAxisView=s},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t.offset=8,t.font="Arial",t.fontSize=12,t.lineSpacing=10,t.bgColor="rgba(255,255,255,.8)",t.borderColor="#e3e3e3",t.padding=8}(e.LabelSettings||(e.LabelSettings={}))},,function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(21),n=i(42),function(t){t[t.FromLeft=-1]="FromLeft",t[t.FromRight=1]="FromRight"}(r=e.TimePointIndexSearchMode||(e.TimePointIndexSearchMode={})),
s=function(){function t(t){this.m_bars=new n.PlotList(t),this.m_nsBars=new n.PlotList(t)}return t.prototype.bars=function(){return this.m_bars},t.prototype.nsBars=function(){return this.m_nsBars},t.prototype.size=function(){return this.m_bars.size()+this.m_nsBars.size()},t.prototype.each=function(t){this.m_bars.each(t),this.m_nsBars.each(t)},t.prototype.clear=function(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0},t.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()},t.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()},t.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()},t.prototype.search=function(t,e){return this.nsBars().isEmpty()?this.bars().search(t,e):this.bars().isEmpty()?this.nsBars().search(t,e):o.ensureNotNull(this.nsBars().firstIndex())<=t?this.nsBars().search(t,e):this.bars().search(t,e)},t.prototype.valueAt=function(t){var e=this.search(t);return null!==e?e.value:null},t.prototype.plotValueToTimePointIndex=function(t,e,i){var o,n,s,a;if(i===r.FromRight)return o=function(i,o){var n=o[e];return void 0!==n&&null!==n&&t>=n},null!==(n=this.m_bars.findLast(o))?n.index:(s=this.m_nsBars.findLast(o),null!==s?s.index:this.m_bars.firstIndex());if(i===r.FromLeft)return a=function(i,o){var n=o[e];return void 0!==n&&null!==n&&t<=n},null!==(n=this.m_bars.findFirst(a))?n.index:(s=this.m_nsBars.findFirst(a),null!==s?s.index:this.m_bars.lastIndex());throw Error("plotValueToTimePointIndex: unsupported search mode")},t}(),e.SeriesData=s},function(t,e,i){"use strict";function o(t){var e=t.split(":");return{name:e[0],type:2===e.length?e[1]:null}}function n(t,e,i,n){var r,s,a,l,c,p,_,f,m,g,v,y,b,S,w,T=i.split(".");if(0!==T.length&&0!==T[0].length){if(r=o(T[0]),s=r.name,a=r.type,l=null!==a,c=!l||"plot"===a,p=!l||"band"===a,_=!l||"area"===a,f=!l||"input"===a,m=c?d.getPlotIdByTitle(t,s):null,g=p?d.getBandIndexByName(t,s):null,v=_?d.getFilledAreaIdByTitle(t,s):null,y=f?d.getInputByName(t,s):null,b=e.hasOwnProperty(s),(null!==m?1:0)+(null!==g?1:0)+(null!==v?1:0)+(null!==y?1:0)+(b?1:0)>1)return void h.logWarn("Study '"+t.description+"' has ambiguous identifier '"+s+"'");if(S=T[1],null!==m){if(1===T.length)return void h.logWarn("Path of sub-property of '"+s+"' plot for study '"+t.description+"' must be not empty");w=T.slice(1),u.applyPlotProperty(t,e,m,w,n)}else if(null!==y)u.applyInputValue(e,y,n);else if(null!==g){if(void 0===S)return void h.logWarn("Property name of '"+s+"' band for study '"+t.description+"' must be set");u.applyBandProperty(e,g,S,n)}else if(null!==v){if(void 0===S)return void h.logWarn("Property name of '"+s+"' area for study '"+t.description+"' must be set");u.applyFilledAreaProperty(e,v,S,n)}else b?u.setRootProperty(e,T,n):h.logWarn("Study '"+t.description+"' has no plot or input '"+s+"'")}}function r(t,e){var i,o,r=t.properties(),s=r.state();for(i in e)e.hasOwnProperty(i)&&n(t.metaInfo(),s,i,e[i]);r.merge(s),o=r.precision,
void 0!==o?o.listeners().fire(o):r.listeners().fire(r)}function s(t,e,i){var o,r,s,a,l;for(o in t)t.hasOwnProperty(o)&&-1!==(r=o.indexOf("."))&&(s=o.substr(0,r),a=d.getMetaInfoByDescription(e,s),null!==a?(l=i(a.id),null!==l?n(a,l,o.substr(r+1),t[o]):h.logWarn("Cannot apply overrides for study "+s)):h.logWarn("There is no such study "+s))}var a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),a=i(106),l=i(21),c=i(13),h=c.getLogger("Chart.Model.StudyPropertiesOverrider"),function(t){function e(t){return"colorer"===t.type}function i(t,i,o){var n,r,s,a;if(void 0===t.plots)return null;for(n=0,r=t.plots;n<r.length;n++)if(s=r[n],e(s)&&void 0!==i.palettes&&(a=i.palettes[s.palette],s.target===o&&void 0!==a))return a;return null}function o(t,e,i,o,n){return void 0===t.styles?void h.logWarn("Study does not have styles"):null===e&&!isNaN(o)&&o>0?void h.logWarn("Study plot does not have color #"+o):((0===o||isNaN(o))&&(l.ensureDefined(t.styles[i]).color=n+"",o=0),void(null!==e&&(l.ensureDefined(e.colors[o]).color=n+"")))}function n(t,e,n,r,s){var a,l,c,u,p;if(void 0===e.styles)return void h.logWarn("Study does not have styles");if("color"===(a=r[0]))return l=i(t,e,n),c=r.length>1?parseInt(r[1]):NaN,void o(e,l,n,c,s);if(void 0===(u=e.styles[n])||!u.hasOwnProperty(a))return void h.logWarn("Study plot does not have property '"+a+"'");if("plottype"===a){if(void 0===(p=d[s+""]))return void h.logWarn("Unsupported plot type for plot: "+s);s=p}u[a]=s}function r(t,e,i,o){var n,r;if(void 0===t.bands)return void h.logWarn("Study does not have bands");if(void 0===(n=t.bands[e])||!n.hasOwnProperty(i))return void h.logWarn("Study band does not have property '"+i+"'");if("plottype"===i){if(void 0===(r=d[o+""]))return void h.logWarn("Unsupported plot type for band: "+o);o=r}n[i]=o}function s(t,e,i,o){if(void 0===t.filledAreasStyle)return void h.logWarn("Study does not have areas");var n=t.filledAreasStyle[e];if(void 0===n||!n.hasOwnProperty(i))return void h.logWarn("Study area does not have property '"+i+"'");n[i]=o}function c(t,e,i){if(void 0===t.inputs||!t.inputs.hasOwnProperty(e))return void h.logWarn("Study does not have input '"+e+"'");t.inputs[e]=i}function u(t,e,i){var o,n,r,s,a;if(0!==e.length){for(o=t,n=0,r=e.slice(0,-1);n<r.length&&(s=r[n],null!=o&&t.hasOwnProperty(s));n++)o=t[s];if(a=e[e.length-1],null==o||!o.hasOwnProperty(a))return void h.logWarn("Study does not have property "+e.join("."));o[a]=i}}var d={line:a.PlotType.Line,histogram:a.PlotType.Histogram,cross:a.PlotType.Cross,area:a.PlotType.Area,columns:a.PlotType.Columns,circles:a.PlotType.Circles,line_with_breaks:a.PlotType.LineWithBreaks,area_with_breaks:a.PlotType.AreaWithBreaks};t.applyPlotProperty=n,t.applyBandProperty=r,t.applyFilledAreaProperty=s,t.applyInputValue=c,t.setRootProperty=u}(u||(u={})),function(t){function e(t,e){var i,o,n;if(void 0===t.inputs)return null;for(e=e.toLowerCase(),i=0,o=t.inputs;i<o.length;i++)if(n=o[i],n.name.toLowerCase()===e)return n.id;return null}function i(t,e){var i,o,n;if(void 0===t.styles)return null;e=e.toLowerCase()
;for(i in t.styles)if(o=t.styles[i],n=void 0!==o&&void 0!==o.title?o.title:i,n.toLowerCase()===e)return i;return null}function o(t,e){var i,o,n;if(void 0===t.filledAreas)return null;for(e=e.toLowerCase(),i=0,o=t.filledAreas;i<o.length;i++)if(n=o[i],n.title.toLowerCase()===e)return n.id;return null}function n(t,e){if(void 0===t.bands)return null;e=e.toLowerCase();for(var i=0;i<t.bands.length;++i)if(t.bands[i].name.toLowerCase()===e)return i;return null}function r(t,e){var i,o,n;for(e=e.toLowerCase(),i=0,o=t;i<o.length;i++)if(n=o[i],n.description.toLowerCase()===e||n.shortDescription.toLowerCase()===e)return n;return null}t.getInputByName=e,t.getPlotIdByTitle=i,t.getFilledAreaIdByTitle=o,t.getBandIndexByName=n,t.getMetaInfoByDescription=r}(d||(d={})),e.applyOverridesToStudy=r,e.applyOverridesToStudyDefaults=s},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(53),n=function(){function t(){this._text="",this._background="#585858",this._coordinate=0}return t.prototype.text=function(){return this._text},t.prototype.background=function(){return this._background},t.prototype.color=function(){return"black"===o.rgbToBlackWhiteString(o.parseRgb(this._background),150)?"white":"black"},t.prototype.coordinate=function(){return this._coordinate},t}(),e.TimeAxisView=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MINUTE_SPAN=20,e.HOUR_SPAN=30,e.DAY_SPAN=40,e.WEEK_SPAN=50,e.MONTH_SPAN=60,e.YEAR_SPAN=70,e.DEFAULT_BAR_SPACING=6,e.DEFAULT_RIGHT_OFFSET=5},function(t,e){"use strict";function i(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}Object.defineProperty(e,"__esModule",{value:!0}),e.regExpEscape=i},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(700);e.TVDialogAbstract=o.TVDialogAbstract,e.closeAllDialogs=o.closeAllDialogs},,,,,,,,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path fill-rule="evenodd" d="M10.893 9.512l.458 3.624c.014.105-.006.16-.02.176-.028.03-.109.005-.182-.03L7.812 11.73a1.973 1.973 0 0 0-.811-.16c-.302 0-.59.057-.81.16l-3.338 1.552c-.118.056-.164.051-.182.03-.014-.016-.034-.07-.02-.178L3.11 9.51c.06-.503-.162-1.18-.505-1.54L.087 5.302c-.085-.091-.09-.148-.086-.158.003-.01.04-.053.16-.077l3.621-.689c.491-.09 1.069-.506 1.315-.948L7.004 0l1.902 3.43c.246.442.824.859 1.312.947l3.617.69c.123.024.162.068.164.077.003.01-.003.066-.089.157L11.4 7.97c-.348.367-.57 1.045-.506 1.543z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M9.901 9.639c-.102-.797.218-1.775.77-2.356l1.438-1.527-2.07-.395c-.784-.142-1.615-.742-2.008-1.446L7.003 2.06 5.97 3.917c-.391.702-1.222 1.301-2 1.443l-2.08.396 1.44 1.526c.547.577.866 1.549.77 2.353l-.262 2.086 1.93-.897a2.95 2.95 0 0 1 1.233-.254c.44 0 .87.085 1.233.254l1.93.897-.263-2.082zm.992-.127l.458 3.624c.014.105-.006.16-.02.176-.028.03-.109.005-.182-.03L7.812 11.73a1.973 1.973 0 0 0-.811-.16c-.302 0-.59.057-.81.16l-3.338 1.552c-.118.056-.164.051-.182.03-.014-.016-.034-.07-.02-.178L3.11 9.51c.06-.503-.162-1.18-.505-1.54L.087 5.302c-.085-.091-.09-.148-.086-.158.003-.01.04-.053.16-.077l3.621-.689c.491-.09 1.069-.506 1.315-.948L7.004 0l1.902 3.43c.246.442.824.859 1.312.947l3.617.69c.123.024.162.068.164.077.003.01-.003.066-.089.157L11.4 7.97c-.348.367-.57 1.045-.506 1.543z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.5 13.8"><path d="M7.3 0l2.2 4.5 5 .7-3.6 3.6.8 5-4.4-2.4-4.5 2.4.8-5L0 5.2l5-.7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 95.939 95.939" width="95.939" height="95.939"><path d="M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-80 -25 140 140" width="16" height="16"><path d="M10 12L-.7.7-41 43.2l.1.1-.1.1L-.7 85.9l10-10.6-29.7-31.2z"/></svg>'},,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){},function(t,e){},,,,function(t,e,i){var o;!function(n,r,s,a){"use strict";function l(t,e,i){return setTimeout(p(t,i),e)}function c(t,e,i){return!!Array.isArray(t)&&(h(t,i[e],i),!0)}function h(t,e,i){var o;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(o=0;o<t.length;)e.call(i,t[o],o,t),o++;else for(o in t)t.hasOwnProperty(o)&&e.call(i,t[o],o,t)}function u(t,e,i){var o="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=n.console&&(n.console.warn||n.console.log);return r&&r.call(n.console,o,i),t.apply(this,arguments)}}function d(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&ft(o,i)}function p(t,e){return function(){return t.apply(e,arguments)}}function _(t,e){return typeof t==Te?t.apply(e?e[0]||a:a,e):t}function f(t,e){return t===a?e:t}function m(t,e,i){h(b(e),function(e){t.addEventListener(e,i,!1)})}function g(t,e,i){h(b(e),function(e){t.removeEventListener(e,i,!1)})}function v(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function y(t,e){return t.indexOf(e)>-1}function b(t){return t.trim().split(/\s+/g)}function S(t,e,i){
if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;o<t.length;){if(i&&t[o][i]==e||!i&&t[o]===e)return o;o++}return-1}function w(t){return Array.prototype.slice.call(t,0)}function T(t,e,i){for(var o,n=[],r=[],s=0;s<t.length;)o=e?t[s][e]:t[s],S(r,o)<0&&n.push(t[s]),r[s]=o,s++;return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}function x(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),r=0;r<Se.length;){if(i=Se[r],(o=i?i+n:e)in t)return o;r++}return a}function C(){return vt++}function P(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||n}function L(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){_(t.options.enable,[t])&&i.handler(e)},this.init()}function I(t){var e=t.options.inputClass;return new(e||(St?$:wt?j:bt?G:W))(t,k)}function k(t,e,i){var o=i.pointers.length,n=i.changedPointers.length,r=e&It&&o-n==0,s=e&(At|Mt)&&o-n==0;i.isFirst=!!r,i.isFinal=!!s,r&&(t.session={}),i.eventType=e,A(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function A(t,e){var i,o,n,r,s,a,l=t.session,c=e.pointers,h=c.length;l.firstInput||(l.firstInput=V(e)),h>1&&!l.firstMultiple?l.firstMultiple=V(e):1===h&&(l.firstMultiple=!1),i=l.firstInput,o=l.firstMultiple,n=o?o.center:i.center,r=e.center=D(c),e.timeStamp=Pe(),e.deltaTime=e.timeStamp-i.timeStamp,e.angle=z(n,r),e.distance=R(n,r),M(l,e),e.offsetDirection=B(e.deltaX,e.deltaY),s=O(e.deltaTime,e.deltaX,e.deltaY),e.overallVelocityX=s.x,e.overallVelocityY=s.y,e.overallVelocity=Ce(s.x)>Ce(s.y)?s.x:s.y,e.scale=o?N(o.pointers,c):1,e.rotation=o?F(o.pointers,c):0,e.maxPointers=l.prevInput?e.pointers.length>l.prevInput.maxPointers?e.pointers.length:l.prevInput.maxPointers:e.pointers.length,E(l,e),a=t.element,v(e.srcEvent.target,a)&&(a=e.srcEvent.target),e.target=a}function M(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},r=t.prevInput||{};e.eventType!==It&&r.eventType!==At||(n=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function E(t,e){var i,o,n,r,s,l,c,h=t.lastInterval||e,u=e.timeStamp-h.timeStamp;e.eventType!=Mt&&(u>Lt||h.velocity===a)?(s=e.deltaX-h.deltaX,l=e.deltaY-h.deltaY,c=O(u,s,l),o=c.x,n=c.y,i=Ce(c.x)>Ce(c.y)?c.x:c.y,r=B(s,l),t.lastInterval=e):(i=h.velocity,o=h.velocityX,n=h.velocityY,r=h.direction),e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=r}function V(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:xe(t.pointers[i].clientX),clientY:xe(t.pointers[i].clientY)},i++;return{timeStamp:Pe(),pointers:e,center:D(e),deltaX:t.deltaX,deltaY:t.deltaY}}function D(t){var e,i,o,n=t.length;if(1===n)return{x:xe(t[0].clientX),y:xe(t[0].clientY)};for(e=0,i=0,o=0;o<n;)e+=t[o].clientX,i+=t[o].clientY,o++;return{x:xe(e/n),y:xe(i/n)}}function O(t,e,i){return{x:e/t||0,y:i/t||0}}function B(t,e){return t===e?Et:Ce(t)>=Ce(e)?t<0?Vt:Dt:e<0?Ot:Bt}function R(t,e,i){i||(i=Nt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function z(t,e,i){i||(i=Nt)
;var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function F(t,e){return z(e[1],e[0],Wt)+z(t[1],t[0],Wt)}function N(t,e){return R(e[0],e[1],Wt)/R(t[0],t[1],Wt)}function W(){this.evEl=Ht,this.evWin=Ut,this.pressed=!1,L.apply(this,arguments)}function $(){this.evEl=Gt,this.evWin=Yt,L.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function H(){this.evTarget=Zt,this.evWin=Xt,this.started=!1,L.apply(this,arguments)}function U(t,e){var i=w(t.touches),o=w(t.changedTouches);return e&(At|Mt)&&(i=T(i.concat(o),"identifier",!0)),[i,o]}function j(){this.evTarget=Qt,this.targetIds={},L.apply(this,arguments)}function q(t,e){var i,o,n,r,s,l=w(t.touches),c=this.targetIds;if(e&(It|kt)&&1===l.length)return c[l[0].identifier]=!0,[l,l];if(n=w(t.changedTouches),r=[],s=this.target,o=l.filter(function(t){return v(t.target,s)}),e===It)for(i=0;i<o.length;)c[o[i].identifier]=!0,i++;for(i=0;i<n.length;)c[n[i].identifier]&&r.push(n[i]),e&(At|Mt)&&delete c[n[i].identifier],i++;return r.length?[T(o.concat(r),"identifier",!0),r]:a}function G(){L.apply(this,arguments);var t=p(this.handler,this);this.touch=new j(this.manager,t),this.mouse=new W(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function Y(t,e){t&It?(this.primaryTouch=e.changedPointers[0].identifier,K.call(this,e)):t&(At|Mt)&&K.call(this,e)}function K(t){var e,i,o,n=t.changedPointers[0];n.identifier===this.primaryTouch&&(e={x:n.clientX,y:n.clientY},this.lastTouches.push(e),i=this.lastTouches,o=function(){var t=i.indexOf(e);t>-1&&i.splice(t,1)},setTimeout(o,te))}function Z(t){var e,i,o,n,r=t.srcEvent.clientX,s=t.srcEvent.clientY;for(e=0;e<this.lastTouches.length;e++)if(i=this.lastTouches[e],o=Math.abs(r-i.x),n=Math.abs(s-i.y),o<=ee&&n<=ee)return!0;return!1}function X(t,e){this.manager=t,this.set(e)}function J(t){var e,i;return y(t,ae)?ae:(e=y(t,le),i=y(t,ce),e&&i?ae:e||i?e?le:ce:y(t,se)?se:re)}function Q(){var t,e;return!!oe&&(t={},e=n.CSS&&n.CSS.supports,["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){t[i]=!e||n.CSS.supports("touch-action",i)}),t)}function tt(t){this.options=ft({},this.defaults,t||{}),this.id=C(),this.manager=null,this.options.enable=f(this.options.enable,!0),this.state=ue,this.simultaneous={},this.requireFail=[]}function et(t){return t&me?"cancel":t&_e?"end":t&pe?"move":t&de?"start":""}function it(t){return t==Bt?"down":t==Ot?"up":t==Vt?"left":t==Dt?"right":""}function ot(t,e){var i=e.manager;return i?i.get(t):t}function nt(){tt.apply(this,arguments)}function rt(){nt.apply(this,arguments),this.pX=null,this.pY=null}function st(){nt.apply(this,arguments)}function at(){tt.apply(this,arguments),this._timer=null,this._input=null}function lt(){nt.apply(this,arguments)}function ct(){nt.apply(this,arguments)}function ht(){tt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ut(t,e){return e=e||{},e.recognizers=f(e.recognizers,ut.defaults.preset),new dt(t,e)}function dt(t,e){this.options=ft({},ut.defaults,e||{}),
this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=I(this),this.touchAction=new X(this,this.options.touchAction),pt(this,!0),h(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function pt(t,e){var i,o=t.element;o.style&&(h(t.options.cssProps,function(n,r){i=x(o.style,r),e?(t.oldCssProps[i]=o.style[i],o.style[i]=n):o.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={}))}function _t(t,e){var i=r.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}var ft,mt,gt,vt,yt,bt,St,wt,Tt,xt,Ct,Pt,Lt,It,kt,At,Mt,Et,Vt,Dt,Ot,Bt,Rt,zt,Ft,Nt,Wt,$t,Ht,Ut,jt,qt,Gt,Yt,Kt,Zt,Xt,Jt,Qt,te,ee,ie,oe,ne,re,se,ae,le,ce,he,ue,de,pe,_e,fe,me,ge,ve,ye,be,Se=["","webkit","Moz","MS","ms","o"],we=r.createElement("div"),Te="function",xe=Math.round,Ce=Math.abs,Pe=Date.now;ft="function"!=typeof Object.assign?function(t){var e,i,o,n;if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(e=Object(t),i=1;i<arguments.length;i++)if((o=arguments[i])!==a&&null!==o)for(n in o)o.hasOwnProperty(n)&&(e[n]=o[n]);return e}:Object.assign,mt=u(function(t,e,i){for(var o=Object.keys(e),n=0;n<o.length;)(!i||i&&t[o[n]]===a)&&(t[o[n]]=e[o[n]]),n++;return t},"extend","Use `assign`."),gt=u(function(t,e){return mt(t,e,!0)},"merge","Use `assign`."),vt=1,yt=/mobile|tablet|ip(ad|hone|od)|android/i,bt="ontouchstart"in n,St=x(n,"PointerEvent")!==a,wt=bt&&yt.test(navigator.userAgent),Tt="touch",xt="pen",Ct="mouse",Pt="kinect",Lt=25,It=1,kt=2,At=4,Mt=8,Et=1,Vt=2,Dt=4,Ot=8,Bt=16,Rt=Vt|Dt,zt=Ot|Bt,Ft=Rt|zt,Nt=["x","y"],Wt=["clientX","clientY"],L.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(P(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(P(this.element),this.evWin,this.domHandler)}},$t={mousedown:It,mousemove:kt,mouseup:At},Ht="mousedown",Ut="mousemove mouseup",d(W,L,{handler:function(t){var e=$t[t.type];e&It&&0===t.button&&(this.pressed=!0),e&kt&&1!==t.which&&(e=At),this.pressed&&(e&At&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:Ct,srcEvent:t}))}}),jt={pointerdown:It,pointermove:kt,pointerup:At,pointercancel:Mt,pointerout:Mt},qt={2:Tt,3:xt,4:Ct,5:Pt},Gt="pointerdown",Yt="pointermove pointerup pointercancel",n.MSPointerEvent&&!n.PointerEvent&&(Gt="MSPointerDown",Yt="MSPointerMove MSPointerUp MSPointerCancel"),d($,L,{handler:function(t){var e=this.store,i=!1,o=t.type.toLowerCase().replace("ms",""),n=jt[o],r=qt[t.pointerType]||t.pointerType,s=r==Tt,a=S(e,t.pointerId,"pointerId");n&It&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):n&(At|Mt)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],
pointerType:r,srcEvent:t}),i&&e.splice(a,1))}}),Kt={touchstart:It,touchmove:kt,touchend:At,touchcancel:Mt},Zt="touchstart",Xt="touchstart touchmove touchend touchcancel",d(H,L,{handler:function(t){var e,i=Kt[t.type];i===It&&(this.started=!0),this.started&&(e=U.call(this,t,i),i&(At|Mt)&&e[0].length-e[1].length==0&&(this.started=!1),this.callback(this.manager,i,{pointers:e[0],changedPointers:e[1],pointerType:Tt,srcEvent:t}))}}),Jt={touchstart:It,touchmove:kt,touchend:At,touchcancel:Mt},Qt="touchstart touchmove touchend touchcancel",d(j,L,{handler:function(t){var e=Jt[t.type],i=q.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Tt,srcEvent:t})}}),te=2500,ee=25,d(G,L,{handler:function(t,e,i){var o=i.pointerType==Tt,n=i.pointerType==Ct;if(!(n&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(o)Y.call(this,e,i);else if(n&&Z.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}}),ie=x(we.style,"touchAction"),oe=ie!==a,ne="compute",re="auto",se="manipulation",ae="none",le="pan-x",ce="pan-y",he=Q(),X.prototype={set:function(t){t==ne&&(t=this.compute()),oe&&this.manager.element.style&&he[t]&&(this.manager.element.style[ie]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return h(this.manager.recognizers,function(e){_(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),J(t.join(" "))},preventDefaults:function(t){var e,i,o,n,r,s,l,c=t.srcEvent,h=t.offsetDirection;return this.manager.session.prevented?void c.preventDefault():(e=this.actions,i=y(e,ae)&&!he[ae],o=y(e,ce)&&!he[ce],n=y(e,le)&&!he[le],i&&(r=1===t.pointers.length,s=t.distance<2,l=t.deltaTime<250,r&&s&&l)||n&&o?a:i||o&&h&Rt||n&&h&zt?this.preventSrc(c):a)},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}},ue=1,de=2,pe=4,_e=8,fe=_e,me=16,ge=32,tt.prototype={defaults:{},set:function(t){return ft(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(c(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=ot(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return c(t,"dropRecognizeWith",this)?this:(t=ot(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(c(t,"requireFailure",this))return this;var e=this.requireFail;return t=ot(t,this),-1===S(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(c(t,"dropRequireFailure",this))return this;t=ot(t,this);var e=S(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,o=this.state;o<_e&&e(i.options.event+et(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=_e&&e(i.options.event+et(o))},tryEmit:function(t){if(this.canEmit())return this.emit(t)
;this.state=ge},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(ge|ue)))return!1;t++}return!0},recognize:function(t){var e=ft({},t);if(!_(this.options.enable,[this,e]))return this.reset(),void(this.state=ge);this.state&(fe|me|ge)&&(this.state=ue),this.state=this.process(e),this.state&(de|pe|_e|me)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},d(nt,tt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,o=e&(de|pe),n=this.attrTest(t);return o&&(i&Mt||!n)?e|me:o||n?i&At?e|_e:e&de?e|pe:de:ge}}),d(rt,nt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ft},getTouchAction:function(){var t=this.options.direction,e=[];return t&Rt&&e.push(ce),t&zt&&e.push(le),e},directionTest:function(t){var e=this.options,i=!0,o=t.distance,n=t.direction,r=t.deltaX,s=t.deltaY;return n&e.direction||(e.direction&Rt?(n=0===r?Et:r<0?Vt:Dt,i=r!=this.pX,o=Math.abs(t.deltaX)):(n=0===s?Et:s<0?Ot:Bt,i=s!=this.pY,o=Math.abs(t.deltaY))),t.direction=n,i&&o>e.threshold&&n&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&de||!(this.state&de)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),d(st,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&de)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),d(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[re]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance<e.threshold,n=t.deltaTime>e.time;if(this._input=t,!o||!i||t.eventType&(At|Mt)&&!n)this.reset();else if(t.eventType&It)this.reset(),this._timer=l(function(){this.state=fe,this.tryEmit()},e.time,this);else if(t.eventType&At)return fe;return ge},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===fe&&(t&&t.eventType&At?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=Pe(),this.manager.emit(this.options.event,this._input)))}}),d(lt,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&de)}}),d(ct,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Rt|zt,pointers:1},getTouchAction:function(){return rt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Rt|zt)?e=t.overallVelocity:i&Rt?e=t.overallVelocityX:i&zt&&(e=t.overallVelocityY),
this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&Ce(e)>this.options.velocity&&t.eventType&At},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),d(ht,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[se]},process:function(t){var e,i,o=this.options,n=t.pointers.length===o.pointers,r=t.distance<o.threshold,s=t.deltaTime<o.time;if(this.reset(),t.eventType&It&&0===this.count)return this.failTimeout();if(r&&s&&n){if(t.eventType!=At)return this.failTimeout();if(e=!this.pTime||t.timeStamp-this.pTime<o.interval,i=!this.pCenter||R(this.pCenter,t.center)<o.posThreshold,this.pTime=t.timeStamp,this.pCenter=t.center,i&&e?this.count+=1:this.count=1,this._input=t,0===this.count%o.taps)return this.hasRequireFailures()?(this._timer=l(function(){this.state=fe,this.tryEmit()},o.interval,this),de):fe}return ge},failTimeout:function(){return this._timer=l(function(){this.state=ge},this.options.interval,this),ge},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==fe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ut.VERSION="2.0.7",ut.defaults={domEvents:!1,touchAction:ne,enable:!0,inputTarget:null,inputClass:null,preset:[[lt,{enable:!1}],[st,{enable:!1},["rotate"]],[ct,{direction:Rt}],[rt,{direction:Rt},["swipe"]],[ht],[ht,{event:"doubletap",taps:2},["tap"]],[at]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ve=1,ye=2,dt.prototype={set:function(t){return ft(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?ye:ve},recognize:function(t){var e,i,o,n,r=this.session;if(!r.stopped)for(this.touchAction.preventDefaults(t),i=this.recognizers,o=r.curRecognizer,(!o||o&&o.state&fe)&&(o=r.curRecognizer=null),n=0;n<i.length;)e=i[n],r.stopped===ye||o&&e!=o&&!e.canRecognizeWith(o)?e.reset():e.recognize(t),!o&&e.state&(de|pe|_e)&&(o=r.curRecognizer=e),n++},get:function(t){var e,i;if(t instanceof tt)return t;for(e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(c(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){var e,i;return c(t,"remove",this)?this:(t=this.get(t),t&&(e=this.recognizers,-1!==(i=S(e,t))&&(e.splice(i,1),this.touchAction.update())),this)},on:function(t,e){if(t!==a&&e!==a){var i=this.handlers;return h(b(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this}},off:function(t,e){if(t!==a){var i=this.handlers;return h(b(t),function(t){e?i[t]&&i[t].splice(S(i[t],e),1):delete i[t]}),this}},emit:function(t,e){var i,o
;if(this.options.domEvents&&_t(t,e),(i=this.handlers[t]&&this.handlers[t].slice())&&i.length)for(e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()},o=0;o<i.length;)i[o](e),o++},destroy:function(){this.element&&pt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ft(ut,{INPUT_START:It,INPUT_MOVE:kt,INPUT_END:At,INPUT_CANCEL:Mt,STATE_POSSIBLE:ue,STATE_BEGAN:de,STATE_CHANGED:pe,STATE_ENDED:_e,STATE_RECOGNIZED:fe,STATE_CANCELLED:me,STATE_FAILED:ge,DIRECTION_NONE:Et,DIRECTION_LEFT:Vt,DIRECTION_RIGHT:Dt,DIRECTION_UP:Ot,DIRECTION_DOWN:Bt,DIRECTION_HORIZONTAL:Rt,DIRECTION_VERTICAL:zt,DIRECTION_ALL:Ft,Manager:dt,Input:L,TouchAction:X,TouchInput:j,MouseInput:W,PointerEventInput:$,TouchMouseInput:G,SingleTouchInput:H,Recognizer:tt,AttrRecognizer:nt,Tap:ht,Pan:rt,Swipe:ct,Pinch:st,Rotate:lt,Press:at,on:m,off:g,each:h,merge:gt,extend:mt,assign:ft,inherit:d,bindFn:p,prefixed:x}),be=a!==n?n:"undefined"!=typeof self?self:{},be.Hammer=ut,(o=function(){return ut}.call(e,i,e,t))!==a&&(t.exports=o)}(window,document)},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o;Object.defineProperty(e,"__esModule",{value:!0}),o=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.KeyboardListener=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keydown";i(this,t),this._event=e}return o(t,[{key:"regHandlers",value:function(t){this._handlers=t}},{key:"watchOn",value:function(t){this._listener=this._regListener(),this._watchingEl=t,t.addEventListener(this._event,this._listener)}},{key:"stopWatching",value:function(){this._watchingEl.removeEventListener(this._event,this._listener)}},{key:"_regListener",value:function(){var t=this;return function(e){var i=e.which,o=t._getHandler(i);e.stopPropagation(),o(e)}}},{key:"_getHandler",value:function(t){var e=this._handlers[t],i=function(){},o=function(t){t.preventDefault(),e(t)};return e?o:i}}]),t}()},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={SELECT:"select"};e.events=i},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.AddCompareDialog=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(694),s=i(692),a=i(373),i(631),l=null,e.AddCompareDialog=function(){function t(e){o(this,t),this._chartWidgetCollection=e,this._$symbolSearchPopup=null,this._dialog=null,this._compareTab=new r.CompareTab(this._chartWidgetCollection,this),this._addSymbolTab=new s.AddSymbolTab(this._chartWidgetCollection,this)}
return n(t,[{key:"show",value:function(){var t,e=this,i=[];return i.push({name:$.t("Compare"),page:this._compareTab.$tab.addClass("tv-compare-dialog__tab-page")}),i.push({name:$.t("Add Symbol",{context:"compare_or_add_symbol_dialog"}),page:this._addSymbolTab.$tab.addClass("tv-compare-dialog__tab-page")}),t=(0,a.createTabbedDialog)({tabs:i,width:400,tabStateSaveKey:"CompareAddDialog.tab",destroyOnClose:!0,withScroll:!1,addClass:"tv-compare-dialog",tabsScrollBoxAddClass:"tv-compare-dialog__scroll-box",tabAddClass:"tv-compare-dialog__tab",isClickOutFn:function(t){if(e._compareTab.isClickOnTab(t)||e._addSymbolTab.isClickOnTab(t))return!1}}),l&&l.close(),this._dialog=t.dialog,this._dialog.open(),l=this._dialog,this._dialog}},{key:"getZIndex",value:function(){return this._dialog.zIndex}}]),t}()},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.AddSymbolCheckbox=void 0,a=i(262),l=o(a),e.AddSymbolCheckbox=function(t){function e(t){n(this,e),t.checked=TVSettings.getBool("showAddSymbolDialog.checkboxState",!0);var i=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.$checkbox.change(function(){setTimeout(function(){TVSettings.setValue("showAddSymbolDialog.checkboxState",i.checked)})}),i}return s(e,t),e}(l.default)},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){var i,o,n,r,c,p,_,f,m,g,v,y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(y=$.extend({},{title:$.t("Confirm Inputs"),callback:function(t){}},y),i=null,o=(0,s.createDialog)({title:y.title,contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"></div>',width:u,closeOnClickAtOtherDialogs:!0,destroyOnClose:!0,actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">',isClickOutFn:function(t){var e=i.symbolSearchPopup();if(e)return e[0]!==t.target&&!e[0].contains(t.target)&&void 0},actions:[{name:"apply",type:"primary",text:$.t("Apply"),key:13}]}),d=o,n=(0,l.merge)({},e.defaults.inputs),r=0;r<e.inputs.length;++r)c=e.inputs[r],c.confirm||delete n[c.id];p=new h.default({inputs:n}),_={metaInfo:function(){return e}},f=o.$content,o.open(),i=new a.StudyInputsPropertyPage(p,t.model(),_,!0,o.zIndex),m=i.widget(),f.append(m),Array.prototype.forEach.call(f.find("select"),function(t){var e=$(t),i="tv-select-container dialog"
;e.hasClass("tv-select-container-fontsize")&&(i+=" tv-select-container-fontsize"),e.selectbox({speed:100,classHolder:i})}),$('input[type="text"]',f).addClass("tv-text-input inset dialog"),$("input.ticker",f).TVTicker(),o.on("action:apply",function(){(0,y.callback)(p.state()),o.close()}),g=o.$content.innerWidth()-o.$content.width(),v=m.width()+g,v>u&&o.$el.css("max-width",v),f.find("input,select").first().focus()}function r(){return d}var s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),e.show=n,e.instance=r,s=i(96),a=i(271),l=i(34),c=i(52),h=o(c),i(142),u=450,d=null},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){var i=new Date(t+e),o=Math.round(Math.abs(e)/6e4),n="UTC";return 0!==o&&(n+=e>0?"+":"-",n+=Math.floor(o/60),o%60&&(n+=":"+o%60)),i.getUTCFullYear()+"-"+("0"+(i.getUTCMonth()+1)).slice(-2)+"-"+("0"+i.getUTCDate()).slice(-2)+" "+("0"+i.getUTCHours()).slice(-2)+":"+("0"+i.getUTCMinutes()).slice(-2)+" ("+n+")"}function r(t){return"string"==typeof t&&0!==t.trim().length}function s(t){var e,i,o,n,s;if(!t||0===t.length)return!0;for(e=0;e<t.length;e++){if(r(t[e])||t[e].id||r(t[e].title))return!1;if(t[e].lines)for(i=t[e].lines,o=i.length,n=0;n<o;n++)if(s=i[n],r(s)||r(s.line))return!1}return!0}function a(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.hasOwnProperty("text")?t.hasOwnProperty("color")&&i?e.append($("<span>",{style:"color: "+t.color}).text(t.text)):e.text(t.text):e.text(t)}function l(t,e){if(Array.isArray(t)&&2===t.length)$("<dl>").append(a(t[0],$("<dt>")),a(t[1],$("<dd>"),!0)).appendTo(e);else if(t.hasOwnProperty("br")&&t.br)$("<br>").appendTo(e);else{var i=$("<dl>").append(a(t,$("<dt>"))).appendTo(e);t.hasOwnProperty("listItem")&&i.addClass("list-item")}}function c(t,e){$("<a>").attr("href",t.href).text(t.text).addClass(t.class).appendTo(e)}function h(t,e){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("string"==typeof t)$("<h2>").text(t).appendTo(e);else if(t.hasOwnProperty("lines"))for(i=0;i<t.lines.length;i++)t.lines[i].hasOwnProperty("line")?0===i?t.lines[i].line.isEmpty||$("<h2>").text(t.lines[i].line).appendTo(e):l(t.lines[i].line,e):t.lines[i].hasOwnProperty("link")&&c(t.lines[i].link,e);else t.hasOwnProperty("title")&&$("<h2>").text(t.title).appendTo(e),t.hasOwnProperty("actual")&&$("<dl>").append($("<dt>").text($.t("Actual")+": "),$("<dd>").text(t.actual||"—")).appendTo(e),t.hasOwnProperty("forecast")&&$("<dl>").append($("<dt>").text($.t("Forecast")+": "),$("<dd>").text(t.forecast||"—")).appendTo(e),t.hasOwnProperty("previous")&&$("<dl>").append($("<dt>").text($.t("Previous")+": "),$("<dd>").text(t.previous||"—")).appendTo(e),t.hasOwnProperty("timestamp")&&$("<dl>").append($("<dt>").text($.t("Date")+": "),$("<dd>").text(n(t.timestamp,o)||"—")).appendTo(e)}var u;Object.defineProperty(e,"__esModule",{value:!0}),e.Tooltip=void 0,u=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,
"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(646),e.Tooltip=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.direction,n=void 0===i?"top":i,r=e.clickable,s=void 0!==r&&r,a=e.wide,l=void 0!==a&&a;o(this,t),this._direction=n,this._tooltipShown=!1,this._tooltipX=void 0,this._tooltipY=void 0,this._tooltipItems=null,this._width=l?250:200,this._$tooltip=$("<div>").addClass("tv-chart-events-source__tooltip").css({position:"absolute",width:this._width+"px"}),this._$tooltipContent=$("<div>").addClass("tv-chart-events-source__tooltip__content").appendTo(this._$tooltip),s&&this._$tooltip.addClass("tv-chart-events-source__tooltip--clickable")}return u(t,[{key:"show",value:function(){var t,e,i,o,n,r,a,l,c,u,d,p,_,f,m,g,v,y,b,S=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},w=S.items,T=void 0===w?[]:w,x=S.x,C=void 0===x?0:x,P=S.y,L=void 0===P?0:P,I=S.wrapElement,k=void 0===I?null:I,A=S.timeOffset,M=void 0===A?"":A,E=S.leftBorderColor,V=void 0===E?null:E;if(k&&!s(T)){if(t=$(k).width(),e=$(k).height(),i=!1,o=!1,this._tooltipShown||(this._$tooltip.appendTo(k),this._tooltipShown=!0,i=!0,o=!0),C===this._tooltipX&&L===this._tooltipY||(i=!0),i&&(n=Math.max(Math.min(C-this._width/2,t-this._width-10),0),this._$tooltip.css({left:Math.round(n),bottom:Math.round(e-L+10)})),this._tooltipItems||(o=!0),!o)for(r=T.length;r--;)if(this._tooltipItems[r]!==T[r]){o=!0;break}if(o){if(a=void 0,T.length<=1)a=T;else{for(l={},c=T.length;c--;)u=T[c].importance,null==u&&(u=-1),l[u]||(l[u]=[]),l[u].push(T[c]);if(d=Object.keys(l).sort(function(t,e){return t-e}),d.length<=1)a=l[d[0]];else for(a=[],p=d.length;p--;)for(_=l[d[p]],f=_.length;f--;)a.push(_[f])}for(this._$tooltipContent.empty(),m=a.length;m--;)g=a[m],v="",g.hasOwnProperty("importance")?("string"==typeof g.importance&&("earnings"===g.importance?v="--importance-earnings":"splits"===g.importance?v="--importance-splits":"dividends"===g.importance?v="--importance-dividends":"list"===g.importance&&(v="--importance-list")),0===g.importance?v="--importance-normal":g.importance>0&&(v="--importance-high")):V||(v="--importance-none"),y="tv-chart-events-source__tooltip__item",v&&(y+=" "+y+v),b=$("<div>").attr("class",y),V&&b.css("border-left-color",V),h(g,b,M),b.appendTo(this._$tooltipContent);this._tooltipItems=T}"bottom"===this._direction&&this._$tooltip.css({bottom:Math.round(e-L-this._$tooltipContent.height()+10)})}}},{key:"hide",value:function(){this._tooltipShown&&(this._$tooltip.detach(),this._tooltipShown=!1)}},{key:"isOpened",value:function(){return this._tooltipShown}}]),t}()},function(t,e,i){"use strict";function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),e.DropdownView=void 0,r=function(){function t(t,e){
var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(651),s=i(261),a=i(28),l=o(a),c=i(207),h=i(158),u=o(h),d=e.DropdownView=function(){function t(e){var i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,t),this.$el=e,this.$wrap=o.$wrap||e.find(".tv-dropdown-behavior__button"),this.$body=o.$body||e.find(".tv-dropdown-behavior__body"),this.notCloseWithCtrl=!!o.notCloseWithCtrl&&o.notCloseWithCtrl,this.closeWithEsc=void 0===o.closeWithEsc||o.closeWithEsc,this.animationDisabled=!0===o.noAnimation,this.closeWithEsc&&this.$el.attr("tabIndex",0),this.animationDisabled||this.$body.addClass("tv-dropdown-behavior__body--animated"),(e.data("scroll")||o.scroll)&&(this.$scroll=this.$body.find(".tv-dropdown-behavior__scroll"),this.$inScroll=this.$scroll.find(".tv-dropdown-behavior__inscroll"),this.scroll=new c.SidebarCustomScroll(this.$scroll,this.$inScroll,{showTopShadow:!1,showBottomShadow:!1}),this.$scrollBar=this.scroll.getScrollBar(),this.$scrollBar&&this.$scrollBar.on("mousedown.tv-dropdown-view-scroll",function(){i.offClickOutside(),$(document).on("mouseup.tv-dropdown-view-scroll",function(){i.onClickOutside(),$(document).off("mouseup.tv-dropdown-view-scroll")})})),(e.data("adaptBody")||o.adaptBody)&&(this._adaptBody=!0),this._fitScreen=e.data("fitScreen")||o.fitScreen,this.$wrap.add(e.find(".js-dropdown-toggle")).on("click",function(t){$(t.currentTarget).hasClass("js-prevent-dropdown")||i.toggle()})}return r(t,[{key:"toggle",value:function(){this.opened?this.close(!0):this.open()}},{key:"open",value:function(){var t=this;this.animating||this.opened||this.disabled||(this.$el.trigger("beforeOpenMenu"),this.$body.removeClass("i-hidden"),this.$wrap.addClass("i-dropped"),this.$el.addClass("i-opened"),"horz"===this._fitScreen&&this.fitHorizontally(),this._adaptBody&&this.adaptBody(),this.updateDelays(),this.onClickOutside(),this._doOpenAnimation().then(function(){t.$body.addClass("i-opened"),t.$el.trigger("updateScroll"),t.$el.trigger("afterOpenMenu"),t.opened=!0}),this.closeWithEsc&&this.$el.on("keypress keyup",function(e){e.keyCode===u.ESC&&t.close(!0)}))}},{key:"onClickOutside",value:function(){var t=this;setTimeout(function(){t.$body.on("clickoutside",function(){t.close(!0)})},0)}},{key:"offClickOutside",value:function(){this.$body.off("clickoutside")}},{key:"close",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.animating||!this.opened||this.disabled||!e&&this.notCloseWithCtrl&&(window.event.ctrlKey||window.event.metaKey)||(this.offClickOutside(),this.$wrap.removeClass("i-dropped"),this.$el.trigger("beforeCloseMenu"),this._doCloseAnimation().then(function(){t.$body.removeClass("i-opened").addClass("i-hidden"),t.$el.removeClass("i-opened").trigger("afterCloseMenu"),t.opened=!1}),this.closeWithEsc&&this.$el.off("keypress keyup"))}},{key:"isOpened",value:function(){return this.opened}},{
key:"updateScroll",value:function(){this.scroll&&(this.scroll.updateScrollBar(),this.scroll.scrollToStart())}},{key:"updateDelays",value:function(){var t,e,i,o,n;this.animationDisabled||(t=this.$scroll||this.$body,e=t.offset().top,i=t.outerHeight(),o=this.$body.find(".tv-dropdown-behavior__item").filter(function(t,o){var n=$(o),r=n.offset().top;return r+n.outerHeight()>=e&&r<e+i}),n=this.$el.data("item-coeff")?parseFloat(this.$el.data("item-coeff")):1,o.each(function(t,e){var i=l.easingFunc.easeInQuad(t/o.length)*(.045*l.dur*n*o.length)+.375*l.dur+"ms";$(e).css({"transition-delay":i,"-o-transition-delay":i,"-ms-transition-delay":i,"-moz-transition-delay":i,"-webkit-transition-delay":i})}))}},{key:"enable",value:function(){this.$wrap.removeClass("i-disabled"),this.disabled=!1}},{key:"disable",value:function(){this.$wrap.addClass("i-disabled"),this.disabled=!0}},{key:"adaptBody",value:function(){function t(){a.height("auto")}function e(t){var e="tv-dropdown-behavior__body--from_top",i="tv-dropdown-behavior__body--from_top-right",o="tv-dropdown-behavior__body--from_bottom",n="tv-dropdown-behavior__body--from_bottom-right",r=void 0,s=void 0;a.hasClass(e)&&"bottom"===t?(r=e,s=o):a.hasClass(i)&&"bottom"===t?(r=i,s=n):a.hasClass(o)&&"top"===t?(r=o,s=e):a.hasClass(n)&&"top"===t&&(r=n,s=i),r!==s&&a.removeClass(r).addClass(s)}var i,o,n,r,s=15,a=this.$body,l=this.$wrap.get(0).getBoundingClientRect(),c=window.innerHeight,h=this.$inScroll.outerHeight(!0),u=parseFloat(a.css("padding-top"));h+=u,i=parseFloat(a.css("padding-bottom")),h+=i,o=l.top+h+s<=c,n=h+s<=l.bottom,r=void 0,o?(r=0-u,t(),e("top")):n?(r=-h+i,t(),e("bottom")):(r=-l.top+s,c<=h&&a.height(c-2*s)),a.css("top",r)}},{key:"_doOpenAnimation",value:function(){var t=this;return new Promise(function(e){t.animationDisabled?e():(t.animating=!0,setTimeout(function(){t.animating=!1,e()},20))})}},{key:"_doCloseAnimation",value:function(){var t=this;return new Promise(function(e){t.animationDisabled?e():(t.animating=!0,t.$body.addClass("i-closing"),t.$el.addClass("i-closing"),setTimeout(function(){t.$body.removeClass("i-closing"),t.$el.removeClass("i-closing"),t.animating=!1,e()},l.dur))})}},{key:"fitHorizontally",value:function(){var t,e,i,o;this.$body.css("marginLeft",0),t=document.body.getBoundingClientRect(),e=parseFloat($(document.body).css("paddingRight")),i=this.$body.offset(),i.right=i.left+this.$body.outerWidth(),(o=Math.max(Math.min(0,t.right-e-i.right),t.left-i.left))&&this.$body.css("marginLeft",o)}},{key:"destroy",value:function(){this.scroll&&this.scroll.destroy(),this.offClickOutside(),this.$el.find(".js-dropdown-toggle").off("click"),this.$wrap.off("click")}}]),t}(),$.fn.tvDropdown=(0,s.createTvBlockWithInstance)("tv-dropdown",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new d(t,e)})},function(t,e,i){"use strict";function o(t){return"number"!=typeof t&&(t=TradingView.STUDY_COUNT_LIMIT),(0,n.createNoticeDialog)({title:$.t("Warning"),
content:$.t("Studies limit exceeded: {0} studies per layout.<br>\nPlease, remove some studies.").format(t)})}Object.defineProperty(e,"__esModule",{value:!0}),e.createTooManyStudiesNotice=o;var n=i(203)},function(t,e,i){(function(t){"use strict";function o(e){var i,o,c,h,u,d,p,_,f,m,g;if(e=$.extend({},l,e),i=$(t.render(s,{tabs:e.tabs,customControls:e.customControls,customControlsAddClass:e.customControlsContainerAddClass},{additionalHeaderContent:e.additionalHeaderContent})),o=$(a),c=o,e.contentAddClass&&o.addClass(e.contentAddClass),!1!==e.withScroll&&(o=$('<div class="js-dialog__scroll-wrap tv-dialog__scroll-wrap">').append(c.addClass("tv-dialog__scroll-wrap-inner"))),h=$('<div class="tv-tabbed-dialog">').append(i).append(o),e.customControls&&i.find(".js-custom-controls").append(e.customControls),!0!==e.doNotCreatePages)for(u=0;u<e.tabs.length;++u)c.append($('<div class="tv-tabbed-dialog__tab-page">').append(e.tabs[u].page));return d=e.tabStateSaveKey,p=e.activeTab,_=e.tabsScrollBoxAddClass,f=e.tabAddClass,delete e.tabs,delete e.activeTab,delete e.customControls,delete e.tabStateSaveKey,delete e.customControlsContainerAddClass,delete e.tabsScrollBoxAddClass,delete e.tabAddClass,e.closeButtonAddClass="tv-tabbed-dialog__close",e.contentWrapTemplate=h,m=(0,r.createDialog)(e),g=new n.Tabs(i.find(".tv-tabs").get(0),c.get(0),{addLeftArrowsClass:"tv-tabbed-dialog__tabs-arrow-left",addRightArrowsClass:"tv-tabbed-dialog__tabs-arrow-right",addScrollBoxClass:_,tabClass:f,saveTab:d,activeTab:p}),m.on("afterOpen",function(){g.setActivePage(g.index(),!0,!0)}),{dialog:m,tabs:g}}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.createTabbedDialog=o,n=i(1163),r=i(96),i(653),s='<div class="tv-dialog__section tv-dialog__section--title tv-tabbed-dialog__header js-dialog__drag js-close-button-place"><div class="tv-tabs tv-tabbed-dialog__tabs js-dialog__drag">{{#tabs}}<div class="tv-tabs__tab">{{name}}</div>{{/tabs}}</div>{{#customControls}}<div class="js-custom-controls tv-tabbed-dialog__custom-controls {{#customControlsAddClass}}{{customControlsAddClass}}{{/customControlsAddClass}}"></div>{{/customControls}}<div class="tv-tabbed-dialog__bottom-border"></div></div>{{>additionalHeaderContent}}',a='<div class="tv-tabbed-dialog__pages-container"></div>',l={tabs:[]}}).call(e,i(54))},function(t,e){"use strict";function i(t,e){var i;return function(){clearTimeout(i),i=setTimeout(t.bind.apply(t,[this].concat(Array.prototype.slice.call(arguments))),e)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,t.exports=e.default},,,,,,,,,,,,,,function(t,e,i){"use strict";function o(t,e){this.handler=t,this.customId=e}function n(){}var r=i(34).declareClassAsPureInterface;TradingView.WEB_SOCKET_WAS_CONNECTED=!1,n.REBIND_STUDY_STANDALONE_TO_CHILD=1,n.REBIND_STUDY_CHILD_TO_STANDALONE=2,n.prototype.defaultWatchlistSymbols=function(){},n.prototype.availableTimeFrames=function(t,e){},n.prototype.defaultResolutions=function(){},n.prototype.supportedSymbolsTypes=function(){},n.prototype.supportedExchangesList=function(){},
n.prototype.futuresRegex=function(){},n.prototype.quoteCreateSession=function(t){},n.prototype.quoteDeleteSession=function(t){},n.prototype.quoteSetFields=function(t,e){},n.prototype.quoteAddSymbols=function(t,e){},n.prototype.quoteRemoveSymbols=function(t,e){},n.prototype.quoteFastSymbols=function(t,e){},n.prototype.depthCreateSession=function(t,e,i){},n.prototype.depthDeleteSession=function(t){},n.prototype.depthSetSymbol=function(t,e){},n.prototype.depthClearSymbol=function(t){},n.prototype.depthSetScale=function(t,e){},n.prototype.chartCreateSession=function(t,e){},n.prototype.chartDeleteSession=function(t){},n.prototype.createSession=function(t,e){},n.prototype.removeSession=function(t){},n.prototype.connected=function(){},n.prototype.connect=function(){},n.prototype.disconnect=function(){},n.prototype.switchTimezone=function(t,e){},n.prototype.resolveSymbol=function(t,e,i,o,n){},n.prototype.createSeries=function(t,e,i,o,n,r,s){},n.prototype.removeSeries=function(t,e,i){},n.prototype.modifySeries=function(t,e,i,o,n,r){},n.prototype.requestMoreData=function(t,e,i,o){},n.prototype.requestMetadata=function(t,e,i){},n.prototype.isCanCreateStudy=function(t,e){},n.prototype.createStudy=function(t,e,i,o,n,r,s){},n.prototype.rebindStudy=function(t,e,i,o,n,r,s,a){},n.prototype.removeStudy=function(t,e,i){},n.prototype.modifyStudy=function(t,e,i,o,n){},n.prototype.createPointset=function(t,e,i,o,n,r,s){},n.prototype.modifyPointset=function(t,e,i,o,n){},n.prototype.removePointset=function(t,e,i){},n.prototype.requestMoreTickmarks=function(t,e,i,o){},n.prototype.requestFirstBarTime=function(t,e,i,o){},n.prototype._invokeHandler=function(t,e){},n.prototype._sendRequest=function(t,e){},n.prototype._onMessage=function(t){},n.prototype._convertTimescaleResponse=function(t){},n.prototype._dispathNotification=function(t){},n.prototype._invokeNotificationHandler=function(t,e,i){},n.prototype._notifySessions=function(t){},n.prototype.unpack=function(t){},n.prototype.searchSymbols=function(t,e,i,o,n,r,s,a,l){},n.prototype.serverTimeOffset=function(){},n.prototype.getMarks=function(t,e,i,o,n){},n.prototype.getTimescaleMarks=function(t,e,i,o,n){},r(n,"ChartApiInterface"),t.exports.HandlerInfo=o,t.exports.ChartApiInterface=n},function(t,e,i){"use strict";var o=i(43),n=i(34).parseJSONorNot,r=i(13).getLogger("Chart.SaveloadAdapter.Library"),s=function(){var t,e,i,s,a={},l=null;return a.setCustomAdapter=function(t){l=t,r.logNormal("Use custom save-load adapter")},a.initialize=function(o,n,r,a){t=o,e=n,i=r,s=a},a.updateUser=function(t){e=t},a.getCharts=function(o,a){function c(t){t=t.map(function(t){return{id:t.id,name:t.name,image_url:t.id,modified_iso:t.timestamp,short_symbol:t.symbol,interval:t.resolution}}),o(t)}return l?void l.getAllCharts().then(c).catch(a):$.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"GET",crossDomain:!0}).done(function(t){var e=n(t);if("ok"!==e.status)return r.logWarn("Charts list request failed: "+e.message),void a();c(e.data)
}).fail(a)},a.removeChart=function(o,a){if(l)return void l.removeChart(o).then(a);$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"DELETE",crossDomain:!0}).done(function(t){var e=n(t);"ok"!==e.status&&r.logWarn("Chart delete request failed: "+e.message),a()})},a.saveChart=function(o,a,c,h,u,d,p){var _,f=u.id.value(),m={name:o,content:JSON.stringify(h),symbol:a,resolution:c};if(l)return m.id=f,void l.saveChart(m).then(d).catch(p);_="{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),void 0!==f&&(_+="&chart="+encodeURIComponent(f)),$.ajax({url:_,data:m,type:"POST",crossDomain:!0}).done(function(t){var e=n(t);if("ok"!==e.status)return r.logWarn("Chart save request failed: "+e.message),void p();d(e.id)}).fail(function(){p()})},a.getChartContent=function(o,a,c){function h(t){var e=JSON.parse(t);return e.uid=o.id,e}if(l)return void l.getChartContent(o.id).then(function(t){var e=h(t);a(e)}).catch(c);$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o.id)),type:"GET",crossDomain:!0}).done(function(t){var e,i=n(t);if("ok"!==i.status)return void r.logWarn("Chart load request failed: "+i.message);e=h(i.data.content),a(e)}).fail(function(){c&&c()})},a.loadChart=function(t){a.getChartContent(t,function(t){o.emit("chart_load_requested",t)},function(){r.logWarn("Error loading chart")})},a.removeStudyTemplate=function(o,a){if(l)return void l.removeStudyTemplate({name:o}).then(a);$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"DELETE",crossDomain:!0}).done(function(t){var e=n(t);"ok"!==e.status&&r.logWarn("Chart delete request failed: "+e.message),a()})},a.getStudyTemplateContent=function(o,r){if(l)return void l.getStudyTemplateContent({name:o}).then(function(t){r({content:t})});$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"GET",crossDomain:!0}).done(function(t){r(n(t).data)})},a.saveStudyTemplate=function(o,a){var c={name:o.name,content:o.content};if(l)return void l.saveStudyTemplate(c).then(a.bind(null,{error:""})).catch(function(t){a({error:null!=t?""+t:"error"})});$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"POST",crossDomain:!0,data:c}).done(function(t){var e=n(t);"ok"!==e.status&&r.logWarn("Template save request failed: "+e.message),a({error:"ok"===e.status?"":e.status})})},a._templatesCache=null,a.getStudyTemplatesList=function(o){function c(t){t=t.map(function(t){return{is_default:!1,name:t.name}}),a._templatesCache=t,o(t)}return a._templatesCache?void o(a._templatesCache):(a._templatesCache=[],
l?void l.getAllStudyTemplates().then(c):void $.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"GET",crossDomain:!0}).done(function(t){if(null!==a._templatesCache){var e=n(t);if("ok"!==e.status)return void r.logWarn("Templates list request failed: "+e.message);c(e.data)}}))},a.invalidateStudyTemplatesList=function(){a._templatesCache=null},a}();t.exports=s},function(t,e,i){(function(e){"use strict";var o=i(82),n=i(57).Interval,r=i(20),s=i(7),a=function(t,e){this._server=t,this._session=e,this._timezone=null,this._timezoneId="",this._isDWM=!1,this._resolution=null,this.seriesCompleted=new r,this._lastBarTimes={}};a.prototype.lastBarTime=function(t){return this._lastBarTimes[t]},a.prototype._userTimezone=function(){return this._timezone},a.prototype.setTimezone=function(t){this._timezone="exchange"===t?"exchange":e.get_timezone(t),this._timezoneId=t},a.prototype.timezone=function(){return this._timezoneId},a.prototype.setResolution=function(t){this._isDWM=n.isDWM(t),this._resolution=t},a.prototype.onRequestMetadata=function(t,e){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,t,e]})},a.prototype.onSymbolResolved=function(t,e){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,t,e]})},a.prototype.onSymbolError=function(t,e){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,t,e]})},a.prototype.onStudyError=function(t,e){this._server.receiveLocalResponse({method:"study_error",params:[this._session,t,e]})},a.prototype.onSeriesLoading=function(t,e){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,t,e]})},a.prototype.onSeriesCompleted=function(t,e,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,t,i,e]}),this.seriesCompleted.fire(t)},a.prototype.onSeriesError=function(t,e){this._server.receiveLocalResponse({method:"series_error",params:[this._session,t,e]})},a.prototype.onSeriesClearData=function(t,e){var i={};i[t]={series:[],turnaround:e},this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,i,{index:0,zoffset:0,changes:[],marks:[],index_diff:[]}]})},a.prototype.onStudyCompleted=function(t,e){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,t,e]})},a.prototype.onStudyLoading=function(t,e){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,t,e]})},a.prototype._calcMarksTime=function(t,i,n,r,a){var l,c,h,u,d,p=e.get_timezone(i),_=this;if(this._isDWM&&!s.enabled("disable_resolution_rebuild"))for(d=new o.Session,d.init(p,n),u=0;u<t.length;u++)h=t[u],l=r(h),c=e.utc_to_cal(p,1e3*l),c=d.spec.correctTradingDay(c,p),e.set_hms(c,0,0,0,0),t[u]=a(h,parseInt(c.valueOf()/1e3));else for(u=0;u<t.length;u++)t[u]=a(t[u],_.timeInTimezone(r(t[u]),p))},a.prototype.onTickmarksUpdated=function(t,e,i,o){var r,s,a,l,c,h,u;if(n.isEqual(o,this._resolution)){for(r=e.slice(0),
this._calcMarksTime(r,i.timezone,i.session,function(t){return t},function(t,e){return e}),s=[],a=[],c=0;c<r.length;++c)h=r[c],s.push([this._spanByTime(h,l),h,t+c]),a.push(h),l=h;u={method:"tickmark_update",params:[this._session,{index:t,zoffset:0,changes:a,marks:s,index_diff:[]}]},this._server.receiveLocalResponse(u)}},a.prototype.onTimescaleUpdate=function(t,e,i,o,n,r){var s,a,l,c,h,u,d,p,_=r&&r.slice(0);for(this._lastBarTimes[t]=_?_&&_[_.length-1]:i&&i[i.length-1].value[0],this._calcMarksTime(i,o.timezone,o.session,function(t){return t.value[0]},function(t,e){return t.exTime=e,t}),_&&this._calcMarksTime(_,o.timezone,o.session,function(t){return t},function(t,e){return{markTime:e,time:t}}),s={},s[t]={series:i,turnaround:e},a=[],l=[],h=i.map(function(t){return{markTime:t.exTime,time:t.value[0]}}),_&&(h=h.concat(_)),u=0;u<h.length;++u)d=h[u].markTime,a.push([this._spanByTime(d,c),d,n+u]),l.push(h[u].time),c=d;p={method:"timescale_update",params:[this._session,s,{index:n,zoffset:0,changes:l,marks:a,index_diff:[]}]},this._server.receiveLocalResponse(p)},a.prototype.onSeriesTimeframeUpdate=function(t,e,i,o,n){var r={method:"series_timeframe",params:[this._session,t,e,i,o,n]};this._server.receiveLocalResponse(r)},a.prototype.onPointsetDataUpdate=function(t,e,i,o){this._onDataUpdate(t,e,i,null,o,1)},a.prototype.onDataUpdate=function(t,e,i,o,n){this._onDataUpdate(t,e,i,o,n,0)},a.prototype._onDataUpdate=function(t,e,i,o,n,r){var s,a={},l="",c=[];null!==o&&(l=JSON.stringify(o.data),c=o.indexes||[]),a[t]={s:i,ns:{d:l,indexes:c},turnaround:e},s={method:"data_update",params:[this._session,a]},this._server.receiveLocalResponse(s)},a.prototype.onQuotesData=function(t){this._server.receiveLocalResponse({method:"quote_symbol_data",params:t})},a.prototype.onDepthData=function(t){this._server.receiveLocalResponse({method:"dd",params:t})},a.prototype.onDepthUpdate=function(t){this._server.receiveLocalResponse({method:"dpu",params:t})},a.prototype.onProjectionUpdate=function(t,e,i,o){var n,r=i.data,s=r[r.length-1],a={data:{reversalAmount:i.reversalAmount,boxSize:i.boxSize,price:s?s[4]:i.price,bars:r.map(function(t,e){return{time:e,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],factor:t[6],additionalPrice:t[6]}})}},l={};l[t]={s:o||[],ns:{d:JSON.stringify(a),indexes:r.map(function(t,e){return i.barsetSize+(t[0]||0)})},turnaround:e},n={method:"data_update",params:[this._session,l]},this._server.receiveLocalResponse(n)},a.prototype.timeInTimezone=function(t,i){return"exchange"===this._userTimezone()?parseInt(e.utc_to_cal(i,1e3*t).valueOf()/1e3):parseInt(e.utc_to_cal(this._userTimezone(),1e3*t).valueOf()/1e3)},a.prototype._spanByTime=function(t,e){function i(t){return 60*t*60*1e3}function o(t){return 60*t*1e3}function n(t){return 1e3*t}var r,s,a,l=[{divisor:1,span:20},{divisor:n(1),span:19},{divisor:o(5),span:21},{divisor:o(30),span:22},{divisor:i(1),span:30},{divisor:i(3),span:31},{divisor:i(6),span:32},{divisor:i(12),span:33}];if(!e)return 20;if(r=new Date(1e3*e),s=new Date(1e3*t),s.getYear()!==r.getYear())return 70
;if(s.getUTCMonth()!==r.getUTCMonth())return 60;if(s.getUTCDate()!==r.getUTCDate())return 50;for(a=l.length-1;a>=0;--a)if(Math.floor(r/l[a].divisor)!==Math.floor(s/l[a].divisor))return l[a].span},TradingView.ChartapiMessagerInstances=[],t.exports=a}).call(e,i(67))},function(t,e,i){"use strict";function o(t,e){this._chartApi=t,this.generateSessionId(),this._sessionDisabled=!1,this._disableStatistics=!!e}var n=i(64);i(13).getLogger("ChartSession");o.prototype.destroy=function(){this._sessionDisabled||this.stopSession()},o.prototype.generateSessionId=function(){this._sessionid="cs_"+n.randomHash()},o.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},o.prototype.connected=function(){return this._chartApi.connected()&&!this._sessionDisabled},o.prototype.disconnected=function(){var t=this;this.restartSession(),Object.keys(this).forEach(function(e){/^(s|st|symbol_)\d+$/.test(e)&&delete t[e]})},o.prototype.initSession=function(){return this._chartApi.createSession(this._sessionid,this)},o.prototype.stopSession=function(){return this._chartApi.chartDeleteSession(this._sessionid),this._chartApi.removeSession(this._sessionid)},o.prototype.restartSession=function(){this.stopSession(),this.generateSessionId(),this.initSession()},o.prototype.setHandler=function(t){this._globalHandler=t},o.prototype.sessionId=function(){return this._sessionid},o.prototype.connect=function(t){return this._globalHandler=t,this.initSession(),this._chartApi.connect()},o.prototype.disconnect=function(){return this._chartApi.disconnect()},o.prototype.switchTimezone=function(t){return this._chartApi.switchTimezone(this._sessionid,t)},o.prototype.resolveSymbol=function(t,e,i){return this._chartApi.resolveSymbol(this._sessionid,t,e,i)},o.prototype.createSeries=function(t,e,i,o,n,r){return this._chartApi.createSeries(this._sessionid,t,e,i,o,n,r)},o.prototype.removeSeries=function(t,e){return this._chartApi.removeSeries(this._sessionid,t,e)},o.prototype.modifySeries=function(t,e,i,o,n){return this._chartApi.modifySeries(this._sessionid,t,e,i,o,n)},o.prototype.requestMoreData=function(t,e,i){return this._chartApi.requestMoreData(this._sessionid,t,e,i)},o.prototype.requestMetadata=function(t,e){this._chartApi.requestMetadata(this._sessionid,t,e)},o.prototype.isCanCreateStudy=function(t,e){return this._chartApi.isCanCreateStudy(t,e)},o.prototype.createStudy=function(t,e,i,o,n,r,s){return this._chartApi.createStudy(this._sessionid,t,e,i,o,n,r,s)},o.prototype.rebindStudy=function(t,e,i,o,n,r,s){return this._chartApi.rebindStudy(this._sessionid,t,e,i,o,n,r,s)},o.prototype.removeStudy=function(t,e,i){return this._chartApi.removeStudy(this._sessionid,t,e,i)},o.prototype.modifyStudy=function(t,e,i,o){return this._chartApi.modifyStudy(this._sessionid,t,e,i,o)},o.prototype.createPointset=function(t,e,i,o,n,r){return this._chartApi.createPointset(this._sessionid,t,e,i,o,n,r)},o.prototype.modifyPointset=function(t,e,i,o){return this._chartApi.modifyPointset(this._sessionid,t,e,i,o)},o.prototype.removePointset=function(t,e){
return this._chartApi.removePointset(this._sessionid,t,e)},o.prototype.requestMoreTickmarks=function(t,e,i){return this._chartApi.requestMoreTickmarks(this._sessionid,t,e,i)},o.prototype.requestFirstBarTime=function(t,e,i){return this._chartApi.requestFirstBarTime(this._sessionid,t,e,i)},o.prototype.setVisibleTimeRange=function(t,e,i,o){return this._chartApi.setVisibleTimeRange(t,this._sessionid,e,i,o)},o.prototype.onMessage=function(t){switch(t.method){case"connected":this._chartApi.chartCreateSession(this._sessionid,this._disableStatistics);break;case"disconnected":this.disconnected()}this._globalHandler&&this._globalHandler(t)},o.prototype.disable=function(){this._sessionDisabled=!0},o.prototype.chartApi=function(){return this._chartApi},t.exports=o},,function(t,e,i){(function(e){"use strict";var o=i(226).futuresRoots,n=function(){function t(t,e){var i=function(){};return i.prototype=e.prototype,t.prototype=new i,t}function i(t){return t.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&")}function n(){}function r(t){this.value=t}function s(){}function a(){}function l(){}function c(){}function h(){}function u(){}function d(){}function p(){}function _(t){this.value=t}function f(t){this.value=t}function m(t){this.value=t}function g(){_.apply(this,arguments)}function v(){f.apply(this,arguments)}function y(t,e){var i,o,n,s,a,l,c,h,u=[];t:for(;i=W.exec(t);){for(o=$.length;o--;)if(i[o+1]){$[o].ctor&&(n=new $[o].ctor(i[o+1]),n._offset=i.index,u.push(n));continue t}s=new m(i[0]),s._offset=i.index,u.push(s)}if(e&&e.recover)for(o=u.length;o--;)l=u[o],l instanceof f||l instanceof _?(void 0!==a&&(c=new _(""),h=u.splice(o,a-o+1,c),c.value=h.map(function(t){return t.value}).join("")),a=o):l instanceof r||(a=void 0);return u}function b(t){var i,o,n,c,h,u,d,p,g,v;if(e.enabled("charting_library_base"))return{currentState:"var"};for(i="init",o="var",n="operator",c=i,h={warnings:[],errors:[],isEmpty:!0},u=[],d=0;d<t.length;d++)if(!((p=t[d])instanceof r))if(delete h.isEmpty,p.isIncomplete&&(g={status:"incomplete",reason:"incomplete_token",offset:p._offset,token:p},p.incompleteSuggest&&(g.recover={append:p.incompleteSuggest()}),h.warnings.push(g),d!==t.length-1))g.status="error";else if(p instanceof _||p instanceof f){if(c===o){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=o}else if(p instanceof l){if(c!==o){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=n}else if(p instanceof s){if(c===o){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}u.push(p),c=i}else if(p instanceof a){if(c!==o){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}v=u.pop(),v||h.errors.push({status:"error",reason:"unbalanced_brace",offset:p._offset,token:p,recover:{prepend:new s}}),c=o}else p instanceof m&&h.errors.push({status:"error",reason:"unparsed_entity",offset:p._offset,token:p});for(h.braceBalance=u.length,c!==o&&h.warnings.push({status:"incomplete"}),v=null;u.length;)p=u.pop(),g={
status:"incomplete",reason:"unbalanced_brace",offset:p._offset,token:p},c===o&&(g.recover={append:new a}),h.warnings.push(g);return h.currentState=c,0===h.warnings.length&&delete h.warnings,0===h.errors.length&&delete h.errors,h}function S(t){var e,i=[];for(e=0;e<t.length;e++)t[e]instanceof r||i.push(t[e]);return i}function w(t){var e,i,o,n,r,c,h;for(t=S(t),e=[],i=[],n=0;n<t.length;n++)r=t[n],r instanceof l?i.length&&i[i.length-1].minPrecedence>r.precedence&&(i[i.length-1].minPrecedence=r.precedence):r instanceof s?i.push(o={minPrecedence:1/0,openBraceIndex:n}):r instanceof a&&(o=i.pop(),c=t[o.openBraceIndex-1],(h=t[n+1])instanceof l&&!(h.precedence<=o.minPrecedence)||!(!(c instanceof l)||c.precedence<o.minPrecedence||c.precedence===o.minPrecedence&&c.commutative)||(e.unshift(o.openBraceIndex),e.push(n),i.length&&i[i.length-1].minPrecedence>o.minPrecedence&&(i[i.length-1].minPrecedence=o.minPrecedence)));for(n=e.length;n--;)t.splice(e[n],1);return t}function T(t){for(var e=0;e<t.length;e++)t[e].parse&&t[e].parse();return t}function x(t){var e=C(t);return w(e?e:[new f("1"),new d,new s].concat(t).concat(new a))}function C(t){var e,i,o,n=0,c=1,h=2,u=3,p=n,_=0;for(i=0;i<t.length;i++)if(!((o=t[i])instanceof r))switch(p){case n:if(!(o instanceof f&&1==+o.value))return!1;p=c;break;case c:if(!(p===c&&o instanceof d))return!1;p=h,e=i+1;break;case h:if(o instanceof s)p=u,_=1;else if(o instanceof l)return!1;break;case u:o instanceof s?_++:o instanceof a&&--_<=0&&(p=h)}return t.slice(e)}function P(t){return new _(t).ticker()}function L(t){if("string"!=typeof t)throw new TypeError("expression must be a string");return t=y(t),t.filter(function(t){return t instanceof _}).map(function(t){return t.exchange()}).filter(function(t){return t})}function I(t){return t=L(t),1!==t.length?null:t[0]}function k(t,e){return t=L(t),t.some(function(t){return!!~e.indexOf((t||"").toUpperCase())})}function A(t){return k(t,["BATS"])}function M(t){return(t=I(t))&&-1!==t.toUpperCase().indexOf("_EOD")}function E(t){return k(t,["CHXEUR"])}function V(t){return k(t,["CHXJPY"])}function D(t){return k(t,pro.getProductsByType(pro.PRODUCT_TYPES.exchange).map(function(t){return t.exchange.toUpperCase()+"_DLY"}))}function O(t,e){return!!(t=I(t))&&t.substr(0,e.length)===e}function B(t){if("string"!=typeof t)throw new TypeError("expression must be a string");var e=w(S(y(t)));return e.forEach(function(t){t instanceof _&&t.exchange(null)}),z(e)}function R(t){if("string"!=typeof t)throw new TypeError("expression must be a string");return z(w(S(y(t))))}function z(t){return t.join("")}var F,N,W,$=[{pattern:"(",ctor:s},{pattern:")",ctor:a},{pattern:"+",ctor:c},{pattern:"-",ctor:h},{pattern:"*",ctor:u},{pattern:"/",ctor:d},{pattern:"^",ctor:p},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:f},{pattern:/\./,ctor:v},{pattern:e.enabled("charting_library_base")?/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:\.&]*|'.+?'/:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:\.&]*|'.+?'/,ctor:_
},{pattern:/'[^']*/,ctor:g},{pattern:/[\0-\x20\s]+/,ctor:r}];return n.prototype.toString=function(){return this.value},t(r,n),t(s,n),s.prototype.value="(",t(a,n),a.prototype.value=")",t(l,n),t(c,l),c.prototype.value="+",c.prototype.precedence=0,c.prototype.commutative=!0,t(h,l),h.prototype.value="-",h.prototype.precedence=0,h.prototype.commutative=!1,t(u,l),u.prototype.value="*",u.prototype.precedence=1,u.prototype.commutative=!0,t(d,l),d.prototype.value="/",d.prototype.precedence=1,d.prototype.commutative=!1,t(p,l),p.prototype.value="^",p.prototype.precedence=2,p.prototype.commutative=!1,F=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,N=/[\+\-\/\*]/,t(_,n),_.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var t=N.test(this._ticker)?"'":"";return t+(this._exchange?this._exchange+":":"")+this._ticker+t}return this.value},_.prototype.parse=function(){var t=F.exec(this.value);t[1]&&(this._exchange=t[1]),this._ticker=t[2]},_.prototype.parseAsFutures=function(){var t,e,i;if(o)for(this.hasOwnProperty("_ticker")||this.parse(),t=function(t){return o.some(function(e){return e.t===t})},e=2;e>=1;--e)if(i=this._ticker.slice(0,e),t(i)){this._root=i,this._contract=this._ticker.slice(e);break}},_.prototype.exchange=function(t){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null===t||void 0===t?delete this._exchange:this._exchange=t+""},_.prototype.ticker=function(t){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null===t||void 0===t?delete this._ticker:this._ticker=t+"",delete this._root,delete this._contract},_.prototype.root=function(t){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===t||void 0===t?delete this._root:(this._root=t+"",this._root&&(this._ticker=this._root+(this._contract||"")))},_.prototype.contract=function(t){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===t||void 0===t?delete this._contract:(this._contract=t+"",this._root&&(this._ticker=this._root+this._contract))},t(f,n),f.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},f.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},m.prototype.toString=function(){return this.value},t(g,_),g.prototype.isIncomplete=!0,g.prototype.incompleteSuggest=function(){if("'"!==this.value)return"'"},t(v,f),v.prototype.isIncomplete=!0,W=RegExp($.map(function(t){return"("+("string"==typeof t.pattern?i(t.pattern):t.pattern.source)+")"}).concat(".").join("|"),"g"),{tokenize:y,validate:b,factorOutBraces:w,normalizeTokens:T,flip:x,hasBatsSymbols:A,hasEodSymbols:M,hasChxeurSymbols:E,hasChxjpySymbols:V,hasFreeDelaySymbols:D,getExchange:I,isExchange:O,SymbolToken:_,IncompleteSymbolToken:g,NumberToken:f,BinaryOperatorToken:l,OpenBraceToken:s,CloseBraceToken:a,ticker:P,shortName:B,normalize:R}}();t.exports=n}).call(e,i(7))},function(t,e){
"use strict";t.exports={INSERT_AT_END:0,INSERT_AT_START:1,INSERT_AT_POS:2,WRAPPER_TAG:"div",WRAPPER_ATTRIBUTES:{class:"context-menu-wrapper"},MENU_TAG:"table",ITEM_ROW_TAG:"tr",ICON_CELL_TAG:"td",TEXT_CELL_TAG:"td",RIGHT_CELL_TAG:"td",SUBMENU_CELL_TAG:"td"}},function(t,e,i){"use strict";function o(t){var e,i=[],n=t.m_items;for(e=0;e<n.length;e++)n[e]._menu&&(i.push(n[e]._menu),i=i.concat(o(n[e]._menu)));return i}function n(t,e,i){var o,n;this.options={},this._parentMenuItem=i,$.extend(this.options,e),this.options.class&&(this.options.attributes.class=this.options.class),this.jqMenu=null,this.m_wrapper=null,this.m_items=[];for(o in t)n=t[o],this.addItem(n)}var r=i(394),s=i(73).ActionPlaceholder,a=i(751),l=a.Item,c=a.ItemPlaceholder,h=i(205),u=i(206);n.prototype.addItem=function(t){var e;return e=t instanceof s?new c(t,this):new l(t,this),this.m_items.push(e),e},n.renderItem=function(t,e){t.append(e.render(t))},n.prototype.closeOtherSubmenus=function(t){for(var e=0;e<this.m_items.length;++e)this.m_items[e].highlight(!1),this.m_items[e]._menu&&(this.m_items[e]._menu.destroy(),this.m_items[e]._menu=null)},n.prototype.isShown=function(){return null!==this.jqMenu},n.prototype.render=function(){var t,e,i,o=this.getAttributes();if(this._parentMenuItem){t=$("<table>"),this.jqMenu=t,t.attr("cellspacing","0"),t.attr("cellpadding","0"),t.addClass("context-menu"),t.addClass("submenu");for(e in this.m_items)i=this.m_items[e],n.renderItem(t,i)}else{t=u.create(r.MENU_TAG,o),this.jqMenu=t;for(e in this.m_items)i=this.m_items[e],n.renderItem(t,i)}return this.jqMenu},n.prototype.getAttributes=function(){var t={},e=["context-menu"];return this.options.attributes&&this.options.attributes.class&&e.push(this.options.attributes.class),t.cellspacing=0,t.cellpadding=0,t.class=e.join(),t},n.prototype.deploy=function(t,e){var i=this.wrapper();return this.jqMenu=i.append(this.render()),e?($(e).data("submenu",this.jqMenu),$(document.body).append(this.jqMenu),this.jqMenu.data("parent-menu",e),this.jqMenu.data("parent-item",t.currentTarget)):$(document.body).append(this.jqMenu),h.unbindContextMenu(this.jqMenu),this._setCoords(t),this.jqMenu},n.prototype.show=function(t,e){this.deploy(t,e).show()},n.prototype.hide=function(){this.isShown()&&this.destroy()},n.prototype.destroy=function(){$.each(this.m_items,function(t,e){e._menu&&e._menu.destroy()}),this.jqMenu&&(this.jqMenu.remove(),this.jqMenu=null),this.m_wrapper.empty()},n.prototype._setCoords=function(t){var e,i,o,n,r,s=5,a=this.jqMenu,l=$(this.jqMenu.data("parent-item")),c={width:$(window).width(),height:Math.min($(window).height(),$("body").height())},h={top:$(document).scrollTop(),left:$(document).scrollLeft()};for(this.jqMenu.css({maxWidth:c.width-2*s,maxHeight:c.height-2*s}),e={width:a.outerWidth(),height:a.outerHeight()},l.size()?(o=l.offset(),i={top:o.top-1,left:o.left+l.outerWidth()}):i={top:t.pageY,left:t.pageX},this.jqMenu.offset(i),n={},n.top=Math.min(i.top,c.height+h.top-e.height-s),i.left+e.width+s>c.width||this.options.reverse?n.left=i.left+h.left-e.width:n.left=i.left,
r=t.target;r&&r!==document;r=r.parentNode)if("fixed"===$(r).css("position")){this.jqMenu.css("position","fixed");break}this.jqMenu.offset(n)},n.prototype._wrapper=function(){var t=this,e=r.WRAPPER_ATTRIBUTES;return this._parentMenuItem?this.m_wrapper=u.create(r.WRAPPER_TAG,e):(this.m_wrapper=h.createPopup(e,void 0,{mouseDownOutsideEvent:function(e){var i=$();$.each(o(t),function(){i=i.add(this.m_wrapper)}),$(e.target).parents().andSelf().is(i)||t.hide()}}),this.m_wrapper.addClass("topmenu")),this.m_wrapper},n.prototype.wrapper=function(t){return this.m_wrapper||this._wrapper()},t.exports=n},,function(t,e,i){"use strict";var o=i(71);t.exports[o.STYLE_AREA]=i(1190),t.exports[o.STYLE_BARS]=i(1192),t.exports[o.STYLE_CANDLES]=i(1199),t.exports[o.STYLE_HEIKEN_ASHI]=i(1210),t.exports[o.STYLE_HOLLOW_CANDLES]=i(1212),t.exports[o.STYLE_LINE]=i(1230),t.exports[o.STYLE_BASELINE]=i(1200)},function(t,e,i){(function(e,o){"use strict";function n(t){var n=i(754);this._options=$.extend({interval:1},t||{}),this._e=$("<div>").addClass("intervals-container favored-list-container"),this._quick=$("<div>").addClass("quick").appendTo(this._e),this._quicked={},this._main=$('<span class="apply-common-tooltip">').text(this.shortLabel(this._options.interval)).attr("title",this.fullLabel(this._options.interval)).appendTo(this._quick),this._main.data("interval",this._options.interval),e.enabled("header_interval_dialog_button")&&this._setIntervalDialogButton(),this._mainSub=$("<span>").addClass("submenu").attr("title",$.t("Time Interval")).append($('<div class="tv-caret"></div>')).appendTo(this._e),t&&"string"==typeof t.submenuBtnAddClass&&this._mainSub.addClass(t.submenuBtnAddClass),this._quick.on("click",this._selectInterval.bind(this)),this._mainSub.on("click",this._selectMenu.bind(this)),this._menu=new n(this,this._mainSub,this._options),this.onResize=new o,s.intraday.subscribe(this._fullUpdate.bind(this)),s.supportedResolutions.subscribe(this._fullUpdate.bind(this)),t.interval&&s.interval.setValue(t.interval),s.interval.subscribe(this.activateInterval.bind(this),{callWithLast:!0}),l.on("intervalwidget-change",this._onChangeInAnotherTab.bind(this)),this._fullUpdate()}var r=i(57).Interval,s=i(97),a=i(178).translatedIntervalString,l=i(181).TVXWindowEvents;n.prototype.forceUpdate=function(){this._fullUpdate(!0)},n.prototype._fullUpdate=function(t){this._setupIntervals(t),this._setupQuicks(t),this.reactivateInterval(),this._resize()},n.prototype._onChangeInAnotherTab=function(){this._fullUpdate(!0)},n.prototype.isDefaultInterval=function(t){return t in ChartApiInstance.defaultResolutions()},n.getIntervals=function(){return TradingView.clone(ChartApiInstance.defaultResolutions())},n.prototype._setupIntervals=function(){this._intervals=n.getIntervals()},n.sortIntervals=function(t){Array.isArray(t)||(t=Object.keys(t));var e=function(t){var e=new r(t);return e.kind()!==r.MINUTES?{S:1/60,D:1440,W:10080,M:43200}[e.letter()]*e.multiplier():e.multiplier()};return t.sort(function(t,i){return e(t)-e(i)})},n.prototype.getSortedIntervals=function(){
return n.sortIntervals(this._intervals)},n.prototype.setUpStarredItemsList=function(t){var e,i={};for(e=0;e<t.length;++e)i[t[e]]=!0;this._setupQuicks(!1,i)},n.prototype._setupQuicks=function(t,i){this._options.notShowQuicks&&!i||(i=i||{},e.enabled("star_some_intervals_by_default")&&(i={1:!0,30:!0,60:!0}),this._quicked=TVSettings.getJSON("IntervalWidget.quicks",i,t),this._quicked=this._removeCustomIntervalQuicks(this._quicked)),this._addQuicked(this._quicked)},n.prototype._removeCustomIntervalQuicks=function(t){var e={};return Object.keys(t).forEach(function(i){this.isDefaultInterval(i)&&(e[i]=t[i])},this),e},n.prototype.element=function(){return this._e},n.prototype.mainButton=function(){return this._main},n.prototype._quicks=function(){return this._quick.find("span").slice(0,-1)},n.prototype.postfix=function(t,e){if(e){var i=" ";switch(t){case"D":i+=$.t("day",{plural:"days",count:e});break;case"W":i+=$.t("week",{plural:"weeks",count:e});break;case"M":i+=$.t("month",{plural:"months",count:e});break;case"S":i+=$.t("second",{plural:"seconds",count:e});break;case"m":i+=$.t("minute",{plural:"minutes",count:e});break;case"h":i+=$.t("hour",{plural:"hours",count:e})}return i}switch(t){case"m":return"";case"h":return $.t("h",{context:"interval_short"});case"D":return $.t("D",{context:"interval_short"});case"W":return $.t("W",{context:"interval_short"});case"M":return $.t("M",{context:"interval_short"});default:return t.toUpperCase()}},n.prototype.readable=function(t,e,i){function o(t){return t>=60&&!(t%60)}var n,s;if(t=t,n="m",e=e,s=new r(t),!s.isValid())throw new TypeError("Wrong interval value: "+t);return s.kind()!==r.MINUTES&&(n=s.letter()),t=s.multiplier(),s.kind()===r.MINUTES&&o(t)&&(t=~~(t/60),n="h"),e=e?t:null,""+(t=i&&1===t&&s.isDWM()?"":t)+this.postfix(n,e)},n.prototype.shortLabel=function(t){return a(this.readable(t,!1))},n.prototype.fullLabel=function(t){return this.readable(t,!0)},n.prototype._addQuicked=function(t){var e,o,r,s,a,l,c,h;for(t=n.sortIntervals(t),e=this._quicks(),o=$(),r=!1,e.size()>t.length&&(e.slice(t.length).remove(),r=!0),s=i(286),a=0;a<t.length;a++)l=t[a],c=e.eq(a),h=!1,c.size()?c.data("interval")!==l&&(h=!0):(c=$('<span class="apply-common-tooltip">'),o=o.add(c),h=!0),h&&(c.data("interval",l).attr("title",this.fullLabel(l)).text(this.shortLabel(l)),r=!0),c.toggleClass("selected",l===this.getInterval()).toggleClass("disabled",!s.isAvailable(l));this._main.before(o),r&&this._resize()},n.prototype._resize=function(){this.onResize.fire()},n.prototype.addQuick=function(t){this._quicked[t]=!0,this._addQuicked(this._quicked),this.saveSettings(),this.reactivateInterval()},n.prototype._quickWithInterval=function(t){var e=null;return this._quicks().each(function(i,o){if(o=$(o),t===o.data("interval"))return e=o,!1}),e},n.prototype.inQuick=function(t){return null!=this._quickWithInterval(t)},n.prototype.removeQuick=function(t){this._quickWithInterval(t)&&(this._quickWithInterval(t).remove(),this._resize(),delete this._quicked[t],this.saveSettings(),this.reactivateInterval())},
n.prototype.toggleQuick=function(t){var e=this.inQuick(t);return e?this.removeQuick(t):this.addQuick(t),!e},n.prototype.hasQuicks=function(){return!!this._quicks().length},n.prototype.deactivate=function(t){this._quick.find("span").removeClass("selected")},n.prototype.activateInterval=function(t){this.deactivate(),this.inQuick(t)?this._quickWithInterval(t).addClass("selected"):(this.hasQuicks()&&this._main.addClass("selected"),this._main.data("interval")!==t&&(this._main.text(this.shortLabel(t)),this._main.attr("title",this.fullLabel(t)),this._main.data("interval",t),this._resize()))},n.prototype.reactivateInterval=function(){this.activateInterval(this.getInterval())},n.prototype.getInterval=function(){return s.interval.value()},n.prototype.setInterval=function(t){s.interval.setValue(""+t)},n.prototype._selectInterval=function(t){var e=$(t.target),i=e.data("interval");this.hasQuicks()||this.getInterval()!==i?e.hasClass("disabled")||this.setInterval(i):this._selectMenu()},n.prototype._selectMenu=function(t){this._mainSub.hasClass("active")?this._menu.close():this._menu.open(this.getSortedIntervals())},n.prototype._setIntervalDialogButton=function(){var t=i(265);this._intervalDialogButton=$("<span>").addClass("submenu interval-dialog-button apply-common-tooltip").attr("title",$.t("Open Interval Dialog")).append($("<i>")).appendTo(this._e).click(function(){var e=new t({callback:function(t){s.interval.setValue(t)}}).show(),i=$(this);i.addClass("active"),e.on("destroy",function(){i.removeClass("active")})})},n.prototype.addInterval=function(t){},n.prototype.removeInterval=function(t){},n.prototype.saveIntervals=function(){},n.prototype.saveQuicked=function(){TVSettings.setJSON("IntervalWidget.quicks",this._quicked)},n.prototype.saveSettings=function(){this.saveQuicked(),this.saveIntervals(),l.emit("intervalwidget-change")},t.exports=n}).call(e,i(7),i(20))},,,,,,,,function(t,e,i){function o(t,e,i,o,r,s){if(!t)return void n.logDebug("Missing control");this._control=t,this._property=e,this._applyOnFly=i,this._undoModel=o,this._undoText=r,e&&(this._formatters=[],this._changed=!1,this.setValue(e.value()),e.listeners().subscribe(this,this.propertyChanged))}var n=i(13).getLogger("Chart.PropertyPage.Binding");o.prototype.addFormatter=function(t){this._formatters.push(t),this.setValue(this._property.value())},o.prototype._formatValue=function(t){return this._formatters.reduce(function(t,e){return e(t)},t)},o.prototype._attachToControl=function(t,e){var i=this;e?t.on("keyup change input",function(t){var e=i.value();i.setValueToProperty(e),i.setValue(e)}):(t.keypress(function(t){if(this._changed=!0,13===t.which){var e=i.value();i.setValueToProperty(e),i.setValue(e)}}),t.focusout(function(t){var e=i.value();i.changed()&&(i.setValueToProperty(e),i.setValue(e))}),t.change(function(t){var e=i.value();$(t.target).is(".ticker")?(void 0!==i._changeTimerId&&clearTimeout(i._changeTimerId),i._changeTimerId=setTimeout(function(){i.setValueToProperty(e)},250)):i.setValueToProperty(e),i.setValue(e)}))},o.prototype.control=function(){
return this._control},o.prototype.changed=function(){return this._changed},o.prototype.setValueToProperty=function(t){this._undoModel.setProperty(this._property,t,this._undoText),this._changed=!1},o.prototype.property=function(){return this._property},o.prototype.propertyChanged=function(t){this.setValue(t.value())},o.prototype.destroy=function(){this._property&&this._property.listeners().unsubscribe(this,this.propertyChanged)},e.Binding=o},,function(t,e){"use strict";function i(t,e,i,o,n){var r,s,a,l,c;for(this._canvasesMap={},this._lines=t.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=this._fontStyle(e,i,o,n),this._fontSize=n,r=$("<canvas>"),s=r.get(0).getContext("2d"),s.font=this._font,a=0,l=0;l<this._lines.length;l++)c=s.measureText(this._lines[l]).width,a=Math.max(a,c);this.textImageWidth=a+1,this.textImageHeight=this._lines.length*n}i.prototype.paintTo=function(t,e,i,o,n,r){var s=this._getTextImage(e),a=this._x(i,n,this.textImageWidth),l=this._y(o,r,this.textImageHeight);t.drawImage(s,a-.5,l-.5)},i.prototype._getTextImage=function(t){var e,i,o,n,r;if(this._canvasesMap[t])return this._canvasesMap[t].get(0);for(e=$("<canvas>").attr("width",this.textImageWidth).attr("height",this.textImageHeight),i=e.get(0).getContext("2d"),i.textBaseline="top",i.font=this._font,i.textAlign="center",i.fillStyle=t,o=Math.round(this.textImageWidth/2),n=0,r=0;r<this._lines.length;r++)i.fillText(this._lines[r],o,n),n+=this._fontSize;return this._canvasesMap[t]=e,e.get(0)},i.prototype._x=function(t,e,i){var o=t;switch(e){case"left":break;case"right":o-=i;break;case"center":o-=i/2}return Math.round(o)},i.prototype._y=function(t,e,i){var o=t;switch(e){case"top":break;case"bottom":o-=i;break;case"middle":o-=i/2}return Math.round(o)},i.prototype._fontStyle=function(t,e,i,o){return(t?"bold ":"")+(e?"italic ":"")+o+"px "+i},t.exports=i},function(t,e,i){"use strict";function o(t,e,i,o,n){function r(t){return e&&e[t]?e[t]:t}function s(t,e,i,o){var n=r(e[0]);return!!t.hasOwnProperty(n)&&(e.length>1?s(t[n],e.slice(1),i):(t[n]&&t[n].setValue?t[n].setValue(i):t[n]=i,!0))}function a(t){i||g.logWarn("Path `"+t+"` does not exist.")}var l,c,h,u;if(o)for(l in o)c=l.split("."),h=r(c[0]),u=void 0!==n&&n===c[0],0!==c.length&&u&&(c=c.slice(1),h=r(c[0])),0!==c.length&&t.hasOwnProperty(h)?s(t,c,o[l])||a(l):u&&a(l)}function n(t,e,i,n){window.__defaultsOverrides&&o(t,e,i,window.__defaultsOverrides,n)}function r(){var t=/^linetool.+/;Object.keys(TradingView.defaultProperties).forEach(function(e){t.test(e)&&n(TradingView.defaultProperties[e],null,!1,e)})}function s(t,e){return e?l(t,e):a(t)}function a(t){var e,i=v(t);return window._UNIT_TESTS||(e=TradingView.clone(TVSettings.getJSON(t,null)))&&TradingView.merge(i,e),i}function l(t,e){var i,o,n=v(t);return window._UNIT_TESTS||(i=TradingView.clone(TVSettings.getJSON(t,null)),t.startsWith("study_")&&i&&d.isVersionHead(i.version)&&(o=e.updateStudyState(i,i),i=o),TradingView.merge(n,i)),n}
var c=i(71),h=i(486).LineToolPitchforkStyle,u=i(311).LineToolBarsPatternMode,d=i(119),p=i(45),_=i(106).PlotType,f=i(318),m=i(18).LineEnd,g=i(13).getLogger("Chart.Defaults"),v=function(t){var e,i,o,s,a,l,d,p,g={a:function(t,e){return{color:t,visible:e}},b:function(t,e,i){return{coeff:t,color:e,visible:i}},c:function(t,e,i,o,n){return{coeff:t,color:e,visible:i,linestyle:void 0===o?CanvasEx.LINESTYLE_SOLID:o,linewidth:void 0===n?1:n}},d:function(t,e,i){return{color:t,width:i,visible:e}},e:function(t,e,i,o,n){return{color:t,visible:e,width:i,x:o,y:n}},f:function(t,e,i,o,n,r){return{coeff1:t,coeff2:e,color:i,visible:o,linestyle:void 0===n?CanvasEx.LINESTYLE_SOLID:n,linewidth:void 0===r?1:r}}};if(void 0===TradingView.defaultProperties){switch(window.locale){case"ar_AE":e="Asia/Dubai";break;case"au":e="Australia/Sydney";break;case"br":e="America/Sao_Paulo";break;case"ca":e="America/Toronto";break;case"de_DE":case"it":e="Europe/Berlin";break;case"es":e="Europe/Madrid";break;case"fa_IR":e="Asia/Tehran";break;case"fr":case"sv_SE":e="Europe/Paris";break;case"he_IL":case"tr":e="Europe/Athens";break;case"hu_HU":case"pl":e="Europe/Warsaw";break;case"id":case"th_TH":case"vi_VN":e="Asia/Bangkok";break;case"in":e="Asia/Kolkata";break;case"ja":case"kr":e="Asia/Tokyo";break;case"ms_MY":e="Asia/Singapore";break;case"ru":e="Europe/Moscow";break;case"uk":e="Europe/London";break;case"zh_CN":case"zh_TW":e="Asia/Shanghai";break;default:e="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:e,timeScale:{barSpacing:f.DEFAULT_BAR_SPACING,rightOffset:f.DEFAULT_RIGHT_OFFSET},dataWindowProperties:{background:"rgba( 255, 254, 206, 0.2)",border:"rgba( 96, 96, 144, 1)",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"#ffffff",gridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},vertGridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"rgba( 152, 152, 152, 1)",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:5,bottomMargin:5,leftAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},overlayPropreties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0}},scalesProperties:{showLeftScale:!1,showRightScale:!0,backgroundColor:"#ffffff",lineColor:"#555",textColor:"#555",fontSize:11,scaleSeriesOnly:!1,showSeriesLastValue:!0,showSeriesPrevCloseValue:!1,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1},mainSeriesProperties:{style:c.STYLE_CANDLES,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"rgba( 226, 116, 91, 1)",
style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,showInDataWindow:!0,visible:!0,silentIntervalChange:!1,showPriceLine:!0,priceLineWidth:1,priceLineColor:"",showPrevClosePriceLine:!1,prevClosePriceLineWidth:1,prevClosePriceLineColor:"rgba( 85, 85, 85, 1)",lockScale:!1,minTick:"default",extendedHours:!1,sessVis:!1,statusViewStyle:{fontSize:17,showExchange:!0,showInterval:!0,showSymbolAsDescription:!1},candleStyle:{upColor:"#53b987",downColor:"#eb4d5c",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#53b987",borderDownColor:"#eb4d5c",wickColor:"#737375",wickUpColor:"#a9cdd3",wickDownColor:"#f5a6ae",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 169, 220, 195, 1)",wickDownColor:"rgba( 245, 166, 174, 1)"},haStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 83, 185, 135, 1)",wickDownColor:"rgba( 255, 77, 92, 1)",showRealLastPrice:!1,barColorsOnPrevClose:!1,inputs:{},inputInfo:{}},barStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 60, 120, 216, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:c.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1},renkoStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",wickUpColor:"rgba( 83, 185, 135, 1)",wickDownColor:"rgba( 255, 77, 92, 1)",inputs:{source:"close",boxSize:3,style:"ATR",atrLength:14,wicks:!0},inputInfo:{source:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR Length"},wicks:{name:"Wicks"}}},pbStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{
upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",style:"ATR",atrLength:14,reversalAmount:1},inputInfo:{source:{name:"Source"},style:{name:"Style"},atrLength:{name:"ATR Length"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{sources:"Close",reversalAmount:3,boxSize:1,style:"ATR",atrLength:14},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR Length"}}},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.1)",topFillColor2:"rgba( 83, 185, 135, 0.1)",bottomFillColor1:"rgba( 235, 77, 92, 0.1)",bottomFillColor2:"rgba( 235, 77, 92, 0.1)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:1,bottomLineWidth:1,priceSource:"close",transparency:50,baseLevelPercentage:50}},symbolWatermarkProperties:{color:"rgba( 85, 85, 85, 0)",transparency:100},chartEventsSourceProperties:{visible:!0,futureOnly:!0,breaks:{color:"rgba(85, 85, 85, 1)",visible:!1,style:CanvasEx.LINESTYLE_DASHED,width:1}},tradingProperties:{showPositions:!0,showOrders:!0,showExecutions:!0,extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:CanvasEx.LINESTYLE_DASHED},alertsProperties:{labels:{visible:!0,color:"rgba( 215, 84, 66, 1)",highlightColor:"rgba( 255, 255, 51, 1)",hoverColor:"rgba( 245, 227, 135, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},fakeLabels:{visible:!0,color:"rgba( 119, 119, 119, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},drawingIcon:{color:"rgba( 170, 170, 170, 1)"}},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},drawings:{magnet:!1,stayInDrawingMode:!1,drawOnAllCharts:!0,crossHairColor:"rgba( 183, 183, 183, 1)",crossHairStyle:CanvasEx.LINESTYLE_DASHED,crossHairWidth:1},linetoolorder:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 255, 0, 0, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 255, 0, 0, 0)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 255, 0, 0, 0)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 255, 0, 0, 0)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 255, 0, 0, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderColor:"rgba( 255, 0, 0, 1)",cancelButtonBorderTransparency:0,cancelButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",cancelButtonBackgroundTransparency:25,
cancelButtonIconColor:"rgba( 255, 0, 0, 1)",cancelButtonIconTransparency:0,tooltip:""},linetoolposition:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 0, 113, 224, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 0, 113, 224, 1)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 0, 113, 224, 1)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 0, 113, 224, 1)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 0, 113, 224, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderColor:"rgba( 0, 113, 224, 1)",reverseButtonBorderTransparency:0,reverseButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",reverseButtonBackgroundTransparency:25,reverseButtonIconColor:"rgba( 0, 113, 224, 1)",reverseButtonIconTransparency:0,closeButtonBorderColor:"rgba( 0, 113, 224, 1)",closeButtonBorderTransparency:0,closeButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",closeButtonBackgroundTransparency:25,closeButtonIconColor:"rgba( 0, 113, 224, 1)",closeButtonIconTransparency:0,tooltip:""},linetoolexecution:{singleChartOnly:!0,direction:"buy",arrowHeight:8,arrowSpacing:1,arrowColor:"rgba( 0, 0, 255, 1)",arrowTransparency:0,text:"",textColor:"rgba( 0, 0, 0, 1)",textTransparency:0,fontFamily:"Verdana",fontSize:8,fontBold:!1,fontItalic:!1,tooltip:""},linetoolicon:{singleChartOnly:!0,clonable:!0,color:"rgba( 61, 133, 198, 1)",size:40,icon:61536,angle:.5*Math.PI,scale:1},linetoolbezierquadro:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:m.Normal,rightEnd:m.Normal},linetoolbeziercubic:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:m.Normal,rightEnd:m.Normal},linetooltrendline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:m.Normal,rightEnd:m.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetooltimecycles:{clonable:!0,linecolor:"rgba(21, 153, 128, 1)",linewidth:1,fillBackground:!0,backgroundColor:"rgba(106, 168, 79, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolsineline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooltrendangle:{singleChartOnly:!0,clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,
linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!0,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1},linetooldisjointangle:{clonable:!0,linecolor:"rgba( 18, 159, 92, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 106, 168, 79, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:m.Normal,rightEnd:m.Normal,font:"Verdana",textcolor:"rgba( 18, 159, 92, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolflatbottom:{clonable:!0,linecolor:"rgba( 73, 133, 231, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:m.Normal,rightEnd:m.Normal,font:"Verdana",textcolor:"rgba( 73, 133, 231, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolfibspiral:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooldaterange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",extendTop:!1,extendBottom:!1},linetoolpricerange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",extendLeft:!1,extendRight:!1},linetooldateandpricerange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)"},linetoolriskrewardshort:{isShort:!0,clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25},linetoolriskrewardlong:{isShort:!1,clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,
fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25},linetoolarrow:{clonable:!0,linecolor:"rgba( 111, 136, 198, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:m.Normal,rightEnd:m.Arrow,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolray:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!0,leftEnd:m.Normal,rightEnd:m.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolextended:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!0,extendRight:!0,leftEnd:m.Normal,rightEnd:m.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolhorzline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,text:"",font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolhorzray:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,text:"",font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showTime:!0},linetoolcirclelines:{clonable:!0,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolfibtimezone:{horzLabelsAlign:"right",vertLabelsAlign:"bottom",clonable:!0,baselinecolor:"rgba( 128, 128, 128, 1)",linecolor:"rgba( 0, 85, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showLabels:!0,font:"Verdana",fillBackground:!1,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(0,"rgba( 128, 128, 128, 1)",!0),level2:g.c(1,"rgba( 0, 85, 219, 1)",!0),level3:g.c(2,"rgba( 0, 85, 219, 1)",!0),level4:g.c(3,"rgba( 0, 85, 219, 1)",!0),level5:g.c(5,"rgba( 0, 85, 219, 1)",!0),level6:g.c(8,"rgba( 0, 85, 219, 1)",!0),level7:g.c(13,"rgba( 0, 85, 219, 1)",!0),
level8:g.c(21,"rgba( 0, 85, 219, 1)",!0),level9:g.c(34,"rgba( 0, 85, 219, 1)",!0),level10:g.c(55,"rgba( 0, 85, 219, 1)",!0),level11:g.c(89,"rgba( 0, 85, 219, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltext:{clonable:!0,color:"rgba( 102, 123, 139, 1)",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 91, 133, 191, 0.9)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:400},linetooltextabsolute:{singleChartOnly:!0,clonable:!0,color:"rgba( 102, 123, 139, 1)",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 155, 190, 213, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!0,wordWrap:!1,wordWrapWidth:400},linetoolballoon:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 254, 206, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:12,font:"Arial",transparency:30,text:$.t("Comment")},linetoolbrush:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,smooth:5,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,leftEnd:m.Normal,rightEnd:m.Normal},linetoolpolyline:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,filled:!1},linetoolarrowmark:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkleft:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkup:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkright:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkdown:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolflagmark:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolnote:{clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,text:$.t("Text"),font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!1,fixedSize:!0},linetoolnoteabsolute:{singleChartOnly:!0,clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,text:$.t("Text"),font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!0,fixedSize:!0},linetoolthumbup:{clonable:!0,color:"rgba( 0, 128, 0, 1)"},linetoolthumbdown:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolpricelabel:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 255, 255, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:11,font:"Arial",transparency:30},linetoolrectangle:{clonable:!0,color:"rgba( 21, 56, 153, 1)",
fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",linewidth:1,snapTo45Degrees:!0,transparency:50},linetoolrotatedrectangle:{clonable:!0,color:"rgba( 152, 0, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 142, 124, 195, 0.5)",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolellipse:{clonable:!0,color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolarc:{clonable:!0,color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolprediction:{singleChartOnly:!0,linecolor:"rgba( 28, 115, 219, 1)",linewidth:2,sourceBackColor:"rgba( 241, 241, 241, 1)",sourceTextColor:"rgba( 110, 110, 110, 1)",sourceStrokeColor:"rgba( 110, 110, 110, 1)",targetStrokeColor:"rgba( 47, 168, 255, 1)",targetBackColor:"rgba( 11, 111, 222, 1)",targetTextColor:"rgba( 255, 255, 255, 1)",successBackground:"rgba( 54, 160, 42, 0.9)",successTextColor:"rgba( 255, 255, 255, 1)",failureBackground:"rgba( 231, 69, 69, 0.5)",failureTextColor:"rgba( 255, 255, 255, 1)",intermediateBackColor:"rgba( 234, 210, 137, 1)",intermediateTextColor:"rgba( 109, 77, 34, 1)",transparency:10,centersColor:"rgba( 32, 32, 32, 1)"},linetooltriangle:{clonable:!0,color:"rgba( 153, 21, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:1},linetoolcallout:{clonable:!0,color:"rgba( 255, 255, 255, 1)",backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:2,fontsize:12,font:"Verdana",text:$.t("Text"),bordercolor:"rgba( 153, 21, 21, 1)",bold:!1,italic:!1,wordWrap:!1,wordWrapWidth:400},linetoolparallelchannel:{clonable:!0,linecolor:"rgba( 119, 52, 153, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:"rgba( 180, 167, 214, 0.5)",transparency:50,showMidline:!1,midlinecolor:"rgba( 119, 52, 153, 1)",midlinewidth:1,midlinestyle:CanvasEx.LINESTYLE_DASHED},linetoolelliottimpulse:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliotttriangle:{degree:7,clonable:!0,showWave:!0,color:"rgba( 255, 152, 0, 1)",linewidth:1},linetoolelliotttriplecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolelliottcorrection:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliottdoublecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolbarspattern:{singleChartOnly:!0,color:"rgba( 80, 145, 204, 1)",clonable:!0,mode:u.Bars,mirrored:!1,flipped:!1},linetoolghostfeed:{singleChartOnly:!0,clonable:!0,averageHL:20,variance:50,candleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375"},transparency:50},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},graphics:{},showInDataWindow:!0,visible:!0,showStudyArguments:!0,precision:"default"},linetoolpitchfork:{clonable:!0,
fillBackground:!0,transparency:80,style:h.Original,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolpitchfan:{clonable:!0,fillBackground:!0,transparency:80,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolgannfan:{clonable:!0,showLabels:!0,font:"Verdana",fillBackground:!0,transparency:80,level1:g.f(1,8,"rgba( 160, 107, 0, 1)",!0),level2:g.f(1,4,"rgba( 105, 158, 0, 1)",!0),level3:g.f(1,3,"rgba( 0, 155, 0, 1)",!0),level4:g.f(1,2,"rgba( 0, 153, 101, 1)",!0),level5:g.f(1,1,"rgba( 128, 128, 128, 1)",!0),level6:g.f(2,1,"rgba( 0, 101, 153, 1)",!0),level7:g.f(3,1,"rgba( 0, 0, 153, 1)",!0),level8:g.f(4,1,"rgba( 102, 0, 153, 1)",!0),level9:g.f(8,1,"rgba( 165, 0, 0, 1)",!0),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolganncomplex:{clonable:!0,fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,levels:[g.d("rgba( 128, 128, 128, 1)",!0,1),g.d("rgba( 160, 107, 0, 1)",!0,1),g.d("rgba( 105, 158, 0, 1)",!0,1),g.d("rgba( 0, 155, 0, 1)",!0,1),g.d("rgba( 0, 153, 101, 1)",!0,1),g.d("rgba( 128, 128, 128, 1)",!0,1)],fanlines:[g.e("rgba( 165, 0, 255, 1)",!1,1,8,1),g.e("rgba( 165, 0, 0, 1)",!1,1,5,1),g.e("rgba( 128, 128, 128, 1)",!1,1,4,1),g.e("rgba( 160, 107, 0, 1)",!1,1,3,1),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,1,1),g.e("rgba( 0, 153, 101, 1)",!0,1,1,2),g.e("rgba( 0, 153, 101, 1)",!1,1,1,3),g.e("rgba( 0, 0, 153, 1)",!1,1,1,4),g.e("rgba( 102, 0, 153, 1)",!1,1,1,5),g.e("rgba( 165, 0, 255, 1)",!1,1,1,8)],arcs:[g.e("rgba( 160, 107, 0, 1)",!0,1,1,0),g.e("rgba( 160, 107, 0, 1)",!0,1,1,1),g.e("rgba( 160, 107, 0, 1)",!0,1,1.5,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,3,0),g.e("rgba( 0, 155, 0, 1)",!0,1,3,1),g.e("rgba( 0, 153, 101, 1)",!0,1,4,0),g.e("rgba( 0, 153, 101, 1)",!0,1,4,1),g.e("rgba( 0, 0, 153, 1)",!0,1,5,0),g.e("rgba( 0, 0, 153, 1)",!0,1,5,1)],
__collectibleLines:["trendline","levels.0","levels.1","levels.2","levels.3","levels.4","levels.5","fanlines.0","fanlines.1","fanlines.2","fanlines.3","fanlines.4","fanlines.5","fanlines.6","fanlines.7","fanlines.8","fanlines.9","fanlines.10","arcs.0","arcs.1","arcs.2","arcs.3","arcs.4","arcs.5","arcs.6","arcs.7","arcs.8","arcs.9","arcs.10"]},linetoolgannsquare:{clonable:!0,color:"rgba( 21, 56, 153, 0.8)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,reverse:!1,fans:g.a("rgba( 128, 128, 128, 1)",!1),hlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),hlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["fans","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibspeedresistancefan:{clonable:!0,fillBackground:!0,transparency:80,grid:{color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,visible:!0},linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,snapTo45Degrees:!0,hlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),hlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["trendline","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibretracement:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.b(0,"rgba( 128, 128, 128, 1)",!0),level2:g.b(.236,"rgba( 204, 40, 40, 1)",!0),
level3:g.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:g.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:g.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:g.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:g.b(1,"rgba( 128, 128, 128, 1)",!0),level8:g.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:g.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:g.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:g.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:g.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:g.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:g.b(2,"rgba( 40, 204, 149, 1)",!1),level14:g.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:g.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:g.b(3,"rgba( 40, 149, 204, 1)",!1),level18:g.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:g.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:g.b(4,"rgba( 204, 40, 40, 1)",!1),level21:g.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:g.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:g.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:g.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolfibchannel:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",coeffsAsPercents:!1,levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.b(0,"rgba( 128, 128, 128, 1)",!0),level2:g.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:g.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:g.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:g.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:g.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:g.b(1,"rgba( 128, 128, 128, 1)",!0),level8:g.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:g.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:g.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:g.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:g.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:g.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:g.b(2,"rgba( 40, 204, 149, 1)",!1),level14:g.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:g.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:g.b(3,"rgba( 40, 149, 204, 1)",!1),level18:g.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:g.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:g.b(4,"rgba( 204, 40, 40, 1)",!1),level21:g.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:g.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:g.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:g.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolprojection:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,color1:"rgba( 0, 128, 0, 0.2)",color2:"rgba( 255, 0, 0, 0.2)",linewidth:1,trendline:{visible:!0,
color:"rgba( 128, 128, 128, 1)",linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.c(1,"rgba( 128, 128, 128, 1)",!0)},linetool5pointspattern:{clonable:!0,color:"rgba( 204, 40, 149, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 204, 40, 149, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolcypherpattern:{clonable:!0,color:"#CC2895",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#CC2895",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetooltrianglepattern:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolabcd:{clonable:!0,color:"rgba( 0, 155, 0, 1)",textcolor:"rgba( 255, 255, 255, 1)",font:"Verdana",fontsize:12,bold:!1,italic:!1,linewidth:2},linetoolthreedrivers:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolheadandshoulders:{clonable:!0,color:"rgba( 69, 104, 47, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 69, 168, 47, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolfibwedge:{singleChartOnly:!0,clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:g.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:g.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:g.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:g.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:g.c(1,"rgba( 128, 128, 128, 1)",!0),level7:g.c(1.618,"rgba( 40, 40, 204, 1)",!1),level8:g.c(2.618,"rgba( 204, 40, 40, 1)",!1),level9:g.c(3.618,"rgba( 149, 40, 204, 1)",!1),level10:g.c(4.236,"rgba( 204, 40, 149, 1)",!1),level11:g.c(4.618,"rgba( 204, 40, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibcircles:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,snapTo45Degrees:!0,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:g.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:g.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:g.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:g.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:g.c(1,"rgba( 128, 128, 128, 1)",!0),level7:g.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:g.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:g.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:g.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:g.c(4.618,"rgba( 204, 40, 149, 1)",!0),
__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibspeedresistancearcs:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,fullCircles:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:g.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:g.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:g.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:g.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:g.c(1,"rgba( 128, 128, 128, 1)",!0),level7:g.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:g.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:g.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:g.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:g.c(4.618,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltrendbasedfibextension:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.b(0,"rgba( 128, 128, 128, 1)",!0),level2:g.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:g.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:g.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:g.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:g.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:g.b(1,"rgba( 128, 128, 128, 1)",!0),level8:g.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:g.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:g.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:g.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:g.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:g.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:g.b(2,"rgba( 40, 204, 149, 1)",!1),level14:g.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:g.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:g.b(3,"rgba( 40, 149, 204, 1)",!1),level18:g.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:g.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:g.b(4,"rgba( 204, 40, 40, 1)",!1),level21:g.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:g.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:g.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:g.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetooltrendbasedfibtime:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(0,"rgba( 128, 128, 128, 1)",!0),level2:g.c(.382,"rgba( 204, 40, 40, 1)",!0),
level3:g.c(.5,"rgba( 149, 204, 40, 1)",!1),level4:g.c(.618,"rgba( 40, 204, 40, 1)",!0),level5:g.c(1,"rgba( 40, 204, 149, 1)",!0),level6:g.c(1.382,"rgba( 40, 149, 204, 1)",!0),level7:g.c(1.618,"rgba( 128, 128, 128, 1)",!0),level8:g.c(2,"rgba( 40, 40, 204, 1)",!0),level9:g.c(2.382,"rgba( 204, 40, 40, 1)",!0),level10:g.c(2.618,"rgba( 149, 40, 204, 1)",!0),level11:g.c(3,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolschiffpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:h.Schiff,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolschiffpitchfork2:{clonable:!0,fillBackground:!0,transparency:80,style:h.Schiff2,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolinsidepitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:h.Inside,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetool:{frozen:!1,visible:!0},linetoolvisibilities:{intervalsVisibilities:{seconds:!0,secondsFrom:1,secondsTo:59,minutes:!0,minutesFrom:1,minutesTo:59,hours:!0,hoursFrom:1,hoursTo:24,days:!0,daysFrom:1,daysTo:366,weeks:!0,months:!0}}},n(TradingView.defaultProperties.chartproperties),r()}for(void 0===TradingView.defaultProperties["study_MA@tv-basicstudies"]&&(TradingView.defaultProperties["study_MA@tv-basicstudies"]={description:"Moving Average",shortDescription:"MA",inputs:{length:9,source:"close"},styles:{
MovAvg:{visible:!0,color:"rgba( 4, 150, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:_.Line,histogramBase:0,title:"MA"}}}),void 0===TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]={description:"Error On Update",styles:{ErrorOnUpdate:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:_.Line,histogramBase:0}}}),void 0===TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"]={description:"Error On Create",styles:{ErrorOnUpdate:{visible:!0,color:"rgba( 0, 255, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:_.Line,histogramBase:0}}}),void 0===TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]={description:"Error On New Bar",styles:{ErrorOnUpdate:{visible:!0,color:"rgba( 0, 0, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:_.Line,histogramBase:0}}}),void 0===TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"rgba( 83, 143, 31, 1)",backColor:"rgba( 240, 255, 204, 1)",textColor:"rgba( 0, 0, 0, 1)"}),void 0===TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]&&(i="rgba( 212, 121, 40, 1)",o=!0,s=1,TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,font:"Arial",fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:o,"S1/R1":o,"S2/R2":o,"S3/R3":o,"S4/R4":o,"S5/R5":o},colors:{P:i,"S1/R1":i,"S2/R2":i,"S3/R3":i,"S4/R4":i,"S5/R5":i},widths:{P:s,"S1/R1":s,"S2/R2":s,"S3/R3":s,"S4/R4":s,"S5/R5":s}}}),void 0===TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]&&(TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]={color:"rgba( 86, 135, 29, 1)",linewidth:2}),void 0===TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]&&(TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:g.a("rgba( 255, 0, 0, 1)",!1),level1:g.a("rgba( 0, 128, 0, 1)",!1),level2:g.a("rgba( 0, 0, 255, 1)",!1),level3:g.a("rgba( 255, 0, 255, 1)",!1),level4:g.a("rgba( 0, 128, 255, 1)",!0),level5:g.a("rgba( 255, 0, 0, 1)",!0),level6:g.a("rgba( 0, 128, 0, 1)",!0),level7:g.a("rgba( 0, 0, 255, 1)",!0),level8:g.a("rgba( 255, 0, 255, 1)",!0)}),void 0===TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]&&(TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]={styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!0,showPearsons:!0,
backgroundColor:"rgba( 153, 21, 21, 0.3)",transparency:70}}),void 0===TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]&&(TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]={linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}}),void 0===TradingView.defaultProperties["study_Compare@tv-basicstudies"]&&(TradingView.defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"}),void 0===TradingView.defaultProperties["study_Overlay@tv-basicstudies"]&&(a="study_Overlay@tv-basicstudies",TradingView.defaultProperties[a]={style:c.STYLE_BARS,showPriceLine:!1,minTick:"default",candleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},barStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 3, 3, 247, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:c.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.1)",topFillColor2:"rgba( 83, 185, 135, 0.1)",bottomFillColor1:"rgba( 235, 77, 92, 0.1)",bottomFillColor2:"rgba( 235, 77, 92, 0.1)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:1,bottomLineWidth:1,priceSource:"close",transparency:50,baseLevelPercentage:50},styles:{open:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:_.Line,histogramBase:0},high:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:_.Line,histogramBase:0},low:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:_.Line,histogramBase:0},close:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:_.Line,histogramBase:0}}}),l=t.split("."),
d=TradingView.defaultProperties,p=0;p<l.length;p++)d&&(d=d[l[p]]);return d?TradingView.clone(d):{}};s.create=function(t,e){var i,o;e&&(i=p.parseIdString(t),o=v(i.id),TradingView.defaultProperties[i.id]=$.extend(e,o))},s.remove=function(t){TradingView.defaultProperties[t]=void 0},TradingView.saveDefaults=function(t,e){TVSettings.setJSON(t,e)},TradingView.factoryDefaults=v,window.applyDefaultOverridesToLinetools=r,window.applyDefaultsOverrides=n,window.applyPropertiesOverrides=o,window.defaults=s,e.applyDefaultOverridesToLinetools=r,e.applyDefaultsOverrides=n,e.applyPropertiesOverrides=o,e.defaults=s,e.factoryDefaults=v,e.saveDefaults=TradingView.saveDefaults},function(t,e){"use strict";function i(t,e){this._formatter=t,this._maxSize=e||50,this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}i.prototype.format=function(t){var e,i;return this._cache[t]?this._cache[t].string:(this._actualSize===this._maxSize&&(e=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[e],this._oldestTick++,this._actualSize--),i=this._formatter(t),this._cache[t]={string:i,tick:this._usageTick},this._tick2Labels[this._usageTick]=t,this._actualSize++,this._usageTick++,i)},t.exports=i},function(t,e,i){"use strict";function o(t,e){this._constructor="LineTool5PointsPattern";var o=e||new r("linetool5pointspattern");n.call(this,t,o),i.e(1,function(t){var e=i(412).Pattern5PaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(173).DateTimeFormatter,a=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 5},o.prototype.title=function(){return"XABCD Pattern"},o.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null},time4:{title:"Date 5",value:null},price4:{title:"Price 5",value:null}},o.prototype._updateTooltip=function(){var t,e,i,o,n,r=this._tooltipFieldsHash,a=this.points().m_values;a[0]&&(e=this._model.timeScale().indexToUserTime(a[0].index),r.time0.value=e?new s(this._model.mainSeries().isDWM()).format(e):0,r.price0.value=this._model.mainSeries()._formatter.format(a[0].price)),a[1]&&(t=this._model.timeScale().indexToUserTime(a[1].index),r.time1.value=t?new s(this._model.mainSeries().isDWM()).format(t):0,r.price1.value=this._model.mainSeries()._formatter.format(a[1].price)),a[2]&&(i=this._model.timeScale().indexToUserTime(a[2].index),r.time2.value=i?new s(this._model.mainSeries().isDWM()).format(i):0,r.price2.value=this._model.mainSeries()._formatter.format(a[2].price)),a[3]&&(o=this._model.timeScale().indexToUserTime(a[3].index),r.time3.value=o?new s(this._model.mainSeries().isDWM()).format(o):0,r.price3.value=this._model.mainSeries()._formatter.format(a[3].price)),a[4]&&(n=this._model.timeScale().indexToUserTime(a[4].index),
r.time4.value=t?new s(this._model.mainSeries().isDWM()).format(n):0,r.price4.value=this._model.mainSeries()._formatter.format(a[4].price))},o.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},o.prototype.getStylesPropertyPage=function(){return a.LineToolLineTool5PointsPatternStylesPropertyPage},e.LineTool5PointsPattern=o},,function(t,e,i){(function(t){"use strict";function o(t,e){this._pane=t,this._timeScale=e}function n(t){this._line=t}function r(t,e){this._adapter=new n(this),this._constructor="LineToolExecution";var o=e||new l("linetoolexecution");this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0},s.call(this,t,o),i.e(1,function(t){var e=i(864).ExecutionPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var s=i(3).LineDataSource,a=i(132),l=i(11).DefaultProperty,c=i(42).PlotRowSearchMode;o.prototype._cachedByBarIndexOrderedExecutions={},o.recreateOrderedByBarsSourcesCache=function(t){var e,i,n,r,s;for(o.clearOrderedByBarsSourcesCache(),e=o.prototype,i=t.orderedSources(),n=0;n<i.length;++n)r=i[n],r._adapter&&void 0!==r._adapter._index&&(s=e._cachedByBarIndexOrderedExecutions[r._adapter._index],e._cachedByBarIndexOrderedExecutions[r._adapter._index]=s||[],e._cachedByBarIndexOrderedExecutions[r._adapter._index].push(r))},o.clearOrderedByBarsSourcesCache=function(){o.prototype._cachedByBarIndexOrderedExecutions={}},o.prototype.getXYCoordinate=function(t,e,i){var o,n,s,a,l,h,u,d,p,_,f=0,m=t.getDirection(),g="buy"===m,v=this._pane.model().mainSeries();if(v.bars&&(o=g?10:-10,null!==(n=v.bars().search(i,c.NearestLeft))&&(i=n.index,s=g?n.value[TradingView.LOW_PLOT]:n.value[TradingView.HIGH_PLOT],a=v.priceScale(),a.isPercent()&&(l=v.firstValue(),s=a.priceRange().convertToPercent(s,l)),f=a.priceToCoordinate(s)+o)),t._index=i,h=e.visibleBars(),!isFinite(i)||null===h||i>h.lastBar()||i<h.firstBar())return{x:-1,y:-1};for(u=this._cachedByBarIndexOrderedExecutions[i]||this._pane.orderedSources(),d=u.length-1;d>=0;--d)if((p=u[d])instanceof r&&p._adapter._index===i&&p._adapter.getDirection()===m){if(p===t._line)break;_=p._adapter._height(),f=g?f+_:f-_}return{x:e.indexToCoordinate(i),y:f}},n.prototype._height=function(){var t,e=this.getArrowHeight(),i=this.getArrowSpacing();return this.getText()&&a.fontHeight(this.getFont()),t=10,e+i+0+t},n.prototype.getIndex=function(){return this._line._model.timeScale().baseIndex()-this._line.points()[0].index},n.prototype.setIndex=function(t){var e,i=this._line._model.timeScale(),o=i.baseIndex(),n=o-Math.abs(t);return this._line.startMoving(this._line.points()[0]),e=TradingView.merge({},this._line.points()[0]),e.index=n,this._line.move(e),this._line.endMoving(),this},n.prototype.getTime=function(){return this._unixtime},n.prototype.setTime=function(t){var e=this._line._model.mainSeries();return this._unixtime=ChartApiInstance.alignTimePoint?ChartApiInstance.alignTimePoint(t,e.interval(),e.symbolInfo()):t,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),
this._line.createServerPoints(),this},n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(t){return this._line.points().length>0&&(this._line.points()[0].price=t),this._line._timePoint.length>0&&(this._line._timePoint[0].price=t),this},n.prototype.getText=function(){return this._line.properties().text.value()},n.prototype.setText=function(t){return this._line.properties().text.setValue(t||""),this._line.updateAllViewsAndRedraw(),this},n.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()},n.prototype.setArrowHeight=function(t){return this._line.properties().arrowHeight.setValue(t||5),this},n.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()},n.prototype.setArrowSpacing=function(t){return this._line.properties().arrowSpacing.setValue(t||1),this},n.prototype.getDirection=function(){return this._line.properties().direction.value()},n.prototype.setDirection=function(t){return this._line.properties().direction.setValue(t||"buy"),this},n.prototype.getArrowColor=function(){return a.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)},n.prototype.setArrowColor=function(t){return a.setColorToProperties(t,this._line.properties().arrowColor,this._line.properties().arrowTransparency),this},n.prototype.getTextColor=function(){return a.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)},n.prototype.setTextColor=function(t){return a.setColorToProperties(t,this._line.properties().textColor,this._line.properties().textTransparency),this},n.prototype.getFont=function(){return a.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)},n.prototype.setFont=function(t){return a.setFontToProperties(t,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic),this},n.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(r,s),r.POINTS_COUNT=1,r.skipMagnetting=!0,r.prototype.pointsCount=function(){return r.POINTS_COUNT},r.prototype.title=function(){return"Execution"},r.prototype.hasContextMenu=function(){return!1},r.prototype.state=function(){return null},r.prototype.updateAllViews=function(){return this._isVisible()?s.prototype.updateAllViews.call(this):null},r.prototype.priceAxisViews=function(t,e){return this._isVisible()?s.prototype.priceAxisViews.call(this,t,e):null},r.prototype._isVisible=function(){return this._model.properties().tradingProperties.showExecutions.value()},r.prototype.paneViews=function(e){
return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showExecutions.value()?s.prototype.paneViews.call(this,e):null},r.prototype.userEditEnabled=function(){return!1},r.prototype.showInObjectTree=function(){return!1},r.prototype.getInputsPropertyPage=function(){return null},e.ExecutionsPositionController=o,e.LineToolExecution=r}).call(e,i(7))},,function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolFibSpeedResistanceArcs";var n=e||this.createPropertiesObject("linetoolfibwedge");r.call(this,t,n),t._fibWedgeLabelsCache||(t._fibWedgeLabelsCache=new o),i.e(1,function(t){var e=i(414).FibWedgePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(3).LineDataSource,s=i(40),a=i(116),l=i(9).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return n.LevelsCount},inherit(n,r),n.LevelsCount=11,n.prototype.getCache=function(){return this._model._fibWedgeLabelsCache||(this._model._fibWedgeLabelsCache=new o),this._model._fibWedgeLabelsCache},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Fib Wedge"},n.prototype.setPoint=function(t,e){var i,o,n,s,a,l,c;r.prototype.setPoint.call(this,t,e),this._recursiveGuard||(this._recursiveGuard=!0,2===t?(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],s=n.subtract(i).length(),a=o.subtract(i).normalized(),o=i.add(a.scaled(s)),l=this.screenPointToPoint(o),this._properties.points[1].price.setValue(l.price),this._properties.points[1].bar.setValue(l.index)):(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],c=o.subtract(i).length(),a=n.subtract(i).normalized(),n=i.add(a.scaled(c)),l=this.screenPointToPoint(n),this._properties.points[2].price.setValue(l.price),this._properties.points[2].bar.setValue(l.index)),this._recursiveGuard=!1)},n.prototype.addPoint=function(t){var e,i,o,n,s,a,l,c;return 2===this._points.length&&(e=this.pointToScreenPoint(this._points[0])[0],i=this.pointToScreenPoint(this._points[1])[0],this.priceScale().isPercent()&&(o=this.ownerSource().firstValue(),t.price=this.priceScale().priceRange().convertFromPercent(t.price,o)),n=this.pointToScreenPoint(t)[0],s=i.subtract(e).length(),a=n.subtract(e).normalized(),n=e.add(a.scaled(s)),l=this.priceScale().coordinateToPrice(n.y),c=Math.round(this._model.timeScale().coordinateToIndex(n.x)),t={index:c,price:l}),r.prototype.addPoint.call(this,t)},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[1,11]})},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibWedgeStylesPropertyPage},e.LineToolFibWedge=n},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolNote"
;var n=e||new s("linetoolnote");r.call(this,t,n),this.version=o.version,i.e(1,function(t){var e=i(899).NotePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}function n(t,e){var i=e||new s("linetoolnoteabsolute");i.locked.value()||i.locked.setValue(!0),o.call(this,t,i)}var r=i(3).LineDataSource,s=i(11).DefaultProperty,a=i(9).propertyPages;inherit(o,r),o.TOOLTIP_WIDTH=300,o.TOOLTIP_PADDING=10,o.TOOLTIP_LINESPACING=5,o.version=1,o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return $.t("Note")},o.prototype.restoreTemplate=function(t){delete t.locked,delete t.text,r.prototype.restoreTemplate.call(this,t)},o.prototype.getTooltipWidth=function(){return o.TOOLTIP_WIDTH},o.prototype.getTooltipPadding=function(){return o.TOOLTIP_PADDING},o.prototype.getTooltipLineSpacing=function(){return o.TOOLTIP_LINESPACING},inherit(n,o),n.prototype.title=function(){return $.t("Anchored Note")},o.prototype.state=function(t){var e=r.prototype.state.call(this,t);return t&&(e.state.fixedSize=!1),e},o.prototype.getStylesPropertyPage=function(){return a.LineToolNotePropertyPage},e.LineToolNote=o,e.LineToolNoteAbsolute=n},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolText";var o=e||new a("linetooltext");r.call(this,t,o),this._timeScale=t.timeScale(),this._barSpacing=t.timeScale().barSpacing(),i.e(1,function(t){var e=i(418).TextPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}function n(t,e){var i=e||new a("linetooltextabsolute");i.locked.value()||i.locked.setValue(!0),o.call(this,t,i)}var r=i(3).LineDataSource,s=i(62).DataSource,a=i(11).DefaultProperty,l=i(9).propertyPages;inherit(o,r),o.MIN_WIDTH=100,o.prototype.setPoint=function(t,e){var i,n,r=this.properties();if(0===t&&r.wordWrapWidth&&r.wordWrapWidth.value()){if(i=r.locked&&r.locked.value()?this.fixedPoints()[0].x:this._timeScale.indexToCoordinate(this.points()[0].index),n=this._timeScale.indexToCoordinate(e.index)-i-~~(r.fontsize.value()/6),!isFinite(n))return;r.wordWrapWidth.setValue(Math.max(o.MIN_WIDTH,n))}},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return $.t("Text")},o.prototype.setPriceScale=function(t){s.prototype.setPriceScale.call(this,t),t&&t.priceRange()&&(this._priceDencity=t.height()/t.priceRange().length(),this._isPriceDencityLog=t.isLog())},o.prototype.restoreSize=function(){this._barSpacing=this._model.timeScale().barSpacing(),this._priceDencity=this.priceScale().height()/this.priceScale().priceRange().length(),this.updateAllViews(),this._model.updateSource(this)},o.prototype.restoreTemplate=function(t){delete t.locked,delete t.text,r.prototype.restoreTemplate.call(this,t)},inherit(n,o),n.prototype.title=function(){return $.t("Anchored Text")},o.prototype.state=function(t){var e=r.prototype.state.call(this,t);return t&&(e.state.fixedSize=!1),e},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return l.LineToolTextStylesPropertyPage},e.LineToolText=o,e.LineToolTextAbsolute=n},function(t,e,i){
"use strict";function o(t){t.forceLineColor=!1,r.call(this,t),this.color1=t.color1,this.color2=t.color2,this.bottom=t.bottom,this.isSeries=!!t.isSeries,this._simpleMode=t.simpleMode}var n=i(69).coordinateIsValid,r=i(212).PaneRendererLine;inherit(o,r),o.prototype.draw=function(t){var e,i,o,s,a,l,c,h,u,d,p,_;if(0!==this.items.length){for(t.lineCap="square",t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,t.lineStyle=this.lineStyle,t.lineWidth=1,e=0;e<this.items.length&&!n(this.items[e].y);)e++;for(i=this.items.length-1;i>=0&&!n(this.items[i].y);)i--;if(!(e>=i)){for(t.translate(.5,.5),o={},s=this.items,a=e;a<=i;a++)l=s[a],c=l.style?l.style.color:this.lineColor,a<i&&s[a+1].style&&(h=s[a+1].style.color,c!==h&&(u=o[h]||[],u.push(l),o[h]=u)),d=o[c]||[],d.push(l),o[c]=d;for(c in o){for(d=o[c],t.beginPath(),p=0,a=0;a<d.length;a++)d[a].style&&d[a].style.color!==c&&(t.moveTo(d[p].x,this.bottom),this.walkLine(t,d.slice(p,a),!0,this.bottom),p=a);t.moveTo(d[p].x,this.bottom),this.walkLine(t,d.slice(p,d.length),!0,this.bottom),t.closePath(),this.isSeries?(_=t.createLinearGradient(0,0,0,this.bottom),_.addColorStop(0,this.color1),_.addColorStop(1,this.color2),t.fillStyle=_,this._simpleMode=!0):t.fillStyle=c,t.fill()}t.lineWidth=this.lineWidth,r.prototype.draw.call(this,t)}}},e.PaneRendererArea=TradingView.PaneRendererArea=o},function(t,e,i){"use strict";function o(t){this.bars=t.bars,this.barSpacing=t.barSpacing,this.barWidth=n.optimalBarWidth(t.barSpacing),this.barLineWidth=Math.max(1,Math.round(this.barWidth)),this.dontDrawOpen=t.dontDrawOpen}var n=i(69),r=i(4);o.prototype.draw=function(t){var e,i,o;for(t.save(),t.translate(.5,.5),i=0;i<this.bars.length;++i)o=this.bars[i],e!==o.color&&(t.fillStyle=o.color,e=o.color),t.fillRect(Math.round(o.time-this.barLineWidth/2),Math.round(o.high-this.barWidth/2),Math.round(this.barLineWidth),Math.round(o.low-o.high+this.barWidth)),this.barLineWidth<this.barSpacing-1&&(this.dontDrawOpen||t.fillRect(Math.round(o.time-1.5*this.barWidth),Math.round(o.open-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)),t.fillRect(Math.round(o.time),Math.round(o.close-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)));t.restore()},o.prototype.hitTest=function(t){var e,i,o,s,a=this.bars,l=.5*this.barSpacing;if(0===a.length)return null;if(t.x<a[0].time-l)return null;if(t.x>a[a.length-1].time+l)return null;for(e=null,i=0;i<a.length;++i)if(o=a[i],t.x<=o.time+l){e=o;break}return s=n.selectionTolerance(this.barLineWidth),e&&e.high-s<=t.y&&t.y<=e.low+s?new r(r.REGULAR):null},e.PaneRendererBars=TradingView.PaneRendererBars=o},function(t,e,i){"use strict";function o(t){l.call(this,t),this.ch=t.char[0]||" ",this.fontFamily=t.fontFamily||"Arial",this._charCache=new a(this.ch,!1,!1,this.fontFamily,this.height)}var n=i(1).Point,r=i(69).selectionTolerance,s=i(4),a=i(408),l=i(84).PaneRendererAbstractShape;inherit(o,l),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a=this._vertOffset>0?1:-1;for(e=0,i=this.items.length;e<i;e++)o=this.items[e],n=o.x,
r=o.y+this._vertOffset-a*Math.round(this.height/2),s=o.style&&null!=o.style.color?o.style.color:this._color,this._charCache.paintTo(t,s,n,r,"center",this._vertOffset>0?"middle":"bottom")},o.prototype.hitTest=function(t){var e,i,o,a=this._vertOffset,l=r(this.height);for(e=0;e<this.items.length;++e)if((i=this.items[e])&&(o=new n(i.x,i.y+a),o.subtract(t).length()<=l))return new s(s.REGULAR);return null},e.PaneRendererUnicodeChar=TradingView.PaneRendererUnicodeChar=o},function(t,e,i){"use strict";function o(t,e,i){this._textSizeCache=e,this._data=t,this._fontSize=t.fontsize?t.fontsize:t.fontSize?t.fontSize:12,this._lineSpacing="number"==typeof this._data.lineSpacing&&this._data.lineSpacing?this._data.lineSpacing:0,t.lines=this._lines=l.prototype.wordWrap.call(this,t.text,t.wordWrapWidth),this._hittest=i||new c(c.MOVEPOINT)}function n(){var t=document.createElement("canvas");t.width=0,t.height=0,r=t.getContext("2d"),t=null}var r,s=i(1).Point,a=i(49).pointInRectangle,l=i(27).TextRenderer,c=i(4),h={priceRange:{width:15,height:14,
data:[134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]},barsRange:{width:16,height:15,
data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},angle:{width:14,height:12,
data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]}};o.prototype._preRender=function(){var t,e,i,o,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C;if(!this._preRendered){if(r||n(),t=this._data.points[0].x+(this._data.offsetX||0),e=t,i=this._data.points[0].y+(this._data.offsetY||0),o=i,a=this._fontSize,l=this._lineSpacing,c=a+l,h=c*this._lines.length-l,r.textBaseline="top",r.font=this.fontStyle(),u=[],this._data.wordWrapWidth)for(d=this._data.wordWrapWidth,p=0;p<this._lines.length;p++)u.push(this._data.wordWrapWidth);else for(d=0,p=0;p<this._lines.length;p++)_=r.measureText(this._lines[p]).width,u.push(_),d=Math.max(d,_);if(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){f={top:this._data.paddingTop||0,right:this._data.paddingRight||0,bottom:this._data.paddingBottom||0,left:this._data.paddingLeft||0},m={x:0,y:0},this._data.backgroundHorzInflate&&(g=this._data.backgroundHorzInflate/2,f.left+=g,f.right+=g,m.x=-g),this._data.backgroundVertInflate&&(v=this._data.backgroundVertInflate/2,f.top+=v,f.bottom+=v,m.y=-v),y="number"==typeof this._data.padding?this._data.padding:~~(a/6);for(p in f)f[p]||(f[p]=y);b={x:Math.floor(t+m.x),y:Math.floor(i+m.y),w:Math.ceil(d+f.left+f.right),h:Math.ceil(h+f.top+f.bottom)},e+=f.left+m.x,o+=f.top+m.y,"bottom"!==this._data.vertAlign&&"middle"!==this._data.vertAlign||(S="middle"===this._data.vertAlign?i-b.h/2:i-b.h-(b.y-i),w=S-b.y,o+=w,b.y=S),
"right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(T="center"===this._data.horzAlign?t-b.w/2:t-b.w-(b.x-t),x=T-b.x,e+=x,b.x=T,!0!==this._data.doNotAlignText&&("right"===this._data.horzAlign?(r.textAlign="end",e+=d):(r.textAlign="center",e+=d/2))),b.w%2!=0&&b.w++,b.x+=.5,b.y+=.5,this._boundingRect=[new s(b.x,b.y),new s(b.x+b.w,b.y+b.h)],this._rect=b,this._padding=f,this._defaultPadding=y}else"bottom"!==this._data.vertAlign&&"middle"!==this._data.vertAlign||(o-=Math.round(h*("middle"===this._data.vertAlign?.5:1))),C=e,"right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(C-=Math.round(d*("center"===this._data.horzAlign?.5:1))),this._boundingRect=[new s(C,o),new s(C+d,o+h)];this._textPoint={x:e,y:o},this._textSizeCache&&(this._textSizeCache.widths=u),this._preRendered=!0,this._maxWidth=d}},o.prototype._drawIcon=function(t,e,i,o){var n,r,s,a;if(h.hasOwnProperty(o)){if(n=h[o],!n.src){for(n.src=document.createElement("canvas"),n.src.width=n.width,n.src.height=n.height,r=n.src.getContext("2d"),s=r.createImageData(n.width,n.height),a=0;a<n.data.length;a++)s.data[a]=n.data[a];r.putImageData(s,0,0)}t.drawImage(n.src,e,i)}},o.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u;if(0!==this._data.points.length){for(this._preRender(),e=this._fontSize,i=this._lineSpacing,o=e+i,t.textBaseline="top",t.font=this.fontStyle(),n=this._rect,(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth)&&this._rect?("right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||!0!==this._data.doNotAlignText&&(t.textAlign="right"===this._data.horzAlign?"end":"center"),this._data.backgroundRoundRect?(t.roundRect(n.x,n.y,n.w,n.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.globalAlpha=this._data.backgroundTransparency,t.fill(),t.globalAlpha=1),this._data.borderColor&&(r="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(e/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=r,t.stroke())):(this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.globalAlpha=this._data.backgroundTransparency,t.fillRect(n.x,n.y,n.w,n.h),t.globalAlpha=1),this._data.borderColor?(r="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(e/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=r,t.strokeRect(n.x-r/2,n.y-r/2,n.w+r,n.h+r)):this._data.highlightBorder&&(t.strokeStyle=this._data.color,t.lineWidth=1,t.beginPath(),l=[3,1],t.dashedLineTo(n.x-.5,a=n.y-.5,s=n.x+n.w+.5,a,l),t.dashedLineTo(s,a,s,a=n.y+n.h+.5,l),t.dashedLineTo(s=n.x-.5,a,n.x+n.w+.5,a,l),t.dashedLineTo(s,n.y-.5,s,a,l),t.globalAlpha=.5,t.stroke(),t.globalAlpha=1)),this._data.icons&&this._data.icons.forEach(function(e,i){var r=n.x+this._defaultPadding,s=n.y+this._padding.top+o*i;this._drawIcon(t,r,s,e)
},this)):"right"===this._data.horzAlign?t.textAlign="end":"center"===this._data.horzAlign&&(t.textAlign="center"),c=this._textPoint.x,h=this._textPoint.y,t.fillStyle=this._data.color,u=0;u<this._lines.length;u++)t.fillText(this._lines[u],c,h),h+=o;return{width:n.w+2}}},o.prototype.hitTest=function(t){return 0===this._data.points.length?null:(this._preRender(),this._boundingRect&&a(t,this._boundingRect[0],this._boundingRect[1])?this._hittest:null)},e.TrendLineStatsRenderer=o},function(t,e){"use strict";t.exports=function(t,e){var i,o=10,n=t%o;for(n&&(t=t-n+o),i=[];t<=e;t+=o)i.push(t);return i}},function(t,e,i){"use strict";function o(t,e){this.m_series=t,this.m_model=e,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=P.enabled("source_selection_markers")}function n(t,e){o.call(this,t,e)}function r(t,e){o.call(this,t,e)}function s(t,e){o.call(this,t,e)}function a(t,e){o.call(this,t,e)}function l(t,e,i){this.m_series=t,this.m_priceSource=e,this.m_model=i,this.m_items=[],this._barGetter={open:function(t){return t[TradingView.OPEN_PLOT]},high:function(t){return t[TradingView.HIGH_PLOT]},low:function(t){return t[TradingView.LOW_PLOT]},close:function(t){return t[TradingView.CLOSE_PLOT]},hl2:function(t){return(t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT])/2},hlc3:function(t){return(t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT]+t[TradingView.CLOSE_PLOT])/3},ohlc4:function(t){return(t[TradingView.OPEN_PLOT]+t[TradingView.HIGH_PLOT]+t[TradingView.LOW_PLOT]+t[TradingView.CLOSE_PLOT])/4}}[this.m_priceSource]}function c(t,e,i){l.call(this,t,e,i),this._invaidated=!0}function h(t,e,i){l.call(this,t,e,i),this._invaidated=!0}function u(t,e,i){l.call(this,t,e,i),this._invaidated=!0,this._renderer=new b}function d(t,e){this._source=t,this._model=e,this._points=[new p(0,0)],this._invalidated=!0,this._renderer=new S;var i={cursorType:L.VerticalResize,pressedMouseMoveHandler:function(t){var e,i,o,n,r=this._source.priceScale();null!==r&&(e=this._source.properties().baselineStyle,i=r.height(),o=100-t.y/i*100,n=o<0?0:Math.round(10*o)/10,e.baseLevelPercentage.setValue(Math.max(Math.min(n,100),0)))}.bind(this)};this._renderer.setHitTest(new f(f.CUSTOM_MOVE,i))}var p=i(1).Point,_=i(74).SelectionRenderer,f=i(4),m=i(421).PaneRendererBars,g=i(212).PaneRendererLine,v=i(420).PaneRendererArea,y=i(279).PaneRendererCandles,b=i(1139).PaneRendererBaseline,S=i(122).HorizontalLineRenderer,w=i(8).CompositeRenderer,T=i(424),x=i(19),C=i(42).PlotRowSearchMode,P=i(7),L=i(490).PaneCursorType;o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,_,m,g=this;if(this.m_bars=[],!this.m_model.timeScale().isEmpty()&&!this.m_series.priceScale().isEmpty()&&null!==(t=this.m_model.timeScale().visibleBars())&&0!==this.m_series.bars().size()){for(e=this.m_series.nearestIndex(t.firstBar(),C.NearestRight),i=this.m_series.nearestIndex(t.lastBar(),C.NearestLeft);e<=i&&null===this.m_series.bars().valueAt(e);e++);if(!(e>i)&&(t=this.m_series.bars().range(e,i),n=this.m_series.priceScale(),
r=n.properties().percentage.value(),s=this.m_series.barColorer(),a={},t.each(function(t,e){var i,n;void 0!==e[TradingView.OPEN_PLOT]&&void 0!==e[TradingView.HIGH_PLOT]&&void 0!==e[TradingView.LOW_PLOT]&&void 0!==e[TradingView.CLOSE_PLOT]&&(void 0===o&&(o=e[TradingView.CLOSE_PLOT]),i={},i.time=Math.round(t),r?(i.open=100*(e[TradingView.OPEN_PLOT]-o)/o,i.high=100*(e[TradingView.HIGH_PLOT]-o)/o,i.low=100*(e[TradingView.LOW_PLOT]-o)/o,i.close=100*(e[TradingView.CLOSE_PLOT]-o)/o):(i.open=e[TradingView.OPEN_PLOT],i.high=e[TradingView.HIGH_PLOT],i.low=e[TradingView.LOW_PLOT],i.close=e[TradingView.CLOSE_PLOT]),a.value=e,n=e[TradingView.STYLE_PLOT]?e[TradingView.STYLE_PLOT]:s.barStyle(t,!1,a),e[TradingView.STYLE_PLOT]=n,a.previousValue=e,i.color=n.barColor,i.borderColor=n.barBorderColor,i.wickColor=n.barWickColor,i.hollow=n.isBarHollow,g.m_bars.push(i))},this),n.barPricesToCoordinates(this.m_bars),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_series===this.m_model.selectedSource()))for(l=T(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=f.REGULAR,c=0;c<l.length;c++)h=l[c],null!==(u=this.m_series.bars().valueAt(h))&&(d=.5*(u[TradingView.OPEN_PLOT]+u[TradingView.CLOSE_PLOT]),n.isPercentage()&&(d=100*(d-o)/o),_=this.m_model.timeScale().indexToCoordinate(h),m=this.m_series.priceScale().priceToCoordinate(d),this._selectionData.points.push(new p(_,m)))}},o.prototype.items=function(){return this.m_bars},o.prototype.dump=function(){var t={};return t.bars=this.m_bars,t},inherit(n,o),n.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value(),e=new w,e.append(new m(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new _(this._selectionData)),e},inherit(r,o),r.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().candleStyle.drawWick.value(),t.drawBorder=this.m_series.properties().candleStyle.drawBorder.value(),t.borderColor=this.m_series.properties().candleStyle.borderColor.value(),t.wickColor=this.m_series.properties().candleStyle.wickColor.value(),e=new w,e.append(new y(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new _(this._selectionData)),e},inherit(s,o),s.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().haStyle.drawWick.value(),t.drawBorder=this.m_series.properties().haStyle.drawBorder.value(),t.borderColor=this.m_series.properties().haStyle.borderColor.value(),t.wickColor=this.m_series.properties().haStyle.wickColor.value(),e=new w,e.append(new y(t)),
this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new _(this._selectionData)),e},inherit(a,o),a.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().hollowCandleStyle.drawWick.value(),t.drawBorder=this.m_series.properties().hollowCandleStyle.drawBorder.value(),t.borderColor=this.m_series.properties().hollowCandleStyle.borderColor.value(),t.wickColor=this.m_series.properties().hollowCandleStyle.wickColor.value(),e=new w,e.append(new y(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new _(this._selectionData)),e},l.prototype.update=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,_;if(this.m_items=[],!this.m_model.timeScale().isEmpty()&&this.m_series.priceScale()&&!this.m_series.priceScale().isEmpty()&&null!==(t=this.m_model.timeScale().visibleBars())&&0!==this.m_series.bars().size()&&(e=this.m_series.nearestIndex(t.firstBar(),C.NearestRight),i=this.m_series.nearestIndex(t.lastBar(),C.NearestLeft),t=this.m_series.bars().range(e,i),n=this.m_series.priceScale(),r={color:this.m_series.properties().lineStyle.color.value()},s=n.properties().percentage.value(),t.each(function(t,e){var i,n=this._barGetter(e);return void 0!==n&&null!==n&&(void 0===o&&(o=n),s&&(n=100*(n-o)/o),i=new p(t,n),i.style=r,this.m_items.push(i),!1)}.bind(this)),n.pointsArrayToCoordinates(this.m_items),this.m_model.timeScale().indexesToCoordinates(this.m_items),this.m_series===this.m_model.selectedSource()))for(a=T(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=f.REGULAR,l=0;l<a.length;l++)c=a[l],h=this.m_series.data().valueAt(c),u=this._barGetter(h),n.isPercentage()&&(u=100*(u-o)/o),d=this.m_model.timeScale().indexToCoordinate(c),_=this.m_series.priceScale().priceToCoordinate(u),this._selectionData.points.push(new p(d,_))},inherit(c,l),c.prototype.update=function(){this._invalidated=!0},c.prototype.renderer=function(){var t,e,i,o;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t=this.m_series.properties().lineStyle,e={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:t.color.value(),lineStyle:t.linestyle.value(),withMarkers:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,withSteps:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP,lineWidth:t.linewidth.value(),simpleMode:!0},i=new g(e),this.m_series===this.m_model.selectedSource()?(o=new w,o.append(i),this._isMarkersEnabled&&o.append(new _(this._selectionData))):o=i,o},inherit(h,l),h.prototype.update=function(){this._invalidated=!0},h.prototype.renderer=function(){var t,e,i;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t={},t.simpleMode=!1,t.barSpacing=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.lineColor=this.m_series.properties().areaStyle.linecolor.value(),t.lineStyle=this.m_series.properties().areaStyle.linestyle.value(),
t.lineWidth=this.m_series.properties().areaStyle.linewidth.value(),e=this.m_series.properties().areaStyle.transparency.value(),t.isSeries=!0,t.color1=x.generateColor(this.m_series.properties().areaStyle.color1.value(),e),t.color2=x.generateColor(this.m_series.properties().areaStyle.color2.value(),e),t.bottom=this.m_series.priceScale().height(),i=new w,i.append(new v(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&i.append(new _(this._selectionData)),i},inherit(u,l),u.prototype.update=function(){this._invalidated=!0},u.prototype._updateImpl=function(){var t,e;l.prototype.update.call(this),t=this.m_series.properties().baselineStyle,e=t.transparency.value(),this._topFillColor1=x.generateColor(t.topFillColor1.value(),e),this._topFillColor2=x.generateColor(t.topFillColor2.value(),e),this._bottomFillColor1=x.generateColor(t.bottomFillColor1.value(),e),this._bottomFillColor2=x.generateColor(t.bottomFillColor2.value(),e),this._topLineColor=t.topLineColor.value(),this._bottomLineColor=t.bottomLineColor.value(),this._topLineWidth=t.topLineWidth.value(),this._bottomLineWidth=t.bottomLineWidth.value(),this._barSpacing=this.m_model.timeScale().barSpacing(),this._bottom=this.m_series.priceScale().height(),this._baseLevelCoordinate=Math.round(this._bottom*(Math.abs(100-t.baseLevelPercentage.value())/100))},u.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData({items:this.m_items,topFillColor1:this._topFillColor1,topFillColor2:this._topFillColor2,bottomFillColor1:this._bottomFillColor1,bottomFillColor2:this._bottomFillColor2,topLineColor:this._topLineColor,bottomLineColor:this._bottomLineColor,topLineWidth:this._topLineWidth,bottomLineWidth:this._bottomLineWidth,lineStyle:CanvasEx.LINESTYLE_SOLID,barSpacing:this._barSpacing,baseLevelCoordinate:this._baseLevelCoordinate,bottom:this._bottom});var t=new w;return t.append(this._renderer),this.m_series===this.m_model.selectedSource()&&t.append(new _(this._selectionData)),t},d.prototype.update=function(){this._invalidated=!0},d.prototype._updateImpl=function(t){var e=this._source.properties().baselineStyle,i=Math.abs(100-e.baseLevelPercentage.value());this._visible=!0,this._points=[new p(0,Math.round(t*(i/100)))],this._color=e.baselineColor.value()},d.prototype.renderer=function(t){return this._invalidated&&(this._updateImpl(t),this._invalidated=!1),this._renderer.setData({visible:this._visible,width:this._model.timeScale().width(),height:t,points:this._points,color:this._color,linewidth:1,linestyle:CanvasEx.LINESTYLE_SPARSE_DOTTED}),this._renderer},e.SeriesBarsPaneView=n,e.SeriesCandlesPaneView=r,e.SeriesHollowCandlesPaneView=a,e.SeriesLinePaneView=c,e.SeriesAreaPaneView=h,e.SeriesHeikenAshiPaneView=s,e.SeriesBaselinePaneView=u,e.SeriesBaselineLinePaneView=d},function(t,e){"use strict";function i(t){this._props=t,this._text="",this._size="12px",this._bold=!1}i.prototype.text=function(){return this._text},i.prototype.setText=function(t){this._text=t},i.prototype.color=function(){
return this._props?this._props.scalesProperties.textColor.value():"#4a4a4a"},i.prototype.bold=function(){return this._bold},i.prototype.size=function(){return this._size},t.exports=i},function(t,e,i){"use strict";function o(t){this._studyId=t,this._maxToVers=n.ZERO,this._maxFromVers=n.ZERO,this._migrs=[]}var n=i(470).Version,r=i(13).getLogger("Chart.StudyMigration");o.prototype.addMigration=function(t,e,i){var o=n.parse(t),r=n.parse(e);o.isGreater(this._maxFromVers)&&(this._maxFromVers=o),r.isGreater(this._maxToVers)&&(this._maxToVers=r),this._migrs.push({fromVers:o,toVers:r,rules:i})},o.prototype.updateInputs=function(t,e,i){var o,n,s;if(!i)return i;for(o=TradingView.clone(i),n=t;n.isLess(e)&&null!=(s=this._findMigration(n));){if(r.logNormal("Migrating study inputs from "+s.fromVers+" to "+s.toVers+" version, studyId: "+this._studyId+", migration: "+JSON.stringify(s)+", inputs: "+JSON.stringify(i)),o=this._applyMigration(o,s),!n.isLess(s.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");n=s.toVers}return n>t&&r.logNormal("Study inputs migration is done, studyId: "+this._studyId+", inputs: "+JSON.stringify(o)),o},o.prototype._findMigration=function(t){var e,i,o=-1,n=this._maxFromVers;for(e=0;e<this._migrs.length;e++)i=this._migrs[e],i.fromVers.isLess(t)||i.fromVers.isLessOrEqual(n)&&(n=i.fromVers,o=e);return o<0?null:this._migrs[o]},o.prototype._applyMigration=function(t,e){var i,o,n,r=t;for(i=0;i<e.rules.length;i++)o=e.rules[i],n=this._getApplyRuleFun(o.type),r=n(r,o);return r},o.prototype._getApplyRuleFun=function(t){if("inputRemoved"===t)return o._applyInputRemovedRule;if("inputChangedType"===t)return o._applyInputChangedTypeRule;if("inputChangedMinMax"===t)return o._applyInputChangedMinMaxRule;if("inputChangedOptions"===t)return o._applyInputChangedOptionsRule;throw Error("Unknown migration rule type: "+t)},o._applyInputRemovedRule=function(t,e){if(!(e.inputId in t))return t;if("removeVal"!==e.action)throw Error("Unexpected rule.action="+e.action+" in rule.type="+e.type);var i=t[e.inputId];return delete t[e.inputId],r.logNormal("Input "+e.inputId+"="+i+" removed"),t},o._applyInputChangedTypeRule=function(t,e){var i=t[e.inputId];if("resetToDefVal"===e.action)return t[e.inputId]=e.defVal,r.logNormal("Input "+e.inputId+"="+i+" reset to default value "+e.defVal),t;if("convertVal"===e.action){if(null==i)return t;if("float"===e.inputTypeFrom&&"integer"===e.inputType)return t[e.inputId]=Math.round(t[e.inputId]),r.logNormal("Input "+e.inputId+"="+i+" converted to value "+t[e.inputId]),t;if("integer"===e.inputTypeFrom&&"float"===e.inputType)return t;if("text"===e.inputTypeFrom&&"source"===e.inputType)return o._isValidSource(i,e.options)?t:(t[e.inputId]=e.defVal,t);throw Error("Cannot convertVal from "+e.inputTypeFrom+" to "+e.inputType)}throw Error("Unknown action "+e.action+" for rule with type "+e.type)},o._isValidSource=function(t,e){return t.indexOf("$")>=0||e.indexOf(t)>=0},o._applyInputChangedMinMaxRule=function(t,e){
if("adjustValIfNeeded"!==e.action)throw Error("Unknown action "+e.action+" for rule with type "+e.type);var i=t[e.inputId];return i<e.minVal?t[e.inputId]=e.minVal:i>e.maxVal&&(t[e.inputId]=e.maxVal),r.logNormal("Input "+e.inputId+"="+i+" adjusted to value "+t[e.inputId]),t},o._applyInputChangedOptionsRule=function(t,e){if(!(["text"].indexOf(e.inputType)>=0&&"resetToDefValIfNeeded"===e.action))throw Error("Unexpected rule.inputType="+e.inputType+" in rule.action="+e.action);var i=t[e.inputId];return e.options.indexOf(i)<0&&(t[e.inputId]=e.defVal,r.logNormal("Input "+e.inputId+"="+i+" reset to default value "+e.defVal)),t},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this._study=t,this._series=e,this._model=i,this._invalidated=!0,this._orderArrow={vMargin:o.DEFAULT_ORDER_ARROW_VMARGIN,width:o.DEFAULT_ORDER_ARROW_WIDTH,height:o.DEFAULT_ORDER_ARROW_HEIGHT},this._exitLineWidth=o.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH,this._priceArrow={width:o.DEFAULT_PRICE_ARROW_WIDTH,height:o.DEFAULT_PRICE_ARROW_HEIGHT},this._text={vMargin:o.DEFAULT_TEXT_VMARGIN,font:o.DEFAULT_FONT,fontSize:o.DEFAULT_FONT_SIZE},this._checkHideTextIfBarSpacingLT=o.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT,this._textIsVisible=!0,this._colors={entryBuy:o.DEFAULT_ENTRY_BUY_COLOR,entrySell:o.DEFAULT_ENTRY_SELL_COLOR,exit:o.DEFAULT_EXIT_COLOR},this._items={entryBuy:[],entrySell:[],exit:[]},this._textWidths={},this._study.properties().strategy.orders.subscribe(this,this.update)}var n=i(1).Point,r=i(963).PaneRendererStudyStrategyOrders,s=i(8).CompositeRenderer,a=i(42).PlotRowSearchMode;o.DEFAULT_ORDER_ARROW_VMARGIN=7,o.DEFAULT_ORDER_ARROW_WIDTH=9,o.DEFAULT_ORDER_ARROW_HEIGHT=11,o.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH=2,o.DEFAULT_PRICE_ARROW_WIDTH=5,o.DEFAULT_PRICE_ARROW_HEIGHT=9,o.DEFAULT_TEXT_VMARGIN=2,o.DEFAULT_FONT="Arial",o.DEFAULT_FONT_SIZE=10,o.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT=10,o.DEFAULT_ENTRY_BUY_COLOR="#008fff",o.DEFAULT_ENTRY_SELL_COLOR="#f00",o.DEFAULT_EXIT_COLOR="#cc47ed",o.prototype._updateImpl=function(){var t,e,i,o,r,s,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L;if(this.clearItems(),(t=this._study.ordersData())&&t.length&&(e=this._model.timeScale(),i=this._series.priceScale(),!(!e||!i||e&&e.isEmpty()||i&&i.isEmpty())&&null!==(o=e.visibleBars()))){for(r=this._study.barsIndexes(),s=this._series.nearestIndex(o.firstBar(),a.NearestRight),l=this._series.nearestIndex(o.lastBar(),a.NearestLeft),c=s,h=[],u=[];c<=l;c++)for(d=-1;-1!==(d=r.indexOf(c,d+1));)(p=t[d])&&(h.push(p),u.push(c));for(_=this._study.properties(),f=_.strategy.orders.showLabels.value(),m=_.strategy.orders.showQty.value(),g=f||m,g&&e.barSpacing()<this._checkHideTextIfBarSpacingLT&&this._orderArrow.width*h.length*2>e.width()&&(g=!1),v=g&&this._text.fontSize+this._text.vMargin||0,y=v&&v*(f+m),b=0,S={upper:[],lower:[]};b<h.length;b++)p=h[b],d=u[b],w=e.indexToCoordinate(d,!0),T=i.priceToCoordinate(this._series[p.b?"low":"high"](d),!0),x=p.b?"lower":"upper",C="number"==typeof S[x][d]&&S[x][d]||0,T+=p.b?C:-C,"number"!=typeof S[x][d]&&(S[x][d]=0),
S[x][d]+=(p.e?0:this._exitLineWidth)+this._orderArrow.vMargin+this._orderArrow.height+y,P=i.priceToCoordinate(p.p,!0),L=p.e?!p.b&&p.e?"entrySell":"entryBuy":"exit",this._items[L].push({orderPoint:new n(w,T),pricePoint:new n(w,P),label:f&&(p.c||p.id||"Untitled")||null,qty:m&&(p.b?"+":"-")+~~p.q||null,pos:x});this._textLabelIsVisible=f,this._textQtyIsVisible=m,this._textIsVisible=g}},o.prototype.update=function(){this._invalidated=!0},o.prototype.clearItems=function(){this._items.entryBuy.length=this._items.entrySell.length=this._items.exit.length=0},o.prototype.renderer=function(){var t,e,i,o=this._study.properties();if(o.visible.value()&&o.strategy.orders.visible.value()&&(t=this._series.priceScale(),(this._invalidated||t&&t.isScaled())&&(this._updateImpl(),this._invalidated=!1),this._items.entryBuy.length||this._items.entrySell.length||this._items.exit.length)){e=new s;for(i in this._items)this._items[i].length&&e.append(new r({items:this._items[i],color:this._colors[i],orderArrow:this._orderArrow,exitLineWidth:"exit"===i&&this._exitLineWidth||0,priceArrow:this._priceArrow,text:this._textIsVisible&&this._text||null},this._textWidths));return e}},t.exports=o},function(t,e,i){"use strict";function o(t){return t+"("+new Date(1e3*t).toUTCString()+")"}function n(t){var e,i,o,n;return t+="",e=t.slice(0),i=!1,o=e[e.length-1],-1==="DWM".indexOf(o)&&"S"!==o&&(i=!0,o=""),n=parseInt(i?e:e.length>1?e.slice(0,e.length-1):1),{resolution:o,interval:n}}var r,s=i(82),a=i(67),l=i(57).Interval,c=!1,h=null,u=0,d=function(t,e){this._session=new s.Session,this._session.init(t.timezone,t.session),this._symbolInfo=t,this._resolution=e,this._extrapolatedData=[],this._modelId=u++,this._valid=!!t.timezone&&!!t.session,c&&console.log('Created model "{0}", interval "{1}", session "{2}", tz "{3}"'.format(this._modelId,this._resolution,t.session,t.timezone))};d.prototype.uniqueId=function(){return this._modelId},d.prototype.isValid=function(){return this._valid},d.prototype._barBuilder=function(){if(!this._builderCache){var t=n(this._resolution);this._builderCache=s.newBarBuilder(t.resolution,t.interval,this._session,this._session)}return this._builderCache},d.prototype.distance=function(t,e){var i,n,r,a,l;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||1e3*e>n)&&(r=500,a=s.extrapolateBarsFrontToTime(this._barBuilder(),n||1e3*t,1e3*e,r),this._extrapolatedData=this._extrapolatedData.concat(a)),(n=this._extrapolatedData[this._extrapolatedData.length-1])<1e3*e?{success:!1}:(l=this._extrapolatedData.indexOf(1e3*e),-1!==l?(c&&console.log('Model "{0}" "{1}", distance between "{2}" and "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),o(e),l)),{success:!0,result:l}):{success:!1})):{success:!1}},d.prototype.projectTime=function(t,e){var i,n,r,a
;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||e>=this._extrapolatedData.length)&&(r=s.extrapolateBarsFrontByCount(this._barBuilder(),n||1e3*t,e-this._extrapolatedData.length+1),this._extrapolatedData=this._extrapolatedData.concat(r)),e<this._extrapolatedData.length?(a=this._extrapolatedData[e]/1e3,c&&console.log('Model "{0}" "{1}", proj.time from "{2}" offset "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),e,o(a))),a):t):t},r=function(t,e){this._source=t,this._target=e,this._isSessionTheSame=t._symbolInfo.timezone===e._symbolInfo.timezone&&t._symbolInfo.session===e._symbolInfo.session,this._isResolutionTheSame=t._resolution===e._resolution,this._shouldCorrectTradingDay=l.isDWM(t._resolution)&&!this._isSessionTheSame,this._cache={},null===h&&(h=new s.Session,h.init("UTC","24x7"))},r.prototype._sourceTargetBuilder=function(){var t,e;return this._sourceTargetBuilderCache||(t=n(this._target._resolution),e=this._isSessionTheSame?this._target._session:h,this._sourceTargetBuilderCache=s.newBarBuilder(t.resolution,t.interval,this._target._session,e)),this._sourceTargetBuilderCache},r.prototype.sourceTimeToTargetTime=function(t){var e,i,n,r,s,l;return this._isSessionTheSame&&this._isResolutionTheSame?t:isNumber(t)&&this._source.isValid()&&this._target.isValid()?(e=this._cache[t],e||(i=1e3*t,this._shouldCorrectTradingDay&&(n=a.utc_to_cal(this._source._session.timezone,i),n=this._source._session.spec.correctTradingDay(n,this._source._session.timezone),r=new Date(n),a.set_hms(r,0,0,0,0),i=r.valueOf()),s=this._sourceTargetBuilder(),s.moveTo(i),l=s.indexOfBar(i),e=s.startOfBar(Math.max(0,l))/1e3,this._cache[t]=e),c&&console.log('Model "{0}" "{1}" sourceTime "{2}" => model "{3}" "{4}" targetTime "{5}"'.format(this._source.uniqueId(),this._source._resolution,o(t),this._target.uniqueId(),this._target._resolution,o(e))),e):t},t.exports.SyncPoint=r,t.exports.SyncModel=d},function(t,e,i){(function(t){TradingView.cleanButAmpersand=function(t,e){var i=e?["&amp;"]:["&"];return TradingView.clean(t,e,i)},TradingView.strip_tags=function(t){return t&&t.replace?t.replace(/(<([^>]+)>)/gi,""):t},TradingView.encodeSpread=function(t){return encodeURIComponent(t)},TradingView.clean=function(t,e,i){var o,n,r,s=[["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],["'","&#039;"],["'","&#39;"]],a=t;if(!t||!t.replace)return a;for(o=0;o<s.length;o++)n=s[o][0],r=s[o][1],i&&i.indexOf&&-1!==i.indexOf(e?r:n)||(a=e?a.replace(RegExp(r,"g"),n):a.replace(RegExp(n,"g"),r));return a},void 0!==t&&t&&t.exports&&(t.exports={clean:TradingView.clean,cleanButAmpersand:TradingView.cleanButAmpersand})}).call(e,i(78)(t))},,function(t,e){"use strict";!function(t){if(document.createElement("canvas")&&document.createElement("canvas").getContext){var e=function(e){
var i=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/i}(document.createElement("canvas").getContext("2d"));e<=1||(t.hidpiCanvasRatio=e,function(t){var i,o=function(t,e){for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},n={fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all",drawImagePatchedSource:[1,2,3,4]};t.drawImagePatchedSource=t.drawImage,i=t.drawImage,t.drawImagePatchedSourceAndDest=function(t){var o,n=Array.prototype.slice.call(arguments);for(o=1;o<n.length;++o)n[o]&&(n[o]*=e);return n.length>5&&("width"in t&&(n[3]=Math.min(t.width,Math.max(1,n[3]))),"height"in t&&(n[4]=Math.min(t.height,Math.max(1,n[4])))),i.apply(this,n)},o(n,function(i,o){var n=t[o];t[o]=function(){var t,o;if("all"===i)for(o=[],t=arguments.length;0<t--;)o[t]=arguments[t]*e;else for(o=Array.prototype.slice.call(arguments),t=i.length;0<t--;)o[i[t]]&&(o[i[t]]=o[i[t]]*e);return n.apply(this,o)}}),t.drawImage=function(t){return function(){return arguments[0]instanceof HTMLCanvasElement?t.drawImagePatchedSourceAndDest.apply(this,arguments):t.drawImagePatchedSource.apply(this,arguments)}}(t),t.fillText=function(t){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=e,i[2]*=e,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i*e+o}),t.apply(this,i),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i/e+o})}}(t.fillText),t.strokeText=function(t){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=e,i[2]*=e,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i*e+o}),t.apply(this,i),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i/e+o})}}(t.strokeText)}(CanvasRenderingContext2D.prototype),function(t){t.getContext=function(t){return function(i){var o=t.call(this,i);return"2d"===i&&this.width!==Math.floor(parseInt(this.style.width)*e)&&(this.style.height=this.height+"px",this.style.width=this.width+"px",this.width*=e,this.height*=e),o}}(t.getContext)}(HTMLCanvasElement.prototype))}}(window)},,,function(t,e,i){(function(t,o,n){"use strict";function r(e){this._chartWidgetCollection=e,this._chartAboutToBeSavedDelegate=new t,this._chartSavedDelegate=new t,this._chartSizeLimitExceededDelegate=new t}function s(t,e,i,o){var r,s,a;o=o||{},r={wl:o.wl,images:JSON.stringify(t.images()),previews:o.previews,onWidget:o.onWidget},s=t.activeChartWidget.value().widgetCustomer(),s&&(r.customer=s),r.timezone=t.activeChartWidget.value()._properties.timezone.value(),window.urlParams&&window.urlParams.locale&&(r.language=urlParams.locale),a=n.enabled("charting_library_base")?o.snapshotUrl||"https://www.tradingview.com/snapshot/":"/snapshot/",$.post(a,r,function(t){t?e(t):i()}).fail(function(){
i()})}var a=i(161);r.prototype.chartAboutToBeSaved=function(){return this._chartAboutToBeSavedDelegate},r.prototype.chartSaved=function(){return this._chartSavedDelegate},r.prototype.chartSizeLimitExceeded=function(){return this._chartSizeLimitExceededDelegate},r.prototype.whenReadyToSave=function(t){var e,i,o=this._chartWidgetCollection,n=o.activeChartWidget.value(),r=n.model().mainSeries();r.symbolInfo()&&!r.hasDelayedSymbolIntervalChange()?t():(e=null,i=null,e=function(){r.onSymbolError().unsubscribe(null,i,!0),t()},i=function(){r.onSymbolResolved().unsubscribe(null,e,!0)},r.onSymbolResolved().subscribe(null,e,!0),r.onSymbolError().subscribe(null,i,!0))},r.prototype.saveToJSON=function(){return this._fillSavingInfo(!1,!0)},r.prototype._fillAsyncInfo=function(t,e,i){function o(e){t.content=JSON.stringify($.extend(!0,r,e)),n.resolve(t)}var n,r=JSON.parse(t.content),s=this._chartWidgetCollection;return e||(i=!0),n=$.Deferred(),i?s.asyncState(!!e).then(o):s.activeChartWidget.value().asyncState(!!e).then(o),n.promise()},r.prototype._fillSavingInfo=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_;if(t||(e=!0),o={publish_request_id:Math.random().toString(36).substring(2)},n=this._chartWidgetCollection,r=n.activeChartWidget.value(),s=n.metaInfo,a=r.model().mainSeries(),l=a.properties(),c=a.symbolInfo(),s.id.value()&&(o.id=s.id.value()),o.name=s.name.value()||"",o.description=s.description.value()||"",o.resolution=a.properties().interval.value(),o.symbol_type=null!==c&&c.type||"",o.exchange=null!==c&&c.exchange||"",o.listed_exchange=null!==c&&c.listed_exchange||"",null!==c&&a.isSpread()?(h=c.legs[0],u=c.base_name[0],u=u.split(":")[1],o.symbol=h,o.short_name=u,o.expression=c.full_name):(o.symbol=null!==c&&c.ticker||l.symbol.value(),o.short_name=l.shortName.value()),null!==c){for(d=[],p=0,_=c.legs.length;p<_;p++)d.push({symbol:c.legs[p],pro_symbol:c.base_name[p]});o.legs=JSON.stringify(d)}else o.legs=JSON.stringify([]);return o.content=e?JSON.stringify(n.state(!!t,i)):JSON.stringify(r.state(!!t,i)),t&&(o.image=JSON.stringify(n.images({onlyActiveChart:!e}))),o.is_realtime=t?"0":"1",o},r.prototype.publishChart=function(t){},r.prototype.publishScript=function(t,e,i){var o,n,r,s,a=this;a._scriptPublisher?a._scriptPublisher.openPublication(t,e):(o=i.ScriptPublisher,n=i.ScriptsProvider,r=i.CategoriesProvider,s=new n({publish:function(t){return new Promise(function(e,i){var o={closeForm:function(){if(t&&t.scriptPublication&&t.scriptPublication.updateScriptIdPart){var i=t.scriptPublication.updateScriptIdPart;publishedScripts.invalidateCache([i]),window.studyMarket&&(window.studyMarket.resetAllPages(),window.studyMarket.updateFavorites())}e()},showError:function(t){i(t)}};a.onPublish(t,o)})}}),a._scriptPublisher=new o({scriptsProvider:s,categoriesProvider:new r}),a._scriptPublisher.openPublication(t,e))},r.prototype.onPublish=function(t,e){function i(i){var n,r,s,l,c,h;a.publishInProgress=!1,n=i.responseText||i,"ok:"===n.substr(0,3)?(r=!1,e.savePrivacySetting&&(r=!t.is_public,TVSettings.setValue("publishchart.private",r)),
kmRecord("Chart","{0} Published".format(void 0===t.script_type?"Chart":"Script"),{is_private:r}),s=n.substr(3),l=JSON.parse(s),a._chartWidgetCollection.metaInfo.id.value()||a._chartWidgetCollection.metaInfo.id.setValue(l.id),e.closeForm&&e.closeForm(),a._lastPublishUrl=l.publishUrl,a.hWnd&&(c=l.publishUrl,e.ideaUrl&&(c=o.render(e.ideaUrl,{idea:l.idea})),a.hWnd.location=c)):(e.showError&&((413===i.status||/^[\d\s]*request.+large/i.test(n.trim()))&&(n=window.t("This chart layout has a lot of objects and can't be published! Please remove some drawings and/or studies from this chart layout and try to publish it again.")),h={html:!0},e.showError(n||$.t("Error occured while publishing"),h)),a.hWnd&&(a.hWnd.close(),a.hWnd=null))}var n,r,s,a=this;a.publishInProgress||(n=a._fillSavingInfo(!0,e&&e.publishAllLayout,!0),a._fillAsyncInfo(n,!0,e&&e.publishAllLayout).then(function(e){var o=t.scriptPublication,n=!(!o||!o.updateScriptIdPart),r=new Promise(function(t,e){if(o){var i;i=n?ScriptLib.publishNext(o.scriptSource,o.updateScriptIdPart):ScriptLib.publishNew(o.scriptSource,o.scriptProtection),i.done(function(e){n||o.scriptProtection!==TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH||PinePerm.add(window.user.username,e.pineId),t(e.publishedstudyscript_id)}).fail(e)}else t()});n?r.then(function(o){var n={publishedstudyscript_id:o,description:t.description,tags:t.tags};$.ajax({url:"/script-update/",type:"post",dataType:"text",data:$.extend({},e,n),complete:i})},i):r.then(function(o){o&&(t.publishedstudyscript_id=o),$.ajax({url:"/publishchart/",type:"post",dataType:"text",data:$.extend({},e,t),complete:i})},i)}),a.publishInProgress=!0,e.onWidget&&!e.ideaUrl||""!==t.name&&""!==t.description&&t.description.length<=4e3&&t.name.length<=64&&($.cookie("publish_request_id",n.publish_request_id,{path:"/"}),r="/loading/",e.ideaUrl&&(s=urlParams.createUrlParams({ideaUrl:e.ideaUrl}),r="/loading?"+s),a.hWnd=window.open(r,"_blank")))},r.prototype._saveChart=function(t,e,i,o,n){var r=i,s=o;return r=function(t){e.id.value()||(e.id.setValue(t),e.uid.setValue(t)),"function"==typeof i&&i()},a.saveChart(t.name,t.short_name,t.resolution,t,e,r,s.bind(this))},r.prototype.saveChartSilently=function(t,e,i,o){var n=this._chartWidgetCollection.metaInfo,r=this._fillSavingInfo(e);if(o=o||{},o.chartName&&(r.name=o.chartName),r.name&&0!==r.name.length||!o.defaultChartName||(r.name=o.defaultChartName),!r.name)return void console.warn("Saving chart with empty name is not allowed");$(window).on("beforeunload.savechart",function(){return $.t("Your chart is being saved, please wait a moment before you leave this page.")}),this._chartAboutToBeSavedDelegate.fire(),this._saveChart(r,n,function(){this._chartWidgetCollection.metaInfo.name.setValue(r.name),this._chartSavedDelegate.fire(!0),t&&t(n)}.bind(this),function(){this._chartSavedDelegate.fire(!1),i&&i.apply(null,arguments)}.bind(this),o),$(window).off("beforeunload.savechart")},e.ChartSaver=r,e.takeSnapshot=s}).call(e,i(20),i(54),i(7))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){"use strict";function i(t){
return t.replace(n,r)}function o(t){return void 0===t&&(t=""),t.replace(/(<([^>]+)>)/gi,"")}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),n=/[<"'&>]/g,r=function(t){return"&#"+t.charCodeAt(0)+";"},e.htmlEscape=i,e.removeTags=o},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(13),n=i(64),r=o.getLogger("GUI.Blocks.AbstractIndicator"),i(177),s=function(){function t(){this._classSuffix="",this._quoteSessionPrefix="abstract-indicator",this._shortMode=!1,this._showTooltip=!0,this._subscribed=!1}return t.prototype.getValue=function(){return this._value},t.prototype.getTooltipText=function(){return this.getLabel()},t.prototype.getLabel=function(){return this._labelMap[this.getValue()]||""},t.prototype.getElement=function(){return this._el},t.prototype.update=function(t,e){this._updateValue(t,e),this._render()},t.prototype.setTooltipEnabled=function(t){void 0===t&&(t=!1),this._showTooltip!==t&&(this._showTooltip=t,this._renderTooltip())},t.prototype.enableShortMode=function(){!0!==this._shortMode&&(this._shortMode=!0,this._render())},t.prototype.disableShortMode=function(){!1!==this._shortMode&&(this._shortMode=!1,this._render())},t.prototype.isShortModeEnabled=function(){return this._shortMode},t.prototype.start=function(){!this._subscribed&&t._quoteSession&&this._symbolName&&(t._quoteSession.subscribe(this._getQuoteSessionId(),this._symbolName,this.update.bind(this)),this._subscribed=!0)},t.prototype.stop=function(){this._subscribed&&t._quoteSession&&this._symbolName&&(t._quoteSession.unsubscribe(this._getQuoteSessionId(),this._symbolName),this._subscribed=!1)},t.assignQuoteSession=function(e){t._quoteSession=e},t.prototype._init=function(e){this._el=e.el?e.el:document.createElement("span"),this._el.innerHTML="",this._classMap=e.classMap,this._labelMap=e.labelMap,this._showTooltip=e.showTooltip,this._classSuffix=e.classSuffix,this._symbolName=e.symbol,this._quoteSessionGUID=n.guid(),!0===e.short&&this.enableShortMode(),e.data&&this._updateValue(e.data),e.quoteSession&&t.assignQuoteSession(e.quoteSession)},t.prototype._clearClasses=function(){var t=this;Object.values(this._classMap).map(function(e){t._el.classList.remove(""+e),t._el.classList.remove(""+e+t._classSuffix)})},t.prototype._render=function(){this._renderClasses(),this._renderTooltip(),this._renderLabel()},t.prototype._renderLabel=function(){this._el.textContent=this.getLabel()},t.prototype._updateValue=function(t,e){var i=this._getValueFromData(t);(e||i!==this.getValue())&&(this._value=i)},t.prototype._renderClasses=function(){this._clearClasses(),this._el.classList.add(this._componentClass),this._el.classList.add(""+this._componentClass+this._classSuffix);var t=this._classMap[this.getValue()];void 0!==t?(this._el.classList.add(""+t+this._classSuffix),this._el.classList.add(t)):void 0!==this.getValue()&&r.logWarn("no className for status "+this.getValue())},t.prototype._renderTooltip=function(){this._el.classList.add("apply-common-tooltip"),
this._el.setAttribute("title",this._showTooltip?this.getTooltipText():""),$(this._el).trigger("common-tooltip-update")},t.prototype._getQuoteSessionId=function(){return this._quoteSessionPrefix+"."+this._quoteSessionGUID},t}(),e.AbstractIndicator=s,window.AbstractIndicator=s},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={SELECT:"select",SELECT_CUSTOM:"selectCustom",AFTER_CLOSE_MENU:"afterCloseMenu",BEFORE_OPEN_MENU:"beforeOpenMenu"};e.events=i},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(21),n=function(){function t(t,e){this._major=t,this._minor=e}return t.prototype.major=function(){return this._major},t.prototype.minor=function(){return this._minor},t.prototype.isZero=function(){return 0===this._major&&0===this._minor},t.prototype.toString=function(){return this._major+"."+this._minor},t.prototype.compareTo=function(t){return this._major<t._major?-1:this._major>t._major?1:this._minor<t._minor?-1:this._minor>t._minor?1:0},t.prototype.isLess=function(t){return this.compareTo(t)<0},t.prototype.isLessOrEqual=function(t){return this.compareTo(t)<=0},t.prototype.isEqual=function(t){return 0===this.compareTo(t)},t.prototype.isGreater=function(t){return this.compareTo(t)>0},t.prototype.isGreaterOrEqual=function(t){return this.compareTo(t)>=0},t.parse=function(e){var i,n,r;if(e instanceof t)return new t(e.major(),e.minor());if("number"==typeof e)return o.assert(Math.floor(e)===e,"Version should not be a float number"),new t(e,0);if("string"==typeof e){if(i=e.split("."),1===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),new t(n,0);if(2===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),r=parseInt(i[1],10),o.assert(!isNaN(r),"Bad version string: "+e),new t(n,r);throw Error("Bad version string (one dot expected): "+e)}throw Error("Bad version: "+e)},t.ZERO=new t(0,0),t}(),e.Version=n},function(t,e,i){"use strict";function o(t){var e=t.action,i=t.isActive,o=t.isBgFull,a=t.isHidden,l=t.isTransparent,c=t.toolName;return n.createElement(s.ToolButton,{icon:r.lineToolsInfo[c].icon,isActive:i,isBgFull:o,isHidden:a,isTransparent:l,onClick:e,title:r.lineToolsInfo[c].localizedName})}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(93),s=i(227),e.ToolButtonAction=o},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(63),n=i(7),r=i(51),s=!n.enabled("hide_left_toolbar_by_default"),a=o.getBool("ChartDrawingToolbarWidget.visible",s),e.isDrawingToolbarVisible=new r(a)},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.supportedLineTools={cursor:{name:"cursor",onlySelectable:!0},dot:{name:"dot",onlySelectable:!0},arrow_cursor:{name:"arrow",onlySelectable:!0},eraser:{name:"eraser",onlySelectable:!0},measure:{name:"measure",onlySelectable:!0},zoom:{name:"zoom",onlySelectable:!0},brush:{name:"LineToolBrush",onlySelectable:!0},text:{name:"LineToolText",supportsText:!0},anchored_text:{
name:"LineToolTextAbsolute",supportsText:!0},note:{name:"LineToolNote",supportsText:!0},anchored_note:{name:"LineToolNoteAbsolute",supportsText:!0},callout:{name:"LineToolCallout",supportsText:!0},balloon:{name:"LineToolBalloon",supportsText:!0},arrow_up:{name:"LineToolArrowMarkUp",supportsText:!0},arrow_down:{name:"LineToolArrowMarkDown",supportsText:!0},arrow_left:{name:"LineToolArrowMarkLeft",supportsText:!0},arrow_right:{name:"LineToolArrowMarkRight",supportsText:!0},price_label:{name:"LineToolPriceLabel"},flag:{name:"LineToolFlagMark"},vertical_line:{name:"LineToolVertLine"},horizontal_line:{name:"LineToolHorzLine"},horizontal_ray:{name:"LineToolHorzRay"},trend_line:{name:"LineToolTrendLine"},trend_angle:{name:"LineToolTrendAngle"},arrow:{name:"LineToolArrow"},ray:{name:"LineToolRay"},extended:{name:"LineToolExtended"},parallel_channel:{name:"LineToolParallelChannel"},disjoint_angle:{name:"LineToolDisjointAngle"},flat_bottom:{name:"LineToolFlatBottom"},pitchfork:{name:"LineToolPitchfork"},schiff_pitchfork_modified:{name:"LineToolSchiffPitchfork"},schiff_pitchfork:{name:"LineToolSchiffPitchfork2"},inside_pitchfork:{name:"LineToolInsidePitchfork"},pitchfan:{name:"LineToolPitchfan"},gannbox:{name:"LineToolGannSquare"},gannbox_square:{name:"LineToolGannComplex"},gannbox_fan:{name:"LineToolGannFan"},fib_retracement:{name:"LineToolFibRetracement"},fib_trend_ext:{name:"LineToolTrendBasedFibExtension"},fib_speed_resist_fan:{name:"LineToolFibSpeedResistanceFan"},fib_timezone:{name:"LineToolFibTimeZone"},fib_trend_time:{name:"LineToolTrendBasedFibTime"},fib_circles:{name:"LineToolFibCircles"},fib_spiral:{name:"LineToolFibSpiral"},fib_speed_resist_arcs:{name:"LineToolFibSpeedResistanceArcs"},fib_wedge:{name:"LineToolFibWedge"},fib_channel:{name:"LineToolFibChannel"},xabcd_pattern:{name:"LineTool5PointsPattern"},cypher_pattern:{name:"LineToolCypherPattern"},abcd_pattern:{name:"LineToolABCD"},triangle_pattern:{name:"LineToolTrianglePattern"},"3divers_pattern":{name:"LineToolThreeDrivers"},head_and_shoulders:{name:"LineToolHeadAndShoulders"},elliott_impulse_wave:{name:"LineToolElliottImpulse"},elliott_triangle_wave:{name:"LineToolElliottTriangle"},elliott_triple_combo:{name:"LineToolElliottTripleCombo"},elliott_correction:{name:"LineToolElliottCorrection"},elliott_double_combo:{name:"LineToolElliottDoubleCombo"},cyclic_lines:{name:"LineToolCircleLines"},time_cycles:{name:"LineToolTimeCycles"},sine_line:{name:"LineToolSineLine"},long_position:{name:"LineToolRiskRewardLong"},short_position:{name:"LineToolRiskRewardShort"},forecast:{name:"LineToolPrediction"},date_range:{name:"LineToolDateRange"},price_range:{name:"LineToolPriceRange"},date_and_price_range:{name:"LineToolDateAndPriceRange"},bars_pattern:{name:"LineToolBarsPattern"},ghost_feed:{name:"LineToolGhostFeed"},projection:{name:"LineToolProjection"},rectangle:{name:"LineToolRectangle"},rotated_rectangle:{name:"LineToolRotatedRectangle"},ellipse:{name:"LineToolEllipse"},triangle:{name:"LineToolTriangle"},polyline:{name:"LineToolPolyline"},curve:{
name:"LineToolBezierQuadro"},double_curve:{name:"LineToolBezierCubic"},arc:{name:"LineToolArc"},icon:{name:"LineToolIcon"}}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),i(22),i(23),o=i(63),n=i(181),r=i(103),s=i(430),a=i(20),l=i(330),c=i(109),h=function(){function t(t,e,i){return void 0===i&&(i={}),this._container=$('<div class="favored-list-container">'),this._quickContainer=$('<div class="quick">').appendTo(this._container),this._onChange=new a,this._onSelect=new a,this._onResize=new a,this._onOpen=new a,this._active=null,this._data=[],this._list=[],this._quicks=[],this._options=i=i,this._name=t,i.addClass&&this._container.addClass(i.addClass),this._submenu=$('<span class="submenu">'+(this._options.submenuHtml||"")+'<div class="tv-caret"></div></span>').appendTo(this._container),i.tooltip&&(this._submenu.attr("title",i.tooltip),i.addTooltipClass&&this._submenu.addClass(i.addTooltipClass)),this._load(e),r.bindPopupMenu(this._container,null,{addClass:"narrow favored-list "+(i.popupAddClass||""),direction:"down",event:"popup-menu",popupSpacing:i.popupSpacing,reverse:!0,svg:null==i.svg||i.svg}),this._submenu.on("click",this.openMenu.bind(this)),n.TVXWindowEvents.on(t+"-change",this._onChangeInAnotherTab.bind(this)),this}return t.prototype.element=function(){return this._container},t.prototype.onChange=function(){return this._onChange},t.prototype.onSelect=function(){return this._onSelect},t.prototype.onResize=function(){return this._onResize},t.prototype.onOpen=function(){return this._onOpen},t.prototype.setValue=function(t){var e=this._getItemByValue(t);this._setActive(e)},t.prototype.value=function(){return this._active?this._active.data.value:void 0},t.prototype.removeById=function(t){var e=this,i=this._data.filter(function(e){return!e.separator&&e.id!==t});this._list.forEach(function(i){i.data.id===t&&e._toggleFavorite(i,!1)}),this.reload(i)},t.prototype.reload=function(t){this._quickContainer.empty(),this._load(t)},t.prototype.openMenu=function(){this._submenu.parent().hasClass("active")||this._onOpen.fire(),this._submenu.trigger("popup-menu",[this._data])},t.prototype._onChangeInAnotherTab=function(){this.reload(this._data)},t.prototype._load=function(t){var e=this;this._options.showJustDefaultQuicks?this._quicks=this._options.defaultFavorites||[]:this._options.notShowQuicks?this._quicks=[]:this._quicks=o.getJSON(this._name+".quicks",this._options.defaultFavorites||[]),this._list=[],t.filter(function(t){return!t.separator}).forEach(function(t,i){var o,n={data:t,drop:function(){n.data.drop&&n.data.drop()},favorite_button:null,index:i,isFavorite:function(){return e._quicks.indexOf(t.id)>-1},markFavorite:function(){n.toQuickButton&&n.toQuickButton.attr("title",$.t("Remove from favorites")).addClass("quicked")},svg:t.svg&&$(t.svg).clone(),toQuickButton:e._options.notShowQuicks?null:$('<span class="to-quick">').append($(l).attr({height:16,width:16})),toggleFavorite:function(t,i){var o=void 0!==t?t:!n.isFavorite();o?n.markFavorite():n.unmarkFavorite(),
e._toggleFavorite(n,o,i)},unmarkFavorite:function(){n.toQuickButton&&n.toQuickButton.attr("title",$.t("Add to favorites")).removeClass("quicked")}};n.data.toQuickButtonStyle&&n.toQuickButton&&n.toQuickButton.css(n.data.toQuickButtonStyle),e._list.push(n),t.action=e._change.bind(e,n),t.active=e._options.notShowActive?function(){return!1}:function(){return!(!e._active||n!==e._active)},t.buttons=[],e._options.notShowQuicks||t.buttons.push({el:n.toQuickButton,handler:function(t){n.toggleFavorite(),t.preventDefault(),t.stopPropagation()}}),n.data.drop&&(o=$("<span>").addClass("delete").attr("title",$.t("Delete")).html(c),e._options.notShowQuicks&&o.css("right","7px"),t.buttons.push({el:o,handler:function(t){n.drop(),t.stopPropagation()}})),n.toggleFavorite(n.isFavorite(),!0)}),this._data=t,this._options.notShowActive||this._addActive(this._list[0]),this._onResize.fire()},t.prototype._toggleFavorite=function(t,e,i){if(!this._options.notShowQuicks||this._options.showJustDefaultQuicks){if(e){t.favorite_button=this._createButton(t);var o=this._lastFavoriteButton(t);o?t.favorite_button.insertAfter(o.favorite_button):t.favorite_button.prependTo(this._quickContainer)}else i||this._removeButton(t);i||(e?-1===this._quicks.indexOf(t.data.id)&&this._quicks.push(t.data.id):this._quicks.indexOf(t.data.id)>-1&&this._quicks.splice(this._quicks.indexOf(t.data.id),1),this._saveFavorite(),this._markActive(),this._onResize.fire())}},t.prototype._lastFavoriteButton=function(t){for(var e=t.index-1;e>=0;e--)if(this._list[e]&&this._list[e].favorite_button)return this._list[e];return null},t.prototype._saveFavorite=function(){this._options.notShowQuicks||(o.setJSON(this._name+".quicks",this._quicks),n.TVXWindowEvents.emit(this._name+"-change"))},t.prototype._createButton=function(t){var e=this,i=t.data.favoriteButton,o=$("<span>").data("item",t);return i.addClass&&o.addClass(i.addClass),i.title&&o.prop("title",s.clean(i.title+"",!0)),t.svg&&$(t.svg).clone().appendTo(o),o.on("click",function(i){e._change(t),0===e._quicks.length&&e.openMenu(),i.preventDefault()}),o},t.prototype._removeButton=function(t){t.favorite_button&&(t.favorite_button.remove(),t.favorite_button=null)},t.prototype._markActive=function(t){var e,i,o=this;this._options.notShowActive||(e=null,this._active&&(t=this._active,t.isFavorite()?(i=this._quickContainer.find(".just_active"),this._btnToggleActiveView(i,!1)):(e=this._addActive(t),0!==this._quicks.length&&this._btnToggleActiveView(e,!0))),this._list.forEach(function(e){t!==e||0===o._quicks.length?o._btnToggleActiveView(e.favorite_button,!1):e.favorite_button&&o._btnToggleActiveView(t.favorite_button,!0)}),e&&e.hasClass("selected")?this._container.addClass("not-favored-active"):this._container.removeClass("not-favored-active"))},t.prototype._btnToggleActiveView=function(t,e){t&&(e?t.addClass("selected"):t.removeClass("selected"))},t.prototype._addActive=function(t){return this._quickContainer.find(".just_active").remove(),this._createButton(t).appendTo(this._quickContainer).addClass("just_active")},
t.prototype._setActive=function(t){return this._active!==t&&(this._active=t,this._markActive(),!0)},t.prototype._change=function(t){this._onSelect.fire(t.data.id),this._setActive(t)&&this._onChange.fire(t.data.id)},t.prototype._getItemByValue=function(t){var e,i,o;for(e=0,i=this._list;e<i.length;e++)if(o=i[e],o.data.id===t)return o;throw Error("undefined value "+t+" in FavoredList")},t}(),e.FavoredList=h},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),o=i(22),i(90),n=i(364),r=i(28),s=i(63),a=i(20),l=i(51),c=i(179),h=i(511),u='<div class="tv-floating-toolbar i-closed i-hidden">'+(Modernizr.touch?'<div class="tv-floating-toolbar__drag-ext js-drag"></div>':"")+'<div class="tv-floating-toolbar__widget-wrapper"><div class="tv-floating-toolbar__drag js-drag">'+h+'</div><div class="tv-floating-toolbar__content js-content"></div></div></div>',i(634),d=function(){function t(e){this._widget=document.createElement("div"),this._isVertical=!1,this._hiddingTimeoutId=null,this._visibility=new l(!1),this._windowResizeListener=this._onWindowResize.bind(this),this._reorderedDelegate=new a,t._toolbars.push(this),this._options=e,this._widget=o(u).get(0),this._content=this._widget.getElementsByClassName("js-content").item(0),this._setZIndex(t._startZIndex+t._toolbars.length-1),this._options.addClass&&(this._widget.className+=" "+this._options.addClass),this._options.layout&&"auto"!==this._options.layout&&(this._isVertical="vertical"===this._options.layout,this._updateLayoutType())}return t.prototype.destroy=function(){this.hide(!0),t._toolbars.splice(t._toolbars.indexOf(this),1),document.body.contains(this._widget)&&document.body.removeChild(this._widget),this._widget.innerHTML=""},t.prototype.isVisible=function(){return this._visibility.value()},t.prototype.visibility=function(){return this._visibility.readonly()},t.prototype.isVertical=function(){return this._isVertical},t.prototype.show=function(){var t=this;this.isVisible()||(document.body.contains(this._widget)||(this._init(),document.body.appendChild(this._widget)),this._setHiddingTimeout(null),window.addEventListener("resize",this._windowResizeListener),this.raise(),this._visibility.setValue(!0),this._widget.classList.contains("i-hidden")?(this._widget.classList.remove("i-hidden"),setTimeout(function(){t.isVisible()&&t._widget.classList.remove("i-closed")})):this._widget.classList.remove("i-closed"),this._onWindowResize())},t.prototype.hide=function(t){var e,i,o=this;void 0===t&&(t=!1),this.isVisible()&&(e=this._widget.classList.contains("i-closed"),this._widget.classList.add("i-closed"),this._visibility.setValue(!1),t||e?(this._setHiddingTimeout(null),this._widget.classList.add("i-hidden")):(i=setTimeout(function(){o._setHiddingTimeout(null),o._widget.classList.add("i-hidden")},this.hideDuration()),this._setHiddingTimeout(i)),window.removeEventListener("resize",this._windowResizeListener))},t.prototype.raise=function(){t._toolbars.length+t._startZIndex!==this._zIndex()&&(t._toolbars.splice(t._toolbars.indexOf(this),1),
t._toolbars.push(this),t._updateAllZIndexes())},t.prototype.hideDuration=function(){return.75*r.dur},t.prototype.addWidget=function(t,e){var i,o,n;if(void 0===e&&(e={}),i=this.widgetsCount(),void 0===e.index&&(e.index=i),e.index<0||e.index>i)throw Error("Index must be in [0, "+i+"]");o=document.createElement("div"),o.className="tv-floating-toolbar__widget js-widget",o.appendChild(t),n=e.index===i?null:this._content.childNodes.item(e.index),this._content.insertBefore(o,n),this._onWindowResize()},t.prototype.removeWidget=function(t){var e=this._findWrapperForWidget(t);e&&(this._content.removeChild(e),this._onWindowResize())},t.prototype.widgetsCount=function(){return this._content.childNodes.length},t.prototype.showWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.remove("i-hidden")},t.prototype.hideWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.add("i-hidden")},t.prototype.removeWidgets=function(){for(;this._content.firstChild;)this._content.removeChild(this._content.firstChild);this._onWindowResize()},t.prototype.onWidgetsReordered=function(){return this._reorderedDelegate},t.prototype.onContextMenu=function(t){var e,i=this;Modernizr.touch?(e=new n(this._widget),e.get("press").set({time:500}),e.on("press",function(e){i._preventWidgetTouchEndEvent(),t(e.srcEvent)})):this._widget.addEventListener("contextmenu",t)},t.prototype._determineCurrentLayoutVertical=function(t){var e=this._isVertical?t.height:t.width;return window.innerWidth<e},t.prototype._getWidget=function(){return this._widget},t.prototype._findWrapperForWidget=function(t){var e,i,o=this._content.getElementsByClassName("js-widget");for(e=0;e<o.length;++e)if(i=o.item(e),i.contains(t))return i;return null},t.prototype._onVerticalChanged=function(t,e){},t.prototype._setHiddingTimeout=function(t){null!==this._hiddingTimeoutId&&clearTimeout(this._hiddingTimeoutId),this._hiddingTimeoutId=t},t.prototype._preventWidgetTouchEndEvent=function(){var t=this,e=function(i){i.preventDefault(),t._widget.removeEventListener("touchend",e)};this._widget.addEventListener("touchend",e)},t.prototype._updateLayoutType=function(){this._widget.classList.toggle("i-vertical",this._isVertical)},t.prototype._onWindowResize=function(){var t,e;"auto"===(this._options.layout||"auto")&&(t=this._isVertical,e=this._getCorrectedWidgetRect(),this._isVertical=this._determineCurrentLayoutVertical(e),this._updateLayoutType(),t!==this._isVertical&&this._onVerticalChanged(this._isVertical,t)),this._checkPosition()},t.prototype._checkPosition=function(){var t=this._getCorrectedWidgetRect(),e={left:t.left,top:t.top};this._correctPosition(e),t.left===e.left&&t.top===e.top||(this._widget.style.left=e.left+"px",this._widget.style.top=e.top+"px")},t.prototype._correctPosition=function(t){var e=this._getCorrectedWidgetRect();t.left+e.width>window.innerWidth&&(t.left=Math.max(0,window.innerWidth-e.width)),t.top+e.height>window.innerHeight&&(t.top=Math.max(0,window.innerHeight-e.height)),t.left=Math.max(0,t.left),t.top=Math.max(0,t.top)},
t.prototype._setZIndex=function(t){this._widget.style.zIndex=t+""},t.prototype._zIndex=function(){return+this._widget.style.zIndex},t.prototype._loadPosition=function(){var t=s.getJSON(this._options.positionSettingsKey,this._options.defaultPosition);this._widget.style.left=Math.round(t.left)+"px",this._widget.style.top=Math.round(t.top)+"px",this._onWindowResize()},t.prototype._savePosition=function(){var t=this._widget.getBoundingClientRect();s.setJSON(this._options.positionSettingsKey,{left:t.left,top:t.top})},t.prototype._init=function(){this._loadPosition(),c.lazyJqueryUI(o(this._widget)).draggable({containment:"window",drag:this._onDragEvent.bind(this),handle:".js-drag",stop:this._savePosition.bind(this)}),this._options.allowSortable&&this._initSortable(),this._widget.addEventListener(Modernizr.touch?"touchstart":"mousedown",this.raise.bind(this))},t.prototype._onDragEvent=function(t,e){this._correctPosition(e.position)},t.prototype._initSortable=function(){var t=this,e=-1;c.lazyJqueryUI(o(this._content)).sortable({start:function(t,i){e=i.item.index()},stop:function(i,o){var n=o.item.index();e!==n&&t._reorderedDelegate.fire(e,n)},tolerance:"point"})},t.prototype._getCorrectedWidgetRect=function(){var t,e,i,o,n=this._widget.getBoundingClientRect();return this._widget.classList.contains("i-closed")?(t=.925,e=1/t-1,i=n.width*e,o=n.height*e,{bottom:n.bottom+o/2,height:n.height+o,left:n.left-i/2,right:n.right+i/2,top:n.top-o/2,width:n.width+i}):n},t._updateAllZIndexes=function(){t._toolbars.forEach(function(e,i){e._setZIndex(t._startZIndex+i)})},t._startZIndex=20,t._toolbars=[],t}(),e.FloatingToolbar=d},,function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),i(22),i(23),o=i(51),n=i(310),r=i(1126),s=i(1129),a=function(){function t(t){this._window=t,this._fullscreenApi=new r.FullscreenApi(t.document),this._initFullscreen()}return t.prototype.allocate=function(){var t,e,i,r=this;return this.free(),t=this._window.document,e=$("<div>",t).addClass("js-rootresizer__contents").css({position:"relative",width:"100%",height:"100%"}).prependTo(t.body),this._visibilityApi=new s.VisibilityApi(this._window.document),i={alive:new o(!0),body:new o(e),width:new o,height:new o,availWidth:new o,availHeight:new o,visible:this._visibilityApi.isVisible,fullscreen:this._fullscreenApi.isFullscreen,remove:function(){i.alive.setValue(!1)},attach:function(){i.alive.setValue(!1),r._window.close()},requestFullscreen:function(){r._requestFullscreen()},exitFullscreen:function(){r._exitFullscreen()}},i.alive.subscribe(function(t){t||i!==r._area||r.free()}),this._area=i,this._resizeHandler=function(){var t=i.body.value()[0],e=t.clientWidth,o=t.clientHeight;i.availHeight.setValue(o),i.availWidth.setValue(e),i.height.setValue(o),i.width.setValue(e)},this._resizeHandler(),$(this._window).on("resize",this._resizeHandler),new n.ResizerDetacherState(i).bridge()},t.prototype.free=function(){if(this._resizeHandler&&($(this._window).off("resize",this._resizeHandler),this._resizeHandler=void 0),
this._visibilityApi&&(this._visibilityApi.destroy(),this._visibilityApi=void 0),this._area){var t=this._area;this._area=void 0,t.alive.setValue(!1),t.body.value().remove()}},t.prototype._requestFullscreen=function(){this._fullscreenApi.enter()},t.prototype._exitFullscreen=function(){this._fullscreenApi.exit()},t.prototype._initFullscreen=function(){var t=this,e=this._window.document;this._fullscreenApi.isFullscreen.subscribe(function(i){i?(t._$exitFullscreenButton=$("<div>",e).addClass("tv-exit-fullscreen-button").text($.t("Exit Full Screen (ESC)")).on("click",function(e){e.preventDefault(),t._exitFullscreen()}).appendTo(e.body),t._onExitFullscreenEsc=function(e){27===e.keyCode&&(e.preventDefault(),t._exitFullscreen())},$(e).on("keyup",t._onExitFullscreenEsc)):(t._$exitFullscreenButton&&(t._$exitFullscreenButton.remove(),t._$exitFullscreenButton=void 0),t._onExitFullscreenEsc&&($(e).off("keyup",t._onExitFullscreenEsc),t._onExitFullscreenEsc=void 0)),t._resizeHandler&&t._resizeHandler()})},t}(),e.Root=a},function(t,e,i){"use strict";function o(t,e,i){e.toggleClass("i-hidden",""===t.val()),i.fire(t.val())}function n(t){var e,i,n,s=$(l);return t.addClass&&s.addClass(t.addClass),t.withoutControls&&s.addClass("tv-search-row--without-controls"),e=s.find(".js-input-control"),i=s.find(".js-reset-button"),t.placeholder&&e.attr("placeholder",t.placeholder),i[0].addEventListener("click",function(){e.val("").trigger("input").focus()}),n=new r,e.on("input propertychange",o.bind(null,e,i,n)),o(e,i,n),{$control:s,$input:e,inputChangedDelegate:n}}var r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),r=i(20),s=i(331),a=i(1342),i(645),l='<div class="tv-search-row"><input class="tv-search-row__input js-input-control" type="text" name="q" value="" autocomplete="off"><span class="tv-search-row__input-reset i-hidden js-reset-button">'+s+'</span><span class="tv-search-row__search-icon">'+a+"</span></div>",e.createSearchControl=n},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(21),n=function(){function t(t,e){o.assert(t<=e,"The last bar in the bars range should be greater than or equal to the first bar"),this._firstBar=t,this._lastBar=e}return t.prototype.firstBar=function(){return this._firstBar},t.prototype.lastBar=function(){return this._lastBar},t.prototype.count=function(){return this._lastBar-this._firstBar+1},t.prototype.contains=function(t){return this._firstBar<=t&&t<=this._lastBar},t}(),e.BarsRange=n},function(t,e,i){"use strict";function o(t,e){return t.compareTo(e)}function n(t){return Array.from(t).reduce(function(t,e){var i=+e;return-1===t.indexOf(i)&&t.push(i),t},[])}function r(t,e,i){var o=6e4,n=new Date(e.valueOf()+t*o);return t+(i.offset_loc(e)/o-i.offset_loc(n)/o)}var s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),s=i(67),a=i(143),l=i(13),c=l.getLogger("Chart.Model.ExchangeSession"),h=[s.MONDAY,s.TUESDAY,s.WEDNESDAY,s.THURSDAY,s.FRIDAY],u=[s.SUNDAY,s.MONDAY,s.TUESDAY,s.WEDNESDAY,s.THURSDAY,s.FRIDAY,s.SATURDAY],d=function(){function t(t,e,i){
this._dayOfWeek=t,this._start=e,this._length=i}return t.prototype.start=function(){return this._start},t.prototype.alignedStart=function(){return this._start<0?this._start+s.minutesPerDay:this._start},t.prototype.isOvernight=function(){return this._start<0},t.prototype.dayOfWeek=function(){return this._dayOfWeek},t.prototype.length=function(){return this._length},t.prototype.weight=function(){return this._dayOfWeek*s.minutesPerDay+this._start},t.prototype.compareTo=function(t){var e=this.weight(),i=e+this._length,o=t.weight();return e<=o&&o<i?0:e>o?1:-1},t}(),e.SessionEntry=d,p=function(){function t(t){void 0===t&&(t="0000-0000");var e=this;this._entries=[],this._firstDayOfWeek=s.MONDAY,this._weekEndsCount=null,"24x7"===t.toLowerCase()?u.forEach(function(t){e.addSessionEntry(t,0,0)}):this._parseSpec(t),this._entries.sort(o)}return t.prototype.entries=function(){return this._entries},t.prototype.firstDayOfWeek=function(){return this._firstDayOfWeek},t.prototype.addSessionEntry=function(t,e,i){i<=e&&0!==e&&(e-=s.minutesPerDay);var o=i===e?s.minutesPerDay:i-e;this._entries.push(new d(t,e,o))},t.prototype.isWeekEnd=function(t){var e=a.lowerbound(this._entries,new d(t,0,0),function(t,e){return t.dayOfWeek()<e.dayOfWeek()});return e>this._entries.length-1||this._entries[e].dayOfWeek()!==t},t.prototype.weekEndsCount=function(){if(null===this._weekEndsCount){var t={};this._entries.forEach(function(e){t[e.dayOfWeek()]=1}),this._weekEndsCount=7-Object.keys(t).reduce(function(e,i){return e+(t[+i]||0)},0)}return this._weekEndsCount},t.prototype.hasWeekEnds=function(){return this.weekEndsCount()>0},t.prototype.indexOfSessionEntry=function(t,e){var i=a.lowerbound(this._entries,new d(t,e,0),function(t,e){return t.compareTo(e)<0});return i>this._entries.length-1?0:i},t.prototype.findSessionEntry=function(t,e){return this._entries[this.indexOfSessionEntry(t,e)]},t.prototype.correctTradingDay=function(t,e){var i=s.get_day_of_week(t),o=60*s.get_hours(t)+s.get_minutes(t),n=this.findSessionEntry(i,o),r=n.dayOfWeek(),a=(r-i+7)%7;return 0!==a?s.add_days_considering_dst(e,t,a):t},t.prototype.alignToSessionStart=function(t,e){var i=s.get_day_of_week(t),o=s.get_minutes_from_midnight(t),n=this.findSessionEntry(i,o),a=n.alignedStart(),l=n.dayOfWeek(),c=n.isOvernight(),h=(l-i+7)%7-(c?1:0);return 0!==h&&s.add_date(t,h),s.set_hms(t,a/60|0,a%60,0,0),r(n.length(),t,e)},t.prototype._parseSpec=function(t){var e=this,i={},o=!1;t=this._parseFirstDayOfWeek(t),t.split("|").forEach(function(t){var e,r,s=t.split(":");if(1!==s.length&&2!==s.length)return void c.logError("Bad session section: "+t);if(e=1===s.length){if(o)return void c.logError("Duplicated default section: "+t);o=!0}r=e?h:n(s[1]),r.forEach(function(t){e&&i[t]||(i[t]=s[0])})}),u.forEach(function(o){var n=i[o];void 0!==n&&n.split(",").forEach(function(i){var n,r,a=i.split("-");2!==a.length&&(c.logError("Bad sessions spec: "+t),a=["0000","0000"]),n=a[0],r=a[1],e.addSessionEntry(o,s.get_minutes_from_hhmm(n),s.get_minutes_from_hhmm(r))})})},t.prototype._parseFirstDayOfWeek=function(t){
var e,i,o,n=t.split(";");return n.length>2?(c.logError("Only one `first day` specification expected @ session "+t),t):1===n.length?t:(e=n[0].indexOf("-")>=0,i=e?NaN:parseInt(n[0]),o=1,isNaN(i)&&(o=0,i=parseInt(n[1])),i<s.SUNDAY||i>s.SATURDAY?(c.logError("Unexpected day index @ session: "+t+"; day index "+i),t):(this._firstDayOfWeek=i,n[o]))},t}(),e.ExchangeSession=p},,function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(38),n=i(34),r=i(333),e.PLACE_HOLDER="---",s=function(){function t(t){this._numericFormatter=new o.NumericFormatter,this._fractionalValues=void 0!==t&&t>0,this._precision=t}return t.prototype.format=function(t){if(!n.isNumber(t))return e.PLACE_HOLDER;var i="";return t<0&&(i="-",t=-t),t>=1e100?"N/A":(!this._fractionalValues||t>=995?t=Math.round(t):this._fractionalValues&&(t=+t.toFixed(this._precision)),t<995?i+this._formatNumber(t):t<999995?i+this._formatNumber(t/1e3)+"K":t<999999995?(t=1e3*Math.round(t/1e3),i+this._formatNumber(t/1e6)+"M"):(t=1e6*Math.round(t/1e6),i+this._formatNumber(t/1e9)+"B"))},t.prototype.parse=function(t){var e,i,o;return"---"===t?{error:"not a number",res:!1,value:NaN}:(e={K:1e3,M:1e6,B:1e9},i=t.slice(-1),e.hasOwnProperty(i)?(o=this._numericFormatter.parse(t.slice(0,-1)),n.isNumber(o)?{res:!0,value:o*e[i]}:{error:"not a number",res:!1,value:NaN}):(o=this._numericFormatter.parse(t),n.isNumber(o)?{res:!0,value:o}:{error:"not a number",res:!1,value:NaN}))},t.prototype._formatNumber=function(t){return this._fractionalValues&&(t=r.fixComputationError(t)),this._numericFormatter.format(t).replace(/(\.[1-9]*)0+$/,function(t,e){return e})},t}(),e.VolumeFormatter=s},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.RoundRadius=8]="RoundRadius",t[t.TextMargins=2]="TextMargins",t[t.MinWidth=100]="MinWidth"}(e.CalloutConsts||(e.CalloutConsts={}))},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(95),r=i(34),s=function(t){function e(e){var i=t.call(this)||this;return i._source=e,i}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o,n,s,a;if(t.visible=!1,e=this._source.points(),i=this._source.priceScale(),0!==e.length&&null!==i&&!i.isEmpty()&&(o=e[0],isFinite(o.price))){if(i.isPercent()){if(!(n=this._source.ownerSource()))return;if(s=n.firstValue(),!r.isNumber(s))return;o.price=i.priceRange().convertToPercent(o.price,s)}a=this._source.properties().linecolor.value(),t.background=a,t.color=this.generateTextColor(a),t.coordinate=i.priceToCoordinate(o.price),t.text=i.formatter().format(o.price),t.visible=!0}},e}(n.PriceAxisView),e.LineToolHorzLinePriceAxisView=s},function(t,e){"use strict";function i(){var t,e,i=[];for(i=i.concat([61536,61537,61538,61539]),i=i.concat([61725,61726]),i=i.concat([61575,61576,61796,61797]),i=i.concat([61779,61780,61781,61782,61783,61784,61785,61786]),t=i.slice(0),e=61440;e<=61846;e++)-1===i.indexOf(e)&&(e%16==15&&61487!==e||e>=61620&&e<=61630||61718!==e&&61719!==e&&61472!==e&&61619!==e&&t.push(e));return t}
Object.defineProperty(e,"__esModule",{value:!0}),e.availableIcons=i()},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Original=0]="Original",t[t.Schiff=1]="Schiff",t[t.Inside=2]="Inside",t[t.Schiff2=3]="Schiff2"}(e.LineToolPitchforkStyle||(e.LineToolPitchforkStyle={}))},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Waiting=0]="Waiting",t[t.Success=1]="Success",t[t.Failure=2]="Failure"}(e.AlertStatus||(e.AlertStatus={})),function(t){t[t.Up=1]="Up",t[t.Down=2]="Down"}(e.Direction||(e.Direction={}))},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Entry=0]="Entry",t[t.Close=1]="Close",t[t.ActualEntry=2]="ActualEntry",t[t.ActualClose=3]="ActualClose"}(e.RiskRewardPointIndex||(e.RiskRewardPointIndex={}))},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(20),n=i(63),function(t){function e(e){return t.favorites.indexOf(e)}function i(){t.favorites=[],n.getJSON("chart.favoriteDrawings",[]).forEach(function(e){t.favorites.push(e.tool||e)}),t.favoritesSynced.fire()}function r(){n.setJSON("chart.favoriteDrawings",t.favorites)}t.favorites=[],t.favoritesSynced=new o,t.favoriteIndex=e,t.saveFavorites=r,i(),n.onSync.subscribe(null,i)}(r||(r={})),function(t){function e(){return r.favorites.slice()}function i(){return r.favorites.length}function n(t){return t<0||t>=i()?"":r.favorites[t]}function s(e){return!l(e)&&(r.favorites.push(e),r.saveFavorites(),t.favoriteAdded.fire(e),!0)}function a(e){var i=r.favoriteIndex(e);return-1!==i&&(r.favorites.splice(i,1),r.saveFavorites(),t.favoriteRemoved.fire(e),!0)}function l(t){return-1!==r.favoriteIndex(t)}function c(e,o){if(o<0||o>=i())return!1;var n=r.favoriteIndex(e);return-1!==n&&o!==n&&(r.favorites.splice(n,1),r.favorites.splice(o,0,e),r.saveFavorites(),t.favoriteMoved.fire(e,n,o),!0)}t.favoriteAdded=new o,t.favoriteRemoved=new o,t.favoriteMoved=new o,t.favoritesSynced=r.favoritesSynced,t.favorites=e,t.favoritesCount=i,t.favorite=n,t.addFavorite=s,t.removeFavorite=a,t.isFavorite=l,t.moveFavorite=c}(e.LinetoolsFavoritesStore||(e.LinetoolsFavoritesStore={}))},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Default=0]="Default",t[t.Pointer=1]="Pointer",t[t.Eraser=2]="Eraser",t[t.Dot=3]="Dot",t[t.Grabbing=4]="Grabbing",t[t.ZoomIn=5]="ZoomIn",t[t.VerticalResize=6]="VerticalResize"}(e.PaneCursorType||(e.PaneCursorType={}))},,,,,function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(21),r=i(57),s=i(95),a=i(7),l=i(71),c=a.enabled("countdown"),h=a.enabled("price_scale_always_last_bar_value"),u=[l.STYLE_BARS,l.STYLE_CANDLES,l.STYLE_LINE,l.STYLE_AREA,l.STYLE_HOLLOW_CANDLES,l.STYLE_HEIKEN_ASHI],d=function(t){function e(e,i){var o=t.call(this)||this;return o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype._getSource=function(){return this._source},e.prototype._getData=function(){return this._data},
e.prototype._isCountdownEnabled=function(){return c},e.prototype._countdownText=function(){var t,e,i,o,s,a,l,c,h,u,d;return this._source.isDWM()?"":(t=1e3*n.ensure(n.ensureNotNull(this._source.data().bars().last()).value[0]),e=1e3*this._source.serverTimeOffset(),i=r.Interval.parse(this._source.interval()),o=i.multiplier()||0,s=i.kind()===r.Interval.SECONDS?o:60*o,a=t.valueOf()+1e3*s,l=(new Date).valueOf()+e,(c=Math.round((a-l)/1e3))<=0?"":(c=Math.min(c,s),h=null,c>=3600&&(h=this._addLeadingZero(Math.floor(c/3600))),c%=3600,u=this._addLeadingZero(Math.floor(c/60)),c%=60,d=this._addLeadingZero(Math.floor(c)),null!==h?h+":"+u+":"+d:u+":"+d))},e.prototype._updateRendererData=function(t){var e,i,o,n,r;t.visible=!1,this._data.model.properties().scalesProperties.showSeriesLastValue.value()&&(e=this._source.lastValueData(TradingView.CLOSE_PLOT,h),e.noData||(i=this._source.properties(),i.style.value()===l.STYLE_HEIKEN_ASHI&&i.haStyle.showRealLastPrice.value()&&(o=this._source.lastValueData(TradingView.CLOSE_PLOT,!1),n=this._source.lastValueData(TradingView.CLOSE_PLOT,!0),!o.noData&&!n.noData&&o.index===n.index)||(r="",c&&i.showCountdown.value()&&-1!==u.indexOf(i.style.value())&&(r=this._countdownText()),t.secondLine=r,t.background=this._source.priceLineColor(e.color),t.color=this.generateTextColor(t.background),t.coordinate=e.coordinate,t.floatCoordinate=e.floatCoordinate,t.text=e.text,t.visible=!0)))},e.prototype._addLeadingZero=function(t){return("0"+t).slice(-2)},e}(s.PriceAxisView),e.SeriesPriceAxisView=d},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(95),r=function(t){function e(e,i){var o=t.call(this)||this;return o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype._updateRendererData=function(t){t.visible=!1;var e=this._source.lastValueData(this._data.plotIndex,!1);e.noData||(t.background=e.color,t.color=this.generateTextColor(e.color),t.coordinate=e.coordinate,t.floatCoordinate=e.floatCoordinate,t.text=e.text,t.visible=!0)},e}(n.PriceAxisView),e.StudyPriceAxisView=r},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(176),r=function(t){function e(e){var i=t.call(this,e,!1)||this;return i._subcommands=[],i}return o.__extends(e,t),e.prototype.addCommand=function(t){this._subcommands.push(t)},e.prototype.isEmpty=function(){return 0===this._subcommands.length},e.prototype.redo=function(){for(var t=0;t<this._subcommands.length;t++)this._subcommands[t].redo()},e.prototype.undo=function(){for(var t=this._subcommands.length-1;t>=0;t--)this._subcommands[t].undo()},e}(n.UndoCommand),e.UndoMacroCommand=r},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(176),n=i(20),r=i(13),s=r.getLogger("Common.UndoStack"),a=function(){function t(t){void 0===t&&(t=!0),this._commands=[],this._onChange=new n,this._logCommands=t}return t.prototype.onChange=function(){return this._onChange},t.prototype.isEmpty=function(){return 0===this._commands.length},t.prototype.clear=function(){
this._commands.length=0,this._onChange.fire()},t.prototype.push=function(t){if(!(t instanceof o.UndoCommand))throw new TypeError("argument must be an instance of UndoCommand");this._commands.push(t),this._onChange.fire()},t.prototype.pop=function(){if(this.isEmpty())return void s.logDebug("pop: undo stack is empty");var t=this._commands.pop();return this._onChange.fire(),t},t.prototype.head=function(){if(!this.isEmpty())return this._commands[this._commands.length-1]},t}(),e.UndoStack=a},function(t,e,i){"use strict";function o(t){var e,i=n.get_timezone(t).offset_utc(Date.now()),o="",r=i/1e3/60/60;return r%1&&(o=":"+r%1*60),e="",e=r>0?"+"+(r-r%1)+o:0===r?"":r-r%1+o+"",{offset:i,string:"UTC"+e}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(67);e.parseTzOffset=o},,function(t,e,i){"use strict";function o(t){i.e(6,function(e){i(500).showGoToDateDialog(t)})}Object.defineProperty(e,"__esModule",{value:!0}),e.showGoToDateDialog=o},,function(t,e){"use strict";function i(t){window.t=t}function o(t){n.$||(n.$={}),n.$.t=t}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),n=window,e.addTranslationFunctionToWindow=i,e.addTranslationFunctionToJQuery=o,r=function(t,e){return t},e.translationFunction=r},,,,,function(t,e,i){"use strict";function o(t){return s.createElement(t.href?"a":"div",t)}function n(t){t.stopPropagation()}var r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),r=i(5),s=i(2),a=i(26),l=i(670),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(t){var i=e.props,o=i.onClick,n=i.onClickArg;o&&o(n,t)},e}return r.__extends(e,t),e.prototype.render=function(){var t,e,i=this.props,r=i.className,c=i.forceShowHint,h=i.hint,u=i.icon,d=i.isActive,p=i.isDisabled,_=i.label,f=i.link,m=i.target,g=i.showToolboxOnHover,v=i.toolbox;return s.createElement(o,{className:a(l.item,r,(t={},t[l.isActive]=d,t[l.isDisabled]=p,t)),href:f,target:m,onClick:this._handleClick},void 0!==u&&s.createElement("div",{className:l.icon,dangerouslySetInnerHTML:{__html:u}}),s.createElement("div",{className:l.labelRow},s.createElement("div",{className:l.label},_)),(void 0!==h||c)&&s.createElement("div",{className:l.hint},h),void 0!==v&&s.createElement("div",{onClick:n,className:a(l.toolbox,(e={},e[l.showOnHover]=g,e))},v))},e}(s.PureComponent),e.PopupMenuItem=c,e.PopupMenuItemString=c},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M10.5 5.333h-.75V3.81C9.75 1.707 8.07 0 6 0 3.93 0 2.25 1.707 2.25 3.81v1.523H1.5c-.825 0-1.5.686-1.5 1.524v7.62C0 15.313.675 16 1.5 16h9c.825 0 1.5-.686 1.5-1.524V6.857c0-.838-.675-1.524-1.5-1.524zM6 12c-.825 0-1.5-.675-1.5-1.5S5.175 9 6 9s1.5.675 1.5 1.5S6.825 12 6 12zm2.325-6.75h-4.65v-1.5A2.326 2.326 0 0 1 6 1.425 2.326 2.326 0 0 1 8.325 3.75v1.5z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 14 14" width="14" height="14" enable-background="new -2.4 120.9 600 600"><path d="M-2.4 120.9v14h14v-14zm3.34 2.123l3.66 3.66 3.66-3.66 1.217 1.22-3.66 3.658 3.66 3.66-1.22 1.22-3.658-3.66-3.66 3.66-1.22-1.22 3.66-3.66-3.66-3.66z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 12"><path fill-rule="evenodd" d="M0 0h2v2H0V0zm4 0h2v2H4V0zM0 5h2v2H0V5zm4 0h2v2H4V5zm-4 5h2v2H0v-2zm4 0h2v2H4v-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 16" width="10" height="16"><path d="M.6 1.4l1.4-1.4 8 8-8 8-1.4-1.4 6.389-6.532-6.389-6.668z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-90 -55 140 140" width="16" height="16"><path d="M10 12l-40.3-42.5-10 10.6 29.7 31.2L-41 43.4l10.7 11.3L10 12.2l-.1-.1z"/></svg>'},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},,,,,,,function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},,function(t,e){},function(t,e){},,function(t,e){},function(t,e){},,,,,,,function(t,e){t.exports={button:"button-12d2ecdm-",bg:"bg-YlLYd-yv-",isBgFull:"isBgFull-2vDsFeGF-",icon:"icon-1Aj0C0n9-",isActive:"isActive-2rPH92mZ-",isGrayed:"isGrayed-4ouw9IZE-",isTransparent:"isTransparent-ID_v_oQg-",isHidden:"isHidden-3LxpKIBm-"}},function(t,e){t.exports={dropdown:"dropdown-6u_w9lBX-",buttonWrap:"buttonWrap-2P8YcFxI-",control:"control-1XS2TnJK-",arrow:"arrow-3rkHC7mg-",arrowIcon:"arrowIcon-2CFVxds0-",isOpened:"isOpened-2NpkzMyL-",isGrayed:"isGrayed-a6uxviTP-"}},function(t,e){t.exports={drawingToolbar:"drawingToolbar-2CoOuCv8-",inner:"inner-miy9NvGa-",isHidden:"isHidden-3clwVygO-",toggleButton:"toggleButton-2o6YKJ1g-",willOpen:"willOpen-FfEto9H9-",separator:"separator-3cgsM4c1-"}},function(t,e){t.exports={wrap:"wrap-3sqRkrxT-",buttonIcon:"buttonIcon-1rzHc9wf-",item:"item-2ygtO0S7-",button:"button-22dNa3Bv-"}},function(t,e){t.exports={item:"item-3ZOl0mtP-",enter:"enter-vkTnkcy0-",enterActive:"enterActive-3sOs6kre-",leave:"leave-DQ7Ov9CG-"}},function(t,e){t.exports={star:"star-2V_oMHOc-",checked:"checked-PT15Z8t2-"}},function(t,e){t.exports={item:"item-3ShHncG0-",isDisabled:"isDisabled-1ebe7hp6-",icon:"icon-3c5_Jcn9-",isActive:"isActive-1oDByUn5-",labelRow:"labelRow-3KFKeuXJ-",hint:"hint-1ACoXAOB-",toolbox:"toolbox-3Hm-uzE_-",showOnHover:"showOnHover-2HcrcYeD-"}},function(t,e){t.exports={separator:"separator-1d19DzZR-"}},function(t,e){t.exports={menu:"menu-13SRjx2L-",menuBox:"menuBox-FiPlQBwv-",menuWrap:"menuWrap-39mEHt1u-",toBottom:"toBottom-DlXGJH_L-",toLeft:"toLeft-4_ywK6bp-",toLeftBottom:"toLeftBottom-1ke8rpT6-",
toLeftTop:"toLeftTop-1phbGMP0-",toRight:"toRight-3LEkQ7Sl-",toRightBottom:"toRightBottom-1kaIZaQe-",toRightTop:"toRightTop-2Ovyfnu2-",toTop:"toTop-1i0VHHiC-",isMeasuring:"isMeasuring-2TOwQm-c-",isHidden:"isHidden-36HyvS5l-"}},function(t,e){t.exports={wrap:"wrap-2ezGj3Gf-",scrollWrap:"scrollWrap-2Regigv6-",noScrollBar:"noScrollBar-a2JtQ0sE-",content:"content-3WPwLkTv-",icon:"icon-1eZA_1s6-",scrollBot:"scrollBot-1mx_BeXt-",scrollTop:"scrollTop-2G6k9HF0-",isVisible:"isVisible-3nZyQUEX-",iconWrap:"iconWrap-1rQdYwAv-"}},,,,,,,,,,,,,,,function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(158),Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})}),n=i(365),Object.defineProperty(e,"KeyboardListener",{enumerable:!0,get:function(){return n.KeyboardListener}})},function(t,e,i){(function(t){"use strict";function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a,l,c,h,u,d,p,_,f,m;Object.defineProperty(e,"__esModule",{value:!0}),e.ArraySource=e.Autocomplete=void 0,a=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(620),l=i(110),c=n(l),h=i(371),u=i(690),d=i(688),p=i(158),_=o(p),f=i(469),m=i(1010),e.Autocomplete=function(){function e(i){var o=i.el,n=i.source,r=i.textField,a=void 0===r?"text":r,l=i.userpicField,c=void 0===l?"userpic":l,h=i.maxLength;s(this,e),this._el=o,this._$el=$(o),this._source=n,this._tmpl=t.render(m,{maxLength:h}),this._textField=a,this._userpicField=c,this._init()}return a(e,[{key:"_init",value:function(){this.stream=new c.default;var t=this._el.querySelector("input");this._el.innerHTML=this._tmpl,this.input=this._el.querySelector("input"),t&&(this.input.parentNode.replaceChild(t,this.input),this.input=t),this.input.addEventListener("input",this._onInput.bind(this)),this.input.addEventListener("focus",this._onInput.bind(this)),this.input.addEventListener("blur",this._onBlur.bind(this)),this._$el.on("beforeOpenMenu",this._onBeforeOpenMenu.bind(this)),this._$el.on("afterCloseMenu",this._onAfterCloseMenu.bind(this)),this._dropdown=new h.DropdownView(this._$el),this._initMenu(),this._regHandlers()}},{key:"_initMenu",value:function(t){var e=this;this._menu=new u.Menu({el:this._el.querySelector("tv-menu"),itemClass:"tv-autocomplete__dropdown-item tv-dropdown__item",textField:this._textField,userpicClass:"tv-autocomplete__userpic",userpicField:this._userpicField}),this._menu.stream.addListener(u.events.SELECT,function(t){
if(!t[e._textField])return void e.stream.emitEvent(f.events.SELECT_CUSTOM,[t]);e.input.value=t[e._textField],e._dropdown.close(),e.stream.emitEvent(f.events.SELECT,[t])})}},{key:"_regHandlers",value:function(){var t,e,i=this;this._closeStateKeyboardListener=new d.KeyboardListener,this._closeStateKeyboardListener.regHandlers((t={},r(t,_.UP_ARROW,function(){i._dropdown.open()}),r(t,_.DOWN_ARROW,function(){i._dropdown.open()}),r(t,_.ENTER,function(){i._menu.select()}),t)),this._openStateKeyboardListener=new d.KeyboardListener,this._openStateKeyboardListener.regHandlers((e={},r(e,_.UP_ARROW,function(){i._menu.prev()}),r(e,_.DOWN_ARROW,function(){i._menu.next()}),r(e,_.ENTER,function(){i._menu.select()}),r(e,_.ESC,function(){i._dropdown.close()}),e)),this._closeStateKeyboardListener.watchOn(this.input)}},{key:"_onBlur",value:function(){this._dropdown.close()}},{key:"_onInput",value:function(){var t=this;this._menu.highlight(this.input.value),this._source.find(this.input.value,this._textField).then(function(e){t._menu.updateItems(e),e.length?t._dropdown.open():t._dropdown.close()})}},{key:"_onAfterCloseMenu",value:function(){this._openStateKeyboardListener.stopWatching(),this._closeStateKeyboardListener.watchOn(this.input),this._menu.reset(),this.stream.emitEvent(f.events.AFTER_CLOSE_MENU)}},{key:"_onBeforeOpenMenu",value:function(){this._closeStateKeyboardListener.stopWatching(),this._openStateKeyboardListener.watchOn(this.input),this.stream.emitEvent(f.events.BEFORE_OPEN_MENU)}},{key:"value",get:function(){return this.input.value!==this._menu.value[this._textField]?r({},this._textField,this.input.value):this._menu.value}}]),e}(),e.ArraySource=function(){function t(e){s(this,t),this._array=e}return a(t,[{key:"find",value:function(t,e){var i=this._array.filter(function(i){return i[e].toLowerCase().includes(t.toLowerCase())});return Promise.resolve(i)}},{key:"getItems",value:function(){return Promise.resolve(this._array)}}]),t}()}).call(e,i(54))},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(691),Object.defineProperty(e,"Menu",{enumerable:!0,get:function(){return o.Menu}}),n=i(366),Object.defineProperty(e,"events",{enumerable:!0,get:function(){return n.events}})},function(t,e,i){(function(t){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c,h,u,d,p,_;Object.defineProperty(e,"__esModule",{value:!0}),e.Menu=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(623),s=i(110),a=o(s),l=i(366),c=i(467),h="tv-menu-item",u='<tv-menu-item class="{{itemClass}} {{activeClass}}" data-item="{{item}}">{{#userpic}}<img class="{{userpicClass}}" src="{{userpic}}">{{/userpic}}{{{html}}}</tv-menu-item>',d="prev",p="next",_=function(t,e){var i=Math.min(t.length,e.length),o=void 0
;for(o=0;o<i&&t.charAt(o).toLowerCase()===e.charAt(o).toLowerCase();o++);return o>0?"<strong>"+(0,c.htmlEscape)(t.slice(0,o))+"</strong>"+(0,c.htmlEscape)(t.slice(o)):(0,c.htmlEscape)(t)},e.Menu=function(){function e(t){var i=t.el,o=t.items,r=t.itemClass,s=t.textField,a=void 0===s?"text":s,l=t.userpicField,c=void 0===l?"userpic":l,h=t.userpicClass;n(this,e),this._el=i,this._items=o,this._itemClass=r,this._textField=a,this._userpicField=c,this._userpicClass=h,this._hightlighted="",this._init()}return r(e,[{key:"_init",value:function(){this._el.setAttribute("tabindex","1"),this.stream=new a.default,this.updateItems(this._items),this._el.addEventListener("mousedown",function(t){t.preventDefault()}),this._el.addEventListener("click",this._onClick.bind(this))}},{key:"updateItems",value:function(t){this._items=t,t&&this._renderItems(t),this._menuItems=this._el.querySelectorAll(h),this._selectedItem=this._el.querySelector(h+".i-active"),this._setFocusOnItem(this._selectedItem)}},{key:"next",value:function(){this._moveFocusTo(p)}},{key:"prev",value:function(){this._moveFocusTo(d)}},{key:"reset",value:function(){return this._selectedItem?void this._setFocusOnItem(this._selectedItem):this._focusedItem?void this._blur():void 0}},{key:"select",value:function(){this._selectedItem=this._focusedItem,this.stream.emitEvent(l.events.SELECT,[this.value])}},{key:"highlight",value:function(t){null==t?t="":t+="",this._hightlighted!==t&&(this._hightlighted=t,this.updateItems(this._items))}},{key:"_moveFocusTo",value:function(t){var e=this._getFocusedItemIdx(),i=this._menuItems.length-1,o=void 0;switch(t){case p:o=this._findActiveItem(t,++e)||this._findActiveItem(t,0);break;case d:o=this._findActiveItem(t,--e)||this._findActiveItem(t,i)}this._setFocusOnItem(o)}},{key:"_getFocusedItemIdx",value:function(){var t=this;return Array.prototype.findIndex.call(this._menuItems,function(e){return Object.is(e,t._focusedItem)})}},{key:"_findActiveItem",value:function(t,e){for(var i=this._menuItems[e];i&&i.classList.contains("i-disabled");)switch(t){case"next":i=this._menuItems[e++];break;case"prev":i=this._menuItems[e--]}return i}},{key:"_setFocusOnItem",value:function(t){t&&!t.classList.contains("i-disabled")?(this._blur(),this._focusedItem=t,this._focus()):this._focusedItem=null}},{key:"_focus",value:function(){this._focusedItem&&this._focusedItem.classList.add("i-active")}},{key:"_blur",value:function(){this._focusedItem&&this._focusedItem.classList.remove("i-active")}},{key:"_onClick",value:function(t){var e=!t.target.classList.contains("i-disabled");t.target.tagName===h.toUpperCase()&&e&&(this._setFocusOnItem(t.target),this.select())}},{key:"_renderItems",value:function(e){var i=this,o={items:e,itemClass:this._itemClass,userpicClass:this._userpicClass,activeClass:function(){var t=i._hightlighted,e=this[i._textField];if(t&&e&&t.toLowerCase()===e.toLowerCase())return"i-active"},text:function(){return this[i._textField]},html:function(){return _(this[i._textField],i._hightlighted)},userpic:function(){return this[i._userpicField]},item:function(){
return JSON.stringify(this)}},n="{{#items}}"+u+"{{/items}}";this._el.innerHTML=t.render(n,o)}},{key:"value",get:function(){var t=void 0;try{t=JSON.parse(this._selectedItem.dataset.item)}catch(e){t={}}return t}}]),e}()}).call(e,i(54))},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),e.AddSymbolTab=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(104),a=o(s),l=i(368),i(360),i(630),c='\n\t<div class="tv-add-symbol-tab">\n\t\t<input type="text" class="tv-control-input js-add-symbol-tab-input" placeholder="'+$.t("Symbol")+'" autocomplete="off">\n\t\t<div class="tv-add-symbol-tab__add-symbol-overlay js-add-symbol-tab-checkbox"></div>\n\t</div>',e.AddSymbolTab=function(){function t(e,i){n(this,t),this._chartWidgetCollection=e,this._dialog=i,this._$popup=null,this.init()}return r(t,[{key:"init",value:function(){var t=this;this.$tab=$(c),this._$input=this.$tab.find(".js-add-symbol-tab-input"),this._checkbox=new l.AddSymbolCheckbox({labelRight:$.t("Overlay the main chart"),labelAddClass:"tv-add-symbol-tab__checkbox-label",boxAddClass:"tv-add-symbol-tab__checkbox-box"}),this.$tab.find(".js-add-symbol-tab-checkbox").append(this._checkbox.$el),a.default.bindToInput(this._$input,{callback:function(e){var i=t._chartWidgetCollection.activeChartWidget.value();i&&i.addSymbol(e,t._checkbox.checked)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"focus",value:function(){Modernizr.touch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),t}()},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function a(t,e,i){var o,n=2*j,r=document.createElement("canvas");return r.width=e*n,r.height=i*n,r.style.width=e+"px",r.style.height=i+"px",o=r.getContext("2d"),o.setTransform(n,0,0,n,0,0),o.drawImage(t,0,0,e,i),r}function l(t,e){return function(){i.e(10,function(){Y=i(695),t.call(e)})}}function c(t){return!C||t>P}var h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E,V,D,O,B,R,z,F,N,W,H,U,j,q,G,Y,K,Z;Object.defineProperty(e,"__esModule",{value:!0}),e.Branding=void 0,h=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,
o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),d=i(1),p=i(49),_=i(7),f=n(_),m=i(4),g=o(m),v=i(374),y=o(v),b=i(28),S=i(19),w="tvLogoBlack",T="tvLogoWhite",u={},s(u,w,i(1347)),s(u,T,i(1348)),x=u,C=f.enabled("adaptive_logo"),P=500,L="images/widget-embed-logo/",I="site_branding",k="widget_branding",A="widget_referral_branding",M="widget_custom_branding",E="widget_custom_no_powered_branding",V="fundamental_branding",D="fundamental_custom_branding",O="fundamental_custom_no_powered_branding",B="library_branding",R="library_custom_branding",z="library_custom_no_powered_branding",F=.2,N=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,W=function(){var t,e=window.navigator.userAgent,i=e.indexOf("MSIE ");return i>0?parseInt(e.substring(i+5,e.indexOf(".",i)),10):e.indexOf("Trident/")>0&&(t=e.indexOf("rv:"),parseInt(e.substring(t+3,e.indexOf(".",t)),10))}(),H=window.urlParams||{},U=window.initData||{},j=window.hidpiCanvasRatio||1,q=!0,G=null,Y=null,K=function(){function t(e){var i=e.layout,o=void 0===i?I:i,n=e.symbol,s=void 0===n?"":n,a=e.model,c=e.onReadyCallback;r(this,t),this._model=a,this._logo=null,this._logoReady=!1,this._showLogo=!1,this._logoWidth=28,this._logoHeight=19,this.show=!0,this.width=100,this.height=20,this._layout=o,this._symbol=s,this._strokeColor=b.color.black255,this._fillСolor=b.color.brand,this._colorOldBlue=b.color.brandDown,this._colorOldGray=b.color.black30,this._strokeOpacity=.6,this._strokeWidth=2,this._fontSize=14,this._font='px "Trebuchet MS", Tahoma, Arial, sans-serif',this._txt="TradingView",this._onReadyCallback=c,this._upscaleRatio=2,this._strokeCanv=null,this._fillCanv=null,W&&(this._init=l(this._init,this)),this._init()}return h(t,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var t=(0,S.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,t>F?(this._strokeColor=b.color.black255,this._strokeWidth=2.5,this._loadLogo(T)):(this._strokeColor=b.color.black0,this._strokeWidth=3,this._loadLogo(w))}},{key:"_loadLogo",value:function(t){var e=this;this._showLogo&&(this._logo=new Image,this._logo.src=W?Y.fallbackImages[t]:"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(x[t]),this._logo.addEventListener("load",function(){N&&(e._logo=a(e._logo,e._logoWidth,e._logoHeight)),e._logoReady=!0,"function"==typeof e._onReadyCallback&&e._onReadyCallback()}))}},{key:"_checkLayout",value:function(){switch(this._layout){case k:case A:case M:case V:case D:case R:case B:this.show=!0;break;case I:case E:case O:case z:this.show=!1}switch(this._layout){case k:this._txt=$.t("{0} chart by TradingView").format(this._symbol);break;case V:
this._txt=$.t("{0} financials by TradingView").format(this._symbol);break;case A:this._txt=$.t("More features on tradingview.com");break;case M:case D:this._txt=$.t("powered by ");break;case B:this._showLogo=!0,this._txt=$.t("charts by TradingView");break;case R:this._txt=$.t("powered by TradingView")}}},{key:"_drawTextStroke",value:function(t){var e,i;this._strokeCanv||(this._strokeCanv=document.createElement("canvas"),e=this._strokeCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),e.font=this._fontSize*this._upscaleRatio+this._font,this._textWidth=e.measureText(this._txt).width,this._strokeCanv.width=(this._textWidth+2*i)*j,e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.strokeStyle=this._strokeColor,e.lineWidth=this._strokeWidth*this._upscaleRatio*j,e.lineJoin="round",e.strokeText(this._txt,i,i),N&&(e.lineWidth=this._strokeWidth*this._upscaleRatio*j/2,e.strokeText(this._txt,i+1.5,i),e.strokeText(this._txt,i-1.5,i))),t.save(),t.globalAlpha=this._strokeOpacity,t.scale(1/j,1/j),t.drawImage(this._strokeCanv,0,0,this._strokeCanv.width,this._strokeCanv.height,0,0,this._strokeCanv.width/this._upscaleRatio,this._strokeCanv.height/this._upscaleRatio),t.restore()}},{key:"_drawTextFill",value:function(t){var e,i;this._fillCanv||(this._fillCanv=document.createElement("canvas"),e=this._fillCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),this._fillCanv.width=(this._textWidth+2*i)*j,e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.fillStyle=this._fillСolor,e.fillText(this._txt,i,i)),t.save(),t.scale(1/j,1/j),t.drawImage(this._fillCanv,0,0,this._fillCanv.width,this._fillCanv.height,0,0,this._fillCanv.width/this._upscaleRatio,this._fillCanv.height/this._upscaleRatio),t.restore()}},{key:"draw",value:function(t,e){var i,o;this._layout===M||this._layout===D?(i='12px "Trebuchet MS", Tahoma, Arial, sans-serif',t.font=i,o=t.measureText(this._txt).width,this.width=o+t.measureText("TradingView").width,t.save(),t.globalAlpha=.7,t.fillStyle=this._colorOldGray,t.fillText(this._txt,0,12),t.fillStyle=this._colorOldBlue,t.fillText("TradingView",o,12),t.restore()):this._showLogo&&this._logoReady?(t.drawImage(this._logo,-2,N?-2:-.5,this._logoWidth,this._logoHeight),t.save(),t.translate(this._logoWidth,0),c(e)&&(this._drawTextStroke(t),this._drawTextFill(t)),t.restore(),null!==this._strokeCanv?this.width=this._logoWidth+this._strokeCanv.width/this._upscaleRatio/j:this.width=this._logoWidth):(t.save(),t.translate(0,N?4:0),c(e)&&(this._drawTextStroke(t),this._drawTextFill(t)),t.restore(),null!==this._strokeCanv&&(this.width=this._strokeCanv.width/this._upscaleRatio/j))}}]),t}(),Z=function(){function t(e){var i=e.layout,o=void 0===i?I:i,n=e.src,s=e.onReadyCallback;r(this,t),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=o,this._src=n,this._onReadyCallback=s,W&&(this._init=l(this._init,this)),this._init()}return h(t,[{key:"_init",value:function(){var t,e,i=this
;this._checkLayout(),this.show&&(t=this._src.match(/(\w+)\.svg/),W&&t&&2===t.length?(e=t[1],this._img.src=Y.fallbackImages[e],this._img.addEventListener("load",function(){var t=Y.logoSizes;e in t?(i.width=t[e].width,i.height=t[e].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),N&&(i._img=a(i._img,i.width,i.height)),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})))}},{key:"_checkLayout",value:function(){switch(this._layout){case M:case E:case D:case O:case R:case z:this.show=!0;break;case I:case k:case A:case V:case B:this.show=!1}}},{key:"draw",value:function(t){this._ready&&t.drawImage(this._img,0,0,this.width,this.height)}}]),t}(),e.Branding=function(){function t(e){var i,o,n=this;r(this,t),this._model=e,this._mainSeries=this._model.mainSeries(),this._canvasWidth=0,this._paneHeight=0,this._left=13,this._bottom=12,this._layout=I,this._needToShow=!0,this._customLogoSrc="",this._customLogoLink="",this._checkLayout(),this._layout!==M&&this._layout!==D||(this._left=8,this._bottom=5),i=function(){q=!!n._needToShow&&(n._layout!==I||window.innerWidth>=768)},o=(0,y.default)(i,200),i(),window.addEventListener("resize",o),this._model.isSnapshot()?this._init():this._mainSeries.onSymbolResolved().subscribe(this,this._init)}return h(t,[{key:"_init",value:function(){var t=this,e=this._mainSeries.symbolInfo()||{};this._poweredBy=new K({layout:this._layout,symbol:e.name,model:this._model,onReadyCallback:function(){return t._model.fullUpdate()}}),this._customLogo=new Z({layout:this._layout,src:this._customLogoSrc,onReadyCallback:function(){return t._model.fullUpdate()}})}},{key:"_checkLayout",value:function(){var t,e,i;f.enabled("widget")?(t=U.logo||{},e=f.enabled("fundamental_widget"),this._needToShow=!(U.whitelabel||H.whitelabel||t.whitelabel),t.image?(this._customLogoSrc=L+t.image,t.no_powered_by?this._layout=e?O:E:this._layout=e?D:M):H.referral_id||H.no_referral_id?this._layout=A:this._layout=e?V:k):f.enabled("charting_library")||f.enabled("amp_terminal")||f.enabled("cqg_terminal")||f.enabled("trading_terminal")?(i=JSON.parse(H.logo)||{},i.image?(this._customLogoSrc=i.image,this._customLogoLink=i.link,this._needToShow=f.enabled("widget_logo"),f.enabled("link_to_tradingview")?this._layout=R:this._layout=z):(this._layout=B,this._needToShow=f.enabled("widget_logo"))):this._layout=I}},{key:"updateAllViews",value:function(){}},{key:"priceScale",value:function(){}},{key:"priceAxisViews",value:function(){}},{key:"onClickOutside",value:function(){}},{key:"hasContextMenu",value:function(){return!1}},{key:"hitTest",value:function(t){var e=this;return!q||f.enabled("logo_without_link")?null:this._poweredBy&&this._layout!==I&&this._layout!==E&&this._layout!==O&&(0,
p.pointInRectangle)(t,new d.Point(this._left,this._paneHeight-Math.max(this._poweredBy.height,void 0!==this._customLogo?this._customLogo.height:0)-this._bottom),new d.Point(this._left+Math.max(this._poweredBy.width,void 0!==this._customLogo?this._customLogo.width:0),this._paneHeight-this._bottom))?new g.default(g.default.CUSTOM,{mouseUpHandler:function(){window.open(e.tvUrl(),"_blank").opener=null}}):null}},{key:"tvUrl",value:function(){var t,e="https://www.tradingview.com/";if(this._customLogoLink)return this._customLogoLink;if(this._layout===B||this._layout===R){switch(t=void 0,!0){case f.enabled("charting_library"):t="library";break;case f.enabled("trading_terminal"):case f.enabled("amp_terminal"):case f.enabled("cqg_terminal"):t="trading-terminal"}return e+="/"===e[e.length-1]?"?":"&",e+="utm_source="+window.location.origin+"&utm_medium=library"+(t?"&utm_campaign="+t:"")}return e}},{key:"draw",value:function(t){if(q){var e=0;this._poweredBy&&this._poweredBy.show&&(e=this._poweredBy.height,t.save(),t.translate(this._left,this._paneHeight-this._bottom-this._poweredBy.height),this._poweredBy.draw(t,this._canvasWidth),t.restore()),this._customLogo&&this._customLogo.show&&(t.save(),t.translate(this._left,this._paneHeight-this._bottom-e-this._customLogo.height),this._customLogo.draw(t),t.restore())}}},{key:"renderer",value:function(t,e){return this._paneHeight=G.height(),this._canvasWidth=e,{draw:this.draw.bind(this)}}},{key:"paneViews",value:function(t){var e=f.enabled("move_logo_to_main_pane");return e&&t.isMainPane()||!e&&t.isLast()||t.isMaximized()?(G=t,[{renderer:this.renderer.bind(this)}]):[]}}]),t}()},function(t,e,i){(function(t,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),e.CompareTab=void 0,s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(104),l=n(a),c=i(48),i(360),i(359),i(632),h='\n\t<div class="tv-compare-tab">\n\t\t<input type="text" class="tv-control-input js-compare-tab-input" placeholder="'+$.t("Company Comparison")+'" autocomplete="off">\n\t</div>',u='<div class="tv-compare-tab__predefines js-compare-tab-predefines"></div>',d='\n\t<div class="tv-compare-tab__predefine-cell">\n\t\t<label for="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox">\n\t\t\t\t<input class="tv-control-checkbox__input js-predefine-checkbox" type="checkbox" id="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox__box tv-compare-tab__checkbox-box">'+i(235)+'</span>\n\t\t\t<span class="tv-control-checkbox__ripple js-ripple"></span>\n\t\t\t</span>\n\t\t\t<span class="tv-control-checkbox__label tv-compare-tab__checkbox-label">{{label}}</span>\n\t\t</label>\n\t</div>',e.CompareTab=function(){function e(t,i){r(this,e),this._chartWidgetCollection=t,
this._dialog=i,this._$popup=null,this._predefines={},this._symbolAlias={},this.init()}return s(e,[{key:"addCompareSymbol",value:function(t,e,i){var o,n,r,s,a,l,h=this._chartWidgetCollection.activeChartWidget.value();if(h&&(o=h.model())){for(n=o.mainSeries().interval(),r=o.studiesMetaData(),s=void 0,a=0;a<r.length;a++)"Compare@tv-basicstudies"===r[a].id&&(s=r[a]);return l={exchange:i,inputs:{symbol:t,resolution:n}},(0,c.trackEvent)("GUI","Add Compare"),o.insertStudy(s,l)}}},{key:"removeCompareSymbol",value:function(t){var e,i=this,o=this._chartWidgetCollection.activeChartWidget.value();o&&(e=o.model())&&e.dataSources().forEach(function(o){if(o._metaInfo&&"Compare@tv-basicstudies"===o._metaInfo.id){var n=o.properties().inputs.symbol.value();(n===t||i._symbolAlias[n]&&i._symbolAlias[n]===t)&&e.removeSource(o)}})}},{key:"init",value:function(){var e,i,o,n=this,r=this._chartWidgetCollection.activeChartWidget.value();r&&(e=r.model())&&(i=e.dataSources(),this.$tab=$(h),this._initSymbolSearch(),t.enabled("charting_library_base")||(this._createPredefinesList(),o=this.$tab.find(".js-compare-tab-predefines"),o.find(".js-predefine-checkbox").attr("checked",!1),Object.keys(this._predefines).forEach(function(t){var e=n._symbolToId(t),r=o.find("#"+e);i.forEach(function(e){if(e._metaInfo&&"Compare@tv-basicstudies"===e._metaInfo.id){var i=e.properties().inputs.symbol.value();(i===t||n._symbolAlias[i]&&n._symbolAlias[i]===t)&&r.attr("checked",!0)}})})))}},{key:"_initSymbolSearch",value:function(){var t=this;this._$input=this.$tab.find(".js-compare-tab-input"),l.default.bindToInput(this._$input,{callback:function(e){return t.addCompareSymbol(e)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"_createPredefinesList",value:function(){function t(t){var e=this;setTimeout(function(){if($(e).is(":checked")){i.addCompareSymbol(t.data.symbol)||$(e).attr("checked",!1)}else i.removeCompareSymbol(t.data.symbol)})}var e=this,i=this,n=$(u);Object.keys(this._predefines).forEach(function(i){var r=$(o.render(d,{symbolId:e._symbolToId(i),label:e._predefines[i]}));r.find(".js-predefine-checkbox").change({symbol:i},t),r.appendTo(n)}),n.appendTo(this.$tab)}},{key:"_symbolToId",value:function(t){return t.replace(/[^a-z0-9]/gi,"_")}},{key:"focus",value:function(){Modernizr.touch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),e}()}).call(e,i(7),i(54))},,function(t,e,i){"use strict";function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),e.ButtonLoader=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,
"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(261),a=i(28),l=o(a),$.fn.tvButtonLoader=(0,s.createTvBlockWithInstance)("tv-button-loader",function(t,e){return new c(t,e)}),c=e.ButtonLoader=function(){function t(e,i){n(this,t),this.$btn=$(e).addClass("tv-button--loader"),0===this.$btn.find(".tv-button__loader").length&&this.$btn.html('<span class="tv-button__text">'+this.$btn.html()+'</span><span class="tv-button__loader"><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span></span>'),this.loading=this.$btn.hasClass("i-loading")}return r(t,[{key:"_start",value:function(){var t=this;this.starting=!0,this.$btn.addClass("i-start-load"),this.$btn.trigger("tv-button-loader:start"),setTimeout(function(){t.loading=!0,t.starting=!1,t._startPromise=!1,t.$btn.addClass("i-loading"),t.$btn.removeClass("i-start-load"),t._stopPromise&&t._stop()},2*l.dur)}},{key:"start",value:function(){this.starting||(this.stopping?this._startPromise=!0:this._start())}},{key:"_stop",value:function(){var t=this;this.stopping=!0,this.$btn.addClass("i-stop-load"),this.$btn.trigger("tv-button-loader:stop"),setTimeout(function(){t.loading=!1,t.stopping=!1,t._stopPromise=!1,t.$btn.removeClass("i-loading i-start-load i-stop-load"),t._startPromise&&t._start()},l.dur)}},{key:"stop",value:function(){this.stopping||(this.starting?this._stopPromise=!0:this._stop())}},{key:"toggle",value:function(){this.loading?this.stop():this.start()}},{key:"contentHtml",value:function(t){return t?(this.$btn.find(".tv-button__text").html(t),t):this.$btn.find(".tv-button__text").html()}},{key:"contentNojQuery",value:function(){return this.$btn.get(0)}},{key:"disable",value:function(){this.stop(),this.$btn.addClass("i-disabled")}},{key:"enable",value:function(){this.$btn.removeClass("i-disabled")}}]),t}()},function(t,e,i){"use strict";function o(t,e,i,o){var s=(0,n.createConfirmDialog)({type:"modal",content:$.t("Do you really want to delete Chart Layout '{0}' ?").format(t),addClass:"delete-chart-dialog"}),a=function(){var t=o;o=null,t&&t()};s.on("action:yes",function(){o=null,r.removeChart(e,i),s.close()}),s.on("action:no",a),s.on("afterClose",a),s.open()}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.deleteChart=o,n=i(123),r=i(161)},function(t,e,i){"use strict";function o(t){var e=0;!0===t&&(ChartApiInstance.disconnect(),e=500),setTimeout(ChartApiInstance.connect.bind(ChartApiInstance),e)}function n(t,e,i,n){l||(l=(0,s.createDialog)({width:n||600,closeOnOutsideClick:!1,destroyOnClose:!0,type:"modal",contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text tv-text--position-outside"></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">',title:t,content:e,actions:[{name:"reconnect",type:"primary",text:$.t("Reconnect")},{name:"report",type:"primary",
text:$.t("Report a data issue")}]}).on("action:reconnect",function(t){t.close(),o(i)}).on("action:report",function(t){t.close(),runOrSignIn(function(){},{source:"Report data issue from disconnect dialog"})}).on("destroy",function(){l=null}).open())}function r(){(0,a.trackEvent)("System","Critical Error"),n($.t("Oops, something went wrong"),$.t("Please report the issue or click Reconnect."),!0,500)}var s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.showCriticalErrorMessage=r,s=i(96),a=i(48),l=null},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.CustomEvent=function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.bubbles,n=void 0!==o&&o,r=i.cancelable,s=void 0!==r&&r,a=i.detail,l=void 0===a?null:a;try{return new window.CustomEvent(t,{bubbles:n,cancelable:s,detail:l})}catch(i){return e=document.createEvent("CustomEvent"),e.initCustomEvent(t,n,s,l),e}}},function(t,e,i){(function(t,o){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function c(){y.forEach(function(t){return t.close()})}var h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P;Object.defineProperty(e,"__esModule",{value:!0}),e.TVDialogAbstract=void 0,h=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},u=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.closeAllDialogs=c,d=i(28),p=r(d),i(696),_=i(262),f=n(_),i(656),i(648),m=i(110),g=n(m),v=0,y=[],b=void 0,S=110,w=$(document),T={closeOnEsc:!0,closeButton:!0,focusFirstControl:!0,closeOnOutsideClick:!0,closeButtonAddClass:"",focusClass:"i-focused",template:'<div class="tv-dialog">',errorTemplate:'<div class="tv-dialog__error i-slided{{# errorMod }} tv-dialog__error--{{ errorMod }}{{/ errorMod }}">{{{ error }}}</div>',titleTemplate:'<div class="tv-dialog__section tv-dialog__section--title js-dialog__drag"><div class="js-title-text tv-dialog__title">{{{ title }}}</div></div>',contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border">',
actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',closeButtonTemplate:'<div class="tv-dialog__close js-dialog__close">'+i(109)+"</div>",helpButtonTemplate:'<a href="{{{ link }}}" target="_blank" class="tv-dialog__help apply-common-tooltip" title="{{{ title }}}"></a>',helpActionsMod:"tv-dialog__section--actions_with-help"},x={default:"tv-button tv-button--default",primary:"tv-button tv-button--primary",success:"tv-button tv-button--success",danger:"tv-button tv-button--danger",warning:"tv-button tv-button--warning",link:"tv-button tv-button--link",checkbox:"tv-control-checkbox tv-control-checkbox--in-actions","default-ghost":"tv-button tv-button--default_ghost","primary-ghost":"tv-button tv-button--primary_ghost","success-ghost":"tv-button tv-button--success_ghost","danger-ghost":"tv-button tv-button--danger_ghost","warning-ghost":"tv-button tv-button--warning_ghost"},C={_default:'<div data-name="{{ name }}" class="js-dialog__action-click js-dialog__no-drag {{ class }}">{{ text }}</div>',"submit-success":'<button type="submit" class="tv-button tv-button--success">{{ text }}</button>'},$(function(){T.$wrap=$(document.all&&!document.querySelector?"html":"body")}),P=function(e){function i(){var e,o,n,r,l,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(s(this,i),e=a(this,(i.__proto__||Object.getPrototypeOf(i)).call(this)),e._id=v++,e.loadingActions=[],e.disabledActions=[],e.firstFocusControl=null,e.options=h({},T,c),e.$el=$(t.render(e.options.template,{title:e.options.title,closeButton:e.options.closeButton})),e.$el.addClass("js-dialog"),e.el=e.$el[0],e.options.addClass&&e.$el.addClass(e.options.addClass),e.options.width&&e.$el.css({width:"100%","max-width":e.options.width}),e.options.title&&(e.$title=$(t.render(e.options.titleTemplate,{title:e.options.title})).appendTo(e.$el)),e.$content=$(e.options.contentWrapTemplate).appendTo(e.$el),e.$contentIn=e.$content;e.$contentIn.length;)e.$contentIn=e.$contentIn.children();if(e.$contentIn=e.$contentIn.end(),e.options.content&&e.renderContent(e.options.content),(e.options.actions||e.options.help)&&(e.$content.hasClass("tv-dialog__section")&&e.$content.addClass("tv-dialog__section--no-padding_bottom"),e.$actions=$(e.options.actionsWrapTemplate).appendTo(e.$el)),e.options.actions)for(e.actions={},e.$el.on("click",".js-dialog__action-click",function(t){e.actionDispatcher($(t.currentTarget).data("name"))}),o=function(i){var o,n,r,s,a,l,c=e.options.actions[i];c.type||(c.type="default"),c.class||(c.class=x[c.type]?x[c.type]:x.default),"checkbox"===c.type?(o=new f.default({labelRight:c.text,name:c.name,checked:c.checked}),e.actions[c.name]=o.$el.appendTo(e.$actions),e.actions[c.name].on("change",function(t){setTimeout(function(){return TVSettings.setValue("publish.showIntroText",!o.checked)},0)})):e.actions[c.name]=$(t.render(c.template?c.template:C[c.type]||C._default,c,c)).appendTo(e.$actions),c.method&&"function"==typeof e[c.method]&&e.on("action:"+c.name,e[c.method].bind(e)),
c.addClass&&e.actions[c.name].addClass(c.addClass),c.key&&(n=void 0,"string"==typeof c.key&&c.key.split("+").length>1?(r=[],s=c.key.split("+"),n=function(t){r=[]},a=function(t){var i=""+t.keyCode;-1!==s.indexOf(i)&&r.indexOf(i)&&r.push(i),e._focused&&r.length===s.length&&(r=[],e.actionDispatcher(c.name))},e.on("afterOpen",function(){w.on("keydown",a),w.on("keyup",n)}),e.on("beforeClose",function(){w.off("keydown",a),w.off("keyup",n)})):(l=$.isArray(c.key)?c.key:[c.key],n=function(t){e._focused&&-1!==l.indexOf(t.keyCode)&&e.actionDispatcher(c.name)},e.on("afterOpen",function(){return w.on("keyup",n)}),e.on("beforeClose",function(){return w.off("keyup",n)})))},n=e.options.actions.length-1;n>=0;n--)o(n);return e.options.help&&$(t.render(e.options.helpButtonTemplate,e.options.help)).prependTo(e.$actions.addClass(e.options.helpActionsMod)),e.options.closeButton&&(r=$(e.options.closeButtonTemplate),r.addClass(e.options.closeButtonAddClass||""),l=e.$el,1===e.$el.find(".js-close-button-place").length&&(l=e.$el.find(".js-close-button-place")),r.appendTo(l)),e.setZIndex(S+y.length),c.errorMod&&(e.errorMod=c.errorMod),e.on("afterOpen",function(){e.options.focusFirstControl&&!Modernizr.touch&&(e.firstFocusControl||e.$el.find('input:not([type="hidden"]), textarea').first()).focus()}),e.$el.on("click",".js-dialog__close",e.close.bind(e)),e.$el.on("mousedown touchstart",e.focus.bind(e)),y.push(e),e}return l(i,e),u(i,[{key:"renderContent",value:function(t){return this.$contentIn.html("function"==typeof t?t(this):t),this}},{key:"setZIndex",value:function(t){return this.zIndex=t,this.trigger("change:zIndex",[this]),this}},{key:"toTop",value:function(){for(var t=y.length-1;t>=0;t--)y[t].zIndex>this.zIndex&&y[t].setZIndex(y[t].zIndex-1);return this.setZIndex(S+y.length),this}},{key:"isEventOut",value:function(t){var e,i,o;return this.options.isClickOutFn&&void 0!==(e=this.options.isClickOutFn(t))?e:(i=!0,o=$(t.target),o.get(0)!==this.$el.get(0)&&($(">*",this.$el).each(function(){o.get(0)===$(this).get(0)&&(i=!1),0===o.closest("HTML",$(this).get(0)).length&&(i=!1)}),i))}},{key:"focus",value:function(){var t=this;b&&b!==this&&b.unfocus(),this._setFocused(),this._focused=!0,this.$el.addClass(this.options.focusClass),this.trigger("focus",[this]),setTimeout(function(){w.on("mousedown.tv-dialog-unfocus-"+t._id,function(e){t.isEventOut(e)&&(t.unfocus(),w.off("mousedown.tv-dialog-unfocus-"+t._id))})},20)}},{key:"_setFocused",value:function(){b!==this&&(b=this)}},{key:"_setUnfocused",value:function(){b===this&&(b=void 0)}},{key:"unfocus",value:function(){b===this&&(this._setUnfocused(),this._focused=!1,this.$el.removeClass(this.options.focusClass).find(":focus").blur(),this.trigger("unfocus",[this]))}},{key:"isFocused",value:function(){return this._focused}},{key:"setTitle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.$title.toggleClass("tv-dialog__section--one-line apply-overflow-tooltip",e),this.$title.html(t),this}},{key:"setTitleText",value:function(t){this.$title.find(".js-title-text").text(t)}
},{key:"actionDispatcher",value:function(t){this.disabledActions.includes(t)||this.loadingActions.includes(t)||this.trigger("action:"+t,[this])}},{key:"toggleAction",value:function(t,e){return!e&&this.disabledActions.includes(t)?this.disabledActions.push(t):e&&this.disabledActions.includes(t)&&(this.disabledActions=o.without(this.disabledActions,t)),this.actions[t].toggleClass("i-disabled",!e),this}},{key:"actionLoader",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"init";return this.actions[t].tvButtonLoader(i),"init"===i&&(this.actions[t].off("tv-button-loader:start.dialog-action").on("tv-button-loader:start.dialog-action",function(){e.loadingActions.push(t)}),this.actions[t].off("tv-button-loader:stop.dialog-action").on("tv-button-loader:stop.dialog-action",function(){e.loadingActions=o.without(e.loadingActions,t)})),this}},{key:"error",value:function(e){var i=$(t.render(this.options.errorTemplate,{error:e,errorMod:this.errorMod})).appendTo(this.$el),o=function(){i.addClass("i-slided"),setTimeout(function(){return i.remove()},.75*p.dur)};return setTimeout(function(){return i.removeClass("i-slided")},20),w.one("touchstart mousedown keydown",o),this.trigger("error",[this,i]),this}},{key:"destroy",value:function(){y=o.without(y,this);for(var t=0;t<y.length;t++)y[t].setZIndex(S+t);this.trigger("destroy",[this])}},{key:"isOpened",value:function(){return!!this.opened}}]),i}(g.default),e.TVDialogAbstract=P,w.on("keyup.tv-dialog-esc",function(t){b&&b.options.closeOnEsc&&!$(".tv-dropdown__body.i-opened").length&&!$(t.target).closest(".js-dialog-skip-escape").length&&27===t.keyCode&&b.close()})}).call(e,i(54),i(192))},function(t,e,i){(function(t){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function l(){return 0!==S.length}var c,h,u,d,p,_,f,m,g,v,y,b,S,w;Object.defineProperty(e,"__esModule",{value:!0}),e.TVModal=void 0,c=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},h=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.isOpenedModals=l,u=i(28),d=n(u),
p=i(263),_=o(p),f=i(320),m=i(232),g=i(306),v=n(g),y=i(180),b=n(y),S=[],w={ajax:{},closingDuration:d.dur/2,overlayTemplate:'<div class="tv-dialog__overlay"></div>',containerTemplate:'<div class="tv-dialog__modal-wrap"><div class="tv-dialog__modal-container"><div class="tv-dialog__modal-body"></div></div></div>',ajaxErrorTemplate:'<div class="tv-dialog__error js-dialog__close">'+$.t("Error")+"</div>"},e.TVModal=function(e){function i(){var t,e,o,n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,i),t=s(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,c({},w,a))),t.$overlay=$(t.options.overlayTemplate),t.$modalWrap=$(t.options.containerTemplate),t.$body=t.$modalWrap.find(".tv-dialog__modal-body").append(t.$el),t.options.closeOnOutsideClick&&t.$overlay.add(t.$modalWrap).click(function(e){t.isEventOut(e)&&t.close()}),t.on("change:zIndex",function(){t.$overlay.css("z-index",t.zIndex),t.$modalWrap.css("z-index",t.zIndex)}),t.on("destroy",function(){var e=function(){t.$overlay.remove(),t.$modalWrap.remove()};t.opened?(t.close(),setTimeout(e,t.options.closingDuration)):e()}),t.on("beforeOpen",function(){S.push(t)}),t.options.ajax.url&&(e=t.options.ajax.beforeSend||$.noop,o=t.options.ajax.success||!1,n=t.options.ajax.error||$.noop,$.extend(t.options.ajax,{beforeSend:function(){t.trigger("beforeLoading",[t]),t.startSpinner(),e(t)},success:function(e){t.trigger("afterLoading",[t]),t.renderContent(o?o(t,e):e).showContent(),t.trigger("afterLoadingShow",[t])},error:function(){t.renderContent(t.options.ajaxErrorTemplate),n(t),t.trigger("errorLoading",[t])}})),t.on("error",function(e,i){t.$modalWrap[0].getBoundingClientRect().height<t.$content[0].getBoundingClientRect().height&&i.addClass("i-fixed").css({width:t.$el.width()})}),t}return a(i,e),h(i,[{key:"open",value:function(){var t,e=this;if(!this.opened)return this.opened=!0,v.disable(),b.disable(),_.default.setFixedBodyState(!0),t=function(){e.focus(),e.toTop(),$("body").append(e.$overlay.addClass("i-hidden i-closed").css("z-index",e.zIndex)).append(e.$modalWrap.addClass("i-hidden i-closed").css("z-index",e.zIndex)),e.trigger("beforeOpen",[e]),e.$overlay.removeClass("i-hidden"),setTimeout(function(){e.$overlay.removeClass("i-closed")},20),e.options.ajax.url?e.ajaxRequest=$.ajax(e.options.ajax):e.showContent()},_.default.isMobileSafari?setTimeout(function(){return t()},50):t(),this}},{key:"close",value:function(){var e=this;if(this.opened)return this.opened=!1,v.enable(),b.enable(),this.trigger("beforeClose",[this]),this.ajaxRequest&&(this.ajaxRequest.abort(),delete this.ajaxRequest),this.hideContent(),this.$overlay.addClass("i-closed"),setTimeout(function(){e.$modalWrap.addClass("i-hidden").detach(),e.$overlay.addClass("i-hidden").detach(),S=t.without(S,e),_.default.setFixedBodyState(!1),e.trigger("afterClose",[e]),e.unfocus(),S.length>0&&S[S.length-1].focus(),e.options.destroyOnClose&&e.destroy()},this.options.closingDuration),this}},{key:"showContent",value:function(){var t=this;return this.$modalWrap.removeClass("i-hidden"),setTimeout(function(){
t.$modalWrap.removeClass("i-closed")},20),setTimeout(function(){t.trigger("afterOpen",[t]),t.spinner&&t.stopSpinner()},.75*d.dur+20),this}},{key:"hideContent",value:function(){if(this.$el)return this.$modalWrap.addClass("i-closed"),this.unfocus(),this}},{key:"startSpinner",value:function(){return this.spinner=(0,m.unifiedSpinner)("xlarge",{color:d.color.black255,zIndex:!1}),this.spinner.spin(this.$overlay[0]),this}},{key:"stopSpinner",value:function(){if(this.spinner)return this.spinner.stop(),delete this.spinner,this}}]),i}(f.TVDialogAbstract)}).call(e,i(192))},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var l,c,h,u,d,p,_,f,m,g,v,y,b;Object.defineProperty(e,"__esModule",{value:!0}),e.TVPopup=void 0,l=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},c=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(28),u=n(h),d=i(263),p=o(d),_=i(320),f=i(207),m=i(179),g=$("body"),v=$(window),y={closeOnClickAtOtherDialogs:!0,draggable:!0,scrollWrap:'<div class="tv-dialog__scroll-wrap">',scrollWrapInner:'<div class="tv-dialog__scroll-wrap-inner">',withScroll:!0},b="js-dialog__scroll-wrap",e.TVPopup=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,e),t=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,l({},y,i))),t.$scrollWrap=t.$content.hasClass(b)?t.$content:t.$content.find("."+b),t.$scrollWrap.length?t.$scrollWrapInner=t.$scrollWrap.children().first():(t.$scrollWrap=t.$content.wrap($(t.options.scrollWrap)).parent(),t.$scrollWrapInner=t.$content.wrap($(t.options.scrollWrapInner)).parent()),t.$actions&&t.$scrollWrap.addClass("i-with-actions"),t.options.withScroll&&(t.scroll=new f.SidebarCustomScroll(t.$scrollWrap,t.$scrollWrapInner),t.scroll.scrolled.subscribe(null,function(){return t.trigger("scroll")})),t.$scrollWrap.css("overflow",""),t.$el.addClass("tv-dialog--popup i-closed i-hidden"),t.options.width&&t.$el.css({width:"calc(100% - 20px)","max-width":t.options.width}),t.$el.on("mousedown touchstart",t.toTop.bind(t)),
t.options.closeOnOutsideClick&&(t.on("beforeOpen",function(){setTimeout(function(){t.opened&&$(document).on("click.tv-popup-"+t.id,function(e){var i=$(e.target).closest(".js-dialog");(t.options.closeOnClickAtOtherDialogs||0===i.length)&&t.isEventOut(e)&&t.close()})},0)}),t.on("beforeClose",function(){return $(document).off("click.tv-popup-"+t.id)})),t.on("change:zIndex",function(){t.$el.css("z-index",t.zIndex)}),t.on("destroy",function(){var e=function(){t.$el.remove()};t.opened?(t.close(),setTimeout(e,u.dur/2)):e()}),t}return a(e,t),c(e,[{key:"open",value:function(){var t=this;return this.opened?this:(this.opened=!0,this.trigger("beforeOpen",[this]),this.$el.appendTo(this.options.$wrap).removeClass("i-hidden").css(function(){var e,i,o,n,r;return t.calcHeight(),e=v.height(),i=v.width(),o=t.$el.height(),n=t.$el.width(),r=t.options.position,r||(r={top:e/2-o/2,left:i/2-n/2}),r.top>e-o&&(r.top=e-o),r.left>i-n&&(r.left=i-n),r}()),this.focus(),this.toTop(),this._doOpenAnimation().then(function(){t.opened&&(t.$el.removeClass("i-closed"),t.options.draggable&&((0,m.lazyJqueryUI)(t.$el).draggable({handle:".js-dialog__drag",cancel:"input, textarea, button, select, option, .js-dialog__no-drag, .js-dialog__close",containment:"window",cursor:"-webkit-grabbing"}),t.$el.find(".js-dialog__drag").addClass("tv-dialog__grab")),t.trigger("afterOpen",[t]))}),v.on("resize.tv-popup-"+this.id,function(){t.calcHeight(),t.fixPos()}),this)}},{key:"close",value:function(){var t=this;if(this.opened)return this.trigger("beforeClose",[this]),this.$el.addClass("i-closed"),this.opened=!1,this._doCloseAnimation().then(function(){t.opened||((0,m.lazyJqueryUI)(t.$el).draggable("destroy"),t.$el.addClass("i-hidden").detach(),g.css("cursor","auto"),t.trigger("afterClose",[t]),t.options.destroyOnClose&&t.destroy())}),v.off("resize.tv-popup-"+this.id),this}},{key:"hide",value:function(){this.$el.addClass("i-hidden")}},{key:"show",value:function(){this.$el.removeClass("i-hidden")}},{key:"fixPos",value:function(){var t=this.$el[0].getBoundingClientRect(),e={};t.bottom>p.default.height-10&&(e.top=p.default.height-10-t.height,e.top<10&&(e.top=10)),t.right>p.default.width-10&&(e.left=p.default.width-10-t.width,e.left<10&&(e.left=10)),(e.top||e.left)&&this.$el.css(e)}},{key:"calcHeight",value:function(){var t,e,i=this.$el[0].getBoundingClientRect(),o=this.$scrollWrapInner[0].getBoundingClientRect(),n=this.$scrollWrap[0].getBoundingClientRect(),r=this.options.height&&this.options.height<p.default.height-20?this.options.height:p.default.height-20;this.$scrollWrap.css({height:""}).removeClass("i-scrollable"),t=this.$el[0].getBoundingClientRect(),(this.options.height||t.height>r)&&(r-=i.height-n.height,r<60&&(r=60),this.$scrollWrap.css({height:r})),this.options.withScroll&&this.scroll.resize(),e=r<o.height,e||this.$scrollWrapInner.css("top",0),this.$scrollWrap.toggleClass("i-scrollable",e),this.$actions&&this.$actions.toggleClass("tv-dialog__section--actions_with-border",e)}},{key:"updateScroll",value:function(){this.scroll&&(this.scroll.updateScroll(),
this.scroll.updateScrollBar())}},{key:"scrollToStart",value:function(){this.scroll&&this.scroll.scrollToStart()}},{key:"_doOpenAnimation",value:function(){return Promise.resolve()}},{key:"_doCloseAnimation",value:function(){return Promise.resolve()}}]),e}(_.TVDialogAbstract)},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.AutocompleteField=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(1093),e.AutocompleteField=function(){function t(e){var i=e.label,n=e.name,s=e.maxLength,a=e.error,l=void 0===a?"":a,c=e.source,h=e.valueField,u=e.textField;o(this,t),this._name=n,this._valueField=h,this._textField=u,this._error=l,this._$field=$('<label class="tv-rename-chart-dialog__field">\n\t\t\t\t<span class="tv-rename-chart-dialog__label">'+i+'</span>\n\t\t\t\t<tv-autocomplete name="'+n+'"><tv-autocomplete>\n\t\t\t</label>'),this._autocomplete=new r.Autocomplete({el:this._$field.find("tv-autocomplete").get(0),source:new r.ArraySource(c),textField:this._textField,maxLength:s}),this._preventDialogEvents()}return n(t,[{key:"appendTo",value:function(t){t.append(this._$field)}},{key:"focus",value:function(){this._autocomplete.input.focus()}},{key:"select",value:function(){this._autocomplete.input.focus(),this._autocomplete.input.select()}},{key:"_preventDialogEvents",value:function(){var t=this,e=function(t){return t.stopPropagation()};this._autocomplete.stream.addListener(r.events.BEFORE_OPEN_MENU,function(){t._$field.on("keypress keyup",e)}),this._autocomplete.stream.addListener(r.events.AFTER_CLOSE_MENU,function(){t._$field.off("keypress keyup",e)})}},{key:"value",get:function(){return this._autocomplete.value[this._valueField]}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){return!!this._autocomplete.input.value}},{key:"error",get:function(){return this._error}}]),t}()},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),e.CheckboxField=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(262),a=o(s),e.CheckboxField=function(){function t(e){var i=e.label,o=e.name,r=e.error,s=void 0===r?"":r,l=e.hint;n(this,t),this._name=o,this._error=s,this._checkboxView=new a.default({labelRight:i,name:o}),this._checkboxView.$el.addClass("tv-rename-chart-dialog__field"),l&&this._checkboxView.$el.append('<span class="tv-rename-chart-dialog__hint apply-common-tooltip" title=\''+l+"'></span>")}return r(t,[{
key:"appendTo",value:function(t){t.append(this._checkboxView.$el)}},{key:"focus",value:function(){}},{key:"select",value:function(){}},{key:"value",set:function(t){this._checkboxView.checked=t},get:function(){return this._checkboxView.checked}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){return!0}},{key:"error",get:function(){return this._error}}]),t}()},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s,a;Object.defineProperty(e,"__esModule",{value:!0}),e.InputFieldRegExp=void 0,s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(204),e.InputFieldRegExp=function(t){function e(t){var i,r;return o(this,e),i=t.regExp,delete t.regExp,r=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)),r._regExp=i,r}return r(e,t),s(e,[{key:"valid",get:function(){return this._regExp.test(this._$input.val())}}]),e}(a.InputField)},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o;Object.defineProperty(e,"__esModule",{value:!0}),o=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.InputField=function(){function t(e){var o=e.label,n=e.name,r=e.maxLength,s=e.error,a=void 0===s?"":s;i(this,t),this._name=n,this._$field=$('<label class="tv-rename-chart-dialog__field">\n\t\t\t\t<span class="tv-rename-chart-dialog__label">'+o+'</span>\n\t\t\t\t<input class="tv-control-input" type="text" name="'+n+'" maxlength="'+r+'"/>\n\t\t\t</label>'),this._$input=this._$field.find("input"),this._error=a}return o(t,[{key:"appendTo",value:function(t){t.append(this._$field)}},{key:"focus",value:function(){return this._$input.focus()}},{key:"select",value:function(){return this.focus().select()}},{key:"value",set:function(t){this._$input.val(t)},get:function(){return this._$input.val()}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){return!!this._$input.val().trim()}},{key:"error",set:function(t){this._error=t},get:function(){return this._error}}]),t}()},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,r
;Object.defineProperty(e,"__esModule",{value:!0}),e.SaveRenameDialog=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(657),r=i(96),e.SaveRenameDialog=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.fields,n=e.title,r=void 0===n?"":n,s=e.destroyOnClose,a=void 0===s||s,l=e.modal,c=void 0!==l&&l;o(this,t),this._$form=$("<div></div>"),this._fields=i,this._appendFieldsToForm(),this._title=r,this._destroyOnClose=a,this._modal=c}return n(t,[{key:"setField",value:function(t,e){this._fields.find(function(e){return e.name===t}).value=e}},{key:"show",value:function(){var t=this,e=this._createDialog(),i=new Promise(function(i){e.on("action:submit",function(e){return t._onSubmit(e,i)})});return e.open(),this._fields[0].select(),i}},{key:"_appendFieldsToForm",value:function(){var t=this;this._fields.forEach(function(e){e.appendTo(t._$form)})}},{key:"_createDialog",value:function(){return(0,r.createDialog)({type:this._modal?"modal":"popup",title:this._title,content:this._$form,actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions i-align_right tv-dialog__section--no-border">',width:470,destroyOnClose:this._destroyOnClose,actions:[{name:"submit",type:"primary",text:$.t("Save"),key:13,addClass:"js-submit-button"},{name:"cancel",type:"default",text:$.t("Cancel"),method:"close",addClass:"js-cancel-button"}]})}},{key:"_onSubmit",value:function(t,e){var i=this._validate();i?(t.error(i.error),i.focus()):(e(this._collectValues(),t),t.close())}},{key:"_validate",value:function(){return this._fields.find(function(t){return!t.valid})}},{key:"_collectValues",value:function(){return this._fields.reduce(function(t,e){return t[e.name]=e.value,t},{})}}]),t}()},,function(t,e){"use strict";function i(t,e){var i=function i(o){var n=i.cache,r=""+(e?e.apply(this,arguments):o);return n.hasOwnProperty(r)||(n[r]=t.apply(this,arguments)),n[r]};return i.cache={},i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,t.exports=e.default},function(t,e){"use strict";function i(t,e,i){var o,n,r,s,a=null,l=0;return i=i||{},s=function(){l=!1===i.leading?0:Date.now(),a=null,r=t.apply(o,n),a||(o=n=null)},function(){var c,h=Date.now();return l||!1!==i.leading||(l=h),c=e-(h-l),o=this,n=arguments,c<=0||c>e?(a&&(clearTimeout(a),a=null),l=h,r=t.apply(o,n),a||(o=n=null)):a||!1===i.trailing||(a=setTimeout(s,c)),r}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,t.exports=e.default},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t.reduce(function(t,e,i){return~t.indexOf(e)||t.push(e),t},[])},t.exports=e.default},,,,,,,,,,,,function(t,e){t.exports={14851:{},custom_items_in_context_menu:{},websocket_connection:{},countdown:{},symbol_search_parser_mixin:{},show_pro_features:{},daily_timeframe_suffix:{},symbollist_context_menu:{},
pay_attention_to_ticker_not_symbol:{},graying_disabled_tools_enabled:{},update_study_formatter_on_symbol_resolve:{},constraint_dialogs_movement:{},same_data_requery:{},phone_verification:{},show_trading_notifications_history:{},show_interval_dialog_on_key_press:{},header_interval_dialog_button:{subsets:["show_interval_dialog_on_key_press"]},header_fullscreen_button:{},header_symbol_search:{},symbol_search_hot_key:{},header_resolutions:{subsets:["header_interval_dialog_button"]},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},header_saveload_to_the_right:{},study_on_study:{},header_widget:{subsets:["header_widget_dom_node","header_symbol_search","header_resolutions","header_chart_type","header_settings","header_indicators","header_compare","header_undo_redo","header_fullscreen_button","compare_symbol"]},compare_symbol:{subsets:["header_compare"]},property_pages:{subsets:["show_chart_property_page","chart_property_page"]},show_chart_property_page:{},chart_property_page:{subsets:["chart_property_page_style","chart_property_page_scales","chart_property_page_background","chart_property_page_timezone_sessions","chart_property_page_events_alerts","chart_property_page_trading","chart_property_page_template_button"]},disable_userlink_popup:{},left_toolbar:{},keep_left_toolbar_visible_on_small_screens:{},hide_left_toolbar_by_default:{},control_bar:{},widget_logo:{},timeframes_toolbar:{},edit_buttons_in_legend:{subsets:["show_hide_button_in_legend","format_button_in_legend","study_buttons_in_legend","delete_button_in_legend"]},hide_legend_by_default:{},show_hide_button_in_legend:{},format_button_in_legend:{},study_buttons_in_legend:{},delete_button_in_legend:{},pane_context_menu:{},scales_context_menu:{},legend_context_menu:{},context_menus:{subsets:["pane_context_menu","scales_context_menu","legend_context_menu","objects_tree_context_menu"]},items_favoriting:{},save_chart_properties_to_local_storage:{},use_localstorage_for_settings:{subsets:["items_favoriting","save_chart_properties_to_local_storage"]},plain_studymarket:{},trading_watch_positions:{},disable_resolution_rebuild:{},border_around_the_chart:{},charting_library_debug_mode:{},cl_feed_return_all_data:{},log_data_request_time:{},saveload_requires_authentication:{},saveload_storage_customization:{},new_chart_creation_available:{},volume_force_overlay:{},create_volume_indicator_by_default:{},create_volume_indicator_by_default_once:{},saved_charts_count_restriction:{},lean_chart_load:{},stop_study_on_restart:{},star_some_intervals_by_default:{},predefined_items_only_may_be_starred:{},move_logo_to_main_pane:{},show_logo_on_all_charts:{},link_to_tradingview:{},logo_without_link:{},right_bar_stays_on_scroll:{},chart_content_overrides_by_defaults:{},show_dialog_on_snapshot_ready:{},snapshot_trading_drawings:{},allow_supported_resolutions_set_only:{},study_market_minimized:{},widgetbar_tabs:{},collapsible_header:{},show_extension_popup:{},study_templates:{},
side_toolbar_in_fullscreen_mode:{},remove_library_container_border:{},whotrades_auth_only:{},support_multicharts:{},display_market_status:{},display_data_mode:{},show_chart_warn_message:{},datasource_copypaste:{},line_tool_templates:{},expand_symbolsearch_items:{},symbol_search_three_columns_exchanges:{},symbol_search_flags:{},symbol_search_limited_exchanges:{},footer_share_buttons:{},footer_bugreport_button:{},footer_publish_idea_button:{},footer_screenshot:{},footer_showdom_button:{},text_notes:{},symbol_info:{},no_bars_status:{},clear_bars_on_series_error:{},hide_loading_screen_on_series_error:{},seconds_resolution:{},dont_show_boolean_study_arguments:{},hide_last_na_study_output:{},price_scale_always_last_bar_value:{},study_dialog_search_control:{},uppercase_instrument_names:{},cqg_trading_confirm_risks:{},trading_notifications:{},chart_crosshair_menu:{},japanese_chart_styles:{},linetoolpropertieswidget_template_button:{},use_overrides_for_overlay:{},timezone_menu:{},main_series_scale_menu:{},show_login_dialog:{},remove_img_from_rss:{},bars_marks:{},chart_scroll:{},chart_zoom:{},source_selection_markers:{},high_density_bars:{},open_account_manager:{},onchart_messages:{},custom_resolutions_box:{},referral_program_for_widget_owners:{},referral_program_policy_aggressive:{subsets:["referral_program_policy_passive","referral_program_policy_normal"]},referral_program_policy_normal:{subsets:["referral_program_policy_passive","header_fake_features_buttons","custom_resolutions_box"]},tv_production:{
subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","header_fullscreen_button","header_widget","dont_show_boolean_study_arguments","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","uppercase_instrument_names","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","new_chart_creation_available","saved_charts_count_restriction","create_volume_indicator_by_default","create_volume_indicator_by_default_once","charts_auto_save","right_bar_stays_on_scroll","save_old_chart_before_save_as","chart_content_overrides_by_defaults","alerts","show_dialog_on_snapshot_ready","show_extension_popup","header_saveload","header_saveload_to_the_right","header_layouttoggle","datasource_copypaste","show_saved_watchlists","watchlists_from_to_file","add_to_watchlist","property_pages","support_multicharts","display_market_status","display_data_mode","show_chart_warn_message","support_manage_drawings","widgetbar_tabs","study_templates","collapsible_header","line_tool_templates","caption_buttons_text_if_possible","footer_share_buttons","footer_screenshot","footer_publish_idea_button","text_notes","trading_watch_positions","symbol_info","linetoolpropertieswidget_template_button","cqg_trading_confirm_risks","trading_notifications","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","phone_verification","chart_events","onchart_messages","custom_resolutions_box","compare_symbol","timezone_menu","main_series_scale_menu","chart_crosshair_menu","study_on_study","japanese_chart_styles","show_login_dialog","dome_widget","bars_marks","chart_scroll","chart_zoom","screener_alerts","show_trading_notifications_history","source_selection_markers","go_to_date"]},browser_extension:{subsets:["disable_userlink_popup","show_pro_features","show_saved_watchlists","display_market_status","display_data_mode","show_chart_warn_message","widgetbar_tabs","show_login_dialog"]},widget:{
subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","uppercase_instrument_names","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","create_volume_indicator_by_default","create_volume_indicator_by_default_once","right_bar_stays_on_scroll","show_dialog_on_snapshot_ready","dont_show_boolean_study_arguments","header_widget_dom_node","header_symbol_search","header_resolutions","header_chart_type","header_compare","header_indicators","star_some_intervals_by_default","display_market_status","display_data_mode","show_chart_warn_message","symbol_info","linetoolpropertieswidget_template_button","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","widgetbar_tabs","compare_symbol","timezone_menu","main_series_scale_menu","show_login_dialog","plain_studymarket","japanese_chart_styles","bars_marks","chart_scroll","chart_zoom","source_selection_markers","property_pages"]},bovespa_widget:{subsets:["widget","header_settings","chart_property_page_timezone_sessions","linetoolpropertieswidget_template_button"]},charting_library_base:{subsets:["14851","allow_supported_resolutions_set_only","border_around_the_chart","collapsible_header","constraint_dialogs_movement","context_menus","control_bar","create_volume_indicator_by_default","custom_items_in_context_menu","datasource_copypaste","daily_timeframe_suffix","uppercase_instrument_names","display_market_status","edit_buttons_in_legend","graying_disabled_tools_enabled","header_widget","header_saveload","header_saveload_to_the_right","dont_show_boolean_study_arguments","lean_chart_load","left_toolbar","trading_watch_positions","link_to_tradingview","pay_attention_to_ticker_not_symbol","plain_studymarket","predefined_items_only_may_be_starred","refresh_saved_charts_list_on_dialog_show","right_bar_stays_on_scroll","saveload_storage_customization","show_dialog_on_snapshot_ready","stop_study_on_restart","study_market_minimized","timeframes_toolbar","symbol_search_hot_key","update_study_formatter_on_symbol_resolve","update_timeframes_set_on_symbol_resolve","use_localstorage_for_settings","volume_force_overlay","widget_logo","countdown","use_overrides_for_overlay","trading_notifications","compare_symbol","symbol_info","timezone_menu","main_series_scale_menu","study_dialog_search_control","chart_crosshair_menu","create_volume_indicator_by_default_once","bars_marks","chart_scroll","chart_zoom","source_selection_markers","property_pages","go_to_date","adaptive_logo"]},charting_library:{subsets:["charting_library_base","header_screenshot"]},static_charts_service:{subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},trading_terminal:{
subsets:["charting_library_base","footer_showdom_button","support_multicharts","header_layouttoggle","japanese_chart_styles","chart_property_page_trading","footer_screenshot","add_to_watchlist","open_account_manager","show_dom_first_time"]},cqg_terminal:{subsets:["charting_library_base","chart_property_page_trading","expand_symbolsearch_items","caption_buttons_text_if_possible","clear_bars_on_series_error","no_bars_status","hide_loading_screen_on_series_error","support_multicharts","header_layouttoggle","same_data_requery","footer_bugreport_button","footer_showdom_button","dome_widget","show_dom_first_time","japanese_chart_styles","remove_img_from_rss","footer_screenshot","add_to_watchlist"]},amp_terminal:{subsets:["cqg_terminal"]}}},,,function(t,e,i){"use strict";var o=i(315).TimePointIndexSearchMode,n=i(76).UndoHistory,r=i(82),s=i(80),a=i(734),l=i(390),c=i(388),h=c.ChartApiInterface,u=c.HandlerInfo,d=i(34).requireFullInterfaceImplementation,p=i(13).getLogger("Chart.ChartApiLocal"),_=i(71);TradingView.STUDY_COUNT_LIMIT=120,JSServer.ChartApi=function(t){this._notificationHandlers={},this._sessions={},this.studyCounter=0,this._connected=!1,this._enabled=!1,this._studyEngine=new a(t),this._callbacks={},this._symbolIdCache={},this._seriesIdCache={},this._recentSeriesId={},this._enableLogging=!1,this._enabledMoreBarsRequest=!0,this._serverTimeOffset=0,this._autosaveTimeoutSeconds=5;var e=this;this._studyEngine.on("configuration_received",function(){e._fireEvent("configuration_received")}),this._studyEngine.on("realtime_tick",function(t){var i={time:t.value[0]/1e3,open:t.value[1],high:t.value[2],low:t.value[3],close:t.value[4],volume:t.value[5]};e._fireEvent("realtime_tick",i,!0)}),this._autosavePaused=void 0,this._setupAutoSave()},JSServer.ChartApi.prototype._makeSymbolKey=function(t,e){if(!t||!e)throw Error("incorrect identifiers");return t+"_"+e},JSServer.ChartApi.prototype._makeSeriesKey=function(t,e){if(!t||!e)throw Error("incorrect identifiers");return t+"_"+e},JSServer.ChartApi.prototype.destroy=function(){this._studyEngine.destroy(),this._studyEngine=null},JSServer.ChartApi.prototype.purgeCache=function(t){this._symbolIdCache={},this._studyEngine.purgeCache(),this._studyEngine.purgeRangeExtensionData(),this._studyEngine.purgeDataCache()},JSServer.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(t){this._enabledMoreBarsRequest=t},JSServer.ChartApi.prototype.setTimeFramesList=function(t){var e,i,o,n,r,a,l,c;for(this._timeframes=[],e=/(\d+)(\w+)/,i=0;i<t.length;++i)o=t[i],n=e.exec(o.text),r=n[2].toLowerCase(),a=parseInt(n[1]),l="y"===r?12*a+"m":a+r,c=s.Symbol.parsePeriod(o.resolution),this._timeframes.push({text:$.t(o.title)||a+$.t(r,{context:"dates",count:a}),description:o.description||"",value:l,targetResolution:o.resolution,requiresIntraday:c.isIntraday})},JSServer.ChartApi.prototype._setupAutoSave=function(){var t=this,e=!1;n.undoStack().onChange().subscribe(this,function(){t._autosavePaused?e=!0:(setTimeout(t._fireEvent.bind(t,"onAutoSaveNeeded",void 0,!0),0),t._autosavePaused=setTimeout(function(){
e&&t._fireEvent("onAutoSaveNeeded",void 0,!0),t._autosavePaused=void 0,e=!1},1e3*t._autosaveTimeoutSeconds))})},JSServer.ChartApi.prototype.setAutoSaveDelay=function(t){this._autosaveTimeoutSeconds=+t},JSServer.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols},JSServer.ChartApi.prototype.availableTimeFrames=function(t,e){return t?e!==_.STATUS_DELAYED&&e!==_.STATUS_DELAYED_STREAMING&&e!==_.STATUS_READY?[]:this._timeframes.filter(function(e){return!(e.requiresIntraday&&!t.has_intraday)&&!(t.supported_resolutions&&t.supported_resolutions.indexOf(e.targetResolution)<0)}):[]},JSServer.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||{1:1,3:1,5:1,15:1,30:1,45:1,60:1,120:1,180:1,240:1,D:1,W:1,M:1}},JSServer.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()},JSServer.ChartApi.prototype.supportedExchangesList=function(){return this._studyEngine.supportedExchangesList()},JSServer.ChartApi.prototype.futuresRegex=function(){return this._studyEngine.futuresRegex()},JSServer.ChartApi.prototype.start=function(){this._enabled=!0,this._fireEvent("start_enabled")},JSServer.ChartApi.prototype._logMessage=function(t){this._enableLogging&&console.log(t)},JSServer.ChartApi.prototype.unsubscribe=function(t,e){var i=this._callbacks[t];i&&i.splice(i.indexOf(e),1)},JSServer.ChartApi.prototype.on=function(t,e){return this._callbacks.hasOwnProperty(t)||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},JSServer.ChartApi.prototype._fireEvent=function(t,e,i){var o,n;if(this._callbacks.hasOwnProperty(t))for(o=this._callbacks[t].slice(0),i||(this._callbacks[t]=[]),n=0;n<o.length;++n)o[n](e)},JSServer.ChartApi.prototype.chartCreateSession=function(t,e){},JSServer.ChartApi.prototype.chartDeleteSession=function(t){},JSServer.ChartApi.prototype.createSession=function(t,e){TradingView.ChartapiMessagerInstances[t]=new l(this,t),this._sessions[t]=e,this._notificationHandlers[t]={},this.connected()&&e.onMessage({method:"connected",params:[]})},JSServer.ChartApi.prototype.removeSession=function(t){delete this._sessions[t],delete this._notificationHandlers[t],this._studyEngine.stopSources(t)},JSServer.ChartApi.prototype.connected=function(){return this._connected},JSServer.ChartApi.prototype.connect=function(){if(!this._enabled){var t=this;return void this.on("start_enabled",function(){t.connect()})}this.connected()||(this._connected=!0,this.sessionid="dummy session id",this._notifySessions({method:"connected",params:[]}))},JSServer.ChartApi.prototype.disconnect=function(){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.switchTimezone=function(t,e){if(TradingView.ChartapiMessagerInstances[t].timezone()!==e&&(TradingView.ChartapiMessagerInstances[t].setTimezone(e),this._recentSeriesId[t])){var i=this;this._doWhenSeriesSymbolIdIsReady(t,this._recentSeriesId[t],function(e){var o=i._seriesIdCache[i._makeSeriesKey(t,i._recentSeriesId[t])].resolution
;i._studyEngine.recreateSources(e.name,o,t,!0),i._doWhenSeriesDataReceived(t,function(){var o=i._seriesIdCache[i._makeSeriesKey(t,i._recentSeriesId[t])].resolution,n=TradingView.ChartapiMessagerInstances[t].lastBarTime(i._recentSeriesId[t]);n&&i._studyEngine.rebuildExtrapolatedData(t,e.name,o,e.info,1e3*n)})})}},JSServer.ChartApi.prototype.receiveLocalResponse=function(t){this._logMessage("< "+t.method),this._dispathNotification(t),this._fireEvent("message_"+t.method,void 0,!0)},JSServer.ChartApi.prototype.getMarks=function(t,e,i,o,n){this._studyEngine.getMarks(t,e,i,o,n)},JSServer.ChartApi.prototype.getTimescaleMarks=function(t,e,i,o,n){this._studyEngine.getTimescaleMarks(t,e,i,o,n)},JSServer.ChartApi.prototype.resolveSymbol=function(t,e,i,o,n){function r(e,o){TradingView.ChartapiMessagerInstances[t].onSymbolError(e,o),TradingView.ChartapiMessagerInstances[t].onSeriesClearData(0,""),s._symbolIdCache[s._makeSymbolKey(t,e)]={name:i,status:"invalid_symbol"},s._fireEvent("resolve_fail",{session:t,symbolId:e},!0),s._fireEvent(s._makeSymbolKey(t,e)+"_resolve_fail")}this._notificationHandlers[t][e]=new u(o,e),this._symbolIdCache[this._makeSymbolKey(t,e)]=null;var s=this;this._studyEngine.resolveSymbol(i,function(o){if(o.errmsg)return void r(e,o.errmsg);s._symbolIdCache[s._makeSymbolKey(t,e)]={name:i,info:o,status:"ok"},s._fireEvent("symbol_resolved",{symbolInfo:o,symbolId:e,session:t},!0),s._fireEvent(s._makeSymbolKey(t,e)+"_resolved",o),TradingView.ChartapiMessagerInstances[t].onSymbolResolved(e,o)},function(t){r(e,t)})},JSServer.ChartApi.prototype._doWhenSymbolIdIsReady=function(t,e,i){function o(){return{name:r._symbolIdCache[r._makeSymbolKey(t,e)].name,info:r._symbolIdCache[r._makeSymbolKey(t,e)].info}}function n(){s&&(i(o()),s=!1,r.unsubscribe(r._makeSymbolKey(t,e)+"_resolved",n),r.unsubscribe(r._makeSymbolKey(t,e)+"_resolve_fail",n))}var r=this,s=!0;this._symbolIdCache[this._makeSymbolKey(t,e)]?n():(this.on(this._makeSymbolKey(t,e)+"_resolved",n),this.on(this._makeSymbolKey(t,e)+"_resolve_fail",n))},JSServer.ChartApi.prototype._doWhenSeriesDataReceived=function(t,e){TradingView.ChartapiMessagerInstances[t].seriesCompleted.subscribe(null,e,!0)},JSServer.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(t,e,i,o){function n(){var e=c._symbolIdCache[c._makeSymbolKey(t,h)];return{name:e.name,info:e.info}}function r(){i(n())}function s(){c.unsubscribe("symbol_resolved",l),c.unsubscribe("resolve_fail",a)}function a(e){e.symbolId===h&&e.session===t&&(s(),o&&o())}function l(e){e.symbolId===h&&e.session===t&&(s(),r())}var c=this,h=this._seriesIdCache[t+"_"+e].symbolId;this._symbolIdCache[this._makeSymbolKey(t,h)]?r():(this.on("symbol_resolved",l),this.on("resolve_fail",a))},JSServer.ChartApi.prototype.createSeries=function(t,e,i,o,n,r,a){i=i||"";var l=this;this._notificationHandlers[t][e]=new u(function(r){if("series_completed"===r.method){var c=s.Symbol.parsePeriod(n);c.range&&l._applyRange(t,o,e,i,c.range)}a(r)},e),this._recentSeriesId[t]=e,
TradingView.ChartapiMessagerInstances[t].setResolution(s.Symbol.parsePeriod(n).pureResolution),this._seriesIdCache[t+"_"+e]={symbolId:o,resolution:n,turnaround:i},this._studyEngine.updateSeriesTurnaround(t,e,i),this._doWhenSeriesSymbolIdIsReady(t,e,function(o){l._studyEngine.seriesTurnaround(t,e)===i&&l._studyEngine.createSeries(o.name,n,t,e,i)})},JSServer.ChartApi.prototype.removeSeries=function(t,e,i){this._notificationHandlers[t][e]=new u(i,e),this._studyEngine.removeSeries(t,e)},JSServer.ChartApi.prototype.setVisibleTimeRange=function(t,e,i,n,r){function s(){var s,l;a=t.data(),s=[a.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,o.FromLeft),a.plotValueToTimePointIndex(n,TradingView.TIME_PLOT,o.FromRight)],a.valueAt(s[1])[0]<n&&t.syncModel()&&(l=t.syncModel().distance(a.valueAt(s[1])[0],n),l.success&&(s[1]+=l.result)),TradingView.ChartapiMessagerInstances[e].onSeriesTimeframeUpdate(c,h._seriesIdCache[e+"_"+c].turnaround,s[0],s[1],!0),t.requestMoreData(),r&&r()}var a=t.data(),l=!!a.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,o.FromLeft),c=this._recentSeriesId[e],h=this;l?s():(this._studyEngine.ensureExtendedTo(c,e,i),this._doWhenSeriesDataReceived(e,s))},JSServer.ChartApi.prototype._exactBarsCountOfTimeFrame=function(t,e){var i,o=chartWidget.model().mainSeries().bars(),n=chartWidget.model().mainSeries().symbolInfo().session,s=o._valueAt(o.size()-1)[0],a=r.alignPeriodsBack(n,t.resolution,t.interval,1,1e3*s),l=o.size();for(a/=1e3,i=0,i=0;i<l&&!(o._valueAt(i)[0]>a);++i);return l-i},JSServer.ChartApi.prototype._applyRange=function(t,e,i,o,n){var r,s,a,l=chartWidget.model().mainSeries().bars().size();0!==l&&(r=this._exactBarsCountOfTimeFrame(n,this._symbolIdCache[this._makeSymbolKey(t,e)].info),s=Math.max(0,l-1-r),a=Math.max(s,l-1),TradingView.ChartapiMessagerInstances[t].onSeriesTimeframeUpdate(i,o,s,a))},JSServer.ChartApi.prototype.modifySeries=function(t,e,i,o,n,r,a){var l,c;i=i||"",l=this._seriesIdCache[t+"_"+e]?this._seriesIdCache[t+"_"+e].resolution:void 0,TradingView.ChartapiMessagerInstances[t].setResolution(s.Symbol.parsePeriod(n).pureResolution),c=this,this._notificationHandlers[t][e]=new u(function(a){var h,u;"series_completed"===a.method&&(h=s.Symbol.parsePeriod(l),u=s.Symbol.parsePeriod(n),u.range&&h.range!==u.range&&c._applyRange(t,o,e,i,u.range)),r(a)},e),this._recentSeriesId[t]=e,this._studyEngine.updateSeriesTurnaround(t,e,i),a&&(this._seriesIdCache[this._makeSeriesKey(t,a)]=null),this._seriesIdCache[this._makeSymbolKey(t,e)]={symbolId:o,resolution:n,turnaround:i},this._doWhenSeriesSymbolIdIsReady(t,e,function(e){c._studyEngine.purgeRangeExtensionData(t),c._studyEngine.recreateSources(e.name,n,t,!0)})},JSServer.ChartApi.prototype.requestMoreData=function(t,e,i,o){if(this._enabledMoreBarsRequest){var n=this;setTimeout(function(){n._notificationHandlers[t][e]=new u(o,e),n._studyEngine.extendSeriesRange(e,t,i)})}},JSServer.ChartApi.prototype.setStudiesAccessController=function(t){this.studiesAccessController=t},JSServer.ChartApi.prototype.setWatchlistSettings=function(t){this._watchlistSettings=t},
JSServer.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()},JSServer.ChartApi.prototype.requestMetadata=function(t,e,i){this._notificationHandlers[t][e]=new u(i,e);var o=this.studiesAccessController.getEnabledTools();TradingView.ChartapiMessagerInstances[t].onRequestMetadata(e,o)},JSServer.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<TradingView.STUDY_COUNT_LIMIT},JSServer.ChartApi.prototype.createStudy=function(t,e,i,o,n,r,s){var a,l,c;if(!this.isCanCreateStudy())throw Error("Exceeded the limit of studies");a=this,i=i||"",this._notificationHandlers[t][e]=new u(s,e),l=this._seriesIdCache[this._makeSeriesKey(t,o)].symbolId,c=this._seriesIdCache[this._makeSeriesKey(t,o)].resolution,this._doWhenSymbolIdIsReady(t,l,function(o){a._studyEngine.createStudy(o.name,c,t,e,i,n,r),a.studyCounter++})},JSServer.ChartApi.prototype.rebindStudy=function(t,e,i,o,n,r,s,a){throw Error("Not implemented")},JSServer.ChartApi.prototype.removeStudy=function(t,e){this._notificationHandlers[t][e]=null,this._studyEngine.removeStudy(t,e),this.studyCounter--},JSServer.ChartApi.prototype.modifyStudy=function(t,e,i,o,n){var r=this;setTimeout(function(){i=i||"",r._notificationHandlers[t][e]=new u(n,e),r._studyEngine.recomputeStudy(e,o,t,i)},0)},JSServer.ChartApi.prototype.createPointset=function(t,e,i,o,n,r,s){i=i||"",this._notificationHandlers[t][e]=new u(s,e);var a=this;this._doWhenSymbolIdIsReady(t,o,function(i){a._studyEngine.createPointset(t,e,i.info.full_name,i.info,n,r)})},JSServer.ChartApi.prototype.modifyPointset=function(t,e,i,o,n){throw Error("This call is not implemented")},JSServer.ChartApi.prototype.removePointset=function(t,e,i){this._notificationHandlers[t][e]=null,this._studyEngine.removePointset(e)},JSServer.ChartApi.prototype.requestMoreTickmarks=function(t,e,i,o){this._notificationHandlers[t][e]=new u(o,e);var n=this;this._doWhenSeriesSymbolIdIsReady(t,e,function(o){var r=n._seriesIdCache[n._makeSeriesKey(t,e)].resolution;n._studyEngine.onMoreTickmarksRequested(t,o.name,o.info,r,i)})},JSServer.ChartApi.prototype.requestFirstBarTime=function(t,e,i,o){this._notificationHandlers[t][e]=new u(o,e)},JSServer.ChartApi.prototype._invokeHandler=function(t,e){t&&t(e)},JSServer.ChartApi.prototype._sendRequest=function(t,e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._onMessage=function(t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._convertTimescaleResponse=function(t){var e,i=t.marks;for(e=0;e<i.length;++e)i[e]={span:i[e][0],time:i[e][1],index:i[e][2]};return t},JSServer.ChartApi.prototype._dispathNotification=function(t){var e,i,o,n,r,s,a,l,c,h,u=t.params.shift();if(this._notificationHandlers[u])switch(t.method){case"timescale_update":e=t.params[0],i=t.params[1],o=this._convertTimescaleResponse(i),o.clear=0===i.changes.length&&0===i.marks.length,this._sessions[u].onMessage({method:"timescale_update",params:o});for(n in e)r={},r.customId=n,r.plots=e[n].series,e[n].ns&&(r.nonseries=e[n].ns),
r.turnaround=e[n].turnaround,s={method:"data_update",params:r},this._invokeNotificationHandler(u,n,s);break;case"tickmark_update":o=this._convertTimescaleResponse(t.params[0]),o.changes=[],this._sessions[u].onMessage({method:"timescale_update",params:o});break;case"data_update":for(n in t.params[0]){a=t.params[0][n],r={},r.customId=n,r.plots=a.series?a.series:a.plots,r.turnaround=a.turnaround,"s"in a&&"ns"in a&&(r.plots=a.s,r.nonseries=a.ns);for(l=0;l<r.plots.length;l++)for(c in r.plots[l].value)1e100===r.plots[l].value[c]&&(r.plots[l].value[c]=void 0);s={method:"data_update",params:r},this._invokeNotificationHandler(u,n,s)}break;case"index_update":for(n in t.params[0])s={method:"index_update",params:t.params[0][n]},this._invokeNotificationHandler(u,n,s);break;case"critical_error":p.logNormal(new Date+" critical_error session:"+this.sessionid+" reason:"+t.params[0]),this._sessions[u].onMessage({method:"critical_error",params:t.params});break;case"quote_symbol_data":case"quote_list_fields":case"depth_symbol_error":case"depth_symbol_success":case"dd":case"dpu":case"depth_bar_last_value":this._sessions[u].onMessage({method:t.method,params:t.params});break;default:h=t.params[0],this._invokeNotificationHandler(u,h,t)}},JSServer.ChartApi.prototype._invokeNotificationHandler=function(t,e,i){if(void 0!==e){var o=this._notificationHandlers[t][e];void 0!==o&&o&&this._invokeHandler(o.handler,i),"series_deleted"!==i.method&&"study_deleted"!==i.method||delete this._notificationHandlers[t][e]}},JSServer.ChartApi.prototype.searchSymbols=function(t,e,i,o,n,r,s,a,l){0===t.length&&0===e.length&&0===i.length&&l([]),this._studyEngine.searchSymbols(t,e,i,l)},JSServer.ChartApi.prototype._notifySessions=function(t){var e,i;for(e in this._sessions){if(!this._sessions.hasOwnProperty(e))return;i=this._sessions[e],"function"==typeof i.onMessage&&i.onMessage(t)}},JSServer.ChartApi.prototype.unpack=function(t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.quoteCreateSession=function(t){return this._studyEngine.quoteCreateSession(t)},JSServer.ChartApi.prototype.quoteDeleteSession=function(t){return this._studyEngine.quoteDeleteSession(t)},JSServer.ChartApi.prototype.quoteSetFields=function(t,e){return this._studyEngine.quoteSetFields(t,e)},JSServer.ChartApi.prototype.quoteAddSymbols=function(t,e){return-1!==e.indexOf(void 0)&&(console.warn("Got undefined in quoteAddSymbols"),e=e.filter(function(t){return!!t})),this._studyEngine.quoteAddSymbols(t,e)},JSServer.ChartApi.prototype.quoteRemoveSymbols=function(t,e){return this._studyEngine.quoteRemoveSymbols(t,e)},JSServer.ChartApi.prototype.quoteFastSymbols=function(t,e){return this._studyEngine.quoteFastSymbols(t,e)},JSServer.ChartApi.prototype.quoteHibernateAll=function(t){return this._studyEngine.quoteHibernateAll(t)},JSServer.ChartApi.prototype.depthCreateSession=function(t){return this._studyEngine.depthCreateSession(t)},JSServer.ChartApi.prototype.depthDeleteSession=function(t){return this._studyEngine.depthDeleteSession(t)},
JSServer.ChartApi.prototype.depthSetSymbol=function(t,e){return this._studyEngine.depthSetSymbol(t,e)},JSServer.ChartApi.prototype.depthClearSymbol=function(t){},JSServer.ChartApi.prototype.depthSetScale=function(t,e){},JSServer.ChartApi.prototype.createStudiesAccessController=function(t,e,i){return new this.StudiesAccessController(this._studyEngine,t&&JSON.parse(t)||{type:"black",tools:[]})},JSServer.ChartApi.prototype.StudiesAccessController=function(t,e){this._studyEngine=t,this._studiesAccess=e},JSServer.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(t){var e,i,o=null;for(e=0;e<this._studiesAccess.tools.length;++e)if(i=this._studiesAccess.tools[e],i.name===t||i===t){o=i;break}return o},JSServer.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){return this._studyEngine.studiesMetadata().filter(function(t){var e=this._findTool(t.description);return"black"===this._studiesAccess.type?!e||e.grayed:!!e},this)},JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(t){var e=this._findTool(t);return e&&e.grayed},JSServer.ChartApi.prototype.serverTimeOffset=function(){return this._studyEngine.serverTimeOffset()},JSServer.ChartApi.prototype.alignTimePoint=function(t,e,i){return this._studyEngine.alignTimePoint(t,e,i)},JSServer.ChartApi.prototype.disconnectCount=function(){return 0},d(JSServer.ChartApi,"JSServer.ChartApi",h,"ChartApiInterface"),t.exports=JSServer.ChartApi},function(t,e,i){"use strict";var o=function(){function t(t,e,i){return t+","+e+","+i}function e(e,i,o){delete n[t(e,i,o)]}function o(e,i,o){function s(t){return"undefined"!=typeof TradingView&&TradingView.ChartapiMessagerInstances?n[t]=new a(TradingView.ChartapiMessagerInstances[e],l.pureResolution):n[t]=new a(null,l.pureResolution),n[t]}var l=r.Symbol.parsePeriod(o),c=t(e,i,l.pureResolution);return n[c]?n[c]:s(c)}var n={},r=i(80),s=i(82),a=function(t,e,i){this._chartApiMessager=t,this._lastRealBarTime=null,this._lastRealBarIndex=null,this._resolution=e,this._extrapolatedBarsCache=[],this._onReadyCallbacks=[],this._requestedAmountOfBars=0,this._maxDepth=i||100};return a.prototype.ready=function(){return null!==this._lastRealBarIndex},a.prototype.rebuild=function(t,e){this._lastRealBarTime=t;var i=Math.max(this._extrapolatedBarsCache.length,this._requestedAmountOfBars);this._extrapolatedBarsCache=[],this.ensureExtrapolatedToBar(e,i)},a.prototype.historyExtrapolator=function(){return void 0===this._historyExtrapolator&&(this._historyExtrapolator=new a(null,this._resolution,Math.max(this._maxDepth,1e3))),this._historyExtrapolator},a.prototype.getPointTimeUTC=function(t,e,i){var o,n;return 0===e?t:!this.ready()||t<this._lastRealBarTime/1e3?(this.historyExtrapolator().setLastBarTime(0,1e3*t),this.historyExtrapolator().getPointTimeUTC(t,e,i)):(o=0===this._extrapolatedBarsCache.length||t===this._lastRealBarTime/1e3,n=o?-1:this.indexOfBar(t,i)-this._lastRealBarIndex-1,this.ensureExtrapolatedToBar(i,n+e+1),this._extrapolatedBarsCache[n+e])},
a.prototype.findDistanceInBars=function(t,e,i){return t===e?0:(this.historyExtrapolator().setLastBarTime(0,1e3*t),this.historyExtrapolator().indexOfBar(e,i))},a.prototype.indexOfBar=function(t,e){this._ensureExtrapolatedToTime(e,1e3*t);var i=s.lower_bound(this._extrapolatedBarsCache,t,function(t,e){return t>e?1:t<e?-1:0});return-1===i?i:this._lastRealBarIndex+i+1},a.prototype._extrapolateData=function(t,e){var i,o,n;if(!this._lastRealBarTime)throw Error("No real bars known, so cannot extrapolate anything");if(!(i=e(this._lastRealBarTime))||0===i.length)return void(null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,t,this._resolution));for(o=0;o<i.length;++o)i[o]=i[o]/1e3;for(i[0]===this._lastRealBarTime/1e3&&(i=i.slice(1)),this._extrapolatedBarsCache=i,n=i.slice(0),n.sort(),o=0;o<n.length-1;++o)n[o]===n[o+1]&&console.error("Duplicating extrapolated bars: duplicated "+new Date(1e3*n[o]));null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,i,t,this._resolution)},a.prototype.onTickmarksNeeded=function(t,e){if(this.ready())this.ensureExtrapolatedToBar(t,e);else{var i=this;this._onReadyCallbacks.push(function(){i.ensureExtrapolatedToBar(t,e)})}},a.prototype.ensureExtrapolatedToBar=function(t,e){var i=this;return this._requestedAmountOfBars=e,this._extrapolateData(t,function(o){return i._extrapolatedBarsCache.length>=e||!i._shouldExtrapolateMore()?null:s.extrapolateBarsFrontByCount(i.newBarBuilder(t),o,e)})},a.prototype._ensureExtrapolatedToTime=function(t,e){var i=this;return this._extrapolateData(t,function(o){var n,r;return o>=e||!i._shouldExtrapolateMore()?null:(n=2e3,r=s.extrapolateBarsFrontToTime(i.newBarBuilder(t),o,e,n),r[r.length-1]<e&&console.warn("Extrapolation error: not enough data created"),r)})},a.prototype.newBarBuilder=function(t){var e=r.Symbol.newSession(t.timezone,t.session);return r.Symbol.newBarBuilder(this._resolution,e)},a.prototype._shouldExtrapolateMore=function(){return this._extrapolatedBarsCache.length<this._maxDepth},a.prototype.setLastBarTime=function(t,e){(null===this._lastRealBarIndex||this._lastRealBarIndex===t&&this._lastRealBarTime!==e)&&(this._extrapolatedBarsCache=[]),this._extrapolatedBarsCache&&this._extrapolatedBarsCache.length&&this._lastRealBarIndex!==t&&(this._lastRealBarIndex>t?this._extrapolatedBarsCache=[]:this._lastRealBarTime!==e&&this._extrapolatedBarsCache.shift(t-this._lastRealBarIndex)),this._lastRealBarIndex=t,this._lastRealBarTime=e;for(var i=0;i<this._onReadyCallbacks.length;++i)this._onReadyCallbacks[i]();this._onReadyCallbacks=[]},{remove:e,storage:o}}();t.exports=o},function(t,e){"use strict";var i=function(){function t(t){return t.is_price_study}function e(t,e){var i,o=e.slice(0).toLowerCase();if(t){for(i=0;i<t.length;++i)if(t[i].description.toLowerCase()===o||t[i].shortDescription.toLowerCase()===o)return t[i];throw Error("Can't find metainfo for `"+e+"`")}
throw Error("There is no studies metainfo at all")}function i(t){return t.inputs.map(function(t){return{id:t.id,type:t.type,name:t.name}})}function o(o,n){var r,a,l,c,h,u,d,p,_;if(!Array.isArray(o))return r=e(n.model().studiesMetaData(),o),{id:r.id,overlay:t(r)};for(a=o.slice(0),l=a[0],r=e(n.model().studiesMetaData(),l),c=t(r),h=i(r),d=a.splice(1),p=0;p<d.length;++p)u||(u={}),_=s[h[p].type]||s.string,u[h[p].id]=_(d[p]);return{id:r.id,name:l,overlay:c,inputs:u}}function n(t,o,n){function r(t){return t.name.toLowerCase()===a}var s,a,l,c=e(n.model().studiesMetaData(),t),h=i(c),u={};for(s in o)a=s.toLowerCase(),l=h.filter(r),0!==l.length?(l=l[0],u[l.id]=o[s]):console.warn("Uknown input `"+s+"` of `"+t+"`");return{id:c.id,name:t,inputs:u}}var r={},s={bool:function(t){return!!t},integer:function(t){return parseInt(t)},float:function(t){return parseFloat(t)},string:function(t){return t}};return r.getStudyRecordFromArray=function(t,e){return e=e||chartWidget,o(t,e)},r.getStudyRecordFromObject=function(t,e,i){return i=i||chartWidget,n(t,e,i)},r}();t.exports=i},function(t,e,i){"use strict";var o=i(7);window.onload=function(){function t(){var t=0;return JSON.parse(urlParams.logo).image&&(t="C",o.enabled("link_to_tradingview")||(t="D")),t}function e(){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(t){return!1}}location.hostname.indexOf(".")>=0&&!e()&&setTimeout(function(){try{var e=t();window.ga&&0!==e&&Math.random()>.98&&window.ga("send","event","s",e)}catch(t){}},3e4)}},function(t,e,i){(function(e){"use strict";var o=i(82),n={},r=function(t,i,r){function s(){var t={};t.symbolname=_,t.status="ok",t.values={},t.values.current_session=d,n[_]=d,TradingView.ChartapiMessagerInstances[f].onQuotesData([f].concat([t]))}function a(t,i,n){var r=e.get_timezone(i);c=(new o.Session).init(r,t),h=n,m=setTimeout(l,6e4),l(),s()}function l(){var t,e;if(c){if(h)return void(d="out_of_session");t=o.isTradingNow(new Date,c),e=t?"market":"out_of_session",e!==d&&(d=e,s())}}var c,h,u={},d=n[r]||"out_of_session",p=!1,_=r,f=i,m=null;return t.resolveSymbol(r,function(t){p||a(t.session,t.timezone,t.expired)},function(){}),u.stop=function(){p=!0,m&&clearTimeout(m)},u.marketStatus=function(){return d},u};t.exports=r}).call(e,i(67))},function(t,e,i){(function(e){"use strict";var o=i(1100).HeikenAshi,n=i(57).Interval,r=function(){function t(t){this.host=t,this.cache={}}function r(t){var e=t.indexOf(",");return-1===e?t:t.slice(0,e)}function s(t,e,i,o,n){return n+t+e+i+(a(o)?"_":"")}function a(t){return t.has_empty_bars||t.force_session_rebuild}function l(t){if(0!==t.indexOf("="))return{symbol:t};var e;try{e=JSON.parse(t.slice(1))}catch(e){return{symbol:t}}return e.type&&(0===e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?e.builder=new o:console.error("unknown builder type: "+e.type)),"string"!=typeof e.symbol&&(e.session=e.symbol.session||e.session,e.symbol=e.symbol.symbol),e}function c(e){t.instance=new t(e),p.setupFeed(t.instance)}
var h,u,d,p=i(80),_=i(82),f=p.Symbol,m=p.StudyEngine,g=p.BarBuilder,v=p.BarSet;return t.prototype.getCache=function(t){return this.cache[t]},t.prototype.putCache=function(t,e){this.cache[t]=e},t.prototype.subscribe=function(t,e,i,o,n,r,a,l){var c=s(t,e,i,r,a),h=this.getCache(c);return h||(h=this.createItem(t,e,i,r,l,a),this.putCache(c,h)),h.listeners.addListener(o,n),{key:c,listener:o}},t.prototype.unsubscribe=function(t){var e=this.getCache(t.key);e&&e.listeners.removeListener(t.listener)},t.prototype.removeUnused=function(){var t,e,i,o,n,r=[];for(t in this.cache)this.cache[t]&&(e=this.cache[t],0===e.listeners.listenersCount()&&r.push(t));if(0!==r.length){for(i=0;i<r.length;i++)o=r[i],n=this.cache[o],this.cache[o]=null,n.stop();this.removeUnused()}},t.prototype.rebuildFrom=function(t,e,i){var o,n,r,s,a=f.parsePeriod(t),l=f.parsePeriod(e);if(""!==a.resolution&&!a.isSeconds){if(i.has_weekly_and_monthly)return a.resolution;if(void 0===i.has_daily||i.has_daily)return"D";""!==l.resolution&&(l.resolution="",l.interval=i.intraday_multipliers?i.intraday_multipliers[0]:1)}if(a.isIntraday&&void 0!==i.has_intraday&&!i.has_intraday)return"";if(a.isSeconds&&!i.has_seconds)return"";if(o=""!==a.resolution?l.interval:""===l.resolution?Math.min(a.interval,l.interval):a.interval,(n=a.isIntraday?i.intraday_multipliers:i.seconds_multipliers)&&-1===n.indexOf(o)){for(r=n.length-1;r>=0;r--)if(s=+n[r],o%s==0)return s+(a.isSeconds?"S":"");return""}return o+(a.isSeconds?"S":"")},t.prototype.createItem=function(t,e,i,o,s,c){var p,_,f,m,v,y,b=new d,S=l(t);return S.builder?new u(b,S.symbol,e,i,S.builder,o,s,c):(p=r(e),_=this.rebuildFrom(p,r(i),o),f=a(o),!n.isEqual(p,_)||f?(m=o.has_empty_bars,v=$.extend({},o),f&&(v.has_empty_bars=!1,v.force_session_rebuild=!1),new u(b,S.symbol,e,_,new g(e,m),v,s,c)):(y=S.session&&"extended"!==S.session,new h(b,S.symbol,e,i,y,this.host,o,s)))},h=function(t,e,i,o,n,s,a,l){this.listeners=t,this.host=s;var c=this;this.host.resolve(e,function(t){n&&t.regular_session&&(t.session=t.regular_session);var s=c.calculateFromTo(t,o||i,e,l);c.subs=c.host.subscribe(t,r(i),s,function(t){c.listeners.fire(t)},function(t){c.listeners.onError(t)})},function(t){c.listeners.onError(t)})},h.prototype._createDWMAligner=function(t,i){var o=e.get_timezone(i.timezone),n=new _.Session;return n.init(o,i.session),f.newBarBuilder(t,n,n)},h.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)},h.prototype.calculateFromTo=function(t,i,o,n){var r,s,a,l,c,h,u,d,p=f.parsePeriod(i),m=(new Date).valueOf(),g=t.expired?e.cal_to_utc(e.get_timezone(t.timezone),new Date(1e3*t.expiration_date))||m:m;return""===p.resolution?(s=p.interval,a="D"):"S"===p.resolution?(s=10*p.interval,a=""):(l="D"===p.resolution?1:"W"===p.resolution?5:30,s=12*l*p.interval,a="M"),p.range?(s=p.range.interval,a=p.range.resolution):this.host.calculateHistoryDepth&&(c=this.host.calculateHistoryDepth(i,a,s))&&(s=c.intervalBack||s,a=void 0===c.resolutionBack?a:c.resolutionBack),h=t.sessionString||t.session,r=_.alignPeriodsBack(h,a,s,1,g),
n&&n.getRangeExtensionTime&&(u=n.getRangeExtensionTime())&&(r=Math.min(1e3*u,r)),n&&n.getRangeExtensionCount&&(d=n.getRangeExtensionCount())>0&&(r=_.alignPeriodsBack(h,p.resolution,p.interval,d,r)),{from:r,to:g+6e4}},u=function(t,e,i,o,n,r,s,a){if(this.listeners=t,this.isRecalculated=!1,""===o)return console.error("unsupported resolution for rebuild: "+i),void this.listeners.onError("unsupported resolution for rebuild: "+i);this.symbolInfo=r;var l=this;this.engine=new m({tickerid:e,period:o,periodBase:i,body:n,sessionId:a,symbolInfo:r,rangeExtension:s,recalc:function(t,e){l._recalc(e)},out:function(t,e){l._out(t,e)},nonseriesOut:function(t,e){l._nonseriesOut(t,e)},setNoMoreData:function(){l.barset&&(l.barset.endOfData=!0)},onErrorCallback:function(t){l.listeners.onError(t)}})},u.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},u.prototype._recalc=function(t){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new v(this.symbolInfo)),t&&(this.barset.nextTime=t.nextTime,this.barset.endOfData=t.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},u.prototype._nonseriesOut=function(t,e){var i=Object.assign({},e);i.nonseries=!0,i.data=e.bars,delete i.bars,i.barsetSize=this.barset?this.barset.count():0,i.lastBar=this.barset?this.barset.bar(this.barset.count()-1):null,this.listeners.fire(i,!0)},u.prototype._out=function(t,e){var i,o,n,r,s,a,l,c=e[0];if(!isNaN(c)){if(i={time:c,open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5],updatetime:e[6]},o=e[7],this.barset||(this.barset=new v(t.info)),(n=e[8])instanceof Array)for(r=0;r<n.length;r++)s=e[9],a=n[r],l={time:a,open:s,high:s,low:s,close:s,volume:0,updatetime:a},this.barset.add(l,!0),this.isRecalculated&&this.listeners.fire(this.barset);this.barset.add(i,o),this.barset.isBarClosed=o,this.isRecalculated&&this.listeners.fire(this.barset)}},d=function(){this.listeners=[]},d.prototype.listenersCount=function(){return this.listeners.reduce(function(t,e){return t+(e?1:0)},0)},d.prototype.addListener=function(t,e){this.listeners.push({dataListener:t,onErrorCallback:e}),this.barset&&t(this.barset),this.errorMsg&&e(this.errorMsg)},d.prototype.removeListener=function(t){var e,i=this.listeners.filter(function(e){return e.dataListener===t});0!==i.length&&(e=this.listeners.indexOf(i[0]),delete this.listeners[e])},d.prototype.onError=function(t){var e,i,o,n;for(this.errorMsg=t||"unspecified error",e=this.listeners,i=e.length,o=0;o<i;o++)(n=e[o])&&n.onErrorCallback&&n.onErrorCallback(t)},d.prototype.fire=function(t,e){var i,o,n,r;for(e||(this.barset=t),i=this.listeners,o=i.length,n=0;n<o;n++)(r=i[n])&&r.dataListener(t)},{setupFeed:c,parseSymbol:l,unsubscribeUnused:function(){t.instance.removeUnused()}}}();t.exports=r}).call(e,i(67))},function(t,e,i){"use strict";var o=i(80);i(264),JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,
trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol"}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(1),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,r,s,a;return this._context=t,i=this._context.new_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_var(this._context.symbol.time),r=o.Std[e(0)](this._context),s=this._context.new_var(r),this._context.select_sym(0),a=s.adopt(n,i,0),[a]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{symbol:""}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{title:"open"},high:{title:"high"},low:{title:"low"},close:{title:"close"}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(0),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,i=this._context.new_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_var(this._context.symbol.time),r=this._context.new_var(o.Std.open(this._context)),s=this._context.new_var(o.Std.high(this._context)),a=this._context.new_var(o.Std.low(this._context)),l=this._context.new_var(o.Std.close(this._context)),this._context.select_sym(0),[r.adopt(n,i,0),s.adopt(n,i,0),a.adopt(n,i,0),l.adopt(n,i,0)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{showMA:!1,maLength:20}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"},{id:"maLength",name:"MA Length",defval:20,type:"integer",min:1,max:2e3}],id:"Volume@tv-basicstudies-1"},
constructor:function(){this.f_0=function(t,e){return o.Std.gt(t,e)?0:1},this.f_1=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c;return this._context=t,this._input=e,i=this._input(0),n=o.Std.volume(this._context),r=this.f_0(o.Std.open(this._context),o.Std.close(this._context)),s=o.Std.volume(this._context),a=this._context.new_var(s),l=o.Std.sma(a,this._input(1),this._context),c=this.f_1(i,l),[n,r,c]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Zig Zag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=i/100,s=n/2,a=o.Std.zigzag(r,s,this._context),l=o.Std.zigzagbars(r,s,this._context),c=a,h=l,[c,h]}}},{name:"Sessions",metainfo:{_metainfoVersion:44,defaults:{graphics:{vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}},linkedToSeries:!0,precision:4},description:"Sessions",graphics:{vertlines:{sessBreaks:{name:"Session Break"}}},id:"Sessions@tv-basicstudies-1",inputs:[],is_hidden_study:!0,is_price_study:!0,name:"Sessions@tv-basicstudies",palettes:{},plots:[],shortDescription:"Sessions"},constructor:function(){function t(t,e){return{id:t,time:t,extendBottom:!0,extendTop:!0}}this.init=function(){this._times=[]},this._getVerticalLineData=function(e){return o.Std.selectSessionBreaks(e,this._times).map(t)},this.main=function(t,e){var i,n,r;return o.Std.isdwm(t)?null:(i=o.Std.time(t),isNaN(i)?null:(n=this._times.length,0!==n&&this._times[n-1]===i||this._times.push(i),t.symbol.isLastBar&&t.symbol.isNewBar?(r=this._getVerticalLineData(t),0===r.length?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{styleId:"sessBreaks",data:r}]},erase:[{action:"all"}]}}}):null))}}},{name:"SuperTrend",metainfo:{_metainfoVersion:39,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:3,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_2:{linestyle:0,linewidth:3,plottype:"shape_arrow_up",trackPrice:!1,location:"BelowBar",transparency:35,visible:!0,color:"#00FF00"},plot_3:{linestyle:0,linewidth:3,plottype:"shape_arrow_down",trackPrice:!1,location:"AboveBar",transparency:35,visible:!0,color:"#FF0000"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#008000",width:3,style:0},1:{color:"#800000",width:3,style:0}}}},inputs:{in_0:10,in_1:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",
target:"plot_0",type:"colorer"},{id:"plot_2",type:"shapes"},{id:"plot_3",type:"shapes"}],styles:{plot_0:{title:"SuperTrend",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Up Arrow",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Down Arrow",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"SuperTrend",shortDescription:"SuperTrend",is_price_study:!0,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:100},{id:"in_1",name:"Factor",defval:3,type:"float",min:1,max:100}],id:"SuperTrend@tv-basicstudies-1",scriptIdPart:"",name:"SuperTrend",isCustomIndicator:!0},constructor:function(){this.f_0=function(){var t,e,i,n,r,s=this._input(0),a=this._input(1),l=o.Std.atr(s,this._context);return s=o.Std.hl2(this._context)+l*a,l=o.Std.hl2(this._context)-l*a,t=this._context.new_var(o.Std.close(this._context)),a=this._context.new_var(),e=o.Std.max(l,a.get(1)),a.set(o.Std.gt(t.get(1),a.get(1))?e:l),l=this._context.new_var(),e=o.Std.min(s,l.get(1)),l.set(o.Std.lt(t.get(1),l.get(1))?e:s),s=this._context.new_var(),t=o.Std.nz(s.get(1),1),t=o.Std.lt(o.Std.close(this._context),a.get(1))?-1:t,s.set(o.Std.gt(o.Std.close(this._context),l.get(1))?1:t),a=o.Std.eq(s.get(0),1)?a.get(0):l.get(0),i=o.Std.eq(s.get(0),1)?0:1,n=1===s.get(0)&&-1===s.get(1),r=-1===s.get(0)&&1===s.get(1),[a,i,n,r]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_0();return[i[0],i[1],i[2],i[3]]}}}])},function(t,e,i){(function(e){"use strict";var o=i(82),n=i(57).Interval,r=function(){function t(t,e){return t}function r(t,e){var i=m.get_timezone(t.timezone),n=new o.Session;return n.init(i,t.session),f.Symbol.newBarBuilder(e,n,n)}function s(e,i,o,n,r,s){var a,l,c,h,u=t(i,o);for(p.hasOwnProperty(u)||(p[u]=[]),a=[],l=0;l<n.length;++l)n[l][1]<0&&(n[l][1]=0),0!==n[l][1]?(c=r.getPointTimeUTC(n[l][0],n[l][1],s),a.push(c)):n[l][0]&&a.push(n[l][0]);h={guid:e,points:a},p[u].push(h)}function a(t){var e,i,o;for(e in p)for(i=p[e],o=0;o<i.length;++o)if(i[o].guid===t)return void i.splice(o,1)}function l(t,e,i,o,n){var r,s,a,l=[];for(r=0;r<t.points.length;++r){if(s=t.points[r],null===(a=h(e,s,i,o,n)))return null;l.push({index:r,value:[a,s]})}return l}function c(e,i,o,n,r,s){var a,c,h,u,d=t(e,i);if(p.hasOwnProperty(d))for(a=p[d].length,c=0;c<a;++c)h=p[d][c],null!==(u=l(h,o,n,r,i))&&s(h.guid,u)}function h(t,e,i,n,s){var a,l;return 1e3*(e=r(n,s).alignTimeIfPossible(1e3*e)/1e3)<t[0].value[0]?-d(n,s,e,t[0].value[0]/1e3,i):(a=o.lower_bound(t,1e3*e,function(t,e){return t.value[0]>e?1:t.value[0]<e?-1:0}))>=0&&e<t[t.length-1].value[0]?(t[a].value[0]/1e3!==e&&0!==a&&a--,t[a].index):(l=i.indexOfBar(e,n),-1===l?null:l)}function u(t,e,i,o,r){function s(t,e){var i=new Date(1e3*t),o=new Date(1e3*e),n=12*(o.getFullYear()-i.getFullYear());return n-=i.getMonth()+1,n+=o.getMonth(),n<=0?0:n}var a,l,c,h,u,d,p,_,f,g,v,y,b,S,w;if(e.kind()===n.MONTHS)a=s(o,r)/e.multiplier();else if(e.kind()===n.WEEKS)l=Math.ceil((r-o)/604800),a=Math.ceil(l/e.multiplier());else{
if(c=m.utc_to_cal(i.timezone,+new Date(1e3*o)),h=m.utc_to_cal(i.timezone,+new Date(1e3*r)),(u=(r-o)/86400)>4*(7-i.spec.weekEndsCount()))p=u/7,d=p*(7-i.spec.weekEndsCount());else{for(_=0,f={},g=c;g.valueOf()<=h.valueOf();g=m.add_days_considering_dst(i.timezone,g,1))v=m.get_day_of_week(g),void 0===f[v]&&(f[v]=i.spec.isWeekEnd(v)),f[v]&&_++;d=u-_}if(e.kind()===n.DAYS)a=Math.ceil(d/e.multiplier());else{if(y=e.kind()===n.HOURS?60*e.multiplier()*60:e.kind()===n.SECONDS?e.multiplier():60*e.multiplier(),u<1&&(b=i.spec.findSessionEntry(m.get_day_of_week(c),m.get_minutes_from_midnight(c)),S=i.spec.findSessionEntry(m.get_day_of_week(h),m.get_minutes_from_midnight(h)),b===S))return Math.ceil((r-o)/y);v=i.spec.entries()[0].dayOfWeek(),w=60*i.spec.entries().reduce(function(t,e){return t+(e.dayOfWeek()===v?e.length():0)},0),a=Math.ceil(d*w/y)}}return a}function d(t,e,i,s,a){var l,c,h=new n(e),d=m.get_timezone(t.timezone),p=new o.Session;return p.init(d,t.session),l=r(t,e),i=l.alignTimeIfPossible(1e3*i)/1e3,s=l.alignTimeIfPossible(1e3*s)/1e3,i>=s?0:(c=u(t,h,p,i,s),c>=1e3?c:a.findDistanceInBars(i,s,t))}var p={},_="undefined"!=typeof window?window:e,f=i(80),m=_.PineJsCalendar?_.PineJsCalendar:i(67);return{createPointset:s,removePointset:a,broadcastPointsetsUpdates:c,tests:{approxBarsInterval:u,indexOfTime:h}}}();t.exports=r}).call(e,function(){return this}())},function(t,e,i){(function(e,o){"use strict";function n(t,i){var o=e.get_timezone(i.timezone),n=new f.Session;return n.init(o,i.session),u.Symbol.newBarBuilder(t,n,n)}function r(t,e){null!=t.graphicsCmds&&null!=t.graphicsCmds.create&&null!=t.graphicsCmds.create.vertlines&&t.graphicsCmds.create.vertlines.forEach(function(t){t.data.forEach(e)})}function s(t,e){var i,o,n,r,s=t.length,a=e.length,l=0;for(i=0;i<s;++i){for(o=t[i];l<a&&e[l].value[0]<o;)++l;if(l>=a){n=s-i,console.warn("Times array contains times which is more than last series bar time. Excess count "+n);break}r=e[l],o!==r.value[0]&&console.warn("Times array contains time which does not presented in series data "+o),t[i]=r.index}}function a(t,e){var i,o;null!==e&&0!==e.length&&(i={},r(t.data,function(t){i[t.time]=!0}),o=Object.keys(i).map(Number).sort(function(t,e){return t-e}),o.forEach(function(t,e){i[t]=e}),r(t.data,function(t){t.index=i[t.time]}),s(o,e),t.indexes=o)}var l,c,h=i(730),u=i(80),d=i(731),p=i(727),_=i(733),f=i(82),m=i(57).Interval,g=i(43);i(264),i(390),l=i(1098).DatafeedRequestsCachedProcessor,c=function(t){function e(t,e){return!o.enabled("disable_resolution_rebuild")&&m.isDWM(t)?n(t,e):null}function i(t,e,i){return function(o){var r,s;o&&o.count()&&(r=n(e,t),s=1e3*c.getCurrentUTCTime(),r.moveTo(s),r.indexOfBar(s)>=0&&o.setLastBarClosed(!1)),i(o)}}function r(t,e,o,n,r){return c._cachedDatafeed.subscribe(t,e,o,i(t,e,n),r)}function s(t){return c._cachedDatafeed.unsubscribe(t)}function a(t,e,i){c.resolveSymbol(t,e,i)}var c=this;this._studiesCache={},this._sessionsLastDataCache={},this._metainfoCache=[],this._barsCoefficientsCache={},this._extrapolationManager=p,this._externalDatafeed=t,
this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._callbacks={},this._serverTimeOffset=0,c._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),c._datafeedConfiguration=c._adoptConfigurationData(window.configurationData),c._fireEvent("configuration_received"),c._externalDatafeed.getServerTime&&c._externalDatafeed.getServerTime(function(t){c._serverTimeOffset=t-(new Date).valueOf()/1e3}),this._pointsetsManager=_,this._rangeExtensionData={},this._quotesInfo=[],this._depthInfo=[],this._fullNameSymbolInfoMap={},this._endOfData={},this._computeStudyCounter=0,this._createDWMAligner=e,this._cachedDatafeed=new l(t,e),this._extendedRange=function(t){return c._rangeExtensionData[t]&&c._rangeExtensionData[t].summary},this._extendedTime=function(t){return c._rangeExtensionData[t]&&c._rangeExtensionData[t].time},d.setupFeed({resolve:a,subscribe:r,unsubscribe:s,calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth?this._externalDatafeed.calculateHistoryDepth.bind(this._externalDatafeed):void 0})},c.prototype._barsCoefficients=function(t,e){if(0!==t.indexOf("="))return{};var i=t+e;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},c.prototype.destroy=function(){this._cachedDatafeed.destroy(),this._externalDatafeed=null},c.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={}},c.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},c.prototype._logMessage=function(t){o.enabled("charting_library_debug_mode")&&console.log(t)},c.prototype._extendRange=function(t,e){this._rangeExtensionData[t]||(this._rangeExtensionData[t]={}),void 0===this._rangeExtensionData[t].summary&&(this._rangeExtensionData[t].summary=0),this._rangeExtensionData[t].summary+=e},c.prototype.on=function(t,e){return this._callbacks.hasOwnProperty(t)||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},c.prototype._fireEvent=function(t,e,i){var o,n;if(this._callbacks.hasOwnProperty(t)){for(o=this._callbacks[t],n=0;n<o.length;++n)o[n](e);i||(this._callbacks[t]=[])}},c.prototype._adoptConfigurationData=function(t){var e,i,o,n=TradingView.merge({},t),r=n.supported_resolutions;if(!r||0===r.length)return n.supported_resolutions=void 0,n;for(e={},i=0;i<r.length;i++){if(o=r[i],e.hasOwnProperty(o))throw Error("Duplicating resolution `"+o+"`");e[o]=1}return n.supported_resolutions=e,n},c.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions},c.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]},c.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]},c.prototype.futuresRegex=function(){return this._datafeedConfiguration.futures_regex||/$a/},c.prototype._findStudyObject=function(t){var e=t.split("@")[0],i=JSServer.studyLibrary.filter(function(i){return i.metainfo.id===t||i.metainfo.shortDescription===e})
;if(0===i.length)throw Error("Study `"+t+"` not found");return i[0]},c.prototype.getMarks=function(t,e,i,o,n){var r,s={red:6,green:5,blue:4,yellow:3};this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks&&(this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name,n,new Date(1e3*e).toUTCString(),new Date(1e3*i).toUTCString())),r=this,this._externalDatafeed.getMarks(t,e,i,function(e){var i,a,l=e.map(function(t){return t.time=parseInt(t.time),t});r._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name,n,JSON.stringify(l))),i=r._createDWMAligner(n,t),a=l.map(function(t){return t.tickmark=null!==i?i.tradingDayToSessionStart(1e3*t.time)/1e3:t.time,t.direction=s[t.color],t.onClicked=function(){g.emit("onMarkClick",t.id)},t.label=!!t.label&&t.label[0],t}),o(a)},n))},c.prototype.getTimescaleMarks=function(t,e,i,o,n){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name,n,new Date(1e3*e).toUTCString(),new Date(1e3*i).toUTCString()));var r=this;this._externalDatafeed.getTimescaleMarks(t,e,i,function(e){var i,s;r._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name,n,JSON.stringify(e))),i=r._createDWMAligner(n,t),s=e.map(function(t){return t.tickmark=null!==i?i.tradingDayToSessionStart(1e3*t.time)/1e3:t.time,t}),o(s)},n)}},c.prototype._computeStudy=function(t,e,i,o,n,r,s,a,l,c){function h(t,e,i){var o,n,r,s,l=t.time,c="number"==typeof e?[e]:e;for(o=0;o<c.length;++o)n=c[o],n&&"object"==typeof n&&(f["plot_"+o]=n.offset,n=n.value,m++),"number"==typeof n&&isNaN(n)&&(n=void 0),c[o]=n;r=_.length-1,s=r<0||l>_[r].value[0],s?_.push({index:_.length,value:[l].concat(c)}):_[r].value=[l].concat(c),d||a([_[_.length-1]],s,_.length,f,i)}var d=!0,p=this._computeStudyCounter++,_=[],f={},m=0,g=!1,v=this,y=function(a){var p;if(u.Symbol.parsePeriod(o).isIntraday&&!a.has_intraday)return void l("Unsupported resolution");if(p=new u.StudyEngine({tickerid:i,symbolInfo:a,period:o,body:e,sessionId:t,onErrorCallback:l,rangeExtension:{getRangeExtensionCount:v._extendedRange.bind(this,t),getRangeExtensionTime:v._extendedTime.bind(this,t)},input:function(t){return r[t]},out:function(t,e){h(t,e,a)},nonseriesOut:function(t,e){c(e,a)},setNoMoreData:function(){g=!0},recalc:function(t,e){d=!1,_.endOfData=g,s(_,m>0?f:void 0,a,e)}}),!v._studiesCache[t]||!v._studiesCache[t][n])throw Error("This should never happen");v._studiesCache[t][n].engine=p},b=function(t){l(t)},S=function(){return v._studiesCache[t]&&v._studiesCache[t][n]&&v._studiesCache[t][n].activeResolve===p};v._studiesCache[t][n].activeResolve=p,this.resolveSymbol(i,function(){S()&&y.apply(v,arguments)},function(){S()&&b.apply(v,arguments)})},c.prototype._createStudy=function(t,e,i,o,n,r,s){function l(t){var e,i,r;if(Array.isArray(t))return t;for(e=[],i=h._studiesCache[o][n].metainfo.inputs,
r=0;r<i.length;r++)e[r]=t[i[r].id];return e}function c(i,s,a){TradingView.ChartapiMessagerInstances[o].onDataUpdate(n,r,h._convertBarsTimeToUnix(i),s,a,h._extendedRange(t,e)),TradingView.ChartapiMessagerInstances[o].onStudyCompleted(n,r)}var h=this;s=l(s),TradingView.ChartapiMessagerInstances[o].onStudyLoading(n,r),h._computeStudy(o,i,t,e,n,s,function(t,e,i){c(t,e?{data:{offsets:e}}:null,i)},function(i,s,a,l,c){var u=l?{data:{offsets:l}}:null;TradingView.ChartapiMessagerInstances[o].onDataUpdate(n,r,h._convertBarsTimeToUnix(i),u,c,h._extendedRange(t,e))},function(t){TradingView.ChartapiMessagerInstances[o].onStudyError(n,t)},function(t,e){switch(t.type){case"projection":this._updateProjectionData(o,n,r,t);break;case"study_graphics":var i={data:t.data,indexes:[]};a(i,h._sessionsLastDataCache[o]),c([],i,e);break;default:console.warn("unsupported non-series data type for study "+t.type)}}.bind(this))},c.prototype.stopSources=function(t){var e,i;for(e in this._studiesCache[t])(i=this._studiesCache[t][e])&&(i.engine&&i.engine.stop(),i.activeResolve=-1);d.unsubscribeUnused()},c.prototype.recreateSources=function(t,e,i,o){var n,r;this.stopSources(i);for(n in this._studiesCache[i])(r=this._studiesCache[i][n])&&(r.symbol=t,r.resolution=e,"series"===r.type&&this.createSeries(t,e,i,n,r.turnaround,o));for(n in this._studiesCache[i])(r=this._studiesCache[i][n])&&"study"===r.type&&this._createStudy(t,e,r.studyObject,i,n,r.turnaround,r.inputs)},c.prototype.removeStudy=function(t,e){this._studiesCache[t]&&this._studiesCache[t][e]&&this._studiesCache[t][e].engine&&(this._studiesCache[t][e].engine.stop(),d.unsubscribeUnused()),this._studiesCache[t][e]=null},c.prototype.removeSeries=function(t,e){this.removeStudy(t,e)},c.prototype.recomputeStudy=function(t,e,i,o){var n=this._studiesCache[i][t];if(!n)throw Error("This should never happen");n.inputs=e,n.turnaround=o,n.engine&&n.engine.stop(),this._createStudy(n.symbol,n.resolution,n.studyObject,i,t,o,e)},c.prototype._convertBarsTimeToUnix=function(t){var e,i,o=[];for(e=0;e<t.length;++e)i={index:t[e].index,value:[].concat(t[e].value)},i.value[0]/=1e3,o.push(i);return o.endOfData=t.endOfData,o},c.prototype.createStudy=function(t,e,i,o,n,r,s){var a=this._findStudyObject(r),l=new a.constructor;this._studiesCache[i]=this._studiesCache[i]||{},this._studiesCache[i][o]={studyObject:l,symbol:t,resolution:e,guid:o,type:"study",inputs:s,metainfo:a.metainfo,turnaround:n},this._createStudy(t,e,l,i,o,n,s)},c.prototype.purgeRangeExtensionData=function(t){t?this._rangeExtensionData[t]={summary:0}:this._rangeExtensionData={}},c.prototype.ensureExtendedTo=function(t,e,i){var o,n=this._studiesCache[e][t];if(!n)throw Error("This should never happen");this.purgeRangeExtensionData(e),this._rangeExtensionData[e]||(this._rangeExtensionData[e]={}),this._rangeExtensionData[e].time=i,o=this,setTimeout(function(){o.recreateSources(n.symbol,n.resolution,e,!0)},0)},c.prototype.extendSeriesRange=function(t,e,i){var o,n,r,s,a=this._studiesCache[e][t];if(!a)throw Error("This should never happen")
;if(this._isEndOfData(e,t,a.turnaround))return o=a.engine.runner.host.symbolInfo.data_status,void setTimeout(function(){TradingView.ChartapiMessagerInstances[e].onSeriesCompleted(t,a.turnaround,o)},0);i+=10,n=this._barsCoefficients(a.symbol,a.resolution),r=n.barsCoefficient||1,this._extendRange(e,i*r),n.barsCoefficient||(n.expectedBarsCount=this._extendedRange(e)),s=this,setTimeout(function(){s.recreateSources(a.symbol,a.resolution,e,!0)},0)},c.prototype._updateProjectionData=function(t,e,i,o){var n=o.barsetSize?this._convertBarsTimeToUnix([{index:o.barsetSize-1,exTime:o.lastBar?o.lastBar[0]/1e3:0,value:o.lastBar}]):null;TradingView.ChartapiMessagerInstances[t].onProjectionUpdate(e,i,o,n)},c.prototype.updateSeriesTurnaround=function(t,e,i){this._studiesCache[t]||(this._studiesCache[t]={}),this._studiesCache[t][e]||(this._studiesCache[t][e]={}),this._studiesCache[t][e].type="series",this._studiesCache[t][e].turnaround=i},c.prototype.seriesTurnaround=function(t,e){return this._studiesCache[t]&&this._studiesCache[t][e]&&this._studiesCache[t][e].turnaround},c.prototype.createSeries=function(t,e,i,n,r,s){function a(t,o,n){l._extrapolationManager.storage(i,t.full_name,e).setLastBarTime(o,n)}var l,c=t,h=new u.OHLCV;this._studiesCache[i]=this._studiesCache[i]||{},this._sessionsLastDataCache[i]=null,this._studiesCache[i][n]={symbol:t,resolution:e,studyObject:h,guid:n,type:"series",turnaround:r},TradingView.ChartapiMessagerInstances[i].onSeriesLoading(n,r),l=this,this._computeStudy(i,h,c,e,n,[],function(o,c,h,u){var d,p,_,f,m,g;if(!l._studiesCache[i][n])throw Error("This should never happen");if(l._sessionsLastDataCache[i]=o,d=l._convertBarsTimeToUnix(o),p=d.length>0?1e3*d[0].value[0]:void 0,u.nextTime&&(!p||u.nextTime<p/1e3))return void l.ensureExtendedTo(n,i,u.nextTime);0!==d.length&&(_=l._barsCoefficients(t,e),_.expectedBarsCount&&_.barsCount&&(_.barsCoefficient=Math.min(Math.max(_.barsCoefficient||1,parseInt(_.expectedBarsCount/(d.length-_.barsCount)+.5)),100)),_.barsCount=d.length,f=d[d.length-1],a(h,d.length-1,1e3*f.value[0]),l.rebuildExtrapolatedData(i,t.name,e,h,1e3*f.value[0]),s&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n,r),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n,r,d,h,0),m=l._extrapolationManager.storage(i,h.full_name,e),Promise.resolve().then(function(){l._pointsetsManager.broadcastPointsetsUpdates(h.full_name,e,o,m,h,function(t,e){TradingView.ChartapiMessagerInstances[i].onPointsetDataUpdate(t,r,e,h)})})),g=0===d.length||u&&u.endOfData,g&&(l._logMessage("Series has no more data on server: {0}".format(h.full_name)),l._setEndOfData(i,n,r),0===d.length&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n,r)),TradingView.ChartapiMessagerInstances[i].onSeriesCompleted(n,r,h.data_status)},function(t,o,s,c,h){var u,d=l._convertBarsTimeToUnix(t),p=d[d.length-1];if(o){if(!l._studiesCache[i][n])throw Error("This should never happen");u=s-1,l._logMessage("New bar arrived: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),
TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n,r,[p],h,u),a(h,u,1e3*p.value[0]),l.rebuildExtrapolatedData(i,h.full_name,e,h,1e3*p.value[0])}else l._logMessage("Last bar update: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),TradingView.ChartapiMessagerInstances[i].onDataUpdate(n,r,d,null,h);l._fireEvent("realtime_tick",t[t.length-1],!0)},function(t){l._logMessage("Series error: {0}".format(t)),TradingView.ChartapiMessagerInstances[i].onSeriesError(n,t),o.enabled("clear_bars_on_series_error")&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n,r)},function(t,o){var s,c,h,u,d,p,_,f;if("projection"!==t.type)throw Error("unexpected non-series data type for series "+t.type);if(s=t.projectionTime/1e3,c=-1,(t.data||[]).forEach(function(t){c=Math.max(c,t[0]||0)}),c=Math.min(c,100),h=t.barsetSize,s&&c>=0&&h&&t.lastBar){for(u=[],d=0;d<=c;d++)u.push(s+.001*d);p=t.lastBar.slice(0),p[0]=p[0]/1e3,TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n,r,[{index:h-1,value:p}],o,h-1,u),_=h+c,f=1e3*Math.trunc(u[c]),a(o,_,f),l.rebuildExtrapolatedData(i,o.full_name,e,o,f)}l._updateProjectionData(i,n,r,t)})},c.prototype.onMoreTickmarksRequested=function(t,e,i,o,n){this._extrapolationManager.storage(t,i.full_name,o).onTickmarksNeeded(i,n)},c.prototype.removePointset=function(t){this._pointsetsManager.removePointset(t)},c.prototype.rebuildExtrapolatedData=function(t,e,i,o,n){this._extrapolationManager.storage(t,o.full_name,i).rebuild(n,o)},c.prototype.createPointset=function(t,e,i,o,n,r){var s=this._extrapolationManager.storage(t,o.full_name,n);this._pointsetsManager.createPointset(e,i,n,r,s,o)},c.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map(function(t){return t.metainfo})),this._metainfoCache},c.prototype.searchSymbols=function(t,e,i,o){function n(t){r._logMessage("Symbol search response: {0}".format(JSON.stringify(t))),o(t)}this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(t,e,i));var r=this;this._externalDatafeed.searchSymbols(t,e,i,n)},c.prototype.validateSymbolInfo=function(t){function e(t){console.warn("SymbolInfo validation: "+t)}var i,o;if((void 0===t.minmov||t.minmov<=0)&&e("minmov must be positive"),(void 0===t.pricescale||t.pricescale<=0)&&e("pricescale must be positive"),void 0!==t.name&&0!==t.name.length||e("name must be non-empty string"),void 0!==t.session&&0!==t.session.length||e("session must be non-empty string"),void 0!==t.timezone&&0!==t.timezone.length||e("timezone must be non-empty string"),void 0!==t.intraday_multipliers)if(i=t.intraday_multipliers,Array.isArray(i))for(o=0;o<i.length;++o)"string"!=typeof i[o]&&e('intraday_multipliers[{0}] = "{1}" must be string (now: {2})'.format(o+1,i[o],typeof i[o]));else e("intraday_multipliers must be array")},c.prototype.resolveSymbol=function(t,e,i){var o,n=d.parseSymbol(t).symbol;this._resolveRequests[n]?o=this._resolveRequests[n]:(o=this.resolveSymbolInternal(n),this._resolveRequests[n]=o),o.done(e).fail(i)
},c.prototype.resolveSymbolInternal=function(t){var e,i=this,o=$.Deferred();return this._logMessage("Symbol resolve requested: `{0}` ".format(t)),e=!0,this._externalDatafeed.resolveSymbol(t,function(n){e&&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(t,JSON.stringify(n))),n.base_name||(n.base_name=[n.name]),n.legs||(n.legs=[n.name]),n.exchange||(n.exchange=n["exchange-listed"]),n.full_name||(n.full_name=n.symbol||(n.exchange?n.exchange+":"+n.name:n.name)),n.pro_name||(n.pro_name=n.full_name),n.data_status||(n.data_status="streaming"),n.ticker||(n.ticker=n.symbol),!n.session&&n["session-regular"]&&(n.session=n["session-regular"]),!n.minmov&&n.minmovement&&(n.minmov=n.minmovement),i.validateSymbolInfo(n),i._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(t,JSON.stringify(n))),i._fullNameSymbolInfoMap[n.full_name]=n,o.resolve(n)},function(e){i._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(t,e)),o.reject(e)}),e=!1,o.promise()},c.prototype._createMarketStatusWatchers=function(t,e){void 0===this._marketStatusWatchers[t]&&(this._marketStatusWatchers[t]={});var i=this;e.forEach(function(e){void 0===i._marketStatusWatchers[t][e]&&(i._marketStatusWatchers[t][e]=new h(i,t,e))})},c.prototype._removeMarketStatusWatchers=function(t){var e=this;Object.keys(this._marketStatusWatchers[t]||{}).forEach(function(i){e._marketStatusWatchers[t][i].stop()}),this._marketStatusWatchers[t]={}},c.prototype._stopQuotesSubscription=function(t){this._quotesInfo[t].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[t].listenerGUID),this._quotesInfo[t].listenerGUID=void 0),this._removeMarketStatusWatchers(t)},c.prototype._startQuotesSubscription=function(t){function e(e,i){var o=r._marketStatusWatchers[t][e.n];e.symbolname=e.n,e.status=e.s,e.values=e.v,e.values.change=e.v.ch,e.values.last_price=e.v.lp,e.values.change_percent=e.v.chp,e.values.current_session=e.v.cs||o&&o.marketStatus(),e.values.pricescale=i.pricescale,e.values.minmov=i.minmov,e.values.minmove2=i.minmove2||0,e.values.fractional=i.fractional||!1,o&&e.v.cs&&o.stop(),TradingView.ChartapiMessagerInstances[t].onQuotesData([t].concat([e]))}function i(t){t.forEach(function(t){void 0!==n[t.n]?null!==n[t.n]&&e(t,n[t.n]):r.resolveSymbol(t.n,function(i){n[t.n]=i,e(t,i)},function(){n[t.n]=null})})}var n={},r=this,s=this._quotesInfo[t].symbols;0!==s.length&&(this._externalDatafeed.getQuotes&&!o.enabled("charting_library")?this._externalDatafeed.getQuotes(s,function(e){r._quotesInfo[t]&&(i(e),r._quotesInfo[t].listenerGUID=t,r._externalDatafeed.subscribeQuotes(s,r._quotesInfo[t].fastSymbols,i,r._quotesInfo[t].listenerGUID))},function(t){}):!this._externalDatafeed.getQuotes&&o.enabled("trading_terminal")&&setTimeout(function(){i(s.map(function(t){return{n:t,s:"ok",v:{}}}))}),this._createMarketStatusWatchers(t,s))},
c.prototype._restartQuotesSubscription=function(t){this._stopQuotesSubscription(t),this._startQuotesSubscription(t)},c.prototype.quoteCreateSession=function(t){this._quotesInfo[t]={symbols:[],fastSymbols:[],listenerGUID:void 0}},c.prototype.quoteDeleteSession=function(t){this._stopQuotesSubscription(t),this._quotesInfo[t]=null},c.prototype.quoteSetFields=function(t,e){},c.prototype.quoteAddSymbols=function(t,e){this._quotesInfo[t].symbols=this._filteredSymbols(this._quotesInfo[t].symbols.concat(e)),this._restartQuotesSubscription(t)},c.prototype.quoteRemoveSymbols=function(t,e){this._quotesInfo[t].symbols=this._quotesInfo[t].symbols.filter(function(t){return e.indexOf(t)<0}),this._restartQuotesSubscription(t)},c.prototype.quoteFastSymbols=function(t,e){this._quotesInfo[t].fastSymbols=this._filteredSymbols(e),this._restartQuotesSubscription(t)},c.prototype.quoteHibernateAll=function(t){},c.prototype._stopDepthSubscription=function(t){this._depthInfo[t].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[t].listenerGUID),this._depthInfo[t].listenerGUID=void 0)},c.prototype._startDepthSubscription=function(t){function e(t){return t.map(function(t){return{p:t.price,v:t.volume}})}function i(t){var i={};return i.s=r,i.bids=e(t.bids),i.asks=e(t.asks),i}function o(e){e.snapshot?TradingView.ChartapiMessagerInstances[t].onDepthData([t].concat([i(e)])):TradingView.ChartapiMessagerInstances[t].onDepthUpdate([t].concat([i(e)]))}var n=this,r=this._depthInfo[t].symbol;r&&this._fullNameSymbolInfoMap[r]&&this._externalDatafeed.subscribeDepth&&(n._depthInfo[t].listenerGUID=this._externalDatafeed.subscribeDepth(r,function(e){n._depthInfo[t]&&o(e)}))},c.prototype._restartDepthSubscription=function(t){this._stopDepthSubscription(t),this._startDepthSubscription(t)},c.prototype.depthCreateSession=function(t){this._depthInfo[t]={symbol:null,listenerGUID:void 0}},c.prototype.depthDeleteSession=function(t){this._depthInfo[t].symbol=null,this._stopDepthSubscription(t),delete this._depthInfo[t]},c.prototype.depthSetSymbol=function(t,e){this._depthInfo[t].symbol=e,this._restartDepthSubscription(t)},c.prototype._filteredSymbols=function(t){var e=[];return t.forEach(function(t){t instanceof Object||e.indexOf(t)<0&&e.push(t)}),e},c.prototype._isEndOfData=function(t,e,i){var o=t+"!"+e+"@"+i;return!!this._endOfData[o]},c.prototype._setEndOfData=function(t,e,i){var o=t+"!"+e+"@"+i;this._endOfData[o]=!0},c.prototype.alignTimePoint=function(t,e,i){return o.enabled("disable_resolution_rebuild")?t:n(e,i).alignTimeIfPossible(1e3*t)/1e3},c.prototype.serverTimeOffset=function(){return this._serverTimeOffset},c.prototype.getCurrentUTCTime=function(){return(new Date).valueOf()/1e3+this._serverTimeOffset},t.exports=c}).call(e,i(67),i(7))},function(t,e,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.getStudies=function(){return[]},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]},TradingView.templates=i(220),TradingView.templates.dialogs={symbolSearch:'<div class="symbol-block"><div class="spread-actions"></div><div class="symbol-block-inputspacer"><input maxlength="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+'" /><div class="search-icon"></div></div></div><div class="filter"></div><div class="results"></div>'},TradingView.AlertLabel=function(){},TradingView.getDataVendorString=function(){},window.Telemetry={sendReport: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(t){t&&t([])},TradingView.MockupRequestedCache.invalidate=function(){},TradingView.StudyStrategy=function(){},TradingView.LinetoolTemplatesList=function(){},window.PublishedScript={suggest:function(){var t=$.Deferred();return t.resolve(null),t}}},function(t,e,i){(function(t){"use strict";function e(t){this._chartApi=t,this._sessionid="qs_"+o(),this._sessionstarted=!1}var o=i(64).randomHash;e.prototype.destroy=function(){this._sessionstarted&&(this._chartApi.quoteDeleteSession(this._sessionid),this._sessionid=null,this._sessionstarted=!1)},e.prototype.connected=function(){return this._chartApi.connected()},e.prototype.connect=function(t){this._globalHandler=t,this._chartApi.createSession(this._sessionid,this),this._chartApi.connect()},e.prototype.disconnect=function(){this._chartApi.disconnect()},e.prototype.quoteAddSymbols=function(t,e){t=[].concat(t),e&&e.forcePermission&&(t=t.concat({flags:["force_permission"]})),this._chartApi.quoteAddSymbols(this._sessionid,t)},e.prototype.quoteRemoveSymbols=function(t){this._chartApi.quoteRemoveSymbols(this._sessionid,t)},e.prototype.quoteFastSymbols=function(t){this._chartApi.quoteFastSymbols(this._sessionid,t)},e.prototype.quoteSetFields=function(t){this._chartApi.quoteSetFields(this._sessionid,t)},e.prototype.onMessage=function(t){switch(t.method){case"connected":this._sessionstarted||(this._chartApi.quoteCreateSession(this._sessionid),this._sessionstarted=!0);break;case"disconnected":this._sessionstarted=!1}this._globalHandler(t)},e.prototype.quoteHibernateAll=function(t){this._chartApi.quoteHibernateAll(this._sessionid)},TradingView.QuoteSession=e,void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(78)(t))},function(t,e,i){(function(t,e){"use strict";function o(e,i){this.options=$.extend({throttleTimeout:125},i),this._connected=!1,this._symbol_data={},this._subscriptions={},this._delayed_subscriptions=[],this.fieldsSent=new $.Deferred,this.onConnect=new t,
this.onDisconnect=new t,this._quoteApi=new n(ChartApiInstance),this._type=e||"full",this.fieldsSent=new $.Deferred,this._delayUpdateFastSymbols=s(this._updateFastSymbols,250),this._throttledSymbolData={},this._formatterValuesCache={},this._waitingForFormatters={},this._snapshotValuesCache={},this._waitingForSnapshot={},this.connect()}var n,r=i(41).PriceFormatter,s=i(374),a=i(710),l=i(711),c=i(64);n=i(736),o.prototype.destroy=function(){this._quoteApi.destroy(),this._quoteApi=null,this._connected=!1,this.onDisconnect.fire()},o.prototype.typeFields={},o.prototype.typeFields.simple=["ch","chp","current_session","description","local_description","language","exchange","fractional","is_tradable","lp","minmov","minmove2","original_name","pricescale","pro_name","short_name","type","update_mode","volume"],o.prototype.typeFields.simpleDetailed=[].concat(o.prototype.typeFields.simple,["ask","bid","fundamentals","high_price","is_tradable","low_price","open_price","prev_close_price","rch","rchp","rtc","status","basic_eps_net_income","beta_1_year","earnings_per_share_basic_ttm","industry","market_cap_basic","price_earnings_ttm","sector","volume"]),o.prototype.typeFields.full=[],o.prototype.connect=function(t){this._quoteApi.connect(this.quoteHandler.bind(this))},o.prototype.quoteHandler=function(t){var e=t.method,i=t.params;switch(e){case"connected":this._connected||(this._connected=!0,this.onConnected());break;case"quote_list_fields":break;case"quote_symbol_data":this._connected&&this.onSymbolData(i[0]);break;case"disconnected":this._connected&&(this._connected=!1,this.onDisconnect.fire())}},o.prototype.onConnected=function(){this.setFields();var t=Object.keys(this._symbol_data);t.length&&this._quoteApi.quoteAddSymbols(t,{forcePermission:!0}),this._delayed_subscriptions.forEach(function(t){this.subscribe.apply(this,t)},this),this._delayed_subscriptions=[],this.onConnect.fire()},o.prototype.setFields=function(){var t=o.prototype.typeFields[this._type];t&&t.length&&this._quoteApi.quoteSetFields(t),this.fieldsSent.resolve()},o.prototype.onSymbolData=function(t){var e=t.symbolname,i=this._throttledSymbolData[e];i||(i=this._throttledSymbolData[e]={fnDispatch:a(this.dipatchSymbolData.bind(this),this.options.throttleTimeout)}),i.cache?$.extend(!0,i.cache,t):i.cache=t,i.fnDispatch(e)},o.prototype._parseUpdateMode=function(t){var e=t.update_mode;e&&(e=e.match(/(delayed_streaming){1}(?:_([\d]+))?/))&&e[1]&&(e[2]&&(t.update_mode_seconds=+e[2]),t.update_mode=e[1])},o.prototype.dipatchSymbolData=function(t){var e,i,o=this._symbol_data[t],n=this._throttledSymbolData[t].cache;if(delete this._throttledSymbolData[t].cache,this._symbol_data[t]){$.extend(!0,o,n),o.values&&this._parseUpdateMode(o.values);for(e in this._subscriptions)i=this._subscriptions[e],i[t]&&i[t].forEach(function(t){t(o,n)})}},o.prototype.subscribe=function(t,e,i){var o,n;if(!this._connected)return void this._delayed_subscriptions.push(arguments);this._subscriptions[t]=this._subscriptions[t]||{},o=this._subscriptions[t],e=[].concat(e),n=[],e.forEach(function(t){
this._symbol_data[t]?o&&o[t]||this._symbol_data[t].subscribers_count++:(this._symbol_data[t]={subscribers_count:1},n.push(t)),o[t]=o[t]||[],o[t].push(i),o[t].fast=!0,this._symbol_data[t]&&this._symbol_data[t].values&&i(this._symbol_data[t],this._symbol_data[t])},this),n.length&&(this._quoteApi.quoteAddSymbols(n,{forcePermission:!0}),this._delayUpdateFastSymbols())},o.prototype.unsubscribe=function(t,e,i){var o,n=this._subscriptions[t];n&&(n[e]&&i?(o=n[e].indexOf(i),~o&&n[e].splice(o,1),n[e].length||delete n[e]):delete n[e]),n&&0===Object.keys(n).length&&delete this._subscriptions[t],this._symbol_data.hasOwnProperty(e)&&(n&&!n[e]&&this._symbol_data[e].subscribers_count--,this._symbol_data[e].subscribers_count||(delete this._symbol_data[e],this._quoteApi.quoteRemoveSymbols([e]),this._delayUpdateFastSymbols()))},o.prototype.setFastSymbols=function(t,e){var i,o;if(this._subscriptions[t]){i=this._subscriptions[t];for(o in i)i[o].fast=-1!==e.indexOf(o)}this._delayUpdateFastSymbols()},o.prototype._updateFastSymbols=function(){if(this._connected){var t=this._fastSymbols();0===t.length?this._quoteApi.quoteHibernateAll():this._quoteApi.quoteFastSymbols(t)}},o.prototype._delayUpdateFastSymbols=o.prototype._updateFastSymbols,o.prototype._fastSymbols=function(){var t,e,i,o=[];for(t in this._subscriptions){e=this._subscriptions[t];for(i in e)e[i].fast&&o.push(i)}return o=l(o)},o.prototype.formatter=function(t){function e(t){return new r(t.pricescale,t.minmov,t.fractional,t.minmove2)}function i(t){return t&&null!=t.pricescale&&null!=t.minmov}var o,n=this;return this._waitingForFormatters[t]?this._waitingForFormatters[t]:(o=new Promise(function(o,r){if(n._formatterValuesCache[t])o(e(n._formatterValuesCache[t]));else{var s=c.guid();n.subscribe(s,[t],function(a){a.error&&(n._waitingForFormatters[t]=null,r(a.error)),i(a.values)&&(n._waitingForFormatters[t]=null,n._formatterValuesCache[t]=a.values,o(e(a.values)),n.unsubscribe(s,t))})}}),this._waitingForFormatters[t]=o,o)},o.prototype.snapshot=function(t){var e,i=this;return this._waitingForSnapshot[t]?this._waitingForSnapshot[t]:(e=new Promise(function(e,o){if(i._snapshotValuesCache[t])e(i._snapshotValuesCache[t]);else{var n=c.guid();i.subscribe(n,[t],function(r){r.error&&(i._waitingForSnapshot[t]=null,o(r.error));var s=r.values;s&&s.minmov&&s.pricescale&&s.description&&(i._waitingForSnapshot[t]=null,i._snapshotValuesCache[t]=s,e(s),i.unsubscribe(n,t))})}}),this._waitingForSnapshot[t]=e,e)},TradingView.QuoteSessionMultiplexer=o,void 0!==e&&e&&e.exports&&(e.exports=o)}).call(e,i(20),i(78)(t))},,function(t,e){"use strict";function i(t,e){this.array=[];for(var i in t)t[i].key=i,this.array.push(t[i]);this.rearrange(e)}i.prototype.rearrange=function(t){if("function"!=typeof t)throw Error("sort param is not a function");return this.array.sort(t)},i.byValue=function(t){return function(t,e){return t-e}},i.byField=function(t){return function(e,i){return e[t]>i[t]?1:e[t]<i[t]?-1:e[t]===i[t]?0:void 0}},i.byOrder=function(t){return function(e,i){return t.indexOf(e.key)-t.indexOf(i.key)}},
t.exports=i},function(t,e){"use strict";!function(t){t.fn.contextMenu=function(e){t(this).bind("contextmenu",function(t){return e(t),!1})}}(jQuery)},,function(t,e){"use strict";!function(t,e,i){"$:nomunge";function o(o,n){function r(e){t(s).each(function(){var i=t(this);this===e.target||i.has(e.target).length||i.triggerHandler(n,[e.target])})}n=n||o+i;var s=t(),a=o+"."+n+"-special-event";t.event.special[n]={setup:function(){s=s.add(this),delete s.prevObject,1===s.length&&t(e).bind(a,r)},teardown:function(){s=s.not(this),delete s.prevObject,0===s.length&&t(e).unbind(a)},add:function(t){var e=t.handler;t.handler=function(t,i){t.target=i,e.apply(this,arguments)}}}}t.map("click dblclick mousemove mousedown mouseup mouseover mouseout change select submit keydown keypress keyup".split(" "),function(t){o(t)}),o("focusin","focus"+i),o("focusout","blur"+i),Modernizr.touch&&(o("touchstart","mousedown"+i),o("touchmove","mousemove"+i),o("touchend","mouseup"+i)),t.addOutsideEvent=o}(jQuery,document,"outside")},function(t,e){"use strict";!function(t){t.fn.selectable=function(e){return this.each(function(){var i=t(this);i.css("user-select",e?"text":"none"),i.css("-moz-user-select",e?"text":"-moz-none"),i.css("-webkit-user-select",e?"auto":"none"),(t.browser.msie||t.browser.opera)&&i.attr("unselectable",e?"off":"on")})}}(jQuery)},function(t,e,i){(function(e){"use strict";function o(){}var n=i(367).AddCompareDialog,r=i(43),s=i(180),a=i(13).getLogger("Chart.ChartHeaderWidget");TradingView.SYMBOL_SEARCH_MAX_LENGTH=1e3,o.prototype._createBarsGroup=function(t){var e=this.createGroup("bars-style",{single:!0});return t._style_list.element().appendTo(e),e},o.prototype._createPropertiesGroup=function(t,o){var n,r=this.createGroup("properties",{single:!0});return this._onWidget&&!e.enabled("header_settings")||(n=$("<span>").addClass("button iconed properties apply-common-tooltip").append($(i(1235)).attr({width:17,height:17})).appendTo(r),n.on(t,function(t){t.pageX=n.offset().left,t.pageY=n.offset().top+n.height()+15,TVSettings.getValue("properties_dialog.active_tab.chart")||TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Style")),o.activeChartWidget.value().showChartProperties({_lastEvent:t}).then(function(t){null!==t&&(n.addClass("active"),t.on("destroy",function(){n.removeClass("active")}))})}),n.attr("title",$.t("Chart Properties"))),r},o.prototype._createCompareGroup=function(t,e,o){var r=this.createGroup("compare",{single:!0}),s=$('<a class="button toggle-caption compare apply-common-tooltip">').append($(i(1202))).append($('<span class="caption">'+$.t("Compare")+"</span>")).appendTo(r);return this._compareButton=s,this._compareButton.on(o,function(t){var i,o;t.preventDefault(),i=new n(e),o=i.show(),s.addClass("active"),o.on("destroy",function(){s.removeClass("active")})}),this._compareButton.attr("title",$.t("Compare or Add Symbol")),r},o.prototype._createIndicatorsGroup=function(t,o){var n,a=this.createGroup("indicators",{single:!0,showInNarrowView:!0})
;return this._indicatorsButton=$('<a class="button toggle-caption indicators'+(this._onWidget?" no-last":"")+' apply-common-tooltip">').append($(i(1213))).append($('<span class="caption">'+$.t("Indicators")+"</span>")).appendTo(a),n="\n"+$.t("Slash",{context:"hotkey"})+" /",e.enabled("charting_library_base")||e.enabled("widget")?this._indicatorsButton.attr("title",$.t("Indicators")+n):this._indicatorsButton.attr("title",$.t("Indicators, Fundamentals, Economy and Add-ons")+n),this._indicatorsButton.on(t,function(t){t.preventDefault(),window.studyMarket.isVisible()?window.studyMarket.hide():(window.studyMarket.show(),r.emit("indicators_dialog"))}),s.registerListener("IndicatorsHotkey",function(t){if(47===t.which&&$(t.target).is("body")&&!window.studyMarket.isVisible())return window.studyMarket.show(),window.studyMarket.selectSearchPage(),t.preventDefault(),t.stopPropagation(),!0}),window.studyMarket.visibilityChanged.subscribe(this,function(t){this._indicatorsButton.toggleClass("active",t)}),!TradingView.onWidget()&&e.enabled("study_templates")&&studyTemplates.appendMenuButtonTo(a),a},o.prototype.createGroup=function(t,e){e=e||{};var i=$("<div>").addClass("group");return e.right&&i.addClass("right"),e.single&&i.addClass("space-single"),t&&i.addClass("header-group-"+t),i},o.prototype.bindToModel=function(){var t=this._chartWidget.model();this._model=t},o.prototype.backButton=function(){return this._backButton},o.prototype.saveLoadWidget=function(){return this._saveLoad||a.logWarn("No save-load widget created in footer")},o.prototype.styleIconPosition=function(t){return"-%1px 0".replace("%1",19*~~t)},o.styleIconPosition=o.prototype.styleIconPosition,t.exports=o}).call(e,i(7))},function(t,e,i){(function(e){"use strict";function o(t){function o(){if(!t.favoriteChartTypes)return[];var e={Bars:p.STYLE_BARS,Candles:p.STYLE_CANDLES,Line:p.STYLE_LINE,Area:p.STYLE_AREA,"Heiken Ashi":p.STYLE_HEIKEN_ASHI,"Hollow Candles":p.STYLE_HOLLOW_CANDLES,Baseline:p.STYLE_BASELINE};return t.favoriteChartTypes.map(function(t){return e[t]})}var a,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E,V,D;t=t||{},a=this._chartWidgetCollection=t.chartWidgetCollection,f=this._chartWidget=a.activeChartWidget.value(),m=this._onWidget=f.onWidget(),g=this,v=Modernizr.touch?"touchstart":"click",this._onResizeRequested=!1,this._resizerBridge=t.resizerBridge,this._$root=$(t.resizerBridge.body.value()),this._$root.addClass("header-chart-panel").html('<div class="header-chart-panel-sizer"><div class="header-chart-panel-content"><div class="right"></div><div class="left"></div></div></div>'),this._$sizer=this._$root.find(".header-chart-panel-sizer"),this._$content=this._$root.find(".header-chart-panel-content"),this._$left=this._$root.find(".left"),this._$right=this._$root.find(".right"),this._itemsVisibility=t.itemsVisibility,a.readOnly()||(e.enabled("header_symbol_search")&&(y=this.createGroup("symbol-search").appendTo(this._$left),b=$('<div class="symbol-edit-widget no-last"></div>').appendTo(y),S=$('<div class="symbol-edit-wrap">').appendTo(b),w=null,
!e.enabled("charting_library_base")&&u.canShowSpreadActions()&&(T=$('<div class="symbol-edit-buttonswrap">').appendTo(S),w=$('<div class="spread-actions">').appendTo(T).on("mousedown",function(t){t.preventDefault()})),x=$('<div class="symbol-edit-inputspacer">').appendTo(S),C=$('<input type="text" class="symbol-edit" maxlength="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+'">').appendTo(x),u.bindToInput(C,{syncWithChartWidget:!0,spreadActions:w}),function(){var t=!1;C.on("focus",function(){t=!0,S.addClass("expanded")}),C.on("blur",function(){t=!1,setTimeout(function(){t||S.removeClass("expanded")},40)})}()),e.enabled("header_resolutions")&&(y=this.createGroup("intervals",{single:!0,showInNarrowView:!0}).appendTo(this._$left),P={onWidget:m,submenuBtnAddClass:"apply-common-tooltip"},t.interval_options&&$.extend(P,t.interval_options),e.enabled("items_favoriting")||$.extend(P,{notShowQuicks:!0,popupSpacing:1}),TradingView.isOnFeaturePage&&$.extend(P,{notShowQuicks:!0}),this._interval=new l(P),loginStateChange.subscribe(this,function(){window.is_authenticated&&this._interval.forceUpdate()}),e.enabled("charting_library_base")&&ChartApiInstance.on("configuration_received",function(){g._interval.forceUpdate()}),this._interval.element().addClass("no-first").appendTo(y),this._interval.onResize.subscribe(this,this._onInternalResize),t.favoriteIntervals&&this._interval.setUpStarredItemsList(t.favoriteIntervals)),e.enabled("header_chart_type")&&(L=[{id:p.STYLE_BARS,title:$.t("Bars")},{id:p.STYLE_CANDLES,title:$.t("Candles")},{id:p.STYLE_HOLLOW_CANDLES,title:$.t("Hollow Candles")},{id:p.STYLE_HEIKEN_ASHI,title:$.t("Heikin Ashi")},{id:p.STYLE_LINE,title:$.t("Line")},{id:p.STYLE_AREA,title:$.t("Area")},{id:p.STYLE_BASELINE,title:$.t("Baseline")}],I=o()||[1,4,5,6],TradingView.isOnFeaturePage&&!e.enabled("charting_library_base")&&(I=[]),m?I=[1,3]:e.enabled("collapsible_header")&&this._createMinimizeButton(t.headerChartPanel),this._style_list=new d("StyleWidget",L.map(function(t){return{id:t.id,title:t.title,svg:$(_[t.id]).attr({width:26,height:26}),favoriteButton:{title:t.title,addClass:"apply-common-tooltip"}}}),{defaultFavorites:I,addClass:"chart-style-widget",popupAddClass:"chart-style-popup",notShowQuicks:!e.enabled("items_favoriting"),showJustDefaultQuicks:I&&I.length&&e.enabled("predefined_items_only_may_be_starred"),tooltip:$.t("Bar's Style"),addTooltipClass:"apply-common-tooltip"}),a.activeChartStyle.subscribe(function(t){g._style_list.setValue(t)},{callWithLast:!0}),k=!1,g._style_list.onChange().subscribe(this,function(t){k||a.trySetChartStyleToActiveWidget(t)||(k=!0,g._style_list.setValue(a.activeChartStyle.value()),k=!1)}),g._style_list.onResize().subscribe(this,this._onInternalResize)),window.studyMarket=new c(a,window.user,{onWidget:m,fundamentalsOnly:t.fundamentalsOnly}),this._createLayout(t,g,v),this._resizerBridge.width.subscribe(this._onInternalResize.bind(this))),!this._chartWidget.readOnly()&&e.enabled("header_undo_redo")&&(this._undoRedo=new n(this._$left,this._chartWidget)),e.enabled("header_screenshot")&&(A="Alt+S",
M=this.createGroup("screenshot",{single:!0}).appendTo(this._$right),E=$('<a class="button getimage"></a>').append($(i(1238)).attr({class:"icon"})).addClass("apply-common-tooltip").attr("title",$.t("Take instant snapshot of your chart. No more Paint or other editors to save screenshots – simply click the button and copy the link of the picture.")+"\n"+A).appendTo(M),M.click(function(t){if(!e.enabled("show_dialog_on_snapshot_ready")){if(E.hasClass("process"))return;E.addClass("process"),h.subscribe("onScreenshotReady",function(t){E.removeClass("process")},null,!0)}f.actions().takeScreenshot.callbacks().fire(),t.preventDefault()})),e.enabled("header_saveload")&&(V=e.enabled("header_saveload_to_the_right")?this._$right:this._$left,y=this.createGroup("save-load",{single:!0,showInNarrowView:!0}).appendTo(V),D=$("<div>").addClass("save-load-buttons").appendTo(y),this._saveLoad=new s(D,a,{popupDirection:"down",popupReverse:!0}),this._saveLoad.onTitleSizeChanged.subscribe(this,this._onInternalResize),TradingView.isOnFeaturePage&&this._saveLoad.hideTitle()),e.enabled("header_widget_dom_node")||$(".header-chart-panel").css("display","none"),f.withModel(this,r.prototype.bindToModel),this._resizerBridge.availWidth.subscribe(this._onAvailSizeChange.bind(this)),this._resizerBridge.availHeight.subscribe(this._onAvailSizeChange.bind(this)),this._onAvailSizeChange(),this._onInternalResize()}var n=i(819),r=i(744),s=i(1130).SaveLoadWidget,a=i(753),l=i(398),c=i(812),h=i(43),u=i(104),d=i(474).FavoredList,p=i(85),_=i(397);inherit(o,r),o.prototype.saveLoadWidget=function(){return this._saveLoad},o.prototype._onAvailSizeChange=function(){var t=this._resizerBridge.availWidth.value()<=520||this._resizerBridge.availHeight.value()<=250;!!this._compactMode!==t&&(this._compactMode=t,this._$root.toggleClass("header-chart-panel--compact",t),this._onInternalResize())},o.prototype.addButton=function(t,e){(e?this._$left:this._$right).append(t),this._onInternalResize()},o.prototype._createUndoRedoGroup=function(){return this._undoRedo=new n(this._$left,this._chartWidget),this._undoRedo.undoElement().addClass("apply-common-tooltip"),this._undoRedo.redoElement().addClass("apply-common-tooltip"),this.createGroup("undo-redo",{single:!0}).append(this._undoRedo.element())},o.prototype._createFullscreenGroup=function(){this._fullscreen=new a(this._chartWidgetCollection);var t=this.createGroup("fullscreen",{single:!0});return this._fullscreen.element().addClass("apply-common-tooltip").appendTo(t),t},o.prototype._createLayout=function(t,i,o){var n=[];e.enabled("header_chart_type")&&n.push(this._createBarsGroup(i)),e.enabled("header_settings")&&e.enabled("show_chart_property_page")&&n.push(this._createPropertiesGroup(o,t.chartWidgetCollection)),e.enabled("header_indicators")&&n.push(this._createIndicatorsGroup(o)),e.enabled("header_compare")&&n.push(this._createCompareGroup(i,t.chartWidgetCollection,o)),e.enabled("header_undo_redo")&&!this._chartWidget.readOnly()&&n.push(this._createUndoRedoGroup()),
e.enabled("header_fullscreen_button")&&n.push(this._createFullscreenGroup()),n.forEach(function(t){t.appendTo(this._$left)},this)},o.prototype._onInternalResize=function(){if(this.hidden)return void this._resizerBridge.negotiateHeight(0);this._onResizeRequested||(this._onResizeRequested=!0,this._resizerBridge.visible.when(function(){var t,i;this._onResizeRequested=!1,e.enabled("caption_buttons_text_if_possible")&&(t=this._$left,i=t.children(".group"),t.addClass("captions"),i.size()>1&&i.last().offset().top>i.first().offset().top+5&&t.removeClass("captions")),this._$content.find("svg").pixelSnap(),this._resizerBridge.negotiateHeight({min:0,max:this._$content.height()})}.bind(this)))},o.prototype._setupCaptionButtons=function(){window.studyTemplates&&studyTemplates.onFavoriteListResize.subscribe(this,this._onInternalResize)},o.prototype._createMinimizeButton=function(){var t=this,e=$("<span>",this._$root).addClass("tv-close-panel top").appendTo(this._$root).on("click",function(i){i.isDefaultPrevented()||(t.hidden=!t.hidden,e.toggleClass("top",!t.hidden),e.toggleClass("bottom",t.hidden),i.preventDefault(),h.emit("toggle_header",!t.hidden),t._onInternalResize())})},t.exports=o}).call(e,i(7))},,function(t,e,i){(function(e){"use strict";function o(t){var i,o,n,r,s,a,l,c,h,u,d,p,m,g,v,y,b,S,T=this;this._guid=q(),this._startSpinner(t.body.value()),P.init(),i=this,P.tool.subscribe(function(t){var e,o,n,r;i._model&&(e=t,i._model.model().setCurrentTool(e),TradingView.isMobile.any()&&(o=i._paneWidgets[0],w.isLineTool(e)&&"LineToolBrush"!==e&&!i.selectBarMode().value()?(n=.5*i._model.model().timeScale().width(),r=.5*o._state.defaultPriceScale().height(),i._model.model().setAndSaveCurrentPosition(n,r,o._state),o._updateTooltip(n,r)):o._hideTooltip()),i._model&&TradingView.isMobile.any()&&i._model.model().crossHairSource().updateAllViews())}),o=function(t,e,i){var o,n=e.mainSeries().syncModel(),r=t.mainSeries().syncModel(),s=i;return n&&r&&(o=t._createSyncPoint(n,r),s=o.sourceTimeToTargetTime(i)),t.timeScale().points().roughIndex(s,r&&r.distance.bind(r))},P.createdLineTool.subscribe(null,function(t){var e,i,n;T._model&&(e=T._model.model(),t.model!==e&&(i=e.paneForSource(T._model.model().mainSeries()),n={index:o(e,t.model,t.point.timeStamp),price:t.point.price},T._model.createLineTool(i,n,t.linetool,t.properties,t.linkKey)))}),P.continuedLineTool.subscribe(null,function(t){var e,i,n;T._model&&(e=T._model.model(),t.model!==e&&(i={index:o(e,t.model,t.point.timeStamp),price:t.point.price},(n=T._model.lineBeingCreated())&&T._model.model().coninueCreatingLine(i,t.envState,!!t.finalState)&&t.finalState&&n.restoreExternalPoints(t.finalState)))}),P.cancelledLineTool.subscribe(null,function(t){if(T._model){var e=T._model.model();t.model!==e&&T._model.model().cancelCreatingLine()}}),P.startedMovingLineTool.subscribe(null,function(t){var e,i,n;T._model&&(e=T._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(n={index:o(e,t.model,t.point.timeStamp),price:t.point.price},
T._model.model().startMovingSource(i,n)))}),P.movedLineTool.subscribe(null,function(t){var e,i;T._model&&(e=T._model.model(),t.model!==e&&e.sourceBeingMoved()&&e.sourceBeingMoved().linkKey===t.linkKey&&(i={index:o(e,t.model,t.point.timeStamp),price:t.point.price},T._model.model().moveSource(i)))}),P.finishedMovingLineTool.subscribe(null,function(t){var e,i;T._model&&(e=T._model.model(),t.model!==e&&(i=e.sourceBeingMoved())&&(T._model.model().endMovingSource(!!t.finalState),t.finalState&&i.restoreExternalPoints(t.finalState)))}),P.startedChangingLineTool.subscribe(null,function(t){var e,i,n;T._model&&(e=T._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(n={index:o(e,t.model,t.point.timeStamp),price:t.point.price},T._model.model().startChangingLinetool(i,n,t.pointIndex,t.envState)))}),P.changedLineTool.subscribe(null,function(t){var e,i;T._model&&(e=T._model.model(),t.model!==e&&e.lineBeingEdited()&&e.lineBeingEdited().linkKey===t.linkKey&&(i={index:o(e,t.model,t.point.timeStamp),price:t.point.price},T._model.model().changeLinePoint(i,t.envState)))}),P.finishedChangingLineTool.subscribe(null,function(t){var e,i;T._model&&(e=T._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0],e.lineBeingEdited()&&T._model.model().endChangingLinetool(!!t.finalState),i&&t.finalState&&i.restoreExternalPoints(t.finalState)))}),P.removedLineTool.subscribe(null,function(t){var e,i;T._model&&(e=T._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&T._model.model().removeSource(i))}),P.finishedLineTool.subscribe(null,function(t){var e;T._model&&(e=T._model.model(),t.model!==e&&e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0]&&T._model.model().finishLineTool())}),P.changedLineStyle.subscribe(null,function(t){var e,i;T._model&&(e=T._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(i.properties().merge(t.state),i.propertiesChanged()))}),P.restoredLineToolState.subscribe(null,function(t){var e,i,o;T._model&&(e=T._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(o=$.extend({},t.state),o.indexes=o.points.map(function(t){return{index:t.index,price:t.price}}),e.restoreLineToolState(i,o)))}),P.restoredLineTool.subscribe(null,function(t){if(T._model){var e=T._model.model();t.model!==e&&e.restoreSource(t.state.restorePane,t.state.paneIndex,t.state.paneState,t.state.sourceState,t.state.priceScaleName)}}),P.copiedLineTool.subscribe(null,function(t){var e,i,n,r,s,a;if(T._model&&(e=T._model.model(),t.model!==e)){if(i=e.paneForSource(e.mainSeries()),n=t.points.map(function(i){return{index:o(e,t.model,i.timeStamp),price:i.price}}),r=n[0],s=e.createLineTool(i,r,t.linetool,null,t.linkKey),e.lineBeingCreated())for(a=1;a<n.length;a++)a!==n.length-1||"LineToolBrush"!==t.linetool&&"LineToolGhostFeed"!==t.linetool||e.finishLineTool(!0),e.coninueCreatingLine(n[a],{},a<n.length-1,!0)
;s.properties().interval.setValue(t.state.interval),s.properties().merge(t.state),s.restoreData&&s.restoreData(t),s.propertiesChanged(),s&&t.finalState&&(s.calcIsActualSymbol(),s.restoreExternalPoints(t.finalState))}}),this._options=t=t||{},n=t.content,r=t.readOnly,s=t.containsData,a=t.onWidget,l=t.onCmeWidget,l&&Q.logWarn("[ChartWidget] 'onCmeWidget' option is depricated"),c=t.widgetCustomer,h=t.timezone,u=t.withDateRanges,d=t.hideSymbolSearch,p=t.defSymbol,m=t.defInterval,g=t.defExtendedHours,v=t.defTimeframe,y=-1!==$.inArray(t.defStyle,$.map($.grep(Object.keys(_),function(t){return/^STYLE_\w+/.test(t)}),function(t){return _[t]})),b=y?t.defStyle:void 0,this._chartWidgetCollection=t.chartWidgetCollection||null,this._withDateRanges=(void 0===u?!r:!!u)&&f.enabled("timeframes_toolbar"),this._jqParent=t.body.value(),this._setContent(n),this._readOnly=r,this._containsData=s,this._defSymbol=p,this._defInterval=m,this._defTimeframe=v,this._defStyle=b,this._onWidget=!!a,this._onWidget&&(l?this._widgetCustomer="cme":c&&(this._widgetCustomer=c)),this.controlBarHeight=22,this._hideSymbolSearch=d,this._jqMainDiv=null,this._jqMainTable=null,this._paneWidgets=[],this._paneSeparators=[],this._timeAxisWidget=null,this._frameTime=30,this._model=null,this._metaInfo={},S=this._contentSeriesProperties(),S&&(p=S.symbol,m=S.interval),void 0===L||L.isValid(m)||(m=void 0),this._properties=new B("chartproperties"),this._properties.mainSeriesProperties.merge(defaults("chartproperties.mainSeriesProperties")),this._properties.mainSeriesProperties.merge({visible:!0,symbol:p||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:m||"D",style:b,extendedHours:g,lineStyle:{styleType:TradingView.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),h&&F(h)&&this._properties.timezone.setValue(h),this._tagsChanged=new e,this._modelCreated=new e,this._disconnected=new e,this._reconnectBailout=new e,this._connected=new e,this._redrawPanes=new e,this._onScroll=new e,this.chartWidgetInitialized=new e,this._studiesMetaData=[],this._studiesMigrations=[],this._chartSession=new W(ChartApiInstance),this.lhsPriceAxisWidthChanged=new e,this.rhsPriceAxisWidthChanged=new e,this._isActive=t.isActive,this._width=t.width,this._height=t.height,t.width.subscribe(function(){T.resize()}),t.height.subscribe(function(){T.resize()})}function n(t){return{UTC:"Etc/UTC",EST:"America/New_York",CST:"America/Chicago",PST:"America/Los_Angeles"}[t]||"exchange"}function r(t){return t.description_localized=window.t(t.description,{context:"study"}),t}var s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E,V,D,O,B,R,z,F,N,W,H,U,j,q,G,Y,K,Z,X,J,Q;i(23),s=i(21).assert,a=i(809),l=i(808),c=i(76).UndoHistory,h=i(829),u=i(269),d=i(817),i(119),p=i(133).BarsMarksContainer,_=i(85),f=i(7),m=i(219).isFeatureEnabled,g=i(270).ActionBinder,v=i(172).showEditObjectDialog,y=i(501).showGoToDateDialog,b=i(61).Study,S=i(216),w=i(3).LineDataSource,T=i(73),x=T.Action,
C=T.ActionSeparator,P=i(44),L=i(57).Interval,I=i(752),k=i(810),A=i(1158).showSymbolInfoDialog,M=i(37),E=i(367).AddCompareDialog,V=i(97),D=i(265),O=i(104),i(393),B=i(11).DefaultProperty,R=i(226),z=R.availableTimezones,F=R.timezoneIsAvailable,N=i(96).createDialog,W=i(391),H=i(45),U=i(232).unifiedSpinner,j=i(48).trackEvent,q=i(64).guid,G=i(171),G.addCanvasTo,Y=G.Size,K=i(369),Z=i(123).createConfirmDialog,X=i(1095).MarketStatusIndicator,J=i(1094).DataModeIndicator,Q=i(13).getLogger("ChartWidget",{color:"#606"}),o.prototype.setTimezone=function(t){t&&F(t)?this._properties.timezone.setValue(t):console.warn("Incorrect timezone: "+JSON.stringify(t))},o.prototype.refreshMarks=function(){this.model().barsMarksSources().forEach(function(t){t.refreshData()})},o.prototype.clearMarks=function(){this.model().barsMarksSources().forEach(function(t){t.clearMarks()})},o._nextMetadataId=1,o._filterAuthorizedMetaInfo=function(t){var e,i,o,n,r=[];for(e=0;t&&e<t.length;++e)i=t[e],o=H.parseIdString(i.id),n=o.productId,pro.hasPackage(n)&&r.push(i);return r},o.prototype.privateMetaInfo=function(t){if(t){return new t(H.CURRENT_METAINFO_FORMAT_VERSION).generateMetaInfo()}return[]},o.prototype._onScriptSources=function(t,e){var i,o,n,r,s,a,l,c;for(Q.logDebug("ChartWidget _onScriptSources called"),i=null,o=0;o<e.length;++o)if(n=e[o],n.id.startsWith("Script@tv-scripting-")){i=H.parseIdString(n.id).version;break}if(null!=i){for(this.studyScriptingPkgVers=i,r=0,s=0,o=0;o<t.length;++o){a=t[o],l=a&&a.scriptName,r++;try{c=H.createMetaInfoStub(a,i),e.push(c)}catch(t){Q.logError("Could not process script (skipped): "+l+" ("+t.message+")"),s++}}Q.logDebug("User's Pine Scripts loaded "+r+", skipped "+s)}else Q.logError("Could not find tv-scripting package in metadata response");for(o=0;o<e.length;o++)H.addOrReplaceStudyMetaInfo(this._studiesMetaData,e[o]);this._applyStudiesOverrides(),this._inited?this.model().model().setStudiesMetaData(this._studiesMetaData,this._studiesMigrations):(this._init(),this.chartWidgetInitialized.fire(),Q.logDebug("ChartWidget _onScriptSources done"))},o.prototype._init=function(){var t,e,i=this;this._containsData||this._content&&this._content.timeScale&&!this._content.timeScale.m_lastVisibleBar&&(this._content.timeScale.m_rightOffset=this._properties.timeScale.rightOffset.value()),this.model()&&this.model().mainSeries().clearData(),this.initColors(),this._makeDefaultGui(),t=function(){i._checkObsoleteTimezone(),i._chartSession&&i._chartSession.connected()&&i._restartModel(),this._content&&(this.initColors(),this._updateGui(),this.update());var t=i._model.mainSeries();t.marketStatus.subscribe(function(e){i.indicatorImage&&i._updateDataAndMarketStatus(e,t.status(),t.quoteData.update_mode_seconds)},{callWithLast:!0}),this._resizeHandler=function(){this._adjustSize(),this._model&&this._model.mainSeries().requestMoreData(),this.paint(),this.resizeSeriesControlUI(),this.checkCompactMode(),this.resizeIndicator()}.bind(this),this._resizeHandler(),this._jqMainDiv.appendTo(this._jqParent),this._spinner&&(this._spinner.stop(),
delete this._spinner),m("chrome_canvas_fix")&&navigator.userAgent.match(/windows.+chrome/i)&&$(window).on("visibilitychange",function(t,e){if(e){for(var o=0;o<i._paneWidgets.length;o++)i._paneWidgets[o].hardResetCanvas();i._timeaxiswidget&&i._timeaxiswidget.hardResetCanvas(),i.paint(new M(M.LIGHT_UPDATE))}}),$(window).keydown(function(t){27===t.which&&t.preventDefault()}),this._containsData||this._jqMainDiv.mousewheel(function(t,e,i,o){var n,r,s,a,l;if((TradingView.onWidget()||!parent||parent===window||!parent.IS_DEMO_PAGE)&&this.model()&&!this.noScroll&&!this.model().timeScale().isEmpty())return n=t.pageX-5,r=this._paneWidgets[0].lhsPriceAxisWidget.size.w,s=this._timeAxisWidget.size.w,r&&(n=Math.max(0,n-r)),n=Math.min(n,s),a=f.enabled("right_bar_stays_on_scroll")?1:2*(n/s-.5),l=Math.min(1,Math.abs(o)),o>0?this.model().zoomIn(a,l):o<0&&this.model().zoomOut(a,l),i&&this.model().scrollChart(-80*i),!1}.bind(this)),this._initBarsMarksSources(),this.setAutoScaleOnSymbolChange(),this._activateSymbolSearchHotkeys(),this.model().timeScale().onScroll().subscribe(this,function(){this._onScroll.fire()}),this._inited=!0}.bind(this),e=this._makeDefaultModel(),void 0===e?t():e.then(t)},o.prototype._activateSymbolSearchHotkeys=function(){this.readOnly()||this._hideSymbolSearch||O.activateKeyPressHandler()},o.prototype._checkObsoleteTimezone=function(){var t=this._properties.timezone.value();F(t)||this._properties.timezone.setValue(n(t))},o.prototype._initBarsMarksSources=function(){var t=this;this.withModel(this,function(){this.model().barsMarksSources().forEach(function(e){e.onNeedRepaint.subscribe(t,t.paint)})})},o.prototype.initESDTimelineWidget=function(){new ESDTimelineWidget(this)},o.prototype.applyAutoScaleOnNewSymbol=function(){(!this.model().mainSeries()instanceof _||!this.model().mainSeries().properties().lockScale.value())&&this.model().mainSeries().priceScale().setAutoScale(!0)},o.prototype.setAutoScaleOnSymbolChange=function(){this.withModel(this,function(){this.model().mainSeries().properties().symbol.listeners().subscribe(this,function(){this.applyAutoScaleOnNewSymbol()})})},o.prototype.initColors=function(){this._properties.paneProperties.background.listeners().subscribe(this,o.prototype.setBackgroundColor),this._properties.paneProperties.vertGridProperties.color.listeners().subscribe(this,o.prototype.redrawPanes),this._properties.paneProperties.horzGridProperties.color.listeners().subscribe(this,o.prototype.redrawPanes),this._properties.scalesProperties.lineColor.listeners().subscribe(this,o.prototype.setScaleLineColor),this._properties.scalesProperties.textColor.listeners().subscribe(this,o.prototype.setScaleTextColor)},o.prototype.paneWidgets=function(){return this._paneWidgets},o.prototype.paneByCanvas=function(t){for(var e=0;e<this._paneWidgets.length;e++)if(this._paneWidgets[e].canvas===t||this._paneWidgets[e].top_canvas===t)return this._paneWidgets[e];return null},o.prototype.paneByState=function(t){for(var e=0;e<this._paneWidgets.length;e++)if(this._paneWidgets[e]._state===t)return this._paneWidgets[e]
;return null},o.prototype.priceAxisByCanvas=function(t){var e,i,o;for(e=0;e<this._paneWidgets.length;e++)if(i=this._paneWidgets[e],o=i.priceAxisByCanvas(t))return o;return null},o.prototype.timeAxisByCanvas=function(t){return t===this._timeAxisWidget.canvas||t===this._timeAxisWidget.top_canvas?this._timeAxisWidget:null},o.prototype.properties=function(){return this._properties},o.prototype.emulateCriticalError=function(){this._chartSession.removeSeries(-1,null)},o.prototype.readOnly=function(){return this._readOnly},o.prototype.onDisconnected=function(){return this._disconnected},o.prototype.onReconnectBailout=function(){return this._reconnectBailout},o.prototype.onConnected=function(){return this._connected},o.prototype.onRedrawPanes=function(){return this._redrawPanes},o.prototype.onScroll=function(){return this._onScroll},o.prototype.modelCreated=function(){return this._modelCreated},o.prototype.setResolution=function(t){if(!this._model)return void this._properties.mainSeriesProperties.merge({interval:t});var e=this._model.mainSeries().properties().interval;this._model.setScreenChartProperty(e,t,this,window.t("Change Resolution"))},o.prototype.getResolution=function(){return this._model?this._model.mainSeries().properties().interval.value():this._properties.mainSeriesProperties.interval.value()},o.prototype._addSymbol=function(t,e){var i=this.model(),o=i.studiesMetaData(),n="study_Overlay@tv-basicstudies",r=f.enabled("use_overrides_for_overlay")&&TradingView.defaultProperties[n]&&TradingView.defaultProperties[n].style,s=r||(i.mainSeries().properties().style.value()===_.STYLE_CANDLES?_.STYLE_BARS:_.STYLE_CANDLES),a={inputs:{symbol:t},style:s},l=o.filter(function(t){return"Overlay@tv-basicstudies"===t.id})[0];i.insertStudy(l,a,e)},o.prototype.addSymbol=function(t,e){this._addSymbol.apply(this,arguments)},o.prototype.updateActions=function(){function t(){var t,e,i=studyTemplates.plainList("custom"),o=studyTemplates.plainList("default");l.applyStudyTemplate.subActions||(l.applyStudyTemplate.subActions=[]),t=l.applyStudyTemplate.subActions,t.splice(0,t.length),e=new x({text:studyTemplates._SAVE_AS_TITLE,statName:"Save"}),e.callbacks().subscribe(studyTemplates,studyTemplates.showSaveAsDialog),t.push(e,new C),i.length||o.length?(i.length&&($.each(i,function(e,i){function o(t){return function(){return studyTemplates.deleteStudyTemplate(t),this._parentMenu._parentMenuItem._parentMenu.destroy(),!1}}var n=new x({text:i,statName:"SetStudyTemplate"});n.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(i)}),n.deleteButton={action:o(n.text)},t.push(n)}),o.length&&t.push(new C)),$.each(o,function(e,i){var o=new x({text:i,statName:"SetStudyTemplateFromDefaults"});o.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(i)}),t.push(o)})):t.push(new x({text:window.t("No study templates saved"),enabled:!1}))}var e,i,o,n,r,s,a,l=this.actions(),c=this._model.dataSources(),h=!1,u=!1;for(e=0,i=c.length;e<i;e++)o=c[e],TradingView.isInherited(o.constructor,w)&&o.isUserDeletable()&&(h=!0),
TradingView.isInherited(o.constructor,b)&&o.removeByRemoveAllStudies()&&(u=!0),TradingView.isInherited(o.constructor,S)&&(u=!0);this._readOnly||(l.paneRemoveAllStudies&&l.paneRemoveAllStudies.setEnabled(u),l.paneRemoveAllDrawingTools&&l.paneRemoveAllDrawingTools.setEnabled(h),l.paneRemoveAllStudiesDrawingTools&&l.paneRemoveAllStudiesDrawingTools.setEnabled(u||h)),window.studyTemplates&&(t(),studyTemplates.refreshStudyTemplateList(t)),n=this,r=[],s=z,a=function(t){return t.id===n.model().model().properties().timezone.value()},s.forEach(function(t){if(!t.separator){var e=new x({text:t.title,checkable:!0,checked:a(t),statName:"SetTimeZone"});e.callbacks().subscribe(this,function(){n.model().setProperty(n.model().model().properties().timezone,t.id,"Changed Time Zone")}),r.push(e)}},this),l.applyTimeZone.subActions=r,l.addToWatchlist&&(l.addToWatchlist.text=window.t("Add {0} To Watchlist").format(this.getSymbol(!0))),l.addToTextNotes&&(l.addToTextNotes.text=window.t("Add Text Note For {0}").format(this.getSymbol(!0))),this.updateActionForIntradayOnly(l.sessionBreaks)},o.prototype.actions=function(){return this._actions||this._setActions(),this._actions},o.prototype._setActions=function(){var t,e,i,n,r,s,a,l,h,u,d,p,_,v,b,S,w,T,L,I,k,E,B,R,z,F,N,W,$,H,U,q,G,Y,K,Z,X,J,Q,tt,et,it,ot,nt,rt,st,at,lt,ct,ht,ut,dt,pt,_t,ft,mt,gt,vt,yt,bt,St=this,wt=[];if(!this._readOnly){for(wt=[new x({text:window.t("Eraser"),callbackContext:"eraser",statName:"Eraser"}),new C,new x({text:window.t("Trend Line"),callbackContext:"LineToolTrendLine",statName:"LineToolTrendLine"}),new x({text:window.t("Horizontal Line"),callbackContext:"LineToolHorzLine",statName:"LineToolHorzLine"}),new x({text:window.t("Vertical Line"),callbackContext:"LineToolVertLine",statName:"LineToolVertLine"}),new x({text:window.t("Arrow"),callbackContext:"LineToolArrow",statName:"LineToolArrow"}),new x({text:window.t("Ray"),callbackContext:"LineToolRay",statName:"LineToolRay"}),new x({text:window.t("Extended"),callbackContext:"LineToolExtended",statName:"LineToolExtended"}),new x({text:window.t("Parallel Channel"),callbackContext:"LineToolParallelChannel",statName:"LineToolParallelChannel"}),new C,new x({text:window.t("Pitchfork"),callbackContext:"LineToolPitchfork",statName:"LineToolPitchfork"}),new x({text:window.t("Schiff Pitchfork"),callbackContext:"LineToolSchiffPitchfork",statName:"LineToolSchiffPitchfork"}),new x({text:window.t("Pitchfan"),callbackContext:"LineToolPitchfan",statName:"LineToolPitchfan"}),new x({text:window.t("Gann Square"),callbackContext:"LineToolGannSquare",statName:"LineToolGannSquare"}),new x({text:window.t("Gann Fan"),callbackContext:"LineToolGannFan",statName:"LineToolGannFan"}),new x({text:window.t("Fib Retracement"),callbackContext:"LineToolFibRetracement",statName:"LineToolFibRetracement"}),new x({text:window.t("Trend-Based Fib Extension"),callbackContext:"LineToolTrendBasedFibExtension",statName:"LineToolTrendBasedFibExtension"}),new x({text:window.t("Fib Speed Resistance Fan"),callbackContext:"LineToolFibSpeedResistanceFan",
statName:"LineToolFibSpeedResistanceFan"}),new x({text:window.t("Fib Time Zone"),callbackContext:"LineToolFibTimeZone",statName:"LineToolFibTimeZone"}),new x({text:window.t("Circle Lines"),callbackContext:"LineToolCircleLines",statName:"LineToolCircleLines"}),new x({text:window.t("Fib Circles"),callbackContext:"LineToolFibCircles",statName:"LineToolFibCircles"}),new x({text:window.t("Fib Speed Resistance Arcs"),callbackContext:"LineToolFibSpeedResistanceArcs",statName:"LineToolFibSpeedResistanceArcs"}),new C,new x({text:window.t("Rectangle"),callbackContext:"LineToolRectangle",statName:"LineToolRectangle"}),new x({text:window.t("Ellipse"),callbackContext:"LineToolEllipse",statName:"LineToolEllipse"}),new x({text:window.t("Triangle"),callbackContext:"LineToolTriangle",statName:"LineToolTriangle"}),new x({text:window.t("Polyline"),callbackContext:"LineToolPolyline",statName:"LineToolPolyline"}),new x({text:window.t("Arc"),callbackContext:"LineToolArc",statName:"LineToolArc"}),new C,new x({text:window.t("Text"),callbackContext:"LineToolText",statName:"LineToolText"}),new x({text:window.t("Anchored Text"),callbackContext:"LineToolTextAbsolute",statName:"LineToolTextAbsolute"}),new x({text:window.t("Balloon"),callbackContext:"LineToolBalloon",statName:"LineToolBalloon"}),new x({text:window.t("Price Label"),callbackContext:"LineToolPriceLabel",statName:"LineToolPriceLabel"}),new C,new x({text:window.t("Elliott Wave Subminuette"),callbackContext:"LineToolElliottSubminuette",statName:"LineToolElliottSubminuette"}),new x({text:window.t("Elliott Wave Minor"),callbackContext:"LineToolElliottMinor",statName:"LineToolElliottMinor"}),new x({text:window.t("Elliott Wave Circle"),callbackContext:"LineToolElliottCircle",statName:"LineToolElliottCircle"}),new x({text:window.t("Elliott Minor Retracement"),callbackContext:"LineToolElliottMinorRetr",statName:"LineToolElliottMinorRetr"}),new x({text:window.t("Elliott Major Retracement"),callbackContext:"LineToolElliottMajorRetr",statName:"LineToolElliottMajorRetr"}),new C,new x({text:window.t("Brush"),callbackContext:"LineToolBrush",statName:"LineToolBrush"}),new C,new x({text:window.t("Forecast"),callbackContext:"LineToolPrediction",statName:"LineToolPrediction"})],St=this,i=function(t){P.tool.setValue(t.callbackContext())},n=0;n<wt.length;n++)wt[n].callbacks().subscribe(null,i);t=new x({text:window.t("Scales Properties..."),statName:"ScalesProperties"}),e=new x({text:window.t("Timezone/Sessions Properties..."),statName:"TimezoneSessionsProperties"})}r=new x({text:window.t("Reset Chart"),shortcut:"Alt+R",statName:"ResetChart"}),r.callbacks().subscribe(this,this.GUIResetScales),s=new x({text:window.t("Undo"),shortcut:"ctrl+z"}),s.callbacks().subscribe(null,function(){j("GUI","Undo"),c.undo()}),s.disable(),a=new x({text:window.t("Redo"),shortcut:"ctrl+y"}),a.callbacks().subscribe(null,function(){j("GUI","Redo"),c.redo()}),a.disable(),c.undoStack().onChange().subscribe(this,this.updateUndoRedo),c.redoStack().onChange().subscribe(this,this.updateUndoRedo),l=new x({text:window.t("Loading")}),
h=[l],u=new x({text:window.t("Color Theme"),subActions:h,statName:"ColorTheme"}),d=new x({text:window.t("TimeZone"),statName:"TimeZone"}),p=new x({text:window.t("Change Symbol..."),shortcut:window.t("Any Symbol"),doNotBindShortcut:!0,statName:"ChangeSymbol"}),TVSettings.setValue("symboledit.dialog_last_entry",""),p.callbacks().subscribe(this,function(){O.showDialog({callback:this.setSymbol.bind(this)})}),_=new x({text:window.t("Change Interval..."),shortcut:window.t("Any Number"),doNotBindShortcut:!0,statName:"ChangeInterval"}),_.callbacks().subscribe(this,function(){new D({callback:function(t){V.interval.setValue(t)}}).show()}),TradingView.onWidget()||(f.enabled("add_to_watchlist")&&(v=new x({text:window.t("Add To Watchlist"),shortcut:"Alt+W",statName:"AddToWatchlist"}),v.callbacks().subscribe(this,function(){var t,e,i=widgetbar.setPage("base");for(e=0;e<i.widgets.length;e++)if("watchlist"===i.widgets[e].type){t=i.widgets[e].widgetObject;break}t&&t.addHighlight(this.getSymbol())})),m("text_notes")&&(b=new x({text:window.t("Add To Text Notes"),shortcut:"Alt+N",statName:"AddToTextNotes"}),b.callbacks().subscribe(this,function(){var t=this;runOrSignIn(function(){TradingView.bottomWidgetBar.toggleWidget("text_notes",!0),TradingView.bottomWidgetBar._widgets.text_notes.addNote(null,t.getSymbol(!0),t.getSymbol())},{source:"Add text note in chart context menu"})}))),S=new x({text:window.t("Insert Study Template"),statName:"InserStudyTemplate"}),w=new x({shortcut:"Ctrl+Alt+Q",text:window.t("Reset Scale"),statName:"ResetScale"}),w.callbacks().subscribe(null,function(t){St.model().resetTimeScale()}),T=new x({text:window.t("Insert Drawing Tool"),subActions:wt,statName:"InsertDravingTool"}),L=new x({text:window.t("Remove All Indicators"),statName:"RemoveAllIndicators"}),I=new x({text:window.t("Remove All Drawing Tools"),statName:"RemoveAllDrawingTools"}),k=new x({text:window.t("All Indicators And Drawing Tools"),statName:"RemoveAllIndicatorsAndDrawingTools"}),E=new x({text:window.t("Insert Indicator..."),shortcut:"/",statName:"InsertIndicator"}),B=new x({text:window.t("Script Editor..."),statName:"ScriptEditor"}),R=new x({text:window.t("Compare or Add Symbol..."),statName:"CompareOrAddSymbol"}),z=new x({text:window.t("Compare..."),statName:"Compare"}),F=new x({text:window.t("Objects Tree..."),statName:"ObjectsTree"}),N=new x({text:window.t("Properties..."),statName:"ChartProperties",callback:function(t,e){St.showChartProperties()}}),W=new x({text:window.t("Lock/Unlock"),statName:"ToggleLockSelectedObject"}),W.callbacks().subscribe(this,o.prototype.toggleLockSelectedObject),$=new x({text:window.t("Hide"),statName:"HideSelectedObject"}),$.callbacks().subscribe(this,o.prototype.hideSelectedObject),f.enabled("property_pages")&&(H=new x({text:window.t("Format..."),statName:"EditSelectedObject"}),H.callbacks().subscribe(this,o.prototype.editSelectedObject)),U=new x({text:window.t("Source Code..."),statName:"OpenSelectedObjectSource"}),U.callbacks().subscribe(this,this.openSelectedObjectSource),q=new x({text:window.t("Left Axis"),
checkable:!0,statName:"ToggleLeftAxis"}),q.binder=new g(q,this._properties.scalesProperties.showLeftScale,this.model(),window.t("Show Left Scale")),G=new x({text:window.t("Right Axis"),checkable:!0,statName:"ToggleRightAxis"}),G.binder=new g(G,this._properties.scalesProperties.showRightScale,this.model(),window.t("Show Right Scale")),this._properties.scalesProperties.showLeftScale.listeners().subscribe(this,o.prototype._updateScalesActions),this._properties.scalesProperties.showRightScale.listeners().subscribe(this,o.prototype._updateScalesActions),Y=new x({text:window.t("Scale Price Chart Only"),checkable:!0,statName:"ScalePriceChartOnly"}),Y.binder=new g(Y,this._properties.scalesProperties.scaleSeriesOnly,this.model(),window.t("Scale Price Chart Only")),K=this.model().model(),this._properties.scalesProperties.scaleSeriesOnly.listeners().subscribe(null,function(){K.recalculateAllPanes(),K.invalidate(new M(M.FULL_UPDATE))}),Z=new x({text:window.t("Drawings Toolbar"),checkable:!0,statName:"ToggleDrawingToolbar"}),X=this._options.isDrawingToolbarVisible,X&&(X.subscribe(function(t){Z.setChecked(t)},{callWithLast:!0}),Z.callbacks().subscribe(null,function(){X.setValue(!X.value())})),J=new x({text:window.t("Favorite Drawings Toolbar"),checkable:!0,statName:"ToggleFavoriteDrawingsToolbar"}),Q=this._options.favoriteDrawingToolbar,Q&&(Q.canBeShown().subscribe(function(t){J.setEnabled(t)},{callWithLast:!0}),Q.visibility().subscribe(function(t){J.setChecked(t)},{callWithLast:!0}),J.callbacks().subscribe(null,function(){Q.isVisible()?Q.hide():Q.show()})),tt=new x({text:window.t("Magnet Mode"),checkable:!0,statName:"ToggleMagnetMode"}),tt.binder=new g(tt,P.properties().magnet,this.model(),"Magnet"),et=new x({text:window.t("Stay In Drawing Mode"),checkable:!0,statName:"ToggleStayInDrawingMode"}),et.binder=new g(et,P.properties().stayInDrawingMode,this.model(),window.t("Stay In Drawing Mode")),it=new x({text:window.t("Sync drawings to all charts"),checkable:!0,statName:"ToggleSyncDrawings"}),it.binder=new g(it,P.properties().drawOnAllCharts,this.model(),"SyncDrawings"),ot=new x({text:window.t("Lock All Drawing Tools"),checkable:!0,statName:"ToggleLockDrawings"}),ot.binder=new g(ot,P.lockDrawings(),this.model(),window.t("Lock drawings"),function(t){t||this.binder.setValue(!this.binder.value()),P.lockDrawings().setValue(this.binder.value())}.bind(ot)),nt=new x({text:window.t("Hide All Drawing Tools"),checkable:!0,statName:"ToggleHideAllDrawingTools"}),nt.binder=new g(nt,P.hideAllDrawings(),this.model(),window.t("Hide All Drawing Tools"),function(t){t||this.binder.setValue(!this.binder.value()),P.hideAllDrawings().setValue(this.binder.value())}.bind(nt)),rt=new x({text:window.t("Hide Marks On Bars"),checkable:!0,statName:"ToggleHideMarksOnBars"}),rt.binder=new g(rt,P.hideMarksOnBars(),this.model(),window.t("Hide Marks On Bars"),function(t){t||this.binder.setValue(!this.binder.value()),P.hideMarksOnBars().setValue(this.binder.value())}.bind(rt)),st=new x({text:window.t("Extended Hours"),checkable:!0,statName:"ToggleExtendedHours"}),
st.binder=new g(st,this.model().mainSeries().properties().extendedHours,this.model(),window.t("Change Extended Hours")),at=new x({text:window.t("Symbol Last Value"),checkable:!0,checked:!1,statName:"ToggleSymbolLastValue"}),at.binder=new g(at,this.properties().scalesProperties.showSeriesLastValue,this.model(),window.t("Show Symbol Last Value")),lt=new x({text:window.t("Symbol Prev. Close Value"),checkable:!0,checked:!1,statName:"ToggleSymbolPrevCloseValue"}),lt.binder=new g(lt,this.properties().scalesProperties.showSeriesPrevCloseValue,this.model(),window.t("Show Symbol Previous Close Value")),this.model().mainSeries().onRestarted().subscribe(this,function(){this.updateActionForIntradayOnly(lt)}),ct=new x({text:window.t("Symbol Labels"),checkable:!0,checked:!1,statName:"ToggleSymbolLabels"}),ct.binding=new g(ct,this.properties().scalesProperties.showSymbolLabels,this.model(),"Undo Show Symbol Labels"),ht=new x({text:window.t("Indicator Last Value"),checkable:!0,checked:!1,statName:"ToggleStudyLastValue"}),ht.binder=new g(ht,this.properties().scalesProperties.showStudyLastValue,this.model(),window.t("Show Indicator Last Value")),ut=new x({text:window.t("Indicator Labels"),checkable:!0,checked:!1,statName:"ToggleIndicatorsLabels"}),ut.binding=new g(ut,this.properties().scalesProperties.showStudyPlotLabels,this.model(),"Undo Show Indicator Labels"),dt=new x({text:window.t("Countdown"),checkable:!0,checked:!1,statName:"ToggleCountdown"}),dt.binder=new g(dt,this.model().mainSeries().properties().showCountdown,this.model(),window.t("Show Countdown")),_t=f.enabled("go_to_date"),!TradingView.onWidget()&&_t&&(pt=new x({text:window.t("Go to Date..."),shortcut:"Alt+G",statName:"GoToDate"}),pt.callbacks().subscribe(null,function(){var t=St._chartWidgetCollection.activeChartWidget.value();y(t.model())})),ft=new x({text:window.t("Symbol Info..."),checkable:!1,statName:"SymbolInfo"}),ft.callbacks().subscribe(null,function(){var t=St.model().mainSeries().symbol(),e=St.model().mainSeries().symbolInfo();A(t,{symbolInfo:e})}),St.onWidget()||(mt=new x({text:window.t("Snapshot"),shortcut:"Alt+s",statName:"Snapshot"}),mt.callbacks().subscribe(null,function(){St._chartWidgetCollection.takeScreenshot()}),gt=new x({text:window.t("Switch to the next chart"),shortcut:"Tab",statName:"SwitchChart"}),gt.callbacks().subscribe(null,function(){St._chartWidgetCollection.switchChart()})),this._actions={chartProperties:N,timeScaleReset:w,chartReset:r,compareOrAdd:R,compare:z,paneObjectTree:F,insertIndicator:E,insertDrawingTool:T,applyColorTheme:u,applyStudyTemplate:S,symbolSearch:p,showSymbolInfoDialog:ft,changeInterval:_,seriesHide:$,studyHide:$,lineToggleLock:W,lineHide:$,showLeftAxis:q,showRightAxis:G,scaleSeriesOnly:Y,drawingToolbarAction:Z,favoriteDrawingToolbar:J,magnetAction:tt,stayInDrawingModeAction:et,syncModeAction:it,lockDrawingsAction:ot,hideAllDrawingsAction:nt,hideAllMarks:rt,applyTimeZone:d,extendedHours:st,showCountdown:dt,showSeriesLastValue:at,showSeriesPrevCloseValue:lt,showSymbolLabelsAction:ct,showStudyLastValue:ht,
showStudyPlotNamesAction:ut,undo:s,redo:a,viewSourceCode:U,takeScreenshot:mt},t&&(this._actions.scalesProperties=t),e&&(this._actions.tmzProperties=e),v&&(this._actions.addToWatchlist=v),!TradingView.onWidget()&&f.enabled("text_notes")&&m("text_notes")&&(this._actions.addToTextNotes=b),!TradingView.onWidget()&&_t&&(this._actions.gotoDate=pt),f.enabled("charting_library_base")||(this._actions.scriptEditor=B),this.createSessionBreaksActions(),this.readOnly()||(vt=new x({text:window.t("Remove"),shortcut:"Del",statName:"RemoveSelectedObject"}),vt.callbacks().subscribe(this,function(){var t;this._chartWidgetCollection&&(t=this._chartWidgetCollection.activeChartWidget.value()),t||(t=this),t.removeSelectedSource()}),yt=new x({text:window.t("Stop syncing drawing"),statName:"StopSyncingDrawing"}),yt.callbacks().subscribe(this,function(){var t;this._chartWidgetCollection&&(t=this._chartWidgetCollection.activeChartWidget.value()),t||(t=this),t.unlinkSelectedLine()}),bt=new x({text:window.t("Sync drawing to all charts"),statName:"SyncDrawingToAllCharts"}),bt.callbacks().subscribe(this,function(){var t;this._chartWidgetCollection&&(t=this._chartWidgetCollection.activeChartWidget.value()),t||(t=this),t.copyLineToOtherCharts()}),this._actions.insertDrawingTool=T,this._actions.paneRemoveAllStudies=L,this._actions.paneRemoveAllDrawingTools=I,this._actions.paneRemoveAllStudiesDrawingTools=k,this._actions.seriesRemove=vt,this._actions.studyRemove=vt,this._actions.lineRemove=vt,this._actions.lineUnlink=yt,this._actions.lineCopyToCharts=bt,f.enabled("property_pages")&&(this._actions.format=H),this._actions.lockDrawingsAction=ot,this._actions.hideAllDrawingsAction=nt,this._actions.hideAllMarks=rt,this._actions.paneRemoveAllStudies.callbacks().subscribe(this,o.prototype.removeAllStudies),this._actions.paneRemoveAllDrawingTools.callbacks().subscribe(this,o.prototype.removeAllDrawingTools),this._actions.paneRemoveAllStudiesDrawingTools.callbacks().subscribe(this,o.prototype.removeAllStudiesDrawingTools)),this._actions.paneObjectTree.callbacks().subscribe(this,o.prototype.showSourceProperties),this._actions.chartProperties.callbacks().subscribe(this,o.prototype.showChartProperties),this._actions.insertIndicator.callbacks().subscribe(this,o.prototype.showIndicators),this._actions.scriptEditor&&this._actions.scriptEditor.callbacks().subscribe(this,o.prototype.showScriptEditor),this._actions.compareOrAdd.callbacks().subscribe(this,o.prototype.showCompareOrAdd),this._actions.compare.callbacks().subscribe(this,o.prototype.showCompareOrAdd),this._actions.scalesProperties&&this._actions.scalesProperties.callbacks().subscribe(this,o.prototype.showScalesProperties),this._actions.tmzProperties&&this._actions.tmzProperties.callbacks().subscribe(this,o.prototype.showTimezoneProperties),this._updateScalesActions()},o.prototype.executeActionById=function(t){if(t in this._actions){var e=this._actions[t];e.checkable&&e.setChecked(!e.checked),this._actions[t].callbacks().fire(e)}else console.warn("Unknown action id: "+t)},
o.prototype.getCheckableActionState=function(t){if(t in this._actions){var e=this._actions[t];if(e.checkable)return e.checked;console.warn("Action "+t+" has no state")}else console.warn("Unknown action id: "+t);return null},o.prototype._updateScalesActions=function(){if(this._actions){for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].updateScalesVisibility();this._timeAxisWidget.updatePriceScalesVisibility(),this._update(new M(M.FULL_UPDATE))}},o.prototype.removeAllStudies=function(){this._model.removeAllStudies()},o.prototype.removeAllDrawingTools=function(){this._model.removeAllDrawingTools()},o.prototype.removeAllStudiesDrawingTools=function(){this._model.removeAllStudies(),this._model.removeAllDrawingTools()},o.prototype.model=function(){return this._model},o.prototype.defaultSymbol=function(){return this._defSymbol},o.prototype.connect=function(){this._handler=function(t){this._onData(t)}.bind(this),this._chartSession.connect(this._handler)},o.prototype.finishInitWithoutConnect=function(){this._chartSession.disable(),this._init(),this.chartWidgetInitialized.fire()},o.prototype.update=function(){if(this._model){for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].update();this._timeAxisWidget.update()}},o.prototype.paint=function(t){t||(t=new M(M.FULL_UPDATE));for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].paint(t.invalidateForPane(e),!1);this._timeAxisWidget&&this._timeAxisWidget.paint(t.fullInvalidation()),this._redrawPanes.fire()},o.prototype._makeDefaultGui=function(){this._makeChartWidget(),this._makeLoadingScreen(),this._makeMasterTable(),this._makeTimeAxisWidget(),this._adjustSize(),this._updateScalesActions(),$("*",this._jqMainTable).selectable(!1),this.update(),this.paint()},o.prototype.widget=function(){return this._jqMainDiv},o._linetoolWarningDialogShown=!1,o.prototype.restoreState=function(t,e){var n,r;if(this._adjustSize(),n=this._model.restoreState(this._content,e),this._setActions(),n&&n.lines_limit_exceeded&&!this.readOnly()){if(o._linetoolWarningDialogShown)return;r=N({type:"modal",destroyOnClose:!0,width:500,title:window.t("Warning"),content:window.t("This chart layout has more than 1000 drawings, which is a lot! This may negatively affect performance, storage and publishing. We recommend to remove some drawings to avoid potential performance issues."),actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">',actions:[{name:"open-manage-drawings",type:"primary",text:window.t("Open Manage Drawings"),method:"close"},{name:"not-now",type:"default",text:window.t("Not Now"),method:"close"}]}),r.on("action:open-manage-drawings",function(){i.e(3,function(t){new(0,i(405).ObjectTreeDialog)({chartWidget:this,activeTab:1},this._model).show()}.bind(this))}.bind(this)),o._linetoolWarningDialogShown=!0,r.on("afterClose",function(){o._linetoolWarningDialogShown=!1}),r.open()}},o.prototype.redrawPanes=function(t){
for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].paint();this._redrawPanes.fire()},o.prototype.setBackgroundColor=function(t){this.scaleBackgroundColor=t.value();for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].paint(),this._paneWidgets[e].setCursorForTool();this.update(),this.paint()},o.prototype.setScaleLineColor=function(t){this.scaleLineColor=t.value(),$.each(this._paneSeparators,function(){this.update()}),this.update(),this.paint()},o.prototype.setScaleTextColor=function(t){this.scaleTextColor=t.value(),this.update(),this.paint()},o.prototype._update=function(t){var e;if(this.performance&&t.start(),t&&t.fullInvalidation()!==M.FULL_UPDATE){if(t.fullInvalidation()===M.LIGHT_UPDATE){for(this._timeAxisWidget.update(),e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}else if(t.fullInvalidation()===M.UPDATE_CURSOR_ONLY){for(e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}}else{for(this._model?this._updateGui():this._adjustSize(),this._timeAxisWidget.update(),e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e]._state=this._model.panes()[e],this._paneWidgets[e].statusWidget().updateLayout();this._dataWindowWidget&&this._dataWindowWidget.fullUpdate()}this.paint(t),this.performance&&(t.end(),this.performance.newChartDraw(t))},o.prototype._createVolumeIfNeeded=function(){var t=f.enabled("create_volume_indicator_by_default")&&this._options.addVolume,e=!this._content,i=f.enabled("charting_library_base"),o=f.enabled("create_volume_indicator_by_default_once"),n=this._content&&!this._content.loading;t&&(e||i&&n&&!o)&&this._model.mainSeries().onSymbolResolved().subscribe(this,function(){var t=this;setTimeout(function(){var e,i,o,n,r=t._model.model().mainSeries().symbolInfo();r&&(e=!r.has_no_volume,!t.containsVolume()&&e?(i=TradingView.factoryDefaults("chartproperties.volumePaneSize"),o={paneSize:i},f.enabled("hide_volume_ma")&&(o.styles={vol_ma:{visible:!1}}),t.insertStudy("Volume@tv-basicstudies",!1,f.enabled("volume_force_overlay"),void 0,o)):!e&&t.containsVolume()&&(n=t.model().dataSources().filter(function(t){return t instanceof b&&"Volume"===t.metaInfo().shortId})[0],t._model.model().removeSource(n)))},0)},o)},o.prototype._restartModel=function(){this._model.restart()},o.prototype._makeDefaultModel=function(){function t(){return h(l._chartSession,function(t){if(!(t instanceof M))throw Error("Invalid mask");l._invalidateMask?l._invalidateMask.merge(t):l._invalidateMask=t,l._draw_planned||(l._draw_planned=!0,l._options.visible.when(function(){requestAnimationFrame(e)}))},l._properties,l.readOnly(),n,l._studiesMetaData,l._studiesMigrations,l)}function e(){l._draw_planned=!1,l._inLoadingState||l._invalidateMask&&(l._invalidateMask=l._update(l._invalidateMask))}var i,n,r,s,a,l=this;if(this._content&&this._content.timeScale.points&&(i=this._content.timeScale.points.items[0],n={startDate:i}),
!this._studiesMetaData)throw Error("Cannot create chart model: studies metainfo is absent");if(f.enabled("lean_chart_load")?this._model=this._model||t():this._model=t(),this._createVolumeIfNeeded(),r=function(){var t,e;this._model.onTagsChanged().subscribe(this,o.prototype.onModelTagsChanged),this._updateGui(),this._modelCreated.fire(this._model),this._tagsChanged.fire(),t=this._model.mainSeries(),this._defTimeframe&&t.setDefaultTimeframe(this._defTimeframe),this._model.lineCancelled().subscribe(this,this.onLineCancelled),t.onSymbolNotPermitted().subscribe(null,function(e){t.properties().symbol.setValue(e)}),t.properties().style.unsubscribe(this,this._onChartStyleChanged),t.properties().style.subscribe(this,this._onChartStyleChanged),e=this._options,e.handleSessionErrors&&(t.chartTypeNotPermitted.subscribe(null,function(){t.properties().interval.setValue("D")}),t.intradaySpreadNotPermitted.subscribe(null,function(){t.properties().interval.setValue("D")}),t.customIntervalNotPermitted.subscribe(null,function(){t.properties().interval.setValue("D")}),t.intradayExchangeNotPermitted.subscribe(null,function(){t.properties().interval.setValue("D")}),l._options.muteSessionErrors||t.onExtendedHoursNotPermitted().subscribe(null,function(){})),this._options.handleSessionErrors&&(t.requestingIntradayWhenNotSupported.subscribe(null,function(){t.properties().interval.setValue("D"),l._options.muteSessionErrors||TVDialogs.showIntervalMismatchDialog()}),t.requestingResolutionWhenNotSupported.subscribe(null,function(e){t.properties().interval.setValue(e)}))}.bind(this),this._content){if(this.restoreState(this._content,this._containsData),f.enabled("chart_content_overrides_by_defaults"))return this._defSymbol&&(s=this.setSymbol(this._defSymbol),this.applyAutoScaleOnNewSymbol()),a=function(){return this._defInterval&&this.setResolution(this._defInterval),void 0!==this._defStyle&&this.setSeriesStyle(this._model.mainSeries(),this._defStyle),r()}.bind(this),void 0===s?a():s.then(a)}else this._setActions();return r()},o.prototype._onChartStyleChanged=function(){j("Chart","Chart Style "+this._model.mainSeries().getStyleShortName().toUpperCase())},o.prototype._updateGui=function(){this._model&&(this._makePaneWidgetsAndSeparators(),this._makeTimeAxisWidget(),$("*",this._jqMainTable).selectable(!1),this._adjustSize())},o.prototype.setVisibleTimeRange=function(t,e,i){this._chartSession.setVisibleTimeRange(this._model.mainSeries(),t,e,i)},o.prototype._dateRangeResolutions=function(){return ChartApiInstance.availableTimeFrames(this._model.mainSeries().symbolInfo(),this._model.mainSeries().status())||[]},o.prototype._makeChartWidget=function(){this._jqMainDiv=$(document.createElement("div")),this._jqMainDiv.addClass("chart-widget"),this._tooltipDiv=$(document.createElement("div")).appendTo(this._jqMainDiv),this._tooltipDiv.addClass("tooltip-wrapper"),this._withDateRanges&&(!f.enabled("lean_chart_load")||!this._chartControlsBar)&&(this._chartControlsBar=$(document.createElement("div")).attr("class","chart-controls-bar").appendTo(this._jqParent),
this._seriesControlWidget=new k({parent:this._chartControlsBar,chartWidget:this})),(this._options.controlBar||f.enabled("control_bar"))&&(this._controlBarNavigation=new I(this,this._jqMainDiv,!0)),this._containsData||this.createIndicatorImage()},o.prototype._makeLoadingScreen=function(){if(f.enabled("lean_chart_load")){if(this.screen)return;this.screen=new o.LoadingScreen(this,this._jqParent)}else this.screen=new o.LoadingScreen(this,this._jqMainDiv)},o.prototype._setSymbol=function(t,e){if(this._model){var i=this._model.mainSeries();if(!e&&i.symbolSameAsCurrent(t)&&!f.enabled("same_data_requery"))return;this._model.setSelectedSource(null),this._model.setScreenChartProperty(i.properties().symbol,t,this,"Change Symbol",f.enabled("same_data_requery"))}else this._properties.mainSeriesProperties.merge({symbol:t})},o.prototype.setSymbol=function(t,e){return this._setSymbol.apply(this,arguments)},o.prototype.getSymbol=function(t){var e;return e=this._model?this._model.mainSeries().properties():this._properties.mainSeriesProperties,e?t&&e.shortName&&e.shortName.value()?e.shortName.value():e.symbol.value():""},o.LoadingScreen=function(t,e){this._cw=t,this.$element=$('<div class="chart-loading-screen">'),this.$shield=$('<div class="chart-loading-screen-shield">').appendTo(this.$element),this.$element.appendTo(e),this._showed=!1,this._cw.withModel(this,this._connectToModel)},o.LoadingScreen.prototype._connectToModel=function(){this._cw.model().mainSeries().onDataLoaded().subscribe(this,function(t){switch(t.method){case"symbol_error":t.params[1]!==_.PERMISSION_DENIED&&this.hide();break;case"series_error":f.enabled("hide_loading_screen_on_series_error")&&this.hide();break;case"series_completed":this.hide()}})},o.LoadingScreen.prototype.show=function(){return this._cw._inLoadingState=!0,this._showed||(this._showed=!0,this._show()),$.Deferred().resolve()},o.LoadingScreen.prototype._show=function(){var t=this._cw.properties().paneProperties.background.value();this.$shield.css("background",t),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.prototype._makeMasterTable=function(){this._jqMainTable=$(document.createElement("table")),this._jqMainTable.appendTo(this._jqMainDiv),this._jqMainTable.addClass("chart-markup-table"),this._jqMainTable.attr("cellpading","0"),this._jqMainTable.attr("cellspacing","0")},o.prototype.unsetActivePaneWidget=function(){this.activePaneWidget=!1},o.prototype.setActivePaneWidget=function(t){this.activePaneWidget=t},o.prototype.isMaximizedPane=function(){return!!this._maximizedPaneWidget},o.prototype.toggleMaximizePane=function(t){if(!(this._paneWidgets.length<2)){this._maximizedPaneWidget?(this._maximizedPaneWidget.state().setMaximized(!1),this._maximizedPaneWidget=null,this._paneSeparators.forEach(function(t){t.show()})):(this._maximizedPaneWidget=t,
this._maximizedPaneWidget.state().setMaximized(!0),this._paneSeparators.forEach(function(t){t.hide()}));for(var e=this._paneWidgets.length;e--;)this._paneWidgets[e].updateControls();this._adjustSize(),this.updateIndicatorImagePosition()}},o.prototype._makePaneWidgetsAndSeparators=function(){var t,e,i,o,n=this._model.panes(),r=n.length,s=this._paneWidgets.length;for(t=r;t<s;t++)e=this._paneWidgets.pop(),e.jqRow.remove(),e.jqRow.find("*").remove(),e.destroy(),(i=this._paneSeparators.pop())&&i.jqRow.remove();for(t=s;t<r;t++)e=new a(this,n[t],this._onWidget,this._options.verticalTouchScroll),e.onMouseLeave=this.unsetActivePaneWidget.bind(this),e.onMouseEnter=this.setActivePaneWidget.bind(this),this._paneWidgets.push(e),t>0&&(i=new l(this,t-1,t),this._paneSeparators.push(i),this._timeAxisWidget?i.jqRow.insertBefore(this._timeAxisWidget.jqRow):i.jqRow.appendTo(this._jqMainTable)),this._timeAxisWidget?e.jqRow.insertBefore(this._timeAxisWidget.jqRow):e.jqRow.appendTo(this._jqMainTable);for(t=0;t<r;t++)o=n[t],e=this._paneWidgets[t],e.state()!==o&&e.setState(o);for(t=r;t--;)this._paneWidgets[t].updateControls()},o.prototype._makeTimeAxisWidget=function(){this._timeAxisWidget||(this._timeAxisWidget=new d(this,this._onWidget),this._timeAxisWidget.jqRow.appendTo(this._jqMainTable))},o.prototype.insertStudyOrShowDialog=function(t,e){var i,o,n,r,s,a,l,c;this.isSymbolicStudy(t)?(i=defaults("study_"+t.id).description,o=$('<input type="text" class="symbol-edit single" placeholder="'+window.t("Symbol")+'" maxlength="30" style="text-transform: none; font-weight: normal;" autocomplete="off">'),o.css({float:"none","box-sizing":"border-box",width:"100%"}),n=null,r=N({title:i||window.t("Add Symbol"),width:400,actions:[{name:"apply",text:window.t("Apply"),type:"primary"}],content:o,isClickOutFn:function(t){if(n&&(t.target===n[0]||n[0].contains(t.target)))return!1}}),s=function(i){var o={inputs:{symbol:i}};this.model().insertStudy(t,o,!1,e),r.close()},a=O.bindToInput(o,{callback:s.bind(this),onPopupOpen:function(t){t.css("z-index",r.zIndex),n=t},onPopupClose:function(){n=null}}),r.on("action:apply",function(){a.acceptTypeIn()}),r.open()):this.hasConfirmInputs(t)?(i=defaults("study_"+t.id).description,K.show(this,t,{title:i,callback:function(i){this.model().insertStudy(t,i,!1,e)}.bind(this)})):b.isPointsBasedStudy(t.id)?(l=b.lineToolNameForPointsBasedStudy(t.id),P.tool.setValue(l)):(c="Volume@tv-basicstudies"===t.id,this.insertStudy(t.id,!0,c,null,null,e))},o.prototype.hasConfirmInputs=function(t){var e,i,o=t.inputs;if(void 0===o)return!1;for(e=0;e<o.length;++e)if(i=o[e],void 0!==i.confirm&&i.confirm)return!0;return!1},o.prototype.isSymbolicStudy=function(t){switch(t.id){case"Overlay@tv-basicstudies":case"CorrelationCoefficient@tv-basicstudies":return!0;default:return!1}},o.prototype.isPointsBasedStudy=function(t){return b.isPointsBasedStudy(t.id)},o.prototype.insertStudy=function(t,e,i,o,n,r){var a,l=H.findStudyMetaInfo(this._studiesMetaData,t);l=TradingView.clone(l),s(!l.isTVScriptStubToCompile,"MetaInfo stub is unexpected here!"),a=o?{
inputs:o}:{},n&&(a=$.extend(a,n)),e?this._model.insertStudy(l,a,i,r):this._model.model().insertStudy(l,a,i,r)},o.prototype.insertStudyStub=function(t){return this.model().insertStudyStub(t)},o.prototype.removeStudyStub=function(t){return this.model().removeStudyStub(t)},o.prototype._adjustSize=function(){var t,e,i,o,n,r,s,a,c=this,h=0,d=0,p=0;$.each(this._paneWidgets,function(){c._maximizedPaneWidget&&c._maximizedPaneWidget!==this||(h=Math.max(this.lhsPriceAxisWidget.optimalWidth(),h),d=Math.max(this.rhsPriceAxisWidget.optimalWidth(),d),p+=this.stretchFactor())}),t=this._width.value(),e=this._height.value(),this._chartControlsBar&&(e=Math.max(e-this.controlBarHeight,0)),i=t-h-d,o=this._paneSeparators.length,n=l.HEIGHT,r=this._timeAxisWidget.optimalHeight(),s=e-n*o-r,a=s/p,this._jqMainTable.width(t),this._jqMainTable.height(e),this._jqMainDiv.width(t),this._jqMainDiv.height(e),$.each(this._paneWidgets,function(t){c._model&&(this._state=c._model.panes()[t]);var e=c._maximizedPaneWidget?c._maximizedPaneWidget===this?s:0:Math.max(Math.round(this.stretchFactor()*a),2);this.setPriceAxisSize(u.LHS,new Y(h,e)),this.setPriceAxisSize(u.RHS,new Y(d,e)),this.setSize(new Y(i,e)),c._model&&this.state()&&c._model.setPaneHeight(this.state(),e)}),this._timeAxisWidget.setSize(new Y(i,r),new Y(h,r),new Y(d,r)),this._model&&this._model.setWidth(i),this.maxLhsPriceAxisWidth!==h&&(this.maxLhsPriceAxisWidth=h,this.lhsPriceAxisWidthChanged.fire(h)),this.maxRhsPriceAxisWidth!==d&&(this.maxRhsPriceAxisWidth=d,this.rhsPriceAxisWidthChanged.fire(d))},o.prototype._onData=function(t){switch(t.method){case"connected":this._onConnection();break;case"disconnected":this._onDisconnect();break;case"reconnect_bailout":this._reconnectBailout.fire();break;case"connection_error":this._onConnectionError(t.params[0]);break;case"critical_error":this._disconnected.fire(!0);break;default:this._model.onData(t)}},o.prototype._nextMetadataId=1,o.prototype._onConnection=function(){this._online=!0,this._model?(this._restartModel(),this._updateGui(),this.update(),this.paint(),this._connected.fire()):this.requestMetadata()},o.prototype._onDisconnect=function(){this._model&&this._model.disconnect(),this._online=!1,this.update(),this.paint(),this._disconnected.fire()},o.prototype._applyStudiesOverrides=function(){H.overrideDefaults(this._studiesMetaData)},o.prototype.requestMetadata=function(){f.enabled("charting_library_base")&&this._chartSession.requestMetadata("metadata_"+o._nextMetadataId,function(t){var e,i=t.params[1];for(e=0;e<i.length;++e)H.addOrReplaceStudyMetaInfo(this._studiesMetaData,r(i[e]));this._applyStudiesOverrides(),this._inited||(this._init(),this.chartWidgetInitialized.fire())}.bind(this)),o._nextMetadataId++},o.prototype.studiesMetaData=function(){return this._model.studiesMetaData()},o.prototype._onConnectionError=function(t){this._disconnected.fire()},o.prototype.getTimeScale=function(){return this._timeAxisWidget},o.prototype.setSeriesStyle=function(t,e){this._model.setProperty(t.properties().style,e)},
o.prototype.showSourceProperties=function(t){var e=this;i.e(3,function(t){new(0,i(405).ObjectTreeDialog)({chartWidget:e},e._model).show()})},o.prototype.showChartProperties=function(t){if(!f.enabled("show_chart_property_page"))return Promise.resolve();t&&t.text===window.t("Properties...")&&TVSettings.setValue("properties_dialog.active_tab.chart",window.t("Style"));var e=this;return new Promise(function(t){v(e._model.mainSeries(),e._model,{doNotCloseOnBgClick:!0}).then(function(e){t(e.isVisible()?e._dialog:null)})})},o.prototype.showScriptEditor=function(){TradingView.bottomWidgetBar&&TradingView.bottomWidgetBar.activateScriptEditorTab()},o.prototype.showCompareOrAdd=function(){new E(this._chartWidgetCollection).show()},o.prototype.showIndicators=function(t){if(window.studyMarket)return window.studyMarket.isVisible()?void window.studyMarket.hide():(window.studyMarket.show(t),window.studyMarket)},o.prototype.showScalesProperties=function(t){v(this._model.mainSeries(),this._model,{selectScales:!0})},o.prototype.showTimezoneProperties=function(){v(this._model.mainSeries(),this._model,{selectTmz:!0})},o.prototype.removeSelectedSource=function(){var t,e=this,i=e._model.selectedSource();!i||i===e._model.mainSeries()||i===e._model.lineBeingCreated()||i instanceof p||(i.hasAlert.value()&&i.isUserDeletable()?(t=Z({type:"modal",content:window.t("This drawing is used in alert. If you remove the drawing, the alert will be also removed. Do you want to remove the drawing anyway?")}),t.on("action:yes",function(t){e._model.removeSelectedSource(),t.close()}),t.open()):i instanceof b&&i.hasChildren()?showDeleteStudyTreeConfirm(e._model.removeSelectedSource.bind(e._model)).open():e._model.removeSelectedSource())},o.prototype.unlinkSelectedLine=function(){var t=this._model.selectedSource();t instanceof w&&this._model.unlinkLine(t)},o.prototype.copyLineToOtherCharts=function(){var t=this._model.selectedSource();t instanceof w&&this._model.copyToOtherCharts(t)},o.prototype.hideSelectedObject=function(){var t=this._model.selectedSource();t&&this._model.setProperty(t.properties().visible,!1,"Hide "+t.title())},o.prototype.toggleLockSelectedObject=function(){var t,e=this._model.selectedSource();e&&(t=e.properties().frozen.value(),this._model.setProperty(e.properties().frozen,!t,(t?window.t("Unlock"):window.t("Lock"))+" "+e.title()))},o.prototype.editSelectedObject=function(t){var e=this._model.selectedSource();e&&v(e,this._model)},o.prototype.openSelectedObjectSource=function(t){},o.prototype.resetPriceAxisOptimalWidth=function(t){$.each(this._paneWidgets,function(){this.resetPriceAxisOptimalWidth(t)}),this._redrawPanes.fire()},o.prototype.adjustPriceAxisWidth=function(t){this.resetPriceAxisOptimalWidth(t),this._adjustSize()},o.prototype.setPriceAxisVisible=function(t,e){$.each(this._paneWidgets,function(){this.setPriceAxisVisible(t,e)}),this._timeAxisWidget.setStubVisible(t,e),this._adjustSize(),this._redrawPanes.fire()},o.prototype.setTimeAxisVisible=function(t){this._timeAxisWidget.setVisible(t),this._adjustSize()},
o.prototype.isTextTool=function(t){switch(t){case"LineToolBalloon":case"LineToolText":case"LineToolTextAbsolute":case"LineToolCallout":case"LineToolNote":case"LineToolNoteAbsolute":return!0}return!1},o.prototype.tags=function(){return this._model?this._model.calculateDefaultTags():[]},o.prototype.state=function(t,e){return this._model.state(t,e)},o.prototype.asyncState=function(t){return this._model.asyncState(t)},o.prototype.metaInfo=function(){var t=this._metaInfo;return this._model&&(t.systemTags=this._model.calculateDefaultTags()),t},o.prototype.image=function(){var t,e,i,o,n,r,s,a,l=document.createElement("canvas"),c=l.getContext("2d"),h=0,u=this._timeAxisWidget.size.h,d=this.properties().scalesProperties.lineColor.value();for(e=0;e<this._paneWidgets.length;e++)(t=this._paneWidgets[e])&&t.state()&&(t.state().recalculate(!0),0===e&&(h=t.lhsPriceAxisWidget.size.w+t.size.w+t.rhsPriceAxisWidget.size.w),u+=t.size.h);for(u+=this._paneWidgets.length-1,this._update(),i=25,o=5,l.width=h+2*o,l.height=u+i+2*o,c.fillStyle="#F2F5F8",c.fillRect(0,0,l.width,l.height),n=i+o,r=o,s=this.mainSeriesQuotesAndMetainfo(),s.ohlc&&(a="{0} O:{1} H:{2} L:{3} C:{4}".format(s.meta.symbol,s.ohlc[0],s.ohlc[1],s.ohlc[2],s.ohlc[3]),c.fillStyle="#000",c.font="12px Verdana, Arial",c.fillText(a,r,o+15)),e=0;e<this._paneWidgets.length;e++)t=this._paneWidgets[e],c.drawImage(t.lhsPriceAxisWidget.canvas,r,n),c.drawImage(t.canvas,r+t.lhsPriceAxisWidget.size.w,n),t.statusWidget().renderTo(c,r+5,n+5),c.drawImage(t.rhsPriceAxisWidget.canvas,r+t.lhsPriceAxisWidget.size.w+t.size.w,n),n+=t.size.h,e<this._paneWidgets.length-1&&(c.fillStyle=d,c.fillRect(r,n,h,1),n++);return c.drawImage(this._timeAxisWidget.lhsCanvas,r,n),c.drawImage(this._timeAxisWidget.canvas,r+t.lhsPriceAxisWidget.size.w,n),c.drawImage(this._timeAxisWidget.rhsCanvas,r+t.lhsPriceAxisWidget.size.w+t.size.w,n),c.lineWidth=1,c.strokeStyle="#000",c.strokeRect(o+.5,i+o+.5,h-1,u-1),l},o.prototype.images=function(){function t(t){var e,o,n,r,s;for(t.paint(M.LIGHT_UPDATE,i._onWidget),e=t.image(i._onWidget),e.containsMainSeries=t.containsMainSeries(),e.studies=[],o=t.state().dataSources(),n=0;n<o.length;n++)r=o[n],s=i.properties().paneProperties.legendProperties,r instanceof b?r.properties().visible.value()&&r.statusView()&&s.showStudyTitles.value()&&s.showLegend.value()&&e.studies.push(r.statusView().text()):r instanceof _&&s.showLegend.value()&&s.showSeriesTitle.value()&&(e.mainSeriesText=r.statusView().text());return e}var e,i,o,n,r,s,a;if(TradingView.printing=!0,e=this._model.selectedSource(),this._model.setSelectedSource(null),i=this,o=[],this.isMaximizedPane())o.push(t(this._maximizedPaneWidget));else for(n=0;n<this._paneWidgets.length;n++)r=this._paneWidgets[n],o.push(t(r)),n<this._paneWidgets.length-1&&o.push(this._paneSeparators[n].image());return this._timeAxisWidget.paint(M.LIGHT_UPDATE),s=this._timeAxisWidget.image(),TradingView.printing=!1,this._model.setSelectedSource(e),this._model.invalidate(new M(M.LIGHT_UPDATE)),a=this.mainSeriesQuotesAndMetainfo(),{panes:o,timeAxis:s,colors:{
text:this.properties().scalesProperties.textColor.value(),bg:this.properties().paneProperties.background.value(),scales:this.properties().scalesProperties.lineColor.value()},meta:a.meta,ohlc:a.ohlc,quotes:a.quotes}},o.prototype.mainSeriesQuotesAndMetainfo=function(){var t,e,i,o,n,r,s,a=this._model.mainSeries();return a&&(o=function(t){return null==t?"":a.formatter().format(t)+""},n=function(t){return null==t?"":t+""},t={resolution:a.interval(),symbol:a.symbol()},r=a.symbolInfo(),r&&(t.symbol=r.full_name,t.description=r.description,t.exchange=r.exchange),s=a.bars().last(),null!==s&&(e=s.value.slice(1,5).map(o)),a.quoteData&&(i={change:o(a.quoteData.change),changePercent:n(a.quoteData.change_percent),last:o(a.quoteData.last_price)})),{meta:t,ohlc:e,quotes:i}},o.prototype.onTagsChanged=function(){return this._tagsChanged},o.prototype.onModelTagsChanged=function(){this._tagsChanged.fire()},o.prototype.destroy=function(){this._model.model().destroy(),this.performance&&this.performance.destroy(),this._chartSession.destroy()},o.prototype.title=function(){return window.t("Chart Properties")},o.prototype.symbolProperty=function(){return this._model.mainSeries().properties().shortName?this._model.mainSeries().properties().shortName:this._model.mainSeries().properties().symbol},o.prototype.loadContent=function(t,e){var i,o,n,r,s,a;for(this.screen.show(),i=this,this.isMaximizedPane()&&this.toggleMaximizePane(),o=i._model.model().dataSources(),n=0;n<o.length;n++)(r=o[n])!==i._model.mainSeries()&&i._model.model().removeSource(r,!0);for(this._model.disconnect(),i._jqMainDiv&&(i._jqMainDiv.remove(),i._jqMainDiv=null),i._timeAxisWidget=null,i._paneWidgets=[],i.activePaneWidget=!1,i._model.mainSeries().purgeSymbolInfo(),t.loading=!0,i._setContent(t),n=0;n<t.panes.length;++n)for(a=0;a<t.panes[n].sources.length;++a)if(t.panes[n].sources[a].state.symbol){s=t.panes[n].sources[a].state;break}if(!s)throw Error("An error occured while determining main series ion the chart");i._properties.mainSeriesProperties.merge({visible:!0,symbol:s.symbol,timeframe:"",onWidget:i._onWidget,interval:s.interval||"D",style:s.style}),i._init(),V.interval.setValue(s.interval),c.clearStack(),i.updateSeriesControlUI()},o.prototype._setContent=function(t){t&&t.panes.forEach(function(t){t.sources=t.sources.filter(function(t){return!!t&&("MainSeries"===t.type||(!t.points||!t.points.some(function(t){return null===t.time_t||!isFinite(t.time_t)})||(Q.logNormal("Dropped invalid "+t.type+". Reason: non-numeric point time"),!1)))});var e=function(e){return t.sources&&t.sources.some(function(t){return t.id===e})};t.leftAxisSources&&(t.leftAxisSources=t.leftAxisSources.filter(e)),t.rightAxisSources&&(t.rightAxisSources=t.rightAxisSources.filter(e))}),this._content=t},o.prototype._contentSeriesProperties=function(){var t,e,i;if(this._content)for(t=this._content.panes.length;t-- >0;)for(e=this._content.panes[t].sources,i=e.length;i-- >0;)if("MainSeries"===e[i].type)return e[i].state},o.prototype.updateSeriesControlUI=function(){
this._seriesControlWidget&&this._seriesControlWidget.updateUI()},o.prototype.tickSeriesControlClock=function(){this._seriesControlWidget&&this._seriesControlWidget.tickClock()},o.prototype.resizeSeriesControlUI=function(){this._seriesControlWidget&&this._seriesControlWidget.resizeUI()},o.prototype.updateUndoRedo=function(){c.undoStack().isEmpty()?this.actions().undo.setEnabled(!1):this.actions().undo.setEnabled(!0),c.redoStack().isEmpty()?this.actions().redo.setEnabled(!1):this.actions().redo.setEnabled(!0)},o.prototype.createSessionBreaksActions=function(t){var e,i=this,o=function(){e=new x({text:window.t("Session Breaks"),checkable:!0,statName:"ToggleSessionBreaks"}),e.binder=new g(e,i.model().mainSeries().sessionsStudy().properties().graphics.vertlines.sessBreaks.visible,i.model(),"Session Breaks"),i._actions.sessionBreaks=e};i.model().mainSeries().sessionsStudy()?o():i.model().mainSeries().onSessionsStudyCreated().subscribe(i,function(){o()})},o.prototype.updateActionForIntradayOnly=function(t){!t||!t instanceof x||t.setEnabled(!!this.model().mainSeries().isIntradayInterval())},o.prototype.withModel=function(t,e){this.model()?e.call(t):this.modelCreated().subscribe(t,e,!0)},o.prototype.containsVolume=function(){return this.model().dataSources().some(function(t){return t instanceof b&&"Volume"===t.metaInfo().shortId})},o.prototype.containsStudyByPredicate=function(t){return!!this._model&&this._model.dataSources().some(function(e){if(!(e instanceof b))return!1;var i=e.metaInfo();return t(i)})},o.prototype.containsStudy=function(t){return this.containsStudyByPredicate(function(e){return e.id===t||e.fullId===t})},o.prototype.containsSessions=function(){return this.model().dataSources().some(function(t){return t instanceof b&&"Sessions"===t.metaInfo().shortId})},o.prototype.isSmall=function(){return this._width.value()<550||this._height.value()<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.resize=function(){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(){j("GUI","Reset Scales"),this.model()&&(this._containsData&&this.model().chartModel().restoreAxisState(this._content),this.model().resetScales())},o.prototype.onLineCancelled=function(){P.resetToCursor()},o.prototype.createIndicatorImage=function(){var t=this;this.indicatorImage=this._jqParent.find(".chart-status-picture"),0===this.indicatorImage.length?this.indicatorImage=$('<span class="chart-status-picture"></span>').appendTo(this._jqParent):this.indicatorImage.html(""),f.enabled("display_market_status")&&(this.indicatorText=$('<span class="series-status-text apply-common-tooltip"><span class="js-market-status tv-market-status--series-status"></span></span>'),this.indicatorText.appendTo(this.indicatorImage),
this.indicatorDot&&this.indicatorDot.stop(),this.indicatorDot=new X({el:this.indicatorText.find(".js-market-status")[0],classSuffix:"--for-chart"}),this.indicatorDot.start(),f.enabled("display_data_mode")&&($('<span class="js-data-mode tv-data-mode--series-status"></span>').appendTo(this.indicatorText),this.dataModeIndicator&&this.dataModeIndicator.stop(),this.dataModeIndicator=new J({el:this.indicatorText.find(".js-data-mode")[0],classSuffix:"--for-chart"}),this.dataModeIndicator.start())),t.withModel(null,function(){var e=t._model.mainSeries();e.onStatusChanged().subscribe(null,t.updateIndicatorImage.bind(t)),e.marketStatus.subscribe(t.updateIndicatorImage.bind(t)),t.updateIndicatorImage(),t.checkCompactMode(),t._model.onRearrangePanes().subscribe(null,function(){t.resetIndicatorSize(),t.resizeIndicator()})}),t.rhsPriceAxisWidthChanged.subscribe(t,t.updateIndicatorImagePosition),t.updateIndicatorImagePosition()},o.prototype.updateIndicatorImage=function(){var t,e,i,o=this,n=this._model;n&&(t=n.mainSeries(),e=t.status(),i=t.quoteData?t.quoteData.update_mode_seconds:null,o._updateDataAndMarketStatus(t.marketStatus.value(),e,i))},o.prototype.checkCompactMode=function(){this._jqMainDiv&&this._jqMainDiv.toggleClass("i-compact",this._jqMainDiv.width()<=400),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.outerWidth())},o.prototype._updateDataAndMarketStatus=function(t,e){var i,o;if(void 0!==this.indicatorText){switch(e){case _.STATUS_LOADING:case _.STATUS_RESOLVING:i="loading",this.indicatorDot.setStatus("loading");break;case _.STATUS_INVALID_SYMBOL:i="invalid",this.indicatorDot.reset();break;case _.STATUS_NO_BARS:i="forbidden";break;case _.STATUS_DELAYED:i="delayed";break;case _.STATUS_DELAYED_STREAMING:i="delayed_streaming";break;case _.STATUS_EOD:case _.STATUS_PULSE:i="endofday";break;case _.STATUS_OFFLINE:i="connecting";break;case _.STATUS_SNAPSHOT:i="snapshot";break;case _.STATUS_READY:i="realtime";break;case _.STATUS_REPLAY:i="replay";break;default:i=e,Q.logWarn("unhandled data mode "+i)}f.enabled("display_data_mode")&&this.dataModeIndicator.setMode(i),o=["loading","invalid","replay"],!o.includes(i)&&t?this.indicatorDot.setStatus(t,!0):"invalid"===i?this.indicatorDot.setStatus("invalid",!0):"replay"===i&&this.indicatorDot.setStatus("replay"),this.resizeIndicator()}},o.prototype.resetIndicatorSize=function(){if(this._paneWidgets[0]&&this._paneWidgets[0].legendWidget)for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].legendWidget.firstTitle().css("padding-right","")},o.prototype.resizeIndicator=function(){var t,e,i;this._paneWidgets[0]&&this._paneWidgets[0].legendWidget&&this._indicatorWidth&&this._paneWidgets[0].legendWidget.firstTitle().css("padding-right",this._indicatorWidth+10),f.enabled("display_market_status")&&f.enabled("display_data_mode")&&this.indicatorDot&&this.dataModeIndicator&&(this.indicatorDot.isShortModeEnabled()&&this.dataModeIndicator.isShortModeEnabled()?(t=[this.indicatorDot.getTooltipText(),this.dataModeIndicator.getTooltipText()],t=t.filter(function(t){return t}),
e=t.join(", "),this.indicatorText.attr("title",e)):this.indicatorText.attr("title",""),this.indicatorText.trigger("common-tooltip-update")),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.outerWidth()),i=this._width.value(),f.enabled("display_market_status")&&this.indicatorDot&&(i>650?(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.disableShortMode()):i>550?(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.disableShortMode()):(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.enableShortMode())),f.enabled("display_data_mode")&&this.dataModeIndicator&&(i>650?(this.dataModeIndicator.setTooltipEnabled(!1),this.dataModeIndicator.disableShortMode()):i>550?(this.dataModeIndicator.setTooltipEnabled(!0),this.dataModeIndicator.enableShortMode()):(this.dataModeIndicator.setTooltipEnabled(!1),this.dataModeIndicator.enableShortMode()))},o.prototype.updateIndicatorImagePosition=function(){var t=this.indicatorImage;this.indicatorImage&&t.css("marginRight",this.maxRhsPriceAxisWidth)},o.prototype._startSpinner=function(t){if(!this._spinner){var e=$(t).get(0);e&&(this._spinner=U("",{zIndex:"auto"}).spin(e))}},o.prototype.isJustClonedChart=function(){return!!(this._options||{}).justCloned},o.prototype.getLastPaneLeftBottom=function(){var t=this._paneWidgets[this._paneWidgets.length-1].jqPane,e=t.offset();return{left:e.left,bottom:$(document.body).height()-e.top-t.height()}},o.prototype.setDataWindowWidget=function(t){this._dataWindowWidget=t},o.prototype.removeDataWindowWidget=function(){this._dataWindowWidget=null},f.enabled("datasource_copypaste")&&(o.prototype.onAppClipboardPaste=function(t,e){Q.logDebug("[[paste]]"),this._model&&this._model.pasteSourceFromClip(t,e)},o.prototype.onAppClipboardCopy=function(t){if(t||(t=this._model.selectedSource()),t instanceof b&&t.isChildStudy())return void Q.logDebug("Can not copy child study");Q.logDebug("[[copy]]"),this._model&&this._model.copySourceToClip(t)},o.prototype.onAppClipboardCut=function(t){Q.logDebug("[[cut]]"),this._model&&this._model.cutSourceToClip(t||this._model.selectedSource())}),o.prototype.applyOverrides=function(t){applyPropertiesOverrides(this.properties(),null,!1,t),this._model&&(applyPropertiesOverrides(this._model.model().properties(),null,!1,t),applyPropertiesOverrides(this._model.mainSeries().properties(),null,!1,t,"mainSeriesProperties"))},o.prototype.applyStudiesOverrides=function(t){H.setDefaultsOverrides(t),this._applyStudiesOverrides()},o.prototype.setActive=function(t){var e,i=this.actions();for(e in i)i.hasOwnProperty(e)&&this.actions()[e].setActive(t);this._isActive=t,this._paneWidgets.forEach(function(t){t.update()})},o.prototype.isActive=function(){return this._isActive},o.prototype.trackTime=function(){return this._chartWidgetCollection.lock.trackTime},o.prototype.id=function(){return this._guid},o.prototype.createBranding=function(){this._modelCreated.subscribe(this,function(){this._model.model().createBrandingSource()},!0)},o.prototype.selectBarMode=function(){return this._model.model().selectBarMode()},
o.prototype.toggleSelectBarMode=function(){this._model.model().toggleSelectBarMode()},o.prototype.onBarSelected=function(){return this._model.model().onBarSelected()},o.prototype.trySetChartStyle=function(t){var e=this.model();return!!e&&(e.mainSeries().properties().style.value()===t||!!f.enabled("charting_library_base")&&(this._setChartStyle(t),!0))},o.prototype._setChartStyle=function(t){var e=this.model(),i=e.mainSeries().properties().style;e.setChartStyleProperty(i,t,"Change Series Style")},t.exports.ChartWidget=o}).call(e,i(20))},function(t,e,i){(function(e){"use strict";function o(t){var e,i,o=Object.keys(m),n=o.length;for(e=0;e<n;++e)if(i=o[e],m[i].name===t)return i;return null}function n(t){return"LineToolRiskRewardLong"===t||"LineToolRiskRewardShort"===t}var r=i(21).ensureNotNull,s=i(728),a=i(316).applyOverridesToStudy,l=i(45),c=i(1096).LineDataSourceApi,h=i(1097).StudyApi,u=i(11).DefaultProperty,d=i(485).availableIcons,p=i(82),_=i(57).Interval,f=i(67),m=i(473).supportedLineTools,g=i(372).createTooManyStudiesNotice,v=function(t){this._chartWidget=t};v.prototype._makeSubscriptionFromDelegate=function(t){var e=$.extend({},t);return delete e.fire,e},v.prototype.executeActionById=function(t){this._chartWidget.executeActionById(t)},v.prototype.getCheckableActionState=function(t){return this._chartWidget.getCheckableActionState(t)},v.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},v.prototype.clearMarks=function(){this._chartWidget.clearMarks()},v.prototype.symbol=function(){return this._chartWidget.getSymbol()},v.prototype.symbolExt=function(){var t=this._chartWidget.model().mainSeries().symbolInfo();return t?{symbol:t.name,full_name:t.full_name,exchange:t.exchange,description:t.description,type:t.type}:null},v.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},v.prototype.setSymbol=function(t,i){function o(){n._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,o),i&&i()}if(t!==this.symbol()||e.enabled("same_data_requery")){var n=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,o),this._chartWidget.setSymbol(t)}},v.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},v.prototype.setResolution=function(t,e){function i(){o._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,i),e&&e()}if((t=t.toUpperCase())!==this.resolution()){var o=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,i),this._chartWidget.setResolution(t)}},v.prototype.setEntityVisibility=function(t,e){var i,o;console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead"),(i=this._chartWidget.model().model().dataSourceForId(t))&&(o=i.properties())&&o.visible&&o.visible.setValue(e)},v.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(t){return{id:t.id(),name:t._metaInfo.description}})},v.prototype.getAllShapes=function(){
return this._chartWidget.model().model().allLineTools().map(function(t){return{id:t.id(),name:o(t.toolname)}}).filter(function(t){return null!==t.name})},v.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},v.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},v.prototype.removeEntity=function(t){var e=this._chartWidget.model().chartModel().dataSourceForId(t);if(!e)return void console.warn("Can't find a source with id: "+t);this._chartWidget.model().chartModel().removeSource(e,!0)},v.prototype.createStudyTemplate=function(t){return this._chartWidget.model().model().studyTemplate(t.saveInterval)},v.prototype.applyStudyTemplate=function(t){this._chartWidget.model().model().restoreStudyTemplate(t,""+1e3*Math.random())},v.prototype.setVisibleRange=function(t,i){var o,n,r,s;if(void 0===t||!t.from||!t.to||isNaN(t.from)||isNaN(t.to))return void console.warn("Wrong time range: "+JSON.stringify(t)+'. Expected an object with "from" and "to" numeric values.');o=this._chartWidget.model().model(),n=o.mainSeries(),r=[parseInt(t.from),parseInt(t.to)],s=_.isDWM(n.interval())&&!e.enabled("disable_resolution_rebuild")?this._alignPoints(r):r,t.from=s[0],t.to=s[1],this._chartWidget.setVisibleTimeRange(t.from,t.to,i)},v.prototype.getVisibleRange=function(){var t,e=this._chartWidget.model().timeScale(),i=e.visibleBars();return null===i?{from:0,to:0}:(t={from:e.indexToUserTime(i.firstBar()<0?0:i.firstBar()),to:e.indexToUserTime(i.lastBar())},{from:(+t.from||0)/1e3,to:(+t.to||0)/1e3})},v.prototype.getVisiblePriceRange=function(){return this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},v.prototype._createTradingPrimitive=function(t,e){function i(){var t=TradingView.CLOSE_PLOT,e=r(o._chartWidget.model().mainSeries().bars().last());return{index:e.index,price:e.value[t]}}var o=this,n=this._chartWidget.model().model(),s=n.paneForSource(n.mainSeries());return(e?n:this._chartWidget.model()).createLineTool(s,i(),t)._adapter},v.prototype.createOrderLine=function(t){var t=t||{};return this._createTradingPrimitive("LineToolOrder",t.disableUndo)},v.prototype.createPositionLine=function(t){var t=t||{};return this._createTradingPrimitive("LineToolPosition",t.disableUndo)},v.prototype.createExecutionShape=function(t){var t=t||{};return this._createTradingPrimitive("LineToolExecution",t.disableUndo)},v.prototype.createShape=function(t,e){return this.createMultipointShape([t],e)},v.prototype._alignPoints=function(t){var e,i=this._chartWidget.model().model(),o=i.mainSeries(),n=o.symbolInfo(),r=f.get_timezone(n.timezone);return i.timeScale().isEmpty()?t:(e=(new p.Session).init(r,n.session),t.map(function(t){return t?p.alignExchangeTimeToSessionStartAndReturnUTC(e.timezone,e.spec,new Date(1e3*t))/1e3:t}))},v.prototype._convertUserPointsToDataSource=function(t){function i(t,e,i){var o,n,r,s=h.closestIndexLeft(t)||0,a={index:s},l=h.valueAt(s);return t>l&&(o=c.syncModel().distance(l,t),o.success&&(a.index=a.index+o.result)),
e?a.price=e:(n=["open","high","low","close"],r=i?n.indexOf(i)+1:1,r<=0&&(r=1),a.price=u.valueAt(s)[r]),a}var o,n,r,s,a,l=this._chartWidget.model().model(),c=l.mainSeries(),h=l.timeScale().points(),u=c.data();if(l.timeScale().isEmpty())return null;for(o=t.map(function(t){return t.time}),n=_.isDWM(c.interval())&&!e.enabled("disable_resolution_rebuild")?this._alignPoints(o):o,r=[],s=0;s<t.length;s++)a=t[s],r.push(i(n[s],a.price,a.channel));return r},v.prototype.createMultipointShape=function(t,e,i){var o,r,s,a,l,c,h,p=e.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),_=this._chartWidget.model().model(),f=_.mainSeries();if(!_.timeScale().isEmpty()){if(o=_.paneForSource(f),r=this._convertUserPointsToDataSource(t),s=m[e.shape]||m.flag,s.onlySelectable)throw Error('Cannot create "'+e.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(e.icon=e.icon||e.overrides&&e.overrides.icon,!e.hasOwnProperty("icon"))throw Error("icon must be specified in options");if(-1===d.indexOf(e.icon))throw Error("icon value must be valid");e.overrides=e.overrides||{},e.overrides.icon=e.icon}if(a=new u(s.name.toLowerCase()),e.overrides)for(l in e.overrides)a[l]?a[l].setValue(e.overrides[l]):n(s.name)&&-1!==["profitLevel","stopLevel"].indexOf(l)&&a.addProperty(l,e.overrides[l]);if(s.supportsText&&e.text&&a.text.setValue(e.text),c=p.createLineTool(o,r[0],s.name,a),c.pointsCount()!==r.length&&-1!==c.pointsCount())throw Error("Wrong points count for "+e.shape+". Required "+c.pointsCount());for(h=1;h<r.length&&this._chartWidget.model().lineBeingCreated();h++)p.coninueCreatingLine(r[h],{},h<r.length-1);return e.lock&&c.setUserEditEnabled(!1),e.disableSelection&&(c.customization.disableSelection=!0),e.disableSave&&(c.customization.disableSave=!0),e.hasOwnProperty("showInObjectsTree")&&(c.customization.showInObjectsTree=e.showInObjectsTree),e.zOrder&&("top"===e.zOrder?p.bringToFront(c):"bottom"===e.zOrder&&p.sendToBack(c)),c.id()}},v.prototype.getShapeById=function(t){var e=this._chartWidget.model().model().getLineToolById(t);if(null===e)throw Error("There is no such shape");return new c(e,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(t){var e=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return t.map(function(t){var o=i.normalizeBarIndex(t.index);return{price:t.price,time:e.projectTime(o.time_t,o.offset)}})}.bind(this)})},v.prototype.createStudy=function(t,e,i,o,n,r,c){var h,u,d;return c&&c.checkLimit&&!this._chartWidget.model().canCreateStudy()?(g().open(),null):(t=t.toLowerCase(),h=l.findStudyMetaInfoByDescription(this._chartWidget.model().studiesMetaData(),t),h=$.extend({},h),delete h.state,h?(u={},o&&(u.inputs=s.getStudyRecordFromArray([t].concat(o),this._chartWidget).inputs),d=this._chartWidget.model().chartModel().insertStudy(h,u,e),r&&a(d,r),i&&d.setUserEditEnabled(!1),
n&&n(d.id()),d.id()):(console.warn("Study `"+t+"` not found."),null))},v.prototype.getStudyById=function(t){var e=this._chartWidget.model().model().getStudyById(t);if(null===e)throw Error("There is no such study");return new h(e,this._chartWidget.model().model())},v.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},v.prototype.setChartType=function(t){this._chartWidget.model().mainSeries().properties().style.setValue(t)},v.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},v.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onCompleted())},v.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onSymbolResolved())},v.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},v.prototype.dataReady=function(t){var e=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return t&&(e?this.onDataLoaded().subscribe(null,t,!0):t()),!e},v.prototype.crossHairMoved=function(t){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,t)},v.prototype.setTimezone=function(t){this._chartWidget.setTimezone(t)},t.exports=v}).call(e,i(7))},function(t,e,i){(function(e){"use strict";function o(t){function i(t,e){var i,o,r=[],s=n[Bt].count;for(i=0;i<s;i++)r.push(Mt[i].chartWidget.state(t,e));return o={layout:Bt,charts:r},Ft.value()&&(o.symbolLock=1),Nt.value()&&(o.intervalLock=1),Wt.value()&&(o.trackTimeLock=1),l.hideAllDrawings().value()&&(o.hideAllDrawings=!0),o}function o(t){var e,i=$.Deferred(),o=[],r=n[Bt].count;for(e=0;e<r;e++)o.push(Mt[e].chartWidget.asyncState(t));return $.when.apply($,o).then(function(){var t,e={charts:[]};for(t=0;t<arguments.length;t++)e.charts.push(arguments[t]);i.resolve(e)}),i}function v(){if(Ot&&!dt)for(var t=0;t<Ot.count;t++)y(t);else y(Dt);gt.trigger("chart-rect-update",gt[0].getBoundingClientRect())}function y(t){var e,i,o=Mt[t];o&&(e=dt?n.s.sizer(0,{width:ht.value(),height:ut.value()},Pt,Lt):Ot.sizer(t,{width:ht.value(),height:ut.value()},Pt,Lt),i={width:Math.max(Math.round(e.width||0)-2*It,0),height:Math.max(Math.round(e.height||0)-2*It,0),top:Math.max(Math.round(e.top||0),0),left:Math.max(Math.round(e.left||0),0)},o.metrics=i,o.body.value().css(i),o.width.setValue(i.width),o.height.setValue(i.height))}function b(){for(var t=0;t<Mt.length;t++)Mt[t].chartWidget.resizeSeriesControlUI()}function S(){for(var t=0;t<Mt.length;t++)Mt[t].chartWidget.tickSeriesControlClock()}function w(){for(var t=0;t<Mt.length;t++)if(!Mt[t].chartWidget||!Mt[t].chartWidget.model())return!1;return!0}function T(e){function i(){a.visible.setValue(!a.hiddenInLayout.value()&&t.resizerBridge.visible.value())}var o,n,s,a;return e=Object.assign({chartWidgetCollection:Ct,isActive:0===Mt.length
},e||{}),n=$(document.createElement("div")).addClass("chart-container").appendTo(gt).css({position:"absolute",overflow:"hidden"}),n.on("mousedown touchstart",function(){w()&&kt.setValue(o)}),s=Mt.length,a={alive:new _(!0),body:new _(n),width:new _,height:new _,hiddenInLayout:new _(!1),visible:new _,rdState:new f},a.rdState.pushOwner(a),Mt.push(a),y(s),a.hiddenInLayout.subscribe(i),t.resizerBridge.visible.subscribe(i),i(),Object.assign(e,a.rdState.bridge()),a.chartWidget=o=new r.ChartWidget(e),Ct.firstWidgetInitialized||o.chartWidgetInitialized.subscribe(null,function(){Ct.firstWidgetInitialized=!0,b()},!0),(1===Mt.length||d.enabled("show_logo_on_all_charts"))&&o.createBranding(),e.containsData?o.finishInitWithoutConnect():o.connect(),C(),P(),yt.fire(o),o}function x(t,e){var i,o,r,s;t in n||(t="s"),i=n[t].count,h.emit("layout_about_to_be_changed",t),Bt=t,dt=e,pt.setValue(dt),Ot=n[t];for(o=0;o<i||o<Mt.length;o++)r=e?Dt===o:o<i,r?(Mt[o]?(gt.append(Mt[o].body.value()),Mt[o].hiddenInLayout.setValue(!1),(s=Rt.shift())&&(zt=!0,Mt[o].chartWidget.loadContent(s.content),zt=!1)):T($.extend({},_t,Rt.shift()||(kt.value()?{content:kt.value().state()}:null)||{},0===o||Ft.value()?{}:{defSymbol:null})),Mt[o].body.value().toggleClass("multiple",i>1),y(o)):Mt[o]&&(Mt[o].hiddenInLayout.setValue(!0),Mt[o].body.value().detach());return C(),h.emit("layout_changed"),!0}function C(){var t,e=Math.min(Ot.count,Mt.length)-1;if(e<0)return void kt.deleteValue();t=Dt,t<0&&(t=0),t>e&&(t=e),kt.setValue(Mt[t].chartWidget)}function P(){var t,e;for(t=Mt.length;t--;)e=t===Dt,Mt[t].body.value().toggleClass("active",e).toggleClass("inactive",!e)}function L(){return Mt.filter(function(t){return!t.hiddenInLayout.value()}).sort(function(t,e){return t.metrics.top-e.metrics.top||t.metrics.left-e.metrics.left})}function I(){var t,e,i,o=Ct.layout.value();"s"!==o&&(t=n[o].count,pt.value()||(Et=L()),e=Vt+1,i=Et[e],!i||e>t?(i=Et[0],Vt=0):Vt=e,kt.setValue(i.chartWidget),pt.value()&&x(o,!0))}function k(t){var e=kt.value();return!!e&&e.trySetChartStyle(t)}function A(t){var e,i,o,n;wt!==t&&(wt&&(wt.modelCreated().unsubscribe(null,M),(e=wt.model())&&(i=e.mainSeries().properties(),i.style.unsubscribe(null,E),o=e.model(),o.onSelectedSourceChanged().unsubscribe(null,V),wt=null)),t&&(n=t.model(),n?M(n):t.modelCreated().subscribe(null,M),wt=t))}function M(t){var e,i=t.mainSeries().properties();i.style.subscribe(null,E),E(i.style),e=t.model(),e.onSelectedSourceChanged().subscribe(null,V),V(t.selectedSource())}function E(t){bt.setValue(t.value())}function V(t){St.setValue(t)}function D(t){var e,i,o,n;if(t!==Ft.value()){if(a.beginUndoMacro("Symbol Lock"),t)for(e=kt.value(),i=e.getSymbol(),o=0;o<Mt.length;o++)(n=Mt[o].chartWidget)!==e&&n.getSymbol()!==i&&n.setSymbol(i);a.setWatchedValue(Ft,t,"Symbol Lock"),a.endUndoMacro()}}function O(t){var e,i,o,n;if(t!==Nt.value()){if(a.beginUndoMacro("Interval Lock"),t)for(e=kt.value(),i=e.getResolution(),o=0;o<Mt.length;o++)(n=Mt[o].chartWidget)!==e&&n.getResolution()!==i&&n.setResolution(i);a.setWatchedValue(Nt,t,"Resolution Lock"),
a.endUndoMacro()}}function B(t){Wt.value()!==t&&a.setWatchedValue(Wt,t,"Track Time")}function R(t){return ct.value()!==t&&(a.pushUndoCommand(new p(Ct,t)),!0)}function z(t){Ft.value()?F(t):kt.value().setSymbol(t)}function F(t){var e,i,o=!1;for(e=0;e<Mt.length;e++)i=Mt[e].chartWidget,(i.model().mainSeries().properties().symbol.value()!==t||d.enabled("same_data_requery"))&&(o||(a.beginUndoMacro("Change Symbol"),o=!0),i.setSymbol(t));o&&a.endUndoMacro()}function N(t){var e,i,o;if(!zt)if(Nt.value()){for(e=!1,i=0;i<Mt.length;i++)o=Mt[i].chartWidget,o.model().mainSeries().properties().interval.value()!==t&&(e||(a.beginUndoMacro("Change Resolution"),e=!0),o.setResolution(t));e&&a.endUndoMacro()}else kt.value().setResolution(t)}function W(t){var e,i,o;if(t&&t.onlyActiveChart||dt)return{layout:"s",hidpiRatio:window.hidpiCanvasRatio||1,charts:[kt.value().images()]};for(e=[],i=Ot.count,o=0;o<Mt.length&&o<i;o++)e.push(Mt[o].chartWidget.images());return{layout:Bt,hidpiRatio:window.hidpiCanvasRatio||1,charts:e}}function H(){var t,e=[];for(t=0;t<Mt.length&&t<Ot.count;t++)e=e.concat(Mt[t].chartWidget.tags());return e=$.unique(e),e=$.map(e,function(t){return t.toLowerCase().replace(/\W+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")})}function U(t,e,i,o){var n,r,s,a;if(i||Ut&&!dt)for(n=Ot.count,r=0;r<Mt.length&&r<n;r++)(s=Mt[r].chartWidget)!==e&&(a=s.model())&&a.model().setExternalPosition(t,o)}function j(t,e){var i,o,n,r;if(Wt.value()){for(i=Ot.count,a.beginUndoMacro("Sync Time"),o=0;o<Mt.length&&o<i;o++)if(n=Mt[o].chartWidget,r=n.model()){if(r.model()===e)continue;r.gotoTime(t,{centerIfVisible:!1,model:e})}a.endUndoMacro()}}function q(){return vt.resolve(),Mt.forEach(function(t){t.chartWidget.destroy()})}function G(){return vt.promise()}function Y(){return yt}function K(){mt.id.setValue(void 0),mt.uid.setValue(void 0),mt.name.setValue(void 0)}function Z(){var e={snapshotUrl:t.snapshotUrl};(d.enabled("show_dialog_on_snapshot_ready")?u.getImageOfChart:u.getImageOfChartSilently)(this,e,function(t){h.emit("onScreenshotReady",t)})}function X(){for(var t=n[Bt].count;t<Mt.length;t++)Mt[t].chartWidget.destroy();Mt.splice(n[Bt].count)}function J(t){for(var e=0;e<Mt.length;e++)Mt[e].chartWidget.applyOverrides(t)}function Q(t){for(var e=0;e<Mt.length;e++)Mt[e].chartWidget.applyStudiesOverrides(t)}function tt(){t.resizerBridge.requestFullscreen()}function et(){t.resizerBridge.exitFullscreen()}function it(){return gt}function ot(t,e){(e?[{chartWidget:kt.value()}]:Mt).forEach(function(e){var i=e.chartWidget.model().mainSeries().properties(),o=e.chartWidget.model().model().properties().paneProperties,n=i.extendedHours.value(),r=o.background.value();e.chartWidget._model.model().restoreTheme(t),i.extendedHours.value()!==n&&i.extendedHours.listeners().fire(i.extendedHours),o.background.value()!==r&&o.background.listeners().fire(o.background)})}function nt(t){return d.enabled("charting_library_base")?t:"s"===t||d.enabled(ProductFeatures.MULTIPLE_CHARTS)&&d.getConfig(ProductFeatures.MULTIPLE_CHARTS).layout.indexOf(t)>=0||_t.containsData||At?t:"s"}
function rt(t){if(Rt=[],t){t.charts||(t={layout:"s",charts:[t]}),Bt=nt(t.layout||"s");for(var e=0;e<t.charts.length;e++)Rt.push({content:t.charts[e]});t.symbolLock&&Ft.setValue(!0),t.intervalLock&&Nt.setValue(!0),t.trackTimeLock&&Wt.setValue(!0),t.hideAllDrawings&&$t.setValue(!0)}ct.setValue(Bt),x(Bt,dt)&&(l.hideAllDrawings().setValue($t.value()),Rt.splice(0,Rt.length))}function st(){0===--Tt&&h.emitOnce("onChartReady")}function at(){return Promise.all(Mt.map(function(t){return m(t.chartWidget.modelCreated())}))}function lt(){return Promise.all(Mt.map(function(t){return m(t.chartWidget.model().mainSeries().onSymbolResolved())}))}var ct,ht,ut,dt,pt,_t,ft,mt,gt,vt,yt,bt,St,wt,Tt,xt,Ct=this,Pt=2,Lt=0,It=1,kt=new _,At=!1,Mt=[],Et=[],Vt=0,Dt=0,Ot=null,Bt="s",Rt=[],zt=!1,Ft=new _(!1),Nt=new _(!1),Wt=new _(!1),$t=new _(!1),Ht=new _(TVSettings.getBool("chart.syncCrosshair",!0)),Ut=Ht.value();Ht.subscribe(function(t){t=!!t,Ut=t,TVSettings.setValue("chart.syncCrosshair",t)}),ct=new _(Bt),ht=t.resizerBridge.width,ut=t.resizerBridge.height,dt=!1,pt=new _(dt),"padding"in t&&(Pt=t.padding),"edge"in t&&(Lt=t.edge),_t=t.widgetOptions||{},_t.readOnly&&(At=!0),ft=t.metaInfo||{},mt={id:new _(ft.id),name:new _(ft.name),description:new _(ft.description),username:new _(ft.username),uid:new _(ft.uid)},gt=$(t.resizerBridge.body.value()).eq(0),vt=$.Deferred(),yt=new e,ht.subscribe(v),ut.subscribe(v),this.updateLayout=v,bt=new _,St=new _,wt=null,kt.subscribe(function(t){var e,i;if(t){for(i=Mt.length;i--;)if(Mt[i].chartWidget===t){e=i;break}if(!isFinite(e))throw Error("Cannot make detached ChartWidget active");if(Dt!==e){for(Dt=e,P(),Et.length&&(Vt=Et.indexOf(Mt[Dt])),i=Mt.length;i--;)Mt[i].chartWidget.setActive(!1);t.setActive(!0)}A(t)}},{callWithLast:!0}),Object.assign(this,{createChartWidget:T,getAll:function(){return Mt.map(function(t){return t.chartWidget})},destroy:q,layout:ct,maximizeCurrentChart:pt,activeChartWidget:kt,activeChartStyle:bt.readonly(),trySetChartStyleToActiveWidget:k,selectedSource:St.readonly(),metaInfo:mt,state:i,asyncState:o,readOnly:function(){return At},lock:{symbol:Ft,setSymbolLockWithUndo:D,interval:Nt,setIntervalLockWithUndo:O,crosshair:Ht,trackTime:Wt,setTrackTimeWithUndo:B},setSymbol:z,setResolution:N,updateLayout:v,setChartLayoutWithUndo:R,resizeWidgetsUI:b,images:W,tags:H,syncCrosshair:U,syncScroll:j,setSymbolAll:F,clearChartMetaInfo:K,onfeatures:t.onfeatures,takeScreenshot:Z,loadContent:rt,purgeUnusedWidgets:X,applyOverrides:J,applyStudiesOverrides:Q,switchChart:I,startFullscreen:tt,exitFullscreen:et,destroyPromise:G,chartWidgetCreated:Y,getContainer:it,onWidget:_t.onWidget,applyTheme:ot}),rt(t.onfeatures?void 0:t.content),ct.subscribe(function(t){P(),x(t,!1)&&(Et=L(),Vt=Et.indexOf(Mt[Dt]))}),ct.hook=function(t){return t===this.value()?t:nt(t)},At&&(ct.writeLock=!0),pt.subscribe(function(t){t!==dt&&(Et=L(),x(Bt,t))}),setInterval(S,1e3),$(window).on("resize",v),$(document).on("onUpdate",v),d.enabled("datasource_copypaste")&&(c.init(),t.globalEvents&&($(window).on("appclip:paste",function(t){
kt.value().onAppClipboardPaste(),t.preventDefault()}),$(window).on("appclip:copy",function(t){kt.value().onAppClipboardCopy(),t.preventDefault()}),$(window).on("appclip:cut",function(t){kt.value().onAppClipboardCut(),t.preventDefault()}))),Tt=0,Mt.forEach(function(t){if(t){Tt++;var e=t.chartWidget;e.withModel(null,function(){if(e.model().mainSeries().bars().size()>0)st();else{var t=function(){st(),e.model().mainSeries().onBarReceived().unsubscribe(null,t),e.model().mainSeries().onCompleted().unsubscribe(null,t)};e.model().mainSeries().onBarReceived().subscribe(null,t),e.model().mainSeries().onCompleted().subscribe(null,t)}})}}),s()&&(xt=l.tool.setValue,l.tool.setValue=function(){Ct.selectedSource.value()&&Ct.activeChartWidget.value().model().lineBeingCreated()&&Ct.activeChartWidget.value().model().cancelCreatingLine(),xt.apply(l.tool,arguments)}),at().then(lt).then(function(){window.saver&&window.is_authenticated&&t.widgetOptions.justCloned&&window.saver.saveChartSilently()}).catch(g.logError.bind(g))}var n=i(308).layouts,r=i(747),s=i(102).supportTouch,a=i(76).UndoHistory,l=i(44),c=i(266),h=i(43),u=i(1159),d=i(7),p=i(1147).SetChartLayoutCommand,_=i(51),f=i(310).ResizerDetacherState,m=i(1101).delegateToPromise,g=i(13).getLogger("Chart.ChartWidgetCollection");t.exports=o}).call(e,i(20))},,function(t,e,i){"use strict";function o(t){return null==t._parentMenu?null:n(t._parentMenu)}function n(t){return null==t._parentMenuItem?t:o(t._parentMenuItem)}function r(t,e){this.action=t,this._parentMenu=e}function s(t,e){this.action=t,this._parentMenu=e}var a=i(394),l=i(206);r.prototype._createIconTag=function(){var t=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqIcon},r.prototype._createDeleteButton=function(){var t,e,i;if(!this.action.deleteButton)return null;t=this,e=this.action.deleteButton.action,i=l.create("span",{class:"context-menu-delete-button"}),e&&i.click(function(){return e.call(t),!1}),this.jqSubmenu.addClass("delete-spacer"),this.jqSubmenu.append(i)},r.prototype._createTextTag=function(){var t=this._textTagAttributes();return this.jqText=l.create(a.TEXT_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqText},r.prototype._createRightTag=function(){var t=this._rightTagAttributes();return this.jqRight=l.create(a.RIGHT_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqRight},r.prototype._createSubmenuTag=function(){var t=this._submenuTagAttributes();return this.jqSubmenu=l.create(a.SUBMENU_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqSubmenu},r.prototype._iconTagAttributes=function(){var t={},e=[];return this.action&&(this.action.icon?(e.push("icon"),e.push(this.action.icon.replace(/\./,"_"))):this.action.checkable?(e.push("icon"),this.action.checked?(e.push("checked-icon"),t.html=i(235)):e.push("unchecked-icon")):e.push("spacer")),t.class=e.join(" "),t},r.prototype._textTagAttributes=function(){return{class:"text",html:this.action?this.action.text:""}},r.prototype.highlight=function(t){
t?(this.jqRow.addClass("context-menu-hover"),this.jqIcon.addClass("context-menu-hover")):(this.jqRow.removeClass("context-menu-hover"),this.jqIcon.removeClass("context-menu-hover")),this.action&&this.action.hasSubActions()&&(t?this.jqSubmenu.addClass("expanded"):this.jqSubmenu.removeClass("expanded"))},r.prototype._rightTagAttributes=function(){var t={},e=["right"];return this.action&&this.action.shortcut&&(e.push("shortcut"),t.class=e.join(" "),t.html=this.action.shortcut),t},r.prototype._submenuTagAttributes=function(){var t={};return this.action&&this.action.hasSubActions()?t.class="submenu-arrow":t.class="context-menu spacer",t},r.prototype.render=function(){this._createRow(),this.jqRow.append(this._createIconTag()),this.jqRow.append(this._createTextTag()),this.jqRow.append(this._createRightTag()),this.jqRow.append(this._createSubmenuTag()),this._createDeleteButton(),this.appendCallback();var t=this;return this.jqRow.mouseenter(function(e){t.showSubmenu(e),t.highlight(!0),t._parentMenu&&t._parentMenu._parentMenuItem&&t._parentMenu._parentMenuItem.highlight(!0)}),this.jqRow.mouseleave(function(){t.highlight(!1)}),this.jqRow},r.prototype._createRow=function(){var t,e,i=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,i),this.jqRow.addClass("context-menu"),t=this,this.action&&!this.action.hasSubActions()&&(e=function(t){t.destroy(),t._parentMenuItem&&e(t._parentMenuItem._parentMenu)},this.jqRow.click(function(i){e(t._parentMenu)}))},r.prototype.showSubmenu=function(t){var e,o;this._parentMenu.closeOtherSubmenus(this),this.action&&!this.action.hasSubActions()||(this._menu||(e=i(131),o={},this._menu=e.createMenu(this.action.subActions,o,this)),t.pageX=this._parentMenu.jqMenu.width()-2,t.pageY=this.jqSubmenu.offset().top-this._parentMenu.jqMenu.offset().top-1,this._menu.show(t,this._parentMenu.jqMenu))},r.prototype._rowTagAttributes=function(){var t=[];return this.action&&(!1===this.action.enabled&&t.push("disabled"),!1===this.action.visible&&t.push("hidden"),this.action.font&&t.push("font_"+this.action.font),this.action.hasSubActions()&&t.push("has_submenu"),this.action.htmlclass&&t.push(this.action.htmlclass)),{class:t.join(" ")}},r.prototype.appendCallback=function(){var t=this;this.jqRow.click(function(e){t.action.enabled&&t.action.executeCallback(e)})},r.prototype.getTopLevelMenu=function(){return o(this)},s.prototype.render=function(t){this._createRow();var e=this;return this.action.deferred.then(function(o){var n,r,s,a=i(395);for(n in o)r=o[n],s=e._parentMenu.addItem(r),a.renderItem(t,s)}).always(function(){e.jqRow.hide()}),this.jqRow},s.prototype._createIconTag=function(){var t=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqIcon},s.prototype._createRow=function(){var t=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,t),this.jqRow.append(this._createIconTag()),this.jqRow.addClass("context-menu")},s.prototype._rowTagAttributes=function(){var t=[];return this.action&&t.push("spinner"),{class:t.join(" ")}},
s.prototype.highlight=function(t){},s.prototype._iconTagAttributes=function(){var t={},e=[];return e.push("spacer"),t.class=e.join(" "),t.colspan="10",t},e.Item=r,e.ItemPlaceholder=s},function(t,e,i){"use strict";function o(t,e,i){this._chart=t,this._parent=e,this.zoom_active=!1,this._real=i,this._state="stop",this._controlBarVisible=!1,this._boundMouseHandler=null,this.init(),i&&this.initToRealChart(),this.initHandlers()}var n=i(37),r=i(309);o.prototype.init=function(){this._widget=$('<div class="control-bar-wrapper">'),this._controlBar=$('<div class="control-bar control-bar--hidden">').append($(i(332)).attr("class","move-left-button-control-bar")).append($(i(1343)).attr("class","zoom-out-right-button-control-bar")).append($(i(1346)).attr("class","turn-button-control-bar")).append($(i(1345)).attr("class","zoom-in-button-control-bar")).append($(i(513)).attr("class","move-right-button-control-bar")).appendTo(this._widget),this._buttons={zoomIn:this._widget.find(".zoom-in-button-control-bar"),zoomOut:this._widget.find(".zoom-out-right-button-control-bar"),moveLeft:this._widget.find(".move-left-button-control-bar"),moveRight:this._widget.find(".move-right-button-control-bar"),turn:this._widget.find(".turn-button-control-bar")},this._initVisibility(),this._widget.appendTo(this._parent)},o.prototype.destroy=function(){this._visibilityTypeProperty&&(this._visibilityTypeProperty.unsubscribe(this,this._onVisibilityTypeChange),this._visibilityTypeProperty=null),this._boundMouseHandler&&(this._parent[0].removeEventListener("mousemove",this._boundMouseHandler,!1),this._parent[0].removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null),this._chart=null},o.prototype._initVisibility=function(){this._visibilityTypeProperty=r.actualBehavior(),this._visibilityTypeProperty.subscribe(this,this._onVisibilityTypeChange),this._onVisibilityTypeChange()},o.prototype._onVisibilityTypeChange=function(){var t=this._visibilityTypeProperty.value();"alwaysOn"===t||"alwaysOff"===t?(this._controlBarVisible="alwaysOn"===t,this._boundMouseHandler&&(this._parent[0].removeEventListener("mousemove",this._boundMouseHandler,!1),this._parent[0].removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null)):(this._controlBarVisible=!1,this._boundMouseHandler||(this._boundMouseHandler=this._visibilityMouseHandler.bind(this),this._parent[0].addEventListener("mousemove",this._boundMouseHandler,!1),this._parent[0].addEventListener("mouseleave",this._boundMouseHandler,!1))),this._updateControlBarVisibility()},o.prototype._visibilityMouseHandler=function(t){var e,i,o,n;t.buttons||(e=this._chart.model())&&e.lineBeingCreated()||(i=!1,o=100,"mousemove"===t.type&&(n=this._widget[0].getBoundingClientRect(),i=t.clientX>=n.left-o&&t.clientX<=n.right+o&&t.clientY>=n.top-o&&t.clientY<=n.bottom+o),this._controlBarVisible!==i&&(this._controlBarVisible=i,this._rafId||(this._rafId=this._controlBar[0].ownerDocument.defaultView.requestAnimationFrame(this._updateControlBarVisibility.bind(this)))))},
o.prototype._updateControlBarVisibility=function(){this._rafId=void 0,this._controlBar[0].classList.toggle("control-bar--hidden",!this._controlBarVisible)},o.prototype.initToRealChart=function(){var t,e=this;this._back=$(i(1237)).attr({class:"back-to-present js-hidden"}).appendTo(this._parent),this._backButtonVisible=!1,this._back.on("click",function(){e._chart.model().timeScale().scrollToRealtime(!0),e._chart.model().model()._invalidateHandler(new n(n.FULL_UPDATE))}),t=function(){var t=e._chart.maxRhsPriceAxisWidth+4;t&&e._back.css("marginRight",t)},this._chart.rhsPriceAxisWidthChanged.subscribe(this,t),t(),this._chart.withModel(this,function(){this._chart.model().model().setInterval(function(){e.check()},1e3)})},o.prototype.check=function(){var t=this._chart.model(),e=!!t&&t.timeScale().rightOffset()<0;e!==this._backButtonVisible&&(this._backButtonVisible=e,this._backButtonVisible?this._back.attr("class","back-to-present"):this._back.attr("class","back-to-present js-hidden"))},o.prototype._move=function(t){var e,i;"stop"===this._state&&this._chart.model().beginUndoMacro(1===t?"Move Left":"Move Right"),this._state="moving",this._moveType="animated",this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0),this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0),this._startTime=+new Date,this._movingTimeout||(e=this._startTime,i=10,this._movingTimeout=setTimeout(function o(){this._moveStep.call(this,e,0,50*t,1e3),this._movingTimeout=setTimeout(o.bind(this),i)}.bind(this),i))},o.prototype._moveStep=function(t,e,i,o){var n,r,s;if(!this._chart.model().timeScale().isEmpty())return n=+new Date,r=1-(Math.max(0,t+o-n)/o||0),r<1&&(s=jQuery.easing.easeOutCubic(null,o*r,0,1,o),this.currentDistance=(i-e)*s+e),this._chart.model().scrollChart(this.currentDistance),r},o.prototype._finishMove=function(t){var e,i;clearTimeout(this._movingTimeout),this._movingTimeout=0,this._deferredFinishTimeout=0,e=this.currentDistance,i=+new Date,this._finishingTimeout=setTimeout(function t(){this._moveStep.call(this,i,e,0,700)<1?this._finishingTimeout=setTimeout(t.bind(this),10):(this._state="stop",this._moveType="",this._movingTimeout=0,this.currentDistance=0,this._chart.model().endUndoMacro())}.bind(this),10)},o.prototype._stopMove=function(t){"moving"===this._state&&(this._state="wait_finishing",(new Date).getTime()-this._startTime<200?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-((new Date).getTime()-this._startTime)):this._finishMove())},o.prototype._moveByBar=function(t){var e,i,o,n,r=this._chart.model().timeScale();r.isEmpty()||("stop"===this._state&&this._chart.model().beginUndoMacro(1===t?"Move Left":"Move Right"),e=r.indexToCoordinate(r.visibleBars().lastBar())+r.barSpacing()/2,Math.abs(r.width()-e)>r.barSpacing()/6&&this._chart.model().scrollChart(r.width()-e),this._state="moving",this._moveType="by_bar",this._startTime=+new Date,this._movingTimeout||(i=400,o=150,n=0,this._movingTimeout=setTimeout(function e(){this._moveByBarStep(t),
n++,o>100&&(o-=n/5*20),this._movingTimeout=setTimeout(e.bind(this),o)}.bind(this),i),this._moveByBarStep(t)))},o.prototype._moveByBarStep=function(t){this._chart.model().timeScale().isEmpty()||this._chart.model().scrollChartByBar(t)},o.prototype._stopMoveByBar=function(t){"moving"===this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state="stop",this._moveType="",this._movingTimeout=0,this.currentDistance=0,this._chart.model().endUndoMacro())},o.prototype.initHandlers=function(){var t,e=this._chart,i=Modernizr.touch?"touchstart":"mousedown",o=Modernizr.touch?"touchend":"mouseup mouseout";this._buttons.moveLeft.on(i,this._moveByBar.bind(this,1)),this._buttons.moveLeft.on(o,this._stopMoveByBar.bind(this,1)),this._buttons.moveRight.on(i,this._moveByBar.bind(this,-1)),this._buttons.moveRight.on(o,this._stopMoveByBar.bind(this,-1)),this._buttons.moveLeft.on("click",function(t){t.preventDefault()}),this._buttons.moveRight.on("click",function(t){t.preventDefault()}),this._buttons.turn.on("click",function(t){t.preventDefault(),e.GUIResetScales()}),this._buttons.zoomOut.on("click",function(t){t.preventDefault(),e.model()&&e.model().zoomOut()}),this._buttons.zoomIn.on("click",function(t){t.preventDefault(),e.model()&&e.model().zoomIn()}),t={},$("body").on("keydown",function(e){if(!$(e.target).closest("input, textarea").length&&!(e.metaKey||e.which in t))switch(t[e.which]=!0,e.which){case 37:e.ctrlKey||e.altKey?this._move(1):this._moveByBar(1),e.preventDefault();break;case 39:e.ctrlKey||e.altKey?this._move(-1):this._moveByBar(-1),e.preventDefault()}}.bind(this)).on("keyup",function(e){if(!$(e.target).closest("input, textarea").length)switch(delete t[e.which],e.which){case 37:case 39:"by_bar"===this._moveType?this._stopMoveByBar():this._stopMove()}}.bind(this))},t.exports=o},function(t,e,i){"use strict";function o(t){this._e=$("<span>").addClass("button fullscreen iconed apply-common-tooltip").attr("title",$.t("Fullscreen mode")).append($(i(1208)).attr({width:18,height:18})),this._e.click(function(){t.startFullscreen()})}o.prototype.element=function(){return this._e},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this._options=i||{},this._w=t,this._opener=e,this._addMetric=1,this._addOpened=!1}var n=i(57).Interval,r=i(286),s=i(103).bindPopupMenu,a=i(7);i(142),o.prototype._interval=function(t){var e=$(t.target);e.hasClass("disabled")||(this._w.setInterval(e.data("interval")),this.close())},o.prototype._quickTitle=function(t){return t?$.t("Remove from favorites"):$.t("Add to favorites")},o.prototype._onQuick=function(t){var e=$(t.target).closest(".item"),i=this._w.toggleQuick(e.data("interval"));return e.find(".to-quick").toggleClass("quicked",i).attr("title",this._quickTitle(i)),!1},o.prototype._onDelete=function(t){var e=$(t.target).closest(".item");return this._w.removeInterval(e.data("interval")),this._reopen(),!1},o.prototype._showControlButtons=function(){return!0},o.prototype._append=function(t,e){
var o=$("<span>").addClass("item").toggleClass("active",e===this._w.getInterval()).toggleClass("disabled",!r.isAvailable(e)).text(this._w.fullLabel(e)).data("interval",e);this._showControlButtons()&&(this._w.isDefaultInterval(e)||o.prepend($("<span>").addClass("delete").attr("title",$.t("Remove custom interval")).html(i(109)).click(this._onDelete.bind(this))),this._w._options.notShowQuicks||o.prepend($("<span>").addClass("to-quick").toggleClass("quicked",this._w.inQuick(e)).append($(i(330)).attr({width:16,height:16})).attr("title",this._quickTitle(this._w.inQuick(e))).click(this._onQuick.bind(this)))),o.click(this._interval.bind(this)),t.append(o)},o.prototype._appendAdd=function(t){function e(){var t,e=parseInt(r.val());e<1&&r.val(1),t={1:1440,60:24,D:364,W:52,M:12}[this._addMetric],e>t&&r.val(t)}var i,o=$("<span>").addClass("item-add"),n=$('<span class="item-add-wrap">').appendTo(o),r=$('<input type="text">').addClass("tv-text-input inset minutes").val(1).appendTo(n).TVTicker(),a=$("<span>").addClass("_tv-button mins").append($("<span>")).append($('<div class="tv-caret"></div>')).appendTo(n),l=$("<span>").addClass("_tv-button add apply-overflow-tooltip").text($.t("Add")).appendTo(n),c={1:$.t("Minutes",{context:"interval"}),60:$.t("Hours",{context:"interval"}),D:$.t("Days",{context:"interval"}),W:$.t("Weeks",{context:"interval"}),M:$.t("Months",{context:"interval"})};a.find("span").text(c[this._addMetric||1]),r.change(e.bind(this)),i=this,s(a,null,{direction:"up",event:"button-popup",addClass:"thin small-font metrics",popupSpacing:~~this._w._options.popupSpacing,onRemove:function(){i._addOpened=!1}}),a.click(function(){i._addOpened=!0,a.trigger("button-popup",[$.map(c,function(t,o){return{title:t.toUpperCase(),active:o===i._addMetric,action:function(){return i._addMetric=o,a.find("span").text(t),e.call(i),!1}}})])}),l.click(function(){}),t.append($("<div>").addClass("separator")),t.append(o)},o.prototype._addInterval=function(t){this._w.addInterval(t),this._reopen({highlight:t})},o.prototype._open=function(t,e){var i,o,r,s,l;t.find(".item, .item-add, .separator").remove(),i=[],o=[],r=[],s=[],l=$("<span>").addClass("separator"),$.each(e,function(t,e){var a=new n(e);a.isDWM()?s.push(e):a.kind()===n.HOURS?r.push(e):a.kind()===n.MINUTES?o.push(e):i.push(e)}),i.length&&(i.forEach(function(e){this._append(t,e)}.bind(this)),t.append(l.clone())),o.length&&o.forEach(function(e){this._append(t,e)}.bind(this)),r.length&&(t.append(l.clone()),r.forEach(function(e){this._append(t,e)}.bind(this))),s.length&&(t.append(l.clone()),s.forEach(function(e){this._append(t,e)}.bind(this))),a.enabled("custom_resolutions_box")&&this._appendAdd(t)},o.prototype._reopen=function(t){if(this._open(this._menu,this._w.getSortedIntervals()),t&&t.highlight){var e=this._menu.find(".item").filter(function(){return $(this).data("interval")===t.highlight});e.length&&e.highlight(2)}},o.prototype.open=function(t){
var e,i=this,o=$("<div>").addClass("charts-popup-list intervals-list favored-list").toggleClass("touch",Modernizr.touch),n=this._w.mainButton().offset(),r=this._w.mainButton().outerHeight(),s=1+n.top+r+parseInt(i._options.popupSpacing||0);o.appendTo(document.body),o.css({top:s,left:n.left}).show(),this._menu=o,this._opener.addClass("active"),this._open(o,t),e=Math.min($("body").height(),$(window).height())-r-s-10,this._setMaxHeight(o,e),setTimeout(function(){o.on("mousedownoutside",function(t){this.close(t)&&o.unbind("mousedownoutside")}.bind(this))}.bind(this),0)},o.prototype._setMaxHeight=function(t,e){t.height()>=e&&(t.css("max-height",e+"px"),t.width(t.width()+18))},o.prototype.close=function(t){return(!t||!$(t.target).parents("span.item-add, .charts-popup-list.metrics").length)&&(!(t&&$(t.target).hasClass("submenu")&&$(t.target).parents(".intervals-container").length)&&(this._menu.remove(),$(document.body).off(".interval-menu"),delete this._menu,this._opener.removeClass("active"),!0))},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,e,i,o){this.reset(t,e,i,o)}var n=i(231).makeFont,r=i(218),s=e.enabled("charting_library_debug_mode");o.prototype.maxCount=200,o.prototype.reset=function(t,e,i,o){this._textWidthCache=new r(this.maxCount),this._fontSize=t,this._color=o,this._font=n(t,e,i),this._keys=[],this._hash={}},o.prototype.paintTo=function(t,e,i,o,n){var r=this.getLabelImage(t,e);"left"!==n&&(i-=r.textWidth),o-=Math.floor(r.height/2),t.drawImage(r.canvas,i,o)},o.prototype.getLabelImage=function(t,e){var i,o,n,r,a;return Object.prototype.hasOwnProperty.call(this._hash,e)?i=this._hash[e]:(this._keys.length>=this.maxCount&&(o=this._keys.shift(),delete this._hash[o]),i={text:e,textWidth:0,width:0,height:0,canvas:document.createElement("canvas")},n=Math.ceil(this._fontSize/4.5),r=Math.round(this._fontSize/10),a=Math.ceil(this._textWidthCache.measureText(t,e)),i.textWidth=Math.round(Math.max(1,a)),i.width=Math.round(a+2*n),i.height=this._fontSize+2*n,0!==a?(this._keys.push(i.text),this._hash[i.text]=i):s&&console.log('Canvas 2d context measureText return zero width for "'+e+'" text'),i.canvas.width=i.width,i.canvas.height=i.height,t=i.canvas.getContext("2d"),t.font=this._font,t.fillStyle=this._color,t.fillText(e,0,i.height-n-r)),i},t.exports=o}).call(e,i(7))},function(t,e,i){(function(e){"use strict";function o(t,e,i){this._model=e,this._paneWidget=t,this._chart=t._chart,this._mainDiv=i,this.$el=$(document.createElement("div")).addClass("pane-legend"),this._itemsBinding=[],this._chart.properties().paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesTitle.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showStudyValues.listeners().subscribe(this,this.updateLayout);var o=this._chart.properties().scalesProperties.textColor
;o.listeners().subscribe(this,function(t){this.$el.css("color",t.value())}),this.$el.css("color",o.value()),this.updateLayout()}var n=(i(61).Study,i(48).trackEvent),r=(i(13).getLogger("Chart.LegendWidget"),i(19)),s=i(172).showEditObjectDialog,a=i(144).setMouseEventHandler;o.prototype.contextMenuEvent=function(t,i){if(!this._model.chartModel().readOnly()&&e.enabled("legend_context_menu")){var o=i.source;this._paneWidget.showContextMenuForSource(o,t)}},o.prototype.updateLayout=function(){var t,o,n,r,s,l,c,h,u,d,p;if(this._itemsBinding.length=0,this.$el.find(".apply-common-tooltip").trigger("mouseleave"),this.$el.empty(),(t=this._paneWidget.state())&&this._model){for(o={showStudyTitles:this._model.model().properties().paneProperties.legendProperties.showStudyTitles.value(),showSeriesTitle:this._chart.properties().paneProperties.legendProperties.showSeriesTitle.value(),showSeriesOHLC:this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.value(),showStudyValues:this._chart.properties().paneProperties.legendProperties.showStudyValues.value(),showLegend:this._model.model().properties().paneProperties.legendProperties.showLegend.value()},n=this._model.mainSeries(),r=t.orderedSources().slice(),s=r.indexOf(n),s>-1&&(r.splice(s,1),r.push(n)),l=r.length-1;l>=0;l--)c=r[l],(h=c.statusView())&&(!(u=c===n)||o.showSeriesTitle||o.showSeriesOHLC||o.showStudyTitles||o.showStudyValues)&&(u&&e.enabled("fundamental_widget")||(o.showLegend||!u?(u||o.showStudyTitles||o.showStudyValues)&&o.showLegend&&(d=$("<div>").addClass("pane-legend-line pane-legend-wrap").appendTo(this.$el),d.source=c,u?(p=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Hide")+'"></a>').append($(i(1340)).attr({class:"expand"})),d.addClass("main").append(p.on("click touchend",this.toggleTitles.bind(this)))):d.addClass("study"),c.properties().visible.value()||d.addClass("disabled"),this._generateItemsForRow(d,h,o),a(d,this,!0)):this.$el.find(".expand-line").length||(d=$("<div>").addClass("pane-legend-line pane-legend-wrap main expand-line").appendTo(this.$el),p=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Show")+'"></a>').append($(i(1339)).attr({class:"expand closed"})),d.append(p.on("click touchend",this.toggleTitles.bind(this))),d.source=c,o={showStudyTitles:!1,showSeriesTitle:!1,showSeriesOHLC:o.showSeriesOHLC,showStudyValues:!1},this._generateItemsForRow(d,h,o),a(d,this,!0),this.update())));this.update()}},o.prototype._generateItemsForRow=function(t,o,n){var r,s,a,l,c,h,u,d,p,_,f,m=t.source,g=this,v=m===this._model.mainSeries();if((v&&n.showSeriesTitle||!v&&n.showStudyTitles)&&(r=$("<span>"),r.addClass("pane-legend-line apply-overflow-tooltip"),e.enabled("legend_context_menu")&&!this._chart.readOnly()||r.addClass("no-context-menu"),v&&r.addClass("main"),m.properties().visible.value()||r.addClass("disabled"),r.css({"font-weight":o.bold()?"bold":"normal","font-size":o.size()}),r.click(function(e){g.contextMenuEvent(e,t)}),r.appendTo(t),this._itemsBinding.push({value:o,cell:r,source:t.source}),
!this._chart.readOnly()&&m.userEditEnabled()&&e.enabled("edit_buttons_in_legend")&&(s=$('<span class="pane-legend-icon-container">').appendTo(t),e.enabled("show_hide_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip icon-hide" title="'+$.t("Show/Hide")+'">').append($(i(1211)).attr({width:14,height:14})).appendTo(s).on("click touchend",this._generateItemsForRow._onShowhideClick.bind(this,m)),e.enabled("property_pages")&&(!v||e.enabled("show_chart_property_page")&&!this._chart.onWidget())&&e.enabled("format_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip format" title="'+$.t("Format")+'">').append($(i(1207)).attr({width:14,height:14})).appendTo(s).on("click touchend",this._generateItemsForRow._onFormatClick.bind(this,m)),!v&&e.enabled("delete_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip delete" title="'+$.t("Delete")+'">').append($(i(510)).attr({width:14,height:14})).appendTo(s).on("click touchend",this._generateItemsForRow._onDeleteClick.bind(this,m)))),a=m.dataWindowView(),this.isDataWindowValuesVisible(a)&&(v&&n.showSeriesOHLC||!v&&n.showStudyValues)){for(l=[],c=[],h=$('<div class="pane-legend-item-value-container">'),e.enabled("legend_context_menu")||h.addClass("no-context-menu"),u=0;u<a.items().length;u++)d=$("<span class='pane-legend-item-value-wrap'>").appendTo(h),p=v?$("<span class='pane-legend-item-value-title pane-legend-line'>").appendTo(d):null,_=$("<span class='pane-legend-item-value pane-legend-line'>").appendTo(d),v&&(p.addClass("pane-legend-item-value-title__main"),_.addClass("pane-legend-item-value__main")),m.properties().visible.value()||(_.addClass("disabled"),p&&p.addClass("disabled")),l.push(_),p&&c.push(p);f=$("<span class='pane-legend-item-additional pane-legend-line'>").appendTo(h.appendTo(t)),this._itemsBinding.push({value:a,cell:l,titleCells:c.length?c:null,source:m,additional:f})}},o.prototype.isDataWindowValuesVisible=function(t){return this._chart.onWidget()?!!t&&!this._chart.isSmall():!!t},o.prototype._generateItemsForRow._onShowhideClick=function(t){this._model.setProperty(t.properties().visible,!t.properties().visible.value(),"Show/Hide "+t.title())},o.prototype._generateItemsForRow._onFormatClick=function(t,e){t.userEditEnabled()&&(TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Style")),s(t,this._model))},o.prototype._generateItemsForRow._onDeleteClick=function(t){t.isUserDeletable()&&(t.hasChildren()?showDeleteStudyTreeConfirm(this._model.removeSource.bind(this._model,t)).open():this._model.removeSource(t))},o.prototype._generateItemsForRow._onAddChildSourceClick=function(t){var e,i,o=this._chart.showIndicators(t);o&&(e=function(){n("SOS","Apply SOS","Apply by Plus SOS")},i=this._model.model().studyInserted(),i.subscribe(this,e),o.visibilityChanged.subscribe(this,function(t){t||i.unsubscribe(this,e)},!0))},o.prototype._generateItemsForRow._onViewSorceClick=function(t){var e=t.metaInfo();this._getPineSourceCode(e).done(function(t){
TradingView.bottomWidgetBar&&TradingView.bottomWidgetBar.activateScriptEditorTab(t)})},o.prototype._getPineSourceCode=function(t){return $.Deferred()},o.prototype.setItemEnabled=function(t,e){var i=!t.hasClass("disabled"),o=t.closest(".pane-legend-wrap");e&&!i?(t.removeClass("disabled"),o.removeClass("disabled")):!e&&i&&(t.addClass("disabled"),o.addClass("disabled"))},o.prototype.valueChanged=function(t,e,i){return t[e]!==i&&(t[e]=i,!0)},o.prototype.firstTitle=function(){return this.$el.find(".pane-legend-line.pane-legend-wrap:first-child")},o.prototype.updateTitle=function(){var t,i,o,n,r,s,a,l,c,h;for(o=this._itemsBinding.length;o--;)i=this._itemsBinding[o],Array.isArray(i.cell)||(i.last||(i.last={}),n=i.last,r=i.source,t=r.properties().visible.value(),this.valueChanged(n,"sourceVisible",t)&&this.setItemEnabled(i.cell,t),s=i.value.color(),a=r!==this._model.mainSeries()&&r===this._model.selectedSource()?"bold":"normal",l=i.value.text(),e.enabled("fundamental_widget")&&(c=this._model.mainSeries(),h=c.symbolInfo(),l=(h?h.name:c.actualSymbol())+" "+l),(this.valueChanged(n,"color",s)||this.valueChanged(n,"fontWeight",a)||this.valueChanged(n,"text",l))&&i.cell.text(TradingView.clean(l,!0)).css({color:s,"border-color":s,"font-weight":a}));this._chart.resizeIndicator()},o.prototype.update=function(t){var e,i,o,n,s,a,l,c,h,u;for(this.updateTitle(),c=this._itemsBinding.length;c--;)if(n=this._itemsBinding[c],e=n.cell,i=n.titleCells,o=n.source.properties().visible.value(),Array.isArray(e)){for(n.last||(n.last={},n.last.dwView||(n.last.dwView={})),h=n.last,s=n.value.items(),u=this.valueChanged(h,"sourceVisible",o),a=0;a<e.length;a++)l=s[a],h[a]||(h[a]={}),u&&this.setItemEnabled(e[a],o),this.valueChanged(h[a],"text",l.text())&&(e[a][0].textContent=l.text()),l.color()&&this.valueChanged(h[a],"color",l.color())&&e[a].css("color",r.resetTransparency(l.color())),i&&(this.valueChanged(h,"sourceVisible",o)&&this.setItemEnabled(i[a],o),this.valueChanged(h[a],"title",l.title())&&(i[a][0].textContent=l.title()));n.additional&&n.value.additional&&this.valueChanged(h,"additional",n.value.additional())&&n.additional.text(n.value.additional()||"")}this._chart.resizeIndicator()},o.prototype.dataSourceAtPoint=function(t,e){return null},o.prototype.renderTo=function(t,e,i){var o,n,r,s,a,l,c;for(t.save(),t.fillStyle=this._chart.properties().scalesProperties.textColor.value(),t.textBaseline="middle",o=0,n=0;n<this._itemsBinding.length;++n)r=this._itemsBinding[n],s=r.value,a=r.source===this._model.mainSeries(),l=a?12:8,c=a?25:17,Array.isArray(r.cell)||(t.font=s.size()+" Verdana, Arial",t.fillText(s.text(),e,i+o+l),o+=c);t.restore()},o.prototype.toggleTitles=function(t){this._model.model().properties().paneProperties.legendProperties.showLegend.setValue(!this._chart.properties().paneProperties.legendProperties.showLegend.value());for(var e=this._chart._paneWidgets.length-1;e>=0;e--)this._chart._paneWidgets[e].legendWidget.updateLayout()},t.exports=o}).call(e,i(7))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){(function(e,o){"use strict"
;function n(t){this._chartWidgetCollection=t,this._bindings=[],this._hasAlertWathcedValue=null,this._$templatesButton=null,this._currentProperties=null,this._toolbarWidgets=[],this._clearProeprtiesOnHideTimeoutId=null,this._init(),this.attachHandlers()}function r(t,e){t.push({id:e,widget:$('<div class="tv-linetool-properties-toolbar__text">'+e+"</div>")[0]})}function s(t,e){t.push({id:e.value,widget:$(e.iconSvgCode)[0]})}function a(t,e){return $("<div>").addClass("tv-linetool-properties-toolbar__icon").addClass(e).append(t)[0]}function l(t){return a(t,"tv-linetool-properties-toolbar__icon--line-props")}var c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x=i(10),C=x.PropertyPage,P=x.ColorBinding,L=i(133).BarsMarksContainer,I=i(3).LineDataSource,k=i(44),A=i(268),M=i(103).bindPopupMenu,E=i(11).DefaultProperty,V=i(1117).GroupButtonFloatingToolbar,D=i(172).showEditObjectDialog,O=i(18).LineEnd;i(200),i(637),n.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},n.prototype.selectedSource=function(){return this._chartWidgetCollection.selectedSource.value()},n.prototype._init=function(){this._floatingToolbar=new V({addClass:"tv-linetool-properties-toolbar",defaultPosition:{top:window.headerChartPanel.outerHeight()+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position"}),this._floatingToolbar.onWidgetStateChanged().subscribe(this,this._onPropertyChangedInToolbar),this._sourceActions=this._createSourceActions(),this._sourceActions.forEach(function(t){this._floatingToolbar.addWidget(t.button)},this)},n.prototype._bindPopupMenuDirection=function(){return this._floatingToolbar.isVertical()?"right":"down"},n.prototype._onPropertyChangedInToolbar=function(t,e){this._currentProperties&&this.activeChartWidget().model().setProperty(this._currentProperties[t],e)},n.prototype._onPropertyChanged=function(t,e){this._floatingToolbar.setGroupedWidgetState(t,e.value())},n.prototype._hideAllSourceActions=function(){this._sourceActions.forEach(function(t){this._floatingToolbar.hideWidget(t.button)},this),this._sourceActionsVisible=!1},n.prototype._updateSourceActionsVisibility=function(t){this._sourceActionsVisible=!1,this._sourceActions.forEach(function(e){!e.isVisibleForSource||e.isVisibleForSource(t)?(this._floatingToolbar.showWidget(e.button),this._sourceActionsVisible=!0):this._floatingToolbar.hideWidget(e.button)},this)},n.prototype.attachHandlers=function(){k.tool.subscribe(this.onToolChanged.bind(this),{callWithLast:!0}),this._chartWidgetCollection.selectedSource.subscribe(this.onSourceChanged.bind(this))},n.prototype.onToolChanged=function(t,e){if(t&&-1!==t.toLowerCase().indexOf("linetool")){var e=e instanceof E?e:new E(t.toLowerCase());this._hideAllSourceActions(),this.showPropertiesOf(t,e),this.showTemplatesOf({tool:t,properties:e}),this._updateVisibility()}else this.selectedSource()?this.onSourceChanged(this.selectedSource()):this.hide()},n.prototype.findSourceOnWidget=function(t){var e,i,o,n
;for(e=0;e<this.activeChartWidget().model().panes().length;e++)for(i=this.activeChartWidget().model().panes()[e],o=i.orderedSources(),n=0;n<o.length;n++)if(o[n]===t)return o[n]},n.prototype.onSourceChanged=function(t){if(this._hasAlertWathcedValue&&(this._hasAlertWathcedValue.destroy(),this._hasAlertWathcedValue=null),!t)return void this.hide();t instanceof I&&!(t instanceof L)&&this.findSourceOnWidget(t)?(!t.userEditEnabled()||"LineToolBrush"!==t.toolname&&this.activeChartWidget().model().lineBeingCreated()?this._hideAllSourceActions():(this._updateSourceActionsVisibility(t),t.canHasAlert()&&(this._hasAlertWathcedValue=t.hasAlert.spawn(),this._hasAlertWathcedValue.subscribe(this._updateSourceActionsVisibility.bind(this,t)))),this.showPropertiesOf(t.getConstructor(),t.properties()),this.showTemplatesOf({source:t}),this._setupToggleLockButton(t),this._updateVisibility()):this.hide()},n.prototype.showTemplatesOf=function(t){var o,n,r,s,a;e.enabled("line_tool_templates")&&(o=t.source,o?(n=o.getConstructor(),r=o.properties()):(n=t.tool,r=t.properties),this._$templatesButton&&(this._floatingToolbar.removeWidget(this._$templatesButton[0]),this._$templatesButton=null),s=this,a=function(t){o?(o.restoreTemplate(t),s.activeChartWidget().model().model().updateSource(this._linetool),s.onSourceChanged(o)):(r.merge(t),r.listeners().fire(this),r.saveDefaults(),s.onToolChanged(n,r))},TradingView.onWidget()&&!window.is_authenticated||!e.enabled("linetoolpropertieswidget_template_button")||(this._templatesList=new A(n,a,{buttonInner:'<div class="tv-linetool-properties-toolbar__icon">'+i(1239)+'</div><span class="tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret"></span>',buttonClass:"tv-linetool-properties-toolbar__button apply-common-tooltip",defaultsCallback:function(){r.restoreFactoryDefaults(),s.showPropertiesOf(n,r)},saveAsText:$.t("Save Drawing Template As..."),applyDefaultText:$.t("Apply Default Drawing Template"),getDataForSaveAs:o?function(){return o.template()}:null,popupActiveClass:"i-dropped",popupDirection:this._bindPopupMenuDirection.bind(this)}),this._$templatesButton=this._templatesList.createButton().attr("title",$.t("Templates")),this._floatingToolbar.addWidget(this._$templatesButton[0],{index:0})),this._templatesVisible=!0)},n.prototype.templatesList=function(){return this._templatesList},n.prototype._createButton=function(t){var e,i,o;return t=t||{},e=document.createElement("div"),e.setAttribute("title",t.title),e.className+="tv-linetool-properties-toolbar__button apply-common-tooltip",e.addEventListener("click",t.callback),t.svgIcon&&(i=document.createElement("div"),i.classList.add("tv-linetool-properties-toolbar__icon"),i.appendChild(t.svgIcon),e.appendChild(i)),t.addCaret&&(o=document.createElement("div"),o.className="tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret",e.appendChild(o)),e},n.prototype._createSettingsButton=function(){var t=this;return this._createButton({title:$.t("Settings"),callback:function(){
D(t.selectedSource(),t.activeChartWidget().model(),{onWidget:t.activeChartWidget()._options.onWidget})},svgIcon:$(i(1203))[0]})},n.prototype._createZOrderButton=function(){var t=this._createButton({title:$.t("Visual Order"),callback:function(){t.classList.contains("i-dropped")||$(t).trigger("button-popup",[this._getZOrderActions()])}.bind(this),svgIcon:$(i(1232))[0],addCaret:!0});return M($(t),null,{direction:this._bindPopupMenuDirection.bind(this),event:"button-popup",reverse:!1,notCloseOnButtons:!0,activeClass:"i-dropped"}),t},n.prototype._createCloneButton=function(){var t,o=$.t("Clone");return e.enabled("datasource_copypaste")&&(o+=", "+$.t("Copy")),e.enabled("support_multicharts")&&(o+=", "+$.t("Sync")),t=this._createButton({title:o,callback:function(){t.classList.contains("i-dropped")||$(t).trigger("button-popup",[this._getCloneActions()])}.bind(this),svgIcon:$(i(1231))[0],addCaret:!0}),M($(t),null,{direction:this._bindPopupMenuDirection.bind(this),event:"button-popup",reverse:!1,notCloseOnButtons:!0,activeClass:"i-dropped"}),t},n.prototype._createLockButton=function(){var t=this._createButton({title:$.t("Lock"),callback:function(){this.activeChartWidget().toggleLockSelectedObject()}.bind(this),svgIcon:$(i(509))[0]});return this._lockChangeListener=function(e){t.classList.toggle("i-active",!!e.value())},t},n.prototype._createHideButton=function(){return this._createButton({title:$.t("Hide"),callback:function(){this.activeChartWidget().hideSelectedObject()}.bind(this),svgIcon:$(i(1233))[0]})},n.prototype._createRemoveButton=function(){return this._createButton({title:$.t("Remove"),callback:function(){this.activeChartWidget().removeSelectedSource()}.bind(this),svgIcon:$(i(1332))[0]})},n.prototype._createSourceActions=function(){var t=[];return e.enabled("property_pages")&&t.push({button:this._createSettingsButton()}),t.push({button:this._createZOrderButton()},{button:this._createCloneButton(),isVisibleForSource:function(t){var e=TradingView.className(t.constructor);return!this.activeChartWidget().model().model().isSingleInstanceLineTool(e)}.bind(this)},{button:this._createLockButton()},{button:this._createHideButton()},{button:this._createRemoveButton()}),t},n.prototype._getCloneActions=function(){var t=this.activeChartWidget().model(),i=this.selectedSource(),o=[];return i.properties().clonable.value()&&o.push({title:$.t("Clone"),action:function(){t.cloneLineTool(i)}}),e.enabled("datasource_copypaste")?(o.push({title:$.t("Copy"),shortcut:"Ctrl-C",action:function(){t.copySourceToClip(i)}}),e.enabled("support_multicharts")?(i.linkKey?o.push({title:$.t("Stop syncing"),action:function(){t.unlinkLine(i)}}):o.push({title:$.t("Sync to all charts"),action:function(){t.copyToOtherCharts(i)}}),o):o):o},n.prototype._getZOrderActions=function(){var t=[],e=this.selectedSource(),i=this.activeChartWidget().model(),o={title:$.t("Bring to Front"),action:function(){i.bringToFront(e)}},n={title:$.t("Send to Back"),action:function(){i.sendToBack(e)}},r={title:$.t("Bring Forward"),action:function(){i.changeZOrder(e,1)}},s={
title:$.t("Send Backward"),action:function(){i.changeZOrder(e,-1)}},a=i.paneForSource(this.selectedSource()),l=a.getZOrderMinMax();return e.zorder()===l.minZOrder&&(n.disabled=!0,s.disabled=!0),e.zorder()===l.maxZOrder&&(r.disabled=!0,o.disabled=!0),t.push(o,n,r,s),t},n.prototype._getPossibleProperty=function(t){var e,i,o=[],r=this._defaultToolProperties();for(e=0;e<r.length;e++)i=r[e],i.name in t&&o.push(i);return t.extendLeft||(o=o.map(function(t){return"leftEnd"===t.name&&(t.comboboxOptions=t.comboboxOptions.filter(function(t){return t.value!==n.LINE_EXTEND})),t})),t.extendRight||(o=o.map(function(t){return"rightEnd"===t.name&&(t.comboboxOptions=t.comboboxOptions.filter(function(t){return t.value!==n.LINE_EXTEND})),t})),o},n.prototype.showPropertiesOf=function(t,e){var i,o,n,a,l,c,h,u;if(this._toolExceptionCases||(this._toolExceptionCases=this._createToolExceptionCases()),i=this._toolExceptionCases[t]||this._getPossibleProperty(e),this._clearProperties(),this._propertiesVisible=!1,i.length){for(o={},n=i.length-1;n>=0;--n)if(a=i[n],l=e[a.name],"function"!=typeof(c=a.showIf)||c(l,e)){if(!l)continue;if(this._propertiesVisible=!0,h=[],"combobox"!==a.inputType){u=this.colorPropertyControl(l,a,e),this._floatingToolbar.addWidget(u[0],{index:this._$templatesButton?1:0}),this._toolbarWidgets.push(u[0]);continue}a.simple?a.comboboxOptions.forEach(r.bind(null,h)):a.comboboxOptions.forEach(s.bind(null,h)),a.propertyProxy&&(l=a.propertyProxy(e,this.activeChartWidget().model())),o[a.name]=l,l.subscribe(this,this._onPropertyChanged.bind(this,a.name,l)),this._floatingToolbar.addGroupedWidget({id:a.name,currentStateId:l.value(),stateWidgetAddClass:"tv-linetool-properties-toolbar__sub-widget",states:h,widgetAddClass:"tv-linetool-properties-toolbar__grouped-button",tooltip:a.title},{index:this._$templatesButton?1:0})}this._currentProperties=o}},n.prototype._updateVisibility=function(){this._propertiesVisible||this._sourceActionsVisible||this._templatesVisible?this._show():this.hide()},n.prototype._clearProperties=function(){this._currentProperties&&(this._clearProeprtiesOnHideTimeoutId&&(clearTimeout(this._clearProeprtiesOnHideTimeoutId),this._clearProeprtiesOnHideTimeoutId=null),Object.keys(this._currentProperties).forEach(function(t){this._currentProperties[t].unsubscribeAll(this),this._floatingToolbar.removeGroupedWidget(t)},this),this._currentProperties=null,this._toolbarWidgets.forEach(function(t){this._floatingToolbar.removeWidget(t)},this),this._toolbarWidgets=[],this.clearBindings())},n.prototype.hide=function(){this._floatingToolbar.hide(),this._clearProeprtiesOnHideTimeoutId=setTimeout(this._clearProperties.bind(this),this._floatingToolbar.hideDuration())},n.prototype._show=function(){this._floatingToolbar.show()},n.prototype.refresh=function(){this.onSourceChanged(this.selectedSource())},n.prototype._setupToggleLockButton=function(t){t!==this._selectedSourceBk&&(this._selectedSourceBk&&this._selectedSourceBk.properties().frozen&&this._selectedSourceBk.properties().frozen.unsubscribe(this,this._lockChangeListener),
t&&t.properties().frozen&&(t.properties().frozen.subscribe(this,this._lockChangeListener),this._lockChangeListener(t.properties().frozen)),this._selectedSourceBk=t)},n.prototype.bindControl=function(t){this._bindings.push(t)},n.prototype.clearBindings=function(t){for(var e=this._bindings.length;e--;)this._bindings[e].destroy();this._bindings.length=0},n.prototype.colorPropertyControl=function(t,e,i){var o,r,s=C.prototype.createColorPicker({addClass:"tv-linetool-properties-toolbar__color-picker apply-common-tooltip",direction:this._bindPopupMenuDirection.bind(this)});return s.attr("title",e.title),o=s.find("input"),r=$(e.iconSvgCode),r.on("click",function(t){o.data("tvcolorpicker")||o.focus()}),$(document).on("click",function(t){o.data("tvcolorpicker")?o.addClass("i-active"):o.removeClass("i-active")}),o.after(r),this.bindControl(new P(s,t,!0,this.activeChartWidget().model(),null,n.getTransparency(e,i))),"string"==typeof e.addClass&&s.addClass(e.addClass),s},n.getTransparency=function(t,e){if(t.transparency)return t.transparencyField?e[t.transparencyField].value():e.transparency.value()},n.prototype.createLineEndPropertyProxy=function(t,e){return function(i,r){var s,a;return s=i[e]&&i[e].value()?n.LINE_EXTEND:i[t].value(),a=new o(s),a.subscribe(this,function(o){var n=o.value();n<2?(r.beginUndoMacro(""),i[t].setValue(n),i[e]&&i[e].setValue(!1),r.endUndoMacro()):(r.beginUndoMacro(""),i[t].setValue(O.Normal),i[e]&&i[e].setValue(!0),r.endUndoMacro())}),a}},n.LINE_EXTEND=42,c=l(i(1226)),h=l(i(1227)),u=l(i(1228)),d=l(i(1229)),p=l(i(1219)),_=l(i(1218)),f=l(i(1222)),m=l(i(1220)),g=l(i(1221)),v=l(i(1225)),y=l(i(1223)),b=l(i(1224)),S=i(1234),w=i(1198),T=i(1206),n.prototype._defaultToolProperties=function(){return[{name:"color",inputType:"colorPicker",iconSvgCode:S,title:$.t("Color")},{name:"linecolor",inputType:"colorPicker",iconSvgCode:S,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Background Color"),transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:c},{value:2,iconSvgCode:h},{value:3,iconSvgCode:u},{value:4,iconSvgCode:d}],title:$.t("Width")},{name:"linestyle",title:$.t("Style"),inputType:"combobox",comboboxOptions:[{value:0,iconSvgCode:c},{value:1,iconSvgCode:p},{value:2,iconSvgCode:_}]},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:O.Normal,iconSvgCode:f},{value:O.Arrow,iconSvgCode:m},{value:n.LINE_EXTEND,iconSvgCode:g}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:O.Normal,iconSvgCode:v},{value:O.Arrow,iconSvgCode:y},{value:n.LINE_EXTEND,iconSvgCode:b}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]},n.prototype._riskPropertiesExceptionCases=function(){return[{name:"textcolor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:T},{name:"profitBackground",title:$.t("Profit Background Color"),inputType:"colorPicker",iconSvgCode:w,transparency:!0,
transparencyField:"profitBackgroundTransparency"},{name:"stopBackground",title:$.t("Stop Background Color"),inputType:"colorPicker",iconSvgCode:w,transparency:!0,transparencyField:"stopBackgroundTransparency"},{name:"linecolor",title:$.t("Border color"),inputType:"colorPicker",iconSvgCode:S}]},n.prototype._elliottPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:S}]},n.prototype._rangeExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:S,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Background Color"),transparency:!0,transparencyField:"backgroundTransparency"},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:c},{value:2,iconSvgCode:h},{value:3,iconSvgCode:u},{value:4,iconSvgCode:d}],title:"Width"}]},n.prototype._textPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:T},{name:"backgroundColor",title:$.t("Background Color"),inputType:"colorPicker",iconSvgCode:w,showIf:function(t,e){return!e||!e.fillBackground||!!e.fillBackground.value()}},{name:"borderColor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:S},{name:"bordercolor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:S},{name:"fontsize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},n.prototype._notePropertiesExceptionCases=function(){return[{name:"markerColor",title:$.t("Marker Color"),inputType:"colorPicker",iconSvgCode:S},{name:"textColor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:T},{name:"fontSize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},n.prototype._brushPropertiesExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:S,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:w,transparency:!0,showIf:function(t,e){return e.fillBackground.value()},title:$.t("Background Color")},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:c},{value:2,iconSvgCode:h},{value:3,iconSvgCode:u},{value:4,iconSvgCode:d}],title:$.t("Line Width")},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:O.Normal,iconSvgCode:f},{value:O.Arrow,iconSvgCode:m}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:O.Normal,iconSvgCode:v},{value:O.Arrow,iconSvgCode:y}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]},n.prototype._oneColorForAllLines=function(){return[{name:"collectibleColors",inputType:"colorPicker",iconSvgCode:S,title:$.t("One color for all lines")}]},n.prototype._createToolExceptionCases=function(){return{LineToolRegressionTrend:[],
LineToolGannSquare:n.prototype._oneColorForAllLines(),LineToolFibTimeZone:n.prototype._oneColorForAllLines(),LineToolBrush:n.prototype._brushPropertiesExceptionCases(),LineToolPolyline:n.prototype._brushPropertiesExceptionCases(),LineToolText:n.prototype._textPropertiesExceptionCases(),LineToolTextAbsolute:n.prototype._textPropertiesExceptionCases(),LineToolBalloon:n.prototype._textPropertiesExceptionCases(),LineToolCallout:n.prototype._textPropertiesExceptionCases(),LineToolPriceLabel:n.prototype._textPropertiesExceptionCases(),LineToolArrowMarkLeft:[],LineToolArrowMarkRight:[],LineToolArrowMarkUp:[],LineToolArrowMarkDown:[],LineToolFlagMark:[],LineToolThumbUp:[],LineToolThumbDown:[],LineToolElliottCircle:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottSubminuette:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinor:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMajorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolDateRange:n.prototype._rangeExceptionCases(),LineToolPriceRange:n.prototype._rangeExceptionCases(),LineToolDateAndPriceRange:n.prototype._rangeExceptionCases(),LineToolIcon:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:w}],LineToolNote:n.prototype._notePropertiesExceptionCases(),LineToolNoteAbsolute:n.prototype._notePropertiesExceptionCases(),LineToolThreeDrivers:[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:S}],LineToolRiskRewardLong:n.prototype._riskPropertiesExceptionCases(),LineToolRiskRewardShort:n.prototype._riskPropertiesExceptionCases(),LineToolBarsPattern:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:w}],LineToolProjection:[{name:"color1",title:$.t("Background color 1"),inputType:"colorPicker",iconSvgCode:w,transparency:!0},{name:"color2",title:$.t("Background color 2"),inputType:"colorPicker",iconSvgCode:w,transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:c},{value:2,iconSvgCode:h},{value:3,iconSvgCode:u},{value:4,iconSvgCode:d}]}],LineToolFibCircles:n.prototype._oneColorForAllLines(),LineToolFibChannel:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceArcs:n.prototype._oneColorForAllLines(),LineToolFibRetracement:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceFan:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibTime:n.prototype._oneColorForAllLines(),LineToolFibWedge:n.prototype._oneColorForAllLines(),LineToolGannComplex:n.prototype._oneColorForAllLines(),LineToolGannFan:n.prototype._oneColorForAllLines(),LineToolPitchfan:n.prototype._oneColorForAllLines(),LineToolPitchfork:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork2:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork:n.prototype._oneColorForAllLines(),LineToolInsidePitchfork:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibExtension:n.prototype._oneColorForAllLines()}},t.exports=n}).call(e,i(7),i(52))},,,,,,,,function(t,e,i){
(function(e,o,n){"use strict";function r(){this.title=$.t("Load Chart Layout"),this._removeDialogShown=!1,this.options={},this.matchedItems=[],this.itemsData=[],this.qs=new r.QuickSearch(this.fieldsExtractor,this.searchResult.bind(this)),this.sortObj=new r.SortObject(this.modifiedCompare),this.nameSort=new r.SortObject(this.nameCompare),this.symbolSort=new r.SortObject(this.symbolCompare),this.toolsSort=new r.SortObject(this.toolsCompare),this.offset=0,c.on("chart_loaded",r.onChartLoaded,this)}var s,a,l,c=i(43),h=i(96).createDialog,u=i(478).createSearchControl,d=i(319).regExpEscape;s='<div class="js-table-row tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--item {{^withFavs}}tv-load-chart-dialog-table__row--item-without-favs{{/withFavs}} {{#isActive}}i-active{{/isActive}}" data-id="{{id}}">{{#withFavs}}<div class="tv-load-chart-dialog-table__favorite-icon-container {{#starred}}i-starred{{/starred}}" ><span data-id="{{id}}" class="js-empty-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--empty" title="'+$.t("Add to favorites")+'">'+i(329)+'</span><span data-id="{{id}}" class="js-filled-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--filled" title="'+$.t("Remove from favorites")+'">'+i(328)+'</span></div>{{/withFavs}}<div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-name">{{title}}</div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-modified">{{modifiedDate}}</div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-symbol">{{chartSymbol}}</div><div data-id="{{id}}" class="js-remove-button tv-load-chart-dialog-table__column-name-action tv-load-chart-dialog-table__remove-icon" title="'+$.t("Delete chart layout")+'">'+i(109)+"</div></div>",a='<div class="tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--header"><div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-name">'+$.t("Chart Layout Name")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-modified">'+$.t("Last Modified")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-symbol">'+$.t("Active Symbol")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div></div>',l=50,r.onChartLoaded=function(){this.itemsData&&this.itemsData.length>0&&this._refreshChartsList()},r.QuickSearch=function(t,e){this.fieldsExtractor=t,this.callback=e,this.regExps=[]},
r.QuickSearch.prototype.onInput=function(t){this.query=t,this.createRegexps(t),this.search()},r.QuickSearch.prototype.createRegexps=function(t){this.regExps=[],t&&this.regExps.push(RegExp("("+t.split("").map(function(t){return d(t)}).join(")(.*?)(")+")","i"))},r.QuickSearch.prototype.match=function(t){var e,i,o,n;for(e=0;e<this.regExps.length;e++)for(i=this.regExps[e],i.lastIndex=0,o=this.fieldsExtractor(t),n=0;n<o.length;n++)if(i.test(o[n]))return!0;return 0===this.regExps.length},r.QuickSearch.prototype.search=function(){var t,e,i=[];for(t=0;t<this.items.length;t++)e=this.items[t],this.match(e)&&i.push(e);this.callback(i,this.regExps)},r.QuickSearch.prototype.setItems=function(t){this.items=t},r.SortObject=function(t,e){this.isAscending=!1,this.sortingFunc=t,this.getPredicate=function(){return function(t,e){var i=this.sortingFunc(t,e);return this.isAscending&&(i*=-1),i}.bind(this)},this.inverse=function(){this.isAscending=!this.isAscending},this.setIsAscending=function(t){return"boolean"==typeof t&&(this.isAscending=t),this.isAscending},this.reset=function(){this.isAscending=!1}},r.prototype.fieldsExtractor=function(t){var e=r.symbolWrap(t);return[t.title,e]},r.prototype.saveFavorite=function(t,e){e?this.favorites[t]=e:delete this.favorites[t]},r.prototype.filterFavorites=function(){var t={};this.itemsData.map(function(e){this.favorites.hasOwnProperty(e.id)&&(t[e.id]=!0)}.bind(this)),this.favorites=t},r.prototype.getFavorite=function(t){return this.favorites.hasOwnProperty(t)},r.prototype._onFavoriteClicked=function(t,e,i){this.saveFavorite(t.id,e),this.filterFavorites(),this.fillList(),t.favoriteAction(this.favorites),i.preventDefault()},r.prototype._onItemClicked=function(t,e){e.defaultPrevented||(e.preventDefault(),t.openAction())},r.prototype._onRemoveButtonClicked=function(t,e){var i=this,o=$.Deferred();this._removeDialogShown=!0,o.done(function(){i.removeItem(t)}).always(function(){setTimeout(function(){i._removeDialogShown=!1})}),t.deleteAction(o,t.title),e.preventDefault()},r.prototype._createListItem=function(t){return e.render(s,{id:t.id,isActive:t.active(),title:t.title,url:t.url,withFavs:o.enabled("items_favoriting"),starred:this.getFavorite(t.id),modifiedDate:n.unix(t.modified).format("L LT"),chartSymbol:""===t.symbol?"multiple charts":t.symbol+", "+t.interval})},r.prototype.removeItem=function(t){var e=this.itemsData.indexOf(t);e>-1&&this.itemsData.splice(e,1),this.setChartsData(this.itemsData)},r.prototype.modifiedCompare=function(t,e){var i=t.modified,o=e.modified;return n(o).diff(n(i))},r.prototype.nameCompare=function(t,e){return t.title.localeCompare(e.title)},r.symbolWrap=function(t){return""===t.symbol?"multiple charts":t.symbol+" "+t.interval},r.prototype.symbolCompare=function(t,e){return r.symbolWrap(t).localeCompare(r.symbolWrap(e))},r.prototype.toolsCompare=function(t,e){var i=t.toolsCount,o=e.toolsCount;return i<o?-1:i===o?0:1},r.prototype.sortClick=function(t){this.setSort($(t.target).data("sort"),!0),this.fillList()},r.prototype.setSort=function(t,e){var i,o,n={
field:TVSettings.getValue("loadChartDialog.sort.field")||"modified",isAscending:TVSettings.getValue("loadChartDialog.sort.asc")||"0"},r=t||n.field,s=e?"0"===n.isAscending?"1":"0":n.isAscending;this.currentSortObj&&!(i=r!==n.field)||(this.currentSortObj="name"===r?this.nameSort:"symbol"===r?this.symbolSort:"tools"===r?this.toolsSort:this.sortObj,i&&TVSettings.setValue("loadChartDialog.sort.field",r)),this.currentSortObj.setIsAscending("1"===s),s!==n.isAscending&&TVSettings.setValue("loadChartDialog.sort.asc",s),o=this,$.each(this.header.children(".tv-load-chart-dialog-table__column--header"),function(){var t=$(this),e=t.data("sort")===r;t.removeClass("i-active i-dropped"),e&&t.addClass("i-active "+(o.currentSortObj.isAscending?"":"i-dropped"))})},r.prototype.sortList=function(){var t,e=[],i=[];this.matchedItems.map(function(t){this.favorites.hasOwnProperty(t.id)?e.push(t):i.push(t)}.bind(this)),void 0!==this.currentSortObj&&(t=this.currentSortObj.getPredicate(),i.sort(t),e.sort(t)),this.matchedItems=e.concat(i)},r.prototype.showMoreData=function(){var t,e,i;if(!(this.offset>=this.matchedItems.length)){for(t=Math.min(this.offset+l,this.matchedItems.length),e="",i=this.offset;i<t;++i)e+=this._createListItem(this.matchedItems[i]);this.itemsList[0].insertAdjacentHTML("beforeend",e),this.offset+=l}},r.prototype.fillList=function(){this.sortList(),this.offset=0,this.itemsList[0].innerHTML="",this.showMoreData(),this.itemsListContainer.toggleClass("i-empty",0===this.itemsData.length),this.highlightOccurrences(this.qs.regExps),this._dialog&&(this.itemsListContainer[0].scrollTop=0)},r.prototype.searchResult=function(t,e){this.matchedItems=t,this.fillList()},r.prototype.updateChartsData=function(t){this.setChartsData(t)},r.prototype.updateFavoritesData=function(t){this.favorites=t,this.itemsList&&this.qs.search()},r.prototype.updateChartsAndFavoritesData=function(t,e){this.favorites=e,this.itemsList&&(this.itemsData=t,this.qs.setItems(t),this.qs.search())},r.prototype._refreshChartsList=function(){this.qs.setItems(this.itemsData),this.qs.search()},r.prototype.setChartsData=function(t){this.itemsList&&(this.itemsData=t,this.qs.setItems(t),this.qs.search())},r.prototype.layoutHeader=function(){var t=$(a);return t.find(".js-column-name").data("sort","name"),t.find(".js-column-modified").data("sort","modified"),t.find(".js-column-symbol").data("sort","symbol"),t.appendTo(this.content),t},r.prototype.resetSort=function(){this.sortObj.reset(),this.nameSort.reset(),this.symbolSort.reset(),this.toolsSort.reset(),this.currentSortObj=this.sortObj},r.prototype._findItemById=function(t){return t=parseInt(t),this.itemsData.find(function(e){return e.id===t})},r.prototype.show=function(t,e){var i=this,n=u({placeholder:$.t("Search")}),r=$("<div>");r.append(n.$control),r.append('<div class="tv-load-chart-dialog-table">'),this.content=$("<div>").appendTo(r.find(".tv-load-chart-dialog-table")),this.header=this.layoutHeader(),this.setSort(),this.itemsListContainer=$('<div class="tv-load-chart-dialog-table__items-list-container">').data({
localScroll:!0}).appendTo(this.content),this.itemsList=$('<div class="tv-load-chart-dialog-table__items-list">').appendTo(this.itemsListContainer),$('<div class="tv-load-chart-dialog-table__empty-list-placeholder">').text($.t("There are no saved charts")).appendTo(this.itemsListContainer),this.itemsListContainer.on("click",".js-remove-button",function(t){var e=i._findItemById($(t.currentTarget).data("id"));i._onRemoveButtonClicked(e,t),t.stopPropagation()}).on("click",".js-table-row",function(t){var e=i._findItemById($(t.currentTarget).data("id"));i._onItemClicked(e,t),t.preventDefault()}).on("scrolltoend",function(){i.showMoreData()}),o.enabled("items_favoriting")&&this.itemsListContainer.on("click",".js-empty-star",function(t){var e=i._findItemById($(t.currentTarget).data("id"));i._onFavoriteClicked(e,!0,t),t.stopPropagation()}).on("click",".js-filled-star",function(t){var e=i._findItemById($(t.currentTarget).data("id"));i._onFavoriteClicked(e,!1,t),t.stopPropagation()}),this.header.children(".tv-load-chart-dialog-table__column--header").click($.proxy(this,"sortClick")),n.inputChangedDelegate.subscribe(this.qs,this.qs.onInput),this.favorites=e,this.setChartsData(t),this.qs.onInput(""),this._dialog&&this._dialog.close(),this._dialog=h({title:this.title,width:600,height:550,content:r,contentWrapTemplate:"<div>",destroyOnClose:!0,withScroll:!1,isClickOutFn:function(){return!this._removeDialogShown&&void 0}.bind(this)}),this._dialog.open()},r.prototype.highlightOccurrences=function(t){0!==t.length&&this.itemsList.children(".js-table-row").each(function(){var e,i=$(this).find(".js-column-name"),o=i.text();o=r.highlightText(o,t),i.html(o),e=$(this).find(".js-column-symbol"),o=e.text(),o=r.highlightText(o,t),e.html(o)})},r.highlightText=function(t,e){var i,o,n,r,s,a;if(t=$("<div>").text(t).html(),0===e.length)return t;for(i=0;i<e.length;i++){if(o=e[i],o.lastIndex=0,n="",r="",(s=o.exec(t))&&s.length)for(a=1;a<s.length;a++)n+=a%2?'<span class="i-match">$'+a+"</span>":"$"+a;if((r=t.replace(o,n))&&r!==t)return r}},t.exports=r}).call(e,i(54),i(7),i(36))},,,,,function(t,e,i){"use strict";function o(t,e,i){this._model=e,this._paneWidget=t,this._chart=t._chart,this._mainDiv=i,this.jqDiv=$('<div class="pane-controls">'),this._initVisibility(),this.update(),this.jqDiv.appendTo(i)}var n=i(309);o.prototype.update=function(){var t,e,o,n,r,s,a,l;if(!this._visible||!this._chart.isActive())return void this.jqDiv[0].classList.add("pane-controls--hidden");if(this.jqDiv[0].classList.remove("pane-controls--hidden"),t=this,e=t._model,o=t._paneWidget.state(),n=e.panes().indexOf(o),this.jqDiv.toggleClass("toppane",0===n||this._chart.isMaximizedPane()),r=!1,!o.containsMainSeries()&&!this._chart.isMaximizedPane()){for(s=0,a=o.dataSources(),l=a.length;l--;)if(a[l]instanceof TradingView.Study&&++s>1){r=!0;break}a=null}n>0&&!this._chart.isMaximizedPane()?(this._$upButton||(this._$upButton=$(document.createElement("a")).addClass("pane-legend-icon up").append($(i(1217)).attr({width:14,height:14})).attr("title",$.t("Move Up")).on("click",function(){
t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"up")})),this._$upButton.appendTo(this.jqDiv)):this._$upButton&&this._$upButton.detach(),n<this._model.panes().length-1&&!this._chart.isMaximizedPane()?(this._$downButton||(this._$downButton=$(document.createElement("a")).addClass("pane-legend-icon down").append($(i(1214)).attr({width:14,height:14})).attr("title",$.t("Move Down")).on("click",function(){t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"down")})),this._$downButton.appendTo(this.jqDiv)):this._$downButton&&this._$downButton.detach(),r?(this._$closeButton||(this._$closeButton=$(document.createElement("a")).addClass("pane-legend-icon delete").append($(i(510)).attr({width:14,height:14})).attr("title",$.t("Delete")).on("click",function(){t._model.removePane(t._chart,t._model.panes().indexOf(t._paneWidget.state()))})),this._$closeButton.appendTo(this.jqDiv)):this._$closeButton&&this._$closeButton.detach(),this._model.panes().length>1&&!this._chart.isMaximizedPane()?(this._$maximizeButton||(this._$maximizeButton=$(document.createElement("a")).addClass("pane-legend-icon maximize").append($(i(1215)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){t._chart.toggleMaximizePane(t._paneWidget)})),this._$maximizeButton.appendTo(this.jqDiv)):this._$maximizeButton&&this._$maximizeButton.detach(),this._model.panes().length>1&&this._chart.isMaximizedPane()?(this._$restoreButton||(this._$restoreButton=$(document.createElement("a")).addClass("pane-legend-icon restore").append($(i(1216)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){t._chart.toggleMaximizePane(t._paneWidget)})),this._$restoreButton.appendTo(this.jqDiv)):this._$restoreButton&&this._$restoreButton.detach()},o.prototype.destroy=function(){this._visibilityProperty&&(this._visibilityProperty.unsubscribe(this,this._onVisibilityPropertyChange),this._visibilityProperty=null),this._boundMouseHandler&&(this._mainDiv[0].removeEventListener("mouseenter",this._boundMouseHandler,!1),this._mainDiv[0].removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null),this.jqDiv.remove()},o.prototype._initVisibility=function(){this._visible=!0,this._visibilityProperty=n.actualBehavior(),this._visibilityProperty.subscribe(this,this._onVisibilityPropertyChange),this._onVisibilityPropertyChange()},o.prototype._onVisibilityPropertyChange=function(){var t=this._visibilityProperty.value();"alwaysOn"===t||"alwaysOff"===t?(this._visible="alwaysOn"===t,this._boundMouseHandler&&(this._mainDiv[0].removeEventListener("mouseenter",this._boundMouseHandler),this._mainDiv[0].removeEventListener("mouseleave",this._boundMouseHandler),this._boundMouseHandler=null)):(this._boundMouseHandler||(this._boundMouseHandler=this._visibilityMouseHandler.bind(this),this._mainDiv[0].addEventListener("mouseenter",this._boundMouseHandler),this._mainDiv[0].addEventListener("mouseleave",this._boundMouseHandler)),this._visible=!1),
this.update()},o.prototype._visibilityMouseHandler=function(t){this._visible="mouseenter"===t.type,this.update()},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this.chart=t,this.paneA=t.paneWidgets()[e],this.paneB=t.paneWidgets()[i],this.jqRow=$(document.createElement("tr")),this.jqRow.height(o.HEIGHT),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("pane-separator"),this.jqCell.attr("colspan","3"),this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value()),this.jqCell.click(function(){}),this.handle=$('<div class="handle">').appendTo(this.jqCell),r(this.handle,this)}var n,r;i(626),n=i(56).clamp,r=i(144).setMouseEventHandler,o.HEIGHT=1,o.prototype.hide=function(){this.jqRow.addClass("js-hidden")},o.prototype.show=function(){this.jqRow.removeClass("js-hidden")},o.prototype.mouseDownEvent=function(t){(0===t.button||Modernizr.touch)&&(this.startY=t.pageY,this.deltaY=0,this.totalHeight=this.paneA.size.h+this.paneB.size.h,this.totalStretch=this.paneA.stretchFactor()+this.paneB.stretchFactor(),this.prevStretchA=this.paneA.stretchFactor(),this.minPaneHeight=30,this.maxPaneHeight=this.totalHeight-this.minPaneHeight,this.pixelStretchFactor=this.totalStretch/this.totalHeight)},o.prototype.pressedMouseMoveEvent=function(t){var e,i,o,r;(0===t.button||Modernizr.touch)&&(t.preventDefault(),this.deltaY=t.pageY-this.startY,e=this.paneA.size.h,i=n(e+this.deltaY,this.minPaneHeight,this.maxPaneHeight),o=i*this.pixelStretchFactor,r=this.totalStretch-o,this.paneA.setStretchFactor(o),this.paneB.setStretchFactor(r),this.chart._adjustSize(),this.paneA.size.h!==e&&(this.startY=t.pageY),this.chart.paint())},o.prototype.mouseUpEvent=function(t){(0===t.button||Modernizr.touch)&&(this.chart._model.addPaneStretchFactorUndoCommand(this.paneA._state,this.paneB._state,this.prevStretchA,this.paneA.stretchFactor()),this.startY=0,this.deltaY=0,this.totalHeight=0,this.totalStretch=0,this.minPaneHeight=0,this.maxPaneHeight=0,this.pixelStretchFactor=0)},o.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())},o.prototype.paint=function(){},o.prototype.image=function(){var t={},e=o.HEIGHT,i=this.paneA.lhsPriceAxisWidget.size.w,n=this.paneA.size.w,r=this.paneA.rhsPriceAxisWidget.size.w,s=$('<canvas width="'+i+'" height="'+e+'">')[0],a=s.getContext("2d");return a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,i,e),t.leftAxis={content:s.toDataURL(),contentWidth:i,contentHeight:e},s=$('<canvas width="'+n+'" height="'+e+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,n,e),t.content=s.toDataURL(),t.contentWidth=n,t.contentHeight=e,s=$('<canvas width="'+r+'" height="'+e+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,r,e),t.rightAxis={content:s.toDataURL(),contentWidth:r,contentHeight:e},t},t.exports=o},function(t,e,i){(function(e){
"use strict";function o(t,e,i,o){this._chart=t,this.dialog=t.dialog,this._state=e,this.verticalTouchScroll=o,this._disableContextMenu=!!i,this.lhsPriceAxisWidget=new c(this,c.LHS),this.rhsPriceAxisWidget=new c(this,c.RHS),this.jqPane=$(document.createElement("td")),this.jqPane.addClass("chart-markup-table"),this.jqPane.addClass("pane"),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqPane),this.canvas=D(this._dv,new O(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=D(this._dv,new O(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._zoomSelector=$("<div>"),this._zoomSelector.addClass("zoom-selector"),this._zoomSelector.css("display","none"),this._zoomSelector.appendTo(this._dv),this._tooltipSelector=$("<div>"),this._tooltipSelector.addClass("tooltip tooltip-selector tooltip-selector-hidden"),this._tooltipSelector.appendTo(this._dv),this.legendWidget=new l(this,this._chart.model(),this._chart._jqMainDiv),this.jqRow=$(document.createElement("tr")),this.lhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.jqPane.appendTo(this.jqRow),this.legendWidget.$el.appendTo(this._dv),this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.setCursorForTool(),B($(this.top_canvas),this,!0,o),e&&!this._chart.readOnly()&&(this.paneControls=new L(this,this._chart.model(),this._dv)),this.updateScalesVisibility(),this.actions=[],this.readonlyActions=[],this._onKeyUpListener=this._onKeyUpListener.bind(this),this._lineCancelledCallback=this._lineCancelledCallback.bind(this),$(window).on("keyup.panewidget",this._onKeyUpListener),this._chart.withModel(this,this._lineCancelledCallback),this._overlays={},this._contextMenuX=0,this._contextMenuY=0,this._lockDrawingsProperty=C.lockDrawings(),this._chart.withModel(this,function(){var t=this._chart.model();t.onSimpleZoomIn().subscribe(this,this._updateCrosshairOnZoom),t.onSimpleZoomOut().subscribe(this,this._updateCrosshairOnZoom)})}var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E,V,D,O,B,R,z,F,N;i(627),n=i(1).Point,r=i(497).UndoMacroCommand,s=i(76).UndoHistory,a=i(61).Study,l=i(756),c=i(269),h=i(83).LineToolOrder,u=i(83).LineToolPosition,d=i(3).LineDataSource,p=i(83).LineToolBrush,_=i(133).BarsMarksContainer,f=i(48).trackEvent,m=i(219).isFeatureEnabled,g=i(172).showEditObjectDialog,v=i(270).ActionBinder,y=i(62).PriceDataSource,b=i(73),S=b.Action,w=b.ActionPlaceholder,T=b.ActionSeparator,x=i(131),C=i(44),P=i(4),L=i(807),I=i(37),k=i(43),A=i(171),M=A.resizeCanvas,E=A.hardResizeCanvas,V=A.clearRect,D=A.addCanvasTo,O=A.Size,B=i(144).setMouseEventHandler,R=i(266),z=i(177),F=i(490).PaneCursorType,N=i(13).getLogger("Chart.PaneWidget"),o.prototype.destroy=function(){
$(window).off("keyup.panewidget",this._onKeyUpListener),this.legendWidget&&(this.legendWidget.$el.remove(),delete this.legendWidget),this.paneControls&&(this.paneControls.destroy(),delete this.paneControls),this._chart.withModel({chart:this._chart,instance:this,callback:this._hideTooltip},function(){this.chart.model().lineCancelled().unsubscribe(this.instance,this.callback)});for(var t in this)delete this[t]},o.prototype.cancelZoom=function(){this._zoomSelector.css("display","none"),delete this._firstZoomPoint},o.prototype._onKeyUpListener=function(t){if(27===t.keyCode){this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine(),this._firstZoomPoint&&this.cancelZoom();this._chart.model().model().crossHairSource().clearMeasure(),this.setCursorForTool(),this._hideTooltip()}},o.prototype._lineCancelledCallback=function(){try{this._chart.model().lineCancelled().subscribe(this,this._hideTooltip)}catch(t){}},o.prototype.backgroundColor=function(){return this._chart.properties().paneProperties.background.value()},o.prototype.priceAxisByCanvas=function(t){return t===this.lhsPriceAxisWidget.canvas||t===this.lhsPriceAxisWidget.top_canvas?this.lhsPriceAxisWidget:t===this.rhsPriceAxisWidget.canvas||t===this.rhsPriceAxisWidget.top_canvas?this.rhsPriceAxisWidget:null},o.prototype.updateScalesVisibility=function(){this.lhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showLeftScale.value()),this.rhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showRightScale.value())},o.prototype.chart=function(){return this._chart},o.prototype._chartModel=function(){return this._chart.model().model()},o.prototype.state=function(){return this._state},o.prototype.setState=function(t){this._state=t},o.prototype.stretchFactor=function(){return this._state?this._state._stretchFactor:Pane.DEFAULT_STRETCH_FACTOR},o.prototype.setStretchFactor=function(t){this._state&&(this._state._stretchFactor=t)},o.prototype.mouseEnterEvent=function(t){var e=this._chart.model();e&&(e.crossHairSource().visible=!0,"function"==typeof this.onMouseEnter&&this.onMouseEnter(this))},o.prototype.isLineTool=function(t){var e=TradingView[t];return"function"==typeof e&&e.prototype instanceof d},o.prototype.hideInplaceEditor=function(){return!!this._inplaceEditor&&(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0)},o.prototype._processMouseMoveWhileZoom=function(t){var e=Math.floor(this._chart.model().timeScale().coordinateToIndex(t.localX)),i=this._chart.model().timeScale().indexToCoordinate(e)-.5*this._chart.model().timeScale().barSpacing(),o=t.localY,n=Math.abs(i-this._firstZoomPoint.x),r=Math.abs(o-this._firstZoomPoint.y);i<this._firstZoomPoint.x?this._zoomSelector.css("left",i):this._zoomSelector.css("left",this._firstZoomPoint.x),t.localY<this._firstZoomPoint.y?this._zoomSelector.css("top",t.localY):this._zoomSelector.css("top",this._firstZoomPoint.y),this._zoomSelector.width(n),this._zoomSelector.height(r)},o.prototype._finishZoom=function(t){
var e=this._state.defaultPriceScale(),i=e.coordinateToPrice(t.localY),o=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX));o!==this._firstZoomPoint.index&&this._chart.model().zoomToViewport(this._firstZoomPoint.index,o,this._firstZoomPoint.price,i,this.state()),this._zoomSelector.css("display","none"),this._firstZoomPoint=null,C.resetToCursor()},o.EvironmentState=function(t){t.shiftKey&&(this.shift=!0),t.ctrlKey&&(this.control=!0)},o.prototype.checkMovepoint=function(t){return t===P.MOVEPOINT||t===P.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any()},o.prototype.mouseDownEvent=function(t){var i,r,s,l,c,h,u,p,_,f,m,g,v,b;if(document.activeElement!==document.body&&document.activeElement!==document.documentElement?document.activeElement&&document.activeElement.blur?document.activeElement.blur():document.body.focus():document.getSelection?document.getSelection().removeAllRanges():document.selection&&document.selection.clear(),k.emit("mouse_down",{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY}),this._updateCommonTooltip(null),i=this._chart.model(),r=new o.EvironmentState(t),i.mainSeries().setGotoDateResult(),this.hideInplaceEditor(),TradingView.supportTouch()&&(this._skipFirstMove=!0),s=this._state.defaultPriceScale(),!s.isEmpty()&&!i.timeScale().isEmpty()){if(l=i.crossHairSource(),TradingView.supportTouch()&&"LineToolBrush"!==C.tool.value()||i.setAndSaveCurrentPosition(t.localX,t.localY,this._state),c=l.price,h=l.index,l.startMeasurePoint()&&l.endMeasurePoint()&&l.clearMeasure(),r.shift&&C.toolIsCursor(C.tool.value())&&C.tool.setValue("measure"),"measure"===C.tool.value()&&!l.startMeasurePoint())return void l.startMeasuring({price:c,index:h,x:t.localX,y:t.localY},this._state);if(l.startMeasurePoint()&&!l.endMeasurePoint())return l.finishMeasure({price:c,index:h,x:t.localX,y:t.localY}),void C.resetToCursor();if(this._firstZoomPoint)return void this._finishZoom(t);if("zoom"===C.tool.value()&&e.enabled("chart_zoom"))return u=i.timeScale().indexToCoordinate(h)-.5*i.timeScale().barSpacing(),this._firstZoomPoint={price:c,index:h,x:u,y:t.localY},this._zoomSelector.css("display","block"),this._zoomSelector.css("left",u),this._zoomSelector.css("top",t.localY),this._zoomSelector.width(0),void this._zoomSelector.height(0);if(!this._isSelectBarModeEnabled()&&(this.isLineTool(C.tool.value())||i.lineBeingCreated()))return void((!e.enabled("charting_library_base")||h>=0)&&this._mouseDownEventForLineTool(t,r,h,c));if(p=this.dataSourceAtPoint(t.localX,t.localY),_=p&&p.source&&p.source.customization?p.source.customization:{},p.hittest&&p.hittest.result()===P.CUSTOM&&(f=p.hittest.data().mouseDownHandler)&&f(t),!this._chart.readOnly()){if(p&&p.hittest&&p.hittest.result()===P.CUSTOM_MOVE&&(f=p.hittest.data().pressedMouseMoveHandler))return void i.startCustomMoving(p.source,new n(t.localX,t.localY),f);if(p&&!_.disableSelection&&(m=p.hittest&&p.hittest.result()>P.MOVEPOINT_BACKGROUND,m=m||p.hittest&&p.hittest.result()===P.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any(),
m?i.setSelectedSource(p.source,p.hittest&&p.hittest.data()):i.setSelectedSource(null)),p.source&&"eraser"===C.tool.value()&&!_.disableErasing&&(TradingView.isInherited(p.source.constructor,d)||TradingView.isInherited(p.source.constructor,a)))return g=p.hittest.eraseMarker(),void(t.ctrlKey&&void 0!==g&&p.source.processErase?p.source.processErase(i,g):i.removeSource(p.source));if(v=p.source&&TradingView.isInherited(p.source.constructor,d)&&p.source.isLocked(),!(this._lockDrawingsProperty.value()||v)){if(p.source&&p.source.userEditEnabled&&!p.source.userEditEnabled())return;if(p.hittest&&p.hittest.result()===P.CHANGEPOINT)return s=p.source.priceScale(),c=s.coordinateToPrice(t.localY),i.startChangingLinetool(p.source,{index:h,price:c},p.hittest.data(),r),void this._updateTooltip(t.localX,t.localY);if(p.hittest&&this.checkMovepoint(p.hittest.result()))return b=p.source.properties(),r.control&&b.clonable&&b.clonable.value()?void(this._clonningAtMoveLineTool=p.source):void(p.source.isFixed&&p.source.isFixed()?i.startMovingSource(p.source,new n(t.localX,t.localY),p.hittest.data()):(s=p.source.priceScale(),c=s.coordinateToPrice(t.localY),i.startMovingSource(p.source,{index:h,price:c},p.hittest.data())))}if(p.source&&TradingView.isInherited(p.source.constructor,y)&&p.source.isDraggable())return void(this._chart.draggingSource=p.source)}p.hittest&&p.hittest.result()===P.REGULAR||(this._processing=!0)}},o.prototype.drawRightThere=function(t){var e,i;this.isLineTool(t)&&(e=this._chart.model(),i=e.crossHairSource(),e.createLineTool(this._state,{index:i.index,price:i.price},t))},o.prototype._finishTool=function(t){var e,i=this._chart.model(),o=C.tool.value();C.resetToCursor(),this._hideTooltip(),i.setSelectedSource(t),this._chart.isTextTool(o)&&(e=i.createUndoCheckpoint(),g(t,i,null,e).then(function(t){t.focusOnText()}))},o.prototype._mouseDownEventForLineTool=function(t,e,i,o){var r,s,a,l,c,h,u,d,_,f,m=this._chart.model(),g=!1,v=null,y=t.localX,b=t.localY,S=this._chart.model().model().crossHairSource(),w=C.tool.value();if(C.hideAllDrawings().setValue(!1),C.lockDrawings().setValue(!1),TradingView.supportTouch()&&this.isLineTool(w)&&"LineToolBrush"!==w&&!m.lineBeingCreated()&&(this._startTouchPoint=new n(y,b),this._initCrossHairPosition=S.currentPoint(),this._skipFirstMove=!0),!m.lineBeingCreated()||m.lineBeingCreated()instanceof p)TradingView.supportTouch()&&"LineToolBrush"!==w||(f={index:i,price:o},v=m.createLineTool(this._state,f,w),m.lineBeingCreated()||(g=!0));else if(TradingView.supportTouch()){if(this._skipFirstMove=!0,!this._startTouchPoint)return this._startTouchPoint=new n(y,b),r=m.lineBeingCreated().points(),s=r[r.length-1],a=m.timeScale().indexToCoordinate(s.index),o=s.price,l=m.lineBeingCreated().priceScale(),l.isPercent()&&(c=m.lineBeingCreated().ownerSource().firstValue(),o=l.priceRange().convertToPercent(o,c)),h=l.priceToCoordinate(o),void(this._lastDrawingPoint=new n(a,h))}else v=m.lineBeingCreated(),u=m.paneForSource(v),u!==this._state?(d=this._dv.offset(),y=t.localX+d.left,b=t.localY+d.top,
_=this._chart.paneByState(u),d=_._dv.offset(),y-=d.left,b-=d.top,o=v.priceScale().coordinateToPrice(b),i=Math.round(m.timeScale().coordinateToIndex(y)),g=m.coninueCreatingLine({index:i,price:o},e)):g=m.coninueCreatingLine({index:i,price:o},e);m.setSelectedSource(v),g?this._finishTool(v):TradingView.supportTouch()&&"LineToolBrush"!==w||this._updateTooltip(t.localX,t.localY)},o.prototype._equalsCursorCache=function(t,e){return C.toolIsCursor(t.tool)?t.tool===e.tool&&t.theme===e.theme&&t.crosshair===e.crosshair:t.tool===e.tool&&t.theme===e.theme},o.prototype._setCursorClassName=function(t){var e="";t&&(e="pane--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqPane.removeClass(this._currentCursorClassName),e&&this.jqPane.addClass(e),this._currentCursorClassName=e,this.jqPane.css("cursor"))},o.prototype.setCursorForTool=function(t,e){var i,o=C.tool.value();if(C.toolIsCursor(o)){if(this._chart.draggingSource||this._isScrolling||this._chart.model()&&this._chart.model().sourceBeingMoved())return void this._setCursorClassName("grabbing");if(t)return void this._setCursorClassName("pointer")}return"eraser"===o?void this._setCursorClassName("eraser"):"zoom"===o?void this._setCursorClassName("zoom-in"):"dot"===(i=C.cursorTool.value())?void this._setCursorClassName("dot"):"arrow"===i?void this._setCursorClassName("default"):void this._setCursorClassName("")},o.prototype.setDragToAnotherPaneCursor=function(){this._setCursorClassName("grabbing")},o.prototype.gestureStartEvent=function(t){this._prev_pinch_scale=1,this._pinching=!0},o.prototype.gestureChangeEvent=function(t){var e,i,o=t.center.x-5,n=this._chart.paneWidgets()[0].lhsPriceAxisWidget.size.w,r=this._chart.model().timeScale().width();n&&(o=Math.max(0,o-n)),o=Math.min(o,r),e=2*(o/r-.5),i=5*(t.scale-this._prev_pinch_scale),i>0?this._chart.model().zoomIn(e,i):i<0&&this._chart.model().zoomOut(e,-i),this._prev_pinch_scale=t.scale},o.prototype.gestureEndEvent=function(t){this._pinching=!1},o.prototype._updateCommonTooltip=function(t){var e,i,o,n=this._lastCommonTooltipData,r=null;if(t&&t.hittest&&t.hittest.result()===P.CUSTOM&&(e=t.hittest.data())&&(r=e.tooltip||null),null!=n||null!=r)return null==r?(this._lastCommonTooltipData=null,void z.hide()):void(n&&r.text===n.text&&r.rect.x===n.rect.x&&r.rect.y===n.rect.y&&r.rect.w===n.rect.w&&r.rect.h===n.rect.h||(this._lastCommonTooltipData=r,i=TradingView.clone(r),o=this.jqPane.offset(),i.rect.x+=o.left,i.rect.y+=o.top,z.show(i)))},o.prototype._processMouseMoveForCustomHandler=function(t){var e,i=this.dataSourceAtPoint(t.localX,t.localY);i.hittest&&i.hittest.result()===P.CUSTOM&&(e=i.hittest.data().mouseMoveHandler)&&e(t)},o.prototype.mouseMoveEvent=function(t){var e,i,n,r,s,a,l,c,h,u,d,p,_,f,m;if(this._processMouseMoveForCustomHandler(t),e=this._chart.model()){if(i=t.localX,n=t.localY,r=new o.EvironmentState(t),this._firstZoomPoint)return void this._processMouseMoveWhileZoom(t);if(!(this._chart.readOnly()||this._editDialog&&this._editDialog.isVisible())&&(s=C.tool.value(),a=null,l=null,c=null,
this._processing||!C.toolIsCursor(s)&&"eraser"!==s||(a=this.dataSourceAtPoint(t.localX,t.localY),h=a&&a.source,u=this._chart.model().crossHairSource(),h&&("LineToolOrder"===h.toolname||"LineToolPosition"===h.toolname||"AlertLabel"===h.toolname)?u.visibleTrap=!1:u.visibleTrap=!0,a.hittest&&a.hittest.result()>P.MOVEPOINT_BACKGROUND?(l=a.source,c=a.hittest.result(),!a.source||"eraser"===s&&a.source.constructor===TradingView.Series?e.setHoveredSource(null):e.setHoveredSource(a.source,a.hittest.data())):e.setHoveredSource(null)),this._isSelectBarModeEnabled()?this._setCursorClassName("pointer"):this.setCursorForTool(l,c),this._updateCommonTooltip(a),null!==a&&null!==a.hittest&&a.hittest.result()===P.CUSTOM_MOVE))switch(d=a.hittest.data()||{},d.cursorType){case F.VerticalResize:this._setCursorClassName("ns-resize")}if(this._chart.readOnly()&&(a=this.dataSourceAtPoint(t.localX,t.localY),null!==a.source?e.setHoveredSource(a.source,a.hittest.data()):e.setHoveredSource(null,null)),this._chart.model().lineBeingCreated()&&(p=this._chart.model().lineBeingCreated(),(_=this._chart.model().paneForSource(p))!==this._state))return f=this._dv.offset(),i+=f.left,n+=f.top,m=this._chart.paneByState(_),f=m._dv.offset(),i-=f.left,n-=f.top,void e.setAndSaveCurrentPosition(i,n,_);s=C.tool.value(),TradingView.supportTouch()&&this.isLineTool(s)||(e.setAndSaveCurrentPosition(i,n,this._state,r),this._updateTooltip(i,n))}},o.prototype.pressedMouseMoveEvent=function(t){var i,r,s,a,l,c,h,u,_,f,m,g,v,y,b,S,w,T,x,P,L,I,k,A,M,E,V,D;if(!this._pinching){if(this._skipFirstMove?(delete this._skipFirstMove,delete this._touchMove):this._touchMove=!0,i=new o.EvironmentState(t),r=this._chart.model(),s=t.localX,a=t.localY,this._firstZoomPoint)return this._processMouseMoveWhileZoom(t),void(this._firstZoomPoint.draggingMode=!0);if(l=C.tool.value(),TradingView.supportTouch()&&this._startTouchPoint&&this.isLineTool(l)&&"LineToolBrush"!==l&&!r.lineBeingCreated()&&!this._isSelectBarModeEnabled())return c=this._initCrossHairPosition,h=new n(s,a),u=h.subtract(this._startTouchPoint),_=c.add(u),this._chart.model().setAndSaveCurrentPosition(_.x,_.y,this._state),void this._updateTooltip(_.x,_.y);if(TradingView.supportTouch()&&r.lineBeingCreated()&&!(r.lineBeingCreated()instanceof p))return void(this._startTouchPoint&&(f=r.lineBeingCreated(),m=t.localX-this._startTouchPoint.x,g=t.localY-this._startTouchPoint.y,v=this._lastDrawingPoint.x+m,y=this._lastDrawingPoint.y+g,b=this._chart.model().paneForSource(f),r.setAndSaveCurrentPosition(v,y,b),this._updateTooltip(v,y)));if(r.setAndSaveCurrentPosition(s,a,this._state,i),this._updateTooltip(s,a),S=C.tool.value(),w=this._isSelectBarModeEnabled(),(!this.isLineTool(S)||"LineToolBrush"===l||w)&&(0===t.button||Modernizr.touch)){if("LineToolBrush"===S&&!w){if(T=this._state.defaultPriceScale(),T.isEmpty())return;if(!this._chart.model().lineBeingCreated())return;return x=T.coordinateToPrice(t.localY),P=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX)),
void((!e.enabled("charting_library_base")||P>=0)&&this._chart.model().coninueCreatingLine({index:P,price:x}))}if(this._chart.draggingSource&&(L=t.target,I=this._chart.paneByCanvas(L),I&&(I!==this?I.setDragToAnotherPaneCursor():I.setCursorForTool()),k=this._chart.priceAxisByCanvas(L),k&&k.setCursor("grabbing"),(A=this._chart.timeAxisByCanvas(L))&&A.setCursor("grabbing")),r.timeScale().isEmpty())return;if(r.customMoveBeingProcessed())return void r.processCustomMove(new n(s,a));if(r.lineBeingEdited())return P=Math.round(this._chart.model().timeScale().coordinateToIndex(s)),(!e.enabled("charting_library_base")||P>=0)&&r.changeLinePoint({x:s,y:a},i),this._updateTooltip(s,a),void this.setCursorForTool();if(r.sourceBeingMoved()){if(T=r.sourceBeingMoved().priceScale(),T.isEmpty())return;if(P=this._chart.model().timeScale().coordinateToIndex(t.localX),x=T.coordinateToPrice(t.localY),M=r.sourceBeingMoved(),this.setCursorForTool(),e.enabled("charting_library_base")&&!r.sourceBeingMoved().onlyYMoving()&&(E=M.points(),0!==E.length&&E.reduce(function(t,e){return e.index<t.index?e:t}).index-((M._currentMovingPoint||M._startMovingPoint).index-P)<0))return;return TradingView.isInherited(M.constructor,d)&&M.isFixed()?void r.moveSource(new n(s,a)):void r.moveSource({index:P,price:x},i)}if(i.control&&this._clonningAtMoveLineTool)return f=this._clonningAtMoveLineTool,V=this.cloneLineTool(f,!0),D=this._chart.model().model().dataSourceForId(V),this._chart.model().setSelectedSource(D),r.startMovingSource(D,{index:this._chart.model().timeScale().coordinateToIndex(t.localX),price:f.priceScale().coordinateToPrice(t.localY)}),void(this._clonningAtMoveLineTool=null);T=this._state.defaultPriceScale(),!this._startScrollingPos&&e.enabled("chart_scroll")&&(this._startScrollingPos={x:t.clientX,y:t.clientY}),this._startScrollingPos&&(this._startScrollingPos.x===t.clientX&&this._startScrollingPos.y===t.clientY||this._isScrolling||(r.beginUndoMacro("scroll").setCustomFlag("doesnt_affect_save",!0),T.isEmpty()||r.startScrollPrice(this._state,T,t.localY),r.startScrollTime(t.localX),this._isScrolling=!0,this.setCursorForTool())),this._isScrolling&&(T.isEmpty()||r.scrollPriceTo(this._state,T,t.localY),r.scrollTimeTo(t.localX))}}},o.prototype._processMouseUpForCustomHandler=function(t){var e,i=this.dataSourceAtPoint(t.localX,t.localY);i.hittest&&i.hittest.result()===P.CUSTOM&&(e=i.hittest.data().mouseUpHandler)&&e(t)},o.prototype.mouseUpEvent=function(t){var e,i,o,n,a,l,c,h,u,d,_,f,m,g,v,y,b,S,w,T,x,P,L,A,M,E,V,D,O,B,R,z,F,N;if(this._processMouseUpForCustomHandler(t),this._clonningAtMoveLineTool=null,e=this,k.emit("mouse_up",{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY}),i=this._chart.model(),o=this._touchMove,delete this._touchMove,n=C.tool.value(),TradingView.supportTouch()&&!o&&"LineToolBrush"!==n&&this.isLineTool(n)&&!i.lineBeingCreated())return a=i.crossHairSource().currentPoint(),l=this._state.defaultPriceScale(),c=l.coordinateToPrice(a.y),h=Math.round(i.timeScale().coordinateToIndex(a.x)),u={
index:h,price:c},d=i.createLineTool(this._state,u,n),i.setSelectedSource(d),i.lineBeingCreated()||this._finishTool(d),this._updateTooltip(a.x,a.y),void delete this._startTouchPoint;if(i.lineBeingCreated()&&!(i.lineBeingCreated()instanceof p)&&this._startTouchPoint)return _=!1,delete this._startTouchPoint,o||(d=i.lineBeingCreated(),f=d.points()[d.points().length-1],c=f.price,m=d.priceScale(),m.isPercent()&&(g=i.lineBeingCreated().ownerSource().firstValue(),c=m.priceRange().convertToPercent(c,g)),_=i.coninueCreatingLine({index:f.index,price:c},{}),delete this._lastDrawingPoint),void(_&&this._finishTool(d));if(this._firstZoomPoint&&this._firstZoomPoint.draggingMode)return void this._finishZoom(t);if(0===t.button||TradingView.supportTouch()){if(this._processing=!1,i=this._chart.model(),i.customMoveBeingProcessed()&&i.endCustomMoving(),i.lineBeingEdited())return i.endChangingLinetool(),void this._hideTooltip();if("LineToolBrush"===n&&!this._isSelectBarModeEnabled()){if(i.finishLineTool(),l=this._state.defaultPriceScale(),l.isEmpty())return;if(!this._chart.model().lineBeingCreated())return;return c=l.coordinateToPrice(t.localY),h=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX)),void this._chart.model().coninueCreatingLine({index:h,price:c})}if(v=i.sourceBeingMoved())return i.endMovingSource(),this._hideTooltip(),this.setCursorForTool(v),void i.invalidate(new I(I.UPDATE_CURSOR_ONLY));if(this._chart.readOnly()||(y=this.dataSourceAtPoint(t.localX,t.localY),b=this._chart.model().crossHairSource(),S=t.localX>=0&&t.localX<this.size.w,y&&y.source===b||!S||(w=e._chart.model().timeScale().coordinateToIndex(t.localX),e._chart.model().model().onSyncScrollNeeded(w))),T=this._isScrolling&&s.undoStack().head()instanceof r,this._isScrolling&&(l=this._state.defaultPriceScale(),i.endScrollPrice(this._state,l),e=this,x=function(){i.endScrollTime(),i.endUndoMacro(),e._startScrollingPos=void 0,e._isScrolling=!1,e.setCursorForTool()},TradingView.supportTouch()?(P=i.timeScale().m_scrollStartPoint,L=.05*(t.localX-P),A=null,M=function(e){var o,n;null===A&&(A=e),o=.01*Math.min(100,3*(e-A)),o=Math.sqrt(o),n=t.localX+L*o,i.scrollTimeTo(n),o>=1?x():requestAnimationFrame(M)},requestAnimationFrame(M)):x()),this._chart.draggingSource)for(E=t.target,V=this._chart.paneByCanvas(E),V&&V!==this&&(D=V._state.findSuitableScale(this._chart.draggingSource),T&&(T=!1,s.undo()),this._chart.model().move(this._chart.draggingSource,V._state,D)),O=this._chart.priceAxisByCanvas(E),O&&(V=O.pane,l=O._isLeft?V._state.leftPriceScale():V._state.rightPriceScale(),T&&(T=!1,s.undo()),this._chart.model().move(this._chart.draggingSource,V._state,l)),B=this._chart.timeAxisByCanvas(E),B&&(T&&(T=!1,s.undo()),this._chart.model().move(this._chart.draggingSource,null,null)),this._chart.draggingSource=null,R=this._chart.getTimeScale(),R&&R.restoreDefaultCursor(),y=this.dataSourceAtPoint(t.localX,t.localY),z=this._chart.paneWidgets(),F=0;F<z.length;F++)N=z[F],N===this&&y?N.setCursorForTool(y.source,y.hittest||null):N.setCursorForTool(),
N.lhsPriceAxisWidget.restoreDefaultCursor(),N.rhsPriceAxisWidget.restoreDefaultCursor()}delete this._touchMove},o.prototype.mouseLeaveEvent=function(t){var e=this._chart.model();e&&(TradingView.isMobile.any()||e.model().clearCurrentPosition(),e.setHoveredSource(null),this._updateCommonTooltip(null),"function"==typeof this.onMouseLeave&&this.onMouseLeave(this))},o.prototype.mouseClickEvent=function(t){var e,i=this.dataSourceAtPoint(t.localX,t.localY),o=this._chart.model(),n=i.source;this._lastClickedSource!==n&&(this._lastClickedSource&&(this._lastClickedSource.onClickOutside(t),o.chartModel().updateSource(this._lastClickedSource)),this._lastClickedSource=n),i.hittest&&i.hittest.result()===P.CUSTOM&&(e=i.hittest.data().mouseClickHandler)&&(e(t),o.chartModel().updateSource(n)),o.hoveredSource()instanceof _&&o.hoveredSource().onClicked()},o.prototype.showEditDialogForSource=function(t){if(!(this.chart().onWidget()||t.userEditEnabled&&!t.userEditEnabled())){var e=this;g(t,this._chart.model()).then(function(t){e._editDialog=t})}},o.prototype.mouseDoubleClickEvent=function(t){var e,i=!this._chart.readOnly()&&!this.isLineTool(C.tool.value())&&this.dataSourceAtPoint(t.localX,t.localY),o=i&&i.hittest&&i.source;o&&i.hittest.result()<=P.MOVEPOINT_BACKGROUND&&!TradingView.isMobile.any()&&(o=null),o&&o.customization&&o.customization.disableSelection&&(o=null),o&&o._metaInfo&&"Sessions@tv-basicstudies"===o._metaInfo.id&&(o=this._chart.model().mainSeries()),o?(e=!1,e?TradingView.alertsDispatcher.openEditDialog(i.source.alert()):this.showEditDialogForSource(o)):this._chart.readOnly()||this.isLineTool(C.tool.value())||this._chart.model().lineBeingCreated()||this._chart.model().selectedSource()||this._chart.toggleMaximizePane(this)},o.prototype.showContextMenuForSource=function(t,e){t.hasContextMenu()&&(this._chart.model().setSelectedSource(t),t.constructor===TradingView.Series?this._seriesContextMenu(t).show(e):TradingView.isInherited(t.constructor,a)?this._studyContextMenu(t).show(e):TradingView.isInherited(t.constructor,h)||TradingView.isInherited(t.constructor,u)?this._tradingDrawingsContextMenu(t).show(e):TradingView.isInherited(t.constructor,d)?this._lineContextMenu(t).then(function(t){t.show(e)}):t===this._chart.model().crossHairSource()&&t.handleContextMenuEvent(e))},o.prototype.contextMenuEvent=function(t,i){var o,n,r,s;if(e.enabled("pane_context_menu")){if(this._chart.model().crossHairSource().startMeasurePoint())return void this._chart.model().crossHairSource().clearMeasure();if(!this._pinching&&(this._firstZoomPoint&&this.cancelZoom(),!this.hideInplaceEditor())){if(!C.toolIsCursor(C.tool.value())&&!this._isSelectBarModeEnabled()){if(TradingView.isMobile.any())return;return C.resetToCursor(!0),this.setCursorForTool(),this._hideTooltip(),void(this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine())}this.chart().readOnly()||this._disableContextMenu||(this._chart.model().mainSeries().createSessStudy(),this._contextMenuX=t.localX,this._contextMenuY=t.localY,o=this.dataSourceAtPoint(t.localX,t.localY),
n=o?o.source:null,r=o&&o.hittest?o.hittest.result():0,s=r>=P.REGULAR||r>=P.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any(),this._chart.updateActions(),null!==n&&s?this.showContextMenuForSource(n,t):(this._contextMenu(t).then(function(e){return e.show(t)}),this._chart.model().setSelectedSource(null)),this.paint())}}},o.prototype._contextMenu=function(t){function e(t){return null===t.text}var i=this;return Promise.all(this._initActions(t)).then(function(t){var o,n,r=i._customActions();for(t=t.filter(function(t){return null!==t}),r.remove.forEach(function(e){for(var i=0;i<t.length;i++)if(t[i].text===e){t.splice(i,1);break}}),o=r.top.concat(t).concat(r.bottom),n=o.length-1;n>0;n--)e(o[n])&&e(o[n-1])&&o.splice(n,1);return o.length&&e(o[0])&&o.splice(0,1),o.length&&e(o[o.length-1])&&o.splice(o.length-1,1),x.createMenu(o,{statName:"ChartContextMenu"})})},o.prototype.createRemoveMenu=function(){var t,e=this._chart.actions(),i=new S({text:$.t("Remove"),statName:"Remove"});return i.subActions||(i.subActions=[]),t=i.subActions,t.push(e.paneRemoveAllStudies,e.paneRemoveAllDrawingTools,e.paneRemoveAllStudiesDrawingTools),i},o.prototype.createDrawingMenu=function(){var t,i=this._chart.actions(),o=new S({text:$.t("Drawing Tools"),statName:"DrawingTools"});return o.subActions||(o.subActions=[]),t=o.subActions,e.enabled("left_toolbar")&&t.push(i.drawingToolbarAction),e.enabled("items_favoriting")&&t.push(i.favoriteDrawingToolbar),0!==o.subActions.length&&t.push(new T),t.push(i.magnetAction,i.stayInDrawingModeAction),e.enabled("support_multicharts")&&t.push(i.syncModeAction),t.push(new T,i.lockDrawingsAction,i.hideAllDrawingsAction,i.paneRemoveAllDrawingTools),o},o.prototype._initActions=function(t){var i,o,n,r,s,a=this,l=this._chart.actions(),c=[];return e.enabled("datasource_copypaste")&&(!(i=R.get())||"study"!==i.type&&"drawing"!==i.type||(o=new S({text:$.t("Paste %s").replace("%s",$.t(i.title||i.type)),shortcut:"Ctrl-V",statName:"Paste"}),o.callbacks().subscribe(null,function(){a._chart.onAppClipboardPaste(a.state())}),c.push(o))),l.gotoDate&&c.push(l.gotoDate),c.length&&c.push(new T),c.push(l.chartReset,l.symbolSearch,l.changeInterval),n=window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist),n&&l.addToWatchlist&&c.push(l.addToWatchlist),e.enabled("text_notes")&&m("text_notes")&&c.push(l.addToTextNotes),e.enabled("symbol_info")&&c.push(l.showSymbolInfoDialog),c.push(new T,this._createLockTimeAxisAction(t),new T,l.paneObjectTree,l.insertIndicator),e.enabled("charting_library_base")||c.push(l.applyStudyTemplate),e.enabled("compare_symbol")&&c.push(l.compareOrAdd),c.push(this.createDrawingMenu()),e.enabled("charting_library_base")&&c.push(l.hideAllMarks),c.push(this.createRemoveMenu(),new T),r=this._priceAxisMenu(),r&&c.push(r),s=this._timeAxisMenu(),s&&c.push(s),e.enabled("charting_library_base")||c.push(l.applyColorTheme),e.enabled("show_chart_property_page")&&c.push(l.chartProperties),
pro.hasPackage("mtp-mtpredictor")&&this.state().containsMainSeries()&&c.push(new T,this._createMTPredictorActions()),c},o.prototype._customActions=function(){var t,i={top:[],bottom:[],remove:[]},o=this._chart.model(),n=o.timeScale(),r=this._state.defaultPriceScale();return e.enabled("custom_items_in_context_menu")?(t=n.isEmpty()?void 0:n.indexToUserTime(n.coordinateToIndex(this._contextMenuX)),k.emit("onContextMenu",{unixtime:t?t/1e3:void 0,price:r.isEmpty()?void 0:r.coordinateToPrice(this._contextMenuY),callback:function(t){[].concat(t).forEach(function(t){if(t.text)if(t.text.length>1&&"-"===t.text[0])i.remove.push(t.text.slice(1));else{var e;"-"===t.text?e=new T:(e=new S({text:t.text}),e.callbacks().subscribe(null,t.click)),t.position&&"top"===t.position?i.top.push(e):i.bottom.push(e)}})}}),i):i},o.prototype._timeAxisMenu=function(){if(this._chart.model().timeScale().isEmpty())return null;var t=this._chart.getTimeScale();return new S({text:$.t("Time Scale"),subActions:t.getContextMenuActions(),statName:"TimeScale"})},o.prototype.getDefaultPriceAxisWidget=function(){var t=this._state.defaultPriceScale();return t.isEmpty()?null:t===this._state.leftPriceScale?this.leftPriceAxisWidget():this.rightPriceAxisWidget()},o.prototype._priceAxisMenu=function(){var t=this.getDefaultPriceAxisWidget();return t?new S({text:$.t("Price Scale"),subActions:t.getContextMenuActions(),statName:"PriceScale"}):null},o.prototype._seriesContextMenu=function(t){var i,o,n,r,s,a=this._chart.actions(),l=t.properties().visible.value(),c=null;if(this._chart.readOnly())i=[l?a.seriesHide:this.createActionShow(t),new T,this.createActionShowCountdown(t),new T,this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t)],e.enabled("countdown")||i.splice(3,1),c=x.createMenu(i);else{if(o=this._mergeContentMenuItems(t),n=[a.showSymbolInfoDialog,a.compare,l?a.seriesHide:this.createActionShow(t),this.createVisualOrderAction(t),new T,this.createActionShowCountdown(t),new T],e.enabled("countdown")||n.splice(5,2),e.enabled("compare_symbol")||n.splice(1,1),e.enabled("symbol_info")||n.splice(0,1),!this.chart().onWidget()&&e.enabled("show_chart_property_page")&&n.unshift(a.format),r=this.createActionLockScale(t),r&&n.push(r,new T),o.length>0){for(s=0;s<o.length;s++)n.push(o[s]);n.push(new T)}n.push(this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t)),pro.hasPackage("mtp-mtpredictor")&&n.push(new T,this._createMTPredictorActions()),c=x.createMenu(n)}return c},o.prototype.toggleLockTimeAxis=function(t,e){var i,o,n;"boolean"!=typeof e&&(e=!C.lockTimeAxis().value()),e&&(i=this._chart.model().timeScale(),o=i.coordinateToIndex(t),n=i.points().roughTime(o),C.lockTimeAxisTime.setValue(n)),C.lockTimeAxis().setValue(e)},o.prototype._createLockTimeAxisAction=function(t){var e=new S({text:$.t("Lock Cursor In Time"),checkable:!0,statName:"ToggleLockCursorInTime"}),i=C.lockTimeAxis().value();return e.setChecked(i),e.callbacks().subscribe(null,this.toggleLockTimeAxis.bind(this,t.localX,!i)),e},
o.prototype._createHVLineAction=function(t,e){e="vertical"===e&&"vertical"||"horizontal";var i=new S({text:"vertical"===e?$.t("Create Vertical Line"):$.t("Create Horizontal Line"),statName:"vertical"===e?"CreateVerticalLine":"CreateHorizontalLine"});return i.callbacks().subscribe(this,function(){var i=this._chart.model().timeScale().coordinateToIndex(t.localX),o=this._state.defaultPriceScale().coordinateToPrice(t.localY),n=this._chart.model().createLineTool(this._state,{index:i,price:o},"vertical"===e&&"LineToolVertLine"||"LineToolHorzLine");this._finishTool(n)}),i},o.prototype._createMTPredictorActions=function(){var t=this,e=function(e,i,o){var n=new S({text:e});return n.callbacks().subscribe(t,function(){var t,e,n=this._chart.model(),r=n.timeScale(),s=this._state.defaultPriceScale();r.isEmpty()||s.isEmpty()||(o?(t=s.coordinateToPrice(this._contextMenuY),e=Math.round(r.coordinateToIndex(this._contextMenuX)),n.createLineTool(this._state,{index:e,price:t},i)):C.tool.setValue(i))}),n};return new S({text:$.t("MTPredictor"),subActions:[e($.t("Apply Manual Risk/Reward"),"LineStudyMtpRiskReward",!1),e($.t("Apply Manual Decision Point"),"LineStudyMtpDecisionPoint",!0),e($.t("Analyze Trade Setup"),"LineStudyMtpAnalysis",!0),new S({text:$.t("Apply Elliot Wave"),subActions:[e($.t("Apply Elliot Wave Intermediate"),"LineStudyMtpElliotWaveMain",!0),e($.t("Apply Elliot Wave Major"),"LineStudyMtpElliotWaveMajor",!0),e($.t("Apply Elliot Wave Minor"),"LineStudyMtpElliotWaveMinor",!0)]}),new S({text:$.t("Apply WPT Up Wave"),subActions:[e($.t("Up Wave 1 or A"),"LineStudyMtpUpWave1OrA",!1),e($.t("Up Wave 2 or B"),"LineStudyMtpUpWave2OrB",!1),e($.t("Up Wave C"),"LineStudyMtpUpWaveC",!1),e($.t("Up Wave 3"),"LineStudyMtpUpWave3",!1),e($.t("Up Wave 4"),"LineStudyMtpUpWave4",!1),e($.t("Up Wave 5"),"LineStudyMtpUpWave5",!1)]}),new S({text:$.t("Apply WPT Down Wave"),subActions:[e($.t("Down Wave 1 or A"),"LineStudyMtpDownWave1OrA",!1),e($.t("Down Wave 2 or B"),"LineStudyMtpDownWave2OrB",!1),e($.t("Down Wave C"),"LineStudyMtpDownWaveC",!1),e($.t("Down Wave 3"),"LineStudyMtpDownWave3",!1),e($.t("Down Wave 4"),"LineStudyMtpDownWave4",!1),e($.t("Down Wave 5"),"LineStudyMtpDownWave5",!1)]})]})},o.prototype.createEarningsShow=function(t){var e=this._chart.model().mainSeries().properties().esdShowEarnings,i=new S({checkable:!0,text:$.t("Show Earnings"),enabled:!0,checked:e.value(),statName:"ToggleShowEarnings"});return i.callbacks().subscribe(this,function(t){this._chart.model().setProperty(e,t.checked,"Show Earnings")}),i},o.prototype.createDividendsShow=function(t){var e=this._chart.model().mainSeries().properties().esdShowDividends,i=new S({checkable:!0,text:$.t("Show Dividends"),enabled:!0,checked:e.value(),statName:"ToggleShowDividends"});return i.callbacks().subscribe(this,function(t){this._chart.model().setProperty(e,t.checked,"Show Dividends")}),i},o.prototype.createSplitsShow=function(t){var e=this._chart.model().mainSeries().properties().esdShowSplits,i=new S({checkable:!0,text:$.t("Show Splits"),enabled:!0,checked:e.value(),
statName:"ToggleShowSplits"});return i.callbacks().subscribe(this,function(t){this._chart.model().setProperty(e,t.checked,"Show Splits")}),i},o.prototype._studyEsdContextMenu=function(t){var e=[];return this._chart.readOnly()||e.push(this.createDividendsShow(t),this.createSplitsShow(t),this.createEarningsShow(t)),x.createMenu(e)},o.prototype._studyContextMenu=function(t){var i,o,n,r,s,a=this._chart.actions(),l=t.properties().visible.value(),c=[];return t.userEditEnabled()?(i=this._chart,this._chart.readOnly()?c=[l?a.studyHide:this.createActionShow(t),new T,this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t)]:(o=[],n=t.metaInfo(),n.pine&&(o=[a.viewSourceCode],a.viewSourceCode.setEnabled(!0),ScriptLib.isAuthToGetPineSourceCode(n.scriptIdPart,n.pine.version).done(function(t){t||a.viewSourceCode.setEnabled(!1)}).fail(function(t){N.logError("Failed isAuthToGetPineSourceCode, reason: "+t)})),c=[],e.enabled("study_on_study")&&t.canHaveChildren()&&c.push(this.createActionAddChildStudy(t)),e.enabled("property_pages")&&c.push(a.format),c=c.concat(o),c=c.concat([l?a.studyHide:this.createActionShow(t),this.createVisualOrderAction(t),new T]),r=this._mergeContentMenuItems(t),!r.length||t.properties().linkedToSeries&&t.properties().linkedToSeries.value()||(r.push(new T),c=c.concat(r)),c.push(this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t),new T),e.enabled("datasource_copypaste")&&!t.isChildStudy()&&(s=new S({text:$.t("Copy"),shortcut:"Ctrl-C",statName:"Copy"}),s.callbacks().subscribe(null,function(){i.onAppClipboardCopy(t)}),c.push(s)),c.push(a.studyRemove)),x.createMenu(c)):x.createMenu(c)},o.prototype.createLineToolTemplateAction=function(t){var e,i,o,n,r,s=t.properties(),a=window.lineToolPropertiesToolbar.templatesList(),l=new S({text:$.t("Templates"),statName:"Templates"});return l.subActions||(l.subActions=[]),e=l.subActions,i=new S({text:$.t("Save As..."),statName:"SaveAs"}),i.callbacks().subscribe(this,function(){a.showSaveDialog(function(e){var i=JSON.stringify(t.template());a.saveTemplate(e,i)})}),e.push(i),o=new S({text:$.t("Apply Default"),statName:"ApplyDefault"}),o.callbacks().subscribe(this,function(){s.restoreFactoryDefaults(),window.lineToolPropertiesToolbar.onSourceChanged(t)}),e.push(o),n=$.Deferred(),a.templatesLoaded().then(function(){var t=a.getData(),e=[];0!==t.length&&e.push(new T),$.each(t,function(t,i){function o(t){return function(){var e=this.getTopLevelMenu();return e&&e.hide(),a.deleteAction(t),!0}}var n=new S({text:i,statName:"ApplyTemplate"});n.callbacks().subscribe(this,function(){a.loadTemplate(i)}),n.deleteButton={action:o(n.text)},e.push(n)}),n.resolve(e)}),r=new w(n),e.push(r),l},o.prototype._lineContextMenu=function(t){var e=[],n=this._chart,r=n.actions(),s=this;return new Promise(function(a){i.e(11,function(l){(function(l){var c,h,u,d,p,_=i(162).hasStylesPropertyPage
;if(n.readOnly())e.push(r.lineHide);else if(t.userEditEnabled()&&(l.enabled("alerts")&&!s.chart().onWidget()&&t.hasAlert.value()&&e.push(s._createEditAlertDrawingAction(t)),l.enabled("property_pages")&&_(t,n.model())&&e.push(r.format),e.push(r.paneObjectTree),l.enabled("charting_library_base")||e.push(s.createLineToolTemplateAction(t)),e.push(s.createVisualOrderAction(t),new T,r.lineHide,r.lineToggleLock),t.properties().clonable&&t.properties().clonable.value()&&(c=new S({text:$.t("Clone"),callbackContext:{target:t},shortcut:"Ctrl+Drag",doNotBindShortcut:!0,statName:"Clone"}),c.callbacks().subscribe(s,o.prototype.cloneLineTool.bind(s,t,!1)),e.push(c)),l.enabled("datasource_copypaste")&&!t.properties().blockCopying&&(h=new S({text:$.t("Copy"),shortcut:"Ctrl-C",statName:"Copy"}),h.callbacks().subscribe(null,function(){n.onAppClipboardCopy(t)}),e.push(h)),l.enabled("support_multicharts")&&(t.linkKey?e.push(r.lineUnlink):e.push(r.lineCopyToCharts)),e.push(r.lineRemove),t.additionalActions))for(e.push(new T),u=t.additionalActions(n.model()),d=0;d<u.length;d++)e.push(u[d]);p=x.createMenu(e),a(p)}).call(this,i(7))})})},o.prototype._tradingDrawingsContextMenu=function(t){return x.createMenu(t.contextMenuItems())},o.prototype._chartEventsContextMenu=function(t){var i,o,n,r=[];return e.enabled("property_pages")&&(i=this._chart,o=new S({text:$.t("Format..."),enabled:!0,statName:"Format"}),o.callbacks().subscribe(this,function(t){TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Events & Alerts")),i.showChartProperties()}),r.push(o)),n=new S({text:$.t("Hide Events on Chart"),enabled:!0,statName:"HideEvents"}),n.callbacks().subscribe(this,function(e){t.properties().visible.setValue(!1)}),r.push(n),x.createMenu(r)},o.prototype._createAlertToggleHorzLineLabelAction=function(t){var e=t.properties().line.visible,i=new S({checkable:!0,text:$.t("Extend Alert Line"),enabled:!0,checked:e.value(),statName:"ToggleExtendAlertLine"});return i.callbacks().subscribe(this,function(t){var i=t.checked,o=i?$.t("Show alert label line"):$.t("Hide alert label line");this._chart.model().setProperty(e,i,o)}),i.setEnabled(t.globalProperties().line.visible.value()),i},o.prototype._createShowGlobalAlertPropertiesLabelAction=function(t){var e=this.chart(),i=new S({text:$.t("Visual settings..."),statName:"VisualSettings"});return i.callbacks().subscribe(this,function(t){e.showChartProperties({selectAlertEvent:!0})}),i},o.prototype._createEditAlertDrawingAction=function(t){if(t.hasAlert.value()){var e=new S({text:$.t("Edit {0} Alert...").format(t.title()),statName:"EditAlert"});return e.callbacks().subscribe(null,function(){runOrSignIn(function(){t.editAlert()},{source:"Alert edit from pane context menu"})}),e}},o.prototype.cloneLineTool=function(t,e){return this._chart.model().cloneLineTool(t,e)},o.prototype.setPriceAxisSize=function(t,e){this._priceAxisWidget(t).setSize(e)},o.prototype.setPriceAxisVisible=function(t,e){this._priceAxisWidget(t).setVisible(e),this._cachedStatus=null},o.prototype.resetPriceAxisOptimalWidth=function(t){
this._priceAxisWidget(t).resetOptimalWidth(),this._cachedStatus=null},o.prototype.setSize=function(t){this.size&&this.size.equals(t)||(this.size=t,M(this.canvas,t),M(this.top_canvas,t),this.ctx=this.canvas.getContext("2d"),this.jqPane.width(t.w),this.jqPane.height(t.h),this._cachedStatus=null,this.jqRow.toggleClass("js-hidden",0===t.h))},o.prototype.dataSourceAtPoint=function(t,e){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,g,v=null,y=null;if(!this._state)return null;for(i=this._state.hitTestSources(),o=i.length;0<o--;)if(r=i[o],s=r.paneViews(this._state))for(a=s.length;0<a--;)(l=s[a].renderer(e))&&l.hitTest&&(c=l.hitTest(new n(t,e)))&&(h=y?y.result():0,c.result()>h&&(y=c,v=r));if(this.containsMainSeries()){for(u=this._chart.model().barsMarksSources(),o=0;o<u.length;++o)for(r=u[o],s=r.paneViews(),a=0;a<s.length;a++)if(l=s[a].renderer(e),d=l.hitTest(new n(t,e))){y=d,v=r;break}p=this._chart.model().activeStrategySource().value(),_=p&&p._strategyOrdersPaneView,_&&(f=_.renderer())&&(m=f.hitTest(new n(t,e)))&&(y=m,v=p)}return null===v&&(v=this.legendWidget.dataSourceAtPoint(t,e)),g=this._chart.model().brandingSource(),g&&(m=g.hitTest(new n(t,e)))&&(y=m,v=g),{source:v,hittest:y}},o.prototype.update=function(){this.lhsPriceAxisWidget.update(),this.rhsPriceAxisWidget.update(),this.legendWidget.update(),this.paneControls&&this.paneControls.update()},o.prototype.updateControls=function(){this.paneControls&&this.paneControls.update()},o.prototype.drawBackground=function(t,e){V(t,0,0,this.size.w,this.size.h,e)},o.prototype.drawGrid=function(t){var e,i,o=this._chart.model().gridSource(),n=o.paneViews(this._state),r=this._state.height(),s=this._state.width();for(e=0;e<n.length;e++)t.save(),i=n[e].renderer(r,s),i&&i.draw(t),t.restore()},o.prototype.drawWatermark=function(t){var e,i,o=this._chart.model().watermarkSource(),n=o.paneViews(this._state),r=this._state.height(),s=this._state.width();for(e=0;e<n.length;e++)t.save(),i=n[e].renderer(r,s),i&&i.draw(t),t.restore()},o.prototype.drawBranding=function(t){var e,i,o,n,r,s=this._chart.model().brandingSource();if(s)for(e=s.paneViews(this._state),i=this._state.height(),o=this._state.width(),n=0;n<e.length;n++)(r=e[n].renderer(i,o))&&(t.save(),r.draw(t),t.restore())},o.prototype.drawCrossHair=function(t){var e=this._chart.model().crossHairSource();e.visibleTrap&&(!e.visible&&C.lockTimeAxis().value()&&(e.setLockedPosition(this._state),e.updateAllViews()),this._drawSource(e,t))},o.prototype._drawSource=function(t,e){var i,o,n,r,s=t.paneViews(this._state);if(s)for(i=this._state.height(),o=this._state.width(),n=0;n<s.length;n++)(r=s[n].renderer(i,o))&&(e.save(),r.draw(e),e.restore())},o.prototype._drawSourceStrategyOrders=function(t,e){var i,o=t._strategyOrdersPaneView;o&&(i=o.renderer())&&(e.save(),i.draw(e),e.restore())},o.prototype._drawSourceBackground=function(t,e){var i,o,n,r,s=t.paneViews(this._state);if(s)for(i=this._state.height(),o=this._state.width(),n=0;n<s.length;n++)(r=s[n].renderer(i,o))&&r.drawBackground&&(e.save(),r.drawBackground(e),e.restore())},
o.prototype.drawActiveLineTool=function(t){var e,i,o=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];for(e=0;e<o.length;e++)(i=o[e])&&this._chart.model().paneForSource(i)===this._state&&this._drawSource(i,t)},o.prototype.disableDrawOnTop=function(t){return t&&t.hasOwnProperty("_metaInfo")&&"Volume@tv-basicstudies"===t._metaInfo.id},o.prototype.drawSources=function(t){var e,i,o,n,r=this._state.orderedSources(),s=this._state.model(),a=this._chart.model().selectedSource(),l=this._chart.model().hoveredSource(),c=s.crossHairSource(),h=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];for(this.disableDrawOnTop(a)&&(a=void 0),this.disableDrawOnTop(l)&&(l=void 0),e=this._chart.model().model().panes(),i=e.length-1;i>=0;i--)e[i].createDrawingsCaches();for(i=0;i<r.length;i++)this._drawSourceBackground(r[i],t);for(i=0;i<r.length;i++)(o=r[i])!==c&&o!==a&&o!==l&&-1===h.indexOf(o)&&this._drawSource(o,t);for(a&&-1===h.indexOf(a)&&-1!==r.indexOf(a)&&this._drawSource(a,t),l&&-1===h.indexOf(l)&&-1!==r.indexOf(l)&&this._drawSource(l,t),n=this._chart.model().activeStrategySource().value(),n&&this.containsMainSeries()&&this._drawSourceStrategyOrders(n,t),i=e.length-1;i>=0;i--)e[i].clearDrawingCaches()},o.prototype.recalculatePriceScale=function(){var t,e,i,o=this._state;for(o.recalculatePriceScale(o.m_rightPriceScale),o.recalculatePriceScale(o.m_leftPriceScale),t=o.dataSources(),e=0;e<t.length;++e)i=t[e],o.isOverlay(i)&&(i instanceof d||o.recalculatePriceScale(i.priceScale()),i.updateAllViews())},o.prototype.containsMainSeries=function(){return this._state.containsMainSeries()},o.prototype.drawBarsMarks=function(t,e){var i,o;this.containsMainSeries()&&!e&&(i=this._chart.model().barsMarksSources(),o=this,i.forEach(function(e){o._drawSource(e,t)}))},o.prototype._syncOverlays=function(){var t,e,i=this._state.orderedSources(),o={},n=this;$.each(i,function(){var t,e,i=this.paneViews(n._state);if(i)for(t=0;t<i.length;t++)e=i[t],e.uid&&(o[e.uid()]=e)});for(t in this._overlays)o[t]||(this._dv.remove(this._overlays[t]),this._overlays[t]=void 0);for(t in o)this._overlays[t]||(e=o[t].overlay(),this._dv.append(e),this._overlays[t]=e)},o.prototype.hardResetCanvas=function(){this.size&&(E(this.canvas,this.size),E(this.top_canvas,this.size),this.lhsPriceAxisWidget.hardResetCanvas(),this.rhsPriceAxisWidget.hardResetCanvas())},o.prototype.paint=function(t,e){if(t&&this._chart.model())if(this.lhsPriceAxisWidget.paint(t),this.rhsPriceAxisWidget.paint(t),t===I.FULL_UPDATE&&(this._cachedStatus=null),t===I.UPDATE_CURSOR_ONLY)this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx);else{var i=this.ctx;this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawBackground(i,this.backgroundColor()),this._state&&(this.recalculatePriceScale(),this.drawGrid(i),this.drawWatermark(i),this.drawSources(i),this.drawBarsMarks(i,e),
this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx),this.drawBranding(i))}},o.prototype.leftPriceAxisWidget=function(){return this.lhsPriceAxisWidget},o.prototype.rightPriceAxisWidget=function(){return this.rhsPriceAxisWidget},o.prototype._priceAxisWidget=function(t){return c.isLeft(t)?this.lhsPriceAxisWidget:this.rhsPriceAxisWidget},o.prototype.statusWidget=function(){return this.legendWidget},o.prototype.onScaleLeft=function(t){var e=t.callbackContext();-1===this._state.leftPriceScale().dataSources().indexOf(e)&&this.chart().model().move(e,this._state,this._state.leftPriceScale())},o.prototype.onScaleRight=function(t){var e=t.callbackContext();-1===this._state.rightPriceScale().dataSources().indexOf(e)&&this.chart().model().move(e,this._state,this._state.rightPriceScale())},o.prototype.onNoScale=function(t){var e=t.callbackContext();this._state.isOverlay(e)||this.chart().model().move(e,this._state,null)},o.prototype.onRiskReward=function(t){},o.prototype.createActionRiskReward=function(t){var e=new S({checkable:!1,text:$.t("Risk/Reward"),enabled:!0,statName:"RiskReward"});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onRiskReward),e},o.prototype.createActionScaleLeft=function(t){var e=new S({checkable:!0,text:$.t("Scale Left"),enabled:!0,statName:"ToggleScaleLeft"});return e.setCallbackContext(t),e.setChecked(-1!==this._state.leftPriceScale().dataSources().indexOf(t)),e.callbacks().subscribe(this,o.prototype.onScaleLeft),e},o.prototype.createActionScaleRight=function(t){var e=new S({checkable:!0,text:$.t("Scale Right"),enabled:!0,statName:"ToggleScaleRight"});return e.setCallbackContext(t),e.setChecked(-1!==this._state.rightPriceScale().dataSources().indexOf(t)),e.callbacks().subscribe(this,o.prototype.onScaleRight),e},o.prototype.createActionNoScale=function(t){var e=this._chart.model().paneForSource(t),i=e.actionNoScaleIsEnabled(t),n=new S({checkable:!0,text:$.t("Screen (No Scale)"),enabled:i,statName:"ToggleNoScale"});return n.setCallbackContext(t),n.setChecked(this._state.isOverlay(t)),n.callbacks().subscribe(this,o.prototype.onNoScale),n},o.prototype.createActionShowCountdown=function(t){var e=new S({checkable:!0,text:$.t("Show Countdown"),enabled:!0,statName:"ToggleShowCountdown"}),i=this._chart.model().mainSeries().properties();return e._binding=new v(e,i.showCountdown,this._chart.model(),e.text),e._binding.setValue(i.showCountdown.value()),e},o.prototype.createActionLockScale=function(t){var e,i;return t instanceof TradingView.Series?(e=new S({checkable:t.properties().lockScale.value(),text:$.t("Lock Scale"),enabled:!0,statName:"LockScale"}),i=function(e){this._undoModel.setLockScaleProperty(this._property,e.checked,t,this._undoText)},e._binding=new v(e,t.properties().lockScale,this._chart.model(),e.text,i),e):null},o.prototype.createActionMergeUp=function(t){if(!this._chart.model().model().isMergeUpAvailableForSource(t))return null;var e=new S({checkable:!1,text:$.t("Merge Up"),enabled:!0,statName:"MergeUp"});return e.setCallbackContext(t),
e.callbacks().subscribe(this,o.prototype.onMergeUp),e},o.prototype.onMergeUp=function(t){var e=t.callbackContext();this._chart.model().model().mergeSourceUp(e)},o.prototype.createActionUnmergeUp=function(t){if(!this._chart.model().model().isUnmergeAvailableForSource(t))return null;var e=new S({checkable:!1,text:$.t("Unmerge Up"),enabled:!0,statName:"UnmergeUp"});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onUnmergeUp),e},o.prototype.onUnmergeUp=function(t){var e=t.callbackContext();this._chart.model().model().unmergeSourceUp(e)},o.prototype.createActionMergeDown=function(t){if(!this._chart.model().model().isMergeDownAvailableForSource(t))return null;var e=new S({checkable:!1,text:$.t("Merge Down"),enabled:!0,statName:"MergeDown"});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onMergeDown),e},o.prototype.onMergeDown=function(t){var e=t.callbackContext();this._chart.model().model().mergeSourceDown(e)},o.prototype.createActionUnmergeDown=function(t){if(!this._chart.model().model().isUnmergeAvailableForSource(t))return null;var e=new S({checkable:!1,text:$.t("Unmerge Down"),enabled:!0,statName:"UnmergeDown"});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onUnmergeDown),e},o.prototype.onUnmergeDown=function(t){var e=t.callbackContext();this._chart.model().model().unmergeSourceDown(e)},o.prototype._mergeContentMenuItems=function(t){var e=[],i=this.createActionMergeUp(t);return i&&e.push(i),i=this.createActionUnmergeUp(t),i&&e.push(i),i=this.createActionMergeDown(t),i&&e.push(i),i=this.createActionUnmergeDown(t),i&&e.push(i),e},o.prototype.createActionShow=function(t){var e=new S({checkable:!0,text:$.t("Show"),enabled:!0,statName:"ToggleShow"});return e._binding=new v(e,t.properties().visible,this._chart.model(),e.text),e._binding.setValue(t.properties().visible.value()),e},o.prototype.createActionAddChildStudy=function(t){var e=new S({text:$.t("Apply Indicator on {0} ...").format(t.title(!0)),enabled:!0,statName:"ApplyIndicator"});return e.callbacks().subscribe(this,function(){var e,i,o=this._chart.showIndicators(t);o&&(e=function(){f("SOS","Apply SOS","Apply by RC menu")},i=this._chart.model().model().studyInserted(),i.subscribe(this,e),o.visibilityChanged.subscribe(this,function(t){t||i.unsubscribe(this,e)},!0))}),e},o.prototype.bringObjectForward=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().changeZOrder(e,1)},o.prototype.sendObjectToBack=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().sendToBack(e)},o.prototype.bringObjectToFront=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().bringToFront(e)},o.prototype.sendObjectBackward=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().changeZOrder(e,-1)},o.prototype.createVisualOrderAction=function(t){var e,i,n,r,s,a,l=new S({text:$.t("Visual Order"),statName:"VisualOrder"});return l.subActions||(l.subActions=[]),e=new S({text:$.t("Bring to Front"),statName:"BringToFront"}),
e.callbacks().subscribe(this,o.prototype.bringObjectToFront),l.subActions.push(e),i=new S({text:$.t("Send to Back"),statName:"SendToBack"}),i.callbacks().subscribe(this,o.prototype.sendObjectToBack),l.subActions.push(i),n=new S({text:$.t("Bring Forward"),statName:"BringForward"}),n.callbacks().subscribe(this,o.prototype.bringObjectForward),l.subActions.push(n),r=new S({text:$.t("Send Backward"),statName:"SendBackward"}),r.callbacks().subscribe(this,o.prototype.sendObjectBackward),l.subActions.push(r),s=this._chart.model().paneForSource(t),a=s.getZOrderMinMax(),i.setEnabled(!0),n.setEnabled(!0),r.setEnabled(!0),e.setEnabled(!0),t.zorder()===a.minZOrder&&(i.setEnabled(!1),r.setEnabled(!1)),t.zorder()===a.maxZOrder&&(n.setEnabled(!1),e.setEnabled(!1)),l},o.prototype.image=function(){var t={};return t.leftAxis=this.leftPriceAxisWidget().image(),t.rightAxis=this.rightPriceAxisWidget().image(),t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t},o.prototype._updateTooltip=function(t,e){if(!this._rafSet){var i=this;requestAnimationFrame(function(){i._updateTooltipImpl(t,e),i._rafSet=!1}),this._rafSet=!0}},o.prototype._updateTooltipImpl=function(t,e){function i(i){function n(){return TradingView.isMobile.any()?{left:t-o._tooltipSelector.outerWidth()-16,top:e-o._tooltipSelector.outerHeight()-16}:{left:t+16,top:e+16}}TradingView[r].getTooltipText&&(i=TradingView[r].getTooltipText(l)||i),o._tooltipSelector.html(i).removeClass("tooltip-selector-hidden").css(n())}var o,n,r,s,l,c;if(this._chart){for(o=this,n=this._chart.paneWidgets(),r=C.tool.value(),s=this._state.model(),l=s.lineBeingCreated(),c=n.length-1;c>=0;c--)n[c]._hideTooltip();this._isSelectBarModeEnabled()||(a.isStudyLineTool(r)&&!TradingView.isMobile.any()?i($.t("Click to set a point")):TradingView.isMobile.any()&&"LineToolBrush"!==r&&o.isLineTool(r)&&!o._chart.model().lineBeingCreated()?i($.t("1. Slide your finger to select location for first anchor<br>2. Tap anywhere to place the first anchor")):TradingView.isMobile.any()&&"LineToolBrush"!==r&&o.isLineTool(r)&&i($.t("1. Slide your finger to select location for next anchor<br>2. Tap anywhere to place the next anchor")))}},o.prototype._hideTooltip=function(){this._tooltipSelector.addClass("tooltip-selector-hidden")},o.prototype._updateCrosshairOnZoom=function(){var t,e;C.lockTimeAxis().value()&&(t=this._chart.model(),e=t.crossHairSource(),e.setPosition(e.index,e.price,this._state))},o.prototype._isSelectBarModeEnabled=function(){return this._chart.model().crossHairSource().selectBarMode().value()},t.exports=o}).call(e,i(7))},function(t,e,i){(function(e){"use strict";function o(t){var i,o,n,a,l,h=this,d=this._chartWidget=t.chartWidget;this.$parent=t.parent,this._dateRangesPopupList=[],this._goToPopupBtn=[],this._iterativeHide=[],this._timeFormatter=new r,this._currentRange=window.urlParams&&window.urlParams.range||"",this._$seriesControls=$(document.createElement("div")).attr("class","chart-controls-bar-buttons chart-series-controls").appendTo(t.parent),
this._$timezoneButton=$('<a class="apply-common-tooltip" title="'+$.t("Timezone")+'"><span class="chart-controls-clock"></span><span class="chart-controls-tz"></span></a>'),e.enabled("fundamental_widget")||this._$timezoneButton.appendTo(this._$seriesControls),!d.onWidget()&&e.enabled("timezone_menu")?c(h._$timezoneButton,function(){var t,e,i,o,n;if(d.updateActions(),t=[],!(e=d.actions())||!e.applyTimeZone||!e.applyTimeZone.subActions)return t;for(i=e.applyTimeZone.subActions,o=0;o<i.length;++o)n=i[o],t.push({action:n.enabled?n.executeCallback.bind(n):null,addClass:n.enabled?"":"special",disabled:!n.enabled,iconClass:n.checkable&&n.checked?"icon checked-icon":"unchecked-icon",svg:n.checkable&&n.checked?u:"",title:n.text});return t},{direction:"up",addClass:"context-menu",svg:!0,wrapIcon:!0}):this._$timezoneButton.addClass("disabled"),this._$timezoneClock=this._$timezoneButton.find(".chart-controls-clock"),this._$timezoneName=this._$timezoneButton.find(".chart-controls-tz"),d.onWidget()||e.enabled("charting_library_base")?this._$extendedHoursButton=null:(this._$extendedHoursButton=$(document.createElement("a")).text($.t("ext")).attr("title",$.t("The Extended Trading Hours feature is available only for intraday charts")).addClass("apply-common-tooltip").appendTo(this._$seriesControls),this._iterativeHide.push(this._$extendedHoursButton)),this._$percButton=$(document.createElement("a")).text("%").attr("title",$.t("Toggle Percentage")).addClass("apply-common-tooltip").appendTo(this._$seriesControls),e.enabled("fundamental_widget")&&(this._$percButton.css("display","inline-block"),urlParams.percentage&&this._$percButton.addClass("active")),this._iterativeHide.push(this._$percButton),this._$logButton=$(document.createElement("a")).text($.t("log")).attr("title",$.t("Toggle Log Scale")).addClass("apply-common-tooltip"),e.enabled("fundamental_widget")||this._$logButton.appendTo(this._$seriesControls),this._iterativeHide.push(this._$logButton),this._$autoScaleButton=$(document.createElement("a")).text($.t("auto",{context:"scale"})).attr("title",$.t("Toggle Auto Scale")).addClass("apply-common-tooltip"),e.enabled("fundamental_widget")||this._$autoScaleButton.appendTo(this._$seriesControls),this._iterativeHide.push(this._$autoScaleButton),i=null,e.enabled("main_series_scale_menu")&&!e.enabled("fundamental_widget")&&(i=$(document.createElement("a")).attr("title",$.t("Scales Properties")).addClass("apply-common-tooltip").appendTo(this._$seriesControls)),this._$fullscreenChartButton=$(document.createElement("a")).attr("title",$.t("Toggle Maximize Chart")).addClass("apply-common-tooltip").appendTo(this._$seriesControls),this._iterativeHide.push(this._$timezoneButton),o="http://www.w3.org/2000/svg",n=$(document.createElementNS(o,"svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"}),$(document.createElementNS(o,"desc")).text("SP").appendTo(n),$(document.createElementNS(o,"path")).attr({
d:"M 11.896733,5.4401 C 11.201602,5.2497118 10.287185,5.3844905 9.8529668,4.6739798 9.3680407,3.9899631 9.7713075,3.1150758 10.335646,2.6255445 10.81759,2.1397596 10.086625,1.2464141 9.5348331,1.5679918 9.0096065,2.0197899 8.3586515,2.5915907 7.6081884,2.2860159 6.8487054,2.0572252 6.6657258,1.2214292 6.6611579,0.52971682 6.6904416,-0.14270317 5.5547878,-0.19920111 5.3509206,0.33932112 5.3495604,1.0614071 5.216111,1.980668 4.4411277,2.2733721 3.718985,2.58432 3.0421913,2.0835985 2.5447076,1.6132218 2.019086,1.2075468 1.1733117,2.0525503 1.6258135,2.5522279 2.1291674,3.0522349 2.6067846,3.7947509 2.23627,4.5142319 1.9382627,5.2487851 1.0997484,5.3013165 0.42629601,5.3591295 -0.18586111,5.4121559 -0.1726988,6.614951 0.4382476,6.6606553 1.1701866,6.6354301 2.0901088,6.8653212 2.3114865,7.6677973 2.5690397,8.4182506 1.9757702,9.0009969 1.5707544,9.5375753 1.260194,10.111116 2.1887088,10.863746 2.6392394,10.30714 3.1282414,9.7691412 3.9518015,9.3917137 4.6315605,9.8249999 5.3287279,10.186762 5.2619381,11.018963 5.3869987,11.672161 5.5440075,12.215504 6.7794125,12.12358 6.6535582,11.446999 6.6654072,10.746236 6.9028479,9.8947057 7.6677558,9.6885901 8.4182253,9.4312024 9.000933,10.024446 9.5375381,10.429439 10.111007,10.739871 10.863873,9.8114259 10.307197,9.360908 9.7691358,8.8719351 9.3913098,8.0483184 9.8250144,7.3685614 10.18688,6.6714752 11.018948,6.7380091 11.672226,6.6131264 12.162952,6.4957229 11.998177,5.7860369 11.896733,5.4401 z M 5.999918,8.8061 C 4.4052236,8.8574703 3.0094365,7.3092614 3.2012542,5.7303585 3.3197775,4.2414555 4.7798203,3.0282413 6.2655218,3.2004993 7.7296227,3.3187202 8.9364572,4.7279379 8.805387,6.1941362 8.7186344,7.6148699 7.4347334,8.84471 5.999918,8.8061 z"}).appendTo(n),i&&i.append(n),a=$(document.createElementNS(o,"svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"}),a.get(0).setAttribute("viewBox","0 0 24 24"),$(document.createElementNS(o,"desc")).text("FS").appendTo(a),$(document.createElementNS(o,"path")).attr({d:"M0 0v9l3.5-3.5 4.5 4.5h2v-2l-4.5-4.5 3.5-3.5h-9zm15 0l3.5 3.5-4.5 4.5v2h2l4.5-4.5 3.5 3.5v-9h-9zm-7 14l-4.5 4.5-3.5-3.5v9h9l-3.5-3.5 4.5-4.5v-2h-2zm6 0v2l4.5 4.5-3.5 3.5h9v-9l-3.5 3.5-4.5-4.5h-2z"}).appendTo(a),this._$fullscreenChartButton.append(a),this._$percButton.on("click",function(t){var e,i,o,n;t.preventDefault(),e=d.model(),i=e.mainSeries(),o=i.priceScale(),n=o.properties(),i.properties().lockScale.value()||(e.beginUndoMacro($.t("Toggle Percentage")),n.log.value()&&e.setLogProperty(n.log,!1,o,$.t("Toggle Log Scale")),e.setPercentProperty(n.percentage,!n.percentage.value(),o,$.t("Toggle Percentage")),e.endUndoMacro())}),this._$logButton.on("click",function(t){var e,i,o,n;t.preventDefault(),e=d.model(),i=e.mainSeries(),o=i.priceScale(),n=o.properties(),i.properties().lockScale.value()||(e.beginUndoMacro($.t("Toggle Log Scale")),n.percentage.value()&&e.setPercentProperty(n.percentage,!1,o,$.t("Toggle Percentage")),e.setLogProperty(n.log,!n.log.value(),o,$.t("Toggle Log Scale")),e.endUndoMacro())}),
this._$autoScaleButton.on("click",function(t){var e,i,o,n;t.preventDefault(),e=d.model(),i=e.mainSeries(),o=i.priceScale(),n=o.properties(),e.beginUndoMacro($.t("Toggle Auto Scale")),n.autoScale.value()&&n.percentage.value()&&e.setPercentProperty(n.percentage,!1,o,$.t("Toggle Percentage")),e.setAutoScaleProperty(n.autoScale,!n.autoScale.value(),o,$.t("Toggle Auto Scale")),e.endUndoMacro()}),i&&c(i,function(){var t,e,i,o,n,r,a,l=d.paneWidgets();for(t=0;t<l.length;++t)if(e=l[t],e.containsMainSeries()){if(i=[],!(o=e.getDefaultPriceAxisWidget()))return i;for(n=o.getContextMenuActions(),r=0;r<n.length;++r)a=n[r],a instanceof s?i.push({separator:!0}):i.push({action:a.enabled?a.executeCallback.bind(a):null,addClass:a.enabled?"":"special",disabled:!a.enabled,iconClass:a.checkable&&a.checked?"icon checked-icon":"unchecked-icon",svg:a.checkable&&a.checked?u:"",title:a.text});return i}return[]},{direction:"up",addClass:"context-menu",reverse:!0,svg:!0,wrapIcon:!0}),this._$extendedHoursButton&&this._$extendedHoursButton.on("click",function(t){var e,i;t.preventDefault(),e=d.model(),i=e.mainSeries().properties().extendedHours,e.setProperty(i,!i.value(),"Extended Hours")}),this._$dateRangesWrap=$(document.createElement("div")).addClass("chart-controls-bar-buttons date-range-wrapper").appendTo(t.parent),this._$dateRangesBtn=$(document.createElement("a")).addClass("date-range-btn").text($.t("Date Range")).appendTo(this._$dateRangesWrap),this._$dateRanges=$(document.createElement("div")).addClass("date-range-list").appendTo(this._$dateRangesWrap),d.withModel(null,function(){var t=d.model(),i=t.mainSeries(),o=i.priceScale();this.updateScaleButtons(),i.priceScaleChanged.subscribe(this,this.updateScaleButtons),o.properties().autoScale.subscribe(this,this.updateScaleButtons),this.updateDateRangeButtons(),i.onStatusChanged().subscribe(this,this.updateDateRangeButtons),e.enabled("update_timeframes_set_on_symbol_resolve")&&i.onSymbolResolved().subscribe(this,this.updateDateRangeButtons),i.properties().lockScale.subscribe(this,this.updateDateRangeButtons),!TradingView.onWidget()&&e.enabled("go_to_date")&&(this.gotoDateButton(),i.onStatusChanged().subscribe(this,this.gotoDateButton)),this.updateExtendedHoursButton(),i.properties().extendedHours.subscribe(this,this.updateExtendedHoursButton),i.properties().interval.subscribe(this,this.updateExtendedHoursButton),t.model().mainSeries().onSymbolResolved().subscribe(null,this.updateTimezonesButton.bind(this)),t.model().properties().timezone.subscribe(null,this.updateTimezonesButton.bind(this))}.bind(this)),this.updateFullscreenChartButton(),l=this._chartWidget._chartWidgetCollection,l&&(l.layout.subscribe(this.updateFullscreenChartButton.bind(this)),l.maximizeCurrentChart.subscribe(this.updateFullscreenChartButton.bind(this)),this._$fullscreenChartButton.on("click",function(){l.activeChartWidget.setValue(d),l.maximizeCurrentChart.setValue(!l.maximizeCurrentChart.value())}),this.checkTimezonesButton(l.activeChartWidget.value()),l.activeChartWidget.subscribe(this.checkTimezonesButton.bind(this))),
d.onScroll().subscribe(this,this._resetCurrentRange),d.withModel(null,function(){d.model().model().onResetScales().subscribe(h,h._resetCurrentRange),d.model().mainSeries().onSymbolResolved().subscribe(h,h._resetCurrentRange),d.model().mainSeries().properties().extendedHours.subscribe(h,h._resetCurrentRange),d.model().mainSeries().onIntervalChanged().subscribe(null,function(t,e){e&&h._currentRange===e.timeframe||h._resetCurrentRange()})})}var n=i(501).showGoToDateDialog,r=i(174).TimeFormatter,s=i(73).ActionSeparator,a=i(499).parseTzOffset,l=i(103),c=l.bindPopupMenu,h=l.unbindPopupMenu,u=i(235);o.prototype._resetCurrentRange=function(){this._currentRange&&(this._$dateRanges.find(".date-range-preset-btn").removeClass("active"),this._currentRange=null)},o.prototype.updateScaleButtons=function(){var t=this._chartWidget.model().mainSeries(),e=t.priceScale().properties(),i=e.log.value(),o=e.percentage.value(),n=e.autoScale.value();this._$logButton.toggleClass("active",i),this._$percButton.toggleClass("active",o),this._$autoScaleButton.toggleClass("active",n)},o.prototype.updateDateRangeButtons=function(){var t,e,i,o,n,r,s=this._chartWidget,a=s.model().mainSeries().status();if(a!==TradingView.Series.STATUS_LOADING&&a!==TradingView.Series.STATUS_RESOLVING){if(t=s._dateRangeResolutions(),e=function(t,e){this._$dateRanges.find(".date-range-preset-btn").removeClass("active"),e.addClass("active"),this._currentRange=e.data("value"),s.model().loadRange(t)},this._dateRangesPopupList=[],t.length)for(this._$dateRanges.empty(),i=0;i<t.length;i++)o=t[i],n=$(document.createElement("a")).text(o.text).attr("title",o.description||o.text).addClass("date-range-preset-btn apply-common-tooltip").data("value",o.value),o.value===this._currentRange&&n.addClass("active"),r=e.bind(this,{val:o.value,res:o.targetResolution},n),n.appendTo(this._$dateRanges).click(r),this._dateRangesPopupList.push({title:o.description||o.text,action:r});this.updateTimeframePopupMenu()}},o.prototype.gotoDateButton=function(){var t,e;this._goToPopupBtn=[],this._chartWidget._dateRangeResolutions().length>0&&(t=$.t("Go to..."),e=function(){n(this._chartWidget.model())}.bind(this),$(document.createElement("a")).text(t).addClass("js-goto-date-btn apply-common-tooltip").attr("title","Alt+G").appendTo(this._$dateRanges).click(e),this._goToPopupBtn.push({title:t,action:e})),this.updateTimeframePopupMenu()},o.prototype.updateTimeframePopupMenu=function(){this._$dateRangesBtn.toggleClass("i-hidden",!(this._dateRangesPopupList.length||this._goToPopupBtn.length)),h(this._$dateRangesBtn),c(this._$dateRangesBtn,this._dateRangesPopupList.concat(this._goToPopupBtn),{direction:"up",addClass:"date-range-popupmenu"}),this.resizeUI()},o.prototype.updateTimezonesButton=function(){var t,e,i;null!==this._chartWidget.model().mainSeries().symbolInfo()&&(t=this._chartWidget.model().model().timezone(),"exchange"===t&&(e=this._chartWidget.model().mainSeries().symbolInfo().timezone)&&(t=e),i=a(t),this.tzOffset=i.offset,this._$timezoneName.text("("+i.string+")"),this.tickClock(),this.resizeUI())},
o.prototype.checkTimezonesButton=function(t){this._$timezoneButton.toggleClass("i-invisible",t!==this._chartWidget),this.resizeUI()},o.prototype.tickClock=function(){void 0!==this.tzOffset&&this._$timezoneClock.text(this._timeFormatter.format(new Date(Date.now()+this.tzOffset+1e3*ChartApiInstance.serverTimeOffset())))},o.prototype.updateExtendedHoursButton=function(){if(this._$extendedHoursButton){this._chartWidget.model().mainSeries().properties().extendedHours.value()?this._$extendedHoursButton.addClass("active"):this._$extendedHoursButton.removeClass("active"),this.resizeUI()}},o.prototype.updateFullscreenChartButton=function(){var t=this._chartWidget._chartWidgetCollection;if(!t||"s"===t.layout.value())return void this._$fullscreenChartButton.addClass("i-hidden");this._$fullscreenChartButton.removeClass("i-hidden"),this._$fullscreenChartButton.toggleClass("active",t.maximizeCurrentChart.value()),this.resizeUI()},o.prototype.updateUI=function(){this.updateScaleButtons(),this.resizeUI()},o.prototype.resizeUI=function(){var t,e,i,o,n,r,s;if(this._$seriesControls&&this._$dateRanges){for(this.$parent.addClass("i-measure"),t=this.$parent.width(),e=this._$dateRanges.width(),i=this._$dateRangesBtn.outerWidth(),o=0,this._$seriesControls.find("a").each(function(){var t=$(this);t.hasClass("i-hidden")||(o+=t.outerWidth())}),n=o,r=0;r<this._iterativeHide.length;r++)this._iterativeHide[r].hasClass("i-hidden")||(s=this._iterativeHide[r].outerWidth(),this._iterativeHide[r].toggleClass("i-compact",t-i<n),n-=s);this._$dateRangesWrap.toggleClass("i-compact",e>t-o),this.$parent.removeClass("i-measure")}},t.exports=o}).call(e,i(7))},,function(t,e,i){(function(e,o,n){"use strict";function r(t,i,o){this.HIGHLIGHT_STUDY_NUM_FLICKS=2,this.SCROLL_TOLERANCE=10,this._BASIC_STUDIES_PACKAGE_NAME="tv-basicstudies",this._CUSTOM_STUDIES_PACKAGE_NAME="Script$USER",this._PUBLISHED_STUDIES_PACKAGE_NAME="Script$PUB",this._STANDARD_STUDIES_PACKAGE_NAME="Script$STD",this._SCRIPTING_PACKAGE_NAME="tv-scripting",this._FUNDAMENTAL_PACKAGE_NAME="Script$EDGR",this._BASIC_STUDIES_PAGE_NAME=e.enabled("plain_studymarket")?$.t("Technical Analysis"):$.t("Built-ins"),this._FUNDAMENTALS_PAGE_NAME=$.t("Fundamentals"),this._dialog=null,this._selectedStudy=null,this._keyDownListener=null,this._chartWidgetCollection=t,this._chart=t.activeChartWidget.value(),this._options=$.extend({},this.DEFAULT_OPTIONS,o||{}),this.concretizeOptions(),this._user=i,this.setup()}var s,a,l,c=i(21).assert,h=i(43),u=i(207).SidebarCustomScroll,d=i(45),p=i(96).createDialog,_=(i(123).createConfirmDialog,i(203).createNoticeDialog),f=i(478).createSearchControl,m=i(28),g=i(63),v=i(263),y=i(104),b=i(368).AddSymbolCheckbox,S=i(180),w=i(158),T=i(365).KeyboardListener,x=i(369),C=i(13).getLogger("Chart.StudyMarket");i(636),i(650),i(200),
s='<div class="tv-insert-indicator-dialog__body js-dialog__scroll-wrap"><div class="tv-insert-indicator-dialog__left-panel">{{^minimized}}<div id="js-search-placeholder"></div>{{/minimized}}<div class="tv-insert-indicator-dialog__left-panel-content-wrapper js-left-panel-wrapper"><div class="tv-insert-indicator-dialog__tabs-viewport js-tabs-viewport"><div class="tv-insert-indicator-dialog__tabs-container js-tabs-container"></div></div></div></div><div class="tv-insert-indicator-dialog__right-panel js-right-panel">{{#minimized}}{{#withSearch}}<div id="js-search-placeholder"></div>{{/withSearch}}{{/minimized}}<div class="tv-insert-indicator-dialog__pages js-pages"></div></div></div>',a='<div class="tv-insert-indicator-dialog__tabs-group"><div class="tv-insert-indicator-dialog__tab tv-insert-indicator-dialog__tab--group-head js-tab js-tab-head">{{title}}<span class="tv-caret"></span></div><div class="tv-insert-indicator-dialog__tabs"></div></div>',l='<div class="js-study-item tv-insert-study-item {{^withFavorites}}i-without-stars{{/withFavorites}}">{{#withFavorites}}<div class="tv-insert-study-item__favorite-icon js-favorite-icon"><span class="tv-insert-study-item__star tv-insert-study-item__star--filled">'+i(328)+'</span><span class="tv-insert-study-item__star tv-insert-study-item__star--empty">'+i(329)+'</span></div>{{/withFavorites}}<div class="tv-insert-study-item__title"><div class="tv-insert-study-item__title-text" title="{{titleTooltip}}">{{{title}}}</div></div></div>',r.prototype.setup=function(){this._initialized=!1,this._loadMore=null,this._$economyTabInput=null,this._$symbolSearchPopup=null,this._market=null,this._studies=null,this._packagesWithTabNames={},this._pages={},this._tabs={},this._subProductIds={},this.favsChanged=new o,this.visibilityChanged=new o,this._previousInviteOnlyStudiesIds=[],this.studiesReady=new $.Deferred,this.marketPagesReady=new $.Deferred,this._pubSearchCount=[0,0,0],this._pubSearchCanLoad=[!0,!0,!0],this._pubSearchEntries=[],this._pubSearchCache=[],this._pubSearchDfd=null,this._pubSearchPageShown=!1,this._w_market_tabs=null,this._w_technical_tabs=null},r.prototype.init=function(){if(this._initialized)return void this.getStudyInfo();this.setupMarketInfo(),this.getStudyInfo(),this.setUser(this._user),this.prepareLayout(),this.attachHandlers(),this._initialized=!0},r.prototype.DEFAULT_OPTIONS={onWidget:!1,hideMarketPages:!1,selectBasicPage:!0,minimized:!1,searchKeywords:{earning:RegExp("EPS"),earnings:RegExp("EPS"),"trailing twelve months":RegExp("TTM")}},r.prototype._PAGE_KEY="studyMarket.page",r.prototype._ECONOMY_TAB=$.t("Economy & Symbols"),r.prototype._PUB_SEARCH_ENTRIES_ON_PAGE=20,r.prototype.loadFavorites=function(){},r.prototype.concretizeOptions=function(){e.enabled("study_market_minimized")&&(this._options.hideMarketPages=!0,this._options.selectBasicPage=!0,this._options.minimized=!0),this._options.onWidget&&(this._options.hideMarketPages=!0)},r.prototype.setupMarketInfo=function(){},r.prototype.getStudyInfo=function(){this._chart.withModel(this,function(){
this.setupStudyInfo()})},r.prototype.setupStudyInfo=function(){var t=this._chartWidgetCollection.activeChartWidget.value().model().studiesMetaData();t.length;this._studies={},t=t.filter(function(t){return!this.isHidedStudy(t)},this),t.forEach(function(t){var e,i=this.getStudyPackageName(t.id);!(this._options.minimized&&i!==this._BASIC_STUDIES_PACKAGE_NAME||this._options.onWidget&&d.isScriptStrategy(t))&&(e=this.resolvePackageName(i),c(void 0!==e,"Cannot resolve packageName "+i),this._studies[e]=this._studies[e]||[],this._studies[e].push(t))}.bind(this),this),this.studiesReady.resolve()},r.prototype.setupAddonsInfo=function(){var t,e,i,o,n,r=[],s={};for(t in this._market.products)e=this._market.products[t],pro.hasPackage(t)&&e.subproduct_ids&&e.subproduct_ids[0]&&!e.disabled&&(i=e.subproduct_ids[0],o=i.split("$")[1],s[o]=t,r.push(ScriptLib.requestPineAddons(o)));return n=this,Promise.all(r).then(function(t){return t.reduce(function(t,e){var i=e[0].scriptIdPart.split("_")[0],o=[];return n._fillScriptsMetainfo(e,o),t[s[i]]=o,t},{})})},r.prototype.resolvePackageName=function(t){return t in this._subProductIds?this._subProductIds[t]:t},r.prototype.setUser=function(t){window.is_authenticated?this.setupUserData(t):this.setAnonymous()},r.prototype.setupUserData=function(t){this._user=t,this.loadFavorites(),this.updateMarketPages()},r.prototype.setAnonymous=function(){this.setupUserData(null),this.favsChanged.fire()},r.prototype.isHidedStudy=function(t){var e;return this._options.onWidget&&(e="IchimokuCloud@tv-basicstudies"===t.id),!!t.is_hidden_study&&!e},r._breakpointDevice="phone-vertical",r.prototype._switchPagesContainer=function(t,e){this._options.minimized||(t===r._breakpointDevice?this._w_pages.detach().appendTo(this._widget.find(".js-left-panel-wrapper")):e===r._breakpointDevice&&this._w_pages.detach().appendTo(this._widget.find(".js-right-panel")))},r.prototype.prepareLayout=function(){this._widget=$(n.render(s,{withSearch:e.enabled("study_dialog_search_control"),minimized:this._options.minimized})),this._w_tabs=this._widget.find(".js-tabs-container"),this._w_pages=this._widget.find(".js-pages"),this._loadMore=null,this.preparePages(),!this._options.selectBasicPage||this._options.fundamentalsOnly||v.device===r._breakpointDevice&&!this._options.minimized?this._options.fundamentalsOnly&&(v.device!==r._breakpointDevice||this._options.minimized)?this.selectPage(this._FUNDAMENTALS_PAGE_NAME):v.device===r._breakpointDevice&&this.selectPage(""):this.selectPage(this._BASIC_STUDIES_PAGE_NAME),this._scroll=new u(this._widget.find(".js-tabs-viewport"),this._w_tabs,{showBottomShadow:!1});var t='<div class="tv-dialog__section tv-dialog__section--title js-dialog__drag tv-insert-indicator-dialog__title-container js-title-container"><div class="tv-insert-indicator-dialog__back-button js-back-button js-dialog__no-drag">'+i(332)+'</div><div class="js-title-text tv-dialog__title tv-insert-indicator-dialog__title-text">{{{ title }}}</div></div>';this._dialog=p({title:" ",titleTemplate:t,contentWrapTemplate:this._widget,
addClass:"tv-insert-indicator-dialog "+(this._options.minimized?"i-minimized":""),width:this._options.minimized?490:842,height:580,withScroll:!1,focusFirstControl:!1,closeOnClickAtOtherDialogs:!1,isClickOutFn:function(t){var e=x.instance();if(e)return e.isEventOut(t);if(this._$symbolSearchPopup)return this._$symbolSearchPopup[0]!==t.target&&!this._$symbolSearchPopup[0].contains(t.target)&&void 0}.bind(this)}),this._dialog.on("afterClose",this._onDialogClosed.bind(this)),this._dialog.$title.find(".js-back-button").on(Modernizr.touch?"touchend":"click",this.selectPage.bind(this,"")),v.on("changeDevice",function(t,e){t===r._breakpointDevice&&this.currentPage()&&this.currentPage().hasClass("js-marketplace-page")&&this.selectPage(""),t===r._breakpointDevice&&(this._scroll.scrollToStart(),this._updateDialogTitleText()),this._switchPagesContainer(t,e)}.bind(this)),this._switchPagesContainer(v.device,""),this._showHideBackButton(),this.hide()},r.prototype.scrollHandler=function(){var t,e;if(!this._loadMore)return void this._w_pages.off("scroll.loadMoreOnEnd");t=$.map(this._w_pages.children(":visible"),function(t){return $(t).outerHeight(!0)}).reduce(function(t,e){return t+e},0),e=this._widget.find(".js-right-panel").height(),this._w_pages.scrollTop()>t-e-this.SCROLL_TOLERANCE&&(this._w_pages.off("scroll.loadMoreOnEnd"),this._loadMore())},r.prototype._updateDialogTitleText=function(){var t,e,i;if(this._dialog){if(t=""!==this._currentPageTitle,e=v.device!==r._breakpointDevice,!t||e||this._options.minimized)return void this._dialog.setTitleText(this._dialogTitleText);i=this.currentPage(),this._dialog.setTitleText(i.data("fullTitle"))}},r.prototype.currentPage=function(){return this._pages[this._currentPageTitle]},r.prototype.preparePages=function(){this.addSearchPage(),e.enabled("items_favoriting")&&this.addFavoritesPage(),this._options.fundamentalsOnly||this.prepareBasicPage(),this._options.fundamentalsOnly||this.addEconomyPage()},r.prototype.addEconomyPage=function(){var t,e,i=this.addPage(this._ECONOMY_TAB,{withoutTopPadding:!0,noFlex:!0}),o=f({withoutControls:!0,placeholder:$.t("Symbol"),addClass:"tv-insert-indicator-dialog__economy"});this._$economyTabInput=o.$input,t=new b({labelRight:$.t("Overlay the main chart")}),this._symbolSearch=y.bindToInput(this._$economyTabInput,{keepFocus:!0,clearAfterAccept:!0,callback:function(e){var i=this._chartWidgetCollection.activeChartWidget.value();i&&i.addSymbol(e,t.checked)}.bind(this),onPopupOpen:function(t){this._$symbolSearchPopup=t,this._$symbolSearchPopup.css("z-index",this._dialog.zIndex)}.bind(this),onPopupClose:function(){this._$symbolSearchPopup=null}.bind(this)}),i.append(o.$control),e=$('<div class="tv-insert-indicator-dialog__economy-content">'),e.append(t.$el),i.append(e)},r.prototype.addFavoritesPage=function(){this.addPage("Favorites",{localizedTitle:$.t("Favorites")}),this.loadFavorites(),this.updateFavorites()},r.prototype.addInvitesOnlyPage=function(){this.addPage("invitesOnly",{localizedTitle:$.t("Invite-Only Scripts")})},r.prototype.prepareBasicPage=function(){
var t=this.addPage(this._BASIC_STUDIES_PAGE_NAME,{packageName:this._BASIC_STUDIES_PACKAGE_NAME,technical:!e.enabled("plain_studymarket")});this._basicPage=t,this.studiesReady.done(function(){this.resetBasicPage()}.bind(this))},r.prototype._applyGlobalFilter=function(t){return this._parentSource&&(t=t.filter(d.canBeChild)),t},r.prototype._applyStrategiesFilter=function(t){var e=this._parentSource?"not_strategies":"none";return"not_strategies"!==e&&"only_strategies"!==e||(t=t.filter(function(t){var i=d.isScriptStrategy(t);return"not_strategies"===e?!i:i})),t},r.prototype.resetBasicPage=function(){var t,e,i=this.getPage(this._BASIC_STUDIES_PAGE_NAME);this._studies&&(t=this._studies[this._BASIC_STUDIES_PACKAGE_NAME]||[],e=this._studies[this._STANDARD_STUDIES_PACKAGE_NAME]||[],t=t.concat(e),t=this._applyStrategiesFilter(t),t=this._applyGlobalFilter(t),this.preparePageStudies(i,t))},r.prototype.resetAllPages=function(){this.resetBasicPage(),this.resetCustomScriptPage(),this.resetPublishedScriptPage(),this.resetInvitesOnlyPage()},r.prototype._fillScriptsMetainfo=function(t,e){var i,o,n;for(i=0;i<t.length;i++)o=t[i],n=d.createMetaInfoStub(o,"1"),TradingView.merge(n,d.parseIdString(n.id)),e.push(n)},r.prototype.resetCustomScriptPage=function(){},r.prototype.resetPublishedScriptPage=function(){},r.prototype._createItemsList=function(){return $('<div class="tv-insert-indicator-dialog__items-list">')},r.prototype._createSubGroupItem=function(t){return $('<div class="tv-insert-study-item tv-insert-study-item--subgroup-header">').text(t)},r.prototype._createItemsGroup=function(t,e,i){var o,n=this._createItemsList();return this.fillStudies(n,t,i),o=$('<div class="tv-insert-indicator-dialog__subgroup">'),e.length&&o.append(this._createSubGroupItem(e)),o.append(n),o},r.prototype.addSearchPage=function(){var t,e,i,o=f({addClass:"tv-insert-indicator-dialog__search-control"});this._tabs.search=o.$control.data("title","search"),this._pages.search=$('<div class="tv-insert-indicator-dialog__page tv-insert-indicator-dialog__page--search">').data("title","search"),this._pages.search.data("fullTitle",$.t("Search")),t=null,this._search_value=null,this._search_input=o.$input,o.inputChangedDelegate.subscribe(null,function(){t&&clearTimeout(t),t=setTimeout(function(){t=null,this.search(this._search_input.val()),this._w_pages.scrollTop(0)}.bind(this),200)}.bind(this)),this._search_input.focus(function(){this.search(this._search_input.val())}.bind(this)),e=this._widget.find("#js-search-placeholder"),e.length&&e.parent()[0].replaceChild(this._tabs.search[0],e[0]),this._w_pages.prepend(this._pages.search),i={},i[w.ENTER]=this._onEnterKeyHandler.bind(this),i[w.UP_ARROW]=this._onUpKeyHandler.bind(this),i[w.DOWN_ARROW]=this._onDownKeyHandler.bind(this),this._keyDownListener=new T("keydown"),this._keyDownListener.regHandlers(i),this._keyDownListener.watchOn(this._search_input[0])},r.prototype._onEnterKeyHandler=function(){null!==this._selectedStudy&&this.insertThisStudy(this._selectedStudy)},r.prototype._onUpKeyHandler=function(){
if(null!==this._selectedStudy){var t=this._selectedStudy.prev(".js-study-item");t&&t.length&&(this._selectedStudy.removeClass("tv-insert-study-item--selected"),t.addClass("tv-insert-study-item--selected"),this._selectedStudy=t,this._ensureSelectedItemIsVisible())}},r.prototype._onDownKeyHandler=function(){if(null===this._selectedStudy)this._selectedStudy=this.currentPage().find(".js-study-item").first(),this._selectedStudy.addClass("tv-insert-study-item--selected");else{var t=this._selectedStudy.next(".js-study-item");t&&t.length&&(this._selectedStudy.removeClass("tv-insert-study-item--selected"),t.addClass("tv-insert-study-item--selected"),this._selectedStudy=t,this._ensureSelectedItemIsVisible())}},r.prototype._ensureSelectedItemIsVisible=function(){var t,e,i,o,n,r;null!==this._selectedStudy&&(t=this._w_pages,e=this._selectedStudy[0].getBoundingClientRect(),i=t[0].getBoundingClientRect(),o=this.currentPage()[0].getBoundingClientRect().top,n=e.top-o,r=3,e.top-i.top<0?t.scrollTop(n-r):e.bottom-i.bottom>0&&t.scrollTop(n-i.height+e.height+r))},r.prototype.search=function(t,i,o){function n(t,e,i,o,n,r){t.push(e),t[t.length-1].matchPriority=o,n&&(t[t.length-1].matchIndex=i.match(r).index)}var r,s,a,l,c,h=this;(this._search_value!==t||i)&&(r=this._pages.search,s=[],a=function(t){return t.replace(/[!-\/[-^{-}]/g,"\\$&")},""!==t&&(l=t.split("").map(function(t,e){var i=a(t);return 0!==e&&(i="[/\\s-]"+i),"("+i+")"}).join("(.*?)")+"(.*)",s.push({fullMatch:RegExp("("+a(t)+")","i"),re:RegExp("^"+l,"i"),reserveRe:RegExp(l,"i"),fuzzyHighlight:!0}),t.toLowerCase()in this.DEFAULT_OPTIONS.searchKeywords&&s.push({fullMatch:this.DEFAULT_OPTIONS.searchKeywords[t.toLowerCase()],re:this.DEFAULT_OPTIONS.searchKeywords[t.toLowerCase()],fuzzyHighlight:!1})),this._search_value=t,c=$.Deferred(),h._currentAsyncSearchDfd=c,e.enabled("plain_studymarket")?c.resolve([]):PublishedScript.suggest(t).done(function(t){var e=[];t&&t.results;c.resolve(e)}).fail(function(){c.resolve([])}),c.done(function(e){var i,o,a,l,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C;if(h._currentAsyncSearchDfd===c){for(i=Object.keys(h._studies),i.indexOf(h._PUBLISHED_STUDIES_PACKAGE_NAME)<0&&i.push(h._PUBLISHED_STUDIES_PACKAGE_NAME),i.sort(),o=[h._BASIC_STUDIES_PACKAGE_NAME,h._STANDARD_STUDIES_PACKAGE_NAME,h._PUBLISHED_STUDIES_PACKAGE_NAME,h._CUSTOM_STUDIES_PACKAGE_NAME],a=o.length;a--;)l=o[a],-1!==(u=i.indexOf(l))&&(i.splice(u,1),i.unshift(l));for(d={},p=0,_=0;_<i.length;_++){for(f=i[_],m=[],g=h._studies[f],f===h._PUBLISHED_STUDIES_PACKAGE_NAME&&(g=e),a=0;a<g.length;a++)if(v=g[a],s.length)for(y=0;y<s.length;y++)b=s[y].re,b.lastIndex=0,S=s[y].fullMatch,w=v.shortDescription,w&&w.toLowerCase()===t.toLowerCase()?n(m,v,w,3,!0,S):w&&S.test(w)?n(m,v,w,2,!0,S):(w=v.description_localized||v.description||v.scriptName,S.test(w)?n(m,v,w,1,!0,S):b.test(w)&&n(m,v,w,0,!0,b));else m.push(v);if(m=h._applyGlobalFilter(m),m.length){switch(T=f,f){case h._BASIC_STUDIES_PACKAGE_NAME:case h._STANDARD_STUDIES_PACKAGE_NAME:T=h._BASIC_STUDIES_PAGE_NAME;break;case h._CUSTOM_STUDIES_PACKAGE_NAME:T=$.t("My Scripts")
;break;case h._PUBLISHED_STUDIES_PACKAGE_NAME:T=$.t("Public Library");break;default:f in h._packagesWithTabNames&&(T=h._packagesWithTabNames[T])}T in d||(d[T]=[]),d[T]=d[T].concat(m),p+=m.length}}for(r.html(""),x=Object.keys(d),a=0;a<x.length;++a)T=x[a],m=d[T],s.length&&Array.prototype.sort.call(m,function(t,e){if(t.matchPriority<e.matchPriority)return 1;if(t.matchPriority>e.matchPriority)return-1;if(t.matchPriority===e.matchPriority)switch(t.matchIndex){case void 0:return 0;default:return t.matchIndex>e.matchIndex?1:t.matchIndex<e.matchIndex?-1:0}}),C=this._createItemsGroup(m,this._options.minimized?"":$.t(T),s),r.append(C),this._selectedStudy=null;0===p&&r.append('<p class="tv-insert-indicator-dialog__not-found-message">'+$.t("No indicators matched your criteria.")+"</p>")}}.bind(this))),o||this.selectPage("search")},r.prototype.updateSearchPage=function(){var t=this._search_input.val();this.search(t,!0,!0)},r.prototype.updateMarketPages=function(){},r.prototype.preparePageStudies=function(t,e,i,o){if(t){o||(e=this.sortStudies(e)),t.empty();var n=this._createItemsList();this.fillStudies(n,e,null),t.append(n)}},r.prototype.addPage=function(t,e){var i,o,n,r,s,a;return e=$.extend({},e),i=e.localizedTitle||$.t(t),o=t.toLowerCase(),n=$('<div class="tv-insert-indicator-dialog__page">').data("title",o),r=$('<div class="tv-insert-indicator-dialog__tab js-tab"></div>').text(i).data("title",o).attr("title",i),s=e.technical?$.t("Technical Analysis")+": ":"",n.data("fullTitle",s+i),r.toggleClass("tv-insert-indicator-dialog__tab--beta",!!e.beta),e.packageName&&(this._packagesWithTabNames[e.packageName]=t),this._pages[o]=n,this._tabs[o]=r,e.withoutTopPadding&&n.addClass("tv-insert-indicator-dialog__page--without-top-padding"),e.noFlex&&n.addClass("tv-insert-indicator-dialog__page--no-flex"),e.technical||e.market?(a=e.technical?this._getOrCreateTechnicalTab():this._getOrCreateMarketTab(),a.find(".tv-insert-indicator-dialog__tabs").append(r),e.market&&n.addClass("js-marketplace-page")):this._w_market_tabs?r.insertBefore(this._w_market_tabs):this._w_tabs.append(r),this._w_pages.append(n),n.toggleClass("i-hidden",o!==this._currentPageTitle),n},r.prototype._createGroupTab=function(t,e){var i=$(n.render(a,{title:t}));return i.find(".js-tab-head").on("click",function(){this._expandCollapseTabs(i,e)}.bind(this)),this._expandCollapseTabs(i,e,g.getBool(e,!0),!0),i.data("settings-open-key",e),this._w_tabs.append(i),i},r.prototype._getOrCreateMarketTab=function(){return this._w_market_tabs||(this._w_market_tabs=this._createGroupTab($.t("Marketplace Add-ons"),"studyMarket.marketTabIsOpen"),this._w_market_tabs.addClass("tv-insert-indicator-dialog__tabs-group--marketplace")),this._w_market_tabs},r.prototype._getOrCreateTechnicalTab=function(){return this._w_technical_tabs||(this._w_technical_tabs=this._createGroupTab($.t("Technical Analysis"),"studyMarket.technicalTabIsOpen")),this._w_technical_tabs},r.prototype._onDialogClosed=function(){null!==this._selectedStudy&&this._selectedStudy.removeClass("tv-insert-study-item--selected"),
this._selectedStudy=null,this.visibilityChanged.fire(!1),S.removeListener("StudyMarket")},r.prototype.hide=function(){this._dialog.close()},r.prototype.show=function(t){var i,o;this.init(),i=!1,o=t instanceof TradingView.Study&&t||null,o!==this._parentSource&&(this._parentSource=o,this._dialogTitleText=this._parentSource?$.t("Apply Indicator on {0}").format(this._parentSource.title(!0)):$.t("Indicators"),i=!0),this._updateDialogTitleText(),this._widget.on("keyup.hideDialogStudy",function(t){t.which===w.ESC&&(this._widget.unbind("keyup.hideDialogStudy"),this.hide())}.bind(this)),this._clearInput(),this.loadFavorites(),i&&this.resetAllPages(),this._scroll.scrollTo(0),this.visibilityChanged.fire(!0),this.focusAddSymbolInput(this._currentPageTitle),S.registerListener("StudyMarket",function(t){return!t.ctrlKey&&(47!==t.which&&(t.which&&t.which===w.ENTER?(t.target===this._search_input.get(0)&&this._insertStudyByShortDescription(),!0):!!t.charCode&&(!(!t.which||t.which<=32)&&(!/^(input|textarea)$/i.test(t.target.tagName)&&(t.preventDefault(),!!(TradingView.onWidget()||this._options.minimized&&!e.enabled("study_dialog_search_control"))||(this._search_input.focus(),this._search_input[0].value=String.fromCharCode(t.charCode),!0))))))}.bind(this)),this._dialog.open()},r.prototype.isVisible=function(){return!!this._initialized&&this._widget.is(":visible")},r.prototype.getPage=function(t){return t=t.toLowerCase(),this._pages[t]},r.prototype.focusAddSymbolInput=function(t){t===this._ECONOMY_TAB.toLowerCase()&&this._$economyTabInput&&this._$economyTabInput.focus()},r.prototype._showHideBackButton=function(){if(this._dialog&&!this._options.minimized){var t=""!==this._currentPageTitle;this._dialog.$el.find(".js-title-container").toggleClass("i-with-back-button",t)}},r.prototype.selectPage=function(t){var e,i,o,n,r,s;if(t=t.toLowerCase(),this.focusAddSymbolInput(t),this._currentPageTitle!==t)if(""===t||t in this._pages&&t in this._tabs&&("favorites"!==t||this.hasVisibleFavorites())){for(e in this._pages)if(i=t===e,o=this._pages[e],o.toggleClass("i-hidden",!i),this._tabs[e].toggleClass("i-active",i),i){if(o.trigger("show-page"),n=this._tabs[e].parents(".tv-insert-indicator-dialog__tabs-group"),0===n.length)continue;r=n.find(".js-tab-head"),this._expandCollapseTabs(n,r.data("settings-open-key"),!0,!0)}this._currentPageTitle=t,this._w_pages.scrollTop(0),g.setValue(this._PAGE_KEY,t),this._selectedStudy=null,s=""!==this._currentPageTitle,this._widget.find(".js-tabs-viewport").toggleClass("i-active",!s),this._w_pages.toggleClass("i-active",s),this._showHideBackButton(),s||this._search_input.blur(),this._updateDialogTitleText()}else this.selectPage(this._BASIC_STUDIES_PAGE_NAME)},r.prototype.attachHandlers=function(){var t=Modernizr.touch?"touchend":"click",i=this;Modernizr.touch&&this._w_pages.on("touchstart",".js-study-item",function(t){i._touchStart=$.extend({},t.originalEvent.touches[0])}),this._w_tabs.on("click",".js-tab",this._onTabClicked.bind(this)),
e.enabled("items_favoriting")&&this._w_pages.on(t,".js-favorite-icon",this.toggleItem.bind(this)),this._w_pages.on(t,".js-study-item",function(t){var e;i._touchStart&&(e=i._w_pages.find(".tv-insert-study-item")[0].clientHeight,Math.abs(i._touchStart.screenY-t.originalEvent.changedTouches[0].screenY)>e)||i.insertThisStudy($(t.target).closest(".js-study-item"))})},r.prototype._onTabClicked=function(t){var e=$(t.currentTarget).data("title");e&&"search"!==e&&this.selectPage(e),t.stopPropagation()},r.prototype._expandCollapseTabs=function(t,e,i,o){var n,r=t.hasClass("i-dropped");if(void 0===i)i=!t.hasClass("i-dropped");else if(r===i&&!o)return;if(n=t.find(".tv-insert-indicator-dialog__tabs"),t.toggleClass("i-dropped",!!i),o)return void n.toggleClass("i-hidden",!i);n.removeClass("i-hidden"),n.velocity(i?"slideDown":"slideUp",{duration:m.dur/2,complete:function(){g.setValue(e,i),this._scroll.updateScroll()}.bind(this)})},r.prototype.toggleItem=function(t){var e=$(t.target).closest(".js-study-item").data("study");return this.toggleFavorite(e.id),this.toggleEverywhere(e.id),!1},r.prototype.toggleEverywhere=function(t){var e=this,i=this.isFavorite(t);this._w_pages.find(".js-study-item").filter(function(i,o){var n=$(o).data("study");return!!n&&e.favsModel.favId(n.id)===e.favsModel.favId(t)}).find(".js-favorite-icon").toggleClass("i-starred",i).attr("title",this.favTitle(i))},r.prototype.toggleFavorite=function(t){this.favsModel.favorite(t)},r.prototype.agreeOnFavorite=function(t){},r.prototype.isFavorite=function(t){},r.prototype._getInviteOnlyStudies=function(){return new Promise(function(t,e){t([])})},r.prototype.resetInvitesOnlyPage=function(){var t=this;t._tabs.invitesonly&&(t._previousInviteOnlyStudiesIds&&0!==t._previousInviteOnlyStudiesIds.length?t._tabs.invitesonly.show():t._tabs.invitesonly.hide()),t._getInviteOnlyStudies().then(function(e){t._previousInviteOnlyStudies=e,t.preparePageStudies(t._pages.invitesonly,e),t._tabs.invitesonly&&(e&&0!==e.length?t._tabs.invitesonly.show():t._tabs.invitesonly.hide())},function(){t.preparePageStudies(t._pages.invitesonly,[]),t._tabs.invitesonly&&t._tabs.invitesonly.hide()})},r.prototype.updateFavorites=function(){var t,e,i,o,n,s,a,l,c,h,u,p,_;if(this._w_pages){if(t=this,e=this.getVisibleFavorites(),i=function(){"favorites"===t._currentPageTitle&&t.selectPage(v.device===r._breakpointDevice?"":t._BASIC_STUDIES_PAGE_NAME),t._w_pages.find(".js-favorite-icon").removeClass("i-starred"),t._tabs&&t._tabs.favorites&&t._tabs.favorites.hide()},t._tabs.favorites&&0===e.length)return void i();for(o=$.Deferred(),n=[],s=[],a=0;a<e.length;a++)if(l=e[a],(c=this.getStudyPackageName(l))!==t._PUBLISHED_STUDIES_PACKAGE_NAME){for(h=this._studies[c]||[],u=0;u<h.length;u++)if(p=t.favsModel.favId(d.cutFullId(h[u].id)),_=t.favsModel.favId(l),p===_){n.push(h[u]);break}}else s.push(l);s.length&&!this._options.minimized||o.resolve(n),o.done(function(t){0===t.length?i():this._tabs.favorites.show(),t=this._applyStrategiesFilter(t),this.preparePageStudies(this._pages.favorites,t),
this._w_pages.find(".js-study-item").find(".js-favorite-icon").removeClass("i-starred"),e.forEach(this.toggleEverywhere,this)}.bind(this)),n&&0!==n.length&&this._tabs.favorites.show()}},r.prototype.hasVisibleFavorites=function(){return!!this.getVisibleFavorites().length},r.prototype.getVisibleFavorites=function(){return[]},r.prototype.checkExcludePackageStudies=function(t){return t.filter(function(t){var e=this.getStudyPackageName(t);return e===this._PUBLISHED_STUDIES_PACKAGE_NAME||!!(this._studies&&this._studies[e]&&$.grep(this._studies[e],function(e){return e.id.indexOf(t)>=0}).length>0)&&(e===this._BASIC_STUDIES_PACKAGE_NAME||e===this._STANDARD_STUDIES_PACKAGE_NAME||e===this._CUSTOM_STUDIES_PACKAGE_NAME||e===this._SCRIPTING_PACKAGE_NAME||e===this._FUNDAMENTAL_PACKAGE_NAME||pro.hasPackage(e)&&e in this._studies)},this)},r.prototype.sortStudies=function(t){return t.sort(function(t,e){return t=t.scriptName||t.description_localized||t.description,e=e.scriptName||e.description_localized||e.description,t>e?1:t<e?-1:0})},r.prototype.fillStudies=function(t,e,i){var o;t.empty(),e.forEach(function(e){e?o=this.createStudyListItem(e,i):(o=document.createElement("div"),o.className="placeholder"),t.append(o)},this)},r.prototype.createStudyListItem=function(t,i){var o,r,s,a,c,h,u,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E,V=t.description_localized||$.t(t.scriptName||t.description||" ",{context:"study"}),D=this.isFavorite(t.id),O=[];if(i&&V)for(o=[],i instanceof RegExp?o.push({re:i,fuzzyHighlight:!1}):$.isArray(i)&&(o=i),r=0;r<o.length;r++)if(s=o[r].fullMatch,a=o[r].reserveRe,c=o[r].re,s.lastIndex=0,c.lastIndex=0,h=s.exec(V),h?o[r].fuzzyHighlight=!1:(h=c.exec(V),!h&&a&&(h=a.exec(V)),o[r].fuzzyHighlight=!0),h)if(o[r].fuzzyHighlight)for(u=h.index,p=1;p<h.length;p++)_=h[p].length,p%2&&(O[u]=!0),u+=_;else for(f=0;f<h[0].length;f++)O[h.index+f]=!0;return m=TradingView.clean(V,!0),g=m.replace(/./g,function(t,e){if("<"===t?t="&lt;":"&"===t?t="&amp;":'"'===t&&(t="&quot;"),O[e]){if(" "===t||"-"===t||"/"===t)return O[e+1]=!0,t;t='<span class="i-match">'+t+"</span>"}return t}),v=!!t.pine,y=this.getStudyPackageName(t.id),b=v&&y===this._PUBLISHED_STUDIES_PACKAGE_NAME,S=v&&y===this._CUSTOM_STUDIES_PACKAGE_NAME,w=v&&(y===this._STANDARD_STUDIES_PACKAGE_NAME||y===this._FUNDAMENTAL_PACKAGE_NAME),T=v&&[TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH,TVScript.Access.ACCESS_CLOSED_NO_AUTH].indexOf(t.pine.access)>=0,x=v&&TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH===t.pine.access,C=v&&x&&void 0!==t.pine.userHaveAccess,P=v&&t.pine.userHaveAccess,L=!!t.TVScriptSourceCode,I=!1,k=v&&!w&&!T&&(S||b||L||D&&!I),A={closed:$.t("Invite-only script. Contact the author for more information."),open:$.t("Invite-only script. You have been granted access.")},M=$(n.render(l,{publishedOrUserScript:S||b,title:g,titleTooltip:TradingView.strip_tags(m),isStrategy:d.isScriptStrategy(t),isInviteOnly:x,showAccessIcon:C,accessIconClass:P?"tv-insert-study-item__green-lock-icon":"tv-insert-study-item__red-lock-icon",accessTooltip:P?A.open:A.closed,author:t.author&&t.author.username,
likes:t.agreeCount?t.agreeCount+" "+$.t("like",{plural:"likes",count:t.agreeCount}):"",showMoreButton:!!t.imageUrl,deleteButton:!t.imageUrl&&S,withFavorites:e.enabled("items_favoriting")&&!this._options.minimized})),k||M.find(".js-show-source-btn").removeClass("js-show-source-btn").addClass("i-empty"),M.data("study",t),void 0!==t.isCustomIndicator&&M.addClass("custom-indicator"),e.enabled("items_favoriting")&&(E=M.find(".js-favorite-icon"),E.toggleClass("i-starred",!!D),E.attr("title",this.favTitle(!!D))),e.enabled("graying_disabled_tools_enabled")&&ChartApiInstance.studiesAccessController.isToolGrayed(t.description)&&M.addClass("i-grayed"),M},r.prototype.favTitle=function(t){return t?$.t("Remove from favorites"):$.t("Add to favorites")},r.prototype.insertThisStudy=function(t){if(!t.hasClass("placeholder")){var i=t.data("study");return e.enabled("graying_disabled_tools_enabled")&&ChartApiInstance.studiesAccessController.isToolGrayed(i.description)?void h.emit("onGrayedObjectClicked",{type:"study",name:i.description}):(t.highlight(this.HIGHLIGHT_STUDY_NUM_FLICKS),this.insertStudy(i),!1)}},r.prototype.insertStudy=function(t){var e,i,o=this._chartWidgetCollection.activeChartWidget.value();o&&(e=o.insertStudyStub(t.description),i=d.replaceWithFullStudyMetaInfoAsync(o.model().studiesMetaData(),t),i.done(function(t){var i;if(o.removeStudyStub(e.id())){if(this._parentSource&&!d.canBeChild(t))return i=_({type:"modal",title:$.t("Oops!"),content:$.t("This indicator cannot be applied to another indicator")}),void i.open();o.insertStudyOrShowDialog(t,this._parentSource),this._is_on_chart=!0}}.bind(this)),i.fail(function(t){C.logError("Error: "+t),e.setStatus(t)}))},r.prototype.onLoginStateChange=function(t){t||this.setUser(window.user),PublishedScript.cleanCache(),this.resetAllPages(),this.setup(),this.init()},r.prototype.getStudyList=function(t){function e(t){i.push(t)}var i,o;if(!this.studiesReady.isResolved())return[];i=[];for(o in this._studies)(o===this._BASIC_STUDIES_PACKAGE_NAME||pro.hasPackage(o))&&(this._studies[o].forEach(e),t&&i.push({separator:!0}));return t&&i.splice(i.length-1,1),i},r.prototype.getStudyPackageName=function(t){var e,i,o,n,r,s;if(t)return e=t.split("@"),(i=1===e.length)||(o=d.getPackageName(t))===this._SCRIPTING_PACKAGE_NAME?(n=e[0],i||/^(Strategy)?Script\$/.test(n)?(r=n.indexOf("_"),-1!==r?(o=n.substring(0,r),s=o.indexOf("Script$")>=0?o:"Script$"+o,pro.getSuperProduct(s)||s):/USER;/.test(n)?this._CUSTOM_STUDIES_PACKAGE_NAME:/PUB;/.test(n)?this._PUBLISHED_STUDIES_PACKAGE_NAME:/STD;/.test(n)?this._STANDARD_STUDIES_PACKAGE_NAME:n):o):o},r.prototype.selectSearchPage=function(){this.selectPage("search"),this._clearInput()},r.prototype._insertStudyByShortDescription=function(){var t,e,i,o=this._search_value;for(o=o.trim(),t=this._studies[this._BASIC_STUDIES_PACKAGE_NAME],e=0;e<t.length;e++)if(i=t[e],i.shortDescription&&i.shortDescription.toUpperCase()===o.toUpperCase()){this.insertStudy(i);break}},r.prototype._clearInput=function(){this._search_input.val(""),
"search"===this._currentPageTitle&&this._search_input.val("").trigger("input").focus()},r.prototype._getScriptType=function(){return 0},r.prototype._pubSearchEntryAlreadyLoaded=function(t){var e=t.scriptIdPart.split(";")[1];return!(this._pubSearchCache.indexOf(e)<0)||(this._pubSearchCache.push(e),!1)},r.prototype._addPubSearchResult=function(t,e){t.length&&(t.forEach(function(t){this._pubSearchEntryAlreadyLoaded(t)||(this._pubSearchEntries.push(t),this._pubSearchCount[t.scriptType]++)},this),0===e&&(this._pubSearchCount[0]+=t.length),this._pubSearchEntries.sort(function(t,e){return e.agreeCount-t.agreeCount}))},r.prototype._getPublicLibraryRequestParams=function(t){var e=this._pubSearchCount[t],i=this._PUB_SEARCH_ENTRIES_ON_PAGE;return e<this._PUB_SEARCH_ENTRIES_ON_PAGE&&(i=this._PUB_SEARCH_ENTRIES_ON_PAGE-e),{offset:e,count:i,type:t}},t.exports=r}).call(e,i(7),i(20),i(54))},,,function(t,e,i){(function(e){"use strict";function o(t,e){u.invalidateStudyTemplatesList(),u.removeStudyTemplate(t,e)}function n(t){this._options=t||{},this._chartWidgetCollection=this._options.chartWidgetCollection,this._SAVE_AS_TITLE=$.t("Save Indicator Template As..."),this._list=[],this._$wrapper=null,this._favoredList=null,this._loaded=!1,this._onFirstLoad=new e,this.onFavoriteListResize=new e,loginStateChange.subscribe(this,this.onLoginStateChange)}var r=i(474).FavoredList,s=i(204),a=s.SaveRenameDialog,l=s.CheckboxField,c=s.AutocompleteField,h=i(123).createConfirmDialog,u=i(161),d=i(48).trackEvent;n.prototype.onLoginStateChange=function(){u.invalidateStudyTemplatesList(),this.refreshFavoriteDropdownMenu()},n.prototype.appendMenuButtonTo=function(t){t&&(this._$wrapper=t,this._generateFavoriteList())},n.prototype.refreshStudyTemplateList=function(t){var e=this;u.getStudyTemplatesList(function(i){e._list=i||[],"function"==typeof t&&t()})},n.prototype._generateFavoriteList=function(){var t=this;this._favoredList=new r("StudyTemplates",t._listPreparedForFavorite(),{addClass:"study-template-widget",popupAddClass:"study-template-popup",notShowActive:!0,svg:!1,popupSpacing:this._options.popupSpacing,notShowQuicks:this._options.notShowQuicks,tooltip:$.t("Study Templates"),addTooltipClass:"apply-common-tooltip"}),t.refreshFavoriteDropdownMenu(),this._favoredList.element().appendTo(this._$wrapper),this._favoredList.onSelect().subscribe(t,function(t){t!==this._SAVE_AS_TITLE&&this.applyStudyTemplate(t)}),this._favoredList.onSelect().subscribe(t,function(t){t===this._SAVE_AS_TITLE&&this.showSaveAsDialog()}),this._favoredList.onResize().subscribe(t._chartWidgetCollection,t._chartWidgetCollection.updateLayout),this._favoredList.onResize().subscribe(this.onFavoriteListResize,this.onFavoriteListResize.fire),this._favoredList.onOpen().subscribe(t,function(){t.refreshFavoriteDropdownMenu()})},n.prototype._listPreparedForFavorite=function(t){var e,o,n,r,s;return t=t||this._list,e=this,o=this.plainList("default"),n=this.plainList("custom"),r=[{id:e._SAVE_AS_TITLE,title:e._SAVE_AS_TITLE,addClass:"special",toQuickButtonStyle:{display:"none"}},{separator:!0}],
s=function(t,o){return $.map(t,function(t){var n={id:t,title:$.t(t),svg:$(i(330)).attr({width:13,height:13}),favoriteButton:{icon:{},title:t,addClass:"apply-common-tooltip"}};return o&&(n.drop=function(){this.deleteStudyTemplate(t)}.bind(e)),n})},n.length&&(r=r.concat(s(n,!0)).concat([{separator:!0}])),r=r.concat(s(o))},n.prototype.applyStudyTemplate=function(t){function e(e){d("GUI","Load Study Template"),i.model().model().restoreStudyTemplate(JSON.parse(e.content),t),i.updateSeriesControlUI()}var i=this._chartWidgetCollection.activeChartWidget.value();TVSettings.setValue("defaultStudyTemplate",t),u.getStudyTemplateContent(t,e)},n.prototype.showSaveAsDialog=function(){var t=this,e=this._chartWidgetCollection.activeChartWidget.value(),i=function(i,o){var n,r,s,a,l,c;i=TradingView.clean(i),n=JSON.stringify(e.model().model().studyTemplate(o)),r={name:i,content:n},s=t.plainList().includes(i),a=function(){var e=function(e){e.error||(TVSettings.setValue("defaultStudyTemplate",i),u.invalidateStudyTemplatesList(),t.refreshFavoriteDropdownMenu())};u.saveStudyTemplate(r,e)},s?(l=$.t("Study Template '{0}' already exists. Do you really want to replace it?").format(i),c=h({type:"modal",content:l}),c.on("action:yes",function(t){a(),t.close()}),c.open()):a()};runOrSignIn(function(){var o="text",n="bool";t.refreshStudyTemplateList(function(){new a({fields:[new c({name:o,label:$.t("Template name")+":",error:$.t("Please enter template name"),source:t.list(),valueField:"name",textField:"name",maxLength:64}),new l({name:n,label:$.t("Save Interval"),hint:$.t('When selecting this checkbox the study template will set "__interval__" interval on a chart',{interval:e.model().model().mainSeries().interval()})})],title:$.t("Save Indicator Template As")}).show().then(function(t){i(t[o],t[n])})})},{source:"Study templates save as",sourceMeta:"Chart"})},n.prototype.refreshFavoriteDropdownMenu=function(){var t=this,e=this._favoredList;e&&t.refreshStudyTemplateList(function(){e.reload(t._listPreparedForFavorite()),e.element().hasClass("active")&&(e.element().trigger("click"),e.openMenu())})},n.prototype.deleteStudyTemplate=function(t){var e=this,i=$.t("Do you really want to delete Study Template '{0}' ?").format(t);runOrSignIn(function(){var n=h({type:"modal",content:i});n.on("action:yes",function(i){e._favoredList.removeById(t),i.actionLoader("yes","start"),o(t,function(){setTimeout(function(){e.refreshFavoriteDropdownMenu(),i.actionLoader("yes","stop"),i.close()},0)})}),n.open()},{source:"Study templates delete"})},n.prototype.container=function(){return this._favoredList?this._favoredList.element():null},n.prototype.list=function(){return this._list},n.prototype.plainList=function(t){return"default"===t?$.map(jQuery.grep(this._list,function(t){return!!t.is_default}),function(t){return t.name}):"custom"===t?$.map(jQuery.grep(this._list,function(t){return!t.is_default}),function(t){return t.name}):$.map(this._list,function(t){return t.name})},t.exports=n}).call(e,i(20))},function(t,e,i){"use strict";var o=i(7)
;t.exports.displayedExchangesFilter=function(t){return o.enabled("symbol_search_limited_exchanges")&&(t=t.filter(function(t){return!("bitcoin"===t.flag||t.hideInSymbolSearch)})),t},t.exports.sortExchangesListByFlagIfNeeded=function(t){return t}},function(t,e,i){(function(e){"use strict";function o(t,e){this.chart=t,this._properties=t.properties().scalesProperties,this.contextMenu=null,this._disableContextMenu=!!e,this.jqRow=$(document.createElement("tr")),this.jqLhsTimeAxisStub=$(document.createElement("td")),this.jqLhsTimeAxisStub.addClass("chart-markup-table"),this.jqLhsTimeAxisStub.appendTo(this.jqRow),this.jqLhsStub=$("<div>"),this.jqLhsStub.css("width","100%"),this.jqLhsStub.css("height","100%"),this.jqLhsStub.css("position","relative"),this.jqLhsStub.css("overflow","hidden"),this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub),this.lhsCanvas=f(this.jqLhsStub,new m(16,16)),$(this.lhsCanvas).css("position","absolute"),$(this.lhsCanvas).css("z-order","2"),$(this.lhsCanvas).css("left",0),$(this.lhsCanvas).css("top",0),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("time-axis"),this.jqCell.height(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=f(this._dv,new m(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=f(this._dv,new m(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this.jqRhsTimeAxisStub=$(document.createElement("td")),this.jqRhsTimeAxisStub.addClass("chart-markup-table"),this.jqRhsTimeAxisStub.appendTo(this.jqRow),this.jqRhsStub=$("<div>"),this.jqRhsStub.css("width","100%"),this.jqRhsStub.css("height","100%"),this.jqRhsStub.css("position","relative"),this.jqRhsStub.css("overflow","hidden"),this.jqRhsStub.appendTo(this.jqRhsTimeAxisStub),this.rhsCanvas=f(this.jqRhsStub,new m(16,16)),$(this.rhsCanvas).css("position","absolute"),$(this.rhsCanvas).css("z-order","2"),$(this.rhsCanvas).css("left",0),$(this.rhsCanvas).css("top",0),this.rhsCtx=this.rhsCanvas.getContext("2d"),this.restoreDefaultCursor(),this.update(),this._minVisibleSpan=b.MINUTE_SPAN,g(this.jqCell,this,!0),this.updatePriceScalesVisibility()}var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b;i(629),n=i(269),r=i(3).LineDataSource,s=i(218),a=i(73),l=a.ActionSeparator,c=i(131),h=i(37),u=i(171),d=u.resizeCanvas,p=u.hardResizeCanvas,_=u.clearRect,f=u.addCanvasTo,m=u.Size,g=i(144).setMouseEventHandler,v=i(48).trackEvent,y=i(231).makeFont,b=i(318),o.prototype._BORDER_SIZE=1,o.prototype._OFFSET_SIZE=1,o.prototype._TICK_LENGTH=3,o.prototype.backgroundColor=function(){
return this.chart.properties().paneProperties.background.value()},o.prototype.lineColor=function(){return this._properties.lineColor.value()},o.prototype.textColor=function(){return this._properties.textColor.value()},o.prototype.fontSize=function(){return this._properties.fontSize.value()},o.prototype.baseFont=function(){return y(this.fontSize(),"Arial","")},o.prototype.baseBoldFont=function(){return y(this.fontSize(),"Arial","bold")},o.prototype.rendererOptions=function(){var t,e;return this._rendererOptions||(this._rendererOptions={borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new s}),t=this._rendererOptions,t.fontSize!==this.fontSize()&&(e=this.fontSize(),t.fontSize=e,t.font=this.baseFont(),t.paddingTop=Math.ceil(Math.max(e/4.5-t.tickLength/2,0)),t.paddingBottom=Math.ceil(e/4.5),t.paddingHorizontal=Math.ceil(e/3),t.baselineOffset=Math.round(this.fontSize()/10),t.widthCache.reset()),this._rendererOptions},o.prototype.updatePriceScalesVisibility=function(){var t=this.chart.properties().scalesProperties;t.showLeftScale.value()?this.jqLhsTimeAxisStub.css("display","table-cell"):this.jqLhsTimeAxisStub.css("display","none"),t.showRightScale.value()?this.jqRhsTimeAxisStub.css("display","table-cell"):this.jqRhsTimeAxisStub.css("display","none")},o.prototype.mouseDownEvent=function(t){if(this._mousedown||!e.enabled("chart_zoom"))return!0;this._mousedown=!0;var i=this.chart.model();i.timeScale().isEmpty()||(this.setCursor("ew-resize"),i.startScaleTime(t.localX))},o.prototype.mouseDownOutsideEvent=function(t){var e=this.chart.model();!e.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,e.endScaleTime(),this.restoreDefaultCursor())},o.prototype.pressedMouseMoveEvent=function(t){var e,i,o=this.chart.model();o.timeScale().isEmpty()||(e=!1,i=(new Date).valueOf(),this._lastScrollScaleTime&&i-this._lastScrollScaleTime<100&&(e=!0),e||(o.scaleTimeTo(t.localX),this._lastScrollScaleTime=i))},o.prototype.mouseUpEvent=function(t){this._mousedown=!1;var e=this.chart.model();e.timeScale().isEmpty()||(e.endScaleTime(),this.restoreDefaultCursor())},o.prototype.contextMenuEvent=function(t,i){!this._disableContextMenu&&e.enabled("scales_context_menu")&&this._createContextMenu().show(t)},o.prototype._createContextMenu=function(){return c.createMenu(this.getContextMenuActions(),{statName:"TimeScaleContextMenu"})},o.prototype.getContextMenuActions=function(){var t,i,o=this.chart;return o.model().mainSeries().createSessStudy(),o.updateActions(),t=o.actions(),i=e.enabled("charting_library_base")?[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks]:[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks,t.extendedHours],e.enabled("timezone_menu")||i.splice(2,1),e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_timezone_sessions")&&t.tmzProperties&&i.push(new l,t.tmzProperties),i},o.prototype.mouseClickEvent=function(t){},o.prototype.mouseDoubleClickEvent=function(t){v("GUI","Double click time scale"),this.chart.model().resetTimeScale()},
o.prototype.optimalHeight=function(){var t=this.rendererOptions();return Math.ceil(t.offsetSize+t.borderSize+t.tickLength+t.fontSize+t.paddingTop+t.paddingBottom)},o.prototype.setSize=function(t,e,i){this.size&&this.size.equals(t)||(this.lhsStubSize=e,d(this.lhsCanvas,e),this.jqLhsTimeAxisStub.width(e.w),this.jqLhsTimeAxisStub.height(e.h),this.rhsStubSize=i,d(this.rhsCanvas,i),this.jqRhsTimeAxisStub.width(i.w),this.jqRhsTimeAxisStub.height(i.h),this.size=t,d(this.canvas,t),d(this.top_canvas,t),this.lhsCanvas.getContext("2d"),this.rhsCanvas.getContext("2d"),this.canvas.getContext("2d"),this.top_canvas.getContext("2d"),this.jqCell.width(t.w),this.jqCell.height(t.h))},o.prototype._spanIndex=function(t){for(var e=[b.MINUTE_SPAN,b.HOUR_SPAN,b.DAY_SPAN,b.MONTH_SPAN,b.YEAR_SPAN],i=e.length-1;i>0;){if(e[i]<=t)return i;i--}return i},o.prototype._spanOffset=function(t,e){if(e<t)throw Error("actual span cuold not be less then base");return this._spanIndex(e)-this._spanIndex(t)},o.prototype.update=function(){var t,e;this.chart.model()&&(t=this.chart.model().timeScale().marks())&&(e=this,this._minVisibleSpan=b.YEAR_SPAN,$.each(t,function(){e._minVisibleSpan=Math.min(this.span,e._minVisibleSpan)}))},o.prototype._hightlightBackground=function(t,e){var i,o,n,r,s=this.chart.model(),a=s.timeScale(),l=e[0].index,c=e[0].index;for(i=1;i<e.length;i++)l=Math.min(l,e[i].index),c=Math.max(c,e[i].index);o=a.indexToCoordinate(l),n=a.indexToCoordinate(c),r="rgba(109, 158, 235, 0.3)",_(t,o,1,n-o,this.size.h-1,r)},o.prototype.drawBackground=function(t){var e,i,o,n,s;if(_(t,0,0,this.size.w,this.size.h,this.backgroundColor()),e=this.chart.model()){if(i=e.timeScale(),(o=e.model().selectedSource())&&o instanceof r&&!i.isEmpty()){if(n=o.axisPoints(),0===n.length)return;this._hightlightBackground(t,n)}s=e.model().crossHairSource(),s.startMeasurePoint()&&this._hightlightBackground(t,s.measurePoints())}},o.prototype.drawBorder=function(t){t.save(),t.fillStyle=this.lineColor(),t.fillRect(-.5,.5,this.size.w+.5,this._BORDER_SIZE),t.restore()},o.prototype.drawStubs=function(){var t,e=this._BORDER_SIZE,i=2*this._BORDER_SIZE,o=this.lhsCtx;_(o,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor()),o.fillStyle=this.lineColor(),o.fillRect(this.lhsStubSize.w-i-.5,.5,i,e),o.fillRect(this.lhsStubSize.w-i-.5,-.5,e,e),t=this.rhsCtx,_(t,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor()),t.fillStyle=this.lineColor(),t.fillRect(-.5,.5,i,e),t.fillRect(.5,-.5,e,e)},o.prototype.drawTickMarks=function(t){var e,i,o,n,r,s,a,l,c,h,u,d=this.chart.model().timeScale().marks();if(d&&0!==d.length){for(e=d.reduce(function(t,e){return t.span>e.span?t:e},d[0]).span,e>30&&e<40&&(e=30),t.save(),t.strokeStyle=this.lineColor(),i=this.rendererOptions(),o=i.borderSize+i.tickLength+i.paddingTop+i.fontSize-i.baselineOffset,t.textAlign="center",t.translate(.5,.5),t.fillStyle=this.lineColor(),t.beginPath(),n=d.length;n--;)t.rect(d[n].coord,i.borderSize,1,i.tickLength);for(t.fill(),t.fillStyle=this.textColor(),r={},s=this.baseFont(),a=this.baseBoldFont(),
n=0;n<d.length;n++)l=d[n].span>=e?a:s,c=r[l]||[],c.push(d[n]),r[l]=c;for(h in r)for(t.setFont(h),u=r[h],n=0;n<u.length;n++)t.fillText(u[n].label,u[n].coord,o);t.restore()}},o.prototype.drawBackLabels=function(t){var e,i,o,n,r,s,a,l;for(t.save(),e=this.chart.model().dataSources(),i=this.chart.model(),o=i.sourceBeingMoved()||i.lineBeingEdited()||i.lineBeingCreated(),n=this.rendererOptions(),r=0;r<e.length;r++)if((s=e[r])!==this.chart.model().crossHairSource()&&s!==o&&s.timeAxisViews&&(a=s.timeAxisViews()))for(l=0;l<a.length;l++)a[l].renderer().draw(t,n);t.restore()},o.prototype.drawCrossHairLabel=function(t){var e,i,o,n,r;if(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),e=this.chart.model(),i=e.sourceBeingMoved()||e.lineBeingEdited()||e.lineBeingCreated(),o=this.rendererOptions(),i){if(t.save(),i.timeAxisViews&&(n=i.timeAxisViews()))for(r=0;r<n.length;r++)n[r].renderer().draw(t,o);return void t.restore()}if(t.save(),n=this.chart.model().crossHairSource().timeAxisView())for(r=0;r<n.length;r++)n[r].renderer().draw(t,o);t.restore()},n.prototype.hardResetCanvas=function(){this.size&&(p(this.canvas,this.size),p(this.top_canvas,this.size))},o.prototype.paint=function(t){if(0!==t)if(t===h.UPDATE_CURSOR_ONLY)this.drawCrossHairLabel(this.top_ctx);else{var e=this.ctx;this.drawBackground(e),this.drawBorder(e),this.drawStubs(),this.chart.model()&&(this.drawTickMarks(e),this.drawBackLabels(e),this.drawCrossHairLabel(this.top_ctx))}},o.prototype.setStubVisible=function(t,e){var i=n.isLeft(t)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;e?i.css("display","table-cell"):i.css("display","none")},o.prototype.restoreDefaultCursor=function(){this.setCursor("")},o.prototype.setCursor=function(t){var e="";"grabbing"!==t&&"ew-resize"!==t||(e="time-axis--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),e&&this.jqCell.addClass(e),this._currentCursorClassName=e,this.jqCell.css("cursor"))},o.prototype.image=function(){var t={};return t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t.lhsStub={},t.lhsStub.content=this.lhsCanvas.toDataURL(),t.lhsStub.contentWidth=this.lhsStubSize.w,t.lhsStub.contentHeight=this.lhsStubSize.h,t.rhsStub={},t.rhsStub.content=this.rhsCanvas.toDataURL(),t.rhsStub.contentWidth=this.rhsStubSize.w,t.rhsStub.contentHeight=this.rhsStubSize.h,t},t.exports=o}).call(e,i(7))},function(t,e,i){(function(e){"use strict";function o(t,i,o,n){this._chartWidgetCollection=t,this._chartSaverInstance=i,this._chartApiInstance=o,this._saveLoad=n,this._proxyWatchListChangedDelegate=null,this._activeChangedChangedDelegate=new e,this._chartWidgetCollection.activeChartWidget.subscribe(function(){this._activeChangedChangedDelegate.fire()}.bind(this))}var n=i(97),r=i(748),s=i(308).layouts,a=i(43),l=i(131),c=i(320).closeAllDialogs,h=i(44),u=i(398),d=i(161),p=i(13),_=i(203).createNoticeDialog,f=i(123).createConfirmDialog,m=i(473);o.prototype.subscribe=function(t,e){a.subscribe(t,e)},
o.prototype.unsubscribe=function(t,e){a.unsubscribe(t,e)},o.prototype.onContextMenu=function(t){a.subscribe("onContextMenu",function(e){e.callback(t(e.unixtime,e.price))})},o.prototype.onGrayedObjectClicked=function(t){a.subscribe("onGrayedObjectClicked",t)},o.prototype.activeChart=function(){return new r(this._chartWidgetCollection.activeChartWidget.value())},o.prototype.onActiveChartChanged=function(){return this._activeChangedChangedDelegate},o.prototype.changeSymbol=function(t,e,i){n.interval.setValue(e),n.symbol.setValue(t),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},o.prototype.setLayout=function(t){this._chartWidgetCollection.layout.setValue(t)},o.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},o.prototype.chartsCount=function(){return s[this.layout()].count},o.prototype.chart=function(t){if(void 0===t&&(t=0),t<0||t>this.chartsCount())throw Error("Incorrect index: "+t);return new r(this._chartWidgetCollection.getAll()[t])},o.prototype.getSymbolInterval=function(t){var e={symbol:n.symbol.value(),interval:n.interval.value()};return t&&t(e),e},o.prototype.saveChart=function(t){var e=this;this._chartSaverInstance.whenReadyToSave(function(){var i=e._chartSaverInstance.saveToJSON();return t&&t(JSON.parse(i.content))})},o.prototype.loadChart=function(t){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(t.json),this._chartWidgetCollection.purgeUnusedWidgets(),t.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(t.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(t.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(t.extendedData.name)),n.symbol.setValue(this.activeChart().symbol()),a.emit("chart_loaded")},o.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter(function(t){return!t.is_hidden_study}).map(function(t){return t.name||t.description})},o.prototype.getSavedCharts=function(t){d.getCharts(t)},o.prototype.loadChartFromServer=function(t){d.loadChart(t)},o.prototype.saveChartToServer=function(t,e,i,o){this._chartSaverInstance.saveChartSilently(t,i,e,o)},o.prototype.removeChartFromServer=function(t,e){d.removeChart(t,e)},o.prototype.getIntervals=function(){return u.sortIntervals(u.getIntervals())},o.prototype.closePopupsAndDialogs=function(){var t,e=document.querySelectorAll("._tv-dialog-title-close");for(t=0;t<e.length;t++)e[t].click();c(),l.hideAll()},o.prototype.selectLineTool=function(t){m.supportedLineTools[t]&&(t=m.supportedLineTools[t].name,h.tool.value()!==t&&h.tool.setValue(t))},o.prototype.selectedLineTool=function(){var t,e=Object.keys(m.supportedLineTools),i=h.tool.value();for(t=0;t<e.length;++t)if(m.supportedLineTools[e[t]].name===i)return e[t];return""},o.prototype.mainSeriesPriceFormatter=function(){return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()},o.prototype.showNoticeDialog=function(t){function e(){i&&(i(),i=null)}var i,o;t=t||{},
i=t.callback,o=_({title:t.title,content:t.body||""}),o.on("action:ok",e),o.on("afterClose",e),o.open()},o.prototype.showConfirmDialog=function(t){function e(t){i&&(i(t),i=null)}var i,o;if(t=t||{},!t.callback)throw Error("callback must be exist");i=t.callback,o=f({title:t.title,content:t.body||""}),o.on("action:yes",e.bind(null,!0)),o.on("action:no",e.bind(null,!1)),o.on("afterClose",e.bind(null,!1)),o.open()},o.prototype.logs=function(){return{getLogHistory:p.getLogHistory,enable:p.loggingOn,disable:p.loggingOff}},o.prototype.showLoadChartDialog=function(){this._saveLoad&&this._saveLoad.signInOrLoadChart()},o.prototype.showSaveAsChartDialog=function(){this._saveLoad&&this._saveLoad.signInOrSaveAs()},t.exports=o}).call(e,i(20))},function(t,e,i){"use strict";function o(){this._$wrap=$(document.createElement("span")),this._undo=$('<span class="button undo disabled"></span>').append($(i(1333))).attr("title","").appendTo(this._$wrap),this._redo=$('<span class="button redo disabled"></span>').append($(i(1236))).attr("title","").appendTo(this._$wrap);var t=this;this._undo.click(function(){t.undo()}),this._redo.click(function(){t.redo()}),n.undoStack().onChange().subscribe(this,this.update),n.redoStack().onChange().subscribe(this,this.update)}var n=i(76).UndoHistory,r=i(48).trackEvent,s=i(177).updateTooltipText;o.prototype.update=function(){var t=n.undoStack(),e=n.redoStack();t.isEmpty()?(this._undo.addClass("disabled"),this._undo.removeClass("apply-common-tooltip"),this._undo.attr("title",null)):(this._undo.removeClass("disabled"),this._undo.addClass("apply-common-tooltip"),this._undo.attr("title",$.t("Undo {0}").format(t.head().text()||"")+"\nCtrl+Z"),s(this._undo)),e.isEmpty()?(this._redo.addClass("disabled"),this._redo.removeClass("apply-common-tooltip"),this._redo.attr("title",null)):(this._redo.removeClass("disabled"),this._redo.addClass("apply-common-tooltip"),this._redo.attr("title",$.t("Redo {0}").format(e.head().text()||"")+"\nCtrl+Y"),s(this._redo))},o.prototype.undo=function(){this._undo.hasClass("disabled")||(r("GUI","Undo"),n.undo())},o.prototype.redo=function(){this._redo.hasClass("disabled")||(r("GUI","Redo"),n.redo())},o.prototype.element=function(){return this._$wrap},o.prototype.undoElement=function(){return this._undo},o.prototype.redoElement=function(){return this._redo},t.exports=o},,function(t,e,i){"use strict";function o(){this._data=null}function n(t){this._source=t,this._points1=[],this._points2=[],this._timePoints=[],this._getBarSpacing=t.model().timeScale().barSpacing.bind(t.model().timeScale()),this._invalidated=!0,this._areaRenderer=new o}function r(t){n.call(this,t)}function s(t,e,i){var o,r;if(n.call(this,t),this._isHlineFill=e.type===h.FilledArea.TYPE_HLINES,a(this._isHlineFill||e.type===h.FilledArea.TYPE_PLOTS,"Wrong filledArea type: "+e.type),this._isHlineFill&&this._initBandIndexes(e.objAId,e.objBId),this._fillMetaInfo=e,this._fillStyleProps=i,o=t._metaInfo,e.palette)for(r in o.plots)if(o.plots[r].palette===e.palette){this._colorPlotOffset=parseInt(r),
this._colorsMap=o.palettes[e.palette].valToIndex,this._colorValues=t.properties().palettes[e.palette].colors;break}}var a=i(21).assert,l=i(4),c=i(69).coordinateIsValid,h=i(45),u=i(19),d=i(56).clamp,p=i(42).PlotRowSearchMode;o.prototype.setData=function(t){this._data=t},o.prototype.hitTest=function(t){var e,i,o;if(null===this._data)return null;for(o=1;o<this._data.points1.length;++o)if(e=this._data.points1[o],i=this._data.points2[o],this._data.timePoints[o]===t.x&&(t.y>=e&&t.y<=i||t.y<=e&&t.y>=i))return new l(l.REGULAR);return null},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,h,d,p,_,f,m,g,v,y,b;if(null!==this._data&&((e=this._data.isHlineFill)||0!==this._data.points1.length&&0!==this._data.points2.length)){for(i=this._data.timePoints,o=this._data.points1,n=this._data.points2,r=this._data.colors,s=isNumber(this._data.transparency)?this._data.transparency:50,s=Math.min(s,100),s=Math.max(s,0),a={},l=[],d=0;d<this._data.timePoints.length;d++)p={point1:e?this._data.level1:o[d],point2:e?this._data.level2:n[d],timePoint:i[d]},_=c(p.point1)&&c(p.point2),_&&(h=r&&r[d]?r[d]:this._data.backcolor,l.push(p)),(d===this._data.timePoints.length-1||r&&h!==r[d+1]||!_)&&(l.length>0&&(f=a[h]||[],f.push(l),a[h]=f),l=_?[p]:[]);for(m in a){for(g=a[m],t.beginPath(),v=0;v<g.length;v++){for(y=g[v],t.moveTo(y[0].timePoint,y[0].point1),b=1;b<y.length;b++)t.lineTo(y[b].timePoint,y[b].point1);for(b=y.length-1;b>=0;b--)t.lineTo(y[b].timePoint,y[b].point2)}t.closePath(),t.fillStyle=u.generateColor(m,s),t.fill()}}},n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I;if(this._points1=[],this._points2=[],this._colorsMap&&(this._colors=[]),this._timePoints=[],this._visible()&&(t=this._source.priceScale(),e=this._source._model.timeScale(),t&&!t.isEmpty()&&!this._source._model.timeScale().isEmpty()&&!(this._source._series.bars().isEmpty()||(this._isHlineFill&&(i=this._source.properties().bands[this._bandAKey],o=this._source.properties().bands[this._bandBKey],this._level1=t.priceToCoordinate(i.value.value()),this._level2=t.priceToCoordinate(o.value.value())),n=this._source.data().plotNames().indexOf(this._plotAId())+1,r=this._source.data().plotNames().indexOf(this._plotBId())+1,null===(s=this._source._model.timeScale().visibleBars())||(a=this._source._series.nearestIndex(s.firstBar(),p.NearestRight),l=this._source._series.nearestIndex(s.lastBar(),p.NearestLeft),(a=this._correctStartBarIndex(a))>l))))){if(c=this._source.data().range(a,l),c.size()>0)for(h=this._source.firstValue(),u=c.firstIndex(),d=c.lastIndex(),_=this._source.offset(this._plotAId()),f=this._source.offset(this._plotBId()),m=Math.max(_,f),g=Math.min(_,f),v=u+m,y=this._source.data().firstIndex(),u>y&&(v=u<m+y?m+y:u),b=d+g,S=this._source.data().lastIndex(),d>S+g&&d<S&&(b=S+g),g<0&&d<=S+g&&(b=d),w=v<u?u+m:v>d?u+m:v,T=v;T<=b;++T)this._timePoints.push(e.indexToCoordinate(w++)),
this._colors&&null!=(x=this._source.data().valueAt(T-g)[this._colorPlotOffset+1])&&this._colors.push(this._colorValues[this._colorsMap[x]].color.value()),this._isHlineFill||(C=this._source.data().valueAt(T-_),P=this._source.data().valueAt(T-f),L=C[n],I=P[r],t.isPercentage()&&(L=100*(L-h)/h,I=100*(I-h)/h),this._points1.push(L),this._points2.push(I));t.pricesArrayToCoordinates(this._points1),t.pricesArrayToCoordinates(this._points2)}},n.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={};return t.points1=this._points1,t.points2=this._points2,t.timePoints=this._timePoints,t.getBarSpacing=this._getBarSpacing,t.backcolor=this._color(),t.transparency=this._transparency(),t.isHlineFill=this._isHlineFill,t.level1=this._level1,t.level2=this._level2,this._colors&&(t.colors=this._colors),this._areaRenderer.setData(t),this._areaRenderer},n.prototype._plotAId=function(){a(!1,"Pure virtual call!")},n.prototype._plotBId=function(){a(!1,"Pure virtual call!")},n.prototype._color=function(){a(!1,"Pure virtual call!")},n.prototype._transparency=function(){a(!1,"Pure virtual call!")},n.prototype._visible=function(){a(!1,"Pure virtual call!")},n.prototype._correctStartBarIndex=function(t){return t},inherit(r,n),r.prototype._plotAId=function(){return this._source.properties().area[0].name.value()},r.prototype._plotBId=function(){return this._source.properties().area[1].name.value()},r.prototype._color=function(){return this._source.properties().areaBackground.backgroundColor.value()},r.prototype._transparency=function(){var t=this._source.properties().areaBackground.transparency.value();return d(t,0,100)},r.prototype._visible=function(){return this._source.properties().areaBackground.fillBackground.value()},inherit(s,n),s.prototype._initBandIndexes=function(t,e){var i,o;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)o=this._source.metaInfo().bands[i],null!==this._bandAKey||o.id!==t?null!==this._bandBKey||o.id!==e||(this._bandBKey=i):this._bandAKey=i},s.prototype._plotAId=function(){return this._fillMetaInfo.objAId},s.prototype._plotBId=function(){return this._fillMetaInfo.objBId},s.prototype._color=function(){return this._fillStyleProps.color.value()},s.prototype._transparency=function(){return this._fillStyleProps.transparency.value()},s.prototype._visible=function(){return this._fillStyleProps.visible.value()},s.prototype._correctStartBarIndex=function(t){var e=this._source.getMinFirstBarIndexForPlot(this._fillMetaInfo.id);return Math.max(e,t)},e.PlotFillPaneView=s,e.AreaBackgroundPaneView=r},function(t,e,i){"use strict";function o(t,e){this._source=e,this._properties=t,this._points=[new l(-1,-1)],this._invalidated=!0,this._lineRenderer=new h}function n(){this._data=null}function r(t){this._source=t,this._points=[],this._bandBgRenderer=new n}function s(t,e,i){this._source=t,this._points=[],a(e.type===u.FilledArea.TYPE_HLINES,"Wrong filledArea type: "+e.type),this._initBandIndexes(e.objAId,e.objBId),this._fillStyleProps=i,
this._bandBgRenderer=new n}var a=i(21).assert,l=i(1).Point,c=i(56).clamp,h=i(122).HorizontalLineRenderer,u=i(45),d=i(19);o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e=this._source.priceScale();if(!e||e.isEmpty())return void(this._points[0]=new l(-1,-1));t=this._properties.value.value(),isNumber(t)?this._points[0]=new l(-1,e.priceToCoordinate(t)):this._points[0]=new l(-1,NaN)},o.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.width=this._source.model().timeScale().width(),t.height=this._source.priceScale().height(),t.points=this._points,t.color=this._properties.color.value(),t.linewidth=this._properties.linewidth.value(),t.linestyle=this._properties.linestyle.value(),this._lineRenderer.setData(t),this._lineRenderer},n.prototype.setData=function(t){this._data=t},n.prototype.draw=function(t){var e,i,o;null!==this._data&&0!==this._data.points.length&&(e=t.canvas.width,t.fillStyle=d.generateColor(this._data.backcolor,this._data.transparency),i=Math.min(this._data.points[0],this._data.points[1]),o=Math.max(this._data.points[0],this._data.points[1]),t.fillRect(0,i,e,o-i))},n.prototype.hitTest=function(t){return null},r.prototype.update=function(){var t,e,i,o;this._points=[],t=this._source.properties().bandsBackground,t.fillBackground.value()&&(e=this._source.properties().bands[0],i=this._source.properties().bands[1],(o=this._source.priceScale())&&!o.isEmpty()&&(this._points.push(o.priceToCoordinate(e.value.value())),this._points.push(o.priceToCoordinate(i.value.value()))))},r.prototype.renderer=function(){var t={};return t.points=this._points,t.backcolor=this._source.properties().bandsBackground.backgroundColor.value(),t.transparency=this._source.properties().bandsBackground.transparency.value(),this._bandBgRenderer.setData(t),this._bandBgRenderer},s.prototype._initBandIndexes=function(t,e){var i,o;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)o=this._source.metaInfo().bands[i],null!==this._bandAKey||o.id!==t?null!==this._bandBKey||o.id!==e||(this._bandBKey=i):this._bandAKey=i},s.prototype.update=function(){var t,e,i;this._points=[],this._fillStyleProps.visible.value()&&(t=this._source.properties().bands[this._bandAKey],e=this._source.properties().bands[this._bandBKey],(i=this._source.priceScale())&&!i.isEmpty()&&(this._points.push(i.priceToCoordinate(t.value.value())),this._points.push(i.priceToCoordinate(e.value.value()))))},s.prototype.renderer=function(){var t,e=this._fillStyleProps.transparency.value();return e=c(e,0,100),t={},t.points=this._points,t.backcolor=d.generateColor(this._fillStyleProps.color.value(),e),t.transparency=this._fillStyleProps.transparency.value(),this._bandBgRenderer.setData(t),this._bandBgRenderer},e.BandPaneView=o,e.BandBackgroundPaneView=r,e.HlineFillPaneView=s},function(t,e,i){(function(e,o,n,r){"use strict";function s(t){return t instanceof A}function a(t){return TradingView.isInherited(t.constructor,f)}function l(t,i,r,s,a,c,h,u,d){
var p,_,f,w;this._version=l.version,this._readOnly=s,this._undoModel=u,this._properties=r,this._isSnapshot=d,this.setStudiesMetaData(c,h),this.m_timeScale=new S(this),p=this,this.m_panes=[],this.m_gridSource=new y,this.m_crossHairSource=new m(this,F.properties()),this.m_crossHairSource.selectBarMode().subscribe(function(t){if(t&&p.lineBeingCreated()){var e=F.tool.value();p.cancelCreatingLine(),F.tool.setValue(e)}}),this.m_width=0,this._tagsChanged=new e,this._lineCancelled=new e,this._magnet=new b(F.properties().magnet,this.m_timeScale,r.paneProperties.magnetSensivity),_=new N("chartproperties.mainSeriesProperties"),_.addExclusion("lockScale"),_.addExclusion("minTick"),_.addExclusion("priceAxisProperties.percentage"),_.addExclusion("priceAxisProperties.log"),this.createPane(void 0,{rightAxisProperties:_.priceAxisProperties.state(["autoScale"])}),this.m_panes[0]._stretchFactor=2*g.DEFAULT_STRETCH_FACTOR,this.m_panes[0]._isMainPane=!0,this.m_selectedSource=null,this._selectedSourceChanged=new e,this._chartApi=t,this._invalidateHandler=i,this.m_hoveredSource=null,this._properties.listeners().subscribe(this,l.prototype.propertyChangeHandler),this._properties.timezone.listeners().subscribe(null,function(){p._chartApi&&p._chartApi.connected()&&p._chartApi.switchTimezone(p.timezone())}),this._properties.timeScale.rightOffset.listeners().subscribe(null,function(){p.m_timeScale.setRightOffset(p._properties.timeScale.rightOffset.value()),p.recalculateAllPanes()}),_.merge(r.mainSeriesProperties.state()),this.m_mainSeries=new z(this,_,a),this.m_panes[0].addDataSource(this.m_mainSeries,this.m_panes[0].rightPriceScale()),this.m_mainSeries.onCompleted().subscribe(this,function(){p.clearCurrentPosition(),p._scrollingState&&p.gotoTime()}),this.m_mainSeries.onIntervalChanged().subscribe(this,function(){this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1}),this.m_mainSeries.onBarReceived().subscribe(this,l.prototype.updateTimeScaleBaseIndex),s||(_.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),_.lockScale.listeners().subscribe(this,function(t){var e=t.value();e&&(_.priceAxisProperties.percentage.setValue(!1),_.priceAxisProperties.logDisabled.setValue(!1)),_.priceAxisProperties.percentageDisabled.setValue(e),_.priceAxisProperties.logDisabled.setValue(e)}),this._properties.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,function(t){t.value()||p._properties.paneProperties.legendProperties.showStudyArguments.setValue(!1)})),this._barsMarksSources=[],this._syncPointCache={},o.enabled("charting_library_base")&&(f=new L(this),f.setOwnerSource(this.m_mainSeries),this._barsMarksSources.push(f),w=new T(this),w.setOwnerSource(this.m_mainSeries),this._barsMarksSources.push(w)),this.m_watermarkSource=new v(this.m_mainSeries),this._brandingSource=null,this.strategySources=[],this.strategySources.change=new e,this._activeStrategySource=new n(null),this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1,this._currentTool="",
F.hideAllDrawings().subscribe(this,l.prototype.visibilityChangeHandler),this._properties.scalesProperties.listeners().subscribe(this,l.prototype.fullUpdate),this._id=U.guid(),this._studyInserted=new e,this._chartThemeLoaded=new e,this._resetScales=new e,this._studyShiftColorStartOffset=void 0}var c=i(21).ensureNotNull,h=i(1).Point,u=i(53),d=u.parseRgb,p=u.rgbToBlackWhiteString,_=i(275),f=i(3).LineDataSource,m=i(826),g=i(280),v=i(983),y=i(833),b=i(948),S=i(980),w=i(281),T=i(982),x=i(133).BarsMarksContainer,C=i(693).Branding,P=i(62).PriceDataSource,L=i(981),I=i(37),k=i(61),A=k.Study,M=k.createStudy,E=k.prepareStudyProperties,V=i(119),D=i(216),O=i(136).StudyLineDataSource,B=i(106).ScaleType,R=i(42).PlotRowSearchMode,z=i(85),F=i(44),N=i(11).DefaultProperty,W=i(429).SyncPoint,H=i(48).trackEvent,U=i(64),j=i(13).getLogger("Chart.ChartModel");l.prototype.setStudiesMetaData=function(t,e){this._studiesMetaData=t,this._studyVersioning=new V(this._studiesMetaData,e)},l.prototype.isSnapshot=function(){return this._isSnapshot},l.prototype.currentTool=function(){return this._currentTool},l.prototype.setCurrentTool=function(t){this._currentTool=t},l.prototype.timezone=function(){return this._properties.timezone.value()},l.prototype.version=function(){return this._version},l.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())},l.prototype.dumpViews=function(){var t,e,i,o,n={};for(n.panes=[],t=0;t<this.m_panes.length;t++)n.panes.push(this.m_panes[t].dumpViews());for(n.dataWindow=[],e=this.dataSources(),t=0;t<e.length;t++)i=e[t],(o=i.dataWindowView())&&n.dataWindow.push(o.dump());return n},l.prototype._paneInvalidationMask=function(t,e){var i=new I,o=this.m_panes.indexOf(t);return void 0===e&&(e=I.LIGHT_UPDATE),i.invalidatePane(o,e),i},l.prototype.updatePane=function(t){var e=this._paneInvalidationMask(t);this.invalidate(e)},l.prototype.fullUpdate=function(){this.invalidate(new I(I.FULL_UPDATE))},l.prototype.updateSource=function(t){var e=this.paneForSource(t),i=this._paneInvalidationMask(e);this.invalidate(i)},l.prototype.studiesMetaData=function(){return this._studiesMetaData},l.prototype.studyVersioning=function(){return this._studyVersioning},l.prototype.disconnect=function(){var t,e,i=this.dataSources();for(e=0;e<i.length;e++)t=i[e],t.disconnect&&t.disconnect()},l.prototype.restart=function(){var t,e,i;for(this.initConnection(),this.m_timeScale.reset(),this.m_mainSeries.restart(),t=this.dataSources(),e=0;e<t.length;e++)i=t[e],i.restart&&i!==this.m_mainSeries&&i.restart()},l.prototype.startNotStartedStudies=function(){var t,e;if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(t=this.dataSources(),e=0;e<t.length;e++)s(t[e])&&!t[e].isStarted()&&t[e].restart&&t[e]!==this.m_mainSeries&&t[e].restart()},l.prototype.updateLineTools=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;t++)a(i[t])&&(e=i[t],e.tryCreateServerPoints(),e.checkAlert&&e.checkAlert())},l.prototype.realignLineTools=function(){var t,e,i=this.dataSources()
;for(t=0;t<i.length;t++)a(i[t])&&(e=i[t],e.calcIsActualSymbol());for(t=0;t<this.m_panes.length;t++)this.m_panes[t].invalidateSourcesCache()},l.prototype.readOnly=function(){return this._readOnly},l.prototype.properties=function(){return this._properties},l.prototype.lineCancelled=function(){return this._lineCancelled},l.prototype.crossHairMoved=function(){return this.m_crossHairSource.moved()},l.prototype.chartApi=function(){return this._chartApi},l.prototype.propertyChangeHandler=function(){this.invalidate(new I(I.LIGHT_UPDATE))},l.prototype.visibilityChangeHandler=function(){this.setSelectedSource(),this.invalidate(new I(I.LIGHT_UPDATE))},l.prototype.updateAllPaneViews=function(){var t,e;for(t=0;t<this.m_panes.length;t++)e=this.m_panes[t],e.updateAllViews()},l.prototype.mainSeries=function(){return this.m_mainSeries},l.prototype.timeScale=function(){return this.m_timeScale},l.prototype.panes=function(){return this.m_panes},l.prototype.gridSource=function(){return this.m_gridSource},l.prototype.watermarkSource=function(){return this.m_watermarkSource},l.prototype.brandingSource=function(){return this._brandingSource},l.prototype.crossHairSource=function(){return this.m_crossHairSource},l.prototype.barsMarksSources=function(){return this._barsMarksSources},l.prototype.width=function(){return this.m_width},l.prototype.setPaneHeight=function(t,e){t.setHeight(e),this.recalculateAllPanes(),this.invalidate(new I(I.LIGHT_UPDATE))},l.prototype.setWidth=function(t){var e,i;for(this.m_width=t,this.m_timeScale.setWidth(this.m_width),e=0;e<this.m_panes.length;++e)i=this.m_panes[e],i.setWidth(t);this.recalculateAllPanes(),this.recalcVisibleRangeStudy(this.dataSources())},l.prototype.createPane=function(t,e){var i,o;if(this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),i=this._properties.paneProperties,e&&i.merge(e),o=new g(this.m_timeScale,i,this),"number"==typeof t&&isFinite(t)){if(t<0||t>this.m_panes.length)return void j.logDebug("ChartModel.createPane: invalid index: "+t);this.m_panes.splice(t,0,o)}else this.m_panes.push(o);return o.onTagsChanged().subscribe(this,l.prototype.onPaneTagsChanged),o},l.prototype.removePane=function(t){this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),t.destroy();var e=this.m_panes.indexOf(t);-1!==e&&this.m_panes.splice(e,1),this.invalidate(new I(I.FULL_UPDATE))},l.prototype.startScalePrice=function(t,e,i){t.startScalePrice(e,i)},l.prototype.scalePriceTo=function(t,e,i){t.scalePriceTo(e,i),this.mainSeries().properties().lockScale.value()?this.invalidate(new I(I.LIGHT_UPDATE)):this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},l.prototype.endScalePrice=function(t,e){t.endScalePrice(e),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},l.prototype.startScrollPrice=function(t,e,i){t.startScrollPrice(e,i)},l.prototype.scrollPriceTo=function(t,e,i){t.scrollPriceTo(e,i),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},l.prototype.endScrollPrice=function(t,e){
t.endScrollPrice(e),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},l.prototype.setPriceAutoScale=function(t,e,i){t.setPriceAutoScale(e,i),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},l.prototype.restorePriceScaleState=function(t,e,i){t.restorePriceScaleState(e,i),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},l.prototype.resetPriceScale=function(t,e){t.resetPriceScale(e),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},l.prototype.updateScales=function(t,e){this._undoModel._chartWidget._updateScalesActions()},l.prototype.startScaleTime=function(t){this.m_timeScale.startScale(t)},l.prototype.scaleTimeTo=function(t){this.m_timeScale.scaleTo(t),this.recalculateAllPanes(),this.invalidate(new I(I.LIGHT_UPDATE))},l.prototype.endScaleTime=function(){this.m_timeScale.endScale(),this.invalidate(new I(I.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources())},l.prototype.startScrollTime=function(t){this.m_timeScale.startScroll(t),this._isTimeScrolling=!0},l.prototype.scrollTimeTo=function(t){this.m_timeScale.scrollTo(t),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new I(I.LIGHT_UPDATE))},l.prototype.endScrollTime=function(){this.m_timeScale.endScroll(),this.invalidate(new I(I.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._isTimeScrolling=!1},l.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach(function(t){t instanceof O&&t.recalcStudyIfNeeded&&t.recalcStudyIfNeeded()})},l.prototype.recalcVisibleRangeStudy=function(t,e){void 0!==this._recalcVRTimerId&&clearTimeout(this._recalcVRTimerId);var i=this;this._recalcVRTimerId=setTimeout(function(){i._recalcVisibleRangeStudy(t,e)},1e3)},l.prototype._recalcVisibleRangeStudy=function(t,e){var i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v;if(!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),o=this.mainSeries().nearestData(i.firstBar(),R.NearestRight),n=this.mainSeries().nearestData(i.lastBar(),R.NearestLeft),r=this.mainSeries().bars().lastIndex(),a=o?o.index:void 0,l=n?n.index:void 0,c=a===this._oldStartVisibleIndex,h=l===this._oldEndVisibleIndex,!c||!h||e))for(this._oldStartVisibleIndex=a,this._oldEndVisibleIndex=l,u={first_visible_bar_time:1e3*Math.floor(o&&o.value?o.value[TradingView.TIME_PLOT]:0),last_visible_bar_time:1e3*Math.floor(n&&n.value?n.value[TradingView.TIME_PLOT]:0),subscribeRealtime:n&&n.index===r},d=0;d<t.length;d++)if(s(t[d])){for(p=t[d],_=p.metaInfo().inputs,f=[],m=0;m<_.length;m++)u.hasOwnProperty(_[m].id)&&f.push(_[m].id);for(g=p.properties().inputs,m=0;m<f.length;m++)v=f[m],g[v].setValueSilently(u[v]);f.length>0&&g.listeners().fire(g)}},l.prototype.onResetScales=function(){return this._resetScales},l.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this.updateCrossHair(),this.invalidate(new I(I.LIGHT_UPDATE)),
this._resetScales.fire()},l.prototype.restoreTimeScaleState=function(t){this.m_timeScale.restoreState(t),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new I(I.LIGHT_UPDATE))},l.prototype.restoreFactoryDefaults=function(t){t.restoreFactoryDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},l.prototype.setSelectedSource=function(t,e){if(!(this.m_selectedSource===t&&this._lastHittestData===e||t&&t.customization&&t.customization.disableSelection)){this._lastHittestData=e;var i=new I;this.m_selectedSource&&(this.m_selectedSource.updateAllViews(),TradingView.alertsDispatcher&&this.m_selectedSource.hasAlert.value()&&this.m_selectedSource.getAlert({fromCache:!0}).done(function(t){t&&t.set("selected",!1)})),this.m_selectedSource=t,this._selectedSourceChanged.fire(t),t&&(t.updateAllViews(),TradingView.alertsDispatcher&&t.hasAlert.value()&&t.getAlert({fromCache:!0}).done(function(t){t&&t.set("selected",!0)})),i.force=!0,this.invalidate(new I(I.LIGHT_UPDATE)),this.setHoveredSource(t,e)}},l.prototype.checkLineToolSelection=function(){this.m_selectedSource&&this.m_selectedSource instanceof f&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))},l.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},l.prototype.setHoveredSource=function(t,e){if(this.m_hoveredSource!==t||this._lastHittestData!==e){this._lastHittestData=e;var i=null;this.m_hoveredSource&&(this.m_hoveredSource.updateAllViews(),i||(i=new I),TradingView.alertsDispatcher&&this.m_hoveredSource.hasAlert.value()&&this.m_hoveredSource.getAlert({fromCache:!0}).done(function(t){t&&t.set("hovered",!1)}),i.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),I.LIGHT_UPDATE))),this.m_hoveredSource=t,t&&(t.updateAllViews(),i||(i=new I),i.merge(this._paneInvalidationMask(this.paneForSource(t),I.LIGHT_UPDATE)),TradingView.alertsDispatcher&&t.hasAlert.value()&&t.getAlert({fromCache:!0}).done(function(t){t&&t.set("hovered",!0)})),i&&this.invalidate(i)}},l.prototype.selectedSource=function(){return this.m_selectedSource},l.prototype.hoveredSource=function(){return this.m_hoveredSource},l.prototype.lastHittestData=function(){return this._lastHittestData},l.prototype.invalidate=function(t){this._invalidateHandler&&this._invalidateHandler(t)},l.prototype.dataSources=function(){var t,e,i,o=[];for(o.push(this.m_crossHairSource),t=0;t<this.m_panes.length;++t)for(e=this.m_panes[t].dataSources(),i=0;i<e.length;i++)o.push(e[i]);return o},l.prototype.orderedDataSources=function(t){var e,i,o=[];for(o.push(this.m_crossHairSource),e=0;e<this.m_panes.length;e++)i=this.m_panes[e].orderedSources().slice(),t&&i.reverse(),o=o.concat(i);return o},l.prototype.dataSourceForId=function(t){var e,i;for(i=0;i<this.m_panes.length;++i)if(e=this.m_panes[i].dataSourceForId(t))return e;return null},l.prototype.children=function(t,e){return this.dataSources().filter(function(i){
return(!0!==e||!s(i)||!i.isChildStudy())&&i.ownerSource()===t})},l.prototype.setAndSaveCurrentPosition=function(t,e,i,o){this.m_crossHairSource.saveOriginCoord(t,e),this.setCurrentPosition(t,e,i,o)},l.prototype.setCurrentPosition=function(t,e,i,o){var n,r,s,a,l,c,h,u,d,p,_,m,g,v=NaN,y=Math.round(this.m_timeScale.coordinateToIndex(t));if(i&&(n=i.defaultPriceScale(),n.isEmpty()||(v=n.coordinateToPrice(e))),(this._lineBeingCreated||f.isLineTool(this.currentTool()))&&(v=this._magnet.align(v,y,i)),this._isTimeScrolling)return void this.m_crossHairSource.setPosition(this.m_crossHairSource.index,v,i);for(this.m_crossHairSource.setOnHoveredChartWidget(!0),this.m_crossHairSource.setPosition(y,v,i),this.m_crossHairSource.dataWindowView().update(),r=this.m_panes,s=r.length;s--;)for(a=r[s].dataSources(),l=a.length;l--;)(c=a[l].dataWindowView())&&c.update();this._lineBeingCreated?(this._lineBeingCreated.setLastPoint({index:y,price:v},o),this._lineBeingCreated.updateAllViews(),this.invalidate(new I(I.LIGHT_UPDATE))):this.crossHairSource().startMeasurePoint()?this.invalidate(new I(I.LIGHT_UPDATE)):this.invalidate(new I(I.UPDATE_CURSOR_ONLY)),this._isSettingsExternalPosition||(h=this._undoModel._chartWidget,h._chartWidgetCollection&&(u=this.mainSeries(),(d=u.syncModel())&&(p=this.m_timeScale.points().roughTime(y,d.projectTime.bind(d)),_={timeStamp:p},m=i.mainDataSource(),m instanceof z&&(_.price=v,_.symbol=m.symbol()),_.syncModel=d,g=this._lineBeingCreated||this._linePointBeingEdited||this._sourceBeingMoved,g=g&&F.drawOnAllCharts().value(),h._chartWidgetCollection.syncCrosshair(_,h,g,o))))},l.prototype.clearCurrentPosition=function(){var t,e,i,o,n,r,s=this.crossHairSource();for(s.clearPosition(),s.dataWindowView().update(),t=this.m_panes,e=t.length;e--;)for(i=t[e].dataSources(),o=i.length;o--;)(n=i[o].dataWindowView())&&n.update();this.invalidate(new I(I.UPDATE_CURSOR_ONLY)),r=this._undoModel._chartWidget,r._chartWidgetCollection&&r._chartWidgetCollection.syncCrosshair(NaN,r)},l.prototype.onSyncScrollNeeded=function(t){var e,i,o,n=this._undoModel._chartWidget;n._chartWidgetCollection&&(e=this.mainSeries(),(i=e.syncModel())&&(o=1e3*this.m_timeScale.points().roughTime(t,i.projectTime.bind(i)),n._chartWidgetCollection.syncScroll(o,this)))},l.prototype.gotoTime=function(t,e){function i(){return p.tickMarks().indexToTime(p.tickMarks().minIndex).valueOf()-t}function o(e){var o,n,r,s,a;if(i()<0){for(o=p.tickMarks().nearestIndex(t),n=c(_.bars().lastIndex()),o=Math.min(o,n),r=p.tickMarks().indexToTime(o).valueOf();r<t&&o<n;)o++,r=p.tickMarks().indexToTime(o).valueOf();return s=p.visibleBars(),a=s.lastBar()-s.firstBar(),!e&&s.contains(o)||(p.zoomToBarsRange(o-a/2,o+a/2),_.requestMoreData()),{timestamp:p.indexToTimePoint(o)}}}var n,r,s,a,l,h,u,d,p=this.timeScale(),_=this.mainSeries();if(e&&e.model&&(n=_.syncModel())&&(r=this._createSyncPoint(e.model.mainSeries().syncModel(),n),t=1e3*r.sourceTimeToTargetTime(t/1e3)),e=e||{centerIfVisible:!0},t)this._scrollingState&&this._scrollingState.deferred.reject(),s=$.Deferred(),this._scrollingState={
targetDate:t,deferred:s,centerIfVisible:e.centerIfVisible};else{if(!this._scrollingState)return j.logError("scrollTo called without an argument"),$.Deferred().reject().promise();t=this._scrollingState.targetDate,s=this._scrollingState.deferred}return a=o(this._scrollingState.centerIfVisible),a||(l=p.tickMarks().minIndex,h=p.visibleBars(),u=h.lastBar()-h.firstBar(),_.endOfData()?(p.zoomToBarsRange(l-u/2,l+u/2),a={timestamp:p.indexToTimePoint(l),eod:!0}):(d=this.timeScale().tickMarks().estimateLeft(t),_.requestMoreData(Math.ceil(d+u/2)))),a&&(this.fullUpdate(),this._scrollingState=null,s.resolve(a)),s.promise()},l.prototype._createSyncPoint=function(t,e){var i,o,n=this._syncPointCache[t.uniqueId()];if(n){if(i=n[e.uniqueId()])return i}else this._syncPointCache[t.uniqueId()]={};return o=new W(t,e),this._syncPointCache[t.uniqueId()][e.uniqueId()]=o,o},l.prototype.setExternalPosition=function(t,e){var i,o,n,r,s,a,l,c,h,u,d,p=this.crossHairSource();if(p.setOnHoveredChartWidget(!1),!Number.isNaN(t)&&isNumber(t.timeStamp)&&(o=this.mainSeries(),(n=o.syncModel())&&(r=this._createSyncPoint(t.syncModel,n),s=r.sourceTimeToTargetTime(t.timeStamp),i=this.m_timeScale.points().roughIndex(s,n.distance.bind(n)))),this.mainSeries().symbol()===t.symbol)return this._isSettingsExternalPosition=!0,a=this.paneForSource(this.mainSeries()),l=this.m_timeScale.indexToCoordinate(i),c=this.mainSeries().priceScale().priceToCoordinate(t.price,!0),this.setCurrentPosition(l,c,a,e||{}),p.setOnHoveredChartWidget(!1),void delete this._isSettingsExternalPosition;for(isFinite(i)?p.setPosition(i,NaN,null):(p.clearPosition(),p.dataWindowView().update()),h=this.dataSources(),u=h.length;u--;)(d=h[u].dataWindowView())&&d.update();this.invalidate(new I(I.UPDATE_CURSOR_ONLY))},l.prototype.updateCrossHair=function(){this.m_crossHairSource.update()},l.prototype.updateTimeScale=function(t,e,i,o,n,r){var s,a,l;if(r)for(this.m_timeScale.reset(),s=this.dataSources(),a=0;a<s.length;a++)s[a].clearData&&s[a].clearData();if(o.length>0)for(s=this.dataSources(),a=0;a<s.length;a++)s[a].moveData&&s[a].moveData(o);this.m_timeScale.update(t,e,i,n),l="ChartModel.prototype.updateTimeScale("+t+","+e+","+i.length+","+o.length+","+n.length+","+r+")",l+="TimeScale: {first:"+this.m_timeScale.m_points.firstIndex()+",last:"+this.m_timeScale.m_points.lastIndex()+"}",j.logDebug(l),this.recalculateAllPanes(),this.invalidate(new I(I.LIGHT_UPDATE))},l.prototype.updateTimeScaleBaseIndex=function(t){var e,i,o,n,r,s=this.mainSeries().bars();s.isEmpty()||(e=this.timeScale(),i=e.baseIndex(),o=c(s.lastIndex()),n=e.visibleBars().contains(i),t&&t.earliestRow.index>0&&!n&&(r=o-i,e.setRightOffset(e.rightOffset()-r)),e.setBaseIndex(o))},l.prototype.recalculatePane=function(t){t&&t.recalculate()},l.prototype.paneForSource=function(t){for(var e=this.m_panes.length-1;e>=0;e--)if(-1!==this.m_panes[e].dataSources().indexOf(t))return this.m_panes[e];return t instanceof x?this.paneForSource(this.m_mainSeries):null},l.prototype.recalculateAllPanes=function(){
for(var t=0;t<this.m_panes.length;++t)this.m_panes[t].recalculate();this.timeScale().recalcLockedScale(),this.updateAllPaneViews()},l.prototype._invalidateBarColorerCaches=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;++t)(e=i[t])instanceof z&&e.invalidateBarColorerCache()},l.prototype.addStrategySource=function(t){~this.strategySources.indexOf(t)||(this.strategySources.push(t),this.strategySources.change.fire())},l.prototype.removeStrategySource=function(t){var e=this.strategySources.indexOf(t);~e&&(this.strategySources.splice(e,1),this.strategySources.change.fire())},l.prototype.setActiveStrategySource=function(t){~this.strategySources.indexOf(t)&&this._activeStrategySource.setValue(t)},l.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)},l.prototype.activeStrategySource=function(){return this._activeStrategySource},l.prototype.insertStudy=function(t,e,i,o){var n,r,a,l,c,h=null;return-1===["Study_ESD$TV_SPLITS@tv-scripting","Study_ESD$TV_DIVIDENDS@tv-scripting","Study_ESD$TV_SPLITS@tv-scripting","Volume@tv-basicstudies","Sessions@tv-basicstudies"].indexOf(t.id)&&H("studies","Study_"+t.id),n=!1,i||t.is_price_study?h=this.paneForSource(o||this.mainSeries()):(h=this.createPane(),e&&e.paneSize&&h.setPaneSize(e.paneSize),n=!0),"Compare@tv-basicstudies"===t.id&&(H("compare","symbol:"+e.inputs.symbol),this.m_mainSeries.priceScale().properties().log.setValue(!1),this.m_mainSeries.priceScale().properties().percentage.setValue(!0)),r=E(t,e,h,this.studyVersioning(),o),a=M(this,r,o||this.mainSeries(),t),this._recalcVisibleRangeStudy([a],!0),a.start(),a.childStudyByRebind().subscribe(null,function(){H("SOS","Apply SOS","Rebind SOS")}),l=a.metaInfo().priceScale||B.Right,!n&&s(o)&&(c=o.isNoScale()?null:o.priceScale()),c||(l===B.Right?c=h.rightPriceScale():l===B.Left?c=h.leftPriceScale():t.is_price_study?c=null:(j.logWarn("Cannot add study "+a.metaInfo().id+" with 'No Scale' setting, because study is not a price study. Using right price scale."),c=h.rightPriceScale())),i?h.addDataSource(a,null):h.addDataSource(a,c),a.properties().linkedToSeries&&a.properties().linkedToSeries.value()&&a.setOwnerSource(this.mainSeries()),this.recalculatePane(h),this.invalidate(new I(I.FULL_UPDATE)),this._invalidateBarColorerCaches(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this._studyInserted.fire(a),a},l.prototype.studyInserted=function(){return this._studyInserted},l.prototype.replaceStudyStub=function(t,e){var i,o,n,r=this.paneForSource(t);return null!==r&&(i=t.isNoScale()?null:t.priceScale(),o=t.zorder(),n=t.ownerSource(),r.insertDataSource(e,i,o),e.setOwnerSource(n),this.panes().forEach(function(i){i.dataSources().forEach(function(i){i._ownerSource===t&&i.setOwnerSource(e)})}),this.removeSource(t),e.start(),this.recalculatePane(r),this.invalidate(new I(I.FULL_UPDATE)),!0)},l.prototype.insertStudyStub=function(t){var e=this.mainSeries(),i=this.paneForSource(e),o=new D(this,null,t);return i.addDataSource(o,null),this.recalculatePane(i),this.invalidate(new I(I.FULL_UPDATE)),o},
l.prototype.removeStudyStub=function(t){var e=this.dataSourceForId(t);return void 0===e?(j.logNormal("StudyStub id="+t+" is not found in chart model"),!1):(this.removeSource(e),!0)},l.prototype.detachSource=function(t,e){var i=this.paneForSource(t);if(i)return i.removeDataSource(t),i.isEmpty()?(this._lineBeingCreated&&i===this._paneBeingCreatedLineOn&&this.cancelCreatingLine(),this.removePane(i,e),!0):(this.invalidate(new I(I.FULL_UPDATE)),!1)},l.prototype.removeSource=function(t,e){var i,o,n,r;if(t===this.m_selectedSource&&this.setSelectedSource(null),t===this._sourceBeingMoved&&(this._sourceBeingMoved=null,this._linePointBeingMoved=null),t.stop&&t.stop(),i=this.detachSource(t,e),t.metaInfo&&t.metaInfo()&&"Compare@tv-basicstudies"===t.metaInfo().id){for(o=this.paneForSource(this.m_mainSeries),n=o.dataSources(),r=0;r<n.length;r++)if(n[r].metaInfo&&"Compare@tv-basicstudies"===n[r].metaInfo().id)return;this.m_mainSeries.priceScale().properties().percentage.setValue(!1)}return this.invalidate(new I(I.FULL_UPDATE)),this._invalidateBarColorerCaches(),t.linkKey&&F.removeLineTool({model:this,linkKey:t.linkKey}),s(t)&&t.isChildStudy()&&t.source().unsetChild(t),t.destroy&&t.destroy(),i},l.prototype._isStudyOrMainSeries=function(t){return TradingView.isInherited(t.constructor,A)||t===this.m_mainSeries},l.prototype.isMergeUpAvailableForSource=function(t){return!!this._isStudyOrMainSeries(t)&&this.paneForSource(t)!==this.panes()[0]},l.prototype.mergeSourceUp=function(t){var e,i,o,n;this.isMergeUpAvailableForSource(t)&&(e=this.paneForSource(t),i=this.panes().indexOf(e),o=this.panes()[i-1],n=o.findSuitableScale(t),this.move(t,o,n))},l.prototype.isMergeDownAvailableForSource=function(t){var e,i;return!!this._isStudyOrMainSeries(t)&&(e=this.paneForSource(t),i=this.panes(),e!==i[i.length-1])},l.prototype.mergeSourceDown=function(t){var e,i,o,n;this.isMergeDownAvailableForSource(t)&&(e=this.paneForSource(t),i=this.panes().indexOf(e),o=this.panes()[i+1],n=o.findSuitableScale(t),this.move(t,o,n))},l.prototype.isUnmergeAvailableForSource=function(t){var e,i;return!!this._isStudyOrMainSeries(t)&&(e=this.paneForSource(t),i=e.dataSources().filter(function(t){return TradingView.isInherited(t.constructor,P)&&t.showInObjectTree()}),i.length>1)},l.prototype.unmergeSourceUp=function(t){var e,i,o,n;this.isUnmergeAvailableForSource(t)&&(e=this.paneForSource(t),i=this.panes().indexOf(e),o=this.createPane(i),n=o.findSuitableScale(t),this.move(t,o,n))},l.prototype.unmergeSourceDown=function(t){var e,i,o,n;this.isUnmergeAvailableForSource(t)&&(e=this.paneForSource(t),i=this.panes().indexOf(e),o=this.createPane(i+1),n=o.findSuitableScale(t),this.move(t,o,n))},l.prototype.move=function(t,e,i){var o,n,r,s,a=this.children(t,!0),l=this.paneForSource(t),c=e?e.priceScaleName(i):"right";if(l===e){for(o=e.priceScaleByName(c),n=0;n<a.length;n++)e.move(a[n],o);e.move(t,o)}else{for(r=e||this.createPane(),s=r.priceScaleByName(c),n=0;n<a.length;n++)this.detachSource(a[n]);for(n=0;n<a.length;n++)r.addDataSource(a[n],s);this.detachSource(t),r.addDataSource(t,s)}
this._alertsList&&this._alertsList.trigger("reset"),this.invalidate(new I(I.FULL_UPDATE))},l.prototype.isSingleInstanceLineTool=function(t){return"LineStudyMtpRiskReward"===t||"LineStudyMtpAnalysis"===t},l.prototype._externalTimeStamp=function(t){var e=this.mainSeries().syncModel();return this.m_timeScale.points().roughTime(t,e&&e.projectTime.bind(e))},l.prototype.createLineTool=function(t,e,i,o,n){var r,s,a,l,c,u,d,p,f,m,g;return _.isValid(i)?(this.isSingleInstanceLineTool(i)&&this._undoModel.removeAllDrawingTools(i),"LineToolExecution"!==i&&H("drawings","Study_Drawing_"+i),o&&(r=o.state(),s=TradingView.factoryDefaults("linetool"),a=i.toLowerCase(),TradingView.merge(s,TradingView.factoryDefaults(a)),o=TradingView[i].prototype.createPropertiesObject(a,s),o.merge(r)),l=_.create(i,this,o,null,t.mainDataSource()),o||(o=l.properties()),c=!l.linkKey&&!n,F.drawOnAllCharts().value()?l.linkKey=n||U.randomHash():l.linkKey=n,l.toolname=i,l.setOwnerSource(t.mainDataSource()),u=t.defaultPriceScale(),t.addDataSource(l,u),p=this.m_timeScale.indexToCoordinate(e.index),f=u.priceToCoordinate(e.price),l.isFixed()?d=l.addFixedPoint(new h(p,f)):(m=l.constructor,m.skipMagnetting||(e.price=this._magnet.align(e.price,e.index,t)),d=l.addPoint(e)),d||(this._lineBeingCreated=l,this._paneBeingCreatedLineOn=t),c&&l.enableCurrentIntervalVisibility(),this.invalidate(new I(I.FULL_UPDATE)),n||!F.drawOnAllCharts().value()||l.properties().singleChartOnly||(g=this._externalTimeStamp(e.index),F.createLineTool({point:{price:e.price,timeStamp:g},linetool:i,properties:o,symbol:this.mainSeries().symbol(),model:this,linkKey:l.linkKey})),l):null},l.prototype.lineBeingCreated=function(){return this._lineBeingCreated},l.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},l.prototype.coninueCreatingLine=function(t,e,i,o){var n,r,s,a,l,c=this.paneForSource(this._lineBeingCreated);return t.price=this._magnet.align(t.price,t.index,c),n=this._lineBeingCreated.addPoint(t,e,i),r=this._lineBeingCreated,this._lineBeingCreated.updateAllViews(),s=new I(I.LIGHT_UPDATE),a=null,n&&(a={points:this._lineBeingCreated._timePoint,interval:this.mainSeries().interval()},this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null,s.force=!0),this.invalidate(s),o||!F.drawOnAllCharts().value()||r.properties().singleChartOnly||(l=this._externalTimeStamp(t.index),F.continueLineTool({point:{price:t.price,timeStamp:l},envState:e,finalState:a,model:this})),n},l.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var t=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),F.drawOnAllCharts().value()&&!t.properties().singleChartOnly&&F.cancelLineTool({model:this})}},l.prototype.startChangingLinetool=function(t,e,i,o){var n,r,s;this._lineBeingEdited=t,this._linePointBeingEdited=i,this._lineBeingEdited.startChanging(i,e),n=this.paneForSource(t),e.price=this._magnet.align(e.price,e.index,n),this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(i,e),
this._lineBeingEdited.setPoint(i,e,o),this._lineBeingEdited.updateAllViews(),r=this._paneInvalidationMask(n,I.LIGHT_UPDATE),r.force=!0,this.invalidate(r),t.linkKey&&!t.properties().singleChartOnly&&(s=this._externalTimeStamp(e.index),F.startChangingLineTool({linkKey:t.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:e.price,timeStamp:s},pointIndex:i,envState:o}))},l.prototype.lineBeingEdited=function(){return this._lineBeingEdited},l.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},l.prototype.changeLinePoint=function(t,e){var i,o,n,r,s=this.paneForSource(this._lineBeingEdited);void 0!==t.x&&void 0!==t.y?(n=this._lineBeingEdited.priceScale(),i=n.coordinateToPrice(t.y),o=Math.round(this.timeScale().coordinateToIndex(t.x)),i=this._magnet.align(i,o,s),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:i,index:o},e)):this._lineBeingEdited.setPoint(this._linePointBeingEdited,t,e),this._lineBeingEdited.updateAllViews(),this.invalidate(new I(I.LIGHT_UPDATE)),this._lineBeingEdited.linkKey&&!this._lineBeingEdited.properties().singleChartOnly&&(r=this._externalTimeStamp(o),F.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:i,timeStamp:r},envState:e}))},l.prototype.endChangingLinetool=function(t){var e,i,o=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,t),this._lineBeingEdited=null,this._linePointBeingEdited=null,e=new I(I.LIGHT_UPDATE),e.force=!0,this.invalidate(e),i={points:o._timePoint,interval:this.mainSeries().interval()},o.linkKey&&!o.properties().singleChartOnly&&F.finishChangingLineTool({model:this,linkKey:o.linkKey,symbol:this.mainSeries().symbol(),finalState:i})},l.prototype.startMovingSource=function(t,e,i){var o,n,r;this._sourceBeingMoved=t,this._linePointBeingMoved=i,this._sourceBeingMoved.startMoving(e,i),o=this.paneForSource(this._sourceBeingMoved),n=this._paneInvalidationMask(o,I.LIGHT_UPDATE),n.force=!0,this.invalidate(n),t.linkKey&&!t.properties().singleChartOnly&&(r=this._externalTimeStamp(e.index),F.startMovingLineTool({linkKey:t.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:e.price,timeStamp:r}}))},l.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved},l.prototype.moveSource=function(t){if(this._sourceBeingMoved.move(t,this._linePointBeingMoved),this.invalidate(new I(I.LIGHT_UPDATE)),this._sourceBeingMoved.linkKey&&!this._sourceBeingMoved.properties().singleChartOnly){var e=this._externalTimeStamp(t.index);F.moveLineTool({linkKey:this._sourceBeingMoved.linkKey,model:this,point:{price:t.price,timeStamp:e}})}},l.prototype.endMovingSource=function(t){var e,i,o=this._sourceBeingMoved,n=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving(t),this._sourceBeingMoved=null,this._linePointBeingMoved=null,e=this._paneInvalidationMask(n,I.LIGHT_UPDATE),e.invalidateAll(I.LIGHT_UPDATE),e.force=!0,this.invalidate(e),o instanceof f&&(i={points:o._timePoint,interval:this.mainSeries().interval()},
o.linkKey&&!o.properties().singleChartOnly&&F.finishMovingLineTool({linkKey:o.linkKey,model:this,finalState:i}))},l.prototype.finishLineTool=function(t){var e=this.lineBeingCreated();e&&(e.finish&&e.finish(),!t&&F.drawOnAllCharts().value()&&e.linkKey&&!e.properties().singleChartOnly&&F.finishLineTool({linkKey:e.linkKey,model:this}))},l.prototype.calculateDefaultTags=function(){var t,e,i=[],o=this.dataSources();for(t=0;t<o.length;t++)e=o[t],e.tags&&(i=i.concat(e.tags()));return i},l.prototype.changeZOrder=function(t,e){this.paneForSource(t).changeZOrder(t,e),this.invalidate(new I(I.FULL_UPDATE))},l.prototype.sendToBack=function(t){this.paneForSource(t).sendToBack(t),this.invalidate(new I(I.FULL_UPDATE))},l.prototype.bringToFront=function(t){this.paneForSource(t).bringToFront(t),this.invalidate(new I(I.FULL_UPDATE))},l.prototype.onTagsChanged=function(){return this._tagsChanged},l.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},l.prototype.setTimeViewport=function(t,e){this.timeScale().zoomToBarsRange(t,e),this.recalculateAllPanes(),this.invalidate(new I(I.LIGHT_UPDATE))},l.prototype.zoomToViewport=function(t,e,i,o,n){var s,a,l;this.setTimeViewport(t,e),s=Math.min(i,o),a=Math.max(i,o),l=n.defaultPriceScale(),l.setAutoScale(!1),l.isLog()&&(s=l.priceToLogical(s),a=l.priceToLogical(a)),l.setPriceRange(new r(s,a)),this.recalculateAllPanes(),this.invalidate(this._paneInvalidationMask(n,I.LIGHT_UPDATE))},l.prototype.clearAllStudies=function(){var t,e=this.dataSources();for(t=0;t<e.length;t++)e[t].clearData&&e[t].clearData()},l.prototype.allStudies=function(){return this._getAllSources(s)},l.prototype.allLineTools=function(){return this._getAllSources(a)},l.prototype.getStudyById=function(t){var e=this.dataSourceForId(t);return null!==e&&s(e)?e:null},l.prototype.getLineToolById=function(t){var e=this.dataSourceForId(t);return null!==e&&a(e)?e:null},l.prototype._getAllSources=function(t){var e,i,o,n,r,s,a=[],l=this.m_panes,c=l.length;for(e=0;e<c;++e)for(i=l[e],o=i.dataSources(),n=o.length,r=0;r<n;++r)s=o[r],t(s)&&a.push(s);return a},l.prototype.getStudyById=function(t){var e=this.dataSourceForId(t);return e instanceof A?e:null},l.prototype.backgroundColor=function(){return this._properties.paneProperties.background._value},l.prototype.backgroundCounterColor=function(){return"black"===p(d(this.backgroundColor()),150)?"white":"black"},l.prototype.isDark=function(){return"white"===this.backgroundCounterColor()},l.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()&&o.enabled("chart_zoom")},l.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()&&o.enabled("chart_zoom")},l.prototype.updateAllVolumeStudies=function(){var t,e,i,o,n,r,a=this.m_panes;for(t=a.length;t--;)for(e=!1,i=a[t],o=i.dataSources(),n=o.length;n--;)r=o[n],s(r)&&"Volume"===r.metaInfo().shortId&&(r.updateAllViews(),e||(this.updatePane(i),e=!0))},l.prototype.alertsList=function(){return this._alertsList},l.prototype.setAlertsStudiesList=function(t){this._alertsStudiesList=$.map($.grep(t,function(t){var e,i=t.plots||[]
;for(e=0;e<i.length;e++)if("line"===i[e].type)return!0;return!1}),function(t){return t.id})},l.prototype.canCreateAlertForDataSource=function(t){if(!o.enabled("alerts"))return!1},l.prototype._modelIntervals=[],l.prototype.setInterval=function(t,e){var i=setInterval(t,e);return this._modelIntervals.push(i),i},l.prototype.clearInterval=function(t){clearInterval(t);var e=this._modelIntervals.indexOf(t);e>-1&&this._modelIntervals.splice(e,1)},l.prototype.clearIntervals=function(){for(var t=0;t<this._modelIntervals.length;t++)clearInterval(this._modelIntervals[t]);this._modelIntervals=[]},l.prototype.destroy=function(){this.clearIntervals()},l.prototype.countUserStudies=function(t){var e,i,o,n,r,a,l=0;for(t=t||{},e=0;e<this.m_panes.length;e++)for(i=this.m_panes[e].dataSources(),o=0;o<i.length;o++)if(n=i[o],s(n)&&n.showInObjectTree()){if(r=n.metaInfo&&n.metaInfo()){if(a=r.id,t.dontCountVolume&&"Volume@tv-basicstudies"===a)continue;if(t.dontCountCompare&&"Compare@tv-basicstudies"===a)continue;if(t.dontCountOverlay&&"Overlay@tv-basicstudies"===a)continue}l++}return l},l.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()},l.prototype.copyToOtherCharts=function(t){var e,i,o,n;t.linkKey=t.linkKey||U.randomHash(),e=this,i=t.state(),o=this.mainSeries(),(n=o.syncModel())&&(i.points=t._timePoint.map(function(t){var i=e.timeScale().timePointToIndex(t.time_t)+t.offset;return{price:t.price,timeStamp:e._externalTimeStamp(i)}}),i.linetool=t.getType(),i.model=this,i.symbol=this.mainSeries().symbol(),i.finalState={points:t._timePoint,interval:this.mainSeries().interval()},F.copyLineTool(i))},l.prototype.restoreSource=function(t,e,i,o,n){var r,s,a,l,c,h,u,d;return r=t?this.createPane(e):this.panes()[e],a=o.type,s=a.toLowerCase().startsWith("study")?r._restoreStudy(o):r._restoreLineTool(o),l=s.ownerSource()?s.ownerSource().priceScale():r.priceScaleByName(n),l?(s.setPriceScale(l),l.addDataSource(s)):(l=new w(r._properties.overlayPropreties,this.properties().scalesProperties),l.setHeight(r.m_height),c=s.metaInfo&&"Volume@tv-basicstudies"===s.metaInfo().id,h=c?.75:r.m_rightPriceScale.topMargin(),u=c?0:r.m_rightPriceScale.bottomMargin(),l.setTopMargin(h),l.setBottomMargin(u),l.addDataSource(s),s.setPriceScale(l),s._isOverlay=!0),d=null,o.ownerSource&&(d=r.dataSourceForId(o.ownerSource)),s.setOwnerSource(d),s.setPriceScale(l),s.start(),s.restore&&s.restore(),t&&r.restoreState(i),this.recalculateAllPanes(),this.mainSeries().invalidateBarColorerCache(),this.invalidate(new I(I.FULL_UPDATE,!0)),s.linkKey&&F.restoreLineTool({model:this,linkKey:s.linkKey,state:{restorePane:t,paneIndex:e,paneState:i,sourceState:o,priceScaleName:n}}),s},l.prototype.restoreLineToolState=function(t,e){t.restorePoints(e.points,e.indexes||[]),t.properties().merge(e.state),t.restoreData&&t.restoreData(e),t.createServerPoints(),this.invalidate(new I(I.FULL_UPDATE)),t.linkKey&&F.restoreLineToolState({model:this,linkKey:t.linkKey,state:e})},l.prototype.createBrandingSource=function(){this._brandingSource=new C(this)},
l.prototype.onChartThemeLoaded=function(){return this._chartThemeLoaded},l.prototype.chartThemeLoaded=function(){this._chartThemeLoaded.fire()},l.prototype.selectBarMode=function(){return this.m_crossHairSource.selectBarMode()},l.prototype.toggleSelectBarMode=function(){this.m_crossHairSource.toggleSelectBarMode()},l.prototype.onBarSelected=function(){return this.m_crossHairSource.onBarSelected()},l.prototype.isSeriesStyleSupported=function(t){return this.m_mainSeries.isStyleSupported(t)},l.prototype.getStudyShiftColorStartOffset=function(){return this._studyShiftColorStartOffset},l.prototype.setStudyShiftColorStartOffset=function(t){this._studyShiftColorStartOffset=t},t.exports=l}).call(e,i(20),i(7),i(51),i(147))},function(t,e,i){(function(t){"use strict";function o(e,i,o,n,r,s,a,l){this._chartWidget=l,this.m_model=new U(e,i,o,n,r,s,a,this,!!l._containsData),this.m_zoomStack=new nt,this._onRearrangePanes=new t,this._onSimpleZoomIn=new t,this._onSimpleZoomOut=new t,this._currentCustomMoveSource=null}function n(t,e,i,o){st.call(this,i),this._targetObj=t,this._newValue=e,this._model=o}function r(t,e,i,o,n){st.call(this,o),this._property=t,this._priceScale=i,this._newValue=e,this._model=n}function s(t,e,i,o,n){st.call(this,o),this._percentage=t,this._priceScale=i,this._newValue=e,this._model=n}function a(t,e,i,o,n){st.call(this,o),this._log=t,this._priceScale=i,this._newValue=e,this._model=n}function l(t,e,i,o,n,r){st.call(this,o),this._style=t,this._mainSeries=i,this._priceAxisProperties=i.properties().priceAxisProperties,this._newValue=e,this._model=n,this._chartWidget=r}function c(t,e,i,o,n){st.call(this,o),this._property=t,this._mainSeries=i,this._priceAxisProperties=i.properties().priceAxisProperties,this._newValue=e,this._model=n}function h(t,e,i,o){st.call(this,"scale price",!1),this.m_model=t,this.m_pane=e,this.m_priceScale=i,this.m_state=o,this.m_newPriceScaleState=null}function u(t,e,i){st.call(this,i,!1),this.setCustomFlag("doesnt_affect_save",!0),this.m_model=t,this.m_state=e,this.m_newTimeScaleState=null}function d(t,e,i,o){this._model=t,this._series=e,this._oldSymbol=e.symbol(),this._oldInterval=e.interval(),this._symbol=i,this._interval=o}function p(t,e,i,o,n){st.call(this,"Insert "+e.id),this._model=t,this._studyMetaInfo=e,this._props=i,this._isOverlay=o,this._parentSource=n}function _(t,e){st.call(this,"Remove Source"),this._model=t,this._sourceId=e.id()}function f(t,e){st.call(this,"Remove Drawing(s)"),this._model=t,this._linetools=e,this._statesByPaneIndexes={}}function m(t,e,i,o){this._model=t,this._oldPane=this._model.paneForSource(e),st.call(this,this._oldPane===i?"Change Price Scale":"Move Source"),this._sourceId=e.id(),this._oldPaneIndex=t.panes().indexOf(this._oldPane),this._oldScaleName=this._oldPane.priceScaleName(e.priceScale()),this._pane=i,this._paneIndex=t.panes().indexOf(i),this._pane?this._scaleName=this._pane.priceScaleName(o):this._paneIndex=t.panes().length}function g(t,e,i){st.call(this,"Create line "+i,!1),this._model=t,this._paneIndex=t.panes().indexOf(e),this._lineTool=i}
function v(t,e,i,o){st.call(this,"Change Drawing",!1),this._model=t,this._prevState=e.state(!0),this._nextState=this._prevState}function y(t,e,i,o){st.call(this,"Move Drawing",!1),this._model=t,this._sourceId=e.id(),this._origPoint=i instanceof F?i.clone():TradingView.clone(i),this._pointIndex=o}function b(t,e,i){st.call(this,"Change %1 Z order (%2)".format(e.title(),i>0?"Forward":"Backward")),this._model=t,this._sourceId=e.id(),this._shift=i}function S(t,e){st.call(this,"Send "+e.title()+" to back"),this._model=t,this._sourceId=e.id()}function w(t,e){st.call(this,"Bring "+e.title()+" to front"),this._model=t,this._sourceId=e.id()}function T(t,e,i){st.call(this,"Remove pane"),this._model=t,this._index=e,this._pane=this._model.panes()[e],this._chart=i}function x(t,e,i,o){st.call(this,"Rearrange panes"),this._model=t,this._index=e,this._direction=i,this._chart=o}function C(t,e,i,o,n,r){st.call(this,"Zoom"),this._model=t,this._startBar=e,this._endBar=i,this._startPrice=o,this._endPrice=n,this._pane=r}function P(t,e,i){st.call(this,"Zoom"),this._baseCmd=t,this._zoomStack=e,this._inOut=i}function L(t,e,i,o,n){st.call(this,"",!1),this._model=t,this._paneA=e,this._paneB=i,this._prevStretchA=o,this._currStretchA=n}function I(t,e){st.call(this,"Restore Defaults"),this._model=t,this._defaultProperty=e,this._state=e.state(e._exclusions),this._chartWidget=t._undoModel._chartWidget}function k(t,e){st.call(this,"Apply Chart Theme"),this._model=t,this._newChartProps=TradingView.factoryDefaults("chartproperties"),this._newSeriesProps=TradingView.factoryDefaults("chartproperties.mainSeriesProperties"),["candleStyle","hollowCandleStyle","haStyle"].forEach(function(t){e.mainSourceProperties[t].wickUpColor=e.mainSourceProperties[t].wickUpColor||e.mainSourceProperties[t].wickColor,e.mainSourceProperties[t].wickDownColor=e.mainSourceProperties[t].wickDownColor||e.mainSourceProperties[t].wickColor}),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||e.chartProperties.paneProperties.gridProperties,e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||e.chartProperties.paneProperties.gridProperties,e.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=$.extend(!0,{},this._newChartProps,e.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,this._newSeriesProps=$.extend(!0,{},this._newSeriesProps,e.mainSourceProperties),this._newChartProps.symbolWatermarkProperties||(this._newChartProps.symbolWatermarkProperties=defaults("chartproperties.symbolWatermarkProperties"),
this._newChartProps.symbolWatermarkProperties.color=this._newChartProps.scalesProperties.textColor),this._oldChartProps=t.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=t.properties().state().mainSeriesProperties}function A(t,e){st.call(this,"Apply Drawing Template"),this._source=t,this._oldProps=t.properties().state(),this._newProps=e}function M(t,e,i,o){var n;o=o||"",n=o+" Study template",st.call(this,n),this._model=t,this._oldProps=e,this._newProps=i}function E(t,e,i,o,n){st.call(this,t),this._property=e,this._value=i,this._forceSetProperty=n,this._prevValue=e.value(),this._cw=o}function V(t,e){var i,o,n,r,s,a=e.priceScale(),l=[];for(a.isPercent()&&(i=e.firstValue()),o=0;o<t.length;o++)n={offset:t[o].offset,time_t:t[o].time_t},r=t[o].price,a.isPercent()&&(r=a.priceRange().convertToPercent(r,i)),s=a.priceToCoordinate(r),s-=40,r=a.coordinateToPrice(s),a.isPercent()&&(r=a.priceRange().convertFromPercent(r,i)),n.price=r,l.push(n);return l}function D(t,e,i){st.call(this,"clone "+e.title()),this._model=t,this._originalSource=e,this._withoutShift=i}function O(t,e){st.call(this,"Stop Sincing Drawing"),this._model=t,this._sourceId=e.id(),this._linkKey=e.linkKey}function B(t,e,i){st.call(this,"Paste Drawing"),this._model=t,this._clipboardData=e,this._paneIndex=this._model.panes().indexOf(i||this._model.paneForSource(this._model.mainSeries()))}function R(t,e){st.call(this,"Paste Indicator"),this._model=t,this._clipboardData=e}function z(t,e){st.call(this,"Move",!1),this._origPoint=t.clone(),this._point=null,this._handler=e}var F=i(1).Point,N=i(275),W=i(3).LineDataSource,H=i(7),U=i(213),j=i(44),q=i(37),G=i(1102).doAnimate,Y=i(110),K=i(11),Z=K.saveDefaultProperties,X=i(266),J=i(85),Q=i(61),tt=Q.Study,et=i(216),it=i(64),ot=i(372).createTooManyStudiesNotice,nt=i(498).UndoStack,rt=i(76).UndoHistory,st=i(176).UndoCommand,at=i(13).getLogger("Chart.ChartUndoModel");inherit(o,Y),o.prototype.version=function(){return this.m_model._version},o.prototype.onData=function(t){switch(t.method){case"timescale_update":var e=t.params;this.m_model.updateTimeScale(e.index,e.zoffset,e.changes,e.index_diff,e.marks,e.clear)}},o.prototype.paneForSource=function(t){return this.m_model.paneForSource(t)},o.prototype.createPane=function(t){return this.m_model.createPane(t)},o.prototype.dumpViews=function(){return this.m_model.dumpViews()},o.prototype.readOnly=function(){return this.m_model.readOnly()},o.prototype.restart=function(){this.m_model.restart()},o.prototype.disconnect=function(){this.m_model.disconnect()},o.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},o.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},o.prototype.chartModel=function(){return this.m_model},o.prototype.pushUndoCommand=function(t){rt.pushUndoCommand(t)},o.prototype.startScalePrice=function(t,e,i){this.pushUndoCommand(new h(this.m_model,t,e,e.state())),this.chartModel().startScalePrice(t,e,i)},
o.prototype.scalePriceTo=function(t,e,i){this.chartModel().scalePriceTo(t,e,i)},o.prototype.endScalePrice=function(t,e){this.chartModel().endScalePrice(t,e)},o.prototype.startScrollPrice=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollState=e.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(t,e,i))},o.prototype.scrollPriceTo=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new h(this.m_model,t,e,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(t,e,i))},o.prototype.endScrollPrice=function(t,e){e.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(t,e))},o.prototype.setPriceAutoScale=function(t,e,i){this.pushUndoCommand(new h(this.m_model,t,e,e.state())),this.chartModel().setPriceAutoScale(t,e,i)},o.prototype.resetPriceScale=function(t,e){this.pushUndoCommand(new h(this.m_model,t,e,e.state())),this.chartModel().resetPriceScale(t,e)},o.prototype.startScaleTime=function(t){this.pushUndoCommand(new u(this.m_model,this.m_model.timeScale().state(),"scale time")),this.chartModel().startScaleTime(t)},o.prototype.scaleTimeTo=function(t){this.chartModel().scaleTimeTo(t)},o.prototype.endScaleTime=function(){this.chartModel().endScaleTime()},o.prototype.startScrollTime=function(t){this._initialTimeScrollState=this.m_model.timeScale().state(),this._initialTimeScrollPos=t,this.chartModel().startScrollTime(t)},o.prototype.scrollTimeTo=function(t){this._initialTimeScrollPos&&Math.abs(t-this._initialTimeScrollPos)>20&&(this.pushUndoCommand(new u(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState),this.chartModel().scrollTimeTo(t)},o.prototype.gotoTime=function(t,e){var i,o,n=this.timeScale().visibleBars();if(null===n)return $.Deferred().reject().promise();i=n.firstBar(),o=this.m_model.timeScale().state(),this.chartModel().gotoTime(t,e),i!==this.timeScale().visibleBars().firstBar()&&this.pushUndoCommand(new u(this.m_model,o,"scroll time"))},o.prototype.endScrollTime=function(){this.chartModel().endScrollTime(),delete this._initialTimeScrollPos,delete this._initialTimeScrollState},o.prototype.resetTimeScale=function(){this.pushUndoCommand(new u(this.m_model,this.m_model.timeScale().state())),this.chartModel().resetTimeScale()},o.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()},o.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()},o.prototype.setWidth=function(t){this.m_model.setWidth(t)},o.prototype.setPaneHeight=function(t,e){this.m_model.setPaneHeight(t,e)},o.prototype.gridSource=function(){return this.m_model.gridSource()},o.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},o.prototype.brandingSource=function(){return this.m_model.brandingSource()},o.prototype.addAlertsSource=function(t){return this.m_model.addAlertsSource(t)},
o.prototype.alertsSources=function(){return this.m_model.alertsSources()},o.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},o.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},o.prototype.model=function(){return this.m_model},o.prototype.mainSeries=function(){return this.m_model.m_mainSeries},o.prototype.panes=function(){return this.m_model.m_panes},o.prototype.timeScale=function(){return this.m_model.timeScale()},o.prototype.setSelectedSource=function(t,e){this.m_model.setSelectedSource(t,e)},o.prototype.setHoveredSource=function(t,e){this.m_model.setHoveredSource(t,e)},o.prototype.selectedSource=function(){return this.m_model.selectedSource()},o.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},o.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},o.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},o.prototype.invalidate=function(t){this.m_model.invalidate(t)},o.prototype.setCurrentPosition=function(t,e,i,o){this.m_model.setCurrentPosition(t,e,i,o)},o.prototype.setAndSaveCurrentPosition=function(t,e,i,o){this.m_model.setAndSaveCurrentPosition(t,e,i,o)},o.prototype.modifySeries=function(t,e,i){var o=new d(this.m_model,t,e,i);this.pushUndoCommand(o)},o.prototype.canCreateStudy=function(t){return this.model().chartApi().chartApi().isCanCreateStudy(t)},o.prototype.checkIfFeatureAvailable=function(t,e){var i=this.canCreateStudy(),o=e&&e instanceof tt;return!this.readOnly()&&o&&(i=this.canCreateStudy(!0)),!!i||void(o||ot().open())},o.prototype._insertStudy=function(t,e,i,o){var n=new p(this.m_model,t,e,i,o);return this.pushUndoCommand(n),n.insertedStudy()},o.prototype.insertStudyWithoutCheck=function(){return this._insertStudy.apply(this,arguments)},o.prototype.insertStudy=function(t,e,i,o){if(this.checkIfFeatureAvailable(t,o))return this._insertStudy(t,e,i,o)},o.prototype.setProperty=function(t,e,i){if(t&&t.value()!==e){var o=new n(t,e,i,this.m_model);this.pushUndoCommand(o),this.emitEvent("setProperty")}},o.prototype.setPercentProperty=function(t,e,i,o){if(t.value()!==e){var n=new s(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setLogProperty=function(t,e,i,o){if(t.value()!==e){var n=new a(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setAutoScaleProperty=function(t,e,i,o){if(t.value()!==e){var n=new r(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setChartStyleProperty=function(t,e,i){if(t.value()!==e){var o=new l(t,e,this.mainSeries(),i,this.m_model,this._chartWidget);this.pushUndoCommand(o),this.emitEvent("setChartStyleProperty")}},o.prototype.setLockScaleProperty=function(t,e,i,o){if(t.value()!==e){var n=new c(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setScreenChartProperty=function(t,e,i,o,n){if(n||t.value()!==e){var r=new E(o,t,e,i,n);this.pushUndoCommand(r)}},o.prototype.beginUndoMacro=rt.beginUndoMacro,o.prototype.endUndoMacro=rt.endUndoMacro,o.prototype.createUndoCheckpoint=rt.createUndoCheckpoint,
o.prototype.undoToCheckpoint=rt.undoToCheckpoint,o.prototype._getSourcesTree=function(t){var e,i=[],o=this.m_model.children(t);for(e=0;e<o.length;e++)i=i.concat(this._getSourcesTree(o[e]));return i.push(t),i},o.prototype.removeSource=function(t,e){var i,o,n;if(t.isUserDeletable()){if(i=this._getSourcesTree(t),this.lineBeingCreated()===t)this.cancelCreatingLine();else{for(this.beginUndoMacro("Remove source"),o=0;o<i.length;++o)n=new _(this.m_model,i[o]),this.pushUndoCommand(n);this.endUndoMacro()}e||(1===i.length?this.emitEvent("removeSource",[i[0]]):this.emitEvent("removeSources",[i]))}},o.prototype.removeSelectedSource=function(){var t,e=this.m_model.selectedSource();e&&e.isUserDeletable()&&(this.setSelectedSource(null),t=new _(this.m_model,e),this.pushUndoCommand(t),this.emitEvent("removeSource",[e]))},o.prototype.removeLineTools=function(t){var e,i,o=this.lineBeingCreated();o&&-1!==(e=t.indexOf(o))&&(this.cancelCreatingLine(),t.splice(e,1)),i=new f(this.m_model,t),this.pushUndoCommand(i),this.emitEvent("removeSources",[t])},o.prototype.move=function(t,e,i){var o=new m(this.m_model,t,e,i);this.pushUndoCommand(o),this.emitEvent("moveSource",[t])},o.prototype.createLineTool=function(t,e,i,o,n){var r,s;return"LineToolRegressionTrend"!==i||this.canCreateStudy()?(this._createLineCommand=new g(this.m_model,t,i),r=this._createLineCommand.startCreatingLine(e,o,n),s=this._createLineCommand.line(),r&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),s):void ot().open()},o.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()},o.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()},o.prototype.coninueCreatingLine=function(t,e,i){var o=this._createLineCommand.continueCreatingLine(t,e,i);return o&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),o},o.prototype.finishLineTool=function(t){this.m_model.finishLineTool(t)},o.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()},o.prototype.lineCancelled=function(){return this.m_model.lineCancelled()},o.prototype.startChangingLinetool=function(t,e,i,o){this._currentLineChangeCommand=new v(this.m_model,t,i,o),this.m_model.startChangingLinetool(t,e,i,o)},o.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()},o.prototype.changeLinePoint=function(t,e){this._currentLineChangeCommand.setPoint(t,e),this.m_model.changeLinePoint(t,e)},o.prototype.endChangingLinetool=function(t){this.m_model.endChangingLinetool(t),this._currentLineChangeCommand.endChanging(),this.pushUndoCommand(this._currentLineChangeCommand),this._currentLineChangeCommand=null},o.prototype.startMovingSource=function(t,e,i){this._currentLineMoveCommand=new y(this.m_model,t,e,i),this.m_model.startMovingSource(t,e,i)},o.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()},o.prototype.moveSource=function(t){this._currentLineMoveCommand.setPoint(t),this.m_model.moveSource(t)},o.prototype.endMovingSource=function(t){
this.m_model.endMovingSource(t),this._currentLineMoveCommand._point&&(this.pushUndoCommand(this._currentLineMoveCommand),this._currentLineChangeCommand=null)},o.prototype.dataSources=function(){return this.m_model.dataSources()},o.prototype.orderedDataSources=function(t){return this.m_model.orderedDataSources(t)},o.prototype.dataSourceForId=function(t){return this.m_model.dataSourceForId(t)},o.prototype.state=function(t,e){return this.m_model.state(t,e)},o.prototype.asyncState=function(t){return this.m_model.asyncState(t)},o.prototype.restoreState=function(t,e){return this.m_model.restoreState(t,e)},o.prototype.calculateDefaultTags=function(){return this.m_model.calculateDefaultTags()},o.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()},o.prototype.changeZOrder=function(t,e){var i=new b(this.m_model,t,e);this.pushUndoCommand(i),this.emitEvent("changeZOrder",[t,e])},o.prototype.sendToBack=function(t){var e=new S(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("changeZOrder",[t])},o.prototype.bringToFront=function(t){var e=new w(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("changeZOrder",[t])},o.prototype.removeAllStudies=function(){var t,e,i;for(this.beginUndoMacro("remove all studies"),t=this.m_model.dataSources(),e=0;e<t.length;e++)i=t[e],(TradingView.isInherited(i.constructor,tt)&&!i.isChildStudy()&&i.removeByRemoveAllStudies()||TradingView.isInherited(i.constructor,et))&&this.removeSource(i);this.endUndoMacro()},o.prototype.removeAllDrawingTools=function(t){var e,i,o;for(this.beginUndoMacro("remove all drawing tools"),this.lineBeingCreated()&&this.cancelCreatingLine(),e=this.m_model.dataSources(),i=0;i<e.length;i++)o=e[i],TradingView.isInherited(o.constructor,W)&&o.isActualSymbol()&&o.isUserDeletable()&&(t&&t!==o._constructor||this.removeSource(o));this.endUndoMacro()},o.prototype.unlinkLine=function(t){var e=new O(this.m_model,t);this.pushUndoCommand(e)},o.prototype.copyToOtherCharts=function(t){this.m_model.copyToOtherCharts(t)},o.prototype.moveDown=function(){var t,e,i,o,n;try{this.beginUndoMacro("Move Down")}catch(t){return}t=this,e=this.m_model.mainSeries(),i=this.m_model.paneForSource(e),o=i.priceScaleForSource(e),o.setAutoScale(!1),n=o.height(),G({endValue:n/5,onStep:function(e){t.startScrollPrice(i,o,0),t.scrollPriceTo(i,o,e),t.endScrollPrice(i,o)},onComplete:function(){t.endUndoMacro()}})},o.prototype.moveUp=function(){var t,e,i,o,n;try{this.beginUndoMacro("Move Up")}catch(t){return}t=this,e=this.m_model.mainSeries(),i=this.m_model.paneForSource(e),o=i.priceScaleForSource(e),o.setAutoScale(!1),n=o.height(),G({endValue:n/5,onStep:function(e){t.startScrollPrice(i,o,e),t.scrollPriceTo(i,o,0),t.endScrollPrice(i,o)},onComplete:function(){t.endUndoMacro()}})},o.prototype.moveLeft=function(){var t,e;try{this.beginUndoMacro("Move Left")}catch(t){return}t=this.m_model.timeScale().width(),e=this,G({endValue:t/5,onStep:function(t){e.startScrollTime(t),e.scrollTimeTo(0),e.endScrollTime()},onComplete:function(){e.endUndoMacro()}})},o.prototype.moveRight=function(){var t,e;try{
this.beginUndoMacro("Move Right")}catch(t){return}t=this.m_model.timeScale().width(),e=this,G({endValue:t/5,onStep:function(t){e.startScrollTime(0),e.scrollTimeTo(t),e.endScrollTime()},onComplete:function(){e.endUndoMacro()}})},o.prototype.scrollChart=function(t){H.enabled("chart_scroll")&&(this.startScrollTime(0),this.scrollTimeTo(t),this.endScrollTime())},o.prototype.scrollChartByBar=function(t){if(H.enabled("chart_scroll")){var e=t*this.m_model.timeScale().barSpacing();this.startScrollTime(0),this.scrollTimeTo(e),this.endScrollTime()}},o.prototype.zoomIn=function(t,e){var i,o,n=this.m_model.timeScale().width(),r=this;if(e=e||1,this.canZoomIn())if(t)i=e*n/10,o=i*((t+1)/2),this.startScaleTime(i),this.scaleTimeTo(0),this.endScaleTime(),this.startScrollTime(0),this.scrollTimeTo(i-o),this.endScrollTime(),this._onSimpleZoomIn.fire();else{try{this.beginUndoMacro("Zoom In")}catch(t){return}G({endValue:n/5,onStep:function(t){r.startScaleTime(t),r.scaleTimeTo(0),r.endScaleTime()},onComplete:function(){r.endUndoMacro(),r._onSimpleZoomIn.fire()}})}},o.prototype.zoomOut=function(t,e){var i=this.m_model.timeScale().width(),o=this;if(e=e||1,this.canZoomOut())if(t)this.startScaleTime(0),this.scaleTimeTo(e*i/10),this.endScaleTime(),this.startScrollTime(e*(i/20-i/20*t)),this.scrollTimeTo(0),this.endScrollTime(),this._onSimpleZoomOut.fire();else{try{this.beginUndoMacro("Zoom Out")}catch(t){return}G({endValue:i/5,onStep:function(t){o.startScaleTime(0),o.scaleTimeTo(t),o.endScaleTime()},onComplete:function(){o.endUndoMacro(),o._onSimpleZoomOut.fire()}})}},o.prototype.resetScales=function(){var t,e;for(this.beginUndoMacro("Reset scales"),this.resetTimeScale(),t=0;t<this.panes().length;t++)e=this.panes()[t],this.resetPriceScale(e,e.leftPriceScale()),this.resetPriceScale(e,e.rightPriceScale());this.endUndoMacro(),this.m_model.recalculateAllPanes()},o.prototype.zoomToViewport=function(t,e,i,o,n){var r=new C(this.m_model,t,e,i,o,n),s=new P(r,this.m_zoomStack,!0);this.pushUndoCommand(s)},o.prototype.zoomFromViewport=function(){var t=new P(this.m_zoomStack.head(),this.m_zoomStack,!1);this.pushUndoCommand(t)},o.prototype.zoomStack=function(){return this.m_zoomStack},o.prototype.addPaneStretchFactorUndoCommand=function(t,e,i,o){var n=new L(this.m_model,t,e,i,o);this.pushUndoCommand(n)},o.prototype.restoreFactoryDefaults=function(t){var e=new I(this.m_model,t);this.pushUndoCommand(e)},o.prototype.chartLoadTheme=function(t,e){var i=new k(t,e);this.pushUndoCommand(i)},o.prototype.drawingLoadTemplate=function(t,e){var i=new A(t,e);this.pushUndoCommand(i)},o.prototype.studyLoadTemplate=function(t,e,i,o){var n=new M(t,e,i,o);this.pushUndoCommand(n)},o.prototype.onRearrangePanes=function(){return this._onRearrangePanes},o.prototype.onSimpleZoomIn=function(){return this._onSimpleZoomIn},o.prototype.onSimpleZoomOut=function(){return this._onSimpleZoomOut},o.prototype.loadRange=function(t){t.res!==this.m_model.mainSeries().properties().interval.value()?(this.m_model.mainSeries().setDefaultTimeframe(t.val),
this.setProperty(this.m_model.mainSeries().properties().interval,t.res,"Change date range")):this.m_model.mainSeries().loadDataTo(t.val)},o.prototype.cloneLineTool=function(t,e){var i=new D(this.m_model,t,e);return this.pushUndoCommand(i),this.emitEvent("cloneLineTool"),i.clonedLineToolId()},o.prototype._preparePriceAxisProperties=function(t,e){var i=t.lockScale.value(),o=t.style.value()===J.STYLE_PNF;(o||i)&&(e.log.setValue(!1),e.percentage.setValue(!1)),e.logDisabled.setValue(!(!o&&!i)),e.percentageDisabled.setValue(!(!o&&!i))},o.prototype.alertsList=function(){return this.m_model.alertsList()},o.prototype.alertsListChanged=function(){return this.m_model.alertsListChanged()},o.prototype.insertStudyStub=function(t){return this.m_model.insertStudyStub(t)},o.prototype.removeStudyStub=function(t){return this.m_model.removeStudyStub(t)},o.prototype.isJustClonedChart=function(){return this._chartWidget.isJustClonedChart()},o.prototype.copySourceToClip=function(t){if(t&&!t.properties().blockCopying){var e={};if(t instanceof W)e.type="drawing",e.geometry=t.geometry();else{if(!(t instanceof tt))return!1;e.type="study"}return e.source=t.state&&t.state(),(delete e.source.alertId,delete e.source.linkKey,e.source)?(e.title=t.title&&t.title(),e.modelId=this.m_model._id,X.set(e),!0):!1}},o.prototype.cutSourceToClip=function(t){if(!this.copySourceToClip(t))return!1;this.removeSource(t)},o.prototype.pasteLineTool=function(t,e){var i=new B(this.m_model,e,t);this.pushUndoCommand(i)},o.prototype.pasteStudy=function(t){var e=new R(this.m_model,t);this.pushUndoCommand(e)},o.prototype.pasteSourceFromClip=function(t,e){var i=X.get();if(!i)return!1;"drawing"===i.type&&this.pasteLineTool(t,i),"study"===i.type&&this.checkIfFeatureAvailable(i.state)&&this.pasteStudy(i)},o.prototype.trackTime=function(){return this._chartWidget.trackTime()},o.prototype.startCustomMoving=function(t,e,i){this._currentCustomMoveCommand=new z(e,i),this._currentCustomMoveSource=t},o.prototype.customMoveBeingProcessed=function(){return null!==this._currentCustomMoveSource},o.prototype.processCustomMove=function(t){this._currentCustomMoveCommand.setPoint(t)},o.prototype.endCustomMoving=function(){null!==this._currentCustomMoveCommand.point()&&(this.pushUndoCommand(this._currentCustomMoveCommand),this._currentCustomMoveCommand=null,this._currentCustomMoveSource=null)},inherit(n,st),n.prototype.redo=function(){this._oldValue=this._targetObj.value(),Z(!0),this._targetObj.setValue(this._newValue),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},n.prototype.undo=function(){Z(!0),this._targetObj.setValue(this._oldValue),Z(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(r,st),r.prototype.redo=function(){this._oldValue=this._property.value(),this._oldLockScaleValue=this._priceScale.mainSource()instanceof J?this._priceScale.mainSource().properties().lockScale.value():void 0,Z(!0),this._property.setValue(this._newValue),
this._oldLockScaleValue&&this._newValue&&this._priceScale.mainSource().properties().lockScale.setValue(!1),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},r.prototype.undo=function(){Z(!0),this._property.setValue(this._oldValue),this._oldLockScaleValue&&this._newValue&&this._priceScale.mainSource().properties().lockScale.setValue(this._oldLockScaleValue),Z(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(s,st),s.prototype.redo=function(){this._oldValue=this._percentage.value(),this._oldAutoScaleValue=this._priceScale.properties().autoScale.value(),this._oldLogValue=this._priceScale.properties().log.value(),this._oldLogDisabled=this._priceScale.properties().logDisabled.value(),Z(!0),this._percentage.setValue(this._newValue),this._priceScale.properties().autoScaleDisabled.setValue(this._newValue),this._priceScale.properties().log.setValue(!1),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},s.prototype.undo=function(){if(Z(!0),this._percentage.setValue(this._oldValue),this._priceScale.properties().autoScale.setValue(this._oldAutoScaleValue),this._priceScale.properties().autoScaleDisabled.setValue(this._oldValue),this._priceScale.properties().log.setValue(this._oldLogValue),!(this._oldAutoScaleValue||this._priceScale.mainSource()instanceof J&&this._priceScale.mainSource().isLockScale())){var t=this._model.timeScale().visibleBars();this._priceScale.setPriceRange(this._priceScale.priceRange().convertFromPercents(this._priceScale.mainSource().close(t.firstBar())))}Z(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(a,st),a.prototype.redo=function(){this._oldValue=this._log.value(),this._oldPercValue=this._priceScale.properties().percentage.value(),this._oldPercDisabled=this._priceScale.properties().percentageDisabled.value(),Z(!0),this._log.setValue(this._newValue),this._priceScale.properties().percentage.setValue(!1),this._priceScale.properties().autoScaleDisabled.setValue(this._priceScale.properties().percentage.value()),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},a.prototype.undo=function(){Z(!0),this._log.setValue(this._oldValue),this._priceScale.properties().percentage.setValue(this._oldPercValue),Z(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(l,st),l.prototype.redo=function(){var t=$.Deferred().resolve();this._mainSeries._properties.style===this._style&&this._model.mainSeries().isNeedRestart(this._newValue)&&(t=this._chartWidget.screen.show()),t.done(function(){this._oldValue=this._style.value(),this._oldAutoScale=this._priceAxisProperties.autoScale.value(),this._oldLogValue=this._priceAxisProperties.log.value(),this._oldLogDisabled=this._priceAxisProperties.logDisabled.value(),
this._oldPercentageValue=this._priceAxisProperties.percentage.value(),this._oldPercentageDisabled=this._priceAxisProperties.percentageDisabled.value(),Z(!0),this._style.setValue(this._newValue),this._chartWidget.model()._preparePriceAxisProperties(this._mainSeries.properties(),this._priceAxisProperties),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))}.bind(this))},l.prototype.undo=function(){var t=$.Deferred().resolve();this._mainSeries._properties.style===this._style&&this._model.mainSeries().isNeedRestart(this._newValue)&&(t=this._chartWidget.screen.show()),t.done(function(){Z(!0),this._style.setValue(this._oldValue),this._priceAxisProperties.log.setValue(this._oldLogValue),this._priceAxisProperties.logDisabled.setValue(this._oldLogDisabled),this._priceAxisProperties.percentage.setValue(this._oldPercentageValue),this._priceAxisProperties.percentageDisabled.setValue(this._oldPercentageDisabled),this._priceAxisProperties.autoScale.setValue(this._oldAutoScale),Z(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))}.bind(this))},inherit(c,st),c.prototype.redo=function(){this._oldValue=this._property.value(),this._oldAutoScale=this._priceAxisProperties.autoScale.value(),this._oldPercentage=this._priceAxisProperties.percentage.value(),this._oldLog=this._priceAxisProperties.log.value(),Z(!0),this._newValue&&(this._priceAxisProperties.percentage.setValue(!1),this._priceAxisProperties.log.setValue(!1),this._priceAxisProperties.autoScale.setValue(!1));var t=this._mainSeries.properties().style.value();t!==J.STYLE_RENKO&&t!==J.STYLE_KAGI&&t!==J.STYLE_PNF&&t!==J.STYLE_PB&&this._mainSeries.fixBoxSize(),this._property.setValue(this._newValue),Z(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},c.prototype.undo=function(){Z(!0),this._priceAxisProperties.percentage.setValue(this._oldPercentage),this._priceAxisProperties.log.setValue(this._oldLog),this._priceAxisProperties.autoScale.setValue(this._oldAutoScale),this._property.setValue(this._oldValue),Z(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE)))},inherit(h,st),h.prototype.undo=function(){if(null!==this.m_newPriceScaleState)return void at.logDebug("PriceScaleChangeUndoCommand.undo: Command is already undone");this.m_newPriceScaleState=this.m_priceScale.state(),this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_state),this.m_priceScale.recalcLockedScale(null)},h.prototype.redo=function(){if(null===this.m_newPriceScaleState)return void at.logDebug("PriceScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_newPriceScaleState),this.m_newPriceScaleState=null},inherit(u,st),u.prototype.undo=function(){if(null!==this.m_newTimeScaleState)return void at.logDebug("TimeScaleChangeUndoCommand.undo: Command is already undone")
;this.m_newTimeScaleState=this.m_model.timeScale().state(),this.m_model.restoreTimeScaleState(this.m_state),this.m_model.timeScale().recalcLockedScale()},u.prototype.redo=function(){if(null===this.m_newTimeScaleState)return void at.logDebug("TimeScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restoreTimeScaleState(this.m_newTimeScaleState),this.m_newTimeScaleState=null},inherit(d,st),d.prototype.redo=function(){this._model.modifySeries(this._series,this._symbol,this._interval)},d.prototype.undo=function(){this._model.modifySeries(this._series,this._oldSymbol,this._oldInterval)},inherit(p,st),p.prototype.redo=function(){var t=null;return this._studyState?(t=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._studyState,this._priceScaleName),this._studyId!==t.id()&&at.logError("Study was restored improperly - study ids does not match"),delete this._studyState):(t=this._model.insertStudy(this._studyMetaInfo,this._props,this._isOverlay,this._parentSource),this._studyId=t.id()),t},p.prototype.insertedStudy=function(){return this._model.dataSourceForId(this._studyId)},p.prototype.undo=function(){var t,e=this.insertedStudy();this._studyState=e.state(),t=this._model.paneForSource(e),this._paneIndex=this._model.panes().indexOf(t),this._priceScaleName=t.priceScaleName(e.priceScale()),this._paneState=t.state(),this._restorePane=this._model.removeSource(e)},inherit(_,st),_.prototype.redo=function(){var t,e=this._model.dataSourceForId(this._sourceId);this._sourceState=e.state(),t=this._model.paneForSource(e),this._paneIndex=this._model.panes().indexOf(t),this._priceScaleName=t.priceScaleName(e.priceScale()),this._paneState=t.state(),this._restorePane=this._model.removeSource(e)},_.prototype.undo=function(){var t=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._sourceState,this._priceScaleName);this._sourceId!==t.id()&&at.logError("Source was restored improperly - source ids does not match")},inherit(f,st),f.prototype.redo=function(){var t,e,i;for(t=0;t<this._linetools.length;t++)e=this._model.paneForSource(this._linetools[t]),i=this._model.panes().indexOf(e),this._statesByPaneIndexes[i]=this._statesByPaneIndexes[i]||[],this._statesByPaneIndexes[i].push({state:this._linetools[t].state(),owner:this._linetools[t].ownerSource().id()}),e.removeDataSource(this._linetools[t]);delete this._linetools},f.prototype.undo=function(){var t,e,i,o,n,r,s;this._linetools=[];for(t in this._statesByPaneIndexes)for(e=this._model.panes()[t],i=this._statesByPaneIndexes[t],o=0;o<i.length;o++)n=i[o],r=this._model.dataSourceForId(n.owner),s=e._restoreLineTool(n.state),s.setOwnerSource(r),s.updateAllViews(),this._linetools.push(s);this._model.invalidate(new q(q.LIGHT_UPDATE))},inherit(m,st),m.prototype.redo=function(){-1===this._model.panes().indexOf(this._pane)&&(this._pane=this._model.createPane(this._paneIndex)),this._model.move(this._model.dataSourceForId(this._sourceId),this._pane,this._pane.priceScaleByName(this._scaleName))},m.prototype.undo=function(){
-1===this._model.panes().indexOf(this._oldPane)&&(this._oldPane=this._model.createPane(this._oldPaneIndex)),this._model.move(this._model.dataSourceForId(this._sourceId),this._oldPane,this._oldPane.priceScaleByName(this._oldScaleName))},inherit(g,st),g.prototype.startCreatingLine=function(t,e,i){var o,n;return this._points=[{point:t}],o=this._model.panes()[this._paneIndex],n=this._model.createLineTool(o,t,this._lineTool,e,i),this._lineId=n.id(),!this._model.lineBeingCreated()},g.prototype.continueCreatingLine=function(t,e,i){return this._points||at.logError("continueCreatingLine is called before startCreatingLine"),this._points.push({point:t,envState:e}),this._model.coninueCreatingLine(t,e,i)},g.prototype.line=function(){return this._lineId?this._model.dataSourceForId(this._lineId):null},g.prototype.undo=function(){var t=this.line();t&&(this._lineState=t.state(),this._model.removeSource(t),delete this._lineId)},g.prototype.redo=function(){this._lineState||at.logError("This command was never undone - nothing to redo");var t=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);this._lineId=t.id(),delete this._lineState},inherit(v,st),v.prototype.setPoint=function(t){var e=this._model.dataSourceForId(this._nextState.id);this._nextState=e.state(!0)},v.prototype.endChanging=function(){var t=this._model.dataSourceForId(this._nextState.id);this._nextState=t.state(!0)},v.prototype.undo=function(){var t=this._model.dataSourceForId(this._prevState.id),e=this._prevState;this._model.restoreLineToolState(t,e)},v.prototype.redo=function(){var t=this._model.dataSourceForId(this._nextState.id),e=this._nextState;this._model.restoreLineToolState(t,e)},inherit(y,st),y.prototype.setPoint=function(t){this._point=t instanceof F?t.clone():TradingView.clone(t)},y.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(t,this._point,this._pointIndex),this._model.moveSource(this._origPoint),this._model.endMovingSource()},y.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(t,this._origPoint,this._pointIndex),this._model.moveSource(this._point),this._model.endMovingSource()},inherit(b,st),b.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(t,-this._shift)};b.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(t,this._shift)},inherit(S,st),S.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(t)},S.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(t)},inherit(w,st),w.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(t)},w.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(t)},o.prototype.removePane=function(t,e){var i=new T(this,e,t);this.pushUndoCommand(i)},inherit(T,st),T.prototype.redo=function(){
this._model.panes().splice(this._index,1),this._chart._updateGui()},T.prototype.undo=function(){this._model.panes().splice(this._index,0,this._pane),this._chart._updateGui()},o.prototype.rearrangePanes=function(t,e,i){var o=new x(this,e,i,t);this.pushUndoCommand(o),this._onRearrangePanes.fire()},inherit(x,st),x.prototype.redo=function(){var t=this._model.panes()[this._index];"up"===this._direction&&this._index>0&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index-1,0,t)),"down"===this._direction&&this._index<this._model.panes().length-1&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index+1,0,t)),this._model.invalidate(new q(q.FULL_UPDATE))},x.prototype.undo=function(){var t;"up"===this._direction&&(t=this._model.panes()[this._index-1],this._model.panes().splice(this._index-1,1),this._model.panes().splice(this._index,0,t)),"down"===this._direction&&(t=this._model.panes()[this._index+1],this._model.panes().splice(this._index+1,1),this._model.panes().splice(this._index,0,t)),this._model.invalidate(new q(q.FULL_UPDATE))},inherit(C,st),C.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)},C.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.invalidate(new q(q.LIGHT_UPDATE))},inherit(P,st),P.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void at.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},P.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void at.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(L,st),L.prototype.redo=function(){var t=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA,this._paneB._stretchFactor=t-this._currStretchA,this._model.invalidate(new q(q.FULL_UPDATE))},L.prototype.undo=function(){var t=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA,this._paneB._stretchFactor=t-this._prevStretchA,this._model.invalidate(new q(q.FULL_UPDATE))},inherit(I,st),I.prototype.redo=function(){this._model.restoreFactoryDefaults(this._defaultProperty)},I.prototype.undo=function(){this._defaultProperty.merge(this._state),this._defaultProperty.listeners().fire(this._defaultProperty),this._model.mainSeries().onChartStyleChanged()},inherit(k,st),k.prototype._merge=function(t,e){var i=this._model;Z(!0),t&&(i.properties().paneProperties.merge(t.paneProperties),i.properties().scalesProperties.merge(t.scalesProperties),
i.properties().symbolWatermarkProperties.merge(t.symbolWatermarkProperties)),i.mainSeries().properties().merge(e),i.mainSeries().properties().saveDefaults(),i.mainSeries().createPaneView(),i.mainSeries().invalidateBarStylesCache(),i._version=e.version,i.recalculateAllPanes(),i.invalidate(new q(q.FULL_UPDATE)),i.properties().saveDefaults(),i.properties().listeners().fire(this._properties),i.properties().scalesProperties.textColor.listeners().fire(i.properties().scalesProperties.textColor),Z(!1)},k.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},k.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(A,st),A.prototype._merge=function(t){var e=this._source;e.properties().merge(t),e.properties().saveDefaults(),e.propertiesChanged(),e.calcIsActualSymbol(),e.updateAllViews(),e._model.invalidate(new q(q.LIGHT_UPDATE))},A.prototype.undo=function(){this._merge(this._oldProps)},A.prototype.redo=function(){this._merge(this._newProps)},inherit(M,st),M.prototype._merge=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p=this._model.model(),_=p.mainSeries();for(_.properties().lockScale.setValue(!1),t.interval&&_.properties().interval.setValue(t.interval),e=[],i=p.panes(),o=i.length;o--;)for(n=i[o],r=n.containsMainSeries(),s=n.dataSources(),a=s.length;a--;)l=s[a],(!r||l instanceof tt)&&(l.isRemovedByStudyTemplates()||e.push(l),p.removeSource(l));for(c=t.panes,function(t,e){return t.dataSources().some(function(t){return t.alert&&t.alert().id===e.alert.id})},o=0;o<c.length;o++){for(h=!1,u=c[o],a=0;a<u.sources.length;a++)l=u.sources[a],"MainSeries"===l.type&&(delete l.state,h=!0);if(n=null,n=h?i[o]:p.createPane(o),n.restoreState(c[o],!1,t.version),h)for(d=0;d<e.length;d++)e[d].restore&&e[d].restore()}_.priceScale().setAutoScale(!0),p._version=t.version,p.startNotStartedStudies(),p.recalculateAllPanes(),p.invalidate(new q(q.FULL_UPDATE))},M.prototype.undo=function(){this._merge(this._oldProps),this._model.model().mainSeries().onChartStyleChanged()},M.prototype.redo=function(){var t,e,i;this._merge(this._newProps),t=this._model.model(),t.mainSeries().onChartStyleChanged(),e=this._model.model().mainSeries().properties(),i=this._model.model().mainSeries().properties().priceAxisProperties,this._model._preparePriceAxisProperties(e,i),t._recalcVisibleRangeStudy(t.dataSources(),!0)},inherit(E,st),E.prototype.redo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._value,this._forceSetProperty)}.bind(this))},E.prototype.undo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._prevValue,this._forceSetProperty)}.bind(this))},inherit(D,st),D.prototype.redo=function(){var t,e,i,o,n,r,s,a,l,c,h;if(this._lineState)r=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);else{for(t=this._originalSource,
e=t.priceScale(),i=this._model.paneForSource(t),o=TradingView.className(t.constructor),n=t.properties().clone(),r=N.create(o,this._model,n,null,t.ownerSource()),r.setOwnerSource(t.ownerSource()),r.properties().visible._value=!0,r._fixedPoints=r._fixedPoints.concat(t._fixedPoints),s=0;s<r._fixedPoints.length;s++)r._fixedPoints[s]=r._fixedPoints[s].add(new F(20,20));a=t._timePoint,l=this._withoutShift?TradingView.clone(a):V(a,t.ownerSource()),c=t._points,h=c,r.restorePoints(l,h),r.cloneData&&r.cloneData(t),i.addDataSource(r,e),this._model.updateSource(r),r.checkAlert&&r.checkAlert(),this._paneIndex=this._model.panes().indexOf(i),j.drawOnAllCharts().value()&&this._model.copyToOtherCharts(r),this._lineState=r.state()}},D.prototype.undo=function(){this._lineState||at.logError("This command was never executed - nothing to undo");var t=this._model.dataSourceForId(this._lineState.id);this._model.removeSource(t)},D.prototype.clonedLineToolId=function(){return this._lineState.id},inherit(O,st),O.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},O.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},inherit(B,st),B.prototype.redo=function(){var t,e,i,o,n,r,s,a,l,c=this._model.panes()[this._paneIndex],h=c.dataSourceForId(this._clipboardData.source.ownerSource)||c.mainDataSource();this._sourceState||(t=!0,e=this._clipboardData.source.state.symbol,i=c.mainDataSource(),o=i.symbol?i.symbol():"",n=e===o,n&&(h instanceof J&&(t=!1),h instanceof tt&&(t=!h.metaInfo().is_price_study)),r=TradingView.clone(this._clipboardData.source),delete r.state.symbol,t?(s=this._model,a=function(t){var e=t.x*s.timeScale().width(),i=t.y*h.priceScale().height();return new F(e,i)},r.points=this._clipboardData.geometry.map(function(t){var e,i=a(t),o=s.timeScale().coordinateToIndex(i.x),n=s.timeScale().normalizeBarIndex(o);return n.price=h.priceScale().coordinateToPrice(i.y),h.priceScale().isPercent()&&(e=h.firstValue(),n.price=h.priceScale().priceRange().convertFromPercent(n.price,e)),n})):this._model._id===this._clipboardData.modelId&&h.id()===this._clipboardData.source.ownerSource&&(r.points=V(this._clipboardData.source.points,h)),r.id=it.guid(),this._sourceState=r),l=c._restoreLineTool(this._sourceState,null,!1),l.calcIsActualSymbol(),l.setOwnerSource(h),l.setPriceScale(h.priceScale()),h.priceScale().addDataSource(l),l.createServerPoints(),this._model.invalidate(new q(q.LIGHT_UPDATE,!0))},B.prototype.undo=function(){var t,e;this._sourceState||at.logError("This command was never executed - nothing to undo"),t=this._model.panes()[this._paneIndex],e=t.dataSourceForId(this._sourceState.id),this._model.removeSource(e)},inherit(R,st),R.prototype.redo=function(){var t,e,i,o;this._sourceState||(t=TradingView.clone(this._clipboardData.source),t.id=it.guid(),this._sourceState=t),e=null,i=null,this._sourceState.metaInfo.is_price_study?(e=this._model.paneForSource(this._model.mainSeries()),i=this._model.mainSeries().priceScale()):(e=this._model.createPane(),i=e.defaultPriceScale()),
o=e._restoreStudy(this._sourceState),o.start(),o.setPriceScale(i),e.move(o,i)},R.prototype.undo=function(){this._sourceState||at.logError("This command was never executed - nothing to undo");var t=this._model.dataSourceForId(this._sourceState.id);this._model.removeSource(t)},inherit(z,st),z.prototype.setPoint=function(t){this._point=t.clone(),this._handler(t)},z.prototype.point=function(){return this._point},z.prototype.undo=function(){this._handler(this._origPoint)},z.prototype.redo=function(){this._handler(this._point)},e.ChartUndoModel=o}).call(e,i(20))},function(t,e,i){(function(e){"use strict";function i(t){e.call(this,""),this.subscribe(this,i.prototype.checkSelfColor),this.reloadProperties(t)}inherit(i,e),i.prototype.reloadProperties=function(t){for(;this._childs.length>0;)this.removeProperty(this._childs[0]);this._initValues=[];for(var e=0;e<t.length;++e)this._initValues.push(t[e].defaultValue),this.addChild(e,t[e].property);this.checkSelfColor()},i.prototype.setValue=function(t,i){if(this._value!==t||i){var o=this;this._childs.forEach(function(e){o[e].setValue(t||o._initValues[e])}),e.prototype.setValue.call(this,t,i)}},i.prototype.checkSelfColor=function(){var t,i=!0;for(t=0;t<this._initValues.length;++t)if(this[t].value()!==this[0].value()){i=!1;break}e.prototype.setValue.call(this,i?this[0].value():"")},t.exports=i}).call(e,i(52))},function(t,e,i){(function(e){"use strict";function o(t,i){var o=this;f.call(this),this._properties=i,this._model=t,this._dataWindowView=new h(this,t),this._priceAxisView=new c(this),this._startMeasurePriceAxisView=new c(this),this._endMeasurePriceAxisView=new c(this),this._timeAxisView=new u(this,t),this._startMeasureTimeAxisView=new u(this,t,"measureStartX"),this._endMeasureTimeAxisView=new u(this,t,"measureEndX"),this.visible=!0,t.readOnly()?this.areLinesVisible=!0:m.cursorTool.subscribe(function(t){o.areLinesVisible="arrow"!==t},{callWithLast:!0}),this._movedDelegate=new e,this._subscribed=!1,this._model.readOnly()&&(this.visibleTrap=!0),this._selectBarMode=new L(!1),this._barSelectedDelegate=new e,this._mouseClickBoundedHandler=this._mouseClickHandler.bind(this),this._isOnHoveredChartWidget=!1}function n(t,e){this._source=t,this._pane=e,this._pipFormatter=null,this._lastSymbolInfo=null,this._horzTrenRenderer=new d,this._vertTrenRenderer=new d,this._bgRenderer=new _,this._labelRenderer=new p({})}function r(t,e,i,o){this.source=t,this.pane=e,this._horzVisible=i,this._mouseClickHandler=o}function s(t,e,i){this.source=t,this.pane=e,this._axis=i||"x"}var a=i(1).Point,l=i(3).LineDataSource,c=i(1131).CrossHairPriceAxisView,h=i(827),u=i(828),d=i(16).TrendLineRenderer,p=i(27).TextRenderer,_=i(70).RectangleRenderer,f=i(62).DataSource,m=i(44),g=i(950).PaneRendererCrossHair,v=i(949).PaneRendererCrossHairLock,y=i(8).CompositeRenderer,b=i(37),S=i(94).PercentageFormatter,w=i(175).TimeSpanFormatter,T=i(145).PipFormatter,x=i(19),C=i(18).LineEnd,P=i(115),L=i(51);inherit(o,f),o.prototype.index=0,o.prototype.price=NaN,o.prototype.pane=null,o.prototype.color="white",o.prototype.style="",
o.prototype.customization={disableSelection:!0},o.prototype.properties=function(){return this._properties},o.prototype.moved=function(){return this._movedDelegate},o.prototype.saveOriginCoord=function(t,e){this._originX=t,this._originY=e},o.prototype.clearOriginCoord=function(){this._originX=NaN,this._originY=NaN},o.prototype.setPosition=function(t,e,i){this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,o.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.visible=!0,this._tryToUpdateViews(t,e,i)},o.prototype.update=function(){var t,e,i,o,n;this.visible&&(t=this._priceScaleByPane(this.pane),e=this._originX||this.x,i=this._originY||this.y,o=this._model.timeScale().coordinateToIndex(e),n=NaN,null!==t&&(n=t.coordinateToPrice(i)),this._tryToUpdateViews(o,n,this.pane))},o.prototype._priceScaleByPane=function(t){return t&&!t.defaultPriceScale().isEmpty()?t.defaultPriceScale():null},o.prototype._tryToUpdateViews=function(t,e,i){this._tryToUpdateData(t,e,i)&&(this.updateAllViews(),this._movedDelegate.fire({time:this._model.timeScale().points().roughTime(this.index),price:this.price}))},o.prototype._tryToUpdateData=function(t,e,i){var o=this.x,n=this.y,r=this.price,s=this.index,a=this.pane,l=this._priceScaleByPane(i);return this.index=t,this.x=this._model.timeScale().indexToCoordinate(t),null!==l?(this.pane=i,this.price=e,this.y=l.priceToCoordinate(e)):(this.pane=null,this.price=NaN,this.y=NaN),o!==this.x||n!==this.y||s!==this.index||r!==this.price||a!==this.pane},o.prototype.setLockedPosition=function(t){delete this.lockedIndex,delete this.lockedX,t!==this._measurePane&&m.lockTimeAxis().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(m.lockTimeAxisTime.value()),this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex))},o.prototype.clearPosition=function(){this.visible=!1;var t=this._model.mainSeries().bars().lastIndex();this.index=null!==t?t:NaN,this.price=NaN,this.x=NaN,this.y=NaN,this.clearOriginCoord()},o.prototype.measureStartY=function(){var t,e=this._startMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureStartX=function(){return this._model.timeScale().indexToCoordinate(this._startMeasurePoint.index)},o.prototype.measureEndY=function(){var t,e=this._endMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureEndX=function(){return this._model.timeScale().indexToCoordinate(this._endMeasurePoint.index)},o.prototype.paneViews=function(t){var e=this._selectBarMode.value()&&this._isOnHoveredChartWidget,i=t===this.pane&&!e,o=[new r(this,t,i,this._mouseClickBoundedHandler)];return t===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new n(this,t)),
this._measurePaneView.update(),o.push(this._measurePaneView)),m.lockTimeAxis().value()&&o.push(this._timeLockPaneView=this._timeLockPaneView||new s(this,t)),o},o.prototype.dataWindowView=function(){return this._dataWindowView},o.prototype.priceAxisViews=function(t,e){var i,o;return this.visibleTrap&&this.visible&&this.pane===t&&e===t.defaultPriceScale()?(i=[],o=this._selectBarMode.value()&&this._isOnHoveredChartWidget,o||i.push(this._priceAxisView),this._startMeasurePoint&&i.push(this._startMeasurePriceAxisView),this._endMeasurePoint&&i.push(this._endMeasurePriceAxisView),i):null},o.prototype.timeAxisView=function(){if(!this.visibleTrap||!this.visible&&!m.lockTimeAxis().value())return null;var t=[this._timeAxisView];return this._startMeasurePoint&&t.push(this._startMeasureTimeAxisView),this._endMeasurePoint&&t.push(this._endMeasureTimeAxisView),t},o.prototype.updateAllViews=function(){this._priceAxisView.update(),this._startMeasurePoint&&(this._startMeasurePriceAxisView.update(),this._startMeasureTimeAxisView.update()),this._endMeasurePoint&&(this._endMeasurePriceAxisView.update(),this._endMeasureTimeAxisView.update()),this._timeAxisView.update()},o.prototype.startMeasurePoint=function(){return this._startMeasurePoint},o.prototype.startMeasuring=function(t,e){if(e.defaultPriceScale().isPercent()){var i=e.mainDataSource().firstValue();t.price=e.defaultPriceScale().priceRange().convertFromPercent(t.price,i)}this._startMeasurePoint=t,this._measurePane=e},o.prototype.finishMeasure=function(t){var e,i=this._measurePane;i.defaultPriceScale().isPercent()&&(e=i.mainDataSource().firstValue(),t.price=i.defaultPriceScale().priceRange().convertFromPercent(t.price,e)),this._endMeasurePoint=t},o.prototype.endMeasurePoint=function(){return this._endMeasurePoint},o.prototype.clearMeasure=function(t){delete this._measurePane,delete this._startMeasurePoint,delete this._endMeasurePoint,delete this._lastValidMeasurePoint,this._model.invalidate(new b(b.LIGHT_UPDATE))},o.prototype.measurePoints=function(){var t,e,i,o,n;return this.updateAllViews(),t=[this._startMeasurePoint],this._endMeasurePoint?t.push(this._endMeasurePoint):(this._measurePane===this.pane&&(this._lastValidMeasurePoint={x:this.x,y:this.y,rawPrice:this.price,price:this.price,index:this.index}),e=this._lastValidMeasurePoint.rawPrice,i=this._measurePane,o=i.defaultPriceScale(),o.isPercent()&&!o.isEmpty()&&(n=i.mainDataSource().firstValue(),this._lastValidMeasurePoint.price=o.priceRange().convertFromPercent(e,n)),t.push(this._lastValidMeasurePoint)),t},o.prototype.currentPoint=function(){return new a(this.x,this.y)},o.prototype.appliedIndex=function(){return isFinite(this.lockedIndex)&&this.lockedIndex||this.index},o.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x},o.prototype.selectBarMode=function(){return this._selectBarMode},o.prototype.toggleSelectBarMode=function(){this._setSelectBarModeState(!this._selectBarMode.value())},o.prototype.onBarSelected=function(){return this._barSelectedDelegate},
o.prototype._setSelectBarModeState=function(t){this._selectBarMode.setValue(t),this._model.invalidate(new b(b.LIGHT_UPDATE))},o.prototype._mouseClickHandler=function(){var t=this._model.timeScale().indexToTimePoint(this.index);null!==t&&(this._setSelectBarModeState(!1),this._barSelectedDelegate.fire(t))},o.prototype.handleContextMenuEvent=function(){this._selectBarMode.value()&&this._setSelectBarModeState(!1)},o.prototype.setOnHoveredChartWidget=function(t){this._isOnHoveredChartWidget=t},o.prototype.isOnHoveredChartWidget=function(){return this._isOnHoveredChartWidget},n.prototype.update=function(){var t,e,i,o,n,r,s,l,c,h,u,d,p,_,f,m,g,v;if(this._source._endMeasurePoint)t=this._source._endMeasurePoint.price,e=this._source._endMeasurePoint.index;else if(this._source._measurePane===this._source.pane)t=this._source.price,e=this._source.index;else{if(!this._source._lastValidMeasurePoint)return;t=this._source._lastValidMeasurePoint.rawPrice,e=this._source._lastValidMeasurePoint.index}i=t-this._source._startMeasurePoint.price,o=e-this._source._startMeasurePoint.index,n=this._source._startMeasurePoint.price,r=this._source._measurePane,r.defaultPriceScale().isPercent()&&(s=r.mainDataSource().firstValue(),this._source._endMeasurePoint&&(t=r.defaultPriceScale().priceRange().convertToPercent(t,s)),n=r.defaultPriceScale().priceRange().convertToPercent(n,s)),l=this._source._measurePane.defaultPriceScale().formatter().format(i),this._source._startMeasurePoint.price&&(c=i/this._source._startMeasurePoint.price,l+=" ("+(new S).format(100*c)+")"),this._label=l+"\n"+$.t("{0} bars").format(o),n=this._source._model._magnet.align(n,this._source._startMeasurePoint.index,this._source._measurePane),t=this._source._model._magnet.align(t,e,this._source._measurePane),h=this._source._model.timeScale().indexToCoordinate(this._source._startMeasurePoint.index),u=this._source._model.timeScale().indexToCoordinate(e),d=this._source._measurePane.defaultPriceScale().priceToCoordinate(n),p=this._source._measurePane.defaultPriceScale().priceToCoordinate(t),this._p1=new a(h,d),this._p2=new a(u,p),_=this._source._model.timeScale().indexToUserTime(this._source._startMeasurePoint.index),f=this._source._model.timeScale().indexToUserTime(e),m=this._pane.model().mainSeries().symbolInfo(),m&&m!==this._lastSymbolInfo&&(this._pipFormatter=new T(m.pricescale,m.minmov,m.type,m.minmove2),this._lastSymbolInfo=m),_&&f&&(g=(f.valueOf()-_.valueOf())/1e3,v=this._pipFormatter?" , "+this._pipFormatter.format(i):"",this._label=""+l+v+"\n"+$.t("{0} bars").format(o)+", "+(new w).format(g))},n.prototype.renderer=function(){var t,e,i,o,n,r,s,l,c,h,u,d,p=new y,_={};return _.points=[this._p1,this._p2],_.width=this._source._model.timeScale().width(),_.height=this._source._measurePane.defaultPriceScale().height(),_.color="#D3E7FF",_.linewidth=0,_.fillBackground=!0,_.transparency=60,_.backcolor="#BADAFF",this._bgRenderer.setData(_),p.append(this._bgRenderer),t=this._p1.add(this._p2).scaled(.5),e=new a(this._p1.x,t.y),i=new a(this._p2.x,t.y),o={points:[e,i],width:_.width,
height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:C.Normal,rightend:C.Arrow},this._horzTrenRenderer.setData(o),p.append(this._horzTrenRenderer),e=new a(t.x,this._p1.y),i=new a(t.x,this._p2.y),o={points:[e,i],width:_.width,height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:C.Normal,rightend:C.Arrow},this._vertTrenRenderer.setData(o),p.append(this._vertTrenRenderer),n={x:0,y:10},r=function(t,e){return{points:[e],text:t,color:"#FFFFFF",horzAlign:"left",vertAlign:"middle",font:"Arial",offsetX:n.x,offsetY:n.y,bold:!1,italic:!1,fontsize:12,padding:5,highlightBorder:!1,backgroundColor:x.generateColor("#5b85bf",10),backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4}},s=.5*(this._p1.x+this._p2.x),l=this._p2.y,c=new a(s,l),h=r(this._label,c),this._labelRenderer.setData(h),u=this._labelRenderer.measure(),d={x:s+h.backgroundHorzInflate+u.textBgPadding-u.width/u.textBgPadding,y:this._p1.y>this._p2.y?c.y-u.height-2*u.textBgPadding-n.y>0?l-u.height-n.y+u.textBgPadding:n.y-2*u.textBgPadding:c.y+u.height+u.textBgPadding+n.y>_.height?_.height-u.height-n.y:l+u.textBgPadding},this._labelRenderer.setPoints([new a(d.x,d.y)]),p.append(this._labelRenderer),p},r.prototype.update=function(){},r.prototype.renderer=function(){var t,e,i,o,n,r,s={},a=this.source.visible&&this.source.areLinesVisible,c=m.lockTimeAxis().value();return s.horzLinesVisible=a&&this._horzVisible,s.vertLinesVisible=a||c,t=this.pane._model.readOnly(),e=t?defaults("chartproperties.paneProperties.crossHairProperties"):null,i=this.source.selectBarMode().value()&&this.source.isOnHoveredChartWidget(),o=TradingView.isMobile.any()&&l.isLineTool(this.source._model.currentTool())&&!i,n=o?"#a000a0":t?e.color:this.pane._model.properties().paneProperties.crossHairProperties.color.value(),r=t?e.transparency:this.pane._model.properties().paneProperties.crossHairProperties.transparency.value(),!o&&r>0&&(n=x.generateColor(n,r)),s.color=n,s.lineWidth=t?e.width:this.pane._model.properties().paneProperties.crossHairProperties.width.value(),s.lineStyle=t?e.style:this.pane._model.properties().paneProperties.crossHairProperties.style.value(),s.drawCenter=o&&this.pane===this.source.pane,s.w=this.pane.width(),s.h=this.pane.height(),s.x=isFinite(this.source.lockedX)&&this.source.lockedX||this.source.x,s.y=this.source.y,i&&(s.x=Math.max(0,this.source.x-1),s.vertLinesVisible=!0,s.lineStyle=P.LINESTYLE_SOLID,s.mouseClickHandler=this._mouseClickHandler,s.lineWidth=2,s.color="#ff0000"),new g(s)},s.prototype.update=function(){},s.prototype.renderer=function(){var t,e,i,o,n=this.source.visible&&this.source.areLinesVisible,r=m.lockTimeAxis().value(),s=n&&this._horzVisible,a=n||r;if(("y"!==this._axis||s)&&a)return t=9,e=11,i="y"===this._axis?this.pane.width()-t/2:this.source.lockedX+1,o="y"===this._axis?this.source.y:this.pane.height()-e/2-1,new v({x:i,y:o,width:t,height:e,bodyHeight:7})},t.exports=o}).call(e,i(20))
},function(t,e,i){"use strict";function o(t,e){r.call(this),this._header=null,this._crossHair=t,this._model=e,this._items.push(new s("Date","")),this._items.push(new s("Time","")),this._items.push(new s("Price","")),this._defaultFormatter=new a(100)}var n=i(209),r=n.DataWindowView,s=n.DataWindowItem,a=i(41).PriceFormatter,l=i(228).DateFormatter,c=i(174).TimeFormatter;inherit(o,r),o.prototype.update=function(){var t,e,i,o,n,r,s=this._model.mainSeries().isDWM();this._items[1].setVisible(!s),this._items[0].setValue("n/a"),this._items[1].setValue("n/a"),this._items[2].setValue("n/a"),this._model.timeScale().isEmpty()||(t=this._crossHair.appliedIndex(),e=this._model.timeScale().indexToUserTime(t),null===e?(this._items[0].setValue("n/a"),s||this._items[1].setValue("n/a")):(this._items[0].setValue((new l).format(e)),s||this._items[1].setValue((new c).format(e))),(i=this._crossHair.pane)&&(o=i.defaultPriceScale(),o.isEmpty()||(n=o.mainSource(),r=n?n.formatter():this._defaultFormatter,this._items[2].setValue(r.format(this._crossHair.price)))))},t.exports=o},function(t,e,i){"use strict";function o(t,e){n.call(this),this._invalidated=!0,this._crosshair=t,this._model=e,this._renderer=new r,this._rendererData={visible:!1,background:"#585858",color:"white",text:"",width:0}}var n=i(317).TimeAxisView,r=i(284),s=i(173).DateTimeFormatter;inherit(o,n),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i=this._rendererData;i.visible=!1,t=this._model.timeScale(),t.isEmpty()||(i.width=t.width(),i.coordinate=this._crosshair.appliedX(),(e=t.indexToUserTime(this._crosshair.appliedIndex()))&&(i.text=new s(this._model.mainSeries().isDWM()).format(e),i.visible=!0))},o.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData(this._rendererData),this._renderer},t.exports=o},function(t,e,i){"use strict";function o(t,e,o,r,s,a,l,c){var h=i(824).ChartUndoModel,u=new h(t,e,o,r,s,a,l,c);return u.model().invalidate(new n(n.FULL_UPDATE)),u}var n=i(37),r=i(45);TradingView.MAMetaInfo=function(){return new r({id:"MASimple",inputs:[{id:"length",type:"integer",defval:10},{id:"source",type:"text",defval:"close"}],plots:[{id:"MovAvg",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"true"}],palettes:{}})},TradingView.VolumeMetaInfo=function(){var t={id:"Volume",inputs:[],plots:[{id:"Volume",type:"histogram"},{id:"Color",type:"colorer",palette:"volumePalette",target:"Volume"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{volumePalette:{colors:{0:{color:"#007F0E",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Up Volume"},1:{color:"#872323",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Down Volume"}}}}};return new r(t)},TradingView.DMMetaInfo=function(){return new r({id:"DM",inputs:[{id:"ADX smoothing",max:50,min:1,type:"integer",defval:14},{id:"DI Length",max:500,min:1,type:"integer",defval:14}],plots:[{id:"ADX",type:"line"},{id:"DI_P",type:"line"},{id:"DI_N",type:"line"}],properties:[{id:"is_price_study",type:"bool",
value:"false"}],palettes:{}})},TradingView.RSIMetaInfo=function(){return new r({id:"RSI",inputs:[{id:"length",type:"integer",defval:14}],plots:[{id:"RelativeStrengthIndex",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._lastClickedId=null,this._model=t,this._study=e,this._metaInfo=e.metaInfo(),this._lollipops={},this._textCache={},this.templatesCache={},this._invalidated=!0,this.templatesCache.hovered=this.createTemplate(this.hoveredStyle),this.templatesCache.default=this.createTemplate(this.defaultStyle),t.properties().paneProperties.background.subscribe(this,this.onPaneBgChange)}function n(t){this.data=t}function r(t){this.data=t,this._hittest=new c(c.CUSTOM,t)}function s(t,e){this._data=t,this._paneView=e,this.textRenderer=new s.TextRenderer(t.style.lollipop.importance)}var a=i(1).Point,l=i(49).pointInCircle,c=i(4),h=i(8).CompositeRenderer,u=i(370).Tooltip;o.prototype.onPaneBgChange=function(){this.defaultStyle.lollipop.fillStyle=this._model.properties().paneProperties.background.value(),this._stylesCache=null,Object.keys(this.templatesCache).forEach(function(t){0===t.indexOf("default")&&(this.templatesCache[t]=null)},this)},o.prototype.onClickOutside=function(){this._lastClickedId=null},o.prototype.closeTooltips=function(){var t,e;for(t in this._lollipops)this._lollipops.hasOwnProperty(t)&&(e=this._lollipops[t],e.visible&&(e.tooltip.isOpened()&&e.tooltip.hide(),e.visible=!1))},o.prototype.getLastClickedLollipopId=function(){return this._lastClickedId},o.prototype._setStackStudies=function(){this._stackStudies=[]},o.prototype._getY=function(){var t,e,i=0,o=this._model.panes();for(t=o.length;t--;)e=o[t],e.containsMainSeries()&&(i+=e.height());return i},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u;this._setStackStudies(),t=this,e=this._study.data(),i=this._model.timeScale(),o=i.visibleBars(),n=this._model.mainSeries().bars(),r=this._study.priceScale(),s=this._model.mainSeries(),a=s.firstBar(),r&&!r.isEmpty()&&!i.isEmpty()&&a&&e&&(this.closeTooltips(),l=this._getY(),c=o.firstBar(),h=o.lastBar(),u=e.range(c,h),u.each(function(e,o){var s,a=0;for(s=0;s<t._stackStudies.length;++s)t._stackStudies[s].data().contains(e)&&++a;e>c&&e<h&&t.addLollipop(l,n,i,r,e,o,a)}),this.afterUpdate(l,n,i,r))},o.prototype.addLollipop=function(t,e,i,o,n,r,s){var l,c,h,d,p,_,f,m,g=r[0],v=this._model.mainSeries().symbolInfo();v&&(l=v.name,c=null,h=this._study.metaInfo().id+"_"+g+"_"+l,d=this._model.lastHittestData(),p=d&&d.id===h,p&&null!==(_=e.valueAt(n))&&(f=_[TradingView.LOW_PLOT],o.isPercent()&&(m=this._model.mainSeries().firstValue(),f=o.priceRange().convertToPercent(f,m)),c=o.priceToCoordinate(f)),this._lollipops[h]=$.extend({id:h,visible:!0,basePoint:new a(i.indexToCoordinate(n)+1,t),hovered:p||h===this.getLastClickedLollipopId(),barY:c,stack:s,tooltip:this._lollipops.hasOwnProperty(h)?this._lollipops[h].tooltip:new u},this.extraData(r)))},
o.prototype.afterUpdate=function(t,e,i){},o.prototype.extraData=function(t){throw Error("Not Implemented")},o.prototype.createText=function(t,e){throw Error("Not Implemented")},o.prototype.showBarLine=function(){return!0},o.prototype.getStyle=function(t,e){var i,o=t;return e.stack&&(o+="_stack:"+e.stack),"hovered"===o?this.hoveredStyle:"default"===o?this.defaultStyle:(this._stylesCache||(this._stylesCache={}),this._stylesCache[o]||(i=TradingView.clone("hovered"===t?this.hoveredStyle:this.defaultStyle),e.stack&&(i.lollipop.incHeight=24*e.stack),this._stylesCache[o]=i),this._stylesCache[o])},o.prototype.hasTooltip=function(t){return!0},o.prototype.renderer=function(){var t,e,i,o,l,c,u,d,p;this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new h;for(e in this._lollipops)this._lollipops.hasOwnProperty(e)&&(i=this._lollipops[e],o=15,l=this.getStyle(i.hovered?"hovered":"default",i),i.visible&&(c=$.extend({tooltipPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-o-(l.lollipop.incHeight||0)),style:l,createText:this.createText.bind(this)},i),u=this.getTemplate(i.hovered?"hovered":"default",i),d={circlePoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-(l.lollipop.incHeight||0)),style:l,template:u,basePoint:i.basePoint,id:i.id,mouseClickHandler:this._lollipopMouseClickHandler.bind(this,i.id)},t.append(new r(d)),i.hovered&&this.hasTooltip(i)&&i.barY&&this.showBarLine()&&(p={style:{lineStyle:l.barLine.lineStyle,strokeStyle:l.strokeStyle,lineWidth:l.lineWidth},startPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight),endPoint:new a(i.basePoint.x,i.barY)},t.append(new n(p))),t.append(new s(c,this))));return t},o.prototype.getTemplate=function(t,e){var i=t;return e.stack&&(i+="_stack:"+e.stack),this.templatesCache[i]||(this.templatesCache[i]=this.createTemplate(this.getStyle(t,e))),this.templatesCache[i]},o.prototype.createTemplate=function(t){var e=document.createElement("canvas"),i=e.getContext("2d"),o=new a(t.lollipop.width/2,t.lollipop.height-t.lollipop.circleHeight-(t.lollipop.incHeight||0));return this.drawCircle(i,t,o),this.drawLabel(i,t,o),e},o.prototype.drawCircle=function(t,e,i){t.strokeStyle=e.strokeStyle,t.fillStyle=e.lollipop.fillStyle,t.lineWidth=e.lollipop.lineWidth,CanvasEx.setLineStyle(t,CanvasEx.LINESTYLE_SOLID),t.beginPath(),t.arc(i.x,i.y,e.lollipop.radius,0,2*Math.PI,!1),t.closePath(),t.stroke(),e.lollipop.fillCircle&&t.fill()},o.prototype.drawLabel=function(t,e,i){t.textAlign="center",t.textBaseline="middle",t.fillStyle=e.lollipop.text.strokeStyle,t.font=e.lollipop.text.font,t.fillText(e.lollipop.text.label,i.x,i.y)},o.prototype._lollipopMouseClickHandler=function(t){this._lastClickedId=this._lastClickedId===t?null:t},n.prototype.draw=function(t){t.strokeStyle=this.data.style.strokeStyle,t.lineWidth=this.data.style.lineWidth,CanvasEx.setLineStyle(t,this.data.style.lineStyle),CanvasEx.drawLine(t,this.data.startPoint.x,this.data.startPoint.y,this.data.endPoint.x,this.data.endPoint.y)},n.prototype.hitTest=function(t){return null},r.prototype.hitTest=function(t){
return l(t,this.data.circlePoint,this.data.style.lollipop.radius)?this._hittest:null},r.prototype.draw=function(t){var e=this.data.template;t.drawImage(e,this.data.basePoint.x-(.5+this.data.style.lollipop.width/2<<0)+.5,this.data.basePoint.y-this.data.style.lollipop.height+.5)},s.prototype.draw=function(t){this._data.createText(this._data,this.textRenderer),this._paneView.getLastClickedLollipopId()===this._data.id?this._data.tooltip.show({items:[this.textRenderer],x:this._data.basePoint.x,y:this._data.basePoint.y-this._data.style.lollipop.circleHeight-10-2*this._data.style.lollipop.radius*(this._data.stack?this._data.stack:0),wrapElement:t.canvas.parentNode,leftBorderColor:this._data.color}):this._data.tooltip.hide()},s.prototype.hitTest=function(t){return null},s.TextRenderer=function(t){this.lines=[],this.fontHeight=12,this.font=this.fontHeight+"px Arial, sans-serif",this.lineSpacing=8,this.fillStyle="black",t&&(this.importance=t)},s.TextRenderer.prototype.draw=function(t,e){var i,o,n=e.y;for(i=0;i<this.lines.length;i++)o=this.lines[i],t.font=this.font,o.options.fontWeight&&(t.font=o.options.fontWeight+" "+this.font),t.fillStyle=this.fillStyle,o.renderer(t,o.line,{x:e.x,y:n}),n+=this.lineSpacing+this.fontHeight},s.TextRenderer.prototype.measure=function(){return this.lines.length*(this.fontHeight+this.lineSpacing)-this.lineSpacing},s.TextRenderer.prototype.basicRenderer=function(t,e,i){t.fillText(e,i.x,i.y)},s.TextRenderer.prototype.addMulticolorTextLine=function(t,e){this.addTextLine(t,e,this.multicolorRenderer)},s.TextRenderer.prototype.addTextLine=function(t,e,i){i||(i=this.basicRenderer),e||(e={}),this.lines.push({line:t,renderer:i,options:e})},s.TextRenderer.prototype.multicolorRenderer=function(t,e,i){var o,n,r=i.x;for(o=0;o<e.length;++o)n=e[o],t.fillStyle=n.color,t.fillText(n.text,r,i.y),r+=t.measureText(n.text).width},e.ESDPaneView=o},function(t,e,i){"use strict";function o(t){function e(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)||""}var i,o,s,a=t||{},l="QUANDL"===a.exchange,c="",h={symbolDescription:"",interval:"",exchange:"",chartStyle:""};switch(a.description&&l?2===a.description.split("/").length?h.symbolDescription=a.description.split("/")[1]:(i=a.description.split("'").filter(function(t){return t.length}),i.forEach(function(t){t=t&&("/"===t[0]||/\d+\/\(?/.test(t))?[t]:t.split("/").filter(function(t){return t.length}),h.symbolDescription+=t[2===t.length?1:0]})):a.description?h.symbolDescription=a.description:h.symbolDescription=a.symbol,a.interval&&(h.interval=n(a.interval)),l&&a.description&&(o=/[\w_]+\/[\w_]+/.exec(a.description),o&&o[0]?h.provider=o[0].split("/")[0]:h.provider=a.description.split("/")[0]),a.exchange&&(h.exchange=a.exchange),a.style){case r.STYLE_RENKO:s=a.inputs.style+("ATR"===a.inputs.style?"("+a.inputs.atrLength+")":""),h.chartStyle=$.t("Renko")+" ["+s+", "+e(a.boxSize,4)+"]";break;case r.STYLE_PB:h.chartStyle=$.t("Line Break")+" ["+a.inputs.lb+"]";break;case r.STYLE_KAGI:s=a.inputs.style+("ATR"===a.inputs.style?"("+a.inputs.atrLength+")":""),
h.chartStyle=$.t("Kagi")+" ["+s+(void 0!==a.reversalAmount?", "+e(a.reversalAmount,8):"")+"]";break;case r.STYLE_PNF:s=a.inputs.style+("ATR"===a.inputs.style?"("+a.inputs.atrLength+")":""),h.chartStyle=$.t("PnF")+" ["+s+", "+e(a.boxSize,8)+", "+a.inputs.reversalAmount+"]";break;case r.STYLE_HEIKEN_ASHI:h.chartStyle=$.t("Heikin Ashi")}return c=h.symbolDescription+(h.interval?", "+h.interval:"")+(h.provider?", "+h.provider:"")+(h.exchange?", "+h.exchange:"")+(h.chartStyle?", "+h.chartStyle:""),c=c.replace(/\'/g,"")}var n=i(178).translatedIntervalString,r=i(71);t.exports={generateTitleForGui:o}},function(t,e,i){"use strict";function o(){this._data=null}function n(t){this._series=t,this._invalidated=!0,this._renderer=new o}var r=i(1).Point,s=i(8).CompositeRenderer,a=i(228).DateFormatter,l=i(174).TimeFormatter;o.prototype.setData=function(t){this._data=t},o.prototype.hitTest=function(){return null},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m;null!==this._data&&(e=5,i=12,o=5,n=8,r=13,s=0,t.save(),t.setFont(r+"px Arial"),c=$.t("Last available bar"),this._data.eod?s=t.measureText(c).width:(a=t.measureText(this._data.dateString||"").width,l=t.measureText(this._data.timeString||"").width,s=Math.max(a,l)),h=this._data.timeString?2:1,t.fillStyle=this._data.eod?"#FF4040":"#58A3CD",t.translate(this._data.point.x+.5,this._data.point.y+.5),u=Math.round(-s/2)-n,d=-(r+e)*h-e-i-o,p=Math.round(u+s+2*n),_=-i-o,t.beginPath(),t.moveTo(u,d),t.lineTo(p,d),t.lineTo(p,_),t.lineTo(i,_),t.lineTo(0,_+i),t.lineTo(-i,_),t.lineTo(u,_),t.fill(),t.fillStyle="#FFFFFF",t.textBaseline="top",this._data.eod?t.fillText(c,u+n,d+e):(f=u+n+(s-a)/2,t.fillText(this._data.dateString,f,d+e),this._data.timeString&&(m=u+n+(s-l)/2,t.fillText(this._data.timeString,m,d+2*e+r))),t.restore())},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,s,c;delete this._point,delete this._dateString,delete this._timeString,delete this._eod,void 0!==(t=this._series.gotoDateResult())&&(e=this._series.model().timeScale().timePointToIndex(t.timestamp),i=this._series.bars(),o=null,e<i.firstIndex()&&null!==i.first()?(e=i.firstIndex(),o=i.first().value):e>i.lastIndex()&&null!==i.last()?(e=i.lastIndex(),o=i.last().value):o=i.valueAt(e),null!==o&&(n=this._series.priceScale().priceToCoordinate(o[TradingView.HIGH_PLOT]),s=this._series.model().timeScale().indexToCoordinate(e),this._point=new r(s,n),t.eod?this._eod=!0:(c=this._series.model().timeScale().indexToUserTime(e),this._dateString=(new a).format(c),this._series.isDWM()||(this._timeString=(new l).format(c)))))},n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._point?(this._renderer.setData({point:this._point,dateString:this._dateString,timeString:this._timeString,eod:this._eod}),this._renderer):new s},t.exports=n},function(t,e){"use strict";function i(){this.visible=!0,this.horzLinesVisible=!0,this.horzLinesColor="white",this.horzLinesStyle="",this.vertLinesVisible=!0,this.vertLinesColor="white",
this.vertLinesStyle=""}function o(t,e){this.source=t,this.pane=e,this._renderer=new n}function n(){this.data=null}i.prototype.paneViews=function(t){return[new o(this,t)]},o.prototype.update=function(){},o.prototype.renderer=function(){var t={};return this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty()?null:(t.horzLinesVisible=!0,t.vertLinesVisible=!0,t.horzLinesColor=this.pane._model.properties().paneProperties.horzGridProperties.color.value(),t.vertLinesColor=this.pane._model.properties().paneProperties.vertGridProperties.color.value(),t.horzLineStyle=this.pane._model.properties().paneProperties.horzGridProperties.style.value(),t.vertLineStyle=this.pane._model.properties().paneProperties.vertGridProperties.style.value(),t.priceMarks=this.pane.defaultPriceScale().marks(),t.timeMarks=this.pane.timeScale().marks(),t.w=this.pane.width(),t.h=this.pane.height(),this._renderer.setData(t),this._renderer)},n.prototype.setData=function(t){this.data=t},n.prototype.draw=function(t){var e;if(null!==this.data){if(t.lineWidth=1,this.data.vertLinesVisible){for(t.strokeStyle=this.data.vertLinesColor,CanvasEx.setLineStyle(t,this.data.vertLineStyle),t.beginPath(),e=0;e<this.data.timeMarks.length;e++)t.moveTo(this.data.timeMarks[e].coord+1,0),t.lineTo(this.data.timeMarks[e].coord+1,this.data.h);t.stroke()}if(this.data.horzLinesVisible){for(t.strokeStyle=this.data.horzLinesColor,CanvasEx.setLineStyle(t,this.data.horzLineStyle),t.beginPath(),e=0;e<this.data.priceMarks.length;e++)t.moveTo(0,this.data.priceMarks[e].coord),t.lineTo(this.data.w,this.data.priceMarks[e].coord);t.stroke()}}},t.exports=i},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolABCD";var o=e||new r("linetoolabcd");n.call(this,t,o),i.e(1,function(t){var e=i(834).ABCDPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(173).DateTimeFormatter,a=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 4},o.prototype.title=function(){return"ABCD Pattern"},o.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null}},o.prototype._updateTooltip=function(){var t,e,i,o,n=this._tooltipFieldsHash,r=this.points().m_values;r[0]&&(t=this._model.timeScale().indexToUserTime(r[0].index),n.time0.value=t?new s(this._model.mainSeries().isDWM()).format(t):0,n.price0.value=this._model.mainSeries()._formatter.format(r[0].price)),r[1]&&(e=this._model.timeScale().indexToUserTime(r[1].index),n.time1.value=e?new s(this._model.mainSeries().isDWM()).format(e):0,n.price1.value=this._model.mainSeries()._formatter.format(r[1].price)),r[2]&&(i=this._model.timeScale().indexToUserTime(r[2].index),n.time2.value=i?new s(this._model.mainSeries().isDWM()).format(i):0,
n.price2.value=this._model.mainSeries()._formatter.format(r[2].price)),r[3]&&(o=this._model.timeScale().indexToUserTime(r[3].index),n.time3.value=o?new s(this._model.mainSeries().isDWM()).format(o):0,n.price3.value=this._model.mainSeries()._formatter.format(r[3].price))},o.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},o.prototype.getStylesPropertyPage=function(){return a.LineToolABCDPatternStylesPropertyPage},e.LineToolABCD=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolArc";var n=e||new d("linetoolarc");u.call(this,t,n),this.version=o.version,i.e(1,function(t){var e=i(836).ArcPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(1).Point,r=i(33).distanceToLine,s=i(193),a=s.rotationMatrix,l=s.scalingMatrix,c=s.translationMatrix,h=s.transformPoint,u=i(3).LineDataSource,d=i(11).DefaultProperty,p=i(9).propertyPages;inherit(o,u),o.prototype.startChanging=function(t,e){var i,o,s,a,l,c,h;u.prototype.startChanging.call(this,t,e),0!==t&&1!==t||(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],s=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,o,s).distance,a=o.subtract(i),l=new n(-a.y,a.x),c=i.add(o).scaled(.5),h=s.subtract(c),h.dotProduct(l)<0&&(this._dist=-this._dist))},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Arc"},o.prototype.setPoint=function(t,e){var i,o,s,u,d,p,_,f,m,g,v,y,b,S=$.extend({},e),w=this.pointToScreenPoint(this._points[0])[0],T=this.pointToScreenPoint(this._points[1])[0],x=this.pointToScreenPoint(this._points[2])[0],C=this.priceScale();switch(C.isPercent()&&(i=this.ownerSource().firstValue(),S.price=C.priceRange().convertFromPercent(S.price,i)),t){case 0:w=this.pointToScreenPoint(S)[0],o=T.subtract(w),s=w.add(T).scaled(.5),u=new n(-o.y,o.x),u=u.normalized(),x=s.add(u.scaled(this._dist)),x=this.screenPointToPoint(x),this._points[0]=S,this._points[2]=x;break;case 1:d=r(w,T,x).distance,T=this.pointToScreenPoint(S)[0],o=T.subtract(w),s=w.add(T).scaled(.5),u=new n(-o.y,o.x),u=u.normalized(),x=s.add(u.scaled(this._dist)),x=this.screenPointToPoint(x),this._points[1]=S,this._points[2]=x;break;case 2:S=this.pointToScreenPoint(S)[0],d=r(w,T,S).distance,o=T.subtract(w),s=w.add(T).scaled(.5),u=new n(-o.y,o.x),u=u.normalized(),x=s.add(u.scaled(d)),p=s.add(u.scaled(-d)),_=o.length(),f=o.x/_,m=o.y/_,g=Math.acos(f),m<0&&(g=-g),v=c(-s.x,-s.y),S=h(v,S),y=h(v,x),v=a(-g),S=h(v,S),y=h(v,y),v=l(1,_/(2*d)),S=h(v,S),y=h(v,y),b=S.y*y.y>=0?new n(x.x,x.y):new n(p.x,p.y),b=this.screenPointToPoint(b),this._points[2]=b}this.normalizePoints()},o.version=2,o.prototype.migrateVersion=function(t,e,i){var o,n;1===t&&2===this._points.length&&(o=(2*this._points[0].price+3*this._points[1].price)/5,this._points.append({price:o,index:this._points[1].index})),1===t&&2===this._timePoint.length&&(o=(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,n={price:o,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t},this._timePoint.append(n))},
o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return p.LineToolArcStylesPropertyPage},e.LineToolArc=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolArrow";var i=e||new r("linetoolarrow");n.call(this,t,i)}var n=i(211).LineToolTrendLine,r=i(11).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Arrow"},e.LineToolArrow=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBalloon";var o=e||new r("linetoolballoon");n.call(this,t,o),i.e(1,function(t){var e=i(839).BalloonPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Balloon"},o.prototype.getStylesPropertyPage=function(){return s.LineToolBalloonStylesPropertyPage},e.LineToolBalloon=o},function(t,e){"use strict";function i(t,e){this.tooltips={},this.tooltipFactory=t,this.source=e}function o(t,e){this.renderer=t,this._tooltip=e,this.visible=!1}i.prototype.findOrCreateTooltip=function(t){var e=this.tooltips[t.id];return null==e&&(t.hovered||t.pinned)&&(e=this._createTooltip(),this.tooltips[t.id]=e),e},i.prototype.showPlate=function(t,e){var i=this.findOrCreateTooltip(t);null!=i&&(i._drawPlate(t,e),i.plateData=t)},i.prototype.draw=function(t,e){this.hoveredId=null;for(var i=0;i<t.length;i++)t[i].hovered&&(this.hoveredId=t[i].id);t.forEach(function(t){this.showPlate(t,e)}.bind(this))},i.prototype.endDraw=function(){var t,e,i=this;for(t in this.tooltips)this.tooltips.hasOwnProperty(t)&&(e=this.tooltips[t],e.toggleVisibility(),i.hoveredId&&e.plateData.id!==i.hoveredId&&!e.plateData.pinned&&(e.remove(),delete this.tooltips[t]))},i.prototype.removeAll=function(){var t,e;for(t in this.tooltips)this.tooltips.hasOwnProperty(t)&&(e=this.tooltips[t],e.remove());this.tooltips={}},i.prototype.removeTooltip=function(t){delete this.tooltips[t]},i.prototype._createTooltip=function(){return new o(this,this.tooltipFactory())},o.prototype._drawPlate=function(t,e){var i=this;this.visible=!0,this._tooltip.setSource(this.renderer.source),this._tooltip.showPlate(t,e),t.hovered||t.pinned||this._tooltip.hide(function(){i.renderer.removeTooltip(t.id)})},o.prototype.remove=function(){this._tooltip._removeLayout()},o.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible),this.visible=!1},e.TooltipRenderer=i},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBarsPattern";var r=e||new s("linetoolbarspattern");n.call(this,t,r),r.mirrored.listeners().subscribe(this,o.prototype.mirror),r.flipped.listeners().subscribe(this,o.prototype.flip),r.addExclusion("mirrored"),r.addExclusion("flipped"),this._scaleCoeff=1,this.version=o.version,this._pattern=[],this._properties.mode.listeners().subscribe(this,o.prototype.onModeChanged),i.e(1,function(t){var e=i(842).BarsPatternPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}
var n=i(3).LineDataSource,r=i(73).Action,s=i(11).DefaultProperty,a=i(42).PlotRowSearchMode,l=i(9).propertyPages,c=i(311).LineToolBarsPatternMode;inherit(o,n),o.version=2,o.prototype.onModeChanged=function(){var t=this.patternPriceDiff();t*=this._pressCoeff,this._points[1].price=this._timePoint[1].price=this._points[0].price+t},o.prototype.additionalActions=function(t){var e,i,o=new r({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),n=new r({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});return o.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().mirrored,!o.properties().mirrored.value(),"Bats Pattern Mirroring"),o.updateAllViews(),o._model.updateSource(o)}),n.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().flipped,!o.properties().flipped.value(),"Bats Pattern Flipping"),o.updateAllViews(),o._model.updateSource(o)}),e=new r({checkable:!0,text:$.t("Restore Size")}),i=this,e.callbacks().subscribe(null,function(e){var o=i.points()[0],n=i.patternPriceDiff(),r=o.price+n,s=o.index+i._pattern.length-1;t.startChangingLinetool(i,{price:r,index:s},1,{}),t.changeLinePoint({price:r,index:s},{}),t.endChangingLinetool()}),[o,n,e]},o.prototype.pointsCount=function(){return 2},o.prototype.state=function(t){var e=n.prototype.state.call(this,t);return e.pattern=this._pattern,e},o.prototype.restoreData=function(t){t.pattern&&(this._pattern=t.pattern)},o.prototype.title=function(){return"Bars Pattern"},o.prototype.cloneData=function(t){this._pattern=TradingView.clone(t._pattern)},o.prototype.mirror=function(){var t,e,i,o,n,r=this._pattern,s=r[0][TradingView.HIGH_PLOT],a=Math.min(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]),l=Math.max(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]);for(t=1;t<r.length;t++)a=Math.min(a,r[t][TradingView.LOW_PLOT]),l=Math.max(l,r[t][TradingView.HIGH_PLOT]);if(a<l)for(e=(a+l)/2,i=function(t){return e-(t-e)},t=0;t<r.length;t++)r[t][TradingView.HIGH_PLOT]=i(r[t][TradingView.HIGH_PLOT]),r[t][TradingView.LOW_PLOT]=i(r[t][TradingView.LOW_PLOT]),r[t][TradingView.OPEN_PLOT]=i(r[t][TradingView.OPEN_PLOT]),r[t][TradingView.CLOSE_PLOT]=i(r[t][TradingView.CLOSE_PLOT]);o=r[0][TradingView.HIGH_PLOT]-s,n=r[r.length-1][TradingView.LOW_PLOT]-r[0][TradingView.HIGH_PLOT],this._points[0].price+=o,this._points[1].price=this._points[0].price+n,this.updateAllViews()},o.prototype.flip=function(){var t,e,i;for(this._points[0].price=this._points[1].price,t=0;t<this._pattern.length/2;t++)e=this._pattern[t],this._pattern[t]=this._pattern[this._pattern.length-t-1],this._pattern[this._pattern.length-t-1]=e;i=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT],this._points[1].price=this._points[0].price+i,this.updateAllViews()},o.prototype.firstPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10)
;return i===c.LineHL2?(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2:(t={0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[0][e])},o.prototype.lastPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10);return i===c.LineHL2?(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2:(t={0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[this._pattern.length-1][e])},o.prototype.patternPriceDiff=function(){return this.lastPatternPrice()-this.firstPatternPrice()},o.prototype.pressCoeff=function(){var t=this.patternPriceDiff(),e=this.points()[0].price,i=this.points()[1].price,o=i-e,n=o/t;return this._pressCoeff=n,n},o.prototype.addPoint=function(t,e){var i,o,r,s,l,h,u,d,p,_,f=this._model.mainSeries(),m=f.nearestIndex(t.index,a.NearestRight);if(this.properties().mode.value()===c.Bars?t.price=f.bars().valueAt(m)[TradingView.HIGH_PLOT]:t.price=f.bars().valueAt(m)[TradingView.CLOSE_PLOT],i=this.priceScale().priceRange().length(),t.price+=.05*i,o=f.priceScale(),o.isPercent()&&(r=f.firstValue(),t.price=o.priceRange().convertToPercent(t.price,r)),s=n.prototype.addPoint.call(this,t,e,!0)){for(l=Math.min(this.points()[0].index,this.points()[1].index),h=Math.max(this.points()[0].index,this.points()[1].index),m=this._model.mainSeries().nearestIndex(l,a.NearestRight),u=this._model.mainSeries().nearestIndex(h,a.NearestLeft),this.points()[0].index>this.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[],d=m;d<=u;d++)p=this._model.mainSeries().data().valueAt(d),this._pattern.push(TradingView.clone(p));this._pattern.length>0&&(_=this.patternPriceDiff(),this._points[1].price=this._points[0].price+_,this._points[1].index=this._points[0].index+(u-m),this.normalizePoints(),this.createServerPoints())}return s},o.prototype.setPoint=function(t,e,i){1===t&&e.index<=this._points[0].index&&(e.index=this._points[0].index+1),0===t&&e.index>=this._points[1].index&&(e.index=this._points[1].index-1),n.prototype.setPoint.call(this,t,e,i)},o.prototype.migrateVersion=function(t,e,i){if(1===t&&this._pattern.length>0){var o=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+o),2===this._points.length&&(this._points[1].price=this._points[0].price+o)}},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return l.LineToolBarsPatternStylesPropertyPage},e.LineToolBarsPattern=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBezierCubic";var o;o=e||new r("linetoolbeziercubic"),n.call(this,t,o),i.e(1,function(t){var e=i(844).BezierCubicPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}
var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Double Curve"},o.prototype.controlPoints=function(){var t=this.pointToScreenPoint(this.points()[0])[0],e=this.pointToScreenPoint(this.points()[1])[0],i=e.subtract(t).scaled(.5),o=i.transposed().scaled(.3),n=t.add(e).scaled(.33),r=t.add(e).scaled(.67),s=n.add(o),a=r.subtract(o);return[this.screenPointToPoint(s),this.screenPointToPoint(a)]},o.prototype.setLastPoint=function(t,e){n.prototype.setLastPoint.call(this,t,e),this._controlPoints=this.controlPoints()},o.prototype.addPoint=function(t,e,i){var o,r=n.prototype.addPoint.call(this,t,e,!0);return r&&(o=this.controlPoints(),delete this._controlPoints,this._points.push(o[0]),this._points.push(o[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)),r},o.prototype.restorePoints=function(t,e,i){n.prototype.restorePoints.call(this,t,e,i),this._createPointProperty(2),this._createPointProperty(3)},o.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},e.LineToolBezierCubic=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBezierQuadro";var o;o=e||new r("linetoolbezierquadro"),n.call(this,t,o),i.e(1,function(t){var e=i(846).BezierQuadroPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Curve"},o.prototype.controlPoint=function(){var t=this.pointToScreenPoint(this.points()[0])[0],e=this.pointToScreenPoint(this.points()[1])[0],i=e.subtract(t).scaled(.5),o=i.transposed().scaled(.3),n=t.add(e).scaled(.5),r=n.add(o);return this.screenPointToPoint(r)},o.prototype.setLastPoint=function(t,e){n.prototype.setLastPoint.call(this,t,e),this._controlPoint=this.controlPoint()},o.prototype.addPoint=function(t,e,i){var o,r=n.prototype.addPoint.call(this,t,e,!0);return r&&(o=this.controlPoint(),this._points.push(o),delete this._controlPoint,i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2)),r},o.prototype.restorePoints=function(t,e,i){n.prototype.restorePoints.call(this,t,e,i),this._createPointProperty(2)},o.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},e.LineToolBezierQuadro=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBrush";var o=e||new r("linetoolbrush");n.call(this,t,o),this._finished=!1,i.e(1,function(t){var e=i(848).BrushPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return-1},o.prototype.finished=function(){return this._finished},o.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},o.prototype.title=function(){
return"Brush"},o.prototype.percentDistance=function(t,e){return Math.abs((e-t)/t)},o.prototype.addPoint=function(t){var e,i,o;return!!this._finished||(this._lastPoint=null,this._points.length>0&&(e=this._points[this._points.length-1],i=this.pointToScreenPoint(e)[1],o=this.pointToScreenPoint(t)[1],o.subtract(i).length()<2)?this._finished:(n.prototype.addPoint.call(this,t),this._finished))},o.prototype.restorePoints=function(t,e,i){n.prototype.restorePoints.call(this,t,e,i),this._finished=!0},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolBrushStylesPropertyPage},e.LineToolBrush=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolCallout";var o=e||new s("linetoolcallout");n.call(this,t,o),this._barOffset=0,this._timeScale=t.timeScale(),i.e(1,function(t){var e=i(850).CalloutPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(62).DataSource,s=i(11).DefaultProperty,a=i(9).propertyPages,l=i(483).CalloutConsts;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Callout"},o.prototype.correctPoints=function(t){var e=this._currentMovingPoint.index-this._startMovingPoint.index,i=this._currentMovingPoint.price-this._startMovingPoint.price,o=t[1];o.index+=e,o.price+=i,t[1]=o},o.prototype.addPoint=function(t){var e=n.prototype.addPoint.call(this,t);return e&&this._calculateBarOffset(),e},o.prototype._calculateBarOffset=function(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)},o.prototype.setLastPoint=function(t){n.prototype.setLastPoint.call(this,t),2===this.points().length&&this._calculateBarOffset()},o.prototype.setPoint=function(t,e){var i,o,r,s,a;switch(t){case 0:n.prototype.setPoint.call(this,t,e),this._calculateBarOffset();break;case 1:if(i=this.properties(),!i.wordWrapWidth)return;if(o=this._points,r=this._dragStartLeftEdgeIndex,s=Math.round((e.index-r)/2),isFinite(r)&&isFinite(s)){if(o[1]={index:r+s,price:o[1].price},this._calculateBarOffset(),this.normalizePoints(),a=this._timeScale.indexToCoordinate(r+2*s)-this._timeScale.indexToCoordinate(r)-l.RoundRadius-l.TextMargins,!isFinite(a))return;i.wordWrapWidth.setValue(Math.max(l.MinWidth,a));break}o[1]=e,this._calculateBarOffset(),this.normalizePoints()}},o.prototype.startDragPoint=function(t,e){var i=this.properties();1===t&&i.wordWrap&&i.wordWrap.value()&&(this._dragStartLeftEdgeIndex=2*this.points()[1].index-e.index)},o.prototype.move=function(t){n.prototype.move.call(this,t),this._calculateBarOffset()},o.prototype.state=function(t){var e=n.prototype.state.call(this,t);return e.barOffset=this._barOffset,e},o.prototype.restoreData=function(t){t.barOffset?this._barOffset=t.barOffset:this._calculateBarOffset(),this._calculatePoint2()},o.prototype.setPriceScale=function(t){r.prototype.setPriceScale.call(this,t),t&&t.priceRange()&&this._calculatePoint2()},o.prototype._calculatePoint2=function(){var t,e
;this._model.lineBeingEdited()!==this&&this._model.sourceBeingMoved()!==this&&(this._points.length<2||(t=this.points()[0],e=this.points()[1],this._points[1]={price:e.price,index:t.index+this._barOffset}))},o.prototype.getStylesPropertyPage=function(){return a.LineToolCalloutStylesPropertyPage},e.LineToolCallout=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolCircleLines";var o=e||new r("linetoolcirclelines");n.call(this,t,o),i.e(1,function(t){var e=i(852).LineToolCircleLinesPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Cyclic Lines"},o.prototype.getStylesPropertyPage=function(){return s.LineToolCircleLinesStylesPropertyPage},e.LineToolCircleLines=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolCypherPattern";var o=e||new r("linetoolcypherpattern");n.call(this,t,o),i.e(1,function(t){var e=i(854).CypherPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(411).LineTool5PointsPattern;inherit(o,s),e.LineToolCypherPattern=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolDateAndPriceRange";var o=e||new r("linetooldateandpricerange");n.call(this,t,o),i.e(1,function(t){var e=i(856).DateAndPriceRangePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Date and Price Range"},o.prototype.getStylesPropertyPage=function(){return s.LineToolDateAndPriceRangeStylesPropertyPage},e.LineToolDateAndPriceRange=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolDateRange";var o=e||new r("linetooldaterange");n.call(this,t,o),i.e(1,function(t){var e=i(858).DateRangePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Date Range"},o.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},e.LineToolDateRange=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolDisjointAngle";var s=e||new r("linetooldisjointangle");n.call(this,t,s),this.version=o.version,i.e(1,function(t){var e=i(860).DisjointAnglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.version=1,o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Disjoint Angle"},o.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),n.prototype.addPoint.call(this,t)},o.prototype.setLastPoint=function(t,e){
return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),n.prototype.setLastPoint.call(this,t)},o.prototype.setPoint=function(t,e,i){var o,r,s,a,l,c=.5*(this._points[1].price+this._points[2].price);i&&i.shift&&1===t&&(o=0,this._snapPoint45Degree(e,this.points()[o])),t<3&&n.prototype.setPoint.call(this,t,e),0!==t&&2!==t&&(1===t?(r=this._points[1].price-c,this._points[2].price=this._points[1].price-2*r):3===t&&(s=this.priceScale(),a=e.price,s.isPercent()&&(l=this.ownerSource().firstValue(),a=s.priceRange().convertFromPercent(a,l)),r=a-this._points[2].price,this._points[0].price=this._points[1].price-r,this._points[0].index=e.index))},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){var t,e,i,o,n,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),t=this._points[2],t.time=h.time,t.index=h.index,e={price:t.price+(h.price-c.price),time:c.time,index:c.index},i=[],t.index<=e.index?(i.push(t),i.push(e)):(i.push(e),i.push(t)),u[0].price>i[0].price?(o=u,n=i):i[0].price>u[0].price?(o=i,n=u):i[1].price>u[1].price?(o=i,n=u):(o=u,n=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(o,"Upper",r,s),this._linePointsToAlertPlot(n,"Lower",r,s)]},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolDisjointAngleStylesPropertyPage},e.LineToolDisjointAngle=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolEllipse";var n=e||new a("linetoolellipse");s.call(this,t,n),this.version=o.version,i.e(1,function(t){var e=i(862).EllipsePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(1).Point,r=i(33).distanceToLine,s=i(3).LineDataSource,a=i(11).DefaultProperty,l=i(9).propertyPages;inherit(o,s),o.prototype.startChanging=function(t,e){var i,o,n;s.prototype.startChanging.call(this,t,e),0!==t&&1!==t||(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,o,n).distance||0)},o.prototype._preparePoint=function(t,e){var i=this._preparePointInternal(t,e,!1);return e&&e.shift&&this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],i),i},o.prototype._preparePointInternal=function(t,e,i){var o,r,a,l,c,h,u,d,p,_,f;if(this._convertPriceFromPercentIfNeeded(t),o=$.extend({},t),e&&e.shift){if(r=this.points().length,!this._fakePointAdded&&3===r&&!i)return o;(this._fakePointAdded||2===r||i)&&(this._snapPoint45Degree(t,this._points[0]),this._fakePointAdded?this._points[1]=t:i||(this._fakePointAdded=!0,s.prototype._addPointIntenal.call(this,t)),a=this.pointToScreenPoint(this._points[0])[0],l=this.pointToScreenPoint(this._points[1])[0],c=l.x-a.x,h=l.y-a.y,u=Math.sqrt(c*c+h*h)/2,d=l.subtract(a),p=a.add(l).scaled(.5),_=new n(-d.y,d.x),_=_.normalized(),
f=p.add(_.scaled(u)),o=this.screenPointToPoint(f),(TradingView.isNaN(o.price)||TradingView.isNaN(o.index))&&(o=this.screenPointToPoint(p)))}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return o},o.prototype._fixVerticalDiameterPoints=function(t,e,i){var o=this.pointToScreenPoint(t)[0],n=this.pointToScreenPoint(e)[0],r=this._model.timeScale(),s=r.indexToCoordinate(t.index),a=r.indexToCoordinate(i.index),l=2*Math.abs(s-a);l*=e.price>t.price?1:-1,t.price=this.screenPointToPoint({x:o.x,y:n.y+l}).price},o.prototype.addPoint=function(t,e,i){var o=s.prototype.addPoint.call(this,t,e,i);return o&&(this._fakePointAdded=!1),o},o.prototype.setPoint=function(t,e,i){var o,s,a,l,c=$.extend({},e),h=this.pointToScreenPoint(this._points[0])[0],u=this.pointToScreenPoint(this._points[1])[0],d=this.pointToScreenPoint(this._points[2])[0];switch(this._convertPriceFromPercentIfNeeded(c),t){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}h=this.pointToScreenPoint(c)[0],o=u.subtract(h),s=h.add(u).scaled(.5),a=new n(-o.y,o.x),a=a.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}u=this.pointToScreenPoint(c)[0],o=u.subtract(h),s=h.add(u).scaled(.5),a=new n(-o.y,o.x),a=a.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(h,u,c).distance,o=u.subtract(h),s=h.add(u).scaled(.5),a=new n(-o.y,o.x),a=a.normalized(),d=s.add(a.scaled(l)),d=this.screenPointToPoint(d),this._points[2]=d}this.normalizePoints()},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Ellipse"},o.version=2,o.prototype.migrateVersion=function(t,e,i){var o,n,r;1===t&&2===this._points.length&&(o=this._points[0].price,n=.5*(this._points[0].price+this._points[1].price),this._points[0]={price:n,index:this._points[0].index},this._points[1]={price:n,index:this._points[1].index},this._points.push({price:o,index:this._points[0].index})),1===t&&2===this._timePoint.length&&(o=this._timePoint[0].price,n=.5*(this._timePoint[0].price+this._timePoint[1].price),this._timePoint[0].price=n,this._timePoint[1].price=n,r={price:o,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t},this._timePoint.push(r))},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return l.LineToolEllipseStylesPropertyPage},e.LineToolEllipse=o},,function(t,e,i){"use strict";function o(t,e){
this._constructor="LineToolExtended";var i=e||new r("linetoolextended");n.call(this,t,i)}var n=i(211).LineToolTrendLine,r=i(11).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Extended Line"},e.LineToolExtended=o},,function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolFibChannel";var s=e||this.createPropertiesObject("linetoolfibchannel");r.call(this,t,s),this.version=n.version,t._fibChannelLabelsCache||(t._fibChannelLabelsCache=new o),i.e(1,function(t){var e=i(866).FibChannelPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(3).LineDataSource,s=i(40),a=i(116),l=i(9).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return n.LevelsCount},inherit(n,r),n.LevelsCount=24,n.version=2,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.migrateVersion=function(t,e,i){i.properties.removeProperty("reverse")},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Fib Channel"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[1,24],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibChannelStylesPropertyPage},e.LineToolFibChannel=n},,function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolFibCircles";var n=e||this.createPropertiesObject("linetoolfibcircles");r.call(this,t,n),t._fibCirclesLabelsCache||(t._fibCirclesLabelsCache=new o),i.e(1,function(t){var e=i(868).FibCirclesPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(3).LineDataSource,s=i(40),a=i(116),l=i(9).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return n.LevelsCount},inherit(n,r),n.LevelsCount=11,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Circles"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibCirclesStylesPropertyPage},e.LineToolFibCircles=n},,function(t,e,i){"use strict";function o(){s.call(this)}function n(t,e){this._constructor="LineToolFibRetracement";var r=e||this.createPropertiesObject("linetoolfibretracement");a.call(this,t,r),this.version=n.version,this._properties._stateVersion=1,t._fibRetracementLabelsCache||(t._fibRetracementLabelsCache=new o),i.e(1,function(t){var e=i(870).FibRetracementPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(40),s=i(116),a=i(3).LineDataSource,l=i(9).propertyPages;inherit(o,s),o.prototype.levelsCount=function(){return n.LevelsCount},inherit(n,a),n.version=2,n.LevelsCount=24,n.prototype.levelsCount=function(){return n.LevelsCount},
n.prototype.stop=function(){a.prototype.stop.call(this),this._model._fibRetracementLabelsCache.removeSource(this.id())},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Retracement"},n.prototype.migrateVersion=function(t,e,i){1===t&&this.properties().extendLines.setValue(!0)},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,24],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibRetracementStylesPropertyPage},e.LineToolFibRetracement=n},,function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolFibSpeedResistanceArcs";var n=e||this.createPropertiesObject("linetoolfibspeedresistancearcs");r.call(this,t,n),t._fibSpeedResistanceArcsLabelsCache||(t._fibSpeedResistanceArcsLabelsCache=new o),i.e(1,function(t){var e=i(872).FibSpeedResistanceArcsPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(3).LineDataSource,s=i(40),a=i(116),l=i(9).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return n.LevelsCount},inherit(n,r),n.LevelsCount=11,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Speed Resistance Arcs"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibSpeedResistanceArcsStylesPropertyPage},e.LineToolFibSpeedResistanceArcs=n},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFibSpeedResistanceFan";var o=e||this.createPropertiesObject("linetoolfibspeedresistancefan");n.call(this,t,o),i.e(1,function(t){var e=i(874).FibSpeedResistanceFanPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(40),s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Speed Resistance Fan"},o.prototype.processErase=function(t,e){var i="h"===e.type?"hlevel"+e.index:"vlevel"+e.index,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpeedResistanceFanStylesPropertyPage},e.LineToolFibSpeedResistanceFan=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFibSpiral";var o=e||new r("linetoolfibspiral");n.call(this,t,o),i.e(1,function(t){var e=i(876).FibSpiralPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){
return 2},o.prototype.title=function(){return"Fib Spiral"},o.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpiralStylesPropertyPage},e.LineToolFibSpiral=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFibTimeZone";var r=e||this.createPropertiesObject("linetoolfibtimezone");n.call(this,t,r),this.version=o.version,i.e(1,function(t){var e=i(878).FibTimeZonePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(40),s=i(9).propertyPages;inherit(o,n),o.version=2,o.prototype.migrateVersion=function(t,e,i){var o;if(1===t){for(i.properties.level1.color.setValue(i.properties.baselinecolor.value()),o=2;o<=11;o++)i.properties["level"+o].color.setValue(i.properties.linecolor.value());for(o=1;o<=11;o++)i.properties["level"+o].linewidth.setValue(i.properties.linewidth.value()),i.properties["level"+o].linestyle.setValue(i.properties.linestyle.value())}},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Time Zone"},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolFibTimeZoneStylesPropertyPage},e.LineToolFibTimeZone=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFlagMark";var o=e||new s("linetoolflagmark");r.call(this,t,o),i.e(1,function(e){var o=i(416).MarkPaneView,r=new o(this,t,this.image,25,25,-8,-21);r.setAnchors(new n(0,0)),this._setPaneViews([r])}.bind(this))}var n=i(1).Point,r=i(3).LineDataSource,s=i(11).DefaultProperty;inherit(o,r),o.prototype.image=new Image,o.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=",o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Flag Mark"},o.prototype.version=2,e.LineToolFlagMark=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFlatBottom";var s=e||new r("linetoolflatbottom");n.call(this,t,s),this.version=o.version,i.e(1,function(t){var e=i(881).FlatBottomPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.version=1,o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Flat Bottom"},o.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),n.prototype.addPoint.call(this,t)},o.prototype.setLastPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),
n.prototype.setLastPoint.call(this,t)},o.prototype.setPoint=function(t,e,i){if(i&&i.shift&&1===t){this._snapPoint45Degree(e,this.points()[0])}t<3?n.prototype.setPoint.call(this,t,e):this._points[0].index=e.index},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){var t,e,i,o,n,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),t=this._points[2],t.time=h.time,t.index=h.index,e={price:t.price,time:c.time,index:c.index},i=[],t.index<=e.index?(i.push(t),i.push(e)):(i.push(e),i.push(t)),u[0].price>i[0].price?(o=u,n=i):i[0].price>u[0].price?(o=i,n=u):i[1].price>u[1].price?(o=i,n=u):(o=u,n=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(o,"Upper",r,s),this._linePointsToAlertPlot(n,"Lower",a,s)]},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolFlatBottomStylesPropertyPage},e.LineToolFlatBottom=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolGannFan";var o=e||this.createPropertiesObject("linetoolgannfan");n.call(this,t,o),i.e(1,function(t){var e=i(883).GannFanPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(40),s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Gann Fan"},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,9]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolGannFanStylesPropertyPage},e.LineToolGannFan=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolGannSquare";var o=e||this.createPropertiesObject("linetoolgannsquare");s.call(this,t,o),i.e(1,function(t){var e=i(885).GannSquarePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n,r,s=i(3).LineDataSource,a=i(40),l=i(9).propertyPages;inherit(o,s),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Gann Box"},n=[4.5,9,11.25,18,22.5,36,45],r=function(){for(var t=[],e=1e10,i=n.length-1,o=1,r=0,s=0;s<e;)s=n[r]*o,t.push(Math.round(s)),t.push(Math.ceil(-s)),r===i-1&&(o*=10),r=(r+1)%i;return t.sort(function(t,e){return t<e?-1:t>e?1:0}),t}(),o.prototype._alignPriceOnPattern=function(t,e){var i,o,r,s,a,l,c=Math.round(1e6*(t.price-e.price))/1e6;if(0===c)return e.price;for(i=n[0],o=n[n.length-1],r=1,s=Math.abs(c);s<i*r||o*r<s;)s<i*r?r*=.1:o*r<s&&(r*=10);for(a=o*r,l=n.length-2;l>=0&&!(n[l]*r<s);--l)a=n[l]*r;return t.price=e.price+(c>=0?a:-a),t},o.prototype._alignTimeOnPattern=function(t,e){var i,o=t.index-e.index;if(0===o)return 0;for(i=r.length-2;i>=0&&!(r[i]<o);--i);return i+=o>0?1:0,t.index=e.index+r[i],t},o.prototype._alignPointsFixedIncrement=function(t,e){return this._alignTimeOnPattern(t,e),this._alignPriceOnPattern(t,e),t
},o.prototype._preparePoint=function(t,e){return e&&e.shift&&0!==this._points.length&&this._alignPointsFixedIncrement(t,this._points[0]),s.prototype._preparePoint.call(this,t,e)},o.prototype.setPoint=function(t,e,i){if(i&&i.shift){var o=0===t?this._points[1]:this._points[0];this._alignPointsFixedIncrement(e,o)}s.prototype.setPoint.call(this,t,e,i)},o.prototype.createPropertiesObject=function(t,e,i){return new a(t,e,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolGannSquareStylesPropertyPage},e.LineToolGannSquare=o},,function(t,e,i){"use strict";function o(t,e,i){this._source=t,this._index=e,this._bars=i||[]}function n(t,e,i){this._source=t,l.call(this,"linetoolghostfeed",e,i)}function r(t,e,o){var s,l;this._constructor="LineToolGhostFeed",e?(s=e,s._source=this):s=new n(this),o||(l=Math.round(this.calculateATR(t)),s.averageHL.setValue(l)),a.call(this,t,s),this._segments=[],s.averageHL.listeners().subscribe(this,r.prototype.regenerate),s.variance.listeners().subscribe(this,r.prototype.regenerate),s.points||s.addProperty("points"),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._currentInterval=t.mainSeries().interval(),i.e(1,function(t){var e=i(887).GhostFeedPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var s=i(56).sign,a=i(3).LineDataSource,l=i(11).DefaultProperty,c=i(9).propertyPages;o.prototype.setBars=function(t){this._bars=t||[]},o.prototype.clone=function(t){return new o(t,this._index,TradingView.clone(this._bars))},o.prototype.createBar=function(){var t,e,i,o,n,r=this._source.properties().averageHL.value(),s=this._source.properties().variance.value()/100,a=this._source._model.mainSeries().base(),l=Math.random(),c=r*(1-2*l)*s;return l=Math.random(),t=r*(1+(.5-l)*s),e=c-t/2,i=e+t,o=e+Math.random()*t,n=e+Math.random()*t,{o:o/a,h:i/a,l:e/a,c:n/a}},o.prototype.generate=function(){var t,e,i,o,n,r;if(this._bars=[],t=this._source.points(),e=t[this._index],i=t[this._index+1],e&&i&&e.index!==i.index)for(this._avgHL=this._source.properties().averageHL.value(),this._variance=this._source.properties().variance.value()/100,o=this._index?e.index+1:e.index,n=s(i.index-e.index),r=o;r!==i.index;r+=n)this._bars.push(this.createBar())},o.prototype.bars=function(){return this._bars},o.prototype.setSize=function(t){if(t<this._bars.length)this._bars.splice(t,this._bars.length-t);else for(;this._bars.length<t;)this._bars.push(this.createBar())},inherit(n,l),n.prototype.restoreFactoryDefaults=function(){l.prototype.restoreFactoryDefaults.call(this);var t=Math.round(this._source.calculateATR());this.averageHL.setValue(t)},inherit(r,a),r.prototype.createPropertiesObject=function(t,e,i){return new n(null,e,i)},r.prototype.regenerate=function(){this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._segments.forEach(function(t){t.generate()}),this.updateAllViews(),this._model.updateSource(this)},
r.prototype.propertiesChanged=function(){a.prototype.propertiesChanged.call(this),this._currentAverageHL===this._properties.averageHL.value()&&this._currentVariance===this._properties.variance.value()||this.regenerate()},r.prototype.pointsCount=function(){return-1},r.prototype.title=function(){return"Ghost Feed"},r.prototype.segmentBars=function(t){return this._segments[t].bars()},r.prototype.segments=function(){return this._segments},r.prototype.generateBars=function(t){this._segments.length<=t&&this._segments.push(new o(this,t)),this._segments[t].generate()},r.prototype.addPoint=function(t){var e,i,o;if(this._points.length>0&&(e=this._points[this._points.length-1],e.index===t.index)){for(this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),i=0;i<this._points.length;i++)this._createPointProperty(i);return!0}return o=a.prototype.addPoint.call(this,t),this._finished&&(this._lastPoint=null),this._points.length>1&&this.generateBars(this._points.length-2),o||this._finished},r.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},r.prototype.setPoint=function(t,e,i){var o,n,r;a.prototype.setPoint.call(this,t,e,i),t>0&&(o=this.points()[t-1],n=e.index-o.index,this._segments[t-1].setSize(Math.abs(n))),t<this.points().length-1&&(r=this.points()[t+1],n=r.index-e.index,this._segments[t].setSize(Math.abs(n)))},r.prototype.state=function(t){var e=a.prototype.state.call(this,t);return e.segments=this._segments.map(function(t){return{bars:t.bars()}}),e},r.prototype.restoreData=function(t){var e=this;t.segments&&(this._segments=t.segments.map(function(t,i){return new o(e,i,[].concat(t.bars))})),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value()},r.prototype.onData=function(t){if(a.prototype.onData.call(this,t),0===this.properties().points._childs.length)for(var e=0;e<this._points.length;e++)this._createPointProperty(e);this._currentInterval!==this._model.mainSeries().interval()&&(this.regenerate(),this._currentInterval=this._model.mainSeries().interval())},r.prototype.cloneData=function(t){var e=this;this._segments=t._segments.map(function(t){return t.clone(e)})},r.prototype.calculateATR=function(t){var e,i=(void 0!==t?t:this._model).mainSeries(),o=[];return i.bars().each(function(t,e){o.push(e[TradingView.HIGH_PLOT]-e[TradingView.LOW_PLOT])}),e=0===o.length?0:o.reduce(function(t,e){return t+e},0)/o.length,e*=i.base()},r.prototype.getInputsPropertyPage=function(){return c.LineToolGhostFeedInputsPropertyPage},r.prototype.getStylesPropertyPage=function(){return c.LineToolGhostFeedStylesPropertyPage},e.LineToolGhostFeed=r},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolHeadAndShoulders";var o=e||new r("linetoolheadandshoulders");n.call(this,t,o),i.e(1,function(t){var e=i(889).LineToolHeadAndShouldersPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),
o.prototype.pointsCount=function(){return 7},o.prototype.title=function(){return"Head & Shoulders"},o.prototype.getStylesPropertyPage=function(){return s.LineToolLineTool5PointsPatternStylesPropertyPage},e.LineToolHeadAndShoulders=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolHorzLine";var o=e||new s("linetoolhorzline");this._priceAxisView=new r(this),n.call(this,t,o),i.e(1,function(t){var e=i(891).HorzLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(484).LineToolHorzLinePriceAxisView,s=i(11).DefaultProperty,a=i(9).propertyPages;inherit(o,n),o.prototype.state=function(t){var e=n.prototype.state.call(this,t);return e.points&&0!==e.points.length&&(e.points[0].offset=0),e},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Horizontal Line"},o.prototype.priceAxisViews=function(t,e){return this.isActualSymbol()&&e===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===t?[this._priceAxisView]:null},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._priceAxisView.update()},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){return[this.points()[0].price]},o.prototype.getInputsPropertyPage=function(){return a.LineToolHorzLineInputsPropertyPage},o.prototype.getStylesPropertyPage=function(){return a.LineToolHorzLineStylesPropertyPage},e.LineToolHorzLine=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolHorzRay";var o=e||new s("linetoolhorzray");this._priceAxisView=new r(this),n.call(this,t,o),i.e(1,function(t){var e=i(893).HorzRayPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(484).LineToolHorzLinePriceAxisView,s=i(11).DefaultProperty,a=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Horizontal Ray"},o.prototype.priceAxisViews=function(t,e){return this.isActualSymbol()&&e===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===t?[this._priceAxisView]:null},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._priceAxisView.update()},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){var t=this._points[0],e={index:t.index+1,price:t.price};return[this._linePointsToAlertPlot([t,e],null,!1,!0)]},o.prototype.getStylesPropertyPage=function(){return a.LineToolHorzLineStylesPropertyPage},e.LineToolHorzRay=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolIcon";var s=e||new r("linetoolicon");s.addExclusion("angle"),s.addExclusion("scale"),n.call(this,t,s),this.version=o.version,i.e(1,function(t){var e=i(895).IconPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.version=1,o.anchorLimit=80,o.prototype.getAnchorLimit=function(){return o.anchorLimit},
o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Icon"},o.prototype.startChanging=function(t,e){var i,r;n.prototype.startChanging.call(this,t,e),i=this.properties(),r=65536*i.icon.value()+i.size.value(),this._startChangeWidth=this._paneViews[0]._cache[r],i.size.value()<o.anchorLimit?this._sizeScale=i.size.value()/o.anchorLimit:this._sizeScale=1,this._origScale=i.scale.value(),this._startChangeWidth*this._origScale<o.anchorLimit?this._resizeRatio=this._startChangeWidth/o.anchorLimit:this._resizeRatio=1},o.prototype.endChanging=function(){n.prototype.endChanging.call(this),delete this._startChangeWidth,delete this._sizeScale,delete this._resizeRatio},o.prototype.setPoint=function(t,e,i){var n,r,s,a,l,c,h,u,d,p,_=$.extend({},e),f=this.priceScale();f.isPercent()&&(n=this.ownerSource().firstValue(),_.price=f.priceRange().convertFromPercent(_.price,n)),i&&i.shift&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(_,this.points()[0]),r=this.pointToScreenPoint(this.points()[0])[1],s=this.pointToScreenPoint(_)[1],0===t||1===t?(a=s.subtract(r).normalized(),l=2*s.subtract(r).length(),l*=this._sizeScale,this._properties.size.setValue(l),c=-a.x,h=Math.acos(c),Math.asin(a.y)>0&&(h=2*Math.PI-h),0===t&&(h+=Math.PI),this._properties.angle.setValue(h)):(u=this._startChangeWidth,d=s.subtract(r).length(),this._origScale*u<o.anchorLimit?(p=o.anchorLimit/2,this._properties.scale.setValue(this._origScale*d/p)):(p=u/2,this._properties.scale.setValue(d/p)))},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolIconStylesPropertyPage},o.prototype.getSourceIcon=function(){return{type:"text",text:String.fromCharCode(this.properties().icon.value())}},e.LineToolIcon=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolinsidepitchfork");r.call(this,t,i),this._constructor="LineToolInsidePitchfork"}var n=i(40),r=i(210).LineToolPitchfork;inherit(o,r),o.prototype.title=function(){return $.t("Inside Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},e.LineToolInsidePitchfork=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(135).LineStudyMtp;inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_tsanalysis"},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t,e,i=this.points();return i.length<this.pointsCount()?null:(t=i[0].index,e=this._model.mainSeries().bars().valueAt(t),null===e?null:[this.properties().inputs.displayZoneLabels.value(),1e3*e[TradingView.TIME_PLOT],this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value(),this.properties().inputs.minRRRatio.value(),this.properties().inputs.shouldFilterWPTZones.value(),this.properties().inputs.shouldFilterSTFTrends.value()])},t.exports=o},,,function(t,e,i){(function(t){"use strict";function o(t){this._line=t,
this._data={bodyText:"order",quantityText:"0"},this._editable=!0}function n(t,e){this._adapter=new o(this),this._constructor="LineToolOrder";var n=e||new c("linetoolorder");r.call(this,t,n),i.e(1,function(t){var e=i(900).OrderPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(277),s=i(312).LineToolPriceAxisView,a=i(132),l=i(3).LineDataSource,c=i(11).DefaultProperty;o.prototype.setEditable=function(t){return this._editable=t,this},o.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},o.prototype.setPrice=function(t){if(this._line.points().length>0){var e=this._line.points()[0];e.price=t,this._line._points[0]=e,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=t),this},o.prototype.getText=function(){return this._data.bodyText},o.prototype.setText=function(t){return this._data.bodyText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},o.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},o.prototype.getQuantity=function(){return this._data.quantityText},o.prototype.setQuantity=function(t){return this._data.quantityText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.getExtendLeft=function(){var t=this._line.properties().extendLeft.value();return"inherit"===t?this._line._model.properties().tradingProperties.extendLeft.value():t},o.prototype.setExtendLeft=function(t){return this._line.properties().extendLeft.setValue(t),this},o.prototype.getLineLength=function(){var t=this._line.properties().lineLength.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineLength.value():t},o.prototype.setLineLength=function(t){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(t,100))),this},o.prototype.getLineColor=function(){return a.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},o.prototype.setLineColor=function(t){return a.setColorToProperties(t,this._line.properties().lineColor,this._line.properties().lineTransparency),this},o.prototype.getLineStyle=function(){var t=this._line.properties().lineStyle.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineStyle.value():t},o.prototype.setLineStyle=function(t){return this._line.properties().lineStyle.setValue(t),this},o.prototype.getLineWidth=function(){var t=this._line.properties().lineWidth.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineWidth.value():t},o.prototype.setLineWidth=function(t){return this._line.properties().lineWidth.setValue(t),this},o.prototype.getBodyBorderColor=function(){return a.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},o.prototype.setBodyBorderColor=function(t){
return a.setColorToProperties(t,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},o.prototype.getBodyBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},o.prototype.setBodyBackgroundColor=function(t){return a.setColorToProperties(t,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},o.prototype.getBodyTextColor=function(){return a.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},o.prototype.setBodyTextColor=function(t){return a.setColorToProperties(t,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},o.prototype.getBodyFont=function(){return a.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},o.prototype.setBodyFont=function(t){return a.setFontToProperties(t,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},o.prototype.getQuantityBorderColor=function(){return a.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},o.prototype.setQuantityBorderColor=function(t){return a.setColorToProperties(t,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},o.prototype.getQuantityBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},o.prototype.setQuantityBackgroundColor=function(t){return a.setColorToProperties(t,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},o.prototype.getQuantityTextColor=function(){return a.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},o.prototype.setQuantityTextColor=function(t){return a.setColorToProperties(t,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},o.prototype.getQuantityFont=function(){return a.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},o.prototype.setQuantityFont=function(t){return a.setFontToProperties(t,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},o.prototype.getCancelButtonBorderColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency)},o.prototype.setCancelButtonBorderColor=function(t){
return a.setColorToProperties(t,this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency),this},o.prototype.getCancelButtonBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)},o.prototype.setCancelButtonBackgroundColor=function(t){return a.setColorToProperties(t,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency),this},o.prototype.getCancelButtonIconColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency)},o.prototype.setCancelButtonIconColor=function(t){return a.setColorToProperties(t,this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency),this},o.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},o.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},o.prototype.isFunction=function(t){return"function"==typeof t},o.prototype.onCancel=function(t,e){return e?this.isFunction(e)&&(this._onCancelData=t,this._onCancelCallback=e):this.isFunction(t)&&(this._onCancelCallback=t),this},o.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)},o.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)},o.prototype.onModify=function(t,e){return e?this.isFunction(e)&&(this._onModifyData=t,this._onModifyCallback=e):this.isFunction(t)&&(this._onModifyCallback=t),this},o.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},o.prototype.onMove=function(t,e){return e?this.isFunction(e)&&(this._onMoveData=t,this._onMoveCallback=e):this.isFunction(t)&&(this._onMoveCallback=t),this},o.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)},o.prototype.onContextMenu=function(t,e){return e?this.isFunction(e)&&(this._onContextMenuData=t,this._onContextMenuCallback=e):this.isFunction(t)&&(this._onContextMenuCallback=t),this},o.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},o.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(n,r),n.skipMagnetting=!0,n.prototype.setPoint=function(t,e,i){this._points[t]=e,this.normalizePoints()},n.prototype.addPoint=function(t,e){return this._points.push(t),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},n.prototype.title=function(){return"Order"},n.prototype.endMoving=function(t){var e=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.price!==this._currentMovingPoint.price;r.prototype.endMoving.call(this),!t&&e&&this._adapter.callOnMove()},
n.prototype.createPriceAxisView=function(t){return this._priceAxisView=new s(this,{pointIndex:t,backgroundProperty:this.properties().lineColor}),this._priceAxisView},n.prototype.paneViews=function(e){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.paneViews.call(this,e):null},n.prototype.priceAxisViews=function(e,i){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.priceAxisViews.call(this,e,i):null},n.prototype.hasContextMenu=function(){return!0},n.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},n.prototype.onlyYMoving=function(){return!0},e.LineToolOrder=n}).call(e,i(7))},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolParallelChannel";var o=e||new r("linetoolparallelchannel");n.call(this,t,o),i.e(1,function(t){var e=i(902).ParallelChannelPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.addPoint=function(t){var e,i=n.prototype.addPoint.call(this,t);return i&&(e=this.points()[0],this._points[2].index=e.index,this._points[2].price=e.price+this._priceOffset),i},o.prototype.calculatePriceDiff=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;if(3===this.points().length){if(t=this.points()[0],e=this.points()[1],i=this.points()[2],t.index===e.index)return;if(null===(o=this.priceScale()))return;if(o.isLog()){if(n=this._model.timeScale(),n.isEmpty())return;r=n.indexToCoordinate(t.index),s=n.indexToCoordinate(e.index),a=o.priceToCoordinate(t.price),l=o.priceToCoordinate(e.price),c=n.indexToCoordinate(i.index),h=(l-a)/(s-r),u=a+h*(c-r),d=o.priceToCoordinate(i.price),p=d-u,_=.5*(a+l),f=o.coordinateToPrice(_),m=_+p,g=o.coordinateToPrice(m),this._priceOffset=g-f}else h=(e.price-t.price)/(e.index-t.index),v=t.price+h*(i.index-t.index),this._priceOffset=i.price-v}},o.prototype.setLastPoint=function(t,e){e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[0]),n.prototype.setLastPoint.call(this,t),this.calculatePriceDiff()},o.prototype.restorePoints=function(t,e,i){n.prototype.restorePoints.call(this,t,e,i),t&&t.length>=3&&(this._priceOffset=t[2].price-t[0].price)},o.prototype.setPoint=function(t,e,i){i&&i.shift&&t<2&&this._snapPoint45Degree(e,this.points()[1-t]),n.prototype.setPoint.call(this,t,e,i),2===t&&this.calculatePriceDiff();var o=this.points()[0];this._points[2].index=o.index,this._points[2].price=o.price+this._priceOffset},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Parallel Channel"},o.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[0]),n.prototype.addPoint.call(this,t,e)},o.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset},o.prototype.cloneData=function(t){
this._priceOffset=t._priceOffset},o.prototype.restoreData=function(t){t.priceOffset&&(this._priceOffset=t.priceOffset)},o.prototype.state=function(t){var e=n.prototype.state.call(this,t);return e.priceOffset=this._priceOffset,e},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){function t(t,e){return t.index<=e.index?[t,e]:[e,t]}var e,i,o,n,r,s,a,l,c=[].concat(this._points).splice(0,2);return c=c.concat([{price:c[0].price+this._priceOffset,time:c[0].time,index:c[0].index},{price:c[1].price+this._priceOffset,time:c[1].time,index:c[1].index}]),e=t(c[0],c[1]),i=t(c[2],c[3]),this._priceOffset<0?(n=i,o=e):(n=e,o=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c[0].index<=c[1].index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(o,"Upper",r,s),this._linePointsToAlertPlot(n,"Lower",r,s)]},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolParallelChannelStylesPropertyPage},e.LineToolParallelChannel=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPitchfan";var o=e||this.createPropertiesObject("linetoolpitchfan");n.call(this,t,o),i.e(1,function(t){var e=i(904).PitchfanLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(40),s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Pitchfan"},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[0,8]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolPitchfanStylesPropertyPage},e.LineToolPitchfan=o},,,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPolyline";var o;e?o=e:(o=new s("linetoolpolyline"),o.filled.setValue(!1)),r.call(this,t,o),o.addExclusion("filled"),i.e(1,function(t){var e=i(907).PolylinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(1).Point,r=i(3).LineDataSource,s=i(11).DefaultProperty,a=i(9).propertyPages;inherit(o,r),o.prototype.pointsCount=function(){return-1},o.prototype.title=function(){return"Polyline"},o.prototype.addPoint=function(t){var e,i,o,s,a,l,c,h,u,d,p=this._model.timeScale().indexToCoordinate(t.index),_=t.price,f=null;if(this.priceScale().isPercent()&&(f=this.ownerSource().firstValue()),e=this.priceScale().priceToCoordinate(_),i=5,this._points.length>0){if(o=this._points[this._points.length-1],s=this._model.timeScale().indexToCoordinate(o.index),a=o.price,this.priceScale().isPercent()&&(a=this.priceScale().priceRange().convertToPercent(a,f)),l=this.priceScale().priceToCoordinate(a),new n(p,e).subtract(new n(s,l)).length()<i)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;if(c=this._points[0],h=this._model.timeScale().indexToCoordinate(c.index),u=c.price,
this.priceScale().isPercent()&&(u=this.priceScale().priceRange().convertToPercent(u,f)),d=this.priceScale().priceToCoordinate(u),new n(p,e).subtract(new n(h,d)).length()<i)return this._properties.filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return r.prototype.addPoint.call(this,t)},o.prototype.setPoint=function(t,e){var i,o,s,a,l,c;r.prototype.setPoint.call(this,t,e),this._model.timeScale().isEmpty()||this.priceScale().isEmpty()||t!==this._points.length-1&&0!==t||(i=5,o=this._model.timeScale().indexToCoordinate(e.index),s=this.priceScale().priceToCoordinate(e.price),a=t===this._points.length-1?this._points[0]:this._points[this._points.length-1],l=this._model.timeScale().indexToCoordinate(a.index),c=this.priceScale().priceToCoordinate(a.price),new n(o,s).subtract(new n(l,c)).length()<i&&this._properties.filled.setValue(!0))},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return a.LineToolPolylineStylesPropertyPage},e.LineToolPolyline=o},,function(t,e,i){(function(t){"use strict";function o(t){this._line=t,this._data={bodyText:"position",quantityText:"0"},this._closeEnabled=!0}function n(t,e){this._adapter=new o(this),this._constructor="LineToolPosition";var n=e||new c("linetoolposition");r.call(this,t,n),i.e(1,function(t){var e=i(909).PositionPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(277),s=i(3).LineDataSource,a=i(312).LineToolPriceAxisView,l=i(132),c=i(11).DefaultProperty;o.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},o.prototype.setPrice=function(t){if(this._line.points().length>0){var e=this._line.points()[0];e.price=t,this._line._points[0]=e,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=t),this},o.prototype.getText=function(){return this._data.bodyText},o.prototype.setText=function(t){return this._data.bodyText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},o.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},o.prototype.getQuantity=function(){return this._data.quantityText},o.prototype.setQuantity=function(t){return this._data.quantityText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.getExtendLeft=function(){var t=this._line.properties().extendLeft.value();return"inherit"===t?this._line._model.properties().tradingProperties.extendLeft.value():t},o.prototype.setExtendLeft=function(t){return this._line.properties().extendLeft.setValue(t),this},o.prototype.getLineLength=function(){var t=this._line.properties().lineLength.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineLength.value():t},o.prototype.setLineLength=function(t){
return this._line.properties().lineLength.setValue(Math.max(0,Math.min(t,100))),this},o.prototype.getLineColor=function(){return l.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},o.prototype.setLineColor=function(t){return l.setColorToProperties(t,this._line.properties().lineColor,this._line.properties().lineTransparency),this},o.prototype.getLineStyle=function(){var t=this._line.properties().lineStyle.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineStyle.value():t},o.prototype.setLineStyle=function(t){return this._line.properties().lineStyle.setValue(t),this},o.prototype.getLineWidth=function(){var t=this._line.properties().lineWidth.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineWidth.value():t},o.prototype.setLineWidth=function(t){return this._line.properties().lineWidth.setValue(t),this},o.prototype.getBodyBorderColor=function(){return l.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},o.prototype.setBodyBorderColor=function(t){return l.setColorToProperties(t,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},o.prototype.getBodyBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},o.prototype.setBodyBackgroundColor=function(t){return l.setColorToProperties(t,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},o.prototype.getBodyTextColor=function(){return l.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},o.prototype.setBodyTextColor=function(t){return l.setColorToProperties(t,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},o.prototype.getBodyFont=function(){return l.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},o.prototype.setBodyFont=function(t){return l.setFontToProperties(t,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},o.prototype.getQuantityBorderColor=function(){return l.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},o.prototype.setQuantityBorderColor=function(t){return l.setColorToProperties(t,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},o.prototype.getQuantityBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},o.prototype.setQuantityBackgroundColor=function(t){
return l.setColorToProperties(t,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},o.prototype.getQuantityTextColor=function(){return l.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},o.prototype.setQuantityTextColor=function(t){return l.setColorToProperties(t,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},o.prototype.getQuantityFont=function(){return l.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},o.prototype.setQuantityFont=function(t){return l.setFontToProperties(t,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},o.prototype.getReverseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency)},o.prototype.setReverseButtonBorderColor=function(t){return l.setColorToProperties(t,this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency),this},o.prototype.getReverseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)},o.prototype.setReverseButtonBackgroundColor=function(t){return l.setColorToProperties(t,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency),this},o.prototype.getReverseButtonIconColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency)},o.prototype.setReverseButtonIconColor=function(t){return l.setColorToProperties(t,this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency),this},o.prototype.getCloseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency)},o.prototype.setCloseButtonBorderColor=function(t){return l.setColorToProperties(t,this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency),this},o.prototype.getCloseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)},o.prototype.setCloseButtonBackgroundColor=function(t){return l.setColorToProperties(t,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency),this},o.prototype.getCloseButtonIconColor=function(){
return l.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)},o.prototype.setCloseButtonIconColor=function(t){return l.setColorToProperties(t,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency),this},o.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},o.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},o.prototype.isFunction=function(t){return"function"==typeof t},o.prototype.onReverse=function(t,e){return e?this.isFunction(e)&&(this._onReverseData=t,this._onReverseCallback=e):this.isFunction(t)&&(this._onReverseCallback=t),this},o.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)},o.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)},o.prototype.onClose=function(t,e){return e?this.isFunction(e)&&(this._onCloseData=t,this._onCloseCallback=e):this.isFunction(t)&&(this._onCloseCallback=t),this},o.prototype.setCloseEnabled=function(t){return this._closeEnabled===t?this:(this._closeEnabled=t,this._onCloseCallback&&this._line.updateAllViewsAndRedraw(),this)},o.prototype.isCloseEnabled=function(){return this._closeEnabled},o.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._closeEnabled&&this._onCloseCallback.call(this,this._onCloseData)},o.prototype.isOnCloseCallbackPresent=function(){return this._closeEnabled&&this.isFunction(this._onCloseCallback)},o.prototype.onModify=function(t,e){return e?this.isFunction(e)&&(this._onModifyData=t,this._onModifyCallback=e):this.isFunction(t)&&(this._onModifyCallback=t),this},o.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},o.prototype.onContextMenu=function(t,e){return e?this.isFunction(e)&&(this._onContextMenuData=t,this._onContextMenuCallback=e):this.isFunction(t)&&(this._onContextMenuCallback=t),this},o.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},o.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(n,r),n.prototype.setPoint=function(t,e,i){this._points[t]=e,this.normalizePoints()},n.prototype.addPoint=function(t,e){return this._points.push(t),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},n.skipMagnetting=!0,n.prototype.title=function(){return"Position"},n.prototype.createPriceAxisView=function(t){return this._priceAxisView=new a(this,{pointIndex:t,backgroundProperty:this.properties().lineColor}),this._priceAxisView},n.prototype.paneViews=function(e){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.paneViews.call(this,e):null},n.prototype.priceAxisViews=function(e,i){
return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.priceAxisViews.call(this,e,i):null},n.prototype.hasContextMenu=function(){return!0},n.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},e.LineToolPosition=n}).call(e,i(7))},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPrediction";var o=e||new s("linetoolprediction");o.merge({status:l.AlertStatus.Waiting}),r.call(this,t,o),i.e(1,function(t){var e=i(911).PredictionPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(21).ensureNotNull,r=i(3).LineDataSource,s=i(11).DefaultProperty,a=i(9).propertyPages,l=i(487);inherit(o,r),o.prototype.status=function(){return this._properties.status.value()},o.prototype.setStatus=function(t){return this._properties.status.setValue(t)},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Forecast"},o.prototype.restorePoints=function(t,e,i){r.prototype.restorePoints.call(this,t,e,i),this.checkAlert()},o.prototype.checkAlert=function(){var t,e,i,o;if(!(this._points.length<2||this._model.mainSeries().bars().isEmpty())){if(t=this._points[1],this.status())return void(t.index>this._model.timeScale().baseIndex()&&this.setStatus(l.AlertStatus.Waiting));e=this._model.mainSeries().bars().valueAt(t.index),null!==e&&(i=this.direction(),i===l.Direction.Up&&e[TradingView.HIGH_PLOT]>=t.price?this.setStatus(l.AlertStatus.Success):i===l.Direction.Down&&e[TradingView.LOW_PLOT]<=t.price?this.setStatus(l.AlertStatus.Success):(o=n(this._model.mainSeries().bars().lastIndex()),t.index!==o&&this.setStatus(l.AlertStatus.Failure)))}},o.prototype.addPoint=function(t){var e=r.prototype.addPoint.call(this,t);return e&&this.checkAlert(),e},o.prototype.endChanging=function(){r.prototype.endChanging.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},o.prototype.onData=function(t){r.prototype.onData.call(this,t),this.checkAlert()},o.prototype.endMoving=function(){r.prototype.endMoving.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},o.prototype.direction=function(){var t,e;return this.points().length<2?l.Direction.Up:(t=this.points()[0],e=this.points()[1],e.price>t.price?l.Direction.Up:l.Direction.Down)},o.prototype.getStylesPropertyPage=function(){return a.LineToolPredictionStylesPropertyPage},e.LineToolPrediction=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPriceLabel";var o=e||new r("linetoolpricelabel");n.call(this,t,o),i.e(1,function(t){var e=i(913).PriceLabelPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Price Label"},o.prototype.getStylesPropertyPage=function(){return s.LineToolPriceLabelStylesPropertyPage},e.LineToolPriceLabel=o},,function(t,e,i){"use strict";function o(t,e){
this._constructor="LineToolPriceRange";var o=e||new r("linetoolpricerange");n.call(this,t,o),i.e(1,function(t){var e=i(915).PriceRangePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Price Range"},o.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},e.LineToolPriceRange=o},,function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolProjection";var o=e||this.createPropertiesObject("linetoolprojection");l.call(this,t,o),i.e(1,function(t){var e=i(917).ProjectionLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(40),s=i(415).LineToolFibWedge,a=i(116),l=i(3).LineDataSource,c=i(9).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return 1},inherit(n,s),n.prototype.title=function(){return"Projection"},n.prototype.getCache=function(){return this._model._projectionLabelsCache||(this._model._projectionLabelsCache=new o),this._model._projectionLabelsCache},n.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,1]})},n.prototype.getStylesPropertyPage=function(){return c.LineToolProjectionStylesPropertyPage},e.LineToolProjection=n},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolRay";var i=e||new r("linetoolray");n.call(this,t,i)}var n=i(211).LineToolTrendLine,r=i(11).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Ray"},e.LineToolRay=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolRectangle";var o=e||new r("linetoolrectangle");n.call(this,t,o),i.e(1,function(t){var e=i(920).RectanglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Rectangle"},o.prototype.setPoint=function(t,e,i){var o,r,s;if(t<2)return void n.prototype.setPoint.call(this,t,e,i);i&&i.shift&&this._properties.snapTo45Degrees&&(o=this.points()[0],r=this.points()[1],s={price:2===t?o.price:r.price,index:2===t?r.index:o.index},this._snapPoint45Degree(e,s)),this._convertPriceFromPercentIfNeeded(e),3===t?(this._points[0].price=e.price,this._points[1].index=e.index):(this._points[1].price=e.price,this._points[0].index=e.index),this.normalizePoints()},o.prototype.getStylesPropertyPage=function(){return s.LineToolRectangleStylesPropertyPage},e.LineToolRectangle=o},,,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolRotatedRectangle";var o=e||new a("linetoolrotatedrectangle");s.call(this,t,o),i.e(1,function(t){var e=i(923).RotatedRectanglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(1).Point,r=i(33).distanceToLine,s=i(3).LineDataSource,a=i(11).DefaultProperty,l=i(9).propertyPages;inherit(o,s),o.prototype.startChanging=function(t,e){var i,o,n,a
;s.prototype.startChanging.call(this,t,e),0!==t&&1!==t||(i=this._paneViews[0],o=i._points[0],n=i._points[1],a=i._points[2],this._distance=r(o,n,a).distance)},o.prototype.setPoint=function(t,e,i){var o,r,a,l,c,h,u;s.prototype.setPoint.call(this,t,e,i),0!==t&&1!==t||(o=this._paneViews[0],o.update(),r=o._points[0],a=o._points[1],l=a.subtract(r),c=new n(l.y,-l.x).normalized().scaled(this._distance),h=r.add(c),u=this.screenPointToPoint(h),this._points[2]=u)},o.prototype.endChanging=function(){delete this._distance},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Rotated Rectangle"},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return l.LineToolRectangleStylesPropertyPage},e.LineToolRotatedRectangle=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork");r.call(this,t,i),this._constructor="LineToolSchiffPitchfork"}var n=i(40),r=i(210).LineToolPitchfork;inherit(o,r),o.prototype.title=function(){return $.t("Modified Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},e.LineToolSchiffPitchfork=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork2");r.call(this,t,i),this._constructor="LineToolSchiffPitchfork2"}var n=i(40),r=i(210).LineToolPitchfork;inherit(o,r),o.prototype.title=function(){return $.t("Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},e.LineToolSchiffPitchfork2=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolSineLine";var o;o=e||new r("linetoolsineline"),n.call(this,t,o),i.e(1,function(t){var e=i(927).SineLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Sine Line"},o.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},e.LineToolSineLine=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolThreeDrivers";var o=e||new r("linetoolthreedrivers");n.call(this,t,o),i.e(1,function(t){var e=i(929).LineToolThreeDrivesPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 7},o.prototype.title=function(){return"Three Drives Pattern"},o.prototype.getStylesPropertyPage=function(){return s.LineToolABCDPatternStylesPropertyPage},e.LineToolThreeDrivers=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolTimeCycles";var o;o=e||new r("linetooltimecycles"),n.call(this,t,o),i.e(1,function(t){var e=i(931).TimeCyclesPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){
return 2},o.prototype.title=function(){return"Time Cycles"},o.prototype.setPoint=function(t,e,i){var o,n=$.extend({},e),r=this._points[0],s=this._points[1],a=this.priceScale();a.isPercent()&&(o=this.ownerSource().firstValue(),n.price=a.priceRange().convertFromPercent(n.price,o)),r.price=n.price,s.price=n.price,this._points[t]=n,this.normalizePoints()},o.prototype.addPoint=function(t,e,i){var o,r,s=n.prototype.addPoint.call(this,t,e,!0);return s&&(o=this._points[0],r=this._points[1],r.price=o.price,i||(this.normalizePoints(),this.createServerPoints())),s},o.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},e.LineToolTimeCycles=o},,function(t,e,i){(function(t){"use strict";function o(t,e){this._constructor="LineToolTrendAngleLine";var n=e||new s("linetooltrendangle");r.call(this,t,n),this._properties.addProperty("angle"),this._properties.angle=new o.AngleProperty(this),i.e(1,function(t){var e=i(933).TrendAnglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(1).Point,r=i(3).LineDataSource,s=i(11).DefaultProperty,a=i(9).propertyPages;inherit(o,r),o.AngleProperty=function(e){t.call(this),this._lineSource=e},inherit(o.AngleProperty,t),o.AngleProperty.prototype.value=function(){var t=this._lineSource._angle,e=180*t/Math.PI;return Math.round(e)},o.AngleProperty.prototype.setValue=function(t){var e,i,o,r,s,a,l=t*Math.PI/180;this._lineSource._angle=l,e=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],i=Math.cos(this._lineSource._angle),o=-Math.sin(this._lineSource._angle),r=new n(i,o),s=e.addScaled(r,this._lineSource._distance),a=this._lineSource.screenPointToPoint(s),this._lineSource._points[1]=a,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Trend Angle"},o.prototype._calculateAngle=function(){var t,e=this.pointToScreenPoint(this.points()[0])[0],i=this.pointToScreenPoint(this.points()[1])[0],o=i.subtract(e);o.length()>0?(o=o.normalized(),this._angle=Math.acos(o.x),o.y>0&&(this._angle=-this._angle),this._distance=i.subtract(e).length()):delete this._angle,t=this.properties(),t.hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)},o.prototype.addPoint=function(t,e){var i=r.prototype.addPoint.call(this,t,e);return i&&this._calculateAngle(),i},o.prototype.setLastPoint=function(t,e){r.prototype.setLastPoint.call(this,t,e),this.points().length>1&&this._calculateAngle()},o.prototype.axisPoints=function(){var t,e,i,o,r,s;return this.points().length<2?[]:(t=[this.points()[0]],e=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,o=-Math.sin(this._angle)*this._distance,r=e.add(new n(i,o)),s=this.screenPointToPoint(r),t.push(s),t)},o.prototype.setPoint=function(t,e,i){r.prototype.setPoint.call(this,t,e,i),this.points().length>1&&1===t&&this._calculateAngle()},o.prototype.restoreData=function(t){
this._angle=t.angle,this._distance=t.distance},o.prototype.state=function(t){var e=r.prototype.state.call(this,t);return e.angle=this._angle,e.distance=this._distance,e},o.prototype.cloneData=function(t){this._angle=t._angle,this._distance=t._distance},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},o.prototype.getInputsPropertyPage=function(){return a.LineToolTrendAngleInputsPropertyPage},o.prototype.getStylesPropertyPage=function(){return a.LineToolTrendAngleStylesPropertyPage},e.LineToolTrendAngle=o}).call(e,i(52))},,function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolTrendBasedFibExtension";var s=e||new this.createPropertiesObject("linetooltrendbasedfibextension");r.call(this,t,s),this.version=n.version,t._trendBasedFibExtensionLabelsCache||(t._trendBasedFibExtensionLabelsCache=new o),i.e(1,function(t){var e=i(935).TrendBasedFibExtensionPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var r=i(3).LineDataSource,s=i(40),a=i(116),l=i(9).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return n.LevelsCount},o.prototype.points=function(t){return[t.points()[0],t.points()[1]]},o.prototype.startPoint=function(t,e){return t.points()[2]},o.prototype.priceRange=function(t,e){var i=this.points(t),o=i[0],n=i[1];return e?o.price-n.price:n.price-o.price},o.prototype.sourceIsReady=function(t){return t.points().length>=3},inherit(n,r),n.version=2,n.LevelsCount=24,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.stop=function(){r.prototype.stop.call(this),this._model._trendBasedFibExtensionLabelsCache.removeSource(this.id())},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Trend-Based Fib Extension"},n.prototype.migrateVersion=function(t,e,i){1===t&&this.properties().extendLines.setValue(!0)},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[0,8]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolTrendBasedFibExtensionStylesPropertyPage},e.LineToolTrendBasedFibExtension=n},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolTrendBasedFibTime";var r=e||new this.createPropertiesObject("linetooltrendbasedfibtime");n.call(this,t,r),this.version=o.version,i.e(1,function(t){var e=i(937).TrendBasedFibTimePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(40),s=i(9).propertyPages;inherit(o,n),o.version=1,o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Trend-Based Fib Time"},o.prototype.migrateVersion=function(t,e,i){},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},
o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolTrendBasedFibTimeStylesPropertyPage},e.LineToolTrendBasedFibTime=o},,,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolTrianglePattern";var o=e||new r("linetooltrianglepattern");n.call(this,t,o),i.e(1,function(t){var e=i(940).LineToolTrianglePatternPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 4},o.prototype.title=function(){return"Triangle Pattern"},o.prototype.getStylesPropertyPage=function(){return s.LineToolTrianglePatternStylesPropertyPage},e.LineToolTrianglePattern=o},,function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolTriangle";var o=e||new r("linetooltriangle");n.call(this,t,o),i.e(1,function(t){var e=i(942).TrianglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Triangle"},o.prototype.getStylesPropertyPage=function(){return s.LineToolTriangleStylesPropertyPage},e.LineToolTriangle=o},,function(t,e,i){"use strict";function o(t,e){n.call(this),this._source=t,this._model=e,this._invalidated=!0,this._renderer=new r}var n=i(317).TimeAxisView,r=i(284),s=i(173).DateTimeFormatter;inherit(o,n),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e;this._model.timeScale().isEmpty()||0!==this._source.points().length&&(this._text="",this._background=this._source.properties().linecolor.value(),t=this._source.points()[0].index,this._coordinate=this._model.timeScale().indexToCoordinate(t),e=this._model.timeScale().indexToUserTime(t),e&&(this._text=new s(this._model.mainSeries().isDWM()).format(e)),this._invalidated=!1)},o.prototype.renderer=function(){this._invalidated&&this.updateImpl();var t={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background};return this._renderer.setData(t),this._renderer},e.LineToolVertLineTimeAxisView=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolVertLine";var o=e||new r("linetoolvertline");this._timeAxisView=new a(this,t),n.call(this,t,o),i.e(1,function(t){var e=i(944).VertLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this))}var n=i(3).LineDataSource,r=i(11).DefaultProperty,s=i(9).propertyPages,a=i(945).LineToolVertLineTimeAxisView;inherit(o,n),o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Vertical Line"},o.prototype.timeAxisViews=function(){return this.symbol()!==this._model.mainSeries().symbol()?null:this.properties().showTime.value()?[this._timeAxisView]:null},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._timeAxisView.update()},o.prototype.canHasAlert=function(){return!0},
o.prototype._getAlertPlots=function(){var t=this._points[0],e={index:t.index,price:t.price+1};return[this._linePointsToAlertPlot([t,e],null,!0,!0)]},o.prototype.getInputsPropertyPage=function(){return s.LineToolVertLineInputsPropertyPage},o.prototype.getStylesPropertyPage=function(){return s.LineToolVertLineStylesPropertyPage},e.LineToolVertLine=o},function(t,e,i){"use strict";function o(){}var n=i(56),r=n.min,s=n.max;o.prototype._locationToY=function(t,e,i){var o,n,a,l,c,h,u;switch(i||(i=0),o=[],n=this._study.priceScale(),t){case CanvasEx.MARKLOC_ABOVEBAR:a=TradingView.HIGH_PLOT;break;case CanvasEx.MARKLOC_BELOWBAR:a=TradingView.LOW_PLOT}for(l=this._study.firstValue(),i>=1&&(i-=1),c=-i;c<=i;c++)null!==(h=this._study.series().bars().valueAt(e+c))&&(u=h[a],n.isPercent()&&(u=n.priceRange().convertToPercent(u,l)),o.push(n.priceToCoordinate(u)));switch(t){case CanvasEx.MARKLOC_ABOVEBAR:return r(o)-15;case CanvasEx.MARKLOC_BELOWBAR:return s(o)+15}},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this._magnetProperty=t,this._timeScale=e}var n=i(85);o.prototype.align=function(t,e,i){var o,r,s,a,l,c,h,u,d,p=50,_=i.defaultPriceScale(),f=_.priceToCoordinate(t),m=t;if(!this._magnetProperty.value())return m;for(o=_.dataSources(),r=null,s=0;s<o.length;s++)if(o[s]instanceof n){r=o[s];break}if(r&&(a=r.bars(),a.contains(e)&&(l=a.valueAt(e),c=[l[TradingView.OPEN_PLOT],l[TradingView.HIGH_PLOT],l[TradingView.LOW_PLOT],l[TradingView.CLOSE_PLOT]],_=r.priceScale(),!_.isEmpty()))){if(h=[],_.isPercent())for(u=r.firstValue(),s=0;s<c.length;s++)c[s]=_.priceRange().convertToPercent(c[s],u);for(s=0;s<c.length;s++)h.push({y:_.priceToCoordinate(c[s]),price:c[s]});h.sort(function(t,e){return Math.abs(t.y-f)-Math.abs(e.y-f)}),d=h[0],Math.abs(d.y-f)<p&&(m=d.price)}return m},t.exports=o},function(t,e){"use strict";function i(t){this._data=t}i.prototype._drawShackle=function(t){var e=this._data.width-3,i=e/2,o=this._data.height-this._data.bodyHeight;t.moveTo(1.5,i),t.arc(this._data.width/2,i,i,Math.PI,2*Math.PI),o>i&&(t.moveTo(1.5,i),t.lineTo(1.5,o),t.moveTo(this._data.width-1.5,i),t.lineTo(this._data.width-1.5,o))},i.prototype.draw=function(t){var e,i,o,n;t.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),e="rgba(153,153,153,.3)",i="rgba(153,153,153,.7)",o="#777",n="rgba(255,255,255,.7)",t.strokeStyle=e,t.lineWidth=2,t.beginPath(),this._drawShackle(t),t.stroke(),t.closePath(),t.strokeStyle=i,t.lineWidth=1,t.beginPath(),t.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),t.closePath(),t.stroke(),t.translate(0,-1),t.strokeStyle=o,t.beginPath(),this._drawShackle(t),t.stroke(),t.closePath(),t.fillStyle=n,t.beginPath(),t.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),t.fill(),t.beginPath(),t.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),t.stroke(),t.closePath(),t.fillStyle=o,t.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)},
e.PaneRendererCrossHairLock=TradingView.PaneRendererCrossHairLock=i},function(t,e,i){"use strict";function o(t){this.data=t}var n=i(4);o.prototype.draw=function(t){var e,i,o,n,r,s=this.data.vertLinesVisible,a=this.data.horzLinesVisible;(s||a)&&this.data&&(t.lineStyle=this.data.lineStyle,t.lineWidth=this.data.lineWidth,t.strokeStyle=this.data.color,e=this.data.lineWidth%2==0?.5:0,i=this.data.x+1+e,o=this.data.y+e,n=this.data.w,r=this.data.h,s&&i>=0&&CanvasEx.drawLine(t,i,0,i,r),a&&o>=0&&CanvasEx.drawLine(t,0,o,n,o),this.data.drawCenter&&(t.beginPath(),t.arc(i,o,3,0,2*Math.PI,!0),t.fillStyle=this.data.color,t.fill()))},o.prototype.hitTest=function(t){return this.data.mouseClickHandler?new n(n.CUSTOM,{mouseClickHandler:this.data.mouseClickHandler}):null},e.PaneRendererCrossHair=TradingView.PaneRendererCrossHair=o},function(t,e,i){"use strict";function o(t){s.call(this,t),this.width=this._calculateWidth(t.barSpacing),this._isUp=!1}function n(t){o.call(this,t),this._isUp=!0}function r(t){o.call(this,t),this._isUp=!1}var s=i(84).PaneRendererAbstractShape;inherit(o,s),o.prototype._calculateWidth=function(t){return t=t||this.barSpacing,Math.round(t/4)},o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=!1,h=this.width,u=Math.abs(this.height),d=h<4,p=Math.max(parseInt(h/2),1),_=Math.round(this.width/2),f=Math.round(this.width),m=this._isUp?-1:1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],r=n.x,s=n.y+this._vertOffset+m*Math.round(u/2),n.style&&null!=n.style.color?(a=n.style.color,l=n.style.borderColor):(a=this._color,l=this._borderColor),a!==e&&(e=a,c&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=a,t.strokeStyle=l),t.translate(r,s),d?(t.moveTo(0,0),t.lineTo(-_,-_*m),t.moveTo(0,0),t.lineTo(_,-_*m),t.moveTo(0,0),t.lineTo(0,-u*m),t.moveTo(-_,-u*m),t.lineTo(_,-u*m),t.lineWidth=p):(t.moveTo(0,0),u<f?(t.lineTo(h,-u*m),t.lineTo(-h,-u*m)):(t.lineTo(h,-f*m),t.lineTo(_,-f*m),t.lineTo(_,-u*m),t.lineTo(-_,-u*m),t.lineTo(-_,-f*m),t.lineTo(-h,-f*m)),t.lineTo(0,0)),t.translate(-r,-s),c=!0;c&&(t.fill(),t.stroke())},inherit(n,o),inherit(r,o),e.PaneRendererArrowBase=TradingView.PaneRendererArrowBase=o,e.PaneRendererArrowUp=TradingView.PaneRendererArrowUp=n,e.PaneRendererArrowDown=TradingView.PaneRendererArrowDown=r},function(t,e){"use strict";function i(t){this._items=t.items,this._y=t.y,this._h=t.h,this._w=t.w}i.prototype.draw=function(t){},i.prototype.drawBackground=function(t){var e,i,o;for(t.save(),t.translate(-.5,-.5),e=0;e<this._items.length;++e)i=this._items[e],null!=i.color&&(t.fillStyle=i.color,o=e===this._items.length-1?this._w:this._items[e+1].x-i.x,t.fillRect(i.x,this._y,o,this._h));t.restore()},i.prototype.hitTest=function(t){return null},e.PaneRendererBackground=TradingView.PaneRendererBackground=i},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(84).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=Math.max(this.width,this.height)/2,h=this._vertOffset,u=2*Math.PI,d=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],
n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,d&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x,l=n.y+h,t.moveTo(a+c,l),t.arc(a,l,c,0,u,!1),d=!0;d&&(t.fill(),t.stroke())},e.PaneRendererCircleShape=TradingView.PaneRendererCircleShape=o},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.lineColor=t.lineColor||t.color,this.radius=t.lineWidth||t.height/2,this.vertOffset=t.vertOffset||0}var n=i(1).Point,r=i(69).selectionTolerance,s=i(4);o.prototype.draw=function(t){var e,i,o,n,r,s,a,l=2*Math.PI,c=!1;for(o=0;o<this.items.length;++o)n=this.items[o],r=n.x,s=n.y+this.vertOffset,TradingView.isNaN(r)||TradingView.isNaN(s)||(null!=n.style?(a=n.style.color,e=n.style.width):(a=this.lineColor,e=this.radius),a!==i&&(i=a,c&&t.fill(),t.beginPath(),t.fillStyle=a),t.moveTo(r+e,s),t.arc(r,s,e,0,l,!1),c=!0);c&&t.fill()},o.prototype.hitTest=function(t){var e,i,o,a=2*this.radius,l=this.vertOffset,c=r(a);for(e=0;e<this.items.length;++e)if((i=this.items[e])&&(o=new n(i.x,i.y+l),o.subtract(t).length()+this.radius<=c))return new s(s.REGULAR);return null},e.PaneRendererCircles=TradingView.PaneRendererCircles=o},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.histogramBase=t.histogramBase,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth}var n=i(4);o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p;if(0!==this.items.length){for(e=this.barSpacing,i=this.lineColor,o=this.histogramBase,t.translate(.5,.5),n={},r=this.items,s=0;s<r.length;++s)a=r[s],l=0===s?null:r[s-1],c=a.style?a.style.color:i,h=n[c]||[],h.push({item:a,prev:l}),n[c]=h;for(c in n){for(h=n[c],t.fillStyle=c,t.strokeStyle=c,t.lineWidth=1,t.beginPath(),s=0;s<h.length;s++)a=h[s].item,u=Math.ceil(a.x-.5*e),d=Math.ceil(u+e),p=a.y,t.rect(u,p,d-u,o-p);for(t.fill(),t.beginPath(),s=0;s<h.length;s++)a=h[s].item,u=Math.ceil(a.x-.5*e),d=Math.ceil(u+e),p=a.y,l=h[s].prev,t.moveTo(d-.5,o),t.lineTo(d-.5,p+.5),t.lineTo(u+.5,p+.5),l&&l.y>p&&t.lineTo(u+.5,l.y);t.stroke()}}},o.prototype.hitTest=function(t){var e,i,o,r=.5*this.barSpacing+this.lineWidth,s=t.x-r,a=t.x+r,l=this.items;for(e=l.length;e--;)if((i=l[e].x)>=s&&i<=a&&(o=l[e].y,t.y>=Math.min(o,this.histogramBase)&&t.y<=Math.max(o,this.histogramBase)))return new n(n.REGULAR);return null},e.PaneRendererColumns=TradingView.PaneRendererColumns=o},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth,this.lineStyle=t.lineStyle}var n=i(1).Point,r=i(33).distanceToSegment,s=i(69).selectionTolerance,a=i(4);o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c=!1;for(o=0;o<this.items.length;++o)n=this.items[o],r=n.x,s=n.y,TradingView.isNaN(r)||TradingView.isNaN(s)||(null!=n.style?(a=n.style.color,e=n.style.width):(a=this.lineColor,e=this.lineWidth),a!==i&&(i=a,c&&t.fill(),t.beginPath(),t.fillStyle=a),l=3*e,t.rect(r-l/2,s-e/2,l,e),t.rect(r-e/2,s-l/2,e,l),c=!0);c&&t.fill()},
o.prototype.hitTest=function(t){var e,i,o,l,c,h,u=s(this.lineWidth);for(h=1;h<this.items.length;++h)if(e=this.items[h-1],i=this.items[h],o=e.x,l=i.x,c=r(new n(o,e.y),new n(l,i.y),new n(t.x,t.y)),c.distance<=u)return new a(a.REGULAR);return null},e.PaneRendererCross=TradingView.PaneRendererCross=o},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(84).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c,h,u;for(t.lineWidth=2,e=this.width,i=this.height,o=this._vertOffset,r=!1,s=0,a=this.items.length;s<a;s++)l=this.items[s],c=l.style&&null!=l.style.color?l.style.color:this._color,c!==n&&(n=c,r&&t.stroke(),t.beginPath(),t.strokeStyle=c),h=l.x-e/2,u=l.y-i/2+o,t.moveTo(h+e/2,u),t.lineTo(h+e/2,u+i),t.moveTo(h,u+i/2),t.lineTo(h+e,u+i/2),r=!0;r&&t.stroke()},e.PaneRendererCrossShape=TradingView.PaneRendererCrossShape=o},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(84).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=!1,h=Math.round(this.height/2);for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,c&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x,l=n.y+this._vertOffset,t.moveTo(a,l-h),t.lineTo(a+h,l),t.lineTo(a,l+h),t.lineTo(a-h,l),t.lineTo(a,l-h),c=!0;c&&(t.fill(),t.stroke())},e.PaneRendererDiamond=TradingView.PaneRendererDiamond=o},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(84).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=this.width,h=this.height,u=h/2,d=this._vertOffset,p=3,_=(c-p)/3,f=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,f&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x-c/2,l=n.y-u+d,t.moveTo(a,l),t.lineTo(a+p,l),t.bezierCurveTo(a+_,l-_,a+2*_,l+_,a+c,l),t.lineTo(a+c,l+u),t.bezierCurveTo(a+c-_,l+u+_,a+c-2*_,l+u-_,a+p,l+u),t.lineTo(a+p,l+h),t.lineTo(a,l+h),t.lineTo(a,l),f=!0;f&&(t.fill(),t.stroke())},e.PaneRendererFlagShape=TradingView.PaneRendererFlagShape=o},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.histogramBase=t.histogramBase,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth}var n=i(1).Point,r=i(33).distanceToSegment,s=i(69).selectionTolerance,a=i(4);o.prototype.draw=function(t){var e,i,o,n,r;for(t.translate(.5,.5),t.fillStyle=this.lineColor,e=this.lineWidth,i=0;i<this.items.length;++i)o=this.items[i],n=o.x,r=o.y,o.style&&(t.fillStyle=o.style.color,e=o.style.width),t.fillRect(Math.round(n-.5*e),r,e,this.histogramBase-r)},o.prototype.hitTest=function(t){var e,i,o,l,c,h=s(this.lineWidth);for(c=0;c<this.items.length;++c)if(e=this.items[c],i=e.x,o=e.y,l=r(new n(i,o),new n(i,this.histogramBase),new n(t.x,t.y)),l.distance<=h)return new a(a.REGULAR);return null},
e.PaneRendererHistogram=TradingView.PaneRendererHistogram=o},function(t,e,i){"use strict";function o(t,e){l.call(this,t),this._isUp=e,this._stepX=Math.round(this.height/2*.65)+.5,this._stepY=Math.round(this.height/2)+.5,this._textCache?(this._padding=this._stepX/2,this._shapeWidth=this._textImageWidth+2*this._stepX,this._shapeHeight=this._textImageHeight+2*this._padding+this._stepY,0===this._vertOffset?this._isUp?this._textVertOffset=this._stepY+this._padding+this._textImageHeight:this._textVertOffset=-this._stepY-this._padding:this._textVertOffset=this._vertOffset>0?this._stepY+this._padding:-this._stepY-this._padding):(this._padding=0,this._shapeWidth=2*this._stepX,this._shapeHeight=2.5*this._stepY)}function n(t){o.call(this,t,!0)}function r(t){o.call(this,t,!1)}var s=i(1).Point,a=i(4),l=i(84).PaneRendererAbstractShape;inherit(o,l),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=!1,h=this._isUp?1:-1,u=Math.round(this._shapeWidth/2)-.5,d=Math.round(this._shapeHeight)-.5,p=0;for(0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(p=-h*Math.round(d+this._stepY)),i=0,o=this.items.length;i<o;i++)n=this.items[i],r=n.x+.5,s=n.y+this._vertOffset+p+.5,n.style&&null!=n.style.color?(a=n.style.color,l=n.style.borderColor):(a=this._color,l=this._borderColor),a!==e&&(e=a,c&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=a,t.strokeStyle=l),t.translate(r,s),t.moveTo(0,0),t.lineTo(this._stepX,this._stepY*h),t.lineTo(u,this._stepY*h),t.lineTo(u,d*h),t.lineTo(-u,d*h),t.lineTo(-u,this._stepY*h),t.lineTo(-this._stepX,this._stepY*h),t.lineTo(0,0),t.translate(-r,-s),c=!0;c&&(t.fill(),t.stroke())},o.prototype.hitTest=function(t,e){var i,o,n,r,l,c,h,u,d,p,_,f,m,g,v=this._stepY/2,y=this._vertOffset,b=this._isUp?1:-1;for(o=0;o<this.items.length;++o)if(n=this.items[o]){if(r=b*v,0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(r=-b*(this._shapeHeight+v)),i=new s(n.x,n.y+y+r),i.subtract(t).length()<=v)return new a(a.REGULAR);if(l=this._shapeWidth/2,r=0,0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(r=-b*(this._shapeHeight+this._stepY)),c=n.y+y+r,h=this._isUp?this._stepY:-this._shapeHeight,u=this._isUp?this._shapeHeight:-this._stepY,d=t.x,p=t.y,_=n.x-l,f=c+h,m=n.x+l,g=c+u,d>_&&d<m&&p>f&&p<g)return new a(a.REGULAR)}return null},inherit(n,o),inherit(r,o),e.PaneRendererLabelBase=TradingView.PaneRendererLabelBase=o,e.PaneRendererLabelUp=TradingView.PaneRendererLabelUp=n,e.PaneRendererLabelDown=TradingView.PaneRendererLabelDown=r},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(84).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=!1,h=Math.round(this.height/2);for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,c&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x-h,l=n.y+this._vertOffset-h,t.rect(a,l,this.height,this.height),c=!0;c&&(t.fill(),t.stroke())},e.PaneRendererSquare=TradingView.PaneRendererSquare=o
},function(t,e,i){"use strict";function o(t,e){this._items=t.items,this._color=t.color,this._orderArrow=t.orderArrow,this._exitLineWidth=t.exitLineWidth,this._priceArrow=t.priceArrow,this._text=t.text,this._textWidths=e}var n=i(4);o.prototype._drawOrderArrow=function(t,e,i,o){var n,r=e.x,s=e.y;o?(t.rotate(Math.PI),r=-r-this._orderArrow.width/2,s=-s-this._orderArrow.height):(r-=this._orderArrow.width/2,s-=this._orderArrow.height),i&&(s-=i),n=o?"floor":"ceil",r=Math[n](r)+(o?-.5:.5),s=Math[n](s)+.5,t.translate(r,s),t.moveTo(.25*this._orderArrow.width,0),t.lineTo(.75*this._orderArrow.width,0),t.lineTo(.75*this._orderArrow.width,.45*this._orderArrow.height),t.lineTo(this._orderArrow.width,.45*this._orderArrow.height),t.lineTo(.5*this._orderArrow.width,this._orderArrow.height),i&&(t.lineTo(this._orderArrow.width,this._orderArrow.height),t.lineTo(this._orderArrow.width,this._orderArrow.height+i),t.lineTo(0,this._orderArrow.height+i),t.lineTo(0,this._orderArrow.height),t.lineTo(.5*this._orderArrow.width,this._orderArrow.height)),t.lineTo(0,.45*this._orderArrow.height),t.lineTo(.25*this._orderArrow.width,.45*this._orderArrow.height)},o.prototype._drawPriceArrow=function(t,e,i){var o=e.x,n=e.y;i?(t.rotate(Math.PI),o=-o-this._priceArrow.width,n=-n-this._priceArrow.height/2):(o-=this._priceArrow.width,n-=this._priceArrow.height/2),o=Math.round(o)+(i?-1.5:.5),n=Math.floor(n)+.5,t.translate(o,n),t.moveTo(0,0),t.lineTo(this._priceArrow.width,.5*this._priceArrow.height),t.lineTo(0,this._priceArrow.height)},o.prototype.draw=function(t){t.beginPath();for(var e,i,o=0;o<this._items.length;o++)e=this._items[o],i="lower"===e.pos,t.save(),t.translate(0,i?this._orderArrow.vMargin:-this._orderArrow.vMargin),this._drawOrderArrow(t,e.orderPoint,this._exitLineWidth,i),t.restore(),t.save(),this._drawPriceArrow(t,e.pricePoint,!i),t.restore();if(t.closePath(),t.fillStyle=this._color,t.fill(),this._text)for(t.font=this._text.fontSize+"px "+this._text.font,t.textAlign="center",t.textBaseline="top",o=0;o<this._items.length;o++)e=this._items[o],i="lower"===e.pos,t.save(),t.translate(0,i?this._orderArrow.vMargin:-this._orderArrow.height-this._orderArrow.vMargin),e.label&&(t.translate(0,i?this._text.fontSize+this._text.vMargin+this._exitLineWidth:-this._text.fontSize-this._text.vMargin-this._exitLineWidth),t.fillText(e.label,Math.ceil(e.orderPoint.x),e.orderPoint.y),"number"!=typeof this._textWidths[e.label]&&(this._textWidths[e.label]=t.measureText(e.label).width)),e.qty&&(t.translate(0,i?this._text.fontSize+this._text.vMargin+this._exitLineWidth:-this._text.fontSize-this._text.vMargin-this._exitLineWidth),t.fillText(e.qty,Math.ceil(e.orderPoint.x),e.orderPoint.y),"number"!=typeof this._textWidths[e.qty]&&(this._textWidths[e.qty]=t.measureText(e.qty).width)),t.restore()},o.prototype._testOrderArrows=function(t){for(var e,i,o,n,r,s,a,l=0,c=this._orderArrow.width/2;l<this._items.length;l++)if(e=this._items[l].orderPoint,!(t.x<e.x-c||t.x>e.x+c||(i=this._items[l],o="lower"===i.pos,n=this._orderArrow.height+this._exitLineWidth,o||(n=-n),
r=e.y+(o?this._orderArrow.vMargin:-this._orderArrow.vMargin),s=Math.min(r,r+n),a=Math.max(r,r+n),t.y<s||t.y>a)))return!0;return!1},o.prototype._testText=function(t){for(var e,i,o,n,r,s,a,l,c,h,u,d=0;d<this._items.length;d++)if(e=this._items[d],i=e.orderPoint,o="lower"===e.pos,n=this._orderArrow.vMargin+this._orderArrow.height+this._exitLineWidth,o||(n=-n),r=i.y+n,s=this._text.vMargin+this._text.fontSize*(!!e.label+!!e.qty),o||(s=-s),a=Math.min(r,r+s),l=Math.max(r,r+s),!(t.y<a||t.y>l||(c=e.label&&e.qty?o&&t.y<r+this._text.fontSize||!o&&t.y>r-this._text.fontSize?e.label:e.qty:e.label||e.qty,h=this._textWidths[c],u=h&&h/2,!h||t.x<i.x-u||t.x>i.x+u)))return!0;return!1},o.prototype.hitTest=function(t){var e=this._testOrderArrows(t),i=!e&&this._text&&this._testText(t);return e||i?new n(n.REGULAR):null},e.PaneRendererStudyStrategyOrders=TradingView.PaneRendererStudyStrategyOrders=o},function(t,e,i){"use strict";function o(t){s.call(this,t)}function n(t){s.call(this,t)}function r(t){s.call(this,t)}var s=i(84).PaneRendererAbstractShape;inherit(o,s),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=this.width,h=this.height,u=Math.round(h/3),d=this._vertOffset-2*u,p=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,p&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x,l=n.y+d,t.moveTo(a,l),t.lineTo(a+c/2,l+h),t.lineTo(a-c/2,l+h),t.lineTo(a,l),p=!0;p&&(t.fill(),t.stroke())},inherit(n,s),n.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=this.width,h=this.height,u=Math.round(h/3),d=this._vertOffset-u,p=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,p&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x-c/2,l=n.y+d,t.moveTo(a,l),t.lineTo(a+c,l),t.lineTo(a+c/2,l+h),t.lineTo(a,l),p=!0;p&&(t.fill(),t.stroke())},inherit(r,s),r.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l=this.width,c=this.height,h=this._vertOffset,u=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],r=n.style&&null!=n.style.color?n.style.color:this._color,r!==e&&(e=r,u&&t.fill(),t.beginPath(),t.fillStyle=r),s=n.x+l/2,a=n.y-c/2+h,t.moveTo(s,a),t.lineTo(s,a+c),t.lineTo(s-l,a+c/2),t.lineTo(s,a),u=!0;u&&t.fill()},e.PaneRendererTriangleApexUp=TradingView.PaneRendererTriangleApexUp=o,e.PaneRendererTriangleApexDown=TradingView.PaneRendererTriangleApexDown=n,e.PaneRendererTriangleApexLeft=TradingView.PaneRendererTriangleApexLeft=r},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(84).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c,h,u;for(t.lineWidth=2,e=this.width,i=this.height,o=this._vertOffset,r=!1,s=0,a=this.items.length;s<a;s++)l=this.items[s],c=l.style&&null!=l.style.color?l.style.color:this._color,c!==n&&(n=c,r&&t.stroke(),t.beginPath(),t.strokeStyle=c),h=l.x-e/2,u=l.y-i/2+o,t.moveTo(h,u),
t.lineTo(h+e,u+i),t.moveTo(h,u+i),t.lineTo(h+e,u),r=!0;r&&t.stroke()},e.PaneRendererXCross=TradingView.PaneRendererXCross=o},function(t,e,i){"use strict";function o(t,e){h.call(this),this._series=t,this._model=e,this._items.push(new u($.t("O",{context:"in_legend"}),"")),this._items.push(new u($.t("H",{context:"in_legend"}),"")),this._items.push(new u($.t("L",{context:"in_legend"}),"")),this._items.push(new u($.t("C",{context:"in_legend"}),"")),this._invalidated=!0,this.update()}var n=i(53),r=n.parseRgb,s=n.distanceRgb,a=n.invertRgb,l=n.rgbToHexString,c=i(209),h=c.DataWindowView,u=c.DataWindowItem,d=i(178).translatedIntervalString,p=i(42).PlotRowSearchMode;inherit(o,h),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,c,h,u,_,f,m,g,v;if(this._series.symbolInfo()?(this._header=[this._series.symbolInfo().name,d(this._series.interval()),this._series.symbolInfo().exchange].join(", "),this._title=this._series.symbolInfo().description):this._header=this._series.symbol(),this._items[0].setValue($.t("n/a")),this._items[1].setValue($.t("n/a")),this._items[2].setValue($.t("n/a")),this._items[3].setValue($.t("n/a")),!this._model.timeScale().isEmpty()&&0!==this._series.bars().size()&&(t=this._series.data().size()-1,e=this._model.crossHairSource().appliedIndex(),void 0!==(i=isNumber(e)?this._series.nearestIndex(e,p.NearestLeft):this._series.nearestIndex(t,p.NearestLeft))))for(o=this._series.data().valueAt(i),n=this._series.formatter(),this._items[0].setValue(n.format(o[TradingView.OPEN_PLOT])),this._items[1].setValue(n.format(o[TradingView.HIGH_PLOT])),this._items[2].setValue(n.format(o[TradingView.LOW_PLOT])),this._items[3].setValue(n.format(o[TradingView.CLOSE_PLOT])),c=this._series.barColorer(),h=c.barStyle(i,!1),u=null!=h.barBorderColor?h.barBorderColor:h.barColor,_=this._series.model().paneForSource(this._series),f=_._properties.background.value(),m=r(u),g=r(f),s(m,g)<70&&(u=l(a(m))),v=0;v<4;v++)this._items[v].setColor(u)},o.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},o.prototype.dump=function(){return{header:this._header,items:this._items}},t.exports=o},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._series=t,this._series.onRestarted().subscribe(this,o.prototype.invalidate),this._series.onSymbolResolved().subscribe(this,o.prototype.invalidate),this._series.onCompleted().subscribe(this,o.prototype.invalidate),this._series.onBoxSizeChanged().subscribe(this,o.prototype.invalidate)}var n=i(426),r=i(1153).getTranslatedSymbolDescription,s=i(831).generateTitleForGui;inherit(o,n),o.prototype.invalidate=function(){delete this._text,this.update()},o.prototype.getSeriesPrecision=function(){var t=4;return this._series._symbolInfo&&this._series._symbolInfo.pricescale&&(t=Math.round(Math.log(this._series._symbolInfo.pricescale)/Math.log(10))),t},o.prototype.round=function(t){var e=this.getSeriesPrecision(),i=Math.round(t*Math.pow(10,e))/Math.pow(10,e);return i||""},o.prototype.update=function(){
if(!("_text"in this)){var t=this._series.symbolInfo()||{};this._bold=!1,this._size=this._props.mainSeriesProperties.statusViewStyle.fontSize.value()+"px",this._text=s({description:this._props.mainSeriesProperties.statusViewStyle.showSymbolAsDescription.value()?t.name:r({pro_name:t.pro_name,description:t.description,local_description:t.local_description,language:t.language}),exchange:this._props.mainSeriesProperties.statusViewStyle.showExchange.value()?t.exchange:null,symbol:this._series.symbol(),interval:this._props.mainSeriesProperties.statusViewStyle.showInterval.value()?this._series.interval():null,style:this._series._properties.style.value(),inputs:this._series.getInputsProperties().state(),boxSize:this._series.data().boxSize,reversalAmount:this._series.data().reversalAmount,precision:this.getSeriesPrecision()})}},t.exports=o},function(t,e,i){"use strict";function o(){this._data=null,this._colors=null}function n(t,e,i){this._series=t,this._lastBar=e,this._direction=i,this._renderer=new o}var r=i(21).ensureNotNull;i(391),i(13).getLogger("Chart.Snapshot");o.prototype.setData=function(t){this._data=t},o.prototype.setPredictCode=function(t){this._colors=this.getBackgroundColor(t)},o.prototype.hitTest=function(){return null},o.prototype.getBackgroundColor=function(t){return[{background:"rgba(255, 158, 171, 0.3)",line:"#7E202F"},{background:"rgba(244, 255, 158, 0.3)",line:"#EBFF3F"},{background:"rgba(195, 255, 160, 0.3)",line:"#308020"}][t+1]},o.prototype.draw=function(t){if(null!==this._data&&null!==this._colors){t.fillStyle=this._colors.background,t.fillRect(Math.max(0,this._data.x),0,this._data.width,this._data.height),t.strokeStyle=this._colors.line,t.beginPath(),t.lineWidth=1;var e=Math.round(this._data.x);t.moveTo(e,0),t.lineTo(e,this._data.height),t.stroke()}},n.prototype.update=function(){this._x=this._series.m_model.timeScale().indexToCoordinate(this._lastBar)+.5*this._series.m_model.timeScale().barSpacing()+1},n.prototype.renderer=function(){var t={x:this._x,height:this._series.priceScale().height(),width:this._series.m_model.timeScale().width()},e=this._series.data().bars(),i=r(e.last()).value[TradingView.CLOSE_PLOT]>r(e.valueAt(this._lastBar))[TradingView.CLOSE_PLOT]?1:-1,o=0;return 1===this._direction?o=i:2===this._direction&&(o=-1*i),this._renderer.setData(t),this._renderer.setPredictCode(o),this._renderer},e.FutureBarsPaneView=n},function(t,e,i){"use strict";function o(t,e,i,o){n.call(this,t,e,i,o)}var n=i(61).Study,r=i(9).propertyPages;inherit(o,n),o.prototype.getStylesPropertyPage=function(){return r.VolumePropertyPage},e.study_Volume=o},function(t,e,i){"use strict";function o(t,e,i,o){this._symbolLabelView=new r(t,this,"compare","symbol","showSymbolLabels"),TradingView.Study.call(this,t,e,i,o);var n=this;this._properties.minTick.listeners().subscribe(null,function(){n._createFormatter()}),this.properties().minTick.listeners().subscribe(null,function(){n._model.invalidate(new s(s.FULL_UPDATE))}),this._properties.merge({skipHistogramBaseOnAutoScale:!0})}
var n=i(214).DataVendorStudyDataWindowView,r=i(217),s=i(37),a=i(41).PriceFormatter,l=i(9).propertyPages;inherit(o,TradingView.Study),o.prototype.createPlotLabels=function(t){},o.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},o.prototype.createViews=function(){this._dataWindowView||(this._dataWindowView=new n(this,this._model)),TradingView.Study.prototype.createViews.call(this),this._paneViews.push(this._symbolLabelView)},o.prototype._createFormatter=function(){var t,e,i,o,n,r=this.properties().inputs.symbol.value(),s=this._resolvedSymbols?this._resolvedSymbols[r]:null;"default"===this.properties().minTick.value()?this._formatter=new a(s?s.pricescale:100,s?s.minmov:1,!!s&&s.fractional):(t=this.properties().minTick.value(),e=isNumber(t)?["100","1","false"]:t.split(","),i=parseInt(e[0]),o=parseInt(e[1]),n="true"===e[2],this._formatter=new a(i,o,n)),this.priceScale()&&this.priceScale().updateFormatter()},o.prototype.symbol=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[e]:null;return t=i?i.name:e,t.toUpperCase()},o.prototype.title=function(t){var e,i=this.properties().inputs.symbol.value(),o=this._resolvedSymbols?this._resolvedSymbols[i]:null;return o?(e=o.name,o.exchange&&0!==o.exchange.length&&(e+=", "+o.exchange)):e=i,e.toUpperCase()},o.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var t=this._properties.inputs.symbol.value();return t?this._resolvedSymbols[t]:null},o.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},o.prototype.tags=function(){var t=this.symbol();return t?[t]:[]},o.prototype.getInputsPropertyPage=function(){return l.StudyCompareInputsPropertyPage},t.exports=o},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e,i){if(i===CanvasEx.HHISTDIR_LEFTTORIGHT)return t+e;if(i===CanvasEx.HHISTDIR_RIGHTTOLEFT)return e+t;throw Error("Unknown direction value: "+i)}var r=i(1),s=r.Point,a=r.equalPoints,l=i(49),c=l.pointInRectangle,h=l.pointInTriangle,u=i(98).intersectRayAndRectangle,d=i(27).TextRenderer,p=i(122).HorizontalLineRenderer,_=i(16).TrendLineRenderer,f=i(1140).HorizHistogramRenderer,m=i(1132).HLinesPriceAxisView,g=i(164),v=TradingView.Study,y=i(947),b=i(4),S=i(8).CompositeRenderer,w=i(171).clearRect,T=i(19),x=i(53).shiftColor,C=i(13).getLogger("Chart.StudyGraphicsPaneViews");v.graphicsZOrderPriority=function(t){switch(t){case"polygons":return-100;case"trendchannels":return-90;default:return 0}},v.StudyPaneView_horizlines=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_horizlines.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_horizlines.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new _,i.setData(this._data[e]),i.setHitTest(new b(b.REGULAR)),t.append(i);return t},v.StudyPaneView_horizlines.prototype._updateViewInternal=function(){
var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w;if(this._data=[],(t=this._study.graphics().horizlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.horizlines[c.styleId],h.visible.value()))for(u=0;u<c.data.length;u++)d=c.data[u],p=o[d.startIndex],_=o[d.endIndex],!d.extendRight&&Math.max(p,_)<r||!d.extendLeft&&Math.min(p,_)>a||(f={},m=i.indexToCoordinate(p),g=i.indexToCoordinate(_),v=d.level,e.isPercent()&&(y=this._study.firstValue(),v=e.priceRange().convertToPercent(v,y)),b=e.priceToCoordinate(v),S=new s(m,b),w=new s(g,b),f.points=[S,w],f.extendleft=d.extendLeft,f.extendright=d.extendRight,f.width=i.width(),f.height=e.height(),f.color=h.color.value(),f.linewidth=h.width.value(),f.linestyle=h.style.value(),this._data.push(f))},v.StudyPaneView_vertlines=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_vertlines.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_vertlines.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new _,i.setData(this._data[e]),i.setHitTest(new b(b.REGULAR)),t.append(i);return t},v.StudyPaneView_vertlines.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S;if(this._data=[],(t=this._study.graphics().vertlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.vertlines[c.styleId],h.visible.value()))for(u=0;u<c.data.length;u++)d=c.data[u],p={},o[d.index]<r||o[d.index]>a||(_=i.indexToCoordinate(o[d.index])+1,f=null,d.extendBottom?m=e.height():(v=d.startPrice,e.isPercent()&&(f=f||this._study.firstValue(),v=e.priceRange().convertToPercent(v,f)),m=e.priceToCoordinate(v)),d.extendTop?g=0:(y=d.endPrice,e.isPercent()&&(f=f||this._study.firstValue(),y=e.priceRange().convertToPercent(y,f)),g=e.priceToCoordinate(y)),b=new s(_,m),S=new s(_,g),p.points=[b,S],p.extendleft=d.extendBottom,p.extendright=d.extendTop,p.width=i.width(),p.height=e.height(),p.color=h.color.value(),p.linewidth=h.width.value(),p.linestyle=h.style.value(),this._data.push(p))},v.StudyPaneView_lines=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_lines.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_lines.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new _,i.setData(this._data[e]),i.setHitTest(new b(b.REGULAR)),t.append(i);return t},v.StudyPaneView_lines.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P;if(this._data=[],
(t=this._study.graphics().lines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=this._study.priceScale().height(),c=i.width(),h=0;h<t.length;h++)if(u=t[h],u.data&&(d=this._study.properties().graphics.lines[u.styleId],d.visible.value()))for(p=0;p<u.data.length;p++)_=u.data[p],f=o[_.startIndex]+(_.startOffset||0),m=o[_.endIndex]+(_.endOffset||0),!_.extendRight&&Math.max(f,m)<r||!_.extendLeft&&Math.min(f,m)>a||(g={},v=i.indexToCoordinate(f),y=i.indexToCoordinate(m),b=_.startPrice,S=_.endPrice,e.isPercent()&&(w=this._study.firstValue(),b=e.priceRange().convertToPercent(b,w),S=e.priceRange().convertToPercent(S,w)),T=e.priceToCoordinate(b),x=e.priceToCoordinate(S),C=new s(v,T),P=new s(y,x),g.points=[C,P],g.width=c,g.height=l,g.color=d.color.value(),g.linewidth=d.width.value(),g.linestyle=d.style.value(),this._data.push(g))},v.StudyPaneView_hlines=function(t,e){this._study=t,this._model=e,this._data=[],this._textData=[]},v.StudyPaneView_hlines.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_hlines.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new p,i.setData(this._data[e]),t.append(i);for(e=0;e<this._textData.length;e++)t.append(new d(this._textData[e],new b(b.REGULAR)));return t},v.StudyPaneView_hlines.prototype._updateViewInternal=function(){this._calcHorzLinesData(),this._calcTextData()},v.StudyPaneView_hlines.prototype._calcTextData=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f;if(this._textData=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=0;o<t.length;o++)if(n=t[o],n.data&&(r=this._study.properties().graphics.hlines[n.styleId],r.enableText.value()&&r.showText.value()))for(a=0;a<n.data.length;a++)l=n.data[a],c={},c.text=void 0===l.text?"":l.text,c.color=r.color.value(),c.font="arial",c.fontsize=r.fontSize.value(),h=l.level,e.isPercent()&&(u=this._study.firstValue(),h=e.priceRange().convertToPercent(h,u)),d=e.priceToCoordinate(h),p=r.textPos.value(),p===CanvasEx.TEXTPOS_TOPLEFT||p===CanvasEx.TEXTPOS_MIDDLELEFT||p===CanvasEx.TEXTPOS_BOTTOMLEFT?(_=4,c.horzAlign="left"):p===CanvasEx.TEXTPOS_TOPCENTER||p===CanvasEx.TEXTPOS_MIDDLECENTER||p===CanvasEx.TEXTPOS_BOTTOMCENTER?(_=i.width()/2,c.horzAlign="center"):p!==CanvasEx.TEXTPOS_TOPRIGHT&&p!==CanvasEx.TEXTPOS_MIDDLERIGHT&&p!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(_=i.width(),c.horzAlign="right"),p===CanvasEx.TEXTPOS_TOPLEFT||p===CanvasEx.TEXTPOS_TOPCENTER||p===CanvasEx.TEXTPOS_TOPRIGHT?(c.vertAlign="bottom",d-=4):p===CanvasEx.TEXTPOS_MIDDLELEFT||p===CanvasEx.TEXTPOS_MIDDLECENTER||p===CanvasEx.TEXTPOS_MIDDLERIGHT?(c.vertAlign="middle",d-=2):p!==CanvasEx.TEXTPOS_BOTTOMLEFT&&p!==CanvasEx.TEXTPOS_BOTTOMCENTER&&p!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(c.vertAlign="top"),f=new s(_,d),c.points=[f],c.offsetX=0,c.offsetY=0,
this._textData.push(c)},v.StudyPaneView_hlines.prototype._calcHorzLinesData=function(){var t,e,i,o,n,r,a,l,c,h,u,d;if(this._data=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale())&&!e.isEmpty())for(i=0;i<t.length;i++)if(o=t[i],o.data&&(n=this._study.properties().graphics.hlines[o.styleId],n.visible.value()))for(r=0;r<o.data.length;r++)a=o.data[r],l={},c=0,h=a.level,e.isPercent()&&(u=this._study.firstValue(),h=e.priceRange().convertToPercent(h,u)),d=e.priceToCoordinate(h),l.points=[new s(c,d)],l.color=n.color.value(),l.linewidth=n.width.value(),l.linestyle=n.style.value(),l.hitTestResult=b.REGULAR,this._data.push(l)},v.StudyPriceAxisView_hlines=m,TradingView.TriangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.TriangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.TriangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,r,s,a;if(this._data){switch(e="up"===this._data.direction?1:-1,i=this._data.point.x,"left"===this._data.halign?i-=this._data.size:"right"===this._data.halign&&(i+=this._data.size),o=this._data.point.y,t.font=this.fontStyle(),n=t.measureText(this._data.text).width,this._textCache.textWidth=n,r=this._data.fontSize,s=.65*r,a=1*r,t.save(),t.translate(i+.5,o+.5),t.beginPath(),t.moveTo(0,0),this._data.direction){case"up":case"down":t.lineTo(s,a*e),t.lineTo(.5*n+s,a*e),t.lineTo(.5*n+s,(a+1.75*r)*e),t.lineTo(.5*-n-s,(a+1.75*r)*e),t.lineTo(.5*-n-s,a*e),t.lineTo(-s,a*e),t.lineTo(0,0),t.strokeStyle=this._data.borderColor,t.stroke(),t.fillStyle=this._data.color,t.fill(),t.fillStyle=this._data.fontColor,t.fillText(this._data.text,.5*-n,e<0?e*a-.5*r:a+1.25*r);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}t.restore()}},TradingView.TriangleTextMarkRenderer.prototype.hitTest=function(t){var e,i,o,n,r,a,l,h,u,d,p,_=this._textCache.textWidth,f=this._data.fontSize;switch(this._data.direction){case"up":case"down":if(e="up"===this._data.direction?1:-1,i=.65*f,o=1*f,n=this._data.point.x,"left"===this._data.halign?n-=this._data.size:"right"===this._data.halign&&(n+=this._data.size),r=this._data.point.y,a=n-.5*_-i,l=n+.5*_+i,h=r+o*e,u=r+(o+1.75*f)*e,u<h&&(r=h,h=u,u=r),c(t,new s(a,h),new s(l,u)))return new b(b.REGULAR);if(d=[],d[0]={},d[0].x=this._data.point.x,d[0].y=this._data.point.y,d[1]={},d[1].x=this._data.point.x+.65*f,d[1].y=this._data.point.y+f*e,d[2]={},d[2].x=this._data.point.x-.65*f,d[2].y=this._data.point.y+f*e,p=(t.x-d[0].x)*(d[1].y-d[0].y)-(t.y-d[0].y)*(d[1].x-d[0].x),((t.x-d[1].x)*(d[2].y-d[1].y)-(t.y-d[1].y)*(d[2].x-d[1].x))*p>0&&((t.x-d[2].x)*(d[0].y-d[2].y)-(t.y-d[2].y)*(d[0].x-d[2].x))*p>0)return new b(b.REGULAR);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}return null},TradingView.RectangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},
TradingView.RectangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.RectangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,r;if(this._data){switch(e=this._data.point.x,i=this._data.point.y,t.font=this.fontStyle(),o=t.measureText(this._data.text).width,this._textCache.textWidth=o,t.save(),t.translate(e+.5,i+.5),t.beginPath(),t.moveTo(0,0),n=this._data.halign,r=this._data.valign,t.textAlign=n,r){case"middle":t.textBaseline="middle";break;case"top":t.textBaseline="bottom";break;case"bottom":t.textBaseline="hanging"}t.fillStyle=this._data.fontColor,t.fillText(this._data.text,0,0),t.restore()}},TradingView.RectangleTextMarkRenderer.prototype.hitTest=function(t){var e,i,o=this._data.point.x+.5,n=this._data.point.y+.5,r=this._textCache.textWidth,a=this._data.fontSize,l=this._data.halign;switch(this._data.valign){case"middle":n-=a/2;break;case"bottom":n-=a}switch(l){case"right":o-=r;break;case"center":o-=r/2}return e=new s(o,n),i=new s(o+r,n+a),c(t,e,i)?new b(b.REGULAR):null},TradingView.CircleShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.CircleShapeMarkRenderer.prototype.draw=function(t){var e,i,o;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=this._data.point.x,o=this._data.point.y,t.save(),t.fillStyle=this._data.color,t.beginPath(),t.arc(i+1,o+2*this._data.size*e+.5,this._data.size,0,2*Math.PI),t.closePath(),t.fill(),t.stroke(),t.restore())},TradingView.CircleShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0;return Math.pow(this._data.point.x+.5-t.x,2)+Math.pow(this._data.point.y+.5+2*this._data.size*e-t.y,2)<=Math.pow(this._data.size,2)?new b(b.REGULAR):null},TradingView.SquareShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.SquareShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,r;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new s(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new s(this._data.point.x+i/2,this._data.point.y+i/2+e*i),r=n.subtract(o),t.beginPath(),t.fillStyle=this._data.color,t.rect(o.x,o.y,r.x,r.y),t.stroke(),t.fill())},TradingView.SquareShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new s(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new s(this._data.point.x+i/2,this._data.point.y+i/2+e*i),r=new s(Math.min(o.x,n.x),Math.min(o.y,n.y)),a=new s(Math.max(o.x,n.x),Math.max(o.y,n.y));return c(t,r,a)?new b(b.REGULAR):null},TradingView.ArrowShapeMarkRenderer=function(t,e,i){this._data=t,this._textCache=e,this._arrowDirection=i},TradingView.ArrowShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u;if(this._data){switch(e=this._arrowDirection,i=1*this._data.size,o=this._data.color,n=this._data.point.x+1,
r=this._data.point.y,s=1.1*i,e){case"up":r-=s;break;case"down":r+=s}switch(a=i/6,l=i/4,c=i/3,h=i/2,u=.6666666*i,t.save(),t.fillStyle=o,t.beginPath(),e){case"up":t.moveTo(n,r),t.lineTo(n-h,r+u),t.lineTo(n-l,r+u),t.lineTo(n,r+c),t.lineTo(n+l,r+u),t.lineTo(n+h,r+u),t.lineTo(n,r);break;case"down":t.moveTo(n,r+i),t.lineTo(n-h,r+c),t.lineTo(n-l,r+c),t.lineTo(n,r+u),t.lineTo(n+l,r+c),t.lineTo(n+h,r+c),t.lineTo(n,r+i);break;case"right":t.moveTo(n+a,r),t.lineTo(n-a,r-l),t.lineTo(n-a,r+l),t.lineTo(n+a,r);break;case"left":t.moveTo(n-a,r),t.lineTo(n+a,r-l),t.lineTo(n+a,r+l),t.lineTo(n-a,r)}t.closePath(),t.fill(),t.stroke(),t.restore()}},TradingView.ArrowShapeMarkRenderer.prototype.hitTest=function(t){var e,i,o,n,r,a,l,c=this._data.point.x,u=this._data.point.y,d=this._arrowDirection,p=1*this._data.size,_=p/2,f=1.1*p;switch(d){case"up":u-=f;break;case"down":u+=f}switch(e=p/6,i=p/4,o=p/3,_=p/2,n=.6666666*p,d){case"up":r=new s(c,u),a=new s(c+_,u+n),l=new s(c-_,u+n);break;case"down":r=new s(c,u+p),a=new s(c+_,u+o),l=new s(c-_,u+o);break;case"right":r=new s(c+e,u),a=new s(c-e,u-i),l=new s(c-e,u+i);break;case"left":r=new s(c-e,u),a=new s(c+e,u-i),l=new s(c+e,u+i)}return h(t,r,a,l)?new b(b.REGULAR):null},v.StudyPaneView_textmarks=function(t,e){this._study=t,this._model=e,this._data=[],this._textCache=[]},inherit(v.StudyPaneView_textmarks,y),v.StudyPaneView_textmarks.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_textmarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"triangle":t.append(new TradingView.TriangleTextMarkRenderer(this._data[e],this._textCache[e]));break;case"rectangle":t.append(new TradingView.RectangleTextMarkRenderer(this._data[e],this._textCache[e]))}return t},v.StudyPaneView_textmarks.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S;if(this._data=[],(t=this._study.graphics().textmarks)&&(e=this._study.priceScale(),i=this._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.textmarks[c.styleId],h.visible.value()))for(u=c.data,d=0;d<u.length;d++)if(p=u[d],_={},f=h.location.value(),m=h.shape.value(),!((g=o[p.time])<r||g>a)&&null!==this._study.series().bars().valueAt(g)){switch(g=o[p.time]+(p.offset||0),_.font=h.fontFamily.value(),_.color=T.generateColor(h.color.value(),h.transparency.value()),_.bold=h.fontBold.value(),_.fontColor=T.generateColor(h.fontColor.value(),h.transparency.value()),_.italic=h.fontItalic.value(),_.fontSize=h.fontSize.value(),_.text=p.text?p.text:"",_.halign=h.halign.value(),_.valign=void 0!==h.valign?h.valign.value():"middle",_.shape=h.shape.value(),_.size=.5*i.barSpacing(),_.borderColor="rgb(0, 0, 0)",v=50,m){case"triangle":S=this._calcCoordsForTriangleShape(f,g,v,p.price,e),_.direction=S.direction,y=Math.round(i.indexToCoordinate(g)),
b=S.y;break;case"rectangle":S=this._calcCoordsForRectangleShape(f,g,p.price,e,i),y=S.x,b=S.y}_.point=new s(y,b),this._data.push(_),this._textCache.push({})}},v.StudyPaneView_textmarks.prototype._calcCoordsForTriangleShape=function(t,e,i,o,n){var r,s,a;switch(t){case CanvasEx.MARKLOC_TOP:r=n.height()-i,s="down";break;case CanvasEx.MARKLOC_BOTTOM:r=i,s="up";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:n.isPercent()&&(a=this._study.firstValue(),o=n.priceRange().convertToPercent(o,a)),r=n.priceToCoordinate(o),s="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:n.isPercent()&&(a=this._study.firstValue(),o=n.priceRange().convertToPercent(o,a)),r=n.priceToCoordinate(o),s="up";break;case CanvasEx.MARKLOC_ABOVEBAR:r=this._locationToY(t,e),s="down";break;case CanvasEx.MARKLOC_BELOWBAR:default:r=this._locationToY(t,e),s="up"}return{y:r,direction:s}},v.StudyPaneView_textmarks.prototype._calcCoordsForRectangleShape=function(t,e,i,o,n){var r,s,a=Math.round(n.indexToCoordinate(e));switch(t){case CanvasEx.MARKLOC_ABSOLUTEDOWN:case CanvasEx.MARKLOC_ABSOLUTEUP:case CanvasEx.MARKLOC_ABSOLUTE:o.isPercent()&&(s=this._study.firstValue(),i=o.priceRange().convertToPercent(i,s)),r=o.priceToCoordinate(i);break;case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BELOWBAR:r=this._locationToY(t,e);break;case CanvasEx.MARKLOC_RIGHT:case CanvasEx.MARKLOC_LEFT:a=n.width(),o.isPercent()&&(s=this._study.firstValue(),i=o.priceRange().convertToPercent(i,s)),r=o.priceToCoordinate(i);break;default:r=this._locationToY(t,e)}return{x:a,y:r}},v.StudyPaneView_shapemarks=function(t,e){this._study=t,this._model=e,this._data=[],this._textCache=[]},inherit(v.StudyPaneView_shapemarks,y),v.StudyPaneView_shapemarks.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_shapemarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"circle":t.append(new TradingView.CircleShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"square":t.append(new TradingView.SquareShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"arrowUp":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"up"));break;case"arrowDown":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"down"));break;case"arrowRight":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"right"));break;case"arrowLeft":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"left"))}return t},v.StudyPaneView_shapemarks.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S;if(this._data=[],(t=this._study.graphics().shapemarks)&&(e=this._study.priceScale(),i=this._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.shapemarks[c.styleId],
h.visible.value()))for(u=c.data,d=0;d<u.length;d++)if(p=u[d],!((_=o[p.time])<r||_>a)&&(f={},null!=p.time&&null!==this._study.series().bars().valueAt(_))){switch(f.color=T.generateColor(h.color.value(),h.transparency.value()),m=0,"left"===h.halign.value()?m-=i.barSpacing()/2+1:"right"===h.halign.value()&&(m+=i.barSpacing()/2+1),f.size=h.size.value(),f.shape=h.shape.value(),g=Math.round(i.indexToCoordinate(_))+m,v=p.price,e.isPercent()&&(y=this._study.firstValue(),v=e.priceRange().convertToPercent(v,y)),b=e.priceToCoordinate(v),S=h.location.value()){case CanvasEx.MARKLOC_ABSOLUTE:f.direction="";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:f.direction="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:f.direction="up";break;case CanvasEx.MARKLOC_ABOVEBAR:b=this._locationToY(S,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="up";break;case CanvasEx.MARKLOC_BELOWBAR:b=this._locationToY(S,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="down";break;default:C.logWarn("Bad location value: "+S),b=this._locationToY(CanvasEx.MARKLOC_ABSOLUTEUP,_),f.direction="up"}f.point=new s(g,b),this._data.push(f),this._textCache.push({})}},o.prototype.draw=function(t){},o.prototype.drawBackground=function(t){var e=this._data;w(t,e.x1,e.y1,e.x2-e.x1,e.y2-e.y1,T.generateColor(this._data.color,this._data.transparency))},o.prototype.hitTest=function(t){return null},v.StudyPaneView_backgrounds=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_backgrounds.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_backgrounds.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)t.append(new o(this._data[e]));return t},v.StudyPaneView_backgrounds.prototype._hideExtendedHours=function(t){return("inSession"===t||"outOfSession"===t)&&!this._study._series.properties().extendedHours.value()},v.StudyPaneView_backgrounds.prototype._updateViewInternal=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b;if(this._data=[],(t=this._study.graphics().backgrounds)&&(e=this._model.timeScale(),(i=this._study.priceScale())&&!i.isEmpty()&&e&&!e.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),s=n.lastBar(),a=0;a<t.length;a++)if(l=t[a],c=l.styleId,h=l.data,u=this._study.properties().graphics.backgrounds[c],!this._hideExtendedHours(c)&&u.visible.value())for(_=0;_<h.length;_++)f=h[_],m={},g=o[f.start],(v=o[f.stop])<r||g>s||null!=f.start&&null!=f.stop&&(y=Math.ceil(e.indexToCoordinate(g,!0)-.5*e.barSpacing()),b=Math.ceil(e.indexToCoordinate(v,!0)+.5*e.barSpacing()),p===g-1&&(y=d),d=b,p=v,y<0&&b<0||y>e.width()&&b>e.width()||(m.x1=y,m.x2=b,m.y1=0,m.y2=i.height(),m.color=u.color.value(),m.transparency=u.transparency.value(),this._data.push(m)))},v.StudyPaneView_polygons=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_polygons.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_polygons.prototype.renderer=function(){var t,e,i
;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new g(new b(b.REGULAR)),i.setData(this._data[e]),t.append(i);return t},v.StudyPaneView_polygons.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T;if(this._data=[],(t=this._study.graphics().polygons)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.polygons[c.styleId],100!==h.transparency.value()))for(u=0;u<c.data.length;u++){for(d=c.data[u],p=1/0,_=-1/0,f=0;d.points&&f<d.points.length;f++)m=o[d.points[f].index]+(d.points[f].offset||0),p=Math.min(p,m),_=Math.max(_,m);if(!(_<r||p>a)){for(g={},g.points=[],f=0;d.points&&f<d.points.length;f++)v=d.points[f],y=i.indexToCoordinate(o[v.index]+(v.offset||0)),b=v.level,e.isPercent()&&(S=this._study.firstValue(),b=e.priceRange().convertToPercent(b,S)),w=e.priceToCoordinate(b),T=new s(y,w),T.data=f,g.points.push(T);g.color=h.color.value(),g.backcolor=h.color.value(),g.linewidth=void 0!==h.showBorder&&h.showBorder.value()?1:0,g.linestyle=CanvasEx.LINESTYLE_SOLID,g.filled=!0,g.fillBackground=!0,g.transparency=h.transparency.value(),g.mouseTouchable=h.mouseTouchable.value(),this._data.push(g)}}},v.StudyPaneView_trendchannels=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_trendchannels.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_trendchannels.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new g(new b(b.REGULAR)),i.setData(this._data[e]),t.append(i);return t},v.StudyPaneView_trendchannels.prototype._convertToYCoord=function(t){var e=this._study.priceScale(),i=this._study.firstValue();return e.isPercent()&&(t=e.priceRange().convertToPercent(t,i)),e.priceToCoordinate(t)},v.StudyPaneView_trendchannels.prototype._updateViewInternal=function(){var t,e,i,o,n,r,l,c,h,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E;if(this._data=[],(t=this._study.graphics().trendchannels)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=function(t,e,i,o,n,r){var l,c,h,d;return a(t,e)?[t,e]:(l=new s(0,0),c=new s(i,o),n&&(h=t.subtract(e),d=u(t,t.add(h),l,c),d?t=d:e.x=i),r&&(h=e.subtract(t),d=u(e,e.add(h),l,c),d?e=d:e.x=i),[t,e])},n=this._study.graphics().indexes,r=this._model.timeScale().visibleBars(),l=r.firstBar(),c=r.lastBar(),h=0;h<t.length;h++)if(d=t[h],d.data)for(p=this._study.properties().graphics.trendchannels[d.styleId],_=0;_<d.data.length;_++)f=d.data[_],m=n[f.startIndex],g=n[f.endIndex],Math.max(m,g)<l&&!f.extendRight||Math.min(m,g)>c&&!f.extendLeft||(v=this._convertToYCoord(f.startHighPrice),y=this._convertToYCoord(f.startLowPrice),b=this._convertToYCoord(f.endHighPrice),S=v-y,w=b-S,T=i.indexToCoordinate(m),
x=i.indexToCoordinate(g),C=new s(T,v),P=new s(T,y),L=new s(x,b),I=new s(x,w),k=o(C,L,i.width(),e.height(),f.extendLeft,f.extendRight),A=o(P,I,i.width(),e.height(),f.extendLeft,f.extendRight),C=k[0],L=k[1],P=A[0],I=A[1],M={},M.points=[C,P,I,L],M.color=p.color.value(),M.backcolor=p.color.value(),M.linewidth=void 0!==p.borderWidth?p.borderWidth.value():0,M.linestyle=CanvasEx.LINESTYLE_SOLID,M.filled=!0,M.fillBackground=!0,f.transparency?(E=f.transparency+p.transparency.value(),M.transparency=Math.min(E,100)):M.transparency=p.transparency.value(),M.mouseTouchable=!0,this._data.push(M))},v.StudyPaneView_hhists=function(t,e){this._study=t,this._model=e,this._rendererData={histsByLineWidth:{},histsBySession:{}},this._textData=[],this._textRendererCache={},this._horizHistogramRenderer=new f(this._rendererData)},v.StudyPaneView_hhists.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_hhists.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,t.append(this._horizHistogramRenderer),e=0;e<this._textData.length;e++)t.append(new d(this._textData[e],new b(b.REGULAR)));return t},v.StudyPaneView_hhists.prototype._resetRenderersData=function(){this._rendererData.histsByLineWidth={},this._rendererData.histsBySession={},this._textData=[],this._maxHistWidth=null},v.StudyPaneView_hhists.prototype._updateColors=function(){var t=this._study.properties().graphics.hhists.histBars,e=this._study.properties().graphics.hhists.vaBars,i=T.generateColor(t.colors[0].value(),t.transparencies[0].value()),o=T.generateColor(t.colors[1].value(),t.transparencies[1].value()),n=e?T.generateColor(e.colors[0].value(),e.transparencies[0].value()):"rgba(255, 0, 0, 1)";this._colors={histBars:[i,o],vaBars:[T.blendColors(i,n),T.blendColors(o,n)]}},v.StudyPaneView_hhists.prototype._updateViewInternal=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;if(this._resetRenderersData(),t=this._study.priceScale(),e=this._model.timeScale(),t&&!t.isEmpty()&&e&&!e.isEmpty()&&(i=this._study.graphics().hhists)&&(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),s=n.lastBar(),a=i[0],l=this._study.properties().graphics.hhists[a.styleId],l.visible.value())){this._updateColors(),c=a.shortDataObj,h=a.dataObj,u=c||h;for(d in u){for(p=u[d],_=1/0,f=-1/0,m=p.length;m--;)g=p[m],_=Math.min(_,o[g.firstBarTime]),f=Math.max(f,o[g.lastBarTime]);f<r||_>s||(v=this._findMaxRate(p),this._updateDataForRenderers(p,l,t,e,o,v,d))}}},v.StudyPaneView_hhists.prototype._updateDataForRenderers=function(t,e,i,o,r,a,l){var c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,P,L,I,k,A,M,E=null,V=null,D={},O={},B={},R={},z=i.height(),F=i.isPercent(),N=e.percentWidth.value(),W=e.showValues.value(),$=e.location.value(),H=e.direction.value(),U=$===CanvasEx.HHISTLOC_ABSOLUTE,j=$===CanvasEx.HHISTLOC_RELATIVE,q=H===CanvasEx.HHISTDIR_LEFTTORIGHT,G=H===CanvasEx.HHISTDIR_RIGHTTOLEFT,Y=this._rendererData.histsByLineWidth,K=this._rendererData.histsBySession,Z={};for(K[l]=Z,_=0;_<t.length;_++){if(f=t[_],
null==E&&(E=this._findActualRateLength(f.rate)),null==this._maxHistWidth&&(m=Math.abs(o.indexToCoordinate(r[f.firstBarTime])-o.indexToCoordinate(r[f.lastBarTime])),this._maxHistWidth=Math.max(N*m/100-E,0)),U&&q)d=o.indexToCoordinate(r[f.firstBarTime]),u=1,p="left";else if(U&&G)d=o.indexToCoordinate(r[f.lastBarTime]),u=-1,p="right";else if(j&&q)d=0,u=1,p="left";else{if(!j||!G)throw Error("Unknown location/direction values: "+$+"/"+H);d=o.width(),u=-1,p="right"}for(F?(g=this._study.firstValue(),c=i.priceRange().convertToPercent(f.priceHigh,g),h=i.priceRange().convertToPercent(f.priceLow,g)):(c=f.priceHigh,h=f.priceLow),y=0;y<E;y++)if(b={},b.y1=i.priceToCoordinate(c)+1,!(b.y1<0||(b.y2=i.priceToCoordinate(h)-1,b.y2>z))){if(V||(V=.6*(b.y2-b.y1)),W&&(void 0===D[y]?D[y]=f.rate[y]:D[y]+=f.rate[y]),W&&y===E-1&&V>=7.5){for(S={},w=this._study.formatter(),S.text="",T=0;T<E;T++)S.text=n(S.text,w.format(f.rate[T]),H),T!==E-1&&(S.text=n(S.text,"x",H));if(S.color=e.valuesColor.value(),S.font="arial",S.fontsize=V,S.horzAlign=p,S.vertAlign="middle",C=new s(d+3*u,b.y2-.61*(b.y2-b.y1)),S.points=[C],S.offsetX=0,S.offsetY=0,this._textData.push(S),0===_&&(v=b.y2),_===t.length-1){for(P=d+3*u,L=v+.39*(b.y2-b.y1),I={text:"",color:x(e.valuesColor.value(),1.5),font:"arial",fontsize:V,horzAlign:p,vertAlign:"middle",points:[new s(P,L)],offsetX:0,offsetY:0},T=0;T<E;T++)I.text=n(I.text,w.format(D[T]),H),T!==E-1&&(I.text=n(I.text,"x",H));this._textData.push(I)}}b.x1=0===y?d:d+u*(this._maxHistWidth*f.rate[y-1]/a),b.x2=b.x1+u*(this._maxHistWidth*f.rate[y]/a),Math.abs(b.y1-O[y])<1?(B[y]?B[y].push(b.x1):B[y]=[b.x1],R[y]?R[y].push(b.x2):R[y]=[b.x2]):((B[y]||R[y])&&(B[y].push(b.x1),R[y].push(b.x2),b.x1=Math.max.apply(null,B[y]),b.x2=Math.max.apply(null,R[y]),delete B[y],delete R[y]),O[y]=b.y1,Math.abs(b.x2-b.x1)<.5||(b.x0=d,k=f.va?this._colors.vaBars[y]:this._colors.histBars[y],A=Math.round(b.y2-b.y1),Y[A]||(Y[A]={}),M=Y[A],M[k]?M[k].push(b):M[k]=[b],Z[_]?Z[_].x2<b.x2&&(Z[_].x2=b.x2):Z[_]={x1:d,x2:b.x2,y1:b.y1,y2:b.y2}))}}},v.StudyPaneView_hhists.prototype._findMaxRate=function(t){var e,i,o=0,n=0;for(e=0;e<t.length;e++){for(n=0,i=0;i<t[e].rate.length;i++)n+=t[e].rate[i];o=Math.max(o,n)}return o},v.StudyPaneView_hhists.prototype._findActualRateLength=function(t){var e,i,o=0;for(e=0;e<t.length&&(null!==(i=t[e])&&void 0!==i);++e)o++;return o},t.exports=v},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this._symbolIntervalChanged=!1,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.onSymbolIntervalChanged)}var n=i(135).LineStudyMtp;inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_decisionpoint"},o.prototype.onSymbolIntervalChanged=function(){this._symbolIntervalChanged=!0},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t,e,i=this.points();return i.length<this.pointsCount()?null:(t=i[0].index,e=this._model.mainSeries().bars().valueAt(t),null===e?null:[this.properties().inputs.displayZoneLabels.value(),this._symbolIntervalChanged,1e3*e[TradingView.TIME_PLOT]])},
o.prototype.onData=function(t){n.prototype.onData.call(this,t),this._symbolIntervalChanged=!1},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(135).LineStudyMtp;inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_riskreward"},o.prototype.pointsCount=function(){return 3},o.getTooltipText=function(t){return t&&0!==t._points.length?1===t._points.length?"Select Stop Bar":2===t._points.length?"Select Target Point":null:"Select Entry Setup Bar"},o.prototype._studyInputs=function(){var t,e,i,o,n,r,s=this.points();return s.length<this.pointsCount()?null:(t=s[0].index,e=s[1].index,i=s[2].index,o=this._model.mainSeries().bars().valueAt(t),n=this._model.mainSeries().bars().valueAt(e),r=this._model.mainSeries().bars().valueAt(i),null===o||null===n||null===r?null:[1e3*o[TradingView.TIME_PLOT],1e3*n[TradingView.TIME_PLOT],1e3*r[TradingView.TIME_PLOT],s[2].price,this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value()])},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._source=t,this._model=e,this._points=[new s(0,0)],this._lineRenderer=new x}function n(t,e){S.call(this),this._additional=void 0,this._study=t,this._model=e,this._items.push(new w("Open","")),this._items.push(new w("High","")),this._items.push(new w("Low","")),this._items.push(new w("Close","")),this._invalidated=!0,this.update()}function r(t,e,i,o){this._symbolLabelView=new C(t,this,"close","symbol","showSymbolLabels"),this._baseLineView=null,l.call(this,t,e,i,o),this._formatter=null,this._paneView=null;var n=this;this.properties().minTick.listeners().subscribe(null,function(){n._createFormatter(),n.updateAllViews(),n._model.invalidate(new P(P.FULL_UPDATE))})}var s=i(1).Point,a=i(85),l=i(61).Study,c=i(42).PlotRowSearchMode,h=i(1138).OverlayPriceAxisView,u=i(425),d=u.SeriesAreaPaneView,p=u.SeriesLinePaneView,_=u.SeriesHollowCandlesPaneView,f=u.SeriesCandlesPaneView,m=u.SeriesBarsPaneView,g=u.SeriesBaselinePaneView,v=u.SeriesBaselineLinePaneView,y=i(215),b=i(209),S=b.DataWindowView,w=b.DataWindowItem,T=i(272).SeriesBarColorer,x=i(122).HorizontalLineRenderer,C=i(217),P=i(37),L=i(41).PriceFormatter,I=i(9).propertyPages;o.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var t=this._source.lastValueData(TradingView.CLOSE_PLOT,!0);t.noData||(this._visible=!0,this._points=[new s(0,t.coordinate)],this._color=t.color)}},o.prototype.renderer=function(){var t={};return t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),t.points=this._points,t.color=this._color,t.linewidth=1,t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.visible=this._visible,this._lineRenderer.setData(t),this._lineRenderer},inherit(n,S),n.prototype._updateImpl=function(){var t,e,i,o,n,r,s,l,h,u,d,p,_,f;if(this._header=this._study.title(),!this._model.timeScale().isEmpty()&&0!==this._study.data().length&&(i=!1,o=this._study.properties().style.value(),
o===a.STYLE_BARS?(t=this._study.properties().barStyle.upColor.value(),e=this._study.properties().barStyle.downColor.value(),i=this._study.properties().barStyle.barColorsOnPrevClose.value()):o===a.STYLE_CANDLES?(t=this._study.properties().candleStyle.upColor.value(),e=this._study.properties().candleStyle.downColor.value(),i=this._study.properties().candleStyle.barColorsOnPrevClose.value()):o===a.STYLE_HOLLOW_CANDLES?(t=this._study.properties().hollowCandleStyle.upColor.value(),e=this._study.properties().hollowCandleStyle.downColor.value(),i=!0):o===a.STYLE_LINE?t=e=this._study.properties().lineStyle.color.value():o===a.STYLE_AREA&&(t=e=this._study.properties().areaStyle.linecolor.value()),n=this._study.series(),r=this._model.crossHairSource().appliedIndex(),void 0!==(s=n.nearestIndex(r,c.NearestLeft)))){if(!(null!==(l=this._study.data().valueAt(s))&&l[TradingView.OPEN_PLOT]&&l[TradingView.HIGH_PLOT]&&l[TradingView.LOW_PLOT]&&l[TradingView.CLOSE_PLOT]))return;for(h=this._study.formatter(),this._items[0].setValue(h.format(l[TradingView.OPEN_PLOT])),this._items[1].setValue(h.format(l[TradingView.HIGH_PLOT])),this._items[2].setValue(h.format(l[TradingView.LOW_PLOT])),this._items[3].setValue(h.format(l[TradingView.CLOSE_PLOT])),o===a.STYLE_BASELINE?(d=this._study.barColorer(),p=d.barStyle(s,!1),u=null!=p.barBorderColor?p.barBorderColor:p.barColor):i&&s>=1?(_=this._study.data().valueAt(s-1),u=_[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]?t:e):u=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?t:e,f=0;f<4;f++)this._items[f].setColor(u)}},n.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},n.prototype.update=function(){this._invalidated=!0},n.prototype.additional=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._additional},inherit(r,l),r.prototype.createPlotLabels=function(t){},r.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},r.prototype.symbol=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[e]:null;return t=i?i.name:e,t.toUpperCase()},r.prototype.lastValueData=function(t,e){var i,o,n,r,s,c=l.prototype.lastValueData.call(this,"close",e);if(c.noData)return c;switch(i=this.properties(),o=c.item,i.style.value()){case a.STYLE_BARS:c.color=o[TradingView.OPEN_PLOT]<=o[TradingView.CLOSE_PLOT]?i.barStyle.upColor.value():i.barStyle.downColor.value();break;case a.STYLE_CANDLES:case a.STYLE_HOLLOW_CANDLES:c.color=o[TradingView.OPEN_PLOT]<=o[TradingView.CLOSE_PLOT]?i.candleStyle.upColor.value():i.candleStyle.downColor.value();break;case a.STYLE_LINE:c.color=i.lineStyle.color.value();break;case a.STYLE_AREA:c.color=i.areaStyle.color1.value();break;case a.STYLE_BASELINE:n=i.baselineStyle,r=this.priceScale(),s=Math.round(r.height()*(Math.abs(100-n.baseLevelPercentage.value())/100)),c.color=c.coordinate<s?i.baselineStyle.topLineColor.value():i.baselineStyle.bottomLineColor.value()}return c},
r.prototype.createViews=function(){this._priceAxisViews=[],this._priceAxisViewsBase=[new h(this)],this._paneViews=[];var t=null;switch(this._properties.style.value()){case a.STYLE_BARS:t=new m(this,this._model);break;case a.STYLE_CANDLES:t=new f(this,this._model);break;case a.STYLE_HOLLOW_CANDLES:t=new _(this,this._model);break;case a.STYLE_LINE:t=new p(this,this._properties.lineStyle.priceSource.value(),this._model);break;case a.STYLE_AREA:t=new d(this,this._properties.areaStyle.priceSource.value(),this._model);break;case a.STYLE_BASELINE:t=new g(this,this._properties.baselineStyle.priceSource.value(),this._model),this._baseLineView=new v(this,this._model)}t&&this._paneViews.push(t),null!==this._baseLineView&&this._paneViews.push(this._baseLineView),this._paneViews.push(new o(this,this._model)),this._paneViews.push(this._symbolLabelView),this._dataWindowView||(this._dataWindowView=new n(this,this._model)),this._statusView||(this._statusView=new y(this)),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},r.prototype.barColorer=function(){return new T(this)},r.prototype.start=function(t){this._formatter=null,l.prototype.start.apply(this,arguments),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype._createFormatter=function(){var t,e,i,o,n,r,s;"default"===this.properties().minTick.value()?(t=this.properties().inputs.symbol.value(),e=this._resolvedSymbols[t],this._formatter=new L(e?e.pricescale:100,e?e.minmov:1,!!e&&e.fractional)):(i=this.properties().minTick.value(),o=isNumber(i)?["100","1","false"]:i.split(","),n=parseInt(o[0]),r=parseInt(o[1]),s="true"===o[2],this._formatter=new L(n,r,s)),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype.formatter=function(){return this._formatter||this._createFormatter(),this._formatter},r.prototype._changeInputs=function(){l.prototype._changeInputs.call(this,this.inputs()),this.m_formatter=null,this.priceScale().updateFormatter()},r.prototype.title=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols[e];return i?(t=i.name,i.exchange&&0!==i.exchange.length&&(t+=", "+i.exchange)):t=e,t.toUpperCase()},r.prototype.bars=function(){return this.m_data},r.prototype.open=function(t){return this.bars().valueAt(t)[TradingView.OPEN_PLOT]},r.prototype.high=function(t){return this.bars().valueAt(t)[TradingView.HIGH_PLOT]},r.prototype.low=function(t){return this.bars().valueAt(t)[TradingView.LOW_PLOT]},r.prototype.close=function(t){return this.bars().valueAt(t)[TradingView.CLOSE_PLOT]},r.prototype.hl2=function(t){return(this.high(t)+this.low(t))/2},r.prototype.hlc3=function(t){return(this.high(t)+this.low(t)+this.close(t))/3},r.prototype.ohlc4=function(t){return(this.open(t)+this.high(t)+this.low(t)+this.close(t))/4},r.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var t=this._properties.inputs.symbol.value();return t?this._resolvedSymbols[t]:null},r.prototype.lastPriceLabelFixedCoordinate=function(){
return this._priceAxisViews[0]._fixedCoordinate},r.prototype.tags=function(){var t=[],e=this.symbolInfo();return e?t.push(e.name):this._properties.inputs.symbol.value()&&t.push(this._properties.inputs.symbol.value()),t},r.prototype.getStylesPropertyPage=function(){return I.StudyOverlayStylesPropertyPage},e.OverlayDataWindowView=n,e.study_Overlay=r},function(t,e,i){"use strict";function o(t,e,i,o){s.call(this,t,e,i,o)}var n=i(21).assert,r=i(34).clone,s=i(61).Study,a=i(42).PlotList;inherit(o,s),o.prototype.clearData=function(){s.prototype.clearData.call(this),this._underlyingData=new a(this._plotFields)},o.prototype._mergeData=function(t){var e,i;return this._invalidateLastNonEmptyPlotRowCache(),e=this._underlyingData.firstIndex(),this._underlyingData.merge(t),e!==this._underlyingData.firstIndex()&&(this.m_data=new a(this._underlyingData.plotNames())),i=this.m_data.lastIndex(),this._underlyingData.range(i,this._underlyingData.lastIndex()).each(function(t,e){return this.m_data.add(t,r(e)),!1}.bind(this)),this._plotsForStrategyProcessing().forEach(function(t){this._createStrategy(t.strategy,t.strategyIndex,t.targetIndex,i).rebuildData(this.m_data)},this),this.m_data},o.prototype._plotsForStrategyProcessing=function(){var t=["dataoffset"],e=[];return this._metaInfo.plots.forEach(function(i,o){var r,s;t.indexOf(i.type)>-1&&(r=null,this._metaInfo.plots.forEach(function(t,e){t.id===i.target&&(r=e)}),n(r>=0,"target plot not found for strategy plot "+i.id),s={strategy:i.type,strategyIndex:o,targetIndex:r},e.push(s))},this),e},o.prototype._createStrategy=function(t,e,i,n){return new o["Strategy_"+t](e,i,n)},o.Strategy_dataoffset=function(t,e,i){this._strategyPlotIndex=t,this._targetPlotIndex=e,this._startIndex=i},o.Strategy_dataoffset.prototype.rebuildData=function(t){var e=this._targetPlotIndex+1,i=this._strategyPlotIndex+1,o=null,n=null;t.range(this._startIndex||t.firstIndex(),t.lastIndex()).each(function(r,s){var a,l,c,h=s[e],u=s[i]?Math.round(s[i]):null;return s[e]=null,s[i]=null,!(!u||u>0)&&(a=r+u,l={pointIndex:a,value:h},n?n.pointIndex!==l.pointIndex&&(a>=0&&(t.valueAt(a)[e]=h),c=!1,o&&(c=o.value<=n.value&&n.value<=h||o.value>=n.value&&n.value>=h),c?n.pointIndex>=0&&(t.valueAt(n.pointIndex)[e]=null):o=n,n=l):n=l,!1)})},t.exports=o},function(t,e,i){"use strict";function o(t,e,i,o){n.call(this,t,e,i,o)}var n=i(61).Study;inherit(o,n),o.prototype.hasContextMenu=function(){return!1},o.prototype.showInObjectTree=function(){return!1},o.prototype.isSavedInStudyTemplates=function(){return!1},o.prototype.isRemovedByStudyTemplates=function(){return!1},o.prototype.removeByRemoveAllStudies=function(){return!1},o.prototype.isUserDeletable=function(){return!1},o.prototype.statusView=function(){return!1},o.prototype.isDraggable=function(){return!1},t.exports=o},function(t,e,i){"use strict";for(var o={StudyStrategy:i(978),StatusView:i(215),StudyLineDataSource:i(136).StudyLineDataSource,StudyLineDataSourcePaneView:i(136).StudyLineDataSourcePaneView,StudyVersioning:i(119),StudyMigration:i(427),study_Overlay:i(974).study_Overlay,
study_Compare:i(970),study_Sessions:i(976),study_Volume:i(969).study_Volume,study_ScriptWithDataOffset:i(975),StudyPaneView:i(118).StudyPaneView,StudyBackgroundPaneView:i(118).StudyBackgroundPaneView,StudyPlotShapesPaneView:i(118).StudyPlotShapesPaneView,StudyPlotCharsPaneView:i(118).StudyPlotCharsPaneView,StudyPlotArrowsPaneView:i(118).StudyPlotArrowsPaneView,StudyPlotCandlesPaneView:i(118).StudyPlotCandlesPaneView,StudyStrategyOrdersPaneView:i(428),StudyPriceAxisView:i(496).StudyPriceAxisView,StudyDataWindowView:i(214).StudyDataWindowView,DataVendorStudyDataWindowView:i(214).DataVendorStudyDataWindowView,LineStudyMtpAnalysis:i(898),LineStudyMtpDecisionPoint:i(972),LineStudyMtpRiskReward:i(973),LineStudyMtpElliotWaveMain:i(283).LineStudyMtpElliotWaveMain,LineStudyMtpElliotWaveMajor:i(283).LineStudyMtpElliotWaveMajor,LineStudyMtpElliotWaveMinor:i(283).LineStudyMtpElliotWaveMinor,LineStudyMtpDownWave1OrA:i(68).LineStudyMtpDownWave1OrA,LineStudyMtpDownWave2OrB:i(68).LineStudyMtpDownWave2OrB,LineStudyMtpDownWave3:i(68).LineStudyMtpDownWave3,LineStudyMtpDownWave4:i(68).LineStudyMtpDownWave4,LineStudyMtpDownWave5:i(68).LineStudyMtpDownWave5,LineStudyMtpDownWaveC:i(68).LineStudyMtpDownWaveC,LineStudyMtpUpWave1OrA:i(68).LineStudyMtpUpWave1OrA,LineStudyMtpUpWave2OrB:i(68).LineStudyMtpUpWave2OrB,LineStudyMtpUpWave3:i(68).LineStudyMtpUpWave3,LineStudyMtpUpWave4:i(68).LineStudyMtpUpWave4,LineStudyMtpUpWave5:i(68).LineStudyMtpUpWave5,LineStudyMtpUpWaveC:i(68).LineStudyMtpUpWaveC},n=Object.keys(o),r=n.length;r--;)TradingView[n[r]]=o[n[r]];t.exports=o},function(t,e,i){(function(e){"use strict";function o(t,i,o,r){n.call(this,t,i,o,r),this._barsIndexes=[],this._reportDataBuffer=null,this._reportData=null,this.watchedData=new e,this.model().addStrategySource(this)}var n=i(61).Study,r=i(428),s=i(9).propertyPages;inherit(o,n),o.prototype.stop=function(){if(n.prototype.stop.call(this),this._avoidRemoveStrategySource)return void delete this._avoidRemoveStrategySource;this.model().removeStrategySource(this)},o.prototype.start=function(){this.model().addStrategySource(this),n.prototype.start.call(this)},o.prototype.processHibernate=function(){this._studyId&&!this.isVisible()&&(this._avoidRemoveStrategySource=!0),n.prototype.processHibernate.call(this)},o.prototype.onData=function(t){var e=this;n.prototype.onData.call(this,t).then(function(){var i,o,n,r;t.method&&"data_update"===t.method&&(i=t.params&&t.params.nonseries&&t.params.nonseries.d,o=i&&i.data&&i.data.report,o?(i.isUpdate&&e._reportDataBuffer&&(o=$.extend(e._reportDataBuffer,o)),e._reportDataBuffer=e._reportData=$.extend(e._reportDataBuffer||{},o)):(n=$.extend({},t),n.params.nonseries.d.data={report:e._reportDataBuffer},t=n),"nochange"!==(r=t.params&&t.params.nonseries&&t.params.nonseries.indexes)&&r instanceof Array&&r.length&&e._collateBarsIndexes(r)),e.watchedData.setValue(t)})},o.prototype._collateBarsIndexes=function(t){var e,i;if(Array.isArray(t)&&(e=this._reportData&&this._reportData.filledOrders)&&e.length)for(this._barsIndexes.length=0,
i=0;i<e.length;i++)this._barsIndexes[i]=t[e[i].tm]},o.prototype.reportData=function(){return this._reportData},o.prototype.ordersData=function(){return this._reportData&&this._reportData.filledOrders},o.prototype.barsIndexes=function(){return this._barsIndexes},o.prototype.clearData=function(){n.prototype.clearData.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.clearItems()},o.prototype.restoreData=function(t){n.prototype.restoreData.apply(this,arguments),this.model().addStrategySource(this),t.reportData&&t.barsIndexes&&(this._reportData=t.reportData,this._barsIndexes=t.barsIndexes,this.watchedData.setValue({method:"data_update",params:{nonseries:{d:{data:{report:this._reportData}}}}})),t.activeState&&(this._activeState=!0)},o.prototype.activeState=function(){return this._activeState},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.update()},o.prototype.createViews=function(){n.prototype.createViews.call(this),this._strategyOrdersPaneView=new r(this,this._series,this._model)},o.prototype.state=function(t){var e=n.prototype.state.apply(this,arguments);return t&&this._reportData&&this._barsIndexes&&(e.data||(e.data={}),e.data.reportData=this._reportData,e.data.barsIndexes=this._barsIndexes,e.data.activeState=this.model().activeStrategySource().value()===this),e},o.prototype.getStrategyPropertyPage=function(){return s.StudyStrategyPropertyPage},t.exports=o}).call(e,i(51))},function(t,e,i){(function(e){"use strict";function i(){this._marksByIndex={},this._marksBySpan=[],this.changed=new e}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(t){var e,i,o,n,r,s=this._marksBySpan,a={};for(e=0;e<t.length;e++){if(i=t[e],o=i.index,n=i.span,r=this._marksByIndex[i.index]){if(r.index===i.index&&r.span===i.span){r.time=i.time;continue}this._removeTickmark(r)}this._marksByIndex[o]=i,this.minIndex<=o||(this.minIndex=o),this.maxIndex>=o||(this.maxIndex=o),s[n]||(s[n]=[]),s[n].push(i),a[n]=!0}for(n=s.length;n--;)s[n]&&(s[n].length||delete s[n],a[n]&&s[n].sort(this._sortByIndexAsc));delete this._cache,this.changed.fire()},i.prototype._removeTickmark=function(t){var e,i,o=t.index;this._marksByIndex[o]===t&&(delete this._marksByIndex[o],o<=this.minIndex&&this.minIndex++,o>=this.maxIndex&&this.maxIndex--,this.maxIndex<this.minIndex&&(delete this.minIndex,delete this.maxIndex),e=this._marksBySpan[t.span],-1!==(i=e.indexOf(t))&&e.splice(i,1))},i.prototype._sortByIndexAsc=function(t,e){return t.index-e.index},i.prototype.removeTail=function(t){var e,i={};this.maxIndex=0;for(e in this._marksByIndex)this._marksByIndex[e].time<t&&(i[e]=this._marksByIndex[e],this.maxIndex=Math.max(this.maxIndex,e));this._marksByIndex=i},i.prototype.addTail=function(t){for(var e=0;e<t.length;e++)t[e].index=this.maxIndex+e+1;this.merge(t)},i.prototype.indexToTime=function(t){
var e=this._marksByIndex[t];return e?new Date(1e3*e.time):null},i.prototype.density=function(){var t,e=this.maxIndex-this.minIndex;if(0!==e)return t=this._marksByIndex[this.maxIndex].time-this._marksByIndex[this.minIndex].time,1e3*t/e},i.prototype.estimateLeft=function(t){var e,i=this.density();if(i)return e=1e3*this._marksByIndex[this.minIndex].time-t,e/i},i.prototype.nearestIndex=function(t){for(var e,i=this.minIndex,o=this.maxIndex;o-i>2;){if(1e3*this._marksByIndex[i].time===t)return i;if(1e3*this._marksByIndex[o].time===t)return o;e=Math.round((i+o)/2),1e3*this._marksByIndex[e].time>t?o=e:i=e}return i},i.prototype.build=function(t,e){var i,o,n,r,s,a,l,c,h,u,d,p,_,f,m=Math.ceil(e/t);if(this._maxbar===m&&this._cache)return this._cache;for(this._maxbar=m,i=[],o=this._marksBySpan.length;o--;)if(this._marksBySpan[o]){for(n=i,i=[],r=n.length,s=0,a=this._marksBySpan[o],l=a.length,c=1/0,h=-1/0,u=0;u<l;u++){for(d=a[u],p=d.index;s<r;){if(_=n[s],!((f=_.index)<p)){c=f;break}s++,i.push(_),h=f,c=1/0}c-p>=m&&p-h>=m&&(i.push(d),h=p)}for(;s<r;s++)i.push(n[s])}return this._cache=i,this._cache},i.prototype.state=function(){var t,e=[];for(t=this._marksBySpan.length;t--;)this._marksBySpan[t]&&(e=e.concat(this._marksBySpan[t]));return e=e.map(function(t){return[t.span,t.time,t.index]}),{marks:e,version:2}},i.prototype.restoreState=function(t){if(this._marksByIndex={},this._marksBySpan=[],delete this.maxIndex,delete this.minIndex,t&&t.marks&&t.marks.length)if(2===t.version){var e=t.marks.map(function(t){return{span:t[0],time:t[1],index:t[2]}});this.merge(e)}else this.merge(t.marks)},t.exports=i}).call(e,i(20))},function(t,e,i){(function(e,o){"use strict";function n(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}function r(t){this._model=t,this._properties=t.properties().timeScale,this._scalesProperties=t.properties().scalesProperties,this.m_width=0,this._baseIndex=0,this._defaultRightOffset=this._properties.rightOffset.value(),this.m_rightOffset=this._properties.rightOffset.value(),this.m_points=new p,this.m_barSpacing=this._properties.barSpacing.value(),this._barSpacingChanged=new e,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.m_tickmarks=new c,this._locked=!1,this._formattedBySpan={},this._onScroll=new e}var s=i(56).clamp,a=i(479).BarsRange,l=i(410),c=i(979),h=i(37),u=i(11).saveDefaultProperties,d=i(41).numberToStringWithLeadingZero,p=i(1146).TimePoints,_=i(318),f=i(13).getLogger("Chart.TimeScale"),m=i(7),g=null,v=50,y=m.enabled("high_density_bars")?.025:.5,b=10;r.prototype.tickMarks=function(){return this.m_tickmarks},r.prototype.reset=function(){this._visibleBarsCache=null,this.m_points=new p,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.m_tickmarks.reset()},r.prototype.restoreDefault=function(){this._visibleBarsCache=null,this.setBarSpacing(_.DEFAULT_BAR_SPACING),this.m_rightOffset=this._properties.rightOffset.value(),this.saveDefault("barSpacing"),
this._correctOffset(),this.recalcLockedScale()},r.prototype.baseIndex=function(){return this._baseIndex},r.prototype.rightOffset=function(){return this.m_rightOffset},r.prototype.rightOffsetForTimePoint=function(t){var e=this.timeToCoordinate(t);return null===e?null:this._rightOffsetForCoordinate(e)},r.prototype._rightOffsetForCoordinate=function(t){return(this.m_width+1-t)/this.m_barSpacing},r.prototype.scrollToRealtime=function(t,e){var i,o,n,r,s=this._properties.rightOffset.value();if(t)return i=this,o=this.m_rightOffset,n=this.maxRightOffset(),n>0&&s>n&&(s=n),r=this._model,void $({offset:o}).animate({offset:s},{duration:1e3,easing:"easeInOutQuint",complete:e,step:function(t){i._visibleBarsCache=null,i.m_rightOffset=t,r.recalculateAllPanes(),r.invalidate(new h(h.LIGHT_UPDATE)),r.recalcVisibleRangeStudy(r.dataSources())}});this._visibleBarsCache=null,this.m_rightOffset=s,this._correctOffset(),void 0!==e&&e()},r.prototype.points=function(){return this.m_points},r.prototype.width=function(){return this.m_width},r.prototype.barSpacing=function(){return this.m_barSpacing},r.prototype.setWidth=function(t){var e,i;!isFinite(t)||t<=0||this.m_width!==t&&(this._visibleBarsCache=null,this._locked&&this.m_width&&(e=this.m_barSpacing,i=e*t/this.m_width,this.m_barSpacing=i,this._barSpacingChanged.fire(e,i)),this.m_width=t,this._correctOffset())},r.prototype.visibleBars=function(){var t,e,i,o;return this._visibleBarsCache?this._visibleBarsCache:this.isEmpty()?null:(t=Math.ceil(this.m_width/this.m_barSpacing)-1,e=Math.round(this.m_rightOffset+this._baseIndex),i=e-t,o=new a(i,e),this._visibleBarsCache=o,o)},r.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()},r.prototype.indexToCoordinate=function(t,e){var i,o;return this.isEmpty()?0:TradingView.isInteger(t)?(i=this._baseIndex+this.m_rightOffset-t,o=this.m_width-(i+.5)*this.m_barSpacing,e?o:Math.round(o)):0},r.prototype.barIndexesToCoordinates=function(t){var e,i,o,n;for(e=0;e<t.length;e++)i=t[e].time,o=this._baseIndex+this.m_rightOffset-i,n=this.m_width-(o+.5)*this.m_barSpacing,t[e].time=Math.round(n),t[e].exactTime=n},r.prototype.indexesToCoordinates=function(t){var e,i,o,n=this._baseIndex+this.m_rightOffset,r=this.m_width-n*this.m_barSpacing-.5*this.m_barSpacing;for(e=0;e<t.length;e++)i=t[e].x,o=r+i*this.m_barSpacing,t[e].x=Math.round(o)},r.prototype.coordinateToIndex=function(t){var e=this._rightOffsetForCoordinate(t),i=this._baseIndex+this.m_rightOffset-e,o=Math.round(1e6*i)/1e6;return Math.ceil(o)},r.prototype.timeToCoordinate=function(t){function e(t){return t<=0||t>=l.m_width}var i,o,n,r=this.m_points.closestIndexLeft(t),s=this.m_points.valueAt(r),a=this.indexToCoordinate(r,!0),l=this;return e(a)?null:(i=this.barSpacing(),o=function(){var t=this._baseIndex;return this.m_points.valueAt(t)-this.m_points.valueAt(t-1)}.bind(this)(),n=Math.round(a+(t-s)/o*i)+1,e(n)?null:n)},r.prototype.alignCoordinate=function(t){if(this.isEmpty())return t;var e=this.coordinateToIndex(t);return this.indexToCoordinate(e)},r.prototype.timePointToIndex=function(t){
return this.m_points.indexOf(t,!0)},r.prototype.indexToTimePoint=function(t){return this.m_points.valueAt(t)},r.prototype.indexToUserTime=function(t){return this.m_tickmarks.indexToTime(t)},r.prototype.marks=function(){var t,e,i,o,n,r,s,a,l,c,h,u;if(this.isEmpty())return null;for(t=this.m_barSpacing,e=this._scalesProperties.fontSize.value()||0,i=5*(e+4),o=Math.round(i/t),n=this.visibleBars(),r=Math.max(n.firstBar(),n.firstBar()-o),s=Math.max(n.lastBar(),n.lastBar()-o),a=this.m_tickmarks.build(t,i),l=[],c=0;c<a.length;++c)h=a[c],r<=h.index&&h.index<=s&&null!==(u=this.m_tickmarks.indexToTime(h.index))&&l.push({coord:this.indexToCoordinate(h.index),label:this.formatLabel(u,h.span),span:h.span,major:h.label>=_.DAY_SPAN?1:0});return l},r.prototype.state=function(t){var e={};return e.m_barSpacing=this.barSpacing(),e.m_rightOffset=this.m_rightOffset,t&&(this.m_points.size()>0&&(e.m_lastVisibleBar=this.m_points.valueAt(this._baseIndex)),e.points=this.m_points.state(),e.tickmarks=this.m_tickmarks.state(),e.width=this.m_width),e},r.prototype.restoreState=function(t,e,i){var o,n,r,s;return void 0===t.m_barSpacing?void f.logDebug("restoreState: invalid state"):void 0===t.m_rightOffset?void f.logDebug("restoreState: invalid state"):(o=this.m_barSpacing,n=t.m_barSpacing,this._visibleBarsCache=null,this.m_barSpacing=n,this.m_rightOffset=t.m_rightOffset,this.m_restoredLastTimePoint=t.m_lastVisibleBar,i&&this.m_restoredLastTimePoint&&(r=this.m_points.indexOf(this.m_restoredLastTimePoint),s=this._baseIndex-r,this.m_rightOffset=-s+t.m_rightOffset),e&&(this.m_points.restoreState(t.points),this.m_tickmarks.restoreState(t.tickmarks),t.width&&(this._locked=!0,this.m_width>0&&(this.m_barSpacing*=this.m_width/t.width,n=this.m_barSpacing))),o!==n&&this._barSpacingChanged.fire(o,n),void this._correctOffset())},r.prototype.setBaseIndex=function(t){if("number"!=typeof t)return void f.logDebug("setBaseIndex: invalid argument");this._visibleBarsCache=null,this._baseIndex=t},r.prototype.setRightOffset=function(t){if(void 0===t)return void f.logDebug("setRightOffset: invalid argument");this._visibleBarsCache=null,this.m_rightOffset=t,this._correctOffset(),this._model.invalidate(new h(h.LIGHT_UPDATE))},r.prototype.resetRightOffset=function(){this.setRightOffset(_.DEFAULT_RIGHT_OFFSET)},r.prototype.setBarSpacing=function(t){if(void 0===t)return void f.logDebug("setBarSpacing: invalid argument");var e=this.m_barSpacing;e!==t&&(this._visibleBarsCache=null,this.m_barSpacing=t,this._correctOffset(),this._barSpacingChanged.fire(e,t))},r.prototype.barSpacingChanged=function(){return this._barSpacingChanged},r.prototype._correctOffset=function(){var t,e;this.isEmpty()||(t=this.maxRightOffset(),t>0&&this.m_rightOffset>t&&(this.m_rightOffset=t,this._visibleBarsCache=null),e=this.minRightOffset(),this.m_rightOffset<e&&(this.m_rightOffset=e,this._visibleBarsCache=null))},r.prototype.minRightOffset=function(){return this.m_points.firstIndex()-this._baseIndex-1+b},r.prototype.maxRightOffset=function(){return this.m_width/this.m_barSpacing-b},
r.prototype.startScale=function(t){this.m_scrollStartPoint&&this.endScroll(),null===this.m_scaleStartPoint&&null===this.m_stateSnapshot&&(this.isEmpty()||(this.m_scaleStartPoint=t,this.m_stateSnapshot=this.state()))},r.prototype.scaleTo=function(t){var e,i;this._visibleBarsCache=null,delete this.m_restoredLastTimePoint,null!==this.m_stateSnapshot&&(e=s(this.m_width-t,0,this.m_width),i=s(this.m_width-this.m_scaleStartPoint,0,this.m_width),0!==e&&0!==i&&this.setBarSpacing(this.getValidBarSpacing(this.m_stateSnapshot.m_barSpacing*e/i)))},r.prototype.getValidBarSpacing=function(t){return void 0===t&&(t=this.barSpacing()),t<y?y:t>v?v:t},r.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this.m_stateSnapshot=null,this.saveDefault("barSpacing"))},r.prototype.saveDefault=function(t){u(!0),this._properties[t].setValue(this["m_"+t]),u(!1)},r.prototype.startScroll=function(t){null===this.m_scrollStartPoint&&null===this.m_stateSnapshot&&(this.isEmpty()||(this.m_scrollStartPoint=t,this.m_stateSnapshot=this.state()))},r.prototype.scrollTo=function(t){if(this._visibleBarsCache=null,delete this.m_restoredLastTimePoint,null!==this.m_scrollStartPoint){var e=(this.m_scrollStartPoint-t)/this.barSpacing();this.m_rightOffset=this.m_stateSnapshot.m_rightOffset+e,this._correctOffset(),this._model.mainSeries().priceScale().properties().percentage.value()&&this.recalcLockedScale(),this._onScroll.fire()}},r.prototype.scrollToOffsetAnimated=function(t,e){var i,o,n,r;if(!isFinite(t))throw new RangeError("offset is required and must be finite number");if(void 0===e&&(e=400),!isFinite(e)||e<=0)throw new RangeError("animationDuration (optional) must be finite positive number");i=this,o=this.m_rightOffset,n=+new Date,r=this._model,function s(){i._visibleBarsCache=null;var a=(new Date-n)/e;if(a>=1)return i.m_rightOffset=t,i._visibleBarsCache=null,r.recalculateAllPanes(),void r.invalidate(new h(h.LIGHT_UPDATE));i.m_rightOffset=o+(t-o)*a,r.recalculateAllPanes(),setTimeout(s,20)}()},r.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this.m_stateSnapshot=null)},r.prototype._currentSavedPosition=function(){var t,e;this.isEmpty()||(t=this.m_points.indexOf(this.m_restoredLastTimePoint,!0),TradingView.isInteger(t)&&(e=this._baseIndex-t,this.m_rightOffset-=e),delete this.m_restoredLastTimePoint)},r.prototype.update=function(t,e,i,o){this._visibleBarsCache=null,i.length>0&&this.m_points.merge(t,e,i),this.m_tickmarks.merge(o),this.m_restoredLastTimePoint&&this._currentSavedPosition()},r.prototype.addTail=function(t,e,i){var o,n,r;for(this.m_tickmarks.removeTail(e),o=t.params,n=this.m_tickmarks.maxIndex+(i?0:1),r=0;r<o.marks.length;r++)o.marks[r].index=n+r;this.m_tickmarks.addTail(o.marks),this.m_points.addTail(o.changes,i),this.m_rightOffset-=o.changes.length},r.prototype.formatLabel=function(t,e){if(this._formattedBySpan[e])return this._formattedBySpan[e].format(t.valueOf());var i=this;return this._formattedBySpan[e]=new l(function(t){return i.formatLabelImpl(new Date(t),e)}),
this._formattedBySpan[e].format(t)},r.prototype.formatLabelImpl=function(t,e){if(!(t&&t instanceof Date))return"incorrect time";var i=this._model.mainSeries().isDWM();return e<_.MINUTE_SPAN&&!i?d(t.getUTCHours(),2)+":"+d(t.getUTCMinutes(),2)+":"+d(t.getUTCSeconds(),2):e<_.DAY_SPAN&&!i?d(t.getUTCHours(),2)+":"+d(t.getUTCMinutes(),2):e<_.WEEK_SPAN?t.getUTCDate():e<_.MONTH_SPAN?t.getUTCDate():e<_.YEAR_SPAN?(g||(g=n()),g[t.getUTCMonth()]):t.getUTCFullYear()},r.prototype.normalizeBarIndex=function(t){var e=0,i=0;return t<this.m_points.firstIndex()?(e=this.m_points.valueAt(this.m_points.firstIndex()),i=t-this.m_points.firstIndex()):t>this._baseIndex?(e=this.m_points.valueAt(this._baseIndex),i=t-this._baseIndex):(e=this.m_points.valueAt(t),i=0),{time_t:e,offset:i}},r.prototype.denormalizeTimePoint=function(t){var e=this.m_points.indexOf(t.time_t);if(null!==e)return e+t.offset},r.prototype.zoomToBarsRange=function(t,e){e<=t||(this.m_rightOffset=e-this._baseIndex,this.setBarSpacing(this.width()/(e-t+1)),this._visibleBarsCache=null)},r.prototype.recalcLockedScale=function(){var t,e,i,n,r,s,a,l;this._model.mainSeries().properties().lockScale.value()&&!this.isEmpty()&&(t=this._model.m_mainSeries.priceScale(),e=this._model.m_mainSeries,i=e.data().boxSize,i||(e.fixBoxSize(),i=e.data().boxSize),i&&(t.isPercentage()&&(n=e.data().search(e.getRealVisibleRange().firstBar()).value[TradingView.CLOSE_PLOT],i=o.prototype.convertToPercent.call(null,n+i,n)-o.prototype.convertToPercent.call(null,n,n)),r=t.internalHeight()/(this.barSpacing()/i),(s=e.priceScale().priceRange())&&r===s.length()||(!s||s.isEmpty()?(a=this.visibleBars(),s=e.priceRange(a.firstBar(),a.lastBar())):(l=(r-s.length())/2,s.set(s.minValue()-l,s.maxValue()+l)),e.priceScale().setPriceRange(s))))},r.prototype.correctBarSpacing=function(){this.isEmpty()||this.points().size()<this.width()/this.barSpacing()&&(this.resetRightOffset(),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),v)))},r.prototype.canZoomIn=function(){return this.m_barSpacing<v},r.prototype.canZoomOut=function(){return this.m_barSpacing>y},r.prototype.onScroll=function(){return this._onScroll},t.exports=r}).call(e,i(20),i(147))},function(t,e,i){"use strict";function o(t){r.call(this,t);var e=this;a.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!a.hideMarksOnBars().value())})}function n(t){s.call(this)}var r=i(133).BarsMarksContainer,s=i(273).BarMarkTooltip,a=i(44);inherit(o,r),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedBarsMarks",o.prototype._plateViewData=function(t){var e={text:t.text};return"object"==typeof t.color&&(e.theme="user_defined_theme",e.overridedTheme={},e.overridedTheme.border=t.color.border,e.overridedTheme.background=t.color.background),e},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;this._marks[t].onClicked()},o.prototype.clearMarks=function(){r.prototype.clearMarks.call(this),
this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype._createTooltip=function(){return new n},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=-1*Math.max(t.minSize/2,.4*this.barWidth()),e},o.prototype.hasContextMenu=function(){return!1},inherit(n,s),n.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>'),this._layout_text=$('<div class="text"></div>').appendTo(this._layout)},n.prototype._updatePlate=function(t){this._currentId=t.id,this._layout.css("border-color",t.theme.border),this._layout.css("margin-top",t.tooltipMargin+"px"),this._layout_text.html(t.text),this._layout.append(this._layout_text)},t.exports=o},function(t,e,i){"use strict";function o(t){a.call(this,t);var e=this;l.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!l.hideMarksOnBars().value())}),this._paneView=new n(this)}function n(t,e){this.source=t,this._rendererFactory=e,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}var r=i(1).Point,s=i(830).ESDPaneView,a=i(133).BarsMarksContainer,l=i(44),c=i(43),h=i(370).Tooltip;inherit(o,a),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedTimescaleMarks",o.prototype._plateViewData=function(t){return{text:t.text}},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;c.emit("onTimescaleMarkClick",t)},o.prototype.clearMarks=function(){a.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getTimescaleMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=-1*Math.max(t.minSize/2,.4*this.barWidth()),e},o.prototype.hasContextMenu=function(){return!1},o.prototype.paneViews=function(t){return this._properties.visible.value()?[this._paneView]:[]},o.prototype.onClickOutside=function(t){this._paneView.onClickOutside(t)},inherit(n,s),n.prototype._createLollipops=function(){var t=this.source._model.timeScale(),e=s.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),o=this;$.each(this.source._marks,function(n,s){var a=s.id;o._lollipops[a]={id:a,basePoint:new r(t.indexToCoordinate(t.timePointToIndex(s.tickmark))+1,e),
hovered:i&&i.id===a||a===o.getLastClickedLollipopId(),barY:null,label:s.label,color:s.color,items:s.tooltip,tooltip:o._lollipops.hasOwnProperty(a)?o._lollipops[a].tooltip:new h,visible:!0}})},n.prototype.update=function(){this._createLollipops()},n.prototype.renderer=function(){return this.update(),s.prototype.renderer.call(this)},n.prototype._generateTemplateStyle=function(t,e,i){var o,n,r=t+e+i;return r in this.stylesCache||(o={strokeStyle:e,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:"white",strokeStyle:"#E2745B",text:{label:i,strokeStyle:e,font:"normal 12px Verdana, Arial, sans-serif"}}},n={strokeStyle:e,lollipop:{fillStyle:e,fillCircle:!0,text:{strokeStyle:"white"}}},this.stylesCache[r]="default"===t?o:$.extend(!0,{},o,n)),this.stylesCache[r]},n.prototype.getTemplate=function(t,e){var i=t+e.color+e.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(t,e.color,e.label))),this.templatesCache[i]},n.prototype.getStyle=function(t,e){return this._generateTemplateStyle(t,e.color,e.label)},n.prototype.createText=function(t,e){"string"==typeof t.items?e.addTextLine(t.items):Array.isArray(t.items)&&t.items.forEach(function(t){e.addTextLine(t)})},n.prototype.hasTooltip=function(t){return!!t.tooltip&&t.tooltip.length},t.exports=o},function(t,e,i){(function(e){"use strict";function o(t){function i(t,e){var i=t.font;return a.hasOwnProperty(i)||(a[i]={}),a[i].hasOwnProperty(e)||(a[i][e]=t.measureText(e).width),a[i][e]}function o(){var o=s.width(),a=s.height();return{draw:function(s){var c,h,u,d,p,_,f,m=t.symbolInfo();if(m&&!e.enabled("fundamental_widget")){for(s.fillStyle=n.generateColor(l.color.value(),l.transparency.value()),c=m.name,/QUANDL/.test(m.exchange)&&(h=c.split(/\//),h.length&&(c=h[h.length-1])),u=[{text:c?c+", "+r(t.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:114,baselineOffset:87},{text:m.description||"",font:"48px Verdana, Arial, sans-serif",lineHeight:57,baselineOffset:43.5}],d=0,p=0;p<u.length;p++)_=u[p],_.text&&(s.font=_.font,f=i(s,_.text),f>o?(_.zoom=o/f,f=o):_.zoom=1,_.offsetLeft=(o-f)/2,d+=_.lineHeight*_.zoom);for(d=Math.max((a-d)/2,0),p=0;p<u.length;p++)_=u[p],_.text&&(s.save(),s.font=_.font,s.translate(_.offsetLeft,d),s.scale(_.zoom,_.zoom),s.fillText(_.text,0,_.baselineOffset),s.restore(),d+=_.lineHeight*_.zoom)}}}}var s=null,a={},l=t.model().properties().symbolWatermarkProperties,c={renderer:o,update:function(){}};this.paneViews=function(t){return t.containsMainSeries()?(s=t,[c]):[]}}var n=i(19),r=i(178).translatedIntervalString;t.exports=o}).call(e,i(7))},function(t,e,i){"use strict";function o(t){return t.keys().map(t)}window.TradingView=window.TradingView||{},window.requireAll=o,i(1004),i(740),i(743),i(102),i(742),i(34),i(101),i(170),i(1118),i(287),i(430),i(985),i(63),i(986),i(219),i(432),i(305)},function(module,exports,__webpack_require__){(function(Delegate,_,Featuresets){"use strict";function loginUser(t,e){
window.TVDialogs&&window.TVDialogs.signModal&&window.TVDialogs.signModal.close(),user=$.extend(!0,{},t),TradingView.changeLoginState(!0),"function"==typeof e&&window.TVDialogs&&window.TVDialogs.signModal?window.TVDialogs.signModal.on("signinSuccess",function(){e()}):"function"==typeof e&&e()}function onLoginStateChange(is_initial){window.iframeAuthWidget&&user.is_first_login&&(window.iframeAuthWidget.preventClose=!0);var available_offer=user.available_offer;$("html").toggleClass("is-authenticated",is_authenticated).toggleClass("is-not-authenticated",!is_authenticated).toggleClass("is-pro",is_authenticated&&user&&!!user.is_pro).toggleClass("is-not-pro",!(is_authenticated&&user&&user.is_pro)).toggleClass("is-trial",is_authenticated&&user&&!!user.is_trial).toggleClass("is-not-trial",!(is_authenticated&&user&&user.is_trial)).toggleClass("is-not-trial-available",available_offer.offer!==OFFERS.trial).toggleClass("is-trial-available",available_offer.offer===OFFERS.trial).toggleClass("is-upsale-available",is_authenticated&&available_offer.offer===OFFERS.upsale),TVSettings.sync(user.settings),$(".js-header__gopro-button").attr("href",is_authenticated?"/gopro/":""),is_authenticated?($(".saved_charts_count").html(user.saved_charts),$(".treated_charts_count").html(user.treated_charts_count),$(".js-trial-days-left").html(user.trial_days_left_text||""),$(".js-header-gopro-button").attr("href","/gopro/"),user.fastpass_script&&eval(user.fastpass_script),user.is_first_login&&($(function(){}),trackEvent("Conversion","First login"),user.prort_trial_started&&delete user.prort_trial_started,delete user.is_first_login),TradingView.setTrialAvailiable(user.available_offer.offer===OFFERS.trial)):(user={username:"Guest",following:"0",followers:"0",ignore_list:{},available_offer:{}},$(".user-info-username").html(user.username),TVLocalStorage.removeItem("trial_availiable"))}var loginStateChange,TVXWindowEvents=__webpack_require__(181).TVXWindowEvents,trackEvent=__webpack_require__(48).trackEvent,OFFERS={};__webpack_require__(1149),$(document).ajaxSend(function(t,e,i){"POST"!==i.type||i.crossDomain||e.setRequestHeader("X-CSRFToken",$.cookie("csrftoken")),i.crossDomain&&!i.forceLanguageHeader||(window.locale?e.setRequestHeader("X-Language",window.locale):console.warn("window.locale is not defined"))}),loginStateChange=window.loginStateChange?window.loginStateChange:window.loginStateChange=new Delegate,loginStateChange.subscribe(null,onLoginStateChange),TVXWindowEvents.on("loginStateChange",function(){var t=JSON.parse(this);window.user=t.user,window.is_authenticated=!!t.is_authenticated,loginStateChange.fire()}),function(){var t="user-obj-changed",e={};window.crossTabSyncUserAttr=function(e){var i={};e instanceof Array?e.forEach(function(t){i[t]=window.user[t]}):i[e]=window.user[e],TVXWindowEvents.emit(t,JSON.stringify(i))},window.onChangeUserAttrInAnotherTab=function(t){var i=new Delegate;return e[t]||(e[t]=[]),e[t].push(i),i},TVXWindowEvents.on(t,function(t){var i,o;t=JSON.parse(t);for(i in t)if(window.user[i]=t[i],
e[i])for(o=0;o<e[i].length;o++)e[i][o].fire(t[i])})}(),TradingView.changeLoginState=function(t){window.is_authenticated=!!t,TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user})),loginStateChange.fire()},window.loginUser=loginUser,TradingView.signOut=function(){var t=_.clone(window.user);TradingView.changeLoginState(!1),$.ajax({type:"POST",url:"/accounts/logout/",dataType:"html"}).fail(function(){window.user=t,TradingView.changeLoginState(!0)})},window.loginRequiredDelegate=new Delegate,window.runOrSignIn=function(t,e){e||(e={}),e.verifiedPhoneRequired,(is_authenticated||Featuresets.enabled("charting_library_base"))&&t()},TradingView.runOrGoPro=function(t,e,i){Featuresets.enabled(e)&&t()},window.onLoginStateChange=onLoginStateChange,TradingView.isPro=function(){return is_authenticated&&user.is_pro},TradingView.setTrialAvailiable=function(t){TVLocalStorage.setItem("trial_availiable",t?1:0)},$.fn.reverse=[].reverse,$(window).load(function(){window.loaded=!0}),TradingView.notificationsChanged=new Delegate}).call(exports,__webpack_require__(20),__webpack_require__(192),__webpack_require__(7))},function(t,e,i){(function(t,e,o){"use strict";var n,r,s,a=i(56).max,l=i(203).createNoticeDialog,c=i(179).lazyJqueryUI;i(142),n=null,r=function(t){n||(n=l({type:"modal",title:t.title,content:t.content}).open(),n.on("beforeClose",function(){n=null}))},s=window.TVDialogs={modalDialog:null,dialogs:[],messageInterval:null,messageDelay:4e3,NOTIFICATION_ANIMATION_START_OFFSET:"-33px",_constrainDraggableOptionsIfNeeded:function(e){return t.enabled("constraint_dialogs_movement")&&(e.containment=".chart-page"),e},validateHelpers:{isErrorListening:function(t){t.on("keyup.error-checker",s.validateHelpers.isError(t.val(),t))},isError:function(t,e){return function(){e.val()!==t&&(e.removeClass("error"),e.off("keyup.error-checker"))}},makeValidator:function(t,e,i,o,n){return function(r){var a,l,c;if(t.removeClass("error"),$("._tv-dialog-field-error").hide(),""!==r.errors)if("object"==typeof r.errors){for(a in r.errors)l=t.filter("input[name^="+a+"]"),l.addClass("error").data("error",r.errors[a][0]),s.validateHelpers.isErrorListening(l);c=t.filter(".error").first().focus(),s.showError(c.data("error"),n)}else s.showError($.t("Error:")+r.errors,n);else"function"==typeof o&&o(r,i);e.removeClass("process")}}},applyMQMatcher:function(t){var e,i;t||(t=s.modalDialog),e=function(){s.positionDialog()},window.matchMedia&&(i=["(max-height: 645px)","(max-width: 460px)"].map(function(t){var i=matchMedia(t);return i.addListener(e),i}),t.on("destroy",function(){i.forEach(function(t){t.removeListener(e)})}))},showBrowserExtensionDialog:function(t){var o,n;if(t)return o={chrome:{logo:"images/svg/google-chrome-logo.svg",name:"Google Chrome",href:"https://chrome.google.com/webstore/detail/tradingview-free-quotes-a/ommjfbdmijjlbhlhnnnfkmbnkpnjpipj"}},n=i(220),s.createModalDialog("Browser Extension",{noHeader:!0,width:"730px",content:e.render(n.dialogs.browserExtension,{browser:o[t]})}),
s.modalDialog.find(".install-extension, ._tv-dialog-title-close").click(function(t){s.destroy()}),s.positionDialog(),s.modalDialog},showIntervalMismatchDialog:function(t){var e,i,o,n,r=$.t("Interval is not applicable"),s=$("<div></div>"),a=$.t("<p>Only <b>D, W, M</b> intervals are supported for this symbol/exchange. You will be automatically switched to a D interval. Intraday intervals are not available because of exchange policies.</p>");s.append(a),t&&(e=$.t("Do not show this message again"),i='<label class="dialog-trail-checkbox"><input type="checkbox" style="margin: 0; vertical-align: middle;"/> '+e+"</label>",s.append(i),o=s.find("input"),o.attr("checked",t.silentIntervalChange.value()),o.bind("click",function(){t.silentIntervalChange.setValue(this.checked)})),n=l({title:r,content:s}),n.open()},showGoProDialog:function(){},showFXCMdataOffer:function(t,o){function n(){c.html(e.render(d.fxcmOfferDialog.stage1,{})),c.find("._tv-dialog-title-close").on("click",function(){s.destroy()}),c.find(".js-go-alternative").on("click",function(t){s.destroy(),t.preventDefault()});var i=c.find(".js-type-selector");["real","demo"].forEach(function(t){i.find("a."+t).toggleClass("active",t===u).on("click",function(e){e.preventDefault(),u=t,i.find("a").removeClass("active"),$(e.target).addClass("active")})}),c.find("form").on("submit",function(e){e.preventDefault(),c.find(".js-connect").addClass("process"),t({password:$(this).find('input[name="password"]').val(),login:$(this).find('input[name="login"]').val(),mode:u}).then(function(t){c.find(".js-connect").removeClass("process"),t?(h=!0,r({okStatus:!0})):r({okStatus:!1})}).catch(function(){r({okStatus:!1})})}),a()}function r(t){c.html(e.render(d.fxcmOfferDialog.stage2,t)),c.find("._tv-dialog-title-close").on("click",function(){s.destroy()}),c.find(".js-try-again").on("click",function(t){t.preventDefault(),n()}),c.find(".js-ok").on("click",function(t){t.preventDefault(),s.destroy()}),a()}function a(){s.applyMQMatcher(l),s.positionDialog(),s.applyHandlers(null,{doNotCloseOnBgClick:!0,doNotCloseOnEsc:!0})}var l,c,h=!1,u="demo",d=i(220);window.runOrSignIn(function(){l=s.createModalDialog($.t("FXCM CFD data is available only to FXCM account holders"),{addClass:"cme-offer-dialog"}),c=s.modalDialog.find("._tv-dialog-content"),$(l).on("destroy",function(){o(h)}),n()})},showSignInDialog:function(t,e){},goRegistrate:function(t){},showAlertTextNotesDialog:function(){r({title:$.t("Oops!"),content:'<div class="tv-text">'+$.t('Text Notes are available only on chart page. Please <a href="/chart/">open a chart</a> and then try again.')+"</div>"})},showNotice:function(t,i,o){var n,r,a,l,c,h;return"object"==typeof i&&(o=i,i=""),o=o||{},n=o.doNotCloseOnBgClick||!1,r=o.html||"",a=o.width||"400px",l={},l.noClose=o.noClose||null,l.addClass=o.modalDialogClass||null,s.createModalDialog(t,l),c=o.centerCaption?"caption-big-center":"caption-big",s.modalDialog.find("._tv-dialog").css("width",a),h=o.customButtonCaption?o.customButtonCaption:$.t("OK"),
s.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><div class="{{captionClassName}} {{classSuffix}}">{{text}}'+r+'</div>{{^removeOkButton}}<div class="buttons"><input type="button" class="_tv-button ok" value="'+h+'"/></div>{{/removeOkButton}}</div>',{captionClassName:c,classSuffix:o.classSuffix||"",text:i,removeOkButton:o&&o.removeOkButton})),s.modalDialog.find("._tv-button.ok").on("click",function(){s.destroy(),o.onOkButtonClick&&o.onOkButtonClick()}),s.positionDialog(),s.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:n,beforeDestroy:o.onClose}),s.modalDialog},showConfirm:function(t,i,o,n,r){var a,l;return r=r||{},r.dontAskSetting&&TVSettings.getBool(r.dontAskSetting)?void o():(a=s.createModalDialog(t,r),s.modalDialog.find("._tv-dialog").css("width",r.customWidth?r.customWidth:"400px"),s.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><div class="caption-big">{{{text}}}</div>{{#dontAskSetting}}<input type="checkbox" id="confirm-dialog-checkbox" style="margin: 0; vertical-align: middle;"> <label for="confirm-dialog-checkbox" style="font-size: 11px;">'+$.t("Do not ask again")+'</label>{{/dontAskSetting}}</div><div class="_tv-dialogs-bottom _tv-dialog-center"><input class="_tv-button wide ok" type="button" value="'+$.t("YES")+'" style="margin-right: 10px;"/><input class="_tv-button wide cancel" type="button" value="'+$.t("NO")+'"/></div>',{text:i,dontAskSetting:!!r.dontAskSetting})),r.okButtonText&&s.modalDialog.find(".ok").val(r.okButtonText),r.cancelButtonText&&s.modalDialog.find(".cancel").val(r.cancelButtonText),l=s.modalDialog.find(".ok"),l.click(function(){r.dontAskSetting&&$("#confirm-dialog-checkbox").is(":checked")&&TVSettings.setValue(r.dontAskSetting,!0),o(),r.manualClose||s.destroy()}),s.modalDialog.find(".cancel").click(function(){n&&n(),r.manualCloseOnCancel||s.destroy()}),s.positionDialog(),s.applyHandlers(a,{processEnterButton:l}),a)},showPrompt:function(t,i,o,n,r){function a(){var t,e=h.val();if(c&&(t=c(e)))return!0===t&&(t=$.t("Wrong value")),void s.showError(t,s.modalDialog);s.destroy(),o&&o(e)}var l,c,h;r=r||{},l=r&&r.defaultValue,c=r&&r.validate,s.createModalDialog(t,r),s.modalDialog.find("._tv-dialog").css("width","400px"),s.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><form><div class="caption-big-center slim">{{text}}: <input type="text" name="prompt-value" class="prompt-value"/></div></form></div><div class="_tv-dialogs-bottom _tv-dialog-{{bottomAlign}}"><input class="_tv-button wide ok" type="button" value="'+$.t("OK")+'" style="margin-right: 10px;"/><input class="_tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/></div>',{text:i,bottomAlign:r.bottomAlign?r.bottomAlign:"center"})),h=s.modalDialog.find('[name="prompt-value"]'),l&&h.val(l),s.modalDialog.find("form").submit(function(t){a(),t.preventDefault()}),s.modalDialog.find(".ok").click(function(t){a(),t.preventDefault()}),s.modalDialog.find(".cancel").click(function(){s.destroy(),n&&n()}),s.positionDialog(),s.applyHandlers(),setTimeout(function(){
h.focus().select()},0)},showCustomDialog:function(t){function e(e){var i=t.action(s.modalDialog),o=i&&!i.error,n=void 0===i,r=i&&i.notClose;!o&&!n||r?i.error&&s.showError(i.error):s.destroy(),e.preventDefault()}function i(e){"function"==typeof t.onCancel?t.onCancel():s.destroy()}return s.createModalDialog(t.title||$.t("Dialog"),{addClass:t.addClass||""}),s.modalDialog.find("._tv-dialog").css("width",t.width||"400px"),s.modalDialog.find("._tv-dialog-content").html('<div class="main">'+(t.html||$.t("Content"))+"</div>"+(t.noButtons?"":'<div class="_tv-dialogs-bottom _tv-dialog-center">'+(t.noButtonOk?"":'<input class="_tv-button wide ok" type="button" value="'+$.t("OK")+'" style="margin-right: 10px;"/>')+(t.noButtonCancel?"":'<input class="_tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/>')+"</div>")),t.okButtonText&&s.modalDialog.find(".ok").val(t.okButtonText),t.cancelButtonText&&s.modalDialog.find(".cancel").val(t.cancelButtonText),s.modalDialog.find(".ok").click(e),s.modalDialog.find("form").submit(e),s.modalDialog.find(".cancel").click(i),s.modalDialog.find("._tv-dialog-title-close").click(i),s.positionDialog(),s.applyHandlers(),s.modalDialog},createModalDialog:function(t,e){var i,o;return e=e||{},null!==s.modalDialog&&s.destroy(),s.modalDialog=$('<div class="_tv-dialog-shadowbox"><div class="_tv-dialog _tv-dialog-modal'+(e.addClass?" "+e.addClass:"")+'">'+(e.noHeader?"":'<div class="_tv-dialog-title">'+(e.noClose?"":'<a class="_tv-dialog-title-close"></a>')+'<span class="_tv-dialog-title-text">'+t+"</span></div>")+'<div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div></div>').appendTo($("body")).data("title",t),s._addMessageCloseButton(s.modalDialog.find("._tv-dialog-error")),s._addMessageCloseButton(s.modalDialog.find("._tv-dialog-message")),e.noShadowBox&&s.modalDialog.addClass("transparent"),e.addClass&&s.modalDialog.addClass(e.addClass),e.width&&s.modalDialog.find("._tv-dialog").css({width:e.width}),e.content&&s.modalDialog.find("._tv-dialog-content").html(e.content),i=$(".fancybox-overlay"),i.length&&(o=i.css("z-index"),$("._tv-dialog-shadowbox").css("z-index",o+1)),e.draggable&&c(s.modalDialog).draggable(s._constrainDraggableOptionsIfNeeded({handle:s.modalDialog.find("._tv-dialog-title")})),e.zIndex&&s.modalDialog.css("z-index",e.zIndex),s.modalDialog},_addMessageCloseButton:function(t){var e=$(i(1338)).attr({class:"close",title:$.t("Close message")});t.append(e),$(e).on("click",function(){t.animate({marginTop:s.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){t.hide()})})},createDialog:function(t,i){var o,n,r;return s.isOpen(t)?(o=s.get(t),o.find("._tv-dialog-content").html(""),o.data("new",!1),o):(i=i||{},
o=$(e.render('<div class="_tv-dialog _tv-dialog-nonmodal {{&addClass}}"><div class="_tv-dialog-title{{#hideTitle}} _tv-dialog-title-hidden{{/hideTitle}}{{#hideCloseCross}} _tv-dialog-title-no-close{{/hideCloseCross}}">{{^hideTitle}} {{&title}}{{/hideTitle}}{{^hideCloseCross}}<a class="_tv-dialog-title-close"></a>{{/hideCloseCross}}</div><div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div>',{addClass:i.addClass||"",hideTitle:i.hideTitle,hideCloseCross:i.hideCloseCross,title:t})).appendTo($("body")),s._addMessageCloseButton(o.find("._tv-dialog-error")),s._addMessageCloseButton(o.find("._tv-dialog-message")),i.width&&o.css({width:i.width}),i.content&&o.find("._tv-dialog-content").html(i.content),n=0,n=i.zIndex?i.zIndex:s.dialogs&&s.dialogs.length?a($.map(s.dialogs,function(t){return parseInt((t.dialog||t).css("z-index"),10)}))+1:110,o.css("z-index",n),o.data("new",!0),o.data("title",t),o.data("id",s.dialogs.length+1),s.dialogs.push({title:t,dialog:o,id:s.dialogs.length+1}),r={start:function(t,e){var i,o,n=e.helper.css("z-index"),r=0,a=null;for(i=0;i<s.dialogs.length;i++)(o=s.dialogs[i].dialog.css("z-index"))>r&&(r=o,a=s.dialogs[i].dialog);e.helper.css("z-index",r),a.css("z-index",n)}},i.dragHandle?r.handle=i.dragHandle:i.hideTitle||(r.handle="._tv-dialog-title"),i.dragOptions&&$.extend(r,i.dragOptions),c(o).draggable(s._constrainDraggableOptionsIfNeeded(r)),o)},positionDialog:function(t,e,i){function o(){n.css("margin-left",-Math.round(n.outerWidth()/2)+"px"),n.css("margin-top",-Math.round(n.outerHeight()/2)+"px")}var n,r,a,l,c,h,u,d;i=i||{},e=e||i.position,t?(r=t.width(),a=t.height(),l=$(window).width(),c=$(window).height(),e&&e.top&&e.left?(u=i.forcePosition?e.left:Math.max(2,Math.min(l-r-4,e.left))+"px",h=i.forcePosition?e.top:Math.max(2,Math.min(c-a-4,e.top))+"px"):e&&e.considerScroll?(d=$(document),u=Math.round((l-r)/2+d.scrollLeft())+"px",h=Math.round((c-a)/2+d.scrollTop())+"px"):(u=Math.round((l-r)/2)+"px",h=Math.round((c-a)/2)+"px"),i.fadeIn?t.css({left:u,top:h}).hide().fadeIn("fast"):i.smooth?t.animate({left:u,top:h}):t.css({left:u,top:h})):(t=s.modalDialog,n=t.find("._tv-dialog"),o(),n.resize(o))},applyHandlers:function(t,e){var i,o,n=!t||t===this.modalDialog;e=e||{},i=n?function(){s.destroy()}:function(){s.destroy(t.data("title"))},t=t||s.modalDialog.find("._tv-dialog"),e.beforeDestroy&&t.on("destroy",e.beforeDestroy),t.find("._tv-dialog-title ._tv-dialog-title-close, .js-dialog-close").on("click",function(t){e.closeHandler&&"function"==typeof e.closeHandler?e.closeHandler(t):i()}),e.doNotCloseOnBgClick||setTimeout(function(){t.on("mousedownoutside",function(o){var n=$(o.target).parents().andSelf();e.doNotCloseOnBgClickIfShadowbox&&n.is("._tv-dialog-shadowbox, .tv-dialog__modal-wrap")||n.is(".colorpicker, .charts-popup-list, ._tv-dialog, .tvcolorpicker-popup, .symbol-edit-popup, .ui-datepicker, .clockpicker-popover, .pac-container")||(t.unbind("mousedownoutside"),i())})},0),
t.find('input[type="checkbox"]').change(function(){var t=$(this);t.next("._tv-dialog-checkbox-mask").toggleClass("disabled",t.prop("disabled")).toggleClass("_tv-dialog-checkbox-mask-active",t.is(":checked"))}),o=t.find('input[type="text"]').focus(function(){$(this).addClass("_tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textactive")}).first(),Modernizr.touch||e.notFocusFirst||o.focus(),t.find('input[type="password"]').focus(function(){$(this).addClass("_tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textactive")}),t.find("textarea").focus(function(){$(this).addClass("_tv-dialog-content-textareaactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textareaactive")}),t.find("._tv-dialog-checkbox-mask").click(function(){var t=$(this).prev();t.prop("disabled")||(t.prop("checked",!t[0].checked),t.change())}),e.doNotCloseOnEsc||$(window).bind("keyup.hideDialog",function(e){if(27===e.keyCode)return t?s.destroy(t.data("title")):s.destroy(),!1}),e.processEnterButton&&$(window).bind("keyup.confirmAndCloseDialog",function(t){13===t.keyCode&&"textarea"!==t.target.tagName.toLowerCase()&&(e.processEnterButton.click(),$(window).unbind("keyup.confirmAndCloseDialog"))})},showError:function(t,e,i){s.showMessage(t,e,$.extend(i||{},{isError:!0}))},showMessage:function(t,e,i){var o,n,r;e||(e=$("._tv-dialog")),i=i||{},o=i.isError&&"_tv-dialog-error"||"_tv-dialog-message",n=e.find("."+o),r=n.find(".message"),i.html?r.html("string"==typeof i.html?i.html:t):r.text(t),r.css("width",e.width()).toggleClass("selectable",!!i.selectable),n.toggleClass("with-close",!!i.withClose).css({marginTop:s.NOTIFICATION_ANIMATION_START_OFFSET,opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast"),i.withClose||(i.hideWithoutAnimation?n.on("touchstartoutside mousedownoutside keydownoutside",function t(){n.hide(),n.off("touchstartoutside mousedownoutside keydownoutside",t)}):n.on("touchstartoutside mousedownoutside keydownoutside",function t(){n.animate({marginTop:s.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){n.hide()}),n.off("touchstartoutside mousedownoutside keydownoutside",t)}))},isOpen:function(t){for(var e=0;e<s.dialogs.length;e++)if(s.dialogs[e].title===t)return!0;return!1},get:function(t){for(var e=0;e<s.dialogs.length;e++)if(s.dialogs[e].title===t)return s.dialogs[e].dialog},submit:function(t,e){var i=e?$(e):$("._tv-dialog form").first(),o=i.serialize(),n=i.attr("action");$.post(n,o,function(e){void 0!==t&&t(e)},"json")},destroy:function(t,e){if(void 0!==s.chart&&(s.chart.destroy(),delete s.chart),$(window).unbind("keyup.hideDialog"),$(window).unbind("keyup.confirmAndCloseDialog"),t&&"string"==typeof t)for(var i=0;i<s.dialogs.length;i++)s.dialogs[i].title===t&&(s.dialogs[i].dialog.find(".apply-common-tooltip").mouseout(),s.dialogs[i].dialog.trigger("destroy",e),$(document).unbind("mouseup.hideDialog"+s.dialogs[i].id),$("input",s.dialogs[i].dialog).blur(),s.dialogs[i].dialog.remove(),
s.dialogs.splice(i,1));else s.modalDialog&&(s.modalDialog.find(".apply-common-tooltip").mouseout(),s.modalDialog.find("._tv-dialog").trigger("destroy"),s.modalDialog.remove(),s.modalDialog=null)},changeTitle:function(t,e){t&&s.dialogs.forEach(function(i){var o,n;if(i.title===t)return o=i.dialog,n=o.find("._tv-dialog-title"),i.title=e,o.data("title",e),n.html(n.html().replace(t,e)),n.find("a").on("click",function(){s.destroy(e)}),!0})},toggleTitleEl:function(t,e){s.dialogs.filter(function(e){return e.title===t}).map(function(t){return t.dialog}).forEach(function(t){var i=t.find("._tv-dialog-title");"boolean"!=typeof e&&(e=i.hasClass("_tv-dialog-title-hidden")),i.toggleClass("_tv-dialog-title-hidden",!e)})},calcHeight:function(t,e,i){null==i&&(i=20),t+=i;var o=parseInt($("body").height(),10);return t>o&&(e-=t-o,e=Math.max(0,e)),e},resizeContent:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($("body").height(),10),n=e.height(),t>o&&(n-=t-o,n=Math.max(0,n),e.height(n))},resizeContentWidth:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($(window).width(),10),n=e.width(),t>o&&(n-=t-o,n=Math.max(0,n),e.width(n))}},s.ideaDialogs={dialogs:[],add:function(t){s.ideaDialogs.dialogs.push(t)},remove:function(t){s.ideaDialogs.dialogs=$.grep(s.ideaDialogs.dialogs,function(e){return""+e!=""+t})},clear:function(){s.ideaDialogs.dialogs.forEach(function(t){s.destroy(t)})},getDraggableEmptyTitle:function(){return $(document.createElement("div")).css({height:"30px","margin-bottom":"-10px",position:"relative"})}},void 0!==o&&o&&o.exports&&(o.exports=s)}).call(e,i(7),i(54),i(78)(t))},,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var o=i(36);window.language&&(o.locale(window.language,{months:[$.t("January"),$.t("February"),$.t("March"),$.t("April"),$.t("May"),$.t("June"),$.t("July"),$.t("August"),$.t("September"),$.t("October"),$.t("November"),$.t("December")],monthsShort:[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")],weekdays:[$.t("Sunday"),$.t("Monday"),$.t("Tuesday"),$.t("Wednesday"),$.t("Thursday"),$.t("Friday"),$.t("Saturday")],weekdaysShort:[$.t("Sun"),$.t("Mon"),$.t("Tue"),$.t("Wed"),$.t("Thu"),$.t("Fri"),$.t("Sat")],weekdaysMin:[$.t("Su",{context:"day_of_week"}),$.t("Mo",{context:"day_of_week"}),$.t("Tu",{context:"day_of_week"}),$.t("We",{context:"day_of_week"}),$.t("Th",{context:"day_of_week"}),$.t("Fr",{context:"day_of_week"}),$.t("Sa",{context:"day_of_week"})],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MMM D",l:"M/D/YYYY",LL:"MMM D, YYYY",ll:"MMM D LT",LLL:"LT - LL",lll:"MMM D, YYYY LT",LLLL:"ddd D MMMM YYYY LT",llll:"ddd D MMM YYYY LT"},calendar:{sameDay:$.t("__specialSymbolOpen__Today at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextDay:$.t("__specialSymbolOpen__Tomorrow at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextWeek:$.t("__dayName__ __specialSymbolOpen__at__specialSymbolClose__ __dayTime__",{
specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),lastDay:$.t("__specialSymbolOpen__Yesterday at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),lastWeek:$.t("__specialSymbolOpen__Last__specialSymbolClose__ __dayName__ __specialSymbolOpen__at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),sameElse:"L"},relativeTime:{future:function(t){return t===$.t("just now")?t:$.t("in %s",{context:"time_range"}).replace("%s",t)},past:function(t){return t===$.t("just now")?t:$.t("%s ago",{context:"time_range"}).replace("%s",t)},s:$.t("just now"),m:function(t){return $.t("%d minute",{plural:"%d minutes",count:t}).replace("%d",t)},mm:function(t){return $.t("%d minute",{plural:"%d minutes",count:t}).replace("%d",t)},h:$.t("an hour"),hh:function(t){return $.t("%d hour",{plural:"%d hours",count:t}).replace("%d",t)},d:$.t("a day"),dd:function(t){return $.t("%d day",{plural:"%d days",count:t}).replace("%d",t)},M:$.t("a month"),MM:function(t){return $.t("%d month",{plural:"%d months",count:t}).replace("%d",t)},y:$.t("a year"),yy:function(t){return $.t("%d year",{plural:"%d years",count:t}).replace("%d",t)}},week:{dow:1,doy:4}}),o.locale(window.language))},,,,,,function(t,e){t.exports='<div class="tv-dropdown-behavior tv-autocomplete__wrapper">\n\t<input class="tv-control-input tv-dropdown-behavior__button" type="text" {{#maxLength}}maxlength="{{ maxLength }}"{{/maxLength}}>\n\t<tv-menu class="tv-dropdown-behavior__body tv-dropdown__body tv-dropdown__body--under-trigger tv-autocomplete__dropdown i-hidden">\n\t</tv-menu>\n</div>\n'},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(689),e.Autocomplete=o.Autocomplete,e.ArraySource=o.ArraySource,n=i(469),e.events=n.events},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(23),i(170),i(621),n=i(468),r={connecting:"tv-data-mode--connecting",delayed:"tv-data-mode--delayed",delayed_streaming:"tv-data-mode--delayed",endofday:"tv-data-mode--endofday",forbidden:"tv-data-mode--forbidden",realtime:"tv-data-mode--realtime",snapshot:"tv-data-mode--snapshot",loading:"tv-data-mode--loading",replay:"tv-data-mode--replay"},s={connecting:$.t("Connecting"),delayed:$.t("Delayed"),delayed_streaming:$.t("Delayed"),endofday:$.t("EOD"),forbidden:$.t("Instrument is not allowed"),realtime:$.t("Realtime"),snapshot:$.t("Snapshot"),loading:"",replay:$.t("Replay Mode")},a={connecting:$.t("C",{context:"data_mode_connecting_letter"}),delayed:$.t("D",{context:"data_mode_delayed_letter"}),delayed_streaming:$.t("D",{context:"data_mode_delayed_streaming_letter"}),endofday:$.t("E",{context:"data_mode_end_of_day_letter"}),forbidden:$.t("F",{context:"data_mode_forbidden_letter"}),realtime:$.t("R",{context:"data_mode_realtime_letter"}),snapshot:$.t("S",{context:"data_mode_snapshot_letter"}),loading:"",replay:$.t("R",{
context:"data_mode_replay_letter"})},l=600,c={streaming:"realtime"},h={classMap:r,classSuffix:"",data:{values:{update_mode:"connecting"}},labelMap:s,modeInterval:l,short:!1,shortLabelMap:a,showTooltip:!0},u=function(t){function e(e){var i=t.call(this)||this;return i._quoteSessionPrefix="data-mode-indicator",i._componentClass="tv-data-mode",i._init(e),i}return o.__extends(e,t),e.prototype.getLabel=function(){return!0===this._shortMode?this._shortLabelMap[this._value]||"":t.prototype.getLabel.call(this)},e.prototype.setMode=function(t,e){this.update({values:{update_mode:t,update_mode_seconds:e}})},e.prototype.hide=function(){this._el.classList.add("i-hidden")},e.prototype.show=function(){this._el.classList.remove("i-hidden")},e.prototype.getTooltipText=function(){var t="",e=this.getValue();if(""===e)return t;switch(e){case"delayed":t=$.t("Quotes are delayed by {0} min and updated every 30 seconds");break;case"delayed_streaming":t=$.t("Quotes are delayed by {0} min");break;default:t=this._labelMap[e]||t}return["delayed","delayed_streaming"].includes(e)&&(t=t.format(Math.round(this._modeInterval/60))),t},e.prototype._init=function(e){void 0===e&&(e={});var i=Object.assign({},h,e);this._modeInterval=i.modeInterval||l,this._shortLabelMap=i.shortLabelMap||a,t.prototype._init.call(this,i),this._render()},e.prototype._getValueFromData=function(t){var e;return e=void 0!==t.values&&void 0!==t.values.update_mode?t.values.update_mode:this.getValue(),c[e]||e},e.prototype._updateValue=function(e,i){void 0!==e.values&&void 0!==e.values.update_mode_seconds&&(this._modeInterval=e.values.update_mode_seconds),t.prototype._updateValue.call(this,e,i)},e}(n.AbstractIndicator),e.DataModeIndicator=u},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(23),i(622),n=i(468),r={invalid:"tv-market-status--invalid",market:"tv-market-status--market",out_of_session:"tv-market-status--out-of-session",post_market:"tv-market-status--post-market",pre_market:"tv-market-status--pre-market",loading:"tv-market-status--loading",replay:"tv-market-status--replay"},s={invalid:$.t("Invalid Symbol"),market:$.t("Market Open"),out_of_session:$.t("Market Closed"),post_market:$.t("Post Market"),pre_market:$.t("Pre Market"),loading:$.t("Loading"),replay:""},a={classMap:r,classSuffix:"",data:{},extraTitle:"",labelMap:s,short:!1,showTooltip:!0},l=function(t){function e(e){var i=t.call(this)||this;return i._quoteSessionPrefix="market-status-indicator",i._componentClass="tv-market-status",i._extraTitle="",i._init(e),i}return o.__extends(e,t),e.prototype.setStatus=function(t,e){var i={values:{current_session:t}};this.update(i,e)},e.prototype.getTooltipText=function(){var e=t.prototype.getTooltipText.call(this);return""===e?e:(""!==this._extraTitle&&(e=e+", "+this._extraTitle),e)},e.prototype.setExtraTitle=function(t){this._extraTitle=t},e.prototype.reset=function(){this._clearClasses(),this._labelEl.textContent="",this._extraTitle="",this._el.setAttribute("title",""),this._value=""},e.prototype.enableShortMode=function(e){
void 0===e&&(e=!0),void 0!==this._labelEl&&this._labelEl.classList.add("i-hidden"),t.prototype.enableShortMode.call(this)},e.prototype.disableShortMode=function(){void 0!==this._labelEl&&this._labelEl.classList.remove("i-hidden"),t.prototype.disableShortMode.call(this)},e.prototype._renderLabel=function(){this._labelEl.textContent=this.getLabel()},e.prototype._getValueFromData=function(t){return void 0!==t.values&&void 0!==t.values.current_session?t.values.current_session:this.getValue()},e.prototype._render=function(){this._renderLabelElement(),this._renderDotElement(),t.prototype._render.call(this)},e.prototype._init=function(e){var i=Object.assign({},a,e);t.prototype._init.call(this,i),this.setExtraTitle(i.extraTitle),this._render()},e.prototype._renderLabelElement=function(){void 0===this._labelEl&&(this._labelEl=document.createElement("span"),this._labelEl.classList.add(this._componentClass+"__label"),this._labelEl.classList.add(this._componentClass+"__label"+this._classSuffix),this._el.appendChild(this._labelEl))},e.prototype._renderDotElement=function(){void 0===this._dotEl&&(this._dotEl=document.createElement("span"),this._dotEl.classList.add(this._componentClass+"__dot"),this._dotEl.classList.add(this._componentClass+"__dot"+this._classSuffix),this._el.appendChild(this._dotEl))},e}(n.AbstractIndicator),e.MarketStatusIndicator=l},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(34),n=["alwaysShowStats","clonable","entryPrice","interval","lastUpdateTime","points","singleChartOnly","snapTo45Degrees","stopPrice","symbol","targetPrice"],r=function(){function t(t,e,i){this._source=t,this._model=e,this._pointsConverter=i}return t.prototype.isSelectionEnabled=function(){return this._source.isSelectionEnabled()},t.prototype.setSelectionEnabled=function(t){this._source.setSelectionEnabled(t)},t.prototype.isSavingEnabled=function(){return this._source.isSavedInChart()},t.prototype.setSavingEnabled=function(t){this._source.setSavingInChartEnabled(t)},t.prototype.isShowInObjectsTreeEnabled=function(){return this._source.showInObjectTree()},t.prototype.setShowInObjectsTreeEnabled=function(t){this._source.setShowInObjectsTreeEnabled(t)},t.prototype.isUserEditEnabled=function(){return this._source.userEditEnabled()},t.prototype.setUserEditEnabled=function(t){this._source.setUserEditEnabled(t)},t.prototype.bringToFront=function(){this._model.bringToFront(this._source)},t.prototype.sendToBack=function(){this._model.sendToBack(this._source)},t.prototype.getProperties=function(){return this._source.properties().state(n,!0)},t.prototype.setProperties=function(t){this._setProps(this._source.properties(),t,"")},t.prototype.getPoints=function(){return this._pointsConverter.dataSourcePointsToPriced(this._source.points())},t.prototype.setPoints=function(t){var e,i,o=this._source.pointsCount(),n=-1===o?this._source.points().length:o;if(n!==t.length)throw Error("Wrong points count. Required="+n);for(e=this._pointsConverter.apiPointsToDataSource(t),
i=0;i<e.length;++i)this._source.setPoint(i,e[i])},t.prototype._setProps=function(t,e,i){var n,r,s;for(n in e)e.hasOwnProperty(n)&&(r=0===i.length?n:i+"."+n,t.hasOwnProperty(n)?(s=e[n],o.isHashObject(s)?this._setProps(t[n],s,r):t[n].setValue(s)):console.warn('Unknown property "'+r+'"'))},t}(),e.LineDataSourceApi=r},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(23),n=i(316),r=function(){function t(t,e){this._study=t,this._model=e}return t.prototype.isUserEditEnabled=function(){return this._study.userEditEnabled()},t.prototype.setUserEditEnabled=function(t){this._study.setUserEditEnabled(t)},t.prototype.getInputsInfo=function(){return this._study.metaInfo().inputs.map(function(t){return o.__assign({},t,{localizedName:void 0!==t.name?window.t(t.name,{context:"input"}):""})})},t.prototype.getInputValues=function(){var t=this._study.inputs();return Object.keys(t).map(function(e){return{id:e,value:t[e]}})},t.prototype.setInputValues=function(t){var e,i,o,n=this.getInputValues(),r=function(t){void 0!==n.find(function(e){return e.id===t.id})?s._study.properties().inputs[t.id].setValue(t.value):console.warn('There is no such input: "'+t.id+'"')},s=this;for(e=0,i=t;e<i.length;e++)o=i[e],r(o)},t.prototype.mergeUp=function(){this._model.mergeSourceUp(this._study)},t.prototype.mergeDown=function(){this._model.mergeSourceDown(this._study)},t.prototype.unmergeUp=function(){this._model.unmergeSourceUp(this._study)},t.prototype.unmergeDown=function(){this._model.unmergeSourceDown(this._study)},t.prototype.isVisible=function(){return this._study.properties().visible.value()},t.prototype.setVisible=function(t){this._study.properties().visible.setValue(t)},t.prototype.bringToFront=function(){this._model.bringToFront(this._study)},t.prototype.sendToBack=function(){this._model.sendToBack(this._study)},t.prototype.applyOverrides=function(t){n.applyOverridesToStudy(this._study,t)},t}(),e.StudyApi=r},function(t,e,i){"use strict";function o(t,e){return t.ticker+"_"+e}function n(t){return new Date(t).toISOString()}var r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),r=i(57),s=i(143),a=i(80),l=i(7),i(170),c=function(){function t(t,e,i,o){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._gaps=[],this._needPurgeCache=!1,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._datafeed=t,this._symbolInfo=e,this._resolution=i,this._dwmAligner=o}return t.prototype.destroy=function(){0!==this._subscribers.length&&console.warn("Destroying with not-empty state"),this._clearResetCacheTimeout(),this._unsubscribeRealtime(),this._purgeCache(),delete this._datafeed},t.prototype.addSubscription=function(t,e,i){var o=this,n=this._getNextSubscriptionId(),r=Math.floor(t.from/1e3),s=Math.floor(t.to/1e3);return this._pendingSubscribers.push({key:n,range:{from:r,to:s},onHistoryCallback:e,onErrorCallback:i}),this._clearResetCacheTimeout(),setTimeout(function(){
return o._processNextPendingSubscriber()},0),n},t.prototype.removeSubscription=function(t){var e,i=this,o=this._pendingSubscribers.find(function(e){return e.key===t});return o?void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(o),1):(e=this._subscribers.find(function(e){return e.key===t}))?(this._subscribers.splice(this._subscribers.indexOf(e),1),void(this._subscribers.length||(this._symbolInfo.expired||this._symbolInfo.expiration_date?this._unsubscribeRealtime():this._resetCacheTimeout=setTimeout(function(){i.purgeCache(),i._unsubscribeRealtime()})))):void console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,t))},t.prototype.purgeCache=function(){this._logMessage("Reset cache"),this._needPurgeCache=!0,this._clearResetCacheTimeout()},t.prototype._logMessage=function(t,e){(l.enabled("charting_library_debug_mode")||e)&&console.log("FEED [{0}|{1}]: {2}".format(this._symbolInfo.name,this._resolution,t))},t.prototype._clearResetCacheTimeout=function(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)},t.prototype._purgeCache=function(){this._cache={bars:[]},this._gaps=[],this._errorMessage=null,this._needPurgeCache=!1,this._leftDate=null,this._endOfData=!1},t.prototype._processNextPendingSubscriber=function(){var t,e,i,o,s,a;if(this._pendingSubscribers.length&&!this._requesting){if(this._needPurgeCache&&this._purgeCache(),t=this._pendingSubscribers.pop(),this._logMessage("Processing bars request {0} from {1} to {2} ".format(t.key,n(1e3*t.range.from),n(1e3*t.range.to))),this._errorMessage)return this._logMessage("Return error:"+this._errorMessage),t.onErrorCallback(this._errorMessage),void this._processNextPendingSubscriber();if((!this._leftDate||t.range.from<this._leftDate)&&(e=new r.Interval(this._resolution),i=(e.inMilliseconds()||0)/1e3,o=!this._leftDate,s=!o&&!!this._cache.bars.length&&this._cache.bars[0].time/1e3-t.range.from<i,(o||!s)&&!this._endOfData))return this._pendingSubscribers.push(t),void this._ensureRequestedTo(t.range.from);a=this._moveSubscriberToRealtime(t),this._returnHistoryDataToSubscriber(t,a),this._subscribeRealtimeIfNeeded(),this._processNextPendingSubscriber()}},t.prototype._moveSubscriberToRealtime=function(t){var e={key:t.key,onHistoryCallback:t.onHistoryCallback,barset:null};return this._subscribers.push(e),e},t.prototype._subscribeRealtimeIfNeeded=function(){!this._subscribers.length||this._realtimeOn||this._symbolInfo.expired||this._symbolInfo.expiration_date||this._subscribeRealtime()},t.prototype._subscribeRealtime=function(){var t,e,i=this;this._symbolInfo.expired||this._realtimeOn||(t=function(t){i._dwmAligner&&(t.time=i._dwmAligner.tradingDayToSessionStart(t.time)),i._putToCacheNewBar(t),i._subscribers.forEach(function(e){var i=e.barset;if(null===i)throw Error("subscirber.barset is null");i.add(t),e.onHistoryCallback(i)})},e=function(){i._unsubscribeRealtime();var t=i._leftDate;i._purgeCache(),t&&i._ensureRequestedTo(t)},this._realtimeOn=!0,
this._datafeed.subscribeBars(this._symbolInfo,this._resolution,t,o(this._symbolInfo,this._resolution),e),this._logMessage("Subscribed to realtime"))},t.prototype._unsubscribeRealtime=function(){!this._symbolInfo.expired&&this._realtimeOn&&(this._datafeed.unsubscribeBars(o(this._symbolInfo,this._resolution)),this._logMessage("Unsubscribed from realtime"),this._realtimeOn=!1)},t.prototype._returnHistoryDataToSubscriber=function(t,e){var i,o,r=t.range,s=l.enabled("cl_feed_return_all_data")?this._createBarset(this._leftDate||r.from):this._createBarset(r.from);s.count()>0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(t.key,s.count(),n(s.bars[0].time),n(s.bars[s.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(t.key)),e.barset=s,i=this._inGapNextTime(r.from),i?(this._logMessage("Request {0} is in gap, nextTime = {1}".format(t.key,n(1e3*i))),s.nextTime=i):0===s.count()&&(o=this._cache.bars.length&&this._cache.bars[this._cache.bars.length-1].time/1e3)&&r.from>o&&(this._logMessage("Request {0} is in gap, nextTime = {1}".format(t.key,n(1e3*o))),s.nextTime=o||void 0),this._endOfData&&null!==this._leftDate&&t.range.from<=this._leftDate&&(s.endOfData=!0),t.onHistoryCallback(s)},t.prototype._createBarset=function(t){var e=s.lowerbound(this._cache.bars,1e3*t,function(t,e){return t.time<e});return new a.BarSet(this._symbolInfo,this._cache.bars.slice(e))},t.prototype._ensureRequestedTo=function(e){var i,o,r,s=this;if(this._leftDate&&this._leftDate<e)return void this._processNextPendingSubscriber();i=!this._leftDate,this._requesting=!0,o=e,r=this._leftDate?this._leftDate-1:this._symbolInfo.expiration_date||Math.floor(t._now()/1e3),this._leftDate=e,this._logMessage("Requesting data: [{0} ... {1}] ".format(n(1e3*o),n(1e3*r))),this._datafeed.getBars(this._symbolInfo,this._resolution,o,r,function(t,e){s._requesting=!1,s._processBars(t,e)},function(t){s._requesting=!1,s._errorMessage=t||null,s._processNextPendingSubscriber()},i)},t.prototype._processBars=function(t,e){this._checkBars(t),this._alignBarsTime(t),t.length>0?this._processFullBarset(t,e):this._processEmptyBarset(e),this._processNextPendingSubscriber()},t.prototype._processEmptyBarset=function(e){this._logMessage("Receiving bars: barset is empty"),e&&e.nextTime?(this._logMessage("Next time received: `{0}`".format(n(1e3*e.nextTime))),this._addGap(e.nextTime),this._leftDate=Math.min(this._leftDate||t._now()/1e3,e.nextTime+1)):e&&e.noData?(this._logMessage("EOD received"),this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._cache.bars[0].time/1e3)):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned")},t.prototype._processFullBarset=function(t,e){var i=t[0].time,o=t[t.length-1].time;this._logMessage("Receiving bars: total {0} bars in [{1} ... {2}] ".format(t.length,n(i),n(o))),null!==this._leftDate&&i<1e3*this._leftDate&&!l.enabled("cl_feed_return_all_data")&&this._logMessage("Returned more data than needed"),
this._putToCache(t)?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),e&&e.nextTime?console.warn("nextTime should be set when there is no data in the requested period only"):e&&e.noData&&console.warn("noData should be set when there is no data in the requested period and earlier only")},t.prototype._addGap=function(e){var i;this._gaps.find(function(t){return t.from===e})||(i=(this._cache.bars.length?this._cache.bars[0].time:t._now())/1e3,this._gaps.push({from:e,to:i}))},t.prototype._inGapNextTime=function(t){var e=this._gaps.find(function(e){return e.from<t&&e.to>t});return e?e.from:null},t.prototype._getNextSubscriptionId=function(){return this._nextSubscriptionId++},t.prototype._checkBars=function(t,e){var i,o;if(void 0===e&&(e=!1),l.enabled("charting_library_debug_mode"))for(i=1;i<t.length;i++)t[i].time<=t[i-1].time&&(o="Wrong bars time: time {0} of bar {1} should be more than time {2} of bar {3}".format(t[i].time,i,t[i-1].time,i-1),e&&this._dwmAligner&&(o+="\nCheck that you provide DWM bars without time part, i.e. 00:00 GMT"),console.error(o))},t.prototype._putToCache=function(t){if(0===t.length)return!0;if(this._cache.bars.length===t.length&&this._cache.bars[0].time===t[0].time&&this._cache.bars[this._cache.bars.length-1].time===t[t.length-1].time)return this._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!==this._cache.bars.length&&t[t.length-1].time===this._cache.bars[0].time&&this._cache.bars.splice(0,1),0!==this._cache.bars.length&&t[t.length-1].time>=this._cache.bars[0].time){var e=this._cache.bars[this._cache.bars.length-1].time===t[t.length-1].time;if(this._cache.bars=[],!e)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return Array.prototype.unshift.apply(this._cache.bars,t),this._checkBars(this._cache.bars,!0),!0},t.prototype._putToCacheNewBar=function(t){var e=this._cache.bars.length,i=t.time,o=0===e?NaN:this._cache.bars[e-1].time;0===e||o<i?this._cache.bars.push(t):o===i?this._cache.bars[e-1]=t:console.error("putToCacheNewBar: time violation, previous bar time: "+n(o)+" should be less or equal to new time: "+n(i))},t.prototype._alignBarsTime=function(t){if(this._dwmAligner)for(var e=0;e<t.length;e++)t[e].time=this._dwmAligner.tradingDayToSessionStart(t[e].time)},t._now=function(){return Date.now()+6e4},t}(),h=function(){function t(t,e){this._threads={},this._datafeed=t,this._dwmAlignerCreator=e}return t.prototype.destroy=function(){this._forEachThread(function(t,e){return e.destroy()}),this._threads={},delete this._datafeed},t.prototype.purgeCache=function(){this._forEachThread(function(t,e){return e.purgeCache()})},t.prototype.subscribe=function(t,e,i,n,r){var s,a=o(t,e);return this._threads[a]||(this._threads[a]=this._createThread(t,e)),
s=this._threads[a].addSubscription(i,n,r),a+'"'+s},t.prototype.unsubscribe=function(t){var e,i,o=t.split('"');if(2!==o.length)return void console.warn("Wrong guid format");e=o[0],i=parseInt(o[1]),this._threads[e].removeSubscription(i)},t.prototype._createThread=function(t,e){return new c(this._datafeed,t,e,this._dwmAlignerCreator(e,t))},t.prototype._forEachThread=function(t){var e=this;Object.keys(this._threads).forEach(function(i){return t(i,e._threads[i])})},t}(),e.DatafeedRequestsCachedProcessor=h},function(t,e){"use strict";function i(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(),200===e.status?JSON.parse(e.responseText):null}if(Object.defineProperty(e,"__esModule",{value:!0}),window.language){if(!window._tv_languages){var o="localization/translations/"+window.language+".json";window._tv_languages={},window._tv_languages[window.language]=i(o)||{}}}else window.language="en"},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(80),n=function(){function t(){}return t.prototype.main=function(t){var e,i,n,r,s=t.new_var(o.Std.open(t)),a=t.new_var(o.Std.close(t)),l=s.get(1),c=a.get(1),h=o.Std.ohlc4(t),u=o.Std.na(s.get(1))?(o.Std.open(t)+o.Std.close(t))/2:(l+c)/2;return s.set(u),a.set(h),e=o.Std.max(o.Std.high(t),o.Std.max(u,h)),i=o.Std.min(o.Std.low(t),o.Std.min(u,h)),n=o.Std.volume(t),r=t.symbol,[r.time,u,e,i,h,n,r.updatetime,r.isBarClosed]},t}(),e.HeikenAshi=n},function(t,e){"use strict";function i(t){return new Promise(function(e,i){t.subscribe(null,e,!0)})}Object.defineProperty(e,"__esModule",{value:!0}),e.delegateToPromise=i},function(t,e,i){"use strict";function o(t,e,i,n){var r,s,a;if(n=!n||n<1e12?Date.now():n,r=n-t,s=Math.min(i.endValue,i.endValue*i.easing(r/i.duration)),a=s-e,i.onStep(a,s),r>=i.duration)return void(i.onComplete&&i.onComplete());requestAnimationFrame(o.bind(null,t,s,i))}function n(t){t.duration=t.duration||250,t.easing=t.easing||r.easingFunc.easeOutCubic,requestAnimationFrame(o.bind(null,Date.now(),0,t))}Object.defineProperty(e,"__esModule",{value:!0});var r=i(28);e.doAnimate=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tzData={"America/New_York":{
time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1536530400,-1523224800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-76941e4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-17762,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Los_Angeles":{
time:[-2717668378,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-769420800,-765410400,-687995940,-662680800,-620866800,-608162400,-589417200,-576108e3,-557967600,-544658400,-526518e3,-513208800,-495068400,-481759200,-463618800,-450309600,-431564400,-418255200,-400114800,-386805600,-368665200,-355356e3,-337215600,-323906400,-305766e3,-292456800,-273711600,-261007200,-242262e3,-226533600,-210812400,-195084e3,-179362800,-163634400,-147913200,-13158e4,-116463600,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Chicago":{
time:[-2717668236,-1633298400,-1615154400,-1601848800,-1583704800,-1563746400,-1551650400,-1538949600,-1520200800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1067810400,-1045432800,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-769413600,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-21036,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"America/Phoenix":{time:[-2717670498,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-820540740,-812678340,-796867140,-84405600,-68680800,1924966800],offset:[-26898,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"America/Toronto":{
time:[-2366755200,-1632088800,-1615154400,-1601771400,-1583712e3,-1567375200,-1554681600,-1534716e3,-1524088800,-1503266400,-149238e4,-1471816800,-1460930400,-1440972e3,-1428876e3,-1409522400,-1397426400,-1378072800,-1365976800,-1346623200,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1188770400,-1176069600,-1157320800,-1144015200,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-880232400,-76941e4,-765410400,-747266400,-733960800,-715824e3,-702518400,-684374400,-671068800,-652924800,-634176e3,-620863200,-602719200,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-19052,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Vancouver":{
time:[-2713910400,-1632088800,-1615154400,-880236e3,-769420800,-765410400,-747266400,-732751200,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356e3,-337212e3,-323906400,-305762400,-292456800,-273708e3,-261007200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-29548,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Argentina/Buenos_Aires":{time:[-2372112e3,-1567468800,-1233446400,-1222992e3,-1205971200,-1194048e3,-117288e4,-1162512e3,-1141344e3,-1130976e3,-1109808e3,-109944e4,-1078272e3,-1067817600,-1046649600,-1036281600,-1015113600,-1004745600,-983577600,-973209600,-952041600,-941587200,-931046400,-900892800,-890352e3,-83376e4,-82728e4,-752284800,-733795200,-197337600,-190857600,-184204800,-164505600,-152668800,-132969600,-121132800,-101433600,-86832e3,-71107200,-54777600,-39052800,-23328e3,-7603200,128131200,136598400,596937600,605059200,624412800,636508800,656467200,667958400,687916800,699408e3,719366400,731462400,938908800,952041600,1198972800,1205625600,1224374400,1237075200,1924981200],offset:[-14028,-15408,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-10800,-10800,-7200,-10800,-7200,-10800]},"America/El_Salvador":{time:[-1546300800,546998400,559699200,578448e3,591148800,1924970400],offset:[-21408,-21600,-18e3,-21600,-18e3,-21600]},"America/Sao_Paulo":{
time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184e4,-570758400,-560217600,-539136e3,-53136e4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816e3,761702400,782265600,793152e3,813715200,823996800,84456e4,856051200,876096e3,888710400,908064e3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904e3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232e4,1203206400,1224374400,1234656e3,1255824e3,1266710400,1287273600,129816e4,1318723200,1330214400,1350777600,1361059200,1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576e3,1487462400,1508025600,1518912e3,154008e4,1550361600,1571529600,1581811200,1602979200,1613865600,1634428800,1645315200,1665878400,1677369600,1697328e3,1708214400,1729382400,1739664e3,1760832e3,1771718400,1792281600,1803168e3,1823731200,1834617600,1855180800,1866067200,1887235200,1897516800,1918684800,1928966400],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,1924974e3],offset:[-17776,-17776,-18e3,-14400,-18e3]},"America/Caracas":{time:[-2524521600,-1826755200,-157766400,1197169200,1462069800,1924977600],offset:[-16064,-16060,-16200,-14400,-16200,-14400]},"Europe/Moscow":{
time:[-2840140800,-1688256e3,-165681e4,-1641340800,-1627956e3,-1618700400,-1596416400,-1593804521,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1414288800,1925002800],offset:[9017,9017,9079,12679,9079,16279,12679,16279,14400,10800,14400,18e3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,-1182988800,-1178150400,-906854400,-904867200,-85725e4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036e3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],
offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Berlin":{time:[-2422051200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-776556e3,-765925200,-761173200,-748476e3,-733266e3,-717627600,-714603600,-71037e4,-701902800,-684972e3,-670453200,-654127200,-639003600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{
time:[-3852662400,-1691964e3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034e3,-1570399200,-1552165200,-1538344800,-152253e4,-15075e5,-1490562e3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732e3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314e3,-1315778400,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-118998e4,-1175461200,-1159135200,-1143406800,-1126476e3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058e3,-1032127200,-1017608400,-1001282400,-986158800,-969228e3,-950475600,-942012e3,-904514400,-896043600,-875484e3,-864594e3,-844034400,-832539600,-812584800,-798066e3,-781048800,-772059600,-764802e3,-748476e3,-733352400,-719445600,-717026400,-706741200,-699483600,-687996e3,-668034e3,-654732e3,-636584400,-622072800,-605739600,-590623200,-57429e4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422e4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298e3,-306972e3,-291848400,-276732e3,-257979600,-245282400,-22653e4,-213228e3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484e3,-100731600,-88034400,-68677200,-59004e3,-37238400,57726e3,69818400,89175600,101268e3,120625200,132717600,152074800,164167200,183524400,196221600,214974e3,227671200,246423600,259120800,278478e3,290570400,309927600,32202e4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676e3,543978e3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428e3,76473e4,782877600,796179600,814327200,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],
offset:[-75,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Madrid":{time:[-2177452800,-1661734800,-1648425600,-1631926800,-1616889600,-1601254800,-1585353600,-1442451600,-1427673600,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1029114e3,-1017619200,-1002848400,-986169600,-969238800,-954115200,-940208400,-873075600,-862531200,-842835600,-828230400,-811386e3,-796003200,-779936400,-765414e3,-748486800,-733881600,-652323600,-639183600,135126e3,150253200,167180400,181702800,196815600,212547600,22887e4,243997200,260406e3,276051600,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[-884,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Paris":{time:[-2486678340,-1855958340,-1689814800,-1680393600,-1665363600,-1648339200,-1635123600,-1616889600,-1604278800,-158544e4,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1470618e3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224e3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1253494800,-1238371200,-1221440400,-1206921600,-1191200400,-1175472e3,-1160355600,-1143417600,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942012e3,-932432400,-85725e4,-844552800,-828219600,-812498400,-800064e3,-796258800,-781048800,-766616400,196822800,212547600,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Rome":{time:[-3259094400,-2403562204,-1690761600,-168048e4,-1664755200,-1648944e3,-163512e4,-1616889600,-1604275200,-1585526400,-1571011200,-1555286400,-932428800,-85725e4,-844552800,-828219600,-812498400,-798066e3,-781048800,-76671e4,-750895200,-733352400,-719452800,-70191e4,-689205600,-670453200,-114048e3,-103161600,-81993600,-71708400,-50544e3,-40258800,-18489600,-8204400,1296e4,23245200,43804800,54694800,75859200,86749200,107913600,118198800,138758400,149648400,170812800,181098e3,202262400,212547600,233107200,243997200,265161600,276051600,296611200,307501200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[2996,2996,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Warsaw":{time:[-2840140800,-1717027200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1600466400,-1587157200,-1501718400,-931730400,-85725e4,-844552800,-828219600,-812498400,-796600800,-778723200,-762652800,-748483200,-733266e3,-715212e3,-701902800,-684972e3,-670453200,-654127200,-639003600,-397090800,-386805600,-371084400,-355356e3,-334191600,-323301600,-307580400,-291852e3,-271292400,-260402400,-239842800,-228952800,-208393200,-197503200,-176338800,-166053600,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404e3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Istanbul":{time:[-2840140800,-1869868800,-1693699200,-168048e4,-1570406400,-1552176e3,-1538352e3,-1522540800,-1507507200,-1490572800,-1440201600,-1428019200,-1409702400,-1396483200,-931132800,-922752e3,-917827200,-892425600,-875836800,-857347200,-781056e3,-764726400,-744336e3,-733795200,-716428800,-701913600,-684979200,-670464e3,-654134400,-639014400,-621820800,-60696e4,-590025600,-575424e3,-235612800,-228268800,-177724800,-165715200,10540800,23846400,41990400,55296e3,74044800,87350400,107917200,12123e4,133927200,152686800,165369600,183513600,202435200,215568e3,228873600,245808e3,260323200,277257600,308793600,323838e3,340243200,354682800,371692800,386132400,403142400,428457600,433900800,482803200,496713600,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733280400,749008800,764125200,780458400,796179600,811908e3,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301281200,1319947200,1332644400,1351396800,1364698800,1382846400,1396234800,1414296e3,1427598e3,1446955200,1459047600,1473206400,1925002800],offset:[6952,7016,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800]},"Europe/Zurich":{
time:[-3675196800,-2385244800,-904431600,-891122400,-872982e3,-859672800,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2048,1786,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Australia/Sydney":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Australia/Brisbane":{time:[-2366755200,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,625629600,636519600,657079200,667969200,688528800,699418800,1925028e3],offset:[36728,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3]},"Australia/Adelaide":{time:[-2364076800,-2230156800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,637729200,657079200,667969200,688528800,701233200,719978400,731473200,752032800,764132400,783482400,796186800,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,972784800,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
offset:[33260,32400,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800]},"Australia/ACT":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Asia/Almaty":{
time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1925013600],offset:[18468,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,21600,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600]},"Asia/Ashkhabad":{time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,192501e4],offset:[14012,14400,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,18e3,14400,18e3]},"Asia/Tokyo":{time:[-2587678861,-2335219200,-1017792e3,-683762400,-672357600,-654732e3,-640908e3,-620258400,-609458400,-588808800,-578008800,1925024400],offset:[33539,32400,32400,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400]},"Asia/Taipei":{time:[-2335219200,-1017792e3,-766191600,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-639100800,-620784e3,-607564800,-589248e3,-576028800,-562896e3,-541728e3,-528681600,-510192e3,-497145600,-478656e3,-465609600,-449798400,-433987200,-418176e3,-402451200,-38664e4,-370915200,-355104e3,-339379200,-323568e3,-302486400,-291945600,-270950400,-260409600,134006400,149817600,165542400,181353600,299635200,307584e3,1925020800],offset:[29160,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Singapore":{time:[-2177452800,-2038176e3,-1167609600,-1073001600,-894153600,-879638400,-766972800,-138758400,378691200,1925020800],offset:[24925,24925,25200,26400,26400,27e3,32400,27e3,27e3,28800]},"Asia/Shanghai":{time:[-2177452800,-933465600,-923097600,-908755200,-891561600,515548800,52704e4,545184e3,558489600,576633600,589939200,608688e3,621993600,640137600,653443200,671587200,684892800,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Seoul":{time:[-1948752e3,-1830384e3,-1017792e3,-767318400,-498096e3,-462672e3,-451699200,-429753600,-418262400,-399513600,-387417600,-368064e3,-355968e3,-336614400,-324518400,-305164800,-293068800,-264902400,547610400,560919600,57906e4,592369200,1925024400],
offset:[30472,30600,32400,32400,32400,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,32400,36e3,32400,36e3,32400]},"Asia/Tehran":{time:[-1704153600,-757382400,247190400,259286400,277776e3,283996800,290822400,306547200,322444800,338515200,673228800,685497600,701222400,71712e4,732758400,748656e3,764294400,780192e3,795830400,811728e3,827366400,843264e3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768e4,1253577600,1269216e3,1285113600,1300752e3,1316649600,1332288e3,1348185600,1363910400,1379808e3,1395446400,1411344e3,1426982400,144288e4,1458518400,1474416e3,1490140800,1506038400,1521676800,1537574400,1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1679443200,1695340800,1710979200,1726876800,1742601600,1758499200,1774137600,1790035200,1805673600,1821571200,1837209600,1853107200,1868745600,1884643200,1900368e3,1916265600,1931904e3],offset:[12344,12344,12600,14400,18e3,14400,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Dubai":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Kolkata":{time:[-2840140800,-891561600,-872035200,-862617600,-764121600,1925011800],offset:[21208,21200,23400,19800,23400,19800]},"Asia/Hong_Kong":{time:[-2056665600,-907360200,-891635400,-884217600,-766713600,-747952200,-728512200,-717021e3,-694470600,-683757e3,-668032200,-654726600,-636582600,-623277e3,-605133e3,-591827400,-573683400,-559773e3,-542320200,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877e3,-308781e3,-288822600,-277331400,-257373e3,-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509e3,-132784200,-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381e3,9343800,25068600,40793400,56518200,72243e3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371e3,295414200,309324600,1925020800],offset:[27402,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],
offset:[24124,24124,25200]},"Pacific/Auckland":{time:[-3192393600,-1330293600,-1320012e3,-1300658400,-1287352800,-1269208800,-1255903200,-1237759200,-1224453600,-1206309600,-1192399200,-117486e4,-1160949600,-1143410400,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-757382400,152676e3,162356400,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,510116400,530676e3,541566e3,562125600,573620400,59418e4,60507e4,623815200,637729200,655264800,669178800,686714400,700628400,718164e3,732682800,749613600,764132400,781063200,795582e3,812512800,827031600,844567200,858481200,876016800,889930800,907466400,921985200,938916e3,953434800,970365600,984884400,100242e4,1016334e3,1033869600,1047783600,1065319200,1079838e3,1096768800,1111287600,1128218400,1142737200,1159668e3,1174186800,1191117600,1207450800,1222567200,1238900400,1254016800,127035e4,1285466400,1301799600,1316916e3,1333249200,1348970400,1365303600,138042e4,1396753200,1411869600,1428202800,1443319200,1459652400,1474768800,1491102e3,1506218400,1522551600,1538272800,1554606e3,1569722400,1586055600,1601172e3,1617505200,1632621600,1648954800,1664071200,1680404400,1695520800,1712458800,1727575200,1743908400,1759024800,1775358e3,1790474400,1806807600,1821924e3,1838257200,1853373600,1869706800,1885428e3,1901761200,1916877600,1933210800],offset:[41944,41400,45e3,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800]},"Pacific/Chatham":{
time:[-3192393600,-757382400,152678700,162359100,183523500,195018300,215577900,226467900,247027500,257917500,278477100,289367100,309926700,320816700,341376300,352266300,372825900,384320700,404880300,415770300,436329900,447219900,467779500,478669500,499229100,510119100,530678700,541568700,562128300,573623100,594182700,605072700,623817900,637731900,655267500,669181500,686717100,700631100,718166700,732685500,749616300,764135100,781065900,795584700,812515500,827034300,844569900,858483900,876019500,889933500,907469100,921987900,938918700,953437500,970368300,984887100,1002422700,1016336700,1033872300,1047786300,1065321900,1079840700,1096771500,1111290300,1128221100,1142739900,1159670700,1174189500,1191120300,1207453500,1222569900,1238903100,1254019500,1270352700,1285469100,1301802300,1316918700,1333251900,1348973100,1365306300,1380422700,1396755900,1411872300,1428205500,1443321900,1459655100,1474771500,1491104700,1506221100,1522554300,1538275500,1554608700,1569725100,1586058300,1601174700,1617507900,1632624300,1648957500,1664073900,1680407100,1695523500,1712461500,1727577900,1743911100,1759027500,1775360700,1790477100,1806810300,1821926700,1838259900,1853376300,1869709500,1885430700,1901763900,1916880300,1933213500],offset:[44028,44100,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500]},"Pacific/Fakaofo":{time:[-2177452800,1325203200,1925038800],offset:[-41096,-39600,46800]},"Pacific/Honolulu":{time:[-2334139200,-1157320800,-1155470400,-880236e3,-765410400,-712188e3,1924956e3],offset:[-37886,-37800,-34200,-37800,-34200,-37800,-36e3]},"America/Mexico_City":{
time:[-1514763396,-1343091600,-1234828800,-1220317200,-1207180800,-1191369600,-975283200,-963187200,-917136e3,-907372800,-821923200,-810086400,-627523200,-613008e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,989114400,1001815200,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1175392800,1193536800,1207447200,1224986400,1238896800,1256436e3,1270346400,1288490400,1301796e3,131994e4,1333245600,1351389600,13653e5,1382839200,1396749600,1414288800,1428199200,1445738400,1459648800,1477792800,1491098400,1509242400,1522548e3,1540692e3,1554602400,1572141600,1586052e3,1603591200,1617501600,1635645600,1648951200,1667095200,1680400800,1698544800,1712455200,1729994400,1743904800,1761444e3,1775354400,1792893600,1806804e3,1824948e3,1838253600,1856397600,1869703200,1887847200,1901757600,1919296800,1933207200],offset:[-23796,-25200,-21600,-25200,-21600,-25200,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"Africa/Johannesburg":{time:[-2458166400,-2109283200,-860968800,-845244e3,-829519200,-813794400,1924999200],offset:[6720,5400,7200,10800,7200,10800,7200]},"Asia/Kathmandu":{time:[-1577923200,504921600,1925012700],offset:[20476,19800,20700]},"US/Mountain":{
time:[-2717668796,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1538949600,-1534111200,-880236e3,-769417200,-765410400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-25196,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]}}},,,,function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C,P,L,I,k,A,M,E;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(23),n=i(2),r=i(55),s=i(26),a=i(63),l=i(7),c=i(44),h=i(43),u=i(102),d=i(93),p=i(1115),_=i(1108),f=i(472),m=i(1182),g=i(234),v=i(1179),y=i(190),b=i(471),S=i(1109),w=i(1110),T=i(1111),x=i(1112),C=i(1113),P=i(1114),L=i(666),I=i(1205),k={hide:window.t("Hide Drawings Toolbar"),show:window.t("Show Drawings Toolbar")},A=u.onWidget(),M=52,E=function(t){function e(e){var i=t.call(this,e)||this
;return i._grayedTools={},i._handleChangeVisibility=function(t){i.setState({isVisible:t})},i._toggleVisibility=function(){f.isDrawingToolbarVisible.setValue(!f.isDrawingToolbarVisible.value())},i._handleEsc=function(){c.resetToCursor(!0)},c.init(),i._toolsFilter=new p.ToolsFilter(i.props.drawingsAccess),i._filteredLineTools=_.lineTools.map(function(t){return t.filter(function(t){return i._toolsFilter.isToolEnabled(d.lineToolsInfo[t.name].localizedName)})}).filter(function(t){return 0!==t.length}),i._filteredLineTools.forEach(function(t){return t.forEach(function(t){i._grayedTools[t.name]=i._toolsFilter.isToolGrayed(d.lineToolsInfo[t.name].localizedName)})}),i.state={isVisible:f.isDrawingToolbarVisible.value()},i._features={favoriting:!A&&l.enabled("items_favoriting"),multicharts:l.enabled("support_multicharts"),tools:!A||l.enabled("charting_library_base")},i._negotiateResizer(),i}return o.__extends(e,t),e.prototype.componentDidMount=function(){f.isDrawingToolbarVisible.subscribe(this._handleChangeVisibility),r.findDOMNode(this).addEventListener("contextmenu",function(t){return t.preventDefault()})},e.prototype.componentWillUnmount=function(){f.isDrawingToolbarVisible.unsubscribe(this._handleChangeVisibility)},e.prototype.componentDidUpdate=function(t,e){var i=this.state.isVisible;i!==e.isVisible&&(h.emit("toggle_sidebar",!i),a.setValue("ChartDrawingToolbarWidget.visible",i),this._negotiateResizer())},e.prototype.render=function(){var t,e,i=this,o=this.props,r=o.bgColor,a=o.chartWidgetCollection,l=o.readOnly,h=this.state.isVisible;return n.createElement("div",{className:L.drawingToolbar,style:{backgroundColor:r&&"#"+r}},n.createElement(m.Scroll,{onScroll:y.globalClosePopupMenu,isVisibleButtons:!0,isVisibleScrollbar:!1},n.createElement("div",{className:s(L.inner,(t={},t[L.isHidden]=!h,t))},!l&&n.createElement("div",null,this._filteredLineTools.map(function(t,e){return n.createElement(C.ToolDropdownDrawings,{chartWidgetCollection:a,favoriting:i._features.favoriting,grayedTools:i._grayedTools,key:e,lineTools:t})}),this._toolsFilter.isToolEnabled("Font Icons")&&n.createElement(S.ToolButtonFontIcons,{isGrayed:this._grayedTools["Font Icons"],toolName:"LineToolIcon"}),n.createElement("div",{className:L.separator}),n.createElement(T.ToolButtonTool,{toolName:"measure"}),n.createElement(T.ToolButtonTool,{toolName:"zoom"}),n.createElement(x.ToolButtonZoomOut,{chartWidgetCollection:a}),n.createElement("div",{className:L.separator}),n.createElement(w.ToolButtonProperty,{property:c.properties().magnet,saveDefaultOnChange:!0,toolName:"magnet"}),this._features.tools&&n.createElement(w.ToolButtonProperty,{property:c.properties().stayInDrawingMode,saveDefaultOnChange:!0,toolName:"drawginmode"}),this._features.tools&&n.createElement(w.ToolButtonProperty,{property:c.lockDrawings(),toolName:"lockAllDrawings"}),this._features.tools&&n.createElement(w.ToolButtonProperty,{property:c.hideAllDrawings(),toolName:"hideAllDrawings"}),this._features.tools&&this._features.multicharts&&n.createElement(w.ToolButtonProperty,{
property:c.drawOnAllCharts(),saveDefaultOnChange:!0,toolName:"SyncDrawing"}),this._features.tools&&n.createElement("div",{className:L.separator}),this._features.tools&&n.createElement(b.ToolButtonAction,{action:function(){return i._activeChartWidget().showSourceProperties()},toolName:"showObjectsTree"}),this._features.tools&&n.createElement(P.ToolDropdownRemove,{chartWidgetCollection:a,toolName:"removeAllDrawingTools"})))),n.createElement("div",{className:s(L.toggleButton,"apply-common-tooltip common-tooltip-vertical",(e={},e[L.willOpen]=!h,e)),dangerouslySetInnerHTML:{__html:I},onClick:this._toggleVisibility,title:h?k.hide:k.show}),n.createElement(g.KeyboardDocumentListener,{keyCode:v.KeyCode.Escape,handler:this._handleEsc}))},e.prototype._activeChartWidget=function(){return this.props.chartWidgetCollection.activeChartWidget.value()},e.prototype._negotiateResizer=function(){this.props.resizerBridge.negotiateWidth(this.state.isVisible?M:0)},e}(n.PureComponent),e.DrawingToolbar=E},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.lineTools=[[{name:"cursor"},{name:"dot"},{name:"arrow"},{name:"eraser"}],[{name:"LineToolTrendLine"},{name:"LineToolTrendAngle"},{name:"LineToolHorzLine",shortcut:{keys:"Alt+H",immediately:!0}},{name:"LineToolHorzRay"},{name:"LineToolVertLine",shortcut:{keys:"Alt+V",immediately:!0}},{name:"LineToolArrow"},{name:"LineToolRay"},{name:"LineToolExtended"},{name:"LineToolParallelChannel"},{name:"LineToolDisjointAngle"},{name:"LineToolFlatBottom"}],[{name:"LineToolPitchfork"},{name:"LineToolSchiffPitchfork2"},{name:"LineToolSchiffPitchfork"},{name:"LineToolInsidePitchfork"},{name:"LineToolPitchfan"},{name:"LineToolGannSquare"},{name:"LineToolGannComplex"},{name:"LineToolGannFan"},{name:"LineToolFibRetracement"},{name:"LineToolTrendBasedFibExtension"},{name:"LineToolFibSpeedResistanceFan"},{name:"LineToolFibTimeZone"},{name:"LineToolTrendBasedFibTime"},{name:"LineToolFibCircles"},{name:"LineToolFibSpiral"},{name:"LineToolFibSpeedResistanceArcs"},{name:"LineToolFibWedge"},{name:"LineToolFibChannel"}],[{name:"LineToolBrush"},{name:"LineToolRectangle"},{name:"LineToolRotatedRectangle"},{name:"LineToolEllipse"},{name:"LineToolTriangle"},{name:"LineToolPolyline"},{name:"LineToolBezierQuadro"},{name:"LineToolBezierCubic"},{name:"LineToolArc"}],[{name:"LineToolText"},{name:"LineToolTextAbsolute"},{name:"LineToolNote"},{name:"LineToolNoteAbsolute"},{name:"LineToolCallout"},{name:"LineToolBalloon"},{name:"LineToolPriceLabel"},{name:"LineToolArrowMarkLeft"},{name:"LineToolArrowMarkRight"},{name:"LineToolArrowMarkUp"},{name:"LineToolArrowMarkDown"},{name:"LineToolFlagMark"}],[{name:"LineTool5PointsPattern"},{name:"LineToolCypherPattern"},{name:"LineToolABCD"},{name:"LineToolTrianglePattern"},{name:"LineToolThreeDrivers"},{name:"LineToolHeadAndShoulders"},{name:"LineToolElliottImpulse"},{name:"LineToolElliottTriangle"},{name:"LineToolElliottTripleCombo"},{name:"LineToolElliottCorrection"},{name:"LineToolElliottDoubleCombo"},{name:"LineToolCircleLines"},{name:"LineToolTimeCycles"},{
name:"LineToolSineLine"}],[{name:"LineToolRiskRewardLong"},{name:"LineToolRiskRewardShort"},{name:"LineToolPrediction"},{name:"LineToolDateRange"},{name:"LineToolPriceRange"},{name:"LineToolDateAndPriceRange"},{name:"LineToolBarsPattern"},{name:"LineToolGhostFeed"},{name:"LineToolProjection"}]]},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(23),n=i(2),r=i(43),s=i(63),a=i(409),l=i(44),c=i(485),h=i(93),u=i(307),d=i(190),p=i(1181),_=i(667),f={icon:window.t("Icon")},m=10,g=function(t){function e(e){var i=t.call(this,e)||this;return i._renderItem=function(t){return n.createElement("div",{className:_.item,key:t,onClick:function(){i._handleSelect(t),d.globalClosePopupMenu()}},String.fromCharCode(t))},i._onChangeDrawingState=function(){i.setState({isActive:i._isActive()})},i._handleSelect=function(t){var e,n;a.saveDefaults("linetoolicon",o.__assign({},a.defaults("linetoolicon"),{icon:t})),l.tool.setValue("LineToolIcon"),e=i.state.recents,n=e.indexOf(t),-1!==n&&e.splice(n,1),e=[t].concat(e.slice(0,m-1)),s.setJSON("linetoolicon.recenticons",e),i.setState({current:t,recents:e})},i.state={current:a.defaults("linetoolicon").icon,recents:s.getJSON("linetoolicon.recenticons")||[]},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){l.tool.subscribe(this._onChangeDrawingState),s.onSync.subscribe(this,this._onSyncSettings)},e.prototype.componentWillUnmount=function(){l.tool.unsubscribe(this._onChangeDrawingState),s.onSync.unsubscribe(this,this._onSyncSettings)},e.prototype.render=function(){var t=this,e=this.props,i=e.isGrayed,o=e.toolName,s=this.state,a=s.current,l=s.isActive,d=s.recents;return n.createElement(u.ToolDropdown,{buttonClass:_.button,buttonIcon:n.createElement("div",{className:_.buttonIcon},String.fromCharCode(a||c.availableIcons[0])),buttonTitle:f.icon,isActive:l,isGrayed:i,menuItems:(d?[n.createElement("div",{className:_.wrap},d.map(this._renderItem)),n.createElement(p.PopupMenuSeparator,null)]:[]).concat([n.createElement("div",{className:_.wrap},c.availableIcons.map(this._renderItem))]),onClickButton:function(){return t._handleSelect(a||c.availableIcons[0])},onClickWhenGrayed:function(){return r.emit("onGrayedObjectClicked",{type:"drawing",name:h.lineToolsInfo[o].localizedName})}})},e.prototype._isActive=function(){return l.tool.value()===this.props.toolName},e.prototype._onSyncSettings=function(){this.setState({recents:s.getJSON("linetoolicon.recenticons")})},e}(n.Component),e.ToolButtonFontIcons=g},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(2),r=i(93),s=i(11),a=i(227),l=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClick=function(){i.props.saveDefaultOnChange&&s.saveDefaultProperties(!0),i.props.property.setValue(!i.props.property.value()),i.props.saveDefaultOnChange&&s.saveDefaultProperties(!1)},i.state={isActive:i.props.property.value()},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){
this.props.property.subscribe(this,this._onChange)},e.prototype.componentWillUnmount=function(){this.props.property.unsubscribe(this,this._onChange)},e.prototype.render=function(){var t=this.props.toolName,e=this.state.isActive,i=r.lineToolsInfo[t];return n.createElement(a.ToolButton,{icon:e&&i.iconActive?i.iconActive:i.icon,isActive:e,onClick:this._handleClick,title:i.localizedName})},e.prototype._onChange=function(t){this.setState({isActive:t.value()})},e}(n.PureComponent),e.ToolButtonProperty=l},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(2),r=i(44),s=i(93),a=i(227),l=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClick=function(){r.tool.setValue(i.props.toolName)},i._onChange=function(){i.setState({isActive:r.tool.value()===i.props.toolName})},i.state={isActive:r.tool.value()===i.props.toolName},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){r.tool.subscribe(this._onChange)},e.prototype.componentWillUnmount=function(){r.tool.unsubscribe(this._onChange)},e.prototype.render=function(){var t=this.props.toolName,e=this.state.isActive;return n.createElement(a.ToolButton,{icon:s.lineToolsInfo[t].icon,isActive:e,isTransparent:!0,onClick:this._handleClick,title:s.lineToolsInfo[t].localizedName})},e}(n.PureComponent),e.ToolButtonTool=l},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(2),r=i(46),s=i(471),a=i(668),l=i(28),c=function(t){function e(e){var i=t.call(this,e)||this;return i._boundUndoModel=null,i._handleClick=function(){var t=i._activeChartWidget().model();t&&t.zoomFromViewport()},i._syncUnzoomButton=function(){var t=i._activeChartWidget(),e=t.model(),o=!1;e?(i._boundUndoModel!==e&&(i._boundUndoModel&&i._boundUndoModel.zoomStack().onChange().unsubscribe(null,i._syncUnzoomButton),e.zoomStack().onChange().subscribe(null,i._syncUnzoomButton),i._boundUndoModel=e),o=!e.zoomStack().isEmpty()):t.withModel(null,i._syncUnzoomButton),i.setState({isVisible:o})},i.state={isVisible:!1},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){this.props.chartWidgetCollection.activeChartWidget.subscribe(this._syncUnzoomButton,{callWithLast:!0})},e.prototype.componentWillUnmount=function(){this.props.chartWidgetCollection.activeChartWidget.unsubscribe(this._syncUnzoomButton)},e.prototype.render=function(){return n.createElement(r.CSSTransitionGroup,{transitionName:{enter:a.enter,enterActive:a.enterActive,leave:a.leave},transitionEnter:!0,transitionEnterTimeout:l.dur/2,transitionLeave:!0,transitionLeaveTimeout:.75*l.dur},this.state.isVisible&&n.createElement("div",{key:"button",className:a.item},n.createElement(s.ToolButtonAction,{action:this._handleClick,isTransparent:!0,toolName:"zoom-out"})))},e.prototype._activeChartWidget=function(){return this.props.chartWidgetCollection.activeChartWidget.value()},e}(n.PureComponent),e.ToolButtonZoomOut=c},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),
n=i(2),r=i(44),s=i(43),a=i(93),l=i(489),c=i(307),h=i(1178),u=i(508),d=i(1183),p=i(190),_=function(t){function e(e){var i,n=t.call(this,e)||this;return n._onChangeDrawingState=function(){var t=n._getActiveToolIndex();n.setState({current:-1!==t?t:n.state.current,isActive:-1!==t})},n._handleClickItem=function(t){n._handleSelect(t),p.globalClosePopupMenu()},n._handleSelect=function(t){r.tool.setValue(t)},n._handleGrayedClick=function(t){s.emit("onGrayedObjectClicked",{type:"drawing",name:a.lineToolsInfo[t].localizedName})},n._handleShortcut=function(t){var e=n.props.lineTools.find(function(e){return e.name===t}),i=e&&e.shortcut;i&&i.immediately?n._drawLinetoolImmediately(t):n._handleSelect(t)},n._drawLinetoolImmediately=function(t){var e=n.props.chartWidgetCollection.activeChartWidget.value();e.activePaneWidget&&e.activePaneWidget.drawRightThere(t)},n._handleClickFavorite=function(t){n.state.favState&&n.state.favState[t]?l.LinetoolsFavoritesStore.removeFavorite(t):l.LinetoolsFavoritesStore.addFavorite(t)},n._onAddFavorite=function(t){n.setState({favState:o.__assign({},n.state.favState,(e={},e[t]=!0,e))});var e},n._onRemoveFavorite=function(t){n.setState({favState:o.__assign({},n.state.favState,(e={},e[t]=!1,e))});var e},n._onSyncFavorites=function(){n.setState({favState:n._composeFavState()})},i=n._getActiveToolIndex(),n.state={current:-1===i?n._firstNonGrayedTool():i,favState:n._composeFavState(),isActive:-1!==i},n}return o.__extends(e,t),e.prototype.componentDidMount=function(){r.tool.subscribe(this._onChangeDrawingState),l.LinetoolsFavoritesStore.favoriteAdded.subscribe(null,this._onAddFavorite),l.LinetoolsFavoritesStore.favoriteRemoved.subscribe(null,this._onRemoveFavorite),l.LinetoolsFavoritesStore.favoritesSynced.subscribe(null,this._onSyncFavorites)},e.prototype.componentWillUnmount=function(){r.tool.unsubscribe(this._onChangeDrawingState),l.LinetoolsFavoritesStore.favoriteAdded.unsubscribe(null,this._onAddFavorite),l.LinetoolsFavoritesStore.favoriteRemoved.unsubscribe(null,this._onRemoveFavorite),l.LinetoolsFavoritesStore.favoritesSynced.unsubscribe(null,this._onSyncFavorites)},e.prototype.componentDidUpdate=function(t,e){t.lineTools!==this.props.lineTools&&this.setState({favState:this._composeFavState()})},e.prototype.render=function(){var t=this,e=this.props,i=e.favoriting,o=e.grayedTools,r=e.lineTools,s=this.state,l=s.current,p=s.favState,_=s.isActive,f=r[l||0].name,m=a.lineToolsInfo[f],g=this._showHint();return n.createElement("span",null,n.createElement(c.ToolDropdown,{buttonIcon:m.icon,buttonTitle:m.localizedName,isActive:_,menuItems:r.map(function(e,r){var s=e.name,c=a.lineToolsInfo[s],d=o[s];return n.createElement(u.PopupMenuItemString,{forceShowHint:g,hint:e.shortcut&&e.shortcut.keys,icon:c.icon,isActive:_&&l===r,isDisabled:d,label:c.localizedName,onClick:d?t._handleGrayedClick:t._handleClickItem,onClickArg:s,showToolboxOnHover:!p[s],toolbox:i&&!d?n.createElement(h.FavoriteButtonString,{isFilled:p[s],onClick:t._handleClickFavorite,onClickArg:s}):void 0})}),onClickButton:function(){
return t._handleSelect(f)}}),r.map(function(e,i){var o=e.name,r=e.shortcut;return r&&n.createElement(d.Shortcut,{handler:function(e){e.preventDefault(),t._handleShortcut(o)},key:o,keys:r.keys})}))},e.prototype._firstNonGrayedTool=function(){var t=this.props,e=t.grayedTools;return t.lineTools.findIndex(function(t){return!e[t.name]})},e.prototype._getActiveToolIndex=function(){return this.props.lineTools.findIndex(function(t){return t.name===r.tool.value()})},e.prototype._showHint=function(){return this.props.lineTools.some(function(t){return"shortcut"in t})},e.prototype._composeFavState=function(){var t={};return this.props.lineTools.forEach(function(e){t[e.name]=l.LinetoolsFavoritesStore.isFavorite(e.name)}),t},e}(n.PureComponent),e.ToolDropdownDrawings=_},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(23),n=i(2),r=i(93),s=i(307),a=i(190),l=i(508),c={all:window.t("Remove Drawing Tools & Indicators"),drawings:window.t("Remove Drawing Tools"),studies:window.t("Remove Indicators")},h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleRemoveDrawings=function(){e.props.chartWidgetCollection.activeChartWidget.value().removeAllDrawingTools(),a.globalClosePopupMenu()},e._handleRemoveStudies=function(){e.props.chartWidgetCollection.activeChartWidget.value().removeAllStudies(),a.globalClosePopupMenu()},e._handleRemoveAll=function(){e.props.chartWidgetCollection.activeChartWidget.value().removeAllStudiesDrawingTools(),a.globalClosePopupMenu()},e}return o.__extends(e,t),e.prototype.render=function(){return n.createElement(s.ToolDropdown,{buttonIcon:r.lineToolsInfo[this.props.toolName].icon,buttonTitle:c.drawings,menuItems:[n.createElement(l.PopupMenuItem,{label:c.drawings,onClick:this._handleRemoveDrawings}),n.createElement(l.PopupMenuItem,{label:c.studies,onClick:this._handleRemoveStudies}),n.createElement(l.PopupMenuItem,{label:c.all,onClick:this._handleRemoveAll})],onClickButton:this._handleRemoveDrawings})},e}(n.PureComponent),e.ToolDropdownRemove=h},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this._drawingsAccess=t||{tools:[],type:"black"}}return t.prototype.isToolEnabled=function(t){var e=this._findTool(t);return!(!e||!e.grayed)||("black"===this._drawingsAccess.type?!e:!!e)},t.prototype.isToolGrayed=function(t){var e=this._findTool(t);return!(!e||!e.grayed)},t.prototype._findTool=function(t){return this._drawingsAccess.tools.find(function(e){return e.name===t})},t}();e.ToolsFilter=i},function(t,e,i){(function(t){"use strict";var o,n,r,s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(22),i(54),i(90),i(23),n=i(475),r=i(489),s=i(73),a=i(131),l=i(44),c=i(93),h=i(63),u=i(51),i(633),d='<span class="tv-favorited-drawings-toolbar__widget {{#isActive}}i-active{{/isActive}} apply-common-tooltip" title="{{title}}">{{{icon}}}</span>',p=function(e){function i(t){var i=e.call(this,{allowSortable:!Modernizr.touch,defaultPosition:t,
positionSettingsKey:"chart.favoriteDrawingsPosition"})||this;return i._linetoolsWidgets={},i._canBeShownValue=new u(!1),i._attachHandlers(),i._loadVisibilityState(),i}return o.__extends(i,e),i.prototype.show=function(){this._canBeShownValue.value()&&(h.setValue(i._visibilitySettingsKey,!0),this.isVisible()||this._renderAllLinetools(),e.prototype.show.call(this))},i.prototype.hide=function(){h.setValue(i._visibilitySettingsKey,!1),e.prototype.hide.call(this)},i.prototype.canBeShown=function(){return this._canBeShownValue.readonly()},i.prototype._onFavoriteAdded=function(t){this._canBeShownValue.setValue(!0),this.addWidget(this._createLinetoolWidget(t)),this.show()},i.prototype._onFavoriteRemoved=function(t){this.removeWidget(this._linetoolsWidgets[t]),delete this._linetoolsWidgets[t],0===r.LinetoolsFavoritesStore.favoritesCount()&&(this._canBeShownValue.setValue(!1),this.hide())},i.prototype._onFavoriteMoved=function(){this._renderAllLinetools()},i.prototype._onSelectedLinetoolChanged=function(t){var e=this;Object.keys(this._linetoolsWidgets).forEach(function(i){e._linetoolsWidgets[i].classList.toggle("i-active",t===i)})},i.prototype._createLinetoolWidget=function(e){var i=$(t.render(d,{icon:c.lineToolsInfo[e].icon,isActive:e===l.tool.value(),title:c.lineToolsInfo[e].localizedName}))[0];return i.addEventListener("click",function(t){t.preventDefault(),l.tool.value()===e?l.resetToCursor():l.tool.setValue(e)}),this._linetoolsWidgets[e]=i,i},i.prototype._renderAllLinetools=function(){var t=this;this._linetoolsWidgets={},this.removeWidgets(),r.LinetoolsFavoritesStore.favorites().forEach(function(e){t.addWidget(t._createLinetoolWidget(e))})},i.prototype._attachHandlers=function(){var t=this;r.LinetoolsFavoritesStore.favoriteAdded.subscribe(this,this._onFavoriteAdded),r.LinetoolsFavoritesStore.favoriteRemoved.subscribe(this,this._onFavoriteRemoved),r.LinetoolsFavoritesStore.favoriteMoved.subscribe(this,this._onFavoriteMoved),r.LinetoolsFavoritesStore.favoritesSynced.subscribe(null,function(){t._loadVisibilityState(),t._renderAllLinetools()}),this.onWidgetsReordered().subscribe(this,function(e,i){if(r.LinetoolsFavoritesStore.favoriteMoved.unsubscribe(t,t._onFavoriteMoved),!r.LinetoolsFavoritesStore.moveFavorite(r.LinetoolsFavoritesStore.favorite(e),i))throw Error("Something went wrong");r.LinetoolsFavoritesStore.favoriteMoved.subscribe(t,t._onFavoriteMoved)}),this.onContextMenu(function(e){e.preventDefault();var i=new s.Action({text:$.t("Hide Favorite Drawings Toolbar")});i.callbacks().subscribe(null,function(){t.hide()}),a.createMenu([i]).show(e)}),l.tool.subscribe(this._onSelectedLinetoolChanged.bind(this))},i.prototype._loadVisibilityState=function(){var t,e=r.LinetoolsFavoritesStore.favoritesCount()>0;this._canBeShownValue.setValue(e),t=h.getBool(i._visibilitySettingsKey,!0),t&&e?this.show():this.hide()},i._visibilitySettingsKey="ChartFavoriteDrawingToolbarWidget.visible",i}(n.FloatingToolbar),e.FavoriteDrawingToolbar=p}).call(e,i(54))},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{
value:!0}),o=i(5),n=i(21),r=i(475),s=i(20),i(200),i(635),a=function(t){function e(i){var o=t.call(this,e._prepareOptions(i))||this;return o._onWidgetStateChangedDelegate=new s,o._statedWidgets=[],o._currentPopup=null,o._onWindowClickedListener=o._onWindowClicked.bind(o),o}return o.__extends(e,t),e.prototype.show=function(){t.prototype.show.call(this),document.addEventListener("mousedown",this._onWindowClickedListener)},e.prototype.hide=function(){t.prototype.hide.call(this),document.removeEventListener("mousedown",this._onWindowClickedListener)},e.prototype.destroy=function(){this._closePopup(),t.prototype.destroy.call(this)},e.prototype.addGroupedWidget=function(t,i){var o,r,s;void 0===i&&(i={}),n.assert(t.states.length>0&&-1!==e._getStateIndexById(t,t.currentStateId),"Argument is invalid (count: "+t.states.length+", state: "+t.currentStateId+")"),o=document.createElement("div"),o.className="tv-grouped-floating-toolbar__widget-wrapper apply-common-tooltip",t.widgetAddClass&&o.classList.add(t.widgetAddClass),o.setAttribute("title",t.tooltip),r={isEnabled:!0,statedWidget:t,toolbarWidget:o},s=this._onWidgetClicked.bind(this,r),r.clickListener=s,o.addEventListener("click",s),this._updateWidgetPreview(r),this.addWidget(o,i),this._statedWidgets.push(r)},e.prototype.removeGroupedWidget=function(t){var e,i,o=this._statedWidgets.length;for(e=0;e<o;++e)if(i=this._statedWidgets[e],i.statedWidget.id===t)return this._isPopupCreatedForWidget(t)&&this._closePopup(),i.toolbarWidget.removeEventListener("click",i.clickListener),this.removeWidget(i.toolbarWidget),this._statedWidgets.splice(e,1),void this._updatePopupPosition();n.assert(!1,"Unknown groupId("+t+")")},e.prototype.updateGroupedWidget=function(t,e){this._closePopup();var i=this._ensuredGetWidgetDataForId(t);i.statedWidget.currentStateId=e.currentStateId,i.statedWidget.states=e.states,this._updateWidgetPreview(i)},e.prototype.setGroupedWidgetEnabled=function(t,e){var i=this._ensuredGetWidgetDataForId(t);i.isEnabled=e,i.toolbarWidget.classList.toggle("i-disabled",!e)},e.prototype.setGroupedWidgetState=function(t,i){var o=this._ensuredGetWidgetDataForId(t);n.assert(-1!==e._getStateIndexById(o.statedWidget,i),"Unknown stateId ("+i+")"),o.statedWidget.currentStateId=i,this._updateSubWidgetsState(o.statedWidget),this._updateWidgetPreview(o)},e.prototype.onWidgetStateChanged=function(){return this._onWidgetStateChangedDelegate},e.prototype._onVerticalChanged=function(t,e){this._updatePopupPosition()},e.prototype._ensuredGetWidgetDataForId=function(t){var e,i,o;for(e=0,i=this._statedWidgets;e<i.length;e++)if(o=i[e],o.statedWidget.id===t)return o;throw Error("Unknown groupId("+t+")")},e.prototype._onWidgetClicked=function(t,e){var i=this._currentPopup&&this._isPopupCreatedForWidget(t.statedWidget.id);this._closePopup(),!i&&t.isEnabled&&this._createPopup(t)},e.prototype._createPopup=function(t){var e,i=this,o={createdFor:t.toolbarWidget,element:document.createElement("div"),stateWidgetId:t.statedWidget.id,widgets:[]}
;o.element.className+="tv-grouped-floating-toolbar__popup js-popup",e=t.statedWidget.states.length,t.statedWidget.states.forEach(function(n,r){var s=i._createSubWidget(t,n),a=i._onSubWidgetClicked.bind(i,t,n.id);s.addEventListener("click",a),o.widgets.push({clickListener:a,stateWidget:n,widget:s}),s.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-right-"+r),s.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-left-"+(e-r+1)),o.element.appendChild(s)}),this._currentPopup=o,this._updateSubWidgetsState(t.statedWidget),t.toolbarWidget.classList.add("i-dropped"),this._getWidget().appendChild(this._currentPopup.element),Promise.resolve().then(function(){i._currentPopup&&i._currentPopup.element.classList.add("i-opened")}),this._updatePopupPosition()},e.prototype._closePopup=function(){var t,e,i=this;this._statedWidgets.forEach(function(t){t.toolbarWidget.classList.remove("i-dropped")}),this._currentPopup&&(t=this._currentPopup.widgets,e=this._currentPopup.element,this._currentPopup=null,t.forEach(function(t){t.widget.removeEventListener("click",t.clickListener)}),e.classList.remove("i-opened"),e.addEventListener("transitionend",function(t){t.target===e&&i._getWidget().removeChild(e)}))},e.prototype._updateWidgetPreview=function(t){var i,o=e._getStateIndexById(t.statedWidget,t.statedWidget.currentStateId);n.assert(-1!==o,"Unknown state id: "+t.statedWidget.currentStateId),i=t.statedWidget.states[o].widget.cloneNode(!0),t.toolbarWidget.firstChild?t.toolbarWidget.replaceChild(i,t.toolbarWidget.firstChild):(t.toolbarWidget.appendChild(i),t.toolbarWidget.appendChild(e._createCaret()))},e.prototype._updateSubWidgetsState=function(t){this._currentPopup&&this._isPopupCreatedForWidget(t.id)&&this._currentPopup.widgets.forEach(function(i){i.widget.classList.toggle(e._activeSubWidgetClass,i.stateWidget.id===t.currentStateId)})},e.prototype._updatePopupPosition=function(){var t,e,i,o,n,r,s,a;if(this._currentPopup){if(t=this._currentPopup.createdFor,e=this._getWidget().getBoundingClientRect(),!(i=this._findWrapperForWidget(t))||!this._currentPopup)throw Error("Toolbar has no wrapper for preview's widget or there is no popup");o=i.getBoundingClientRect(),n=this._currentPopup.element.getBoundingClientRect(),r=this._currentPopup.element,this.isVertical()?(r.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),r.style.top=o.top-e.top+1+"px",r.style.left="",e.left>window.innerWidth-e.right?r.classList.add("tv-grouped-floating-toolbar__popup--at-left"):r.classList.remove("tv-grouped-floating-toolbar__popup--at-left")):(r.classList.remove("tv-grouped-floating-toolbar__popup--at-left"),s=o.left+n.width,a=0,s>window.innerWidth?e.left+n.width>window.innerWidth&&(a=e.width-n.width):a=o.left-e.left+1,r.style.left=a+"px",e.bottom+n.height>window.innerHeight?r.classList.add("tv-grouped-floating-toolbar__popup--at-top"):(r.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),r.style.top=""))}},e.prototype._isPopupCreatedForWidget=function(t){return!(!this._currentPopup||this._currentPopup.stateWidgetId!==t)
},e.prototype._createSubWidget=function(t,e){var i=document.createElement("div");return i.className+="tv-grouped-floating-toolbar__sub-widget",t.statedWidget.stateWidgetAddClass&&i.classList.add(t.statedWidget.stateWidgetAddClass),i.appendChild(e.widget),i},e.prototype._onSubWidgetClicked=function(t,e){this._closePopup(),t.statedWidget.currentStateId!==e&&(this.setGroupedWidgetState(t.statedWidget.id,e),this._onWidgetStateChangedDelegate.fire(t.statedWidget.id,e))},e.prototype._onWindowClicked=function(t){if(this.isVisible()&&this._currentPopup&&!e._isEventInElement(t,this._currentPopup.element)){for(var i=0;i<this._statedWidgets.length;++i)if(e._isEventInElement(t,this._statedWidgets[i].toolbarWidget))return;this._closePopup()}},e._getStateIndexById=function(t,e){for(var i=0;i<t.states.length;++i)if(t.states[i].id===e)return i;return-1},e._createCaret=function(){var t=document.createElement("div");return t.className="tv-caret tv-caret--small tv-caret--colored tv-grouped-floating-toolbar__caret",t},e._prepareOptions=function(t){var e=" tv-grouped-floating-toolbar";return t.addClass?t.addClass+=e:t.addClass=e,t},e._isEventInElement=function(t,e){return t.target===e||e.contains(t.target)},e._activeSubWidgetClass="tv-grouped-floating-toolbar__sub-widget--current",e}(r.FloatingToolbar),e.GroupButtonFloatingToolbar=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(1165);$.fn.lastCharSup=function(){for(var t=0;t<this.size();t++)o.lastCharSup(this.get(t));return this}},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),i(22),o=i(161),n=i(802),r=i(697),s=i(181),a=i(63),l=i(7),c=function(){function t(){var e=this;this._savedCharts=[],window.loginStateChange.subscribe(this,function(){e._refreshSavedChartsList()}),s.TVXWindowEvents.on("saved-charts-change",this._otherTabUpdated.bind(this)),s.TVXWindowEvents.on("saved-charts-change-favorites",this._favoritesUpdated.bind(this)),this._favorites=a.getJSON(t._favoritesKey,{})}return t.prototype.signInOrLoadChart=function(){l.enabled("saveload_requires_authentication")?runOrSignIn(this.loadMenu.bind(this),{source:"Load chart",sourceMeta:"Chart"}):this.loadMenu()},t.prototype.loadMenu=function(){var t,e=this;return this._loadChartDialog||(this._loadChartDialog=new n),t=this._loadChartDialog,t.show(this._getLoadMenuCharts(),this._favorites),this._refreshSavedChartsList().then(function(){t.updateChartsAndFavoritesData(e._getLoadMenuCharts(),e._favorites)})},t.prototype._refreshSavedChartsList=function(){var t,e=this;return t=l.enabled("saveload_requires_authentication")&&!window.is_authenticated?Promise.resolve([]):new Promise(function(t,e){o.getCharts(t,e)}),t.then(function(t){e._savedCharts=t,s.TVXWindowEvents.emit("saved-charts-change",JSON.stringify(t))})},t.prototype._fastDelete=function(t,e){this._savedCharts.splice(e,1)},t.prototype._chartIsActive=function(t){return!1},t.prototype._getLoadMenuCharts=function(){var e=this;return this._savedCharts.map(function(i,n){return{id:i.id,url:i.url,
title:i.name,symbol:i.short_symbol,interval:i.interval,toolsCount:0,modified:i.modified_iso,active:e._chartIsActive.bind(e,i.id),openAction:function(){return o.loadChart(i)},deleteAction:function(t,o){r.deleteChart(o,i.image_url,function(){e._fastDelete(i.id,n),s.TVXWindowEvents.emit("saved-charts-change",JSON.stringify(e._savedCharts)),t.resolve()},t.reject.bind(t))},favoriteAction:function(i){e._favorites=i,a.setJSON(t._favoritesKey,i),s.TVXWindowEvents.emit("saved-charts-change-favorites",JSON.stringify(i))}}})},t.prototype._favoritesUpdated=function(t){this._favorites=JSON.parse(t),this._loadChartDialog&&this._loadChartDialog.updateFavoritesData(this._favorites)},t.prototype._otherTabUpdated=function(t){this._savedCharts=JSON.parse(t),this._loadChartDialog&&this._loadChartDialog.updateChartsData(this._getLoadMenuCharts())},t._favoritesKey="loadChartDialog.favorites",t}(),e.LoadChartWidget=c},,,,,,function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(22),o=i(51),n=i(310),r=i(1127),s=i(1128),a=i(7),l=function(){function t(t){var e=this;if(this._$body=$(t.body.value()),0===this._$body.size())throw Error("bridge.body.value() must be an element or not empty jQuery object");this._availableAreas=["left","dompanel","right","top","footer","bottom","center"],this._areas={},this._bridge=t,this._width=t.width,this._height=t.height,this._visible=t.visible,this._width.subscribe(function(){return e.recalculate()}),this._height.subscribe(function(){return e.recalculate()}),this._bridge.visible.subscribe(function(){return e._updateVisibility()}),this._bridge.fullscreen.subscribe(function(){return e._onParentFullscreenChange()}),this.recalculate()}return t.prototype.allocate=function(t){var e,i,a=this,l=t&&t.areaName;if(-1===this._availableAreas.indexOf(l))throw Error("unknown options.areaName");return this.free(l),e=this._createDOM(l),i={canNegotiate:{width:"left"===l||"right"===l||"dompanel"===l,height:"top"===l||"bottom"===l||"footer"===l},negotiations:{width:[],height:[]},remove:function(){for(var t in a._areas)a._areas[t]===i&&a.free(t)},negotiateWidth:function(t){if(i.canNegotiate.width){var e=r.processNegotiation(t);r.negotiationsAreEqual(i.negotiations.width,e)||(i.negotiations.width=e,a.recalculate())}},negotiateHeight:function(t){if(i.canNegotiate.height){var e=r.processNegotiation(t);r.negotiationsAreEqual(i.negotiations.height,e)||(i.negotiations.height=e,a.recalculate())}},requestFullscreen:function(){a._fullscreenArea||("right"!==l&&"center"!==l||(a._fullscreenArea=l),"center"===l&&a._bridge.requestFullscreen(),a._updateFullscreen())},exitFullscreen:function(){l===a._fullscreenArea&&(a._fullscreenArea=void 0,"center"===l&&a._bridge.exitFullscreen(),a._updateFullscreen())},detach:function(t){s.detachToPopup(i.rdState,Object.assign({},t,s.screenBox(i.body.value())))},width:new o,height:new o,availWidth:new o,availHeight:new o,alive:new o(!0),body:new o(e),detachable:new o(!0),visible:new o(!0),fullscreen:new o(!0),rdState:new n.ResizerDetacherState},i.rdState.pushOwner(i),
this._areas[l]=i,i.rdState.owner.subscribe(function(t){var e,o,n,r=i.body.value();if(t!==i)r.empty().detach();else{for(e=null,o=a._availableAreas.indexOf(l);o--;)if(n=a._availableAreas[o],a._affectsLayout(n)){e=a._areas[n].body.value();break}e?r.insertAfter(e):r.appendTo(a._$body)}a.recalculate()},{callWithLast:!0}),i.rdState.bridge()},t.prototype.free=function(t){var e=this._areas[t];e&&(this._areas[t]=void 0,$(e.body.value()).remove(),e.alive.setValue(!1))},t.prototype.recalculate=function(){var t,e,i,o,n,s,a,l,c,h,u,d,p,_={};for(this._recalcSingleRunToken=_,t={width:this._width.value(),height:this._height.value()},e=0;e<this._availableAreas.length;e++)if(i=this._availableAreas[e],(o=this._areas[i])&&this._affectsLayout(i)){for("center"===i?(n=0,this._affectsLayout("left")&&(n+=this._areas.left.width.value()),s=0,this._affectsLayout("top")&&(s+=this._areas.top.height.value()),o.body.value().css({left:n,top:s})):"top"!==i&&"bottom"!==i&&"footer"!==i||(n=0,this._affectsLayout("left")&&(n+=this._areas.left.width.value()),o.body.value().css({left:n})),a=void 0,a=o.canNegotiate.width&&!o.canNegotiate.height?["height","width"]:["width","height"],l=0;l<2;l++){if(c=a[l],h=void 0,u=t[c],this._fullscreenArea===i)h=u;else{if("bottom"===i&&"height"===c&&(u-=5),"right"!==i&&"dompanel"!==i||"width"!==c||(u-=300),"width"===c?o.availWidth.setValue(u):"height"===c&&o.availHeight.setValue(u),_!==this._recalcSingleRunToken)return;o.canNegotiate[c]?(h=r.determineSize(u,o.negotiations[c]),t[c]-=h):h=u}if(o.body.value().css(c,h),o[c].setValue(h),_!==this._recalcSingleRunToken)return}o.body.value().toggleClass("js-hidden",!1)}else o&&o.body.value().toggleClass("js-hidden",!0);this._affectsLayout("footer")&&(o=this._areas.footer,d=this._height.value()-o.height.value(),this._affectsLayout("bottom")&&(d-=this._areas.bottom.height.value()),o.body.value().css({top:d})),this._affectsLayout("dompanel")&&(o=this._areas.dompanel,p=0,this._affectsLayout("right")&&(p+=this._areas.right.width.value()),o.body.value().css({right:p}))},t.prototype._affectsLayout=function(t){var e,i=this._areas[t];return!!i&&(i.rdState.owner.value()===i&&((!this._fullscreenArea||this._fullscreenArea===t)&&!((this._width.value()<=567||this._height.value()<=450)&&(e=["center","top"],a.enabled("keep_left_toolbar_visible_on_small_screens")&&e.push("left"),!e.includes(t)))))},t.prototype._updateVisibility=function(){var t,e,i,o=this._bridge.visible.value();for(t=0;t<this._availableAreas.length;t++)e=this._availableAreas[t],(i=this._areas[e])&&(o&&this._affectsLayout(e)?i.visible.setValue(!0):i.visible.setValue(!1))},t.prototype._onParentFullscreenChange=function(){this._bridge.fullscreen.value()||(this._fullscreenArea=void 0,this._updateFullscreen())},t.prototype._updateFullscreen=function(){var t,e,i,o=void 0!==this._fullscreenArea;for(t=0;t<this._availableAreas.length;t++)e=this._availableAreas[t],(i=this._areas[e])&&(e!==this._fullscreenArea?i.body.value().toggleClass("js-hidden",o):i.fullscreen.setValue(o));this._updateVisibility(),this.recalculate()},
t.prototype._createDOM=function(t){var e=$("<div>").addClass("layout__area--"+t).css("position","absolute");return"bottom"===t?e.css("bottom",0):e.css("top",0),"right"===t||"dompanel"===t?e.css("right",0):e.css("left",0),e},t}(),e.ChartPage=l},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(51),n=function(){function t(t){var e,i,n,r,s=this;this._document=t,this.isFullscreen=new o,(e=function(){var t,e,i=["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement","msFullscreenElement"];for(t=0;t<i.length;t++)if((e=i[t])in s._document){s.isFullscreen.setValue(!!s._document[e]);break}})();for(i=0,n=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"];i<n.length;i++)r=n[i],t.addEventListener(r,e,!1)}return t.prototype.enter=function(){var t,e,i,o=this._document.documentElement;for(t=0,e=["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"];t<e.length;t++)if(i=e[t],"function"==typeof o[i]){o[i]();break}this.isFullscreen.setValue(!0)},t.prototype.exit=function(){var t,e,i,o=this._document;for(t=0,e=["exitFullscreen","mozCancelFullScreen","mozExitFullscreen","webkitExitFullscreen","msExitFullscreen"];t<e.length;t++)if(i=e[t],"function"==typeof o[i]){o[i]();break}this.isFullscreen.setValue(!1)},t}(),e.FullscreenApi=n},function(t,e){"use strict";function i(t,e){var i,o,n,r,s,a,l=0;for(i=0,o=e;i<o.length&&(n=o[i],r=n.min,s=n.max,t<r||s<r||(a=Math.min(t,s),l=Math.max(l,a),t!==l));i++);return l}function o(t){var e,i,o,n,r,s=[];if(void 0===t)return[];for(Array.isArray(t)||(t=[t]),e=0,i=t;e<i.length;e++)o=i[e],n=void 0,r=void 0,isFinite(o)?n=r=+o:(n=+o.min,r=+o.max),(n<0||isNaN(n))&&(n=0),isNaN(r)&&(r=1/0),n<=r&&r>0&&s.push({min:n,max:r});return s.sort(function(t,e){return t.min-e.min||t.max-e.max}),s}function n(t,e){if(t.length!==e.length)return!1;for(var i=t.length;i--;){if(t[i].min!==e[i].min)return!1;if(t[i].max!==e[i].max)return!1}return!0}Object.defineProperty(e,"__esModule",{value:!0}),e.determineSize=i,e.processNegotiation=o,e.negotiationsAreEqual=n},function(t,e,i){"use strict";function o(t,e){var i,o=Object.assign({},e),n=t.bridge().body.value();return n&&(o.useStylesFrom=n.prop("ownerDocument")),!!(i=l(o))&&(t.pushOwner(i.allocate()),!0)}function n(t){var e,i,o=$(t),n=o.offset(),r={left:+n.left,top:+n.top,width:o.width(),height:o.height()},s=o.prop("ownerDocument");return s&&(e=s.defaultView)?(i=e.innerWidth/$(s.documentElement).width(),isFinite(i)&&(r.left*=i,r.top*=i,r.width*=i,r.height*=i),r.left+=e.screenLeft||e.screenX||0,r.top+=e.screenTop||e.screenY||0,r):r}var r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),r=i(477),e.detachToPopup=o,e.screenBox=n,s=function(t,e){var i,o,n,r,s,a,l=t.querySelectorAll('style, link[rel~="stylesheet"]'),c=e.createDocumentFragment();for(i=0;i<l.length;i++){for(o=l[i],n=e.createElement(o.tagName),r=0;r<o.attributes.length;r++)s=o.attributes[r],n.setAttribute(s.nodeName,s.nodeValue||"");a=o.textContent,a&&(n.textContent=a),
c.appendChild(n)}return c},a=function(t,e,i){var o=function(){t&&t.removeEventListener("unload",o,!1),e&&(e.removeEventListener("unload",o,!1),e.close()),i&&i.free()};t.addEventListener("unload",o,!1),e.addEventListener("unload",o,!1)},l=function(t){var e,i,o,n,l,c,h,u,d;for(void 0===t&&(t={}),e="menubar=no,toolbar=no,location=no,personalbar=no,status=no",i=0,o=["top","left","width","height"];i<o.length;i++)n=o[i],l=+t[n],isFinite(l)&&l>=0&&(e+=","+n+"="+l);if(!(c=window.open("",t.name||"_blank",e))||c.closed)return null;h=null;try{h=c.document,h.close()}catch(t){return null}return h.open(),h.write('<!DOCTYPE html><html><head><meta http-equiv="X-UA-Compatible" content="IE=Edge" /></head><body></body></html>'),h.close(),null!=t.title&&(h.title=t.title+""),t.useStylesFrom&&(h.head.appendChild(s(t.useStylesFrom,h)),u=h.createElement("style"),u.textContent="html, body {min-width: 0 !important; max-width: none !important}",h.head.appendChild(u)),d=new r.Root(c),a(window,c,d),d}},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(51),n=function(){function t(t){var e,i,n,r,s,a,l=this;this.isVisible=new o(!0),i=null,n=function(o){var n=o?o+"Hidden":"hidden";if(n in t)return e=o+"visibilitychange",i=function(){l.isVisible.setValue(!t[n])},i(),t.addEventListener(e,i,!1),"break"};for(r=0,s=["","moz","ms","webkit"];r<s.length&&(a=s[r],"break"!==n(a));r++);this.destroy=function(){i&&(t.removeEventListener(e,i,!1),i=null)}}return t}(),e.VisibilityApi=n},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(22),i(23),n=i(76),r=i(43),s=i(204),a=i(103),l=i(48),c=i(20),h=i(1204),u=i(1334),d=i(467),p=i(7),_=i(180),f=i(1119),m=function(t){function e(e,i,o){var s,l,d,p,f=t.call(this)||this;return f.onTitleSizeChanged=new c,f._autosaveInterval=6e4,f._editEnabled=!0,f._titleValue="",f._saving=!1,f._haveChanges=!1,f._autosaveTimer=0,f._container=e,f._options=o=Object.assign({popupDirection:"up"},o||{}),f._chartWidgetCollection=i,f._readOnly=i.readOnly(),s="\n"+window.t("Dot",{context:"hotkey"})+" (.)",f._load=$('<span class="load button first apply-common-tooltip"></span>').html(h).attr("title",window.t("Load Chart Layout")+s).click(f.signInOrLoadChart.bind(f)).appendTo(e),f._title=$('<span class="title apply-common-tooltip"></span>'),o.hideChartTitle&&f._title.hide(),l=$("<span>").addClass("separator"),f._optionsMenu=$('<span class="button options last">').append($('<div class="tv-caret"></div>')),a.bindPopupMenu(f._optionsMenu,f._getSavedCharts.bind(f),{direction:o.popupDirection,reverse:o.popupReverse,notCloseOnButtons:!0,popupSpacing:o.popupSpacing}),f._readOnly?(f._save=$(),f._copy=$('<span class="copy">'+window.t("Copy")+"</span>").appendTo(e).click(f.cloneChart.bind(f)),f._title.addClass("read-only"),f._titleReadOnly=$("<span>").addClass("read-only").appendTo(f._title),l.appendTo(f._copy),
f._optionsMenu.hide()):(d=window.t("Save Chart Layout saves not just some particular chart, it saves all charts for all symbols and intervals which you are modifying while working with this Layout"),f._save=$('<span class="save button apply-common-tooltip"></span>').attr("title",d).html(u).appendTo(e).click(f.signInOrSaveChart.bind(f,null,null,null)),f._copy=$(),f._titleInput=$('<span type="text" maxlength="80">').appendTo(f._title),f._title.bind("click",f._renameChart.bind(f)),f._title.attr("title",window.t("Rename Chart Layout")),f._titleSize=$('<span class="sizer">').appendTo(f._title),f._titleReadOnly=$(),l.appendTo(f._save)),f._title.appendTo(e),f._optionsMenu.appendTo(e),f._savecopy=$().add(f._save).add(f._copy).mousedown(function(t){if(t.button)return void t.preventDefault();f._save.addClass("active")}).mouseup(function(t){f._save.removeClass("active")}),p=function(){i.metaInfo.name.value()||f._readOnly?f.setTitle(i.metaInfo.name.value()):f.hideTitle()},i.metaInfo.name.subscribe(p),p(),f._setChanges(!1),r.subscribe("chart_loaded",function(){f._setChanges(!1)},void 0),n.UndoHistory.undoStack().onChange().subscribe(f,function(){var t=n.UndoHistory.undoStack().head();t&&t.customFlag("doesnt_affect_save")||(f._setChanges(!0),f.autosave())}),_.registerListener("LoadChartDialogHotkey",function(t){return!t.ctrlKey&&(!(46!==t.which||!$(t.target).is("body"))&&(f.loadMenu(),t.preventDefault(),t.stopPropagation(),!0))}),window.saver.chartSaved().subscribe(f,f._onChartSaved),window.saver.chartAboutToBeSaved().subscribe(f,f._onChartAboutToBeSaved),f}return o.__extends(e,t),e.prototype.setTitle=function(t){var e,i;this._readOnly?(e=this._chartWidgetCollection.metaInfo.username.value(),i='<a href="/u/'+encodeURIComponent(e)+'">'+d.htmlEscape(e)+"</a>",t=(t?d.htmlEscape(t)+": ":"")+window.t("view-only chart by {user}").replace("{user}",i),this._setReadOnlyTitle(t)):this._setTitle(t)},e.prototype.hideTitle=function(){this._title.hide(),this._optionsMenu.hide(),this._titleInput.text(""),this._savecopy.removeClass("titled").addClass("last")},e.prototype.getTitle=function(){return this._titleValue},e.prototype.cloneChart=function(){var t,e,i,o=this;p.enabled("save_old_chart_before_save_as")&&this._chartWidgetCollection.metaInfo.id.value()&&this._saveChart(),t="text",e=new s.SaveRenameDialog({fields:[new s.InputField({name:t,label:window.t("Enter a new chart layout name")+":",error:window.t("Please enter chart layout name"),maxLength:64})],title:window.t("Copy Chart Layout")}),i=this._chartWidgetCollection.metaInfo.name.value(),e.setField(t,i?window.t("{0} copy").format(i):""),e.show().then(function(e){p.enabled("saved_charts_count_restriction")&&!window.user.is_pro&&o._savedCharts.length>=5||(p.enabled("saveload_storage_customization")?(o._chartWidgetCollection.metaInfo.uid.deleteValue(),o._chartWidgetCollection.metaInfo.id.deleteValue(),o.setTitle(e[t]),o.saveChart()):window.open("/chart/?clone="+o._chartWidgetCollection.metaInfo.uid.value()+"&name="+encodeURIComponent(e[t]),"_blank"))})},e.prototype.autosave=function(){
var t=this;p.enabled("charts_auto_save")&&(this._chartWidgetCollection.onfeatures||(this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=0),this._autosaveTimer=setTimeout(function(){t._chartWidgetCollection.metaInfo.id.value()&&t._saveChart()},this._autosaveInterval)))},e.prototype.saveChart=function(t,e,i){var o,n,r,a=this;if(this._chartWidgetCollection.onfeatures)return void(e&&e());o=this.getTitle(),o?(this._chartWidgetCollection.metaInfo.name.setValue(o),t&&t(),this._saveChart(function(){l.trackEvent("GUI","Save Chart Layout"),a._goChartPage(a._chartWidgetCollection.metaInfo.uid.value()),e&&e(),a._refreshSavedChartsList()},i)):(n="text",r=new s.SaveRenameDialog({fields:[new s.InputField({name:n,label:window.t("Chart layout name")+":",maxLength:64,error:window.t("Please enter chart layout name")})],title:window.t("Save New Chart Layout")}),r.show().then(function(o){a.setTitle(o[n]),a.saveChart(t,e,i)}))},e.prototype.signInOrSaveChart=function(t,e,i){p.enabled("saveload_requires_authentication")?runOrSignIn(this.saveChart.bind(this,t,e,i),{source:"Save chart",sourceMeta:"Chart"}):this.saveChart(t,e,i)},e.prototype.signInOrRenameChart=function(){p.enabled("saveload_requires_authentication")?runOrSignIn(this._renameChart.bind(this),{source:"Rename chart"}):this._renameChart()},e.prototype.signInOrSaveAs=function(){p.enabled("saveload_requires_authentication")?runOrSignIn(this.cloneChart.bind(this),{source:"Clone chart"}):this.cloneChart()},e.prototype.saveChartByEnter=function(t){13===t.keyCode&&(this._titleInput.blur(),this.signInOrSaveChart())},e.prototype.isSaved=function(){return!!this.getTitle()},e.prototype.loadMenu=function(){var e=this;return this._load.addClass("process"),t.prototype.loadMenu.call(this).catch(function(){}).then(function(){e._load.removeClass("process")})},e.prototype._fastDelete=function(e,i){t.prototype._fastDelete.call(this,e,i),this._chartIsActive(e)&&(p.enabled("saveload_storage_customization")?(this._chartWidgetCollection.clearChartMetaInfo(),this.setTitle("")):location.href="/chart/"+window.location.search)},e.prototype._chartIsActive=function(t){return t===this._chartWidgetCollection.metaInfo.id.value()},e.prototype._renameChart=function(){var t=this,e="text",i=new s.SaveRenameDialog({fields:[new s.InputField({name:e,label:window.t("Enter a new chart layout name")+":",error:window.t("Please enter chart layout name"),maxLength:64})],title:window.t("Rename Chart Layout")});this._editEnabled&&(i.setField(e,this.getTitle()),i.show().then(function(i){t.setTitle(i[e]),t.saveChart()}))},e.prototype._setTitle=function(t){this._titleInput.text(t),this._titleValue=t,this._savecopy.removeClass("last").addClass("titled"),t?this._options.hideChartTitle||(this._optionsMenu.show(),this._title.show()):(this._optionsMenu.hide(),this._title.hide(),this._savecopy.addClass("last").removeClass("titled")),this._setInputSize(),this._setChanges(!0)},e.prototype._setReadOnlyTitle=function(t){this._titleReadOnly.html(t).attr("title",t.replace(/<[^>]+>/g,"")),
this._savecopy.removeClass("last").addClass("titled"),this._title.addClass("last"),this._options.hideChartTitle||this._title.show()},e.prototype._setInputSize=function(){this._titleSize.text(this._titleInput.text()),this._titleInput.width(this._titleSize.width()),this.onTitleSizeChanged.fire()},e.prototype._setChanges=function(t){t=!!t,this._haveChanges=t,!t&&this.getTitle()?this._save.addClass("no-change"):this._save.removeClass("no-change")},e.prototype._process=function(t){t?this._save.addClass("process"):this._save.removeClass("process")},e.prototype._onChartAboutToBeSaved=function(){this._saving=!0,this._process(!0),this._editEnabled=!1},e.prototype._onChartSaved=function(t){this._stopProcess(),t&&this._setChanges(!1)},e.prototype._stopProcess=function(){this._saving=!1,this._process(!1),this._editEnabled=!0},e.prototype._saveChart=function(t,e){return this._readOnly||this._saving?void(e&&e()):this._haveChanges?void window.saver.saveChartSilently(function(){t&&t()},!1,function(){e&&e()}):void(t&&t())},e.prototype._goChartPage=function(t){"/chart/"===location.pathname&&(location.href="/chart/"+t)},e.prototype._getSavedCharts=function(){var t=[];return this.isSaved()&&t.push({title:this.getTitle(),disabled:!0,addClass:"save-load-chart-title"}),this._readOnly||(t.push({title:window.t("Save Chart Layout"),action:this.signInOrSaveChart.bind(this,null,null,null)}),this.isSaved()&&(t.push({title:window.t("Save As..."),action:this.signInOrSaveAs.bind(this)}),t.push({title:window.t("Rename..."),action:this.signInOrRenameChart.bind(this)}))),t},e}(f.LoadChartWidget),e.SaveLoadWidget=m},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(95),r=i(41),s=function(t){function e(e){var i=t.call(this)||this;return i._defaultFormatter=new r.PriceFormatter(100),i._background="#585858",i._source=e,i}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o,n;t.visible=!1,null!==(e=this._source.pane)&&(i=e.defaultPriceScale(),this._source.visible&&!i.isEmpty()&&(n=i.mainSource(),o=n?n.formatter():this._defaultFormatter,t.background=this._background,t.color=this.generateTextColor(this._background),t.coordinate=this._source.y,t.text=o.format(this._source.price),t.visible=!0))},e}(n.PriceAxisView),e.CrossHairPriceAxisView=s},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(95),r=i(34),s=function(t){function e(e,i){var o=t.call(this)||this;return o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o,n,s,a;if(t.visible=!1,e=this._source.priceScale(),i=this._source.properties().visible.value(),e&&!e.isEmpty()&&i&&(o=this._source.properties().graphics[this._data.lineType][this._data.styleId],o.visible&&o.visible.value()&&o.showPrice&&o.showPrice.value())){if(n=this._data.line.level,e.isPercent()){if(s=this._source.firstValue(),!r.isNumber(s))return;n=e.priceRange().convertToPercent(n,s)}a=o.color.value(),t.background=a,t.color=this.generateTextColor(a),
t.coordinate=e.priceToCoordinate(n),t.text=e.formatter().format(n),t.visible=!0}},e}(n.PriceAxisView),e.HLinesPriceAxisView=s},,,function(t,e,i){"use strict";function o(t,e,i){return new a(t,e,i)}var n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),n=i(5),r=i(34),s=i(40),a=function(t){function e(e,i,o){return t.call(this,e,i,o,{names:["width","color","visible"]})||this}return n.__extends(e,t),e.prototype._iterateLevels=function(t,e){var i,o,n;for(i in t.levels)if(t.levels[i]&&r.isSameType(t.levels[i],e.typecheck())){o=e.tpl();for(n in this._map.names)this._map.names.hasOwnProperty(n)&&(o=e.fill(n,this._map.names[n],t.levels[i],o));t.levels[i]=o}return t},e}(s),e.LineToolGannComplexProperty=a,e.createPropertiesObject=o},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(1),r=i(3),s=i(1135),a=i(9),l=function(t){function e(e,o){var n=t.call(this,e,null==o?s.createPropertiesObject("linetoolganncomplex"):o)||this;return n._constructor="LineToolGannComplex",i.e(1,function(t){var e=i(1134).GannComplexPaneView;n._setPaneViews([new e(n,n.model())])}),n.properties().reverse.subscribe(n,n._reversePoints),n}return o.__extends(e,t),e.prototype.pointsCount=function(){return 2},e.prototype.title=function(){return"Gann Square"},e.prototype.createPropertiesObject=function(t,e,i){return s.createPropertiesObject(t,e,i)},e.prototype.getStylesPropertyPage=function(){return a.propertyPages.LineToolGannComplexStylesPropertyPage},e.prototype.axisPoints=function(){var t=this.points(),e=this.getScreenPoints();return t.length<2||e.length<2?[]:[t[0],this.screenPointToPoint(e[1])]},e.prototype.getScreenPoints=function(){var t,e,i,o,r,s,a,l,c,h,u=this.points();return u.length<2?[]:(t=this._calcAngle(),null!==t?(e=u[0],i=u[1],o=this.pointToScreenPoint(e)[0],r=this.pointToScreenPoint(i)[0],s=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),a=new n.Point(Math.cos(t),-Math.sin(t)),l=a.normalized(),c=l.x<0?-1:1,h=l.y<0?-1:1,[o.addScaled(a,s),o.add(new n.Point(5*s*c,5*s*h))]):[])},e.prototype.levelsCount=function(){return this.properties().levels.childCount()},e.prototype.levels=function(){var t,e,i=[],o=this.properties(),n=o.levels.childCount();for(t=0;t<n;t++)e=o.levels[t],i.push({index:t,visible:e.visible.value(),color:e.color.value(),width:e.width.value()});return i},e.prototype.fanLinesCount=function(){return this.properties().fanlines.childCount()},e.prototype.fanLines=function(){var t,e,i=[],o=this.properties(),n=o.fanlines.childCount();for(t=0;t<n;t++)e=o.fanlines[t],i.push({index:t,visible:e.visible.value(),x:e.x.value(),y:e.y.value(),color:e.color.value(),width:e.width.value()});return i},e.prototype.arcsCount=function(){return this.properties().arcs.childCount()},e.prototype.arcs=function(){var t,e,i=[],o=this.properties(),n=o.arcs.childCount();for(t=0;t<n;t++)e=o.arcs[t],i.push({index:t,visible:e.visible.value(),x:e.x.value(),y:e.y.value(),color:e.color.value(),width:e.width.value()});return i},e.prototype.arcsBackgroundTransparency=function(){
return this.properties().arcsBackground.transparency.value()},e.prototype.isArcsBackgroundFilled=function(){return this.properties().arcsBackground.fillBackground.value()},e.prototype._calcAngle=function(){var t,e,i,o,n,r,s,a=this.points();return a.length<2?null:(t=a[0],e=a[1],i=this.pointToScreenPoint(t)[0],o=this.pointToScreenPoint(e)[0],n=o.subtract(i),r=n.length(),r>0?(n=n.normalized(),s=Math.acos(n.x),n.y>0&&(s=-s),s):null)},e.prototype._reversePoints=function(){var t=this._points,e=t[0],i=t[1];this._points[0]=i,this._points[1]=e,this.normalizePoints(),this.restart()},e}(r.LineDataSource),e.LineToolGannComplex=l,l.prototype.superclass=r.LineDataSource},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(95),r=function(t){function e(e,i){var o=t.call(this)||this;return o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o;t.visible=!1,e=this._source.priceScale(),0===this._source.points().length||null===e||e.isEmpty()||(i=this._data.priceProperty.value(),o=this._data.colorProperty.value(),t.background=o,t.color=this.generateTextColor(o),t.coordinate=e.priceToCoordinate(i),t.text=e.formatter().format(i),t.visible=!0)},e}(n.PriceAxisView),e.LineToolRiskRewardPriceAxisView=r},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(95),r=function(t){function e(e){var i=t.call(this)||this;return i._source=e,i}return o.__extends(e,t),e.prototype._updateRendererData=function(t){t.visible=!1;var e=this._source.lastValueData("close",!1);e.noData||(t.background=e.color,t.color=this.generateTextColor(e.color),t.coordinate=e.coordinate,t.floatCoordinate=e.floatCoordinate,t.text=e.text,t.visible=!0)},e}(n.PriceAxisView),e.OverlayPriceAxisView=r},function(t,e,i){"use strict";function o(t){var e,i;if(0===t.length)return!1;if(-1===(e=t.findIndex(function(t){return l.coordinateIsValid(t.y)})))return!1;for(i=t.length-1;i>e&&!l.coordinateIsValid(t[i].y);)i--;return!(e>=i)}function n(t,e){var i,o,n,a,c,h=[],u=[],d=null;for(i=0;i<t.length;i++){if(o=t[i],n=t[i+1]||{},l.coordinateIsValid(o.y))o.y<=e&&h.push(o),o.y>=e&&u.push(o),d=o;else{if(null===d)continue;o=d}l.coordinateIsValid(n.y)&&((o.y>e&&n.y<e||o.y<e&&n.y>e)&&(Math.abs(o.x-n.x)<1?(a=new r.Point(o.x,e),h.push(a),u.push(a)):null!==(c=s.intersectLineSegments(o,n,new r.Point(o.x,e),new r.Point(n.x,e)))&&(a=o.add(n.subtract(o).scaled(c)),h.push(a),u.push(a))))}return{topItems:h,bottomItems:u}}var r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),r=i(1),s=i(98),a=i(33),l=i(69),c=i(143),h=i(4),e.itemsRangeIsValid=o,e.splitItems=n,u=function(){function t(){this._data=null}return t.prototype.setData=function(t){this._data=t},t.prototype.draw=function(t){var e,i,r,s,a,l,c,h,u,d,p,_,f,m,g;null!==this._data&&(e=this._data,i=e.items,r=e.baseLevelCoordinate,s=e.bottom,a=e.bottomFillColor1,l=e.bottomFillColor2,c=e.topFillColor1,h=e.topFillColor2,u=e.topLineColor,d=e.bottomLineColor,p=e.topLineWidth,_=e.bottomLineWidth,o(i)&&(f=n(i,r),
m=f.topItems,g=f.bottomItems,t.lineCap="round",t.lineJoin="round",t.translate(.5,.5),0!==m.length&&(t.beginPath(),t.moveTo(m[0].x,r),this._makeLine(t,m,!0,0),t.closePath(),t.fillStyle=this._makeLinearGradient(t,c,h,r-s,r),t.fill(),t.beginPath(),this._makeLine(t,m,!1,0),t.lineWidth=p,t.strokeStyle=u,t.stroke()),0!==g.length&&(t.beginPath(),t.moveTo(g[0].x,r),this._makeLine(t,g,!0,1),t.closePath(),t.fillStyle=this._makeLinearGradient(t,a,l,r,r+s),t.fill(),t.beginPath(),this._makeLine(t,g,!1,1),t.lineWidth=_,t.strokeStyle=d,t.stroke())))},t.prototype.hitTest=function(t){var e,i,o,n,s,u,d,p,_,f,m;if(null===this._data)return null;for(e=this._data,i=e.items,o=e.topLineWidth,n=e.bottomLineWidth,s=l.selectionTolerance((o+n)/2),u=c.lowerbound(i,t,function(t,e){return t.x<=e.x}),d=Math.max(1,u-1),p=Math.min(i.length-1,u+1),_=d;_<=p;++_)if(f=i[_-1],m=i[_],a.distanceToSegment(new r.Point(f.x,f.y),new r.Point(m.x,m.y),new r.Point(t.x,t.y)).distance<=s)return new h(h.REGULAR);return null},t.prototype._makeLine=function(t,e,i,o){var n,r,s,a,c,h,u,d,p,_;if(null!==this._data&&-1!==(n=e.findIndex(function(t){return l.coordinateIsValid(t.y)})))for(r=this._data,s=r.barSpacing,a=r.baseLevelCoordinate,c=.25*s,u=e.length,d=n;d<u;d++)if(p=e[d],_=e[d+1]||{},l.coordinateIsValid(p.y)){if(0===o){if(h&&h.y>=a&&p.y>=a){t.moveTo(p.x,p.y);continue}}else if(h&&h.y<=a&&p.y<=a){t.moveTo(p.x,p.y);continue}if(h&&l.coordinateIsValid(h.y))t.lineTo(p.x,p.y),i&&!l.coordinateIsValid(_.y)&&t.lineTo(p.x,a);else if(_&&l.coordinateIsValid(_.y))i?(d!==n&&t.lineTo(p.x,a),t.lineTo(p.x,p.y)):t.moveTo(p.x,p.y);else if(i){if(0===d)continue;d!==n&&t.lineTo(p.x-c,a),t.lineTo(p.x-c,p.y),t.lineTo(p.x+c,p.y),t.lineTo(p.x+c,a)}else t.moveTo(p.x-c,p.y),t.lineTo(p.x+c,p.y);h=p}},t.prototype._makeLinearGradient=function(t,e,i,o,n){var r=t.createLinearGradient(0,o,0,n);return r.addColorStop(0,e),r.addColorStop(1,i),r},t}(),e.PaneRendererBaseline=u},function(t,e,i){"use strict";function o(t,e){return t.y1-1>e?1:t.y2+1<e?-1:0}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=i(143),r=i(4),s=function(){function t(t){this._data=null,this._data=t}return t.prototype.hitTest=function(t){var e,i,s,a,l,c,h,u,d,p=this._data;if(null===p)return null;if(e=Object.keys(p.histsBySession),0===e.length)return null;for(i=e.length-1;i>=0;i--){s=p.histsBySession[parseInt(e[i],10)],a=[];for(l in s)s.hasOwnProperty(l)&&a.push(s[l]);if(-1!==(c=n.bSearch(a,t.y,o))&&(h=a[c],u=Math.min(h.x1,h.x2),d=Math.max(h.x1,h.x2),t.x>=u&&t.x<=d))return new r(r.REGULAR)}return null},t.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u=this._data;if(null!==u){t.save();for(e in u.histsByLineWidth)if(u.histsByLineWidth.hasOwnProperty(e)){i=parseInt(e,10),o=u.histsByLineWidth[e],n=i%2==0?.5:0,r=Math.round(i/2);for(s in o)if(o.hasOwnProperty(s)){for(t.strokeStyle=s,t.lineWidth=i*(window.hidpiCanvasRatio||1),t.beginPath(),a=o[s],l=0,c=a;l<c.length;l++)h=c[l],t.moveTo(h.x1+n,h.y1+r+n),t.lineTo(h.x2+n,h.y1+r+n);t.stroke()}}t.restore()}},t}(),e.HorizHistogramRenderer=s},function(t,e,i){"use strict";var o,n,r
;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(19),r=function(){function t(t){this.setData(t)}return t.prototype.setData=function(t){this._data=o.__assign({},t)},t.prototype.draw=function(t,e){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w;this._data.visible&&(i=e.fontSize,t.font=e.font,o=e.tickLength,r=e.borderSize,s=e.paddingTop,a=e.paddingBottom,l=e.paddingInner,c=e.paddingOuter,h=Math.ceil(e.widthCache.measureText(t,this._data.text)),u=e.baselineOffset,d=e.fontSize+s+a,p=r+h+l+c+o,_=this._data.coordinate,this._data.fixedCoordinate&&(_=this._data.fixedCoordinate),f=_-Math.floor(i/2)-s-.5,m=f+d,g=e.isLeft?e.width-r-.5:.5,v=g,t.fillStyle=n.resetTransparency(this._data.background),t.lineWidth=1,this._data.text&&(e.isLeft?(v=g-p,y=g-o,b=v+c):(v=g+p,y=g+o,b=g+r+o+l),t.beginPath(),t.moveTo(g,f),t.lineTo(v,f),t.lineTo(v,m),t.lineTo(g,m),t.fill(),t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(g,_),t.lineTo(y,_),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,b,m-a-u)),this._data.secondLine&&(S=Math.ceil(e.widthCache.measureText(t,this._data.secondLine)),w=S+l+c,t.fillStyle=n.resetTransparency(this._data.background),this._data.text&&(f+=d+1,m+=d+1),e.isLeft?(v=Math.min(v,e.width-o),g=v+w,b=v+c):(g=Math.max(v-w,r),v=g+w,b=g+l),t.beginPath(),t.moveTo(g,f),t.lineTo(v,f),t.lineTo(v,m),t.lineTo(g,m),t.fill(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.secondLine,b,m-a-u)))},t.prototype.height=function(t,e){var i=t.fontSize+t.paddingTop+t.paddingBottom;return this._data.secondLine&&e?2*i+1:i},t}(),e.PriceAxisViewRenderer=r},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(21),r=i(42),s=i(495),a=i(71),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.lastPrice=function(){return this._getSource().data().lastProjectionPrice},e.prototype._updateRendererData=function(t){var e,i,o,s,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,C;t.visible=!1,e=this._getData().model,e.properties().scalesProperties.showSeriesLastValue.value()&&(i=this._getSource(),o=i.priceScale(),s=e.timeScale(),l=this.lastPrice(),s.isEmpty()||o.isEmpty()||void 0===l||null!==(c=s.visibleBars())&&(h=c.firstBar(),u=c.lastBar(),d=i.data(),null!==(p=d.search(u,r.PlotRowSearchMode.NearestLeft))&&void 0!==(_=i.nearestIndex(h,r.PlotRowSearchMode.NearestRight))&&(f=n.ensureNotNull(d.valueAt(_))[TradingView.CLOSE_PLOT],m=l,o.properties().percentage.value()&&(m=100*(m-f)/f),g=t.background,v="",y=!1,b=i.properties(),S=b.style.value()===a.STYLE_HEIKEN_ASHI,S&&b.haStyle.showRealLastPrice.value()?(this._isCountdownEnabled()&&b.showCountdown.value()&&(v=this._countdownText()),w=i.lastValueData(TradingView.CLOSE_PLOT,!0),w.noData||w.color===t.background||(g=w.color),T=i.lastValueData(TradingView.CLOSE_PLOT,!1),w.noData||T.noData||(y=w.index===T.index)):(x=i.barColorer(),C=x.barStyle(p.index,!0),g=C.barColor,y=!0),t.background=g,t.secondLine=v,t.visible=y,t.color=this.generateTextColor(g),
t.coordinate=o.priceToCoordinate(m),t.text=o.formatter().format(m))))},e}(s.SeriesPriceAxisView),e.ProjectionSeriesPriceAxisView=l},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(95),r=function(t){function e(e,i){var o=t.call(this)||this;return o._source=e,o._model=i,o}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o;t.visible=!1,e=this._source,this._model.properties().scalesProperties.showSeriesPrevCloseValue.value()&&(e.isDWM()||null!==(i=e.prevClose())&&(o=this._source.properties().prevClosePriceLineColor.value(),t.background=o,t.color=this.generateTextColor(o),t.coordinate=i.coordinate,t.text=i.text,t.visible=!0))},e}(n.PriceAxisView),e.PrevCloseSeriesPriceAxisView=r},function(t,e,i){"use strict";function o(t){return-1!==r.indexOf(t)}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),n=i(71),r=[n.STYLE_RENKO,n.STYLE_KAGI,n.STYLE_PNF,n.STYLE_PB,n.STYLE_HEIKEN_ASHI],e.isJapaneseStyle=o},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.types={ECONOMIC:"economic",QUANDL:"quandl"}},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(13),n=o.getLogger("Chart.TimePoints"),r=function(){function t(){this._zoffset=0,this._items=[]}return t.prototype.clear=function(){this._zoffset=0,this._items=[]},t.prototype.size=function(){return this._items.length},t.prototype.firstIndex=function(){return this._offsetToIndex(0)},t.prototype.lastIndex=function(){return this._offsetToIndex(this._items.length-1)},t.prototype.merge=function(t,e,i){var o,r,s,a,l,c,h,u;if(0===i.length)return n.logError("merge: 'values' does not contain any time points"),[];if(e>this._zoffset&&t+e>0)return n.logError("merge: when the first time point index is updated, we should fill the time points starting from the first one"),[];if(0===this._items.length)return this._items=i,this._zoffset=e,[{change:"rebuild",index:this._validOffsetToIndex(0)}];if((o=t+this._zoffset)<0){if(r=Math.abs(o),i.length<r)return n.logError("merge: 'values' does not contain enough time points to fill in the new items. 'index': "+t+", previous 'zoffset': "+this._zoffset+", new 'zoffset': "+e+", 'values.length': "+i.length),[];for(this._items=Array(r).concat(this._items),this._zoffset=e,s=0;s<i.length;++s)this._items[t+s+e]=i[s];return[{change:"rebuild",index:this._validOffsetToIndex(0)}]}for(a=[],l=o;l<this._items.length&&l-o<i.length;++l)this._items[l]=i[l-o],a.push({change:"update",index:this._validOffsetToIndex(l),value:i[l-o]});if((c=o+i.length)>this._items.length)for(r=c-this._items.length,h=l;h<l+r;++h)u=this._items.length,this._items.push(i[h-o]),a.push({change:"append",index:this._validOffsetToIndex(u),value:i[h-o]});return this._zoffset=e,a},t.prototype.addTail=function(t,e){for(var i=e?1:0;i<t.length;i++)this._items.push(t[i])},t.prototype.remove=function(t){var e,i,o,n=this._indexToOffset(t);if(null===n)return[];for(e=this._items.splice(n),i=[],o=0;o<e.length;o++)i.push({change:"remove",index:t+o,value:e[o]});return i},
t.prototype.valueAt=function(t){var e=this._indexToOffset(t);return null!==e?this._items[e]:null},t.prototype.indexOf=function(t,e){if(this._items.length<1)return null;if(t>this._items[this._items.length-1])return e?this._validOffsetToIndex(this._items.length-1):null;for(var i=0;i<this._items.length;++i){if(t===this._items[i])return this._validOffsetToIndex(i);if(t<this._items[i])return e?this._validOffsetToIndex(i):null}return null},t.prototype.state=function(){return{items:this._items,zoffset:this._zoffset}},t.prototype.restoreState=function(t){null!==t&&(this._items=t.items,this._zoffset=t.zoffset)},t.prototype.roughTime=function(t,e){var i,o,n,r,s,a,l,c,h,u,d,p;return void 0===e&&(e=null),null!==(i=this.valueAt(t))?i:(o=this._items,!o.length||o.length<2?null:(n=0,r=o.length-1,s=this._validOffsetToIndex(n),a=this._validOffsetToIndex(r),l=o[n],c=o[r],h=(c-l)/(a-s),t<s?(u=s-t,d=u*h,l-d):(p=500,t>a?(u=t-a)<p&&null!=e?e(c,u):(d=u*h,c+d):null)))},t.prototype.roughIndex=function(t,e){var i,o,n,r,s,a,l,c,h,u,d,p;return void 0===e&&(e=null),i=this._items,!i.length||i.length<2?null:(o=0,n=i.length-1,r=this._validOffsetToIndex(o),s=this._validOffsetToIndex(n),a=i[o],l=i[n],t>=a&&t<=l?this.closestIndexLeft(t):(c=(l-a)/(s-r),t<a?(h=a-t,u=Math.round(h/c),r-u):(d=500,t>l?(h=t-l,u=Math.trunc(h/c),u<d&&null!==e&&(p=e(l,t),p.success&&(u=p.result)),s+u):null)))},t.prototype.closestIndexLeft=function(t){var e,i,o,n,r,s,a=this._items;if(!a.length)return null;if(t!==t)return null;if(e=a.length-1,i=a[e],t>=i)return this._validOffsetToIndex(e);if(o=0,n=a[o],t<n)return null;if(t===n)return this._validOffsetToIndex(o);for(;e>o+1;)if(r=o+e>>1,(s=a[r])>t)e=r;else{if(!(s<t))return s===t?this._validOffsetToIndex(r):null;o=r}return this._validOffsetToIndex(o)},t.prototype._validOffsetToIndex=function(t){return t-this._zoffset},t.prototype._offsetToIndex=function(t){return 0<=t&&t<this.size()?this._validOffsetToIndex(t):null},t.prototype._indexToOffset=function(t){var e=t+this._zoffset;return 0<=e&&e<this.size()?e:null},t}(),e.TimePoints=r},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(176),r=i(308),s=function(t){function e(e,i){var o=this,n="Change Chart Layout to "+r.layouts[i].title;return o=t.call(this,n)||this,o._chartWidgetCollection=e,o._newLayoutType=i,o._oldLayoutType=e.layout.value(),o}return o.__extends(e,t),e.prototype.redo=function(){this._chartWidgetCollection.layout.setValue(this._newLayoutType)},e.prototype.undo=function(){this._chartWidgetCollection.layout.setValue(this._oldLayoutType)},e}(n.UndoCommand),e.SetChartLayoutCommand=s},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(176),r=function(t){function e(e,i,o){var n=t.call(this,o)||this;return n._wv=e,n._newValue=i,n._oldValue=e.value(),n}return o.__extends(e,t),e.prototype.redo=function(){this._wv.setValue(this._newValue)},e.prototype.undo=function(){this._wv.setValue(this._oldValue)},e}(n.UndoCommand),e.SetWatchedValueCommand=r},function(t,e,i){"use strict"
;function o(t){$(t).attr("title")||t.offsetWidth+r>=t.scrollWidth||$(t).attr("title",$(t).text())}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),i(22),n=i(177),r=$.browser.msie||/\btrident\b/i.test(navigator.userAgent)?1:0,$(function(){$(document).on("mouseenter",".apply-overflow-title",function(){o(this)}),$(document).on("mouseenter",".apply-overflow-tooltip",function(){function t(){n.hide(),i.off("mouseleave mousedown",t)}var e,i=$(this);i[0].offsetWidth+r>=i[0].scrollWidth||(e="",e=i.is(".apply-overflow-tooltip--allow-text")?i.text():i.clone().children().remove().end().text().trim(),n.showOnElement(i[0],{text:e}),i.on("mouseleave mousedown",t))})})},,,,function(t,e){"use strict";function i(t){return t.description||""}Object.defineProperty(e,"__esModule",{value:!0}),e.getTranslatedSymbolDescription=i},function(t,e,i){"use strict";function o(t){return n.createDialog(Object.assign({},a,t))}var n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),i(23),n=i(96),r={key:13,name:"yes",text:$.t("Yes"),type:"success"},s={method:"close",name:"no",text:$.t("No"),type:"default"},a={actions:[r,s],actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',content:$.t("Are you sure?"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',destroyOnClose:!0,title:$.t("Confirmation"),width:400},e.createConfirmDialog=o},function(t,e,i){"use strict";function o(t){var e=t.type||"popup";return delete t.type,"modal"===e?new n.TVModal(t):new r.TVPopup(t)}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),n=i(1156),r=i(1157),e.createDialog=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(701);e.TVModal=o.TVModal,e.isOpenedModals=o.isOpenedModals},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(702);e.TVPopup=o.TVPopup},function(t,e,i){"use strict";function o(t,e){i.e(7,function(o){i(431).showSymbolInfoDialog(t,e)})}Object.defineProperty(e,"__esModule",{value:!0}),e.showSymbolInfoDialog=o},function(t,e,i){"use strict";function o(t,e,o){void 0===e&&(e={}),i.e(2,function(n){i(233).getImageOfChart(t,e,o)})}function n(t,e,o){void 0===e&&(e={}),i.e(2,function(n){i(233).getImageOfChartSilently(t,e,o)})}Object.defineProperty(e,"__esModule",{value:!0}),e.getImageOfChart=o,e.getImageOfChartSilently=n},function(t,e){"use strict";function i(){return"www.tradingview.com"===location.host||"wwwcn.tradingview.com"===location.host||"dwq4do82y8xi7.cloudfront.net"===location.host||"s.tradingview.com"===location.host||"i18n.tradingview.com"===location.host||"partial.tradingview.com"===location.host||location.host.match(/^[a-z]{2}\.tradingview\.com/)||location.host.match(/prod-[^.]+.tradingview.com/)?"battle":-1!==location.href.indexOf("tradingview.com")?"staging":location.host.match(/webcharts/)?"staging_local":(location.host.match(/^localhost(:\d+)?$/),"local")}function o(){return"local"===i()}function n(){return"battle"===i()}
function r(){return!n()}Object.defineProperty(e,"__esModule",{value:!0}),e.environment=i,e.isLocal=o,e.isProd=n,e.isDebug=r},,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.breakpoints={desktop:1/0,desktopHd:1919,phone:767,"phone-vertical":479,tablet:1019}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),i(654),o=i(321),i(90),n=i(28),r=i(1164),s=i(20),a=i(332),l=i(513),c=i(63),function(t){t[t.Left=0]="Left",t[t.Right=1]="Right"}(h||(h={})),u={saveTab:"",noSlider:!1,onTabClick:!1,loadedClass:"i-loaded",tabsContainerClass:"tv-tabs",tabClass:"tv-tabs__tab",tabDisabledClass:"disabled",activeTabClass:"i-active",activePageClass:"active",sliderClass:"tv-tabs__slider",scrollBoxClass:"tv-tabs__scroll-box",scrollWrapClass:"tv-tabs__scroll-wrap",lArrowClass:"tv-tabs__left-arrow",rArrowClass:"tv-tabs__right-arrow"},d={leftArrow:a,rightArrow:l},p=function(){function t(t,e,i){void 0===i&&(i={}),this._animating=!1,this._bindings=[],this._options=r.deepExtend({},u,i),this.tabChanged=new s,this._elTabs=t,this._elPages=e,this._elScrollWrap=this._findOrCreateElement(this._options.scrollWrapClass||"",this._elTabs,"wrapInner"),this._elScrollBox=this._findOrCreateElement(this._options.scrollBoxClass||"",this._elScrollWrap,"wrapInner"),this._elArrowLeft=this._findOrCreateElement(this._options.lArrowClass||"",this._elTabs,"append",'<div class="'+(this._options.lArrowClass||"")+' i-slided">'+d.leftArrow+"</div>"),this._elArrowRight=this._findOrCreateElement(this._options.rArrowClass||"",this._elTabs,"append",'<div class="'+(this._options.rArrowClass||"")+' i-slided">'+d.rightArrow+"</div>"),this._options.noSlider||(this._elSlider=this._findOrCreateElement(this._options.sliderClass||"",this._elScrollBox,"append")),this._addClass(this._elArrowLeft,this._options.addLeftArrowsClass),this._addClass(this._elArrowRight,this._options.addRightArrowsClass),this._addClass(this._elScrollBox,this._options.addScrollBoxClass),this._addClass(this._elTabs,this._options.tabsContainerClass),this._addClass(this.getTabsArray(),this._options.tabClass),this._addClass(this._elTabs,this._options.loadedClass),"string"==typeof this._options.sliderMod&&this._addClass(this._elSlider,this._options.sliderClass+"--"+this._options.sliderMod),this.checkScrollArrows(!0),this._initActivePage(),this._bindEvents()}return t.prototype.getTabsArray=function(){var t,e,i,o=this._elScrollBox.children;if(!this._options.sliderClass)return Array.prototype.slice.call(o);for(t=[],e=0;e<o.length;e++)i=o[e],i.classList.contains(this._options.sliderClass)||t.push(i);return t},t.prototype.getPagesArray=function(){return this._elPages?Array.prototype.slice.call(this._elPages.children):[]},t.prototype.getElTabs=function(){return this._elTabs},t.prototype.getElPages=function(){return this._elPages},t.prototype.checkScrollArrows=function(t){function e(t){t.classList.remove("i-slided"),$.Velocity&&$.Velocity.animate(t,{translateX:"0%"},{duration:n.dur/2,easing:"easeOutCubic",queue:!1})}function i(e,i){
if(t)return e.classList.add("i-slided"),void e.setAttribute("style","");var r=i===h.Left?"-100%":"100%";o.lazyVelocity().then(function(){$.Velocity.animate(e,{translateX:r},{complete:function(){return e.classList.add("i-slided")},duration:n.dur/2,easing:"easeOutCubic",queue:!1})})}var r,s,a,l;void 0===t&&(t=!1),r=this._elScrollWrap.scrollLeft,s=this._getElWidth(this._elScrollWrap),a=10,l=this._elScrollWrap.scrollWidth-s,r>=a?e(this._elArrowLeft):(r<=a||this._elScrollWrap.scrollWidth<=s)&&i(this._elArrowLeft,h.Left),l-r>1?e(this._elArrowRight):(r>=l||this._elScrollWrap.scrollWidth<=s)&&i(this._elArrowRight,h.Right)},t.prototype.index=function(){var t=this.getElActiveTab();return t?this.getTabsArray().indexOf(t):-1},t.prototype.getElActiveTab=function(){return this._getActiveElement(this.getTabsArray(),this._options.activeTabClass||"",this._options.inactiveTabClass)},t.prototype.getElActivePage=function(){return this._getActiveElement(this.getPagesArray(),this._options.activePageClass||"",this._options.inactivePageClass)},t.prototype.setActivePage=function(t,e,i){function o(e,i,o){e.forEach(function(e,n){var r=t===n,s=e.classList;i&&s.toggle(i,r),o&&s.toggle(o,!r)})}if(-1!==t&&(t!==this.index()||i)){var n=this.index();o(this.getTabsArray(),this._options.activeTabClass,this._options.inactiveTabClass),o(this.getPagesArray(),this._options.activePageClass,this._options.inactivePageClass),this._options.noSlider||this.updateSlider(n,t,e),this._options.saveTab&&c.setValue(this._options.saveTab,t),this.tabChanged.fire(t)}},t.prototype.updateSlider=function(t,e,i){var r,s,a,l,c,h,u=this;this._options.noSlider||(r=this.getTabsArray()[e],0===r.clientWidth||0===r.clientHeight||"none"===window.getComputedStyle(r).getPropertyValue("display")||(s=window.getComputedStyle(r),a=r.offsetLeft+parseInt(s.getPropertyValue("padding-left")),l=this._getElWidth(r),c=r.querySelector(".js-tabs__slider-pos"),c&&(h=window.getComputedStyle(c),a+=parseInt(h.getPropertyValue("padding-left"))+c.offsetLeft,l-=l-this._getElWidth(c)),i=i||-1===t||document.all&&!window.atob,i?(this._elSlider.style.left=a+"px",this._elSlider.style.width=l+"px"):(this._animating=!0,o.lazyVelocity().then(function(){$.Velocity.animate(u._elSlider,{left:a},{duration:n.dur,easing:"easeOutCubic",queue:!1}),$.Velocity.animate(u._elSlider,{width:l},{complete:function(){u._animating=!1},duration:n.dur,easing:"easeOutCubic",queue:!1})}))))},t.prototype.onTabClick=function(t){var e=t.currentTarget||t.target,i=this.getTabsArray().indexOf(e);-1===i||this._isTabDisabled(e)||this.setActivePage(i),document.activeElement.blur(),t.preventDefault()},t.prototype.resizeSlider=function(){var t,e;this._options.noSlider||(t=this._elTabs.offsetWidth)!==this._prevWidth&&(this._prevWidth=t,e=this.index(),this.updateSlider(e,e,!0))},t.prototype.count=function(){return this.getTabsArray().length},t.prototype.add=function(t,e){this._elScrollBox.appendChild(t),this._elPages&&e&&this._elPages.appendChild(e),this._bindTabEvents(t),this.checkScrollArrows(!0)},t.prototype.remove=function(t){function e(t){
t.parentElement&&t.parentElement.removeChild(t)}var i,o,n=this.tabAt(t);n&&(this._unbindTabEvents(n),e(n)),i=this.pageAt(t),i&&e(i),o=t-1>=0?t-1:0,this.setActivePage(o),this.checkScrollArrows(!0)},t.prototype.indexOfTab=function(t){return this.getTabsArray().indexOf(t)},t.prototype.indexOfPage=function(t){return this.getPagesArray().indexOf(t)},t.prototype.pageAt=function(t){return this.getPagesArray()[t]||null},t.prototype.tabAt=function(t){return this.getTabsArray()[t]||null},t.prototype.deselect=function(t){var e,i=this.getElActiveTab();return this._options.activeTabClass&&i&&i.classList.remove(this._options.activeTabClass),e=this.getElActivePage(),this._options.activePageClass&&e&&e.classList.remove(this._options.activePageClass),this._elSlider&&(this._elSlider.style.left="",this._elSlider.style.width=""),this},t.prototype.stop=function(){this._unbindEvents({})},t.prototype._getElWidth=function(t){if(0===t.offsetWidth)return 0;var e=window.getComputedStyle(t);return t.offsetWidth-parseFloat(e.getPropertyValue("padding-left"))-parseFloat(e.getPropertyValue("padding-right"))-parseFloat(e.getPropertyValue("border-left-width"))-parseFloat(e.getPropertyValue("border-right-width"))},t.prototype._findOrCreateElement=function(t,e,i,o){var n,r,s,a=e.querySelector("."+t);if(!a)if(n=document.createElement("div"),n.innerHTML=o||'<div class="'+t+'"></div>',a=n.firstElementChild,"append"===i)e.appendChild(a);else{if("wrapInner"!==i)throw Error("Unknown insertMethod");for(r=Array.prototype.slice.call(e.childNodes),s=0;s<r.length;s++)a.appendChild(r[s]);e.appendChild(a)}return a},t.prototype._addClass=function(t,e){if("string"==typeof e){Array.isArray(t)||(t=[t]);var i=e.split(/\s+/);t.forEach(function(t){i.forEach(function(e){t.classList.add(e)})})}},t.prototype._initActivePage=function(){var t,e=0;this._options.saveTab&&(e=c.getInt(this._options.saveTab,0)),t=this.index(),-1!==t&&(e=t),void 0!==this._options.activeTab&&(e=this._options.activeTab),this.setActivePage(e,!0,!0)},t.prototype._bindEvents=function(){var t,e=this;this.getTabsArray().forEach(this._bindTabEvents.bind(this)),this._bindOneEvent({eventName:"scroll",listener:this.checkScrollArrows.bind(this,!1),target:this._elScrollWrap}),this._bindOneEvent({eventName:"click",listener:function(t){var i=e.getTabsArray(),r=0,s=!1,a=e._elScrollWrap.scrollLeft;i.forEach(function(t){if(!s){var e=t.offsetLeft+t.offsetWidth;e>a?s=!0:r=e}}),o.lazyVelocity().then(function(){$.Velocity.animate(e._elScrollWrap,"scroll",{axis:"x",container:$(e._elScrollWrap),duration:n.dur/2,easing:"easeInOutCubic",offset:Math.floor(r-a-e._getElWidth(e._elArrowLeft)),queue:!1})})},target:this._elArrowLeft}),this._bindOneEvent({eventName:"click",listener:function(t){var i=e.getTabsArray(),r=0,s=e._elScrollWrap.scrollLeft+e._getElWidth(e._elScrollWrap);i.forEach(function(t){if(0===r){var e=t.offsetLeft+t.offsetWidth;e>s&&(r=e)}}),o.lazyVelocity().then(function(){$.Velocity.animate(e._elScrollWrap,"scroll",{axis:"x",container:$(e._elScrollWrap),duration:n.dur/2,easing:"easeInOutCubic",
offset:Math.ceil(r-s+e._getElWidth(e._elArrowRight)),queue:!1})})},target:this._elArrowRight}),t=Array.prototype.slice.call(this._elTabs.querySelectorAll(".js-tabs__slider-hover")||[]),t.length&&t.forEach(function(t){return e._bindOneEvent({eventName:"mouseenter",listener:function(t){if(!e._animating){var i=t.currentTarget;i&&e._options.activeTabClass&&i.classList&&i.classList.contains(e._options.activeTabClass)&&e._hoverSlider(i)}},target:t})}),this._bindOneEvent({eventName:"resize",listener:function(){e.checkScrollArrows(!0),e._options.noSlider||e.resizeSlider()},target:window})},t.prototype._bindTabEvents=function(t){var e=this;this._bindOneEvent({eventName:Modernizr.touch?"touchend":"click",listener:function(t){"function"==typeof e._options.onTabClick?e._options.onTabClick(t):e.onTabClick(t)},target:t})},t.prototype._unbindTabEvents=function(t){this._unbindEvents({target:t})},t.prototype._bindOneEvent=function(t){t.target.addEventListener(t.eventName,t.listener),this._bindings.push(t)},t.prototype._unbindEvents=function(t){var e=function(e){return!(void 0!==e.eventName&&e.eventName!==t.eventName||void 0!==e.target&&e.target!==t.target||void 0!==e.listener&&e.listener!==t.listener)};this._bindings.filter(e).forEach(function(t){return t.target.removeEventListener(t.eventName,t.listener)}),this._bindings=this._bindings.filter(function(t){return!e(t)})},t.prototype._getActiveElement=function(t,e,i){var o=function(t,o,n){return e?t.classList.contains(e):!!i&&!t.classList.contains(i)};return t.filter(o)[0]||null},t.prototype._isTabDisabled=function(t){return t.classList.contains("i-disabled")||this._options.tabDisabledClass&&t.classList.contains(this._options.tabDisabledClass)||t.hasAttribute("disabled")},t.prototype._hoverSlider=function(t){var e,i=this,r=this._getElWidth(t),s=window.getComputedStyle(t),a=t.offsetLeft+parseInt(s.getPropertyValue("padding-left"))+parseInt(s.getPropertyValue("margin-left")),l={duration:n.dur/4,easing:"easeOutCubic",queue:!1};o.lazyVelocity().then(function(){$.Velocity.animate(i._elSlider,{left:a},l),$.Velocity.animate(i._elSlider,{width:r},l)}),e=function(){i.getElActiveTab()===t&&i._unhoverSlider(t),t.removeEventListener("mousleave",e)},t.addEventListener("mouseleave",e)},t.prototype._unhoverSlider=function(t){var e=this,i=window.getComputedStyle(t),r=t.querySelector(".js-tabs__slider-pos"),s=window.getComputedStyle(r),a=t.offsetLeft+parseInt(i.getPropertyValue("padding-left"))+parseInt(i.getPropertyValue("margin-left"))+parseInt(s.getPropertyValue("padding-left"))+r.offsetLeft,l=this._getElWidth(t),c=l-(l-this._getElWidth(r)),h={duration:n.dur/2,easing:"easeInSine",queue:!1};o.lazyVelocity().then(function(){$.Velocity.animate(e._elSlider,{left:a},h),$.Velocity.animate(e._elSlider,{width:c},h)})},t}(),e.Tabs=p},function(t,e){"use strict";function i(t){var e,n=[];for(e=1;e<arguments.length;e++)n[e-1]=arguments[e];return t&&"object"==typeof t?0===n.length?t:(n.forEach(function(e){void 0!==e&&null!==e&&"object"==typeof e&&Object.keys(e).forEach(function(n){var r,s,a=t[n],l=e[n]
;l===t||(r=Array.isArray(l),l&&(o(l)||r)?(s=void 0,s=r?a&&Array.isArray(a)?a:[]:a&&o(a)?a:{},t[n]=i(s,l)):void 0!==l&&(t[n]=l))})}),t):t}function o(t){var e,i,o;return!(!t||"[object Object]"!==Object.prototype.toString.call(t))&&(!(e=Object.getPrototypeOf(t))||(i=Object.hasOwnProperty.toString,"function"==typeof(o=e.hasOwnProperty("constructor")&&e.constructor)&&i.call(o)===i.call(Object)))}Object.defineProperty(e,"__esModule",{value:!0}),e.deepExtend=i},function(t,e){"use strict";function i(t){var e,o;if(3===t.nodeType&&t.data.trim())return t;if(t.childNodes)for(e=t.childNodes.length;e--;)if(o=i(t.childNodes[e]))return o;return null}function o(t,e){var i,o=e.parentNode;o&&(i=e.nextSibling,i?o.insertBefore(t,i):o.appendChild(t))}function n(t){var e,n,r,s=i(t);if(s){if(e=s.data,s.parentNode&&s.parentNode.tagName&&"sup"===s.parentNode.tagName.toLowerCase())return;n=/^([^]*)(\S)(\s*)$/.exec(e),n&&(s.data=n[1],r=document.createElement("sup"),r.textContent=n[2],o(r,s),n[3]&&o(document.createTextNode(n[3]),r))}}Object.defineProperty(e,"__esModule",{value:!0}),e.lastCharSup=n},function(t,e,i){"use strict";var o,n;i(22),o=$.Deferred(),n=function(){o.resolve(),document.body.removeEventListener("tradingview-i18next-initialized",n)},window.__tradingviewI18nextInited?n():document.body.addEventListener("tradingview-i18next-initialized",n),t.exports=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(503);o.addTranslationFunctionToWindow(o.translationFunction),o.addTranslationFunctionToJQuery(o.translationFunction)},,,,,,,,,,,function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),i(23),n=i(2),r=i(26),s=i(669),a=i(328),l=i(329),c={add:window.t("Add to favorites"),remove:window.t("Remove from favorites")},h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(t){var i=e.props,o=i.onClick,n=i.onClickArg;o&&o(n,t)},e}return o.__extends(e,t),e.prototype.render=function(){var t,e=this.props.isFilled;return n.createElement("span",{className:r(s.star,"apply-common-tooltip",(t={},t[s.checked]=e,t)),dangerouslySetInnerHTML:{__html:e?a:l},onClick:this._handleClick,title:e?c.remove:c.add})},e}(n.PureComponent),e.FavoriteButton=h,e.FavoriteButtonString=h},function(t,e,i){"use strict";function o(t){return function(e){function i(t){var i=e.call(this,t)||this;return i._keyboardListener=new s,i._listener=i._keyboardListener.listen.bind(i._keyboardListener),i}return n.__extends(i,e),i.prototype.componentDidMount=function(){this._registerHandlers(this.props.keyboardEventHandlers)},i.prototype.componentWillReceiveProps=function(t){Object.is(this.props.keyboardEventHandlers,t.keyboardEventHandlers)||this._registerHandlers(t.keyboardEventHandlers)},i.prototype.render=function(){return r.createElement(t,n.__assign({},this.props,{onKeyDown:this._listener}))},i.prototype._registerHandlers=function(t){t&&(this._keyboardListener.deleteAllHandlers(),this._keyboardListener.registerHandlers(t))},i}(r.PureComponent)}var n,r,s
;Object.defineProperty(e,"__esModule",{value:!0}),n=i(5),r=i(2),function(t){t[t.Enter=13]="Enter",t[t.Space=32]="Space",t[t.Backspace=8]="Backspace",t[t.DownArrow=40]="DownArrow",t[t.UpArrow=38]="UpArrow",t[t.RightArrow=39]="RightArrow",t[t.LeftArrow=37]="LeftArrow",t[t.Escape=27]="Escape",t[t.Tab=9]="Tab"}(e.KeyCode||(e.KeyCode={})),s=function(){function t(){this._handlers=new Map}return t.prototype.registerHandlers=function(t){var e=this;Object.keys(t).forEach(function(i){var o,n=parseInt(i),r=t[n];Array.isArray(r)||(r=[r]),e._handlers.has(n)?(o=e._handlers.get(n))&&r.forEach(function(t){return o.add(t)}):e._handlers.set(n,new Set(r))})},t.prototype.unregisterHandlers=function(t){var e=this;Object.keys(t).forEach(function(i){var o,n=parseInt(i),r=t[n];Array.isArray(r)||(r=[r]),e._handlers.has(n)&&(o=e._handlers.get(n))&&r.forEach(function(t){return o.delete(t)})})},t.prototype.deleteAllHandlers=function(){this._handlers=new Map},t.prototype.registerHandler=function(t,e){if(this._handlers.has(t)){var i=this._handlers.get(t);i&&i.add(e)}else this._handlers.set(t,new Set([e]))},t.prototype.unregisterHandler=function(t,e){if(this._handlers.has(t)){var i=this._handlers.get(t);i&&i.delete(e)}},t.prototype.listen=function(t){if(this._handlers.has(t.keyCode)){var e=this._handlers.get(t.keyCode);e&&e.forEach(function(e){return e(t)})}},t}(),e.KeyboardListener=s,e.makeKeyboardListener=o},function(t,e,i){"use strict";function o(t){var i=e.formatLayerId(t),o=document.getElementById(i);return o||(o=document.createElement("div"),o.id=i,document.body.appendChild(o)),c[t]=(c[t]||0)+1,o}function n(t){var i=e.formatLayerId(t),o=document.getElementById(i);c[t]&&(c[t]-=1),o&&0===c[t]&&document.body.removeChild(o)}var r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),r=i(5),s=i(2),a=i(55),l=0,c={},e.formatLayerId=function(t){return"__outside-render-"+t},h=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.prototype.componentDidMount=function(){this._rememberLayer(),this._renderLayer()},e.prototype.componentDidUpdate=function(t){this.props.layerId!==t.layerId&&(n(this._layerId),this._rememberLayer()),this._renderLayer()},e.prototype.componentWillUnmount=function(){a.unmountComponentAtNode(this._layer),n(this._layerId)},e.prototype.render=function(){return null},e.prototype._rememberLayer=function(){var t=this.props.layerId,e=void 0===t?l+++"":t;this._layerId=e,this._layer=o(e)},e.prototype._renderLayer=function(){a.render(s.createElement("div",null,this.props.children),this._layer)},e}(s.Component),e.OutsideRenderWrap=h},function(t,e,i){"use strict";function o(){return n.createElement("div",{className:r.separator})}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(671),e.PopupMenuSeparator=o},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(2),r=i(55),s=i(26),a=i(288),l=i(77),c=i(673),h=i(28),u=i(1185),d=function(t){function e(e){var i=t.call(this,e)||this;return i._handleScrollTop=function(){
i.animateTo(Math.max(0,i.currentPosition()-(i.state.heightContent-50)))},i._handleScrollBot=function(){i.animateTo(Math.min((i.state.heightContent||0)-(i.state.heightWrap||0),i.currentPosition()+(i.state.heightContent-50)))},i._handleResizeWrap=function(t){var e=t.height;i.setState({heightWrap:e})},i._handleResizeContent=function(t){var e=t.height;i.setState({heightContent:e})},i._handleScroll=function(){var t=i.props.onScroll;t&&t(i.currentPosition(),i.isAtTop(),i.isAtBot()),i._checkButtonsVisibility()},i._checkButtonsVisibility=function(){var t,e,o,n,r;i.props.isVisibleButtons&&(t=i.state,e=t.isVisibleTopButton,o=t.isVisibleBotButton,n=i.isAtTop(),r=i.isAtBot(),n||e?n&&e&&i.setState({isVisibleTopButton:!1}):i.setState({isVisibleTopButton:!0}),r||o?r&&o&&i.setState({isVisibleBotButton:!1}):i.setState({isVisibleBotButton:!0}))},i.state={heightContent:0,heightWrap:0,isVisibleBotButton:!1,isVisibleTopButton:!1},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){this._checkButtonsVisibility()},e.prototype.componentDidUpdate=function(t,e){e.heightWrap===this.state.heightWrap&&e.heightContent===this.state.heightContent||this._handleScroll()},e.prototype.currentPosition=function(){return this._scroll?this._scroll.scrollTop:0},e.prototype.isAtTop=function(){return this.currentPosition()<=1},e.prototype.isAtBot=function(){return this.currentPosition()+this.state.heightWrap>=this.state.heightContent-1},e.prototype.animateTo=function(t,e){var i,o,n,s,a;void 0===e&&(e=h.dur),this._scroll&&(i=r.findDOMNode(this._scroll),o=i.scrollTop,n=-(o-t),a=function(r){s||(s=r);var l=(r-s)/e;l>=1&&(i.scrollTop=t),i.scrollTop!==t&&(i.scrollTop=Math.round(o+n*h.easingFunc.easeInOutCubic(l)),window.requestAnimationFrame(a))},window.requestAnimationFrame(a))},e.prototype.render=function(){var t,e,i,o=this,r=this.props,h=r.children,d=r.isVisibleScrollbar,p=r.isVisibleButtons,_=this.state,f=_.heightContent,m=_.heightWrap,g=_.isVisibleBotButton,v=_.isVisibleTopButton;return n.createElement(a,{whitelist:["height"],onMeasure:this._handleResizeWrap},n.createElement("div",{className:c.wrap},n.createElement("div",{className:s(c.scrollWrap,(t={},t[c.noScrollBar]=!d,t)),onScroll:this._handleScroll,ref:function(t){return o._scroll=t}},n.createElement(a,{onMeasure:this._handleResizeContent,whitelist:["height"]},n.createElement("div",{className:c.content},h))),p&&n.createElement("div",{className:s(c.scrollTop,(e={},e[c.isVisible]=v&&f>m,e)),onClick:this._handleScrollTop},n.createElement("div",{className:c.iconWrap},n.createElement(l.Icon,{icon:u,className:c.icon}))),p&&n.createElement("div",{className:s(c.scrollBot,(i={},i[c.isVisible]=g&&f>m,i)),onClick:this._handleScrollBot},n.createElement("div",{className:c.iconWrap},n.createElement(l.Icon,{icon:u,className:c.icon})))))},e.defaultProps={isVisibleScrollbar:!0},e}(n.PureComponent),e.Scroll=d},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(5),n=i(2),r=i(306),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}
return o.__extends(e,t),e.prototype.componentDidMount=function(){r.bind(this.props.keys,this.props.handler)},e.prototype.componentDidUpdate=function(t){this.props.keys===t.keys&&this.props.handler===t.handler||(r.unbind(t.keys),r.bind(this.props.keys,this.props.handler))},e.prototype.componentWillUnmount=function(){r.unbind(this.props.keys)},e.prototype.render=function(){return null},e}(n.PureComponent),e.Shortcut=s},,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 10" width="20" height="10"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M2 1l8 8 8-8"/></svg>'},,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 8" width="16" height="8"><path d="M0 1.475l7.396 6.04.596.485.593-.49L16 1.39 14.807 0 7.393 6.122 8.58 6.12 1.186.08z"/></svg>'},,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28"><path fill="#ffffff" d="M18 10V0h-8v10H0v8h10v10h8V18h10v-8"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M453.8 360.2l-92.1 6L234 517.7l-86.2-86.1L5.2 514.7v118.9h585.3V268.1z" opacity=".3"/><path d="M234 508.8c-156 222.067-78 111.033 0 0zm309-276.3l-71.3 95.1h-101L236.9 488l-92.1-112.9-38.6 41.6-101 98.1 41.6 41.6 95.1-95.1L234 574.2 397.4 387h104l89.1-118.9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 14" width="25" height="14" style="position:relative;top:3px"><path d="M10.43 8.683L9.345 8.68c-.943-.005-1.712-.774-1.716-1.717-.003-.452.172-.877.49-1.195.32-.32.744-.493 1.196-.492l4.002.016c.83.004 2.22.18 2.225 1.316.002.522.427.943.95.942.52-.002.942-.427.94-.95-.007-1.932-1.62-3.188-4.107-3.198l-4.003-.016c-.96-.003-1.862.368-2.54 1.045-.677.68-1.048 1.58-1.044 2.54.003.99.41 1.887 1.06 2.54.652.65 1.55 1.056 2.54 1.06l1.086.004c.522.002.947-.42.948-.942.002-.52-.42-.946-.942-.947zm13.832-1.655c-.008-2.076-1.41-3.59-3.33-3.597l-1.357-.003c-.522-.002-.947.42-.948.942-.002.52.42.946.94.947l1.356.006c.996.003 1.445.863 1.448 1.714.004.453-.17.878-.49 1.196-.317.32-.742.493-1.195.492l-4.27-.017c-1.952-.008-1.955-.924-1.957-1.315-.002-.522-.426-.943-.948-.942-.523.003-.945.428-.943.95.004.896.296 1.63.834 2.17.66.66 1.69 1.023 3.01 1.028l4.27.017c.96.003 1.86-.368 2.54-1.046.675-.678 1.046-1.58 1.043-2.54z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 4v7h-3v2h3v7h2v-2h3v-2h-3V4h-2zM7 6v12H4v2h3v2h2V10h3V8H9V6H7z"/></svg>'},,,,,,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M0 0v38h38V0H0zm7 29h24v4H7v-4z" class="bg"/><path d="M24.06 17.94L15.123 9l-1.41 1.41 2.38 2.38-5.15 5.15a1.49 1.49 0 0 0 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM12.713 19l4.79-4.79L22.29 19h-9.58zM26.5 20.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z" class="icon"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9zm-1 6h3v9H8v-9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill="none" stroke="currentColor"><path stroke-dasharray="1,1" d="M4 14.5h22"/><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 12.5l2-4 1 2 2-4 3 6"/><path stroke-linecap="round" d="M5.5 16.5l-1 2"/><path stroke-linecap="round" stroke-linejoin="round" d="M17.5 16.5l2 4 2-4m2-4l1-2-1 2z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 973.125"><path d="M960 832L710.875 582.875C746.438 524.812 768 457.155 768 384 768 171.97 596 0 384 0 171.97 0 0 171.97 0 384c0 212 171.97 384 384 384 73.156 0 140.812-21.562 198.875-57L832 960c17.5 17.5 46.5 17.375 64 0l64-64c17.5-17.5 17.5-46.5 0-64zM384 640c-141.375 0-256-114.625-256-256s114.625-256 256-256 256 114.625 256 256-114.625 256-256 256z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17"><path d="M8.5.36L6.45 2H1v1h2l-3 8a3.54 3.5 0 0 0 3.055 2.97 3.5 3.5 0 0 0 .004 0 3.54 3.5 0 0 0 .44.03 3.5 3.5 0 0 0 .35-.018A3.54 3.5 0 0 0 7 11L4 3h9l-3 8a3.54 3.5 0 0 0 3.502 3A3.54 3.5 0 0 0 17 11l-3-8h2V2h-5.45L8.5.36zm0 1.28l.45.36h-.9l.45-.36zm-5 2.694L6 11H1l2.5-6.666zm10 0L16 11h-5l2.5-6.666z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 16"><path d="M15.09 6.857s-.571 0-.724-.533c-.114-.457-.305-.876-.533-1.295-.229-.495.152-.876.152-.876l.571-.571c.229-.229.229-.61 0-.876l-.762-.762c-.229-.229-.61-.229-.876 0l-.571.571s-.381.381-.876.152c-.419-.229-.838-.419-1.295-.533-.533-.152-.533-.724-.533-.724v-.8a.602.602 0 0 0-.61-.61H7.966a.602.602 0 0 0-.61.61v.8s0 .571-.533.724c-.457.114-.876.305-1.295.533-.495.229-.876-.152-.876-.152l-.571-.571c-.229-.229-.61-.229-.876 0l-.762.762c-.229.229-.229.61 0 .876l.571.571s.381.381.152.876c-.229.419-.419.838-.533 1.295-.152.495-.724.533-.724.533h-.8a.602.602 0 0 0-.61.61v1.067c0 .343.267.61.61.61h.8s.571 0 .724.533c.114.457.305.876.533 1.295.229.495-.152.876-.152.876l-.571.571c-.229.229-.229.61 0 .876l.762.762c.229.229.61.229.876 0l.571-.571s.381-.381.876-.152c.419.229.838.419 1.295.533.495.152.533.724.533.724v.8c0 .343.267.61.61.61h1.067c.343 0 .61-.267.61-.61v-.8s0-.571.533-.724c.457-.114.876-.305 1.295-.533.495-.229.876.152.876.152l.571.571c.229.229.61.229.876 0l.762-.762c.229-.229.229-.61 0-.876l-.571-.571s-.381-.381-.152-.876c.229-.419.419-.838.533-1.295.152-.495.724-.533.724-.533h.8c.343 0 .61-.267.61-.61V7.467a.602.602 0 0 0-.61-.61h-.8zM8.5 11.555a3.541 3.541 0 0 1-3.556-3.556A3.541 3.541 0 0 1 8.5 4.443a3.541 3.541 0 0 1 3.556 3.556A3.561 3.561 0 0 1 8.5 11.555z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 18" width="26" height="18"><path d="M12 0C8.4 0 5.4 2.8 5.1 6.3 2 6.1.1 9 0 11.1 0 13.9 2.2 16 4.7 16h4.9l-1-1H4.7C2.8 15 1 13.3 1 11.2 1 9 3 6.7 6 7.4 6 3 9 1 12 1s3.7 1.2 5.1 2.9c1.5.1 3.3.6 4.2 1.7 1 1.5 1.2 2.6 1.2 4.2 1.4.4 2.5 1.5 2.5 2.7-.2 1.6-1.3 2.5-2.6 2.5h-5l-1 1h5.9c2.8 0 3.7-1.9 3.7-3.5s-1-3-2.5-3.4c0-1.6-.5-2.9-1.4-4.1-.9-1.2-2.7-2-4.5-2.1C16.3 1.2 14.3 0 12 0zm-2 7v5H7l6 6 6-6h-3V7h-6zm1 1h4v5h1.6L13 16.6 9.4 13H11V8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3 13" width="3" height="13"><path d="M2.919 11.662l-1.463-5.432v.676l1.5-5.568-1.456-.342-.037 11 1.456-.334zm-1.412.676c.284 1.053 1.452.785 1.456-.334l.037-11c.004-1.124-1.171-1.4-1.456-.342l-1.5 5.568c-.059.219-.059.458 0 .676l1.463 5.432z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M0 0v38h38V0H0zm7 29h24v4H7v-4z" class="bg"/><path d="M23.094 25.5L22 22.17h-5.904l-1.17 3.33H12.5l6.446-16h.574l5.98 16h-2.405zM19.13 13.637l-2.46 6.95h4.712l-2.252-6.95z" class="icon"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 14 14" width="14" height="14" enable-background="new -2.4 120.9 600 600"><path d="M-2.4 120.9v14h14v-14zm6.086 1.803H5.52v1.332c.416.1.805.258 1.166.48l.944-.935 1.297 1.297-.943.943c.215.35.38.748.48 1.164H9.8v1.837H8.463c-.1.417-.257.806-.48 1.167l.935.944-1.296 1.298-.944-.943c-.35.215-.747.38-1.164.48v1.332H3.677v-1.33c-.415-.102-.804-.258-1.165-.482l-.943.936-1.298-1.296.94-.945c-.216-.35-.38-.748-.482-1.165H-.597v-1.835H.737c.1-.416.257-.805.48-1.166l-.935-.944 1.296-1.297.944.943c.35-.215.747-.38 1.164-.48zm.912 3.053c-1.188 0-2.143.963-2.143 2.143 0 1.187.963 2.143 2.143 2.143 1.18 0 2.14-.963 2.145-2.145 0-1.188-.966-2.144-2.145-2.144z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586.09999 586.09996" width="586.1" height="586.1" enable-background="new 0 0 595.3 841.9"><path d="M172.6 367.9l-97.7 97.7L0 390.7v195.4h195.4l-74.9-74.9 97.7-97.7-45.6-45.6zM195.4 0H0v195.4l74.9-74.9 97.7 97.7 45.6-45.6-97.7-97.7L195.4 0zm195.3 0l74.9 74.9-97.7 97.7 45.6 45.6 97.7-97.7 74.9 74.9V0H390.7zm22.8 367.9l-45.6 45.6 97.7 97.7-74.9 74.9h195.4V390.7l-74.9 74.9-97.7-97.7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M5.5 13A2.5 2.5 0 0 0 3 15.5 2.5 2.5 0 0 0 5.5 18 2.5 2.5 0 0 0 8 15.5 2.5 2.5 0 0 0 5.5 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5A2.5 2.5 0 0 0 15 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 15 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5 2.5 2.5 0 0 0-2.5-2.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 2.69c3.018 0 5.172 3.232 5.172 4.31 0 1.077-2.154 4.31-5.172 4.31S1.828 8.08 1.828 7c0-1.077 2.154-4.31 5.172-4.31zm0 1.508C5.49 4.198 4.198 5.49 4.198 7S5.49 9.802 7 9.802 9.802 8.51 9.802 7 8.51 4.198 7 4.198zm0 1.68c.646 0 1.12.476 1.12 1.122 0 .646-.473 1.12-1.12 1.12-.646 0-1.12-.473-1.12-1.12 0-.646.473-1.12 1.12-1.12z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9zm6 3h3v10h-3V7zm-7 3h3v9H8v-9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17"><path d="M16 0a1 1 0 0 0-1 1 1 1 0 0 0 .127.484L13.017 5A1 1 0 0 0 13 5a1 1 0 0 0-.258.035L10.965 3.26A1 1 0 0 0 11 3a1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 .082.393L7.12 6.008a1 1 0 0 0-.12-.01 1 1 0 0 0-.44.104l-1.564-1.04A1 1 0 0 0 5 4.998a1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 .002.066l-1.56 1.04A1 1 0 0 0 1 5.998a1 1 0 0 0-1 1 1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.002-.064l1.56-1.04A1 1 0 0 0 4 6a1 1 0 0 0 .44-.103l1.564 1.04A1 1 0 0 0 6 7a1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.082-.39l1.965-2.62A1 1 0 0 0 10 4a1 1 0 0 0 .258-.035l1.777 1.777A1 1 0 0 0 12 6a1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.127-.482L15.983 2A1 1 0 0 0 16 2a1 1 0 0 0 1-1 1 1 0 0 0-1-1zm-1 5v10h2V5h-2zM9 7v8h2V7H9zM3 9v6h2V9H3zm9 1v5h2v-5h-2zM0 11v4h2v-4H0zm6 0v4h2v-4H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M14 14V0H0v14zm-7-2L4.2 9H6V3h2v6h1.8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 1l2.8 3H8v2.5H6V4H4.2zM6 7.5h2V10h1.8L7 13l-2.8-3H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0H0zm6 1.5h2V4h1.8L7 7l2.8 3H8v2.5H6V10H4.2L7 7 4.2 4H6V1.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 2l2.8 3H8v6H6V5H4.2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M1.5 2a.5.5 0 0 0 0 1H5V2zM7 2v1h3V2zm5 0v1h3V2zm5 0v1h3.5a.5.5 0 0 0 0-1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M1.5 2a.5.5 0 0 0 0 1H3V2H1.5zM4 2v1h2V2H4zm3 0v1h2V2H7zm3 0v1h2V2h-2zm3 0v1h2V2h-2zm3 0v1h2V2h-2zm3 0v1h1.5a.5.5 0 0 0 0-1H19z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M0 2.5L8 0v5zm20 0a.5.5 0 1 1 1 0 .5.5 0 1 1-1 0z"/><path d="M20.5 3H7V2h13.5z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M0 2.5a.5.5 0 1 1 1 0 .5.5 0 1 1-1 0zm18 0a2 2 0 1 1 4 0 2 2 0 1 1-4 0zm-9 0a2 2 0 1 1 4 0 2 2 0 1 1-4 0z"/><path d="M19 3H.5V2H19z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M20 2.5a.5.5 0 1 1 1 0 .5.5 0 1 1-1 0zm-19 0a2 2 0 1 1 4 0 2 2 0 1 1-4 0z"/><path d="M20.5 3H3V2h17.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M22 2.5L14 5V0zM2 2.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0z"/><path d="M1.5 2H15v1H1.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M22 2.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0zM4 2.5a2 2 0 1 1-4 0 2 2 0 1 1 4 0zM13 2.5a2 2 0 1 1-4 0 2 2 0 1 1 4 0z"/><path d="M3 2h18.5v1H3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 2.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0zM21 2.5a2 2 0 1 1-4 0 2 2 0 1 1 4 0z"/><path d="M1.5 2H19v1H1.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M1.5 2a.5.5 0 0 0 0 1h19a.5.5 0 0 0 0-1h-19z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 2a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2H2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 1a1.5 1.5 0 0 0 0 3h18a1.5 1.5 0 0 0 0-3H2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 1a2 2 0 0 0 0 4h18a2 2 0 0 0 0-4H2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M142.5 447.4c-102.74 102.74-83.44 83.44 0 0m399-186.2l-70.9 94.6H370.1l-136 159.6-91.6-112.3-38.5 41.4L6.5 542l41.4 41.4 94.6-94.6 91.6 112.3 162.6-186.2h103.5l88.7-118.2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 15"><path d="M1 0C.45 0 0 .45 0 1v11h1V1h9V0H1zm2.467 2C2.66 2 2 2.65 2 3.444v10.111c0 .794.66 1.444 1.467 1.444h8.067c.807 0 1.467-.65 1.467-1.444V3.444c0-.794-.66-1.444-1.467-1.444H3.467zM3 3h9v11H3V3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M1.5 2H0v12c0 .825.675 1.5 1.5 1.5h12V14h-12V2zm13.056-2H4.445c-.794 0-1.444.65-1.444 1.444v10.111c0 .794.65 1.444 1.444 1.444h10.111c.794 0 1.444-.65 1.444-1.444V1.444C16 .65 15.35 0 14.556 0z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 12"><path d="M8.25 0C4.5 0 1.297 2.332 0 5.625c1.297 3.292 4.5 5.625 8.25 5.625s6.953-2.333 8.25-5.625C15.203 2.332 12 0 8.25 0zm0 9.375c-2.07 0-3.75-1.68-3.75-3.75 0-2.07 1.68-3.75 3.75-3.75 2.07 0 3.75 1.68 3.75 3.75 0 2.07-1.68 3.75-3.75 3.75zm0-6C7.005 3.375 6 4.38 6 5.625s1.005 2.25 2.25 2.25 2.25-1.005 2.25-2.25-1.005-2.25-2.25-2.25z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M0 0v38h38V0H0zm7 29h24v4H7v-4z" class="bg"/><path d="M24.748 16l-3.75-3.748-9.998 10V26h3.75l9.998-10zm2.96-2.96a.996.996 0 0 0 0-1.408l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.96 1.96 3.75 3.75 1.96-1.96z" class="icon"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 600 600" enable-background="new -2.4 120.9 600 600"><path d="M594 473.5V368.8h-76c-5.7-23.8-15.2-46.4-27.5-66.4l53.8-53.8-73.9-73.9-53.8 53.4c-20.6-12.8-42.7-21.8-66.4-27.5v-75.9H245.5v75.9c-23.8 5.7-46.4 15.2-66.4 27.5l-53.8-53.8-73.9 73.9 53.4 53.8C92 322.6 83 344.7 77.3 368.4h-76V473h75.9c5.7 23.8 15.2 46.4 27.5 66.4L51 593.3l73.9 73.9 53.8-53.4c20.6 12.8 42.7 21.8 66.4 27.5v75.9h104.6v-75.9c23.8-5.7 46.4-15.2 66.4-27.5l53.8 53.8 73.9-73.9-53.4-53.8c12.8-20.6 21.8-42.7 27.5-66.4H594zm-296.4 69.7c-67.3 0-122.3-54.6-122.3-122.3 0-67.3 54.6-122.3 122.3-122.3 67.3 0 122.3 54.6 122.3 122.3-.4 67.4-54.9 122.3-122.3 122.3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path d="M7.5 8.2v3.2L15 6.5 7.5 1.7V5S0 4.1 0 13.4c0-.1 1.7-5.2 7.5-5.2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.8 13.4" enable-background="new 0 0 14.8 13.4"><path d="M8 6.7L1.7 0 .1 1.7l4.7 4.9-4.8 5 1.7 1.8L8 6.7zm6.8 0L8.4 0 6.8 1.7l4.7 4.9-4.8 5 1.7 1.8 6.4-6.7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 11.5"><path d="M7.5 4.8c-1.1 0-1.9.9-1.9 1.9s.9 1.9 1.9 1.9c1.1 0 1.9-.9 1.9-1.9s-.9-1.9-1.9-1.9zM13 1.9h-2.2c0-1-.9-1.9-2-1.9H6.1C5 0 4.2.9 4.2 1.9H1.9c-1 0-1.9.9-1.9 2v5.7c0 1.1.9 1.9 1.9 1.9H13c1.1 0 1.9-.9 1.9-1.9V3.9c.1-1.1-.8-2-1.9-2zm-5.5 8.3C5.6 10.2 4 8.6 4 6.7s1.5-3.4 3.4-3.4 3.4 1.5 3.4 3.4c.1 1.9-1.4 3.5-3.3 3.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M2 0a2 2 0 0 0-2 2v14h14a2 2 0 0 0 2-2H2zm2 0v2h3V0zm5 0v2h3V0zm5 0v2h2a2 2 0 0 0-2-2zm0 4v3h2V4zm0 5v3h2V9z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M21.487 5.248l-12.019 1.502.124.992 12.019-1.502zM6.619 9.355l-2.217 11.083.981.196 2.217-11.083zM6.534 22.75l12.071-1.509-.124-.992-12.071 1.509zM21.387 18.612l2.21-11.048-.981-.196-2.21 11.048zM8.507 9.214l10.255 10.255.707-.707-10.255-10.255z"/><path d="M7.5 9c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM20.5 22c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M16 11c0-3.314-2.686-6-6-6s-6 2.686-6 6c0 2.913 2.872 8.112 6 11.551 3.128-3.438 6-8.638 6-11.551zm-6 13c-3-3-7-9.134-7-13 0-3.866 3.134-7 7-7s7 3.134 7 7-4 10-7 13z"/><ellipse cx="10" cy="11" rx="2" ry="2"/><path fill-rule="nonzero" d="M25 20c0 2.485-2.015 4-4.5 4s-4.5-1.515-4.5-4h1c0 1.797 1.421 3 3.5 3 2.079 0 3.5-1.203 3.5-3h1zm-1 0h1c0 2.485-2.015 4-4.5 4s-4.5-1.515-4.5-4h1c0 1.797 1.421 3 3.5 3 2.079 0 3.5-1.203 3.5-3z"/><path fill-rule="nonzero" d="M18 19h5v-1h-5zM20 15.5v8h1v-8z"/><ellipse cx="20.5" cy="14.5" rx="1.5" ry="1.5"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M25 19c0 2.485-2.015 4-4.5 4s-4.5-1.515-4.5-4h1c0 1.797 1.421 3 3.5 3 2.079 0 3.5-1.203 3.5-3h1zm-1 0h1c0 2.485-2.015 4-4.5 4s-4.5-1.515-4.5-4h1c0 1.797 1.421 3 3.5 3 2.079 0 3.5-1.203 3.5-3z"/><path fill-rule="nonzero" d="M18 18h5v-1h-5zM20 14.5v8h1v-8z" id="Line"/><ellipse cx="20.5" cy="13.5" rx="1.5" ry="1.5"/><path fill-rule="nonzero" d="M11 5.5v17h1v-17z" id="Line"/><path fill-rule="nonzero" d="M6 8.5v-2.001c0-.272.229-.499.502-.499h9.995c.28 0 .502.221.502.499v2.001h1v-2.001c0-.832-.672-1.499-1.502-1.499h-9.995c-.824 0-1.502.673-1.502 1.499v2.001h1z"/><path fill-rule="nonzero" d="M9 23h5v-1h-5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.013 23.846c4.923 2.247 9.792 2.626 13.448-.517l-.652-.758c-3.277 2.817-7.775 2.467-12.381.365l-.415.91z"/><path d="M24.035 20.056c2.262-4.176 1.814-8.73-.13-12.98l-.909.416c1.826 3.993 2.244 8.24.16 12.088l.879.476z"/><path d="M8.221 21.401l13.249-14.077-.728-.685-13.249 14.077z"/><path d="M6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M17 12v-6h-6v6h-4.865l7.865 9.438 7.865-9.438h-4.865zm-7-7h8v6h6l-10 12-10-12h6v-6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M16 17h6v-6h-6v-4.865l-9.438 7.865 9.438 7.865v-4.865zm7 1h-6v6l-12-10 12-10v6h6v8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M12 11h-6v6h6v4.865l9.438-7.865-9.438-7.865v4.865zm-7 7v-8h6v-6l12 10-12 10v-6h-6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M11 16v6h6v-6h4.865l-7.865-9.438-7.865 9.438h4.865zm7 7h-8v-6h-6l10-12 10 12h-6v6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M11.682 16.09l3.504 6.068 1.732-1-3.497-6.057 3.595-2.1L8 7.74v10.512l3.682-2.163zm-.362 1.372L7 20V6l12 7-4.216 2.462 3.5 6.062-3.464 2-3.5-6.062z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M9.586 18h7.414c3.309 0 6-2.689 6-6 0-3.309-2.687-6-5.994-6h-5.012c-3.306 0-5.994 2.686-5.994 5.994v9.592l3.586-3.586zm-4.586 6v-12.006c0-3.863 3.137-6.994 6.994-6.994h5.012c3.863 0 6.994 3.142 6.994 7 0 3.866-3.142 7-7 7h-7l-5 5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M6 6v6.5h1v-6.5zM7 22v-2.5h-1v2.5zM11 11v2.5h1v-2.5zM12 24v-7.5h-1v7.5zM16 5v5.5h1v-5.5zM17 21v-2.5h-1v2.5zM21 7v4.5h1v-4.5zM22 19v-2.5h-1v2.5z"/><path d="M6 13v6h1v-6h-1zm-1-1h3v8h-3v-8z"/><path d="M11 16h1v-2h-1v2zm-1-3h3v4h-3v-4z"/><path d="M16 18h1v-7h-1v7zm-1-8h3v9h-3v-9z"/><path d="M21 16h1v-4h-1v4zm-1-5h3v6h-3v-6z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M1.789 23l.859-.854.221-.228c.18-.19.38-.409.597-.655.619-.704 1.238-1.478 1.815-2.298.982-1.396 1.738-2.776 2.177-4.081 1.234-3.667 5.957-4.716 8.923-1.263 3.251 3.785-.037 9.38-5.379 9.38h-9.211zm9.211-1c4.544 0 7.272-4.642 4.621-7.728-2.45-2.853-6.225-2.015-7.216.931-.474 1.408-1.273 2.869-2.307 4.337-.599.852-1.241 1.653-1.882 2.383l-.068.078h6.853z"/><path d="M18.182 6.002l-1.419 1.286c-1.031.935-1.075 2.501-.096 3.48l1.877 1.877c.976.976 2.553.954 3.513-.045l5.65-5.874-.721-.693-5.65 5.874c-.574.596-1.507.609-2.086.031l-1.877-1.877c-.574-.574-.548-1.48.061-2.032l1.419-1.286-.672-.741z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M6 21.586l3.586-3.586h13.407c.004 0 .007-11.993.007-11.993 0-.007-17-.007-17-.007v15.586zm-1 2.414v-18.005c0-.549.451-.995.995-.995h17.01c.549 0 .995.45.995 1.007v11.986c0 .556-.45 1.007-1.007 1.007h-12.993l-5 5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path d="M18 15h8v-1h-8z"/><path d="M14 18v8h1v-8zM14 3v8h1v-8zM3 15h8v-1h-8z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M6.256 20.652c.548-3.024 1.607-5.962 3.329-8.312l-.807-.591c-1.825 2.493-2.933 5.565-3.506 8.725l.984.178z"/><path d="M12.243 9.657c2.365-1.764 5.345-2.846 8.416-3.402l-.178-.984c-3.21.581-6.326 1.712-8.836 3.584l.598.802z"/><path d="M10.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M23 4v21h1v-21z"/><path d="M17 4v21h1v-21z"/><path d="M5 16.5v8.5h1v-8.5z"/><path d="M5 4v8.5h1v-8.5z"/><path d="M5.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M11 16.5v8.5h1v-8.5z"/><path d="M11 4v8.5h1v-8.5z"/><path d="M11.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path d="M15.246 21.895l1.121.355c-.172.625-.458 1.089-.857 1.393-.4.303-.907.455-1.521.455-.76 0-1.385-.26-1.875-.779-.49-.52-.734-1.23-.734-2.131 0-.953.246-1.693.738-2.221.492-.527 1.139-.791 1.941-.791.701 0 1.27.207 1.707.621.26.245.456.596.586 1.055l-1.145.273c-.068-.297-.209-.531-.424-.703-.215-.172-.476-.258-.783-.258-.424 0-.769.152-1.033.457-.264.305-.396.798-.396 1.48 0 .724.13 1.24.391 1.547.26.307.599.461 1.016.461.307 0 .572-.098.793-.293.221-.195.38-.503.477-.922z"/><path fill-rule="nonzero" d="M20.449 8.505l2.103 9.112.974-.225-2.103-9.112zM13.943 14.011l7.631 4.856.537-.844-7.631-4.856zM14.379 11.716l4.812-3.609-.6-.8-4.812 3.609zM10.96 13.828l-4.721 6.744.819.573 4.721-6.744zM6.331 20.67l2.31-13.088-.985-.174-2.31 13.088zM9.041 7.454l1.995 3.492.868-.496-1.995-3.492z"/><path fill-rule="nonzero" d="M8.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM12.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM20.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M6.5 23v1h17.5v-17.5h-1v16.5z"/><path fill-rule="nonzero" d="M21.5 5v-1h-17.5v17.5h1v-16.5z"/><path fill-rule="nonzero" d="M4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path fill-rule="nonzero" d="M13 9v13h1v-13z" id="Line"/><path d="M13.5 6l2.5 3h-5z"/><path fill-rule="nonzero" d="M19 14h-13v1h13z"/><path d="M19 17v-5l3 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M20 14h-14v1h14z" id="Line"/><path d="M20 17v-5l3 2.5z"/><path fill-rule="nonzero" d="M24 8.5v16.5h1v-16.5zM4 4v16.5h1v-16.5z"/><path fill-rule="nonzero" d="M4.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M20.534 4.664l-13.318 4.701.333.943 13.318-4.701zM20.802 22.371l-13.285-4.689-.333.943 13.285 4.689z"/><path d="M5.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 19c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><circle cx="14" cy="14" r="3"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M17.605 19.584c.295-2.304-.584-3.586-3.274-5.959-2.462-2.172-3.191-3.241-2.94-5.111l-.991-.133c-.312 2.322.567 3.61 3.269 5.994 2.452 2.163 3.181 3.227 2.943 5.083l.992.127z"/><path d="M6.053 24.868c3.772 1.644 7.307 1.643 9.712-1.249l-.769-.64c-2.045 2.458-5.133 2.459-8.544.972l-.4.917z"/><path d="M12.949 5.087c2.044-2.525 5.157-2.54 8.602-1.036l.4-.917c-3.81-1.663-7.376-1.646-9.779 1.324l.777.629z"/><path d="M4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM16.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM11.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M23.002 23C23 23 23 18.003 23 18.003L15.998 18C16 18 16 22.997 16 22.997l7.002.003zM15 18.003A1 1 0 0 1 15.998 17h7.004c.551 0 .998.438.998 1.003v4.994A1 1 0 0 1 23.002 24h-7.004A.993.993 0 0 1 15 22.997v-4.994z"/><path d="M19 20h1v2h-1z"/><path fill-rule="nonzero" d="M22 17.5v-2a2.5 2.5 0 0 0-5 0v2h1v-2a1.5 1.5 0 0 1 3 0v2h1z"/><g fill-rule="nonzero"><path d="M3 14.707A1 1 0 0 1 3.293 14L14.439 2.854a1.5 1.5 0 0 1 2.122 0l2.585 2.585a1.5 1.5 0 0 1 0 2.122L8 18.707a1 1 0 0 1-.707.293H4a1 1 0 0 1-1-1v-3.293zm1 0V18h3.293L18.439 6.854a.5.5 0 0 0 0-.708l-2.585-2.585a.5.5 0 0 0-.708 0L4 14.707z"/><path d="M13.146 4.854l4 4 .708-.708-4-4zm-9 9l4 4 .708-.708-4-4z"/><path d="M15.146 6.146l-9 9 .708.708 9-9z"/></g></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M23.002 23C23 23 23 18.003 23 18.003L15.998 18C16 18 16 22.997 16 22.997l7.002.003zM15 18.003A1 1 0 0 1 15.998 17h7.004c.551 0 .998.438.998 1.003v4.994A1 1 0 0 1 23.002 24h-7.004A.993.993 0 0 1 15 22.997v-4.994z"/><path d="M19 20h1v2h-1z"/><path fill-rule="nonzero" d="M22 14.5a2.5 2.5 0 0 0-5 0v3h1v-3a1.5 1.5 0 0 1 3 0v.5h1v-.5z"/><g fill-rule="nonzero"><path d="M3 14.707A1 1 0 0 1 3.293 14L14.439 2.854a1.5 1.5 0 0 1 2.122 0l2.585 2.585a1.5 1.5 0 0 1 0 2.122L8 18.707a1 1 0 0 1-.707.293H4a1 1 0 0 1-1-1v-3.293zm1 0V18h3.293L18.439 6.854a.5.5 0 0 0 0-.708l-2.585-2.585a.5.5 0 0 0-.708 0L4 14.707z"/><path d="M13.146 4.854l4 4 .708-.708-4-4zm-9 9l4 4 .708-.708-4-4z"/><path d="M15.146 6.146l-9 9 .708.708 9-9z"/></g></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M13.746 7h-1.258l-.5-1.301h-2.289l-.473 1.301h-1.227l2.23-5.727h1.223l2.293 5.727zm-2.129-2.266l-.789-2.125-.773 2.125h1.563z"/><path d="M26.246 4.895l1.121.355c-.172.625-.458 1.089-.857 1.393-.4.303-.907.455-1.521.455-.76 0-1.385-.26-1.875-.779-.49-.52-.734-1.23-.734-2.131 0-.953.246-1.693.738-2.221.492-.527 1.139-.791 1.941-.791.701 0 1.27.207 1.707.621.26.245.456.596.586 1.055l-1.145.273c-.068-.297-.209-.531-.424-.703-.215-.172-.476-.258-.783-.258-.424 0-.769.152-1.033.457-.264.305-.396.798-.396 1.48 0 .724.13 1.24.391 1.547.26.307.599.461 1.016.461.307 0 .572-.098.793-.293.221-.195.38-.503.477-.922z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M8.395 7l-1.367-5.727h1.184l.863 3.934 1.047-3.934h1.375l1.004 4 .879-4h1.164l-1.391 5.727h-1.227l-1.141-4.281-1.137 4.281z"/><path d="M24.086 7v-2.41l-2.098-3.316h1.355l1.348 2.266 1.32-2.266h1.332l-2.105 3.324v2.402z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M11.148 7h-1.098v-4.137c-.401.375-.874.652-1.418.832v-.996c.286-.094.598-.271.934-.533.336-.262.566-.567.691-.916h.891v5.75z"/><path d="M23.355 5.527l1.094-.113c.031.247.124.443.277.588.154.145.331.217.531.217.229 0 .423-.093.582-.279.159-.186.238-.467.238-.842 0-.352-.079-.615-.236-.791-.158-.176-.363-.264-.615-.264-.315 0-.598.139-.848.418l-.891-.129.563-2.98h2.902v1.027h-2.07l-.172.973c.245-.122.495-.184.75-.184.487 0 .9.177 1.238.531.339.354.508.814.508 1.379 0 .471-.137.892-.41 1.262-.372.505-.889.758-1.551.758-.529 0-.96-.142-1.293-.426-.333-.284-.533-.665-.598-1.145z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M13.746 7h-1.258l-.5-1.301h-2.289l-.473 1.301h-1.227l2.23-5.727h1.223l2.293 5.727zm-2.129-2.266l-.789-2.125-.773 2.125h1.563z"/><path d="M22.582 7v-5.727h4.246v.969h-3.09v1.27h2.875v.965h-2.875v1.559h3.199v.965z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M8.395 7l-1.367-5.727h1.184l.863 3.934 1.047-3.934h1.375l1.004 4 .879-4h1.164l-1.391 5.727h-1.227l-1.141-4.281-1.137 4.281z"/><path d="M22.086 7v-1.043l3.008-3.715h-2.668v-.969h4.191v.898l-3.137 3.863h3.258v.965z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M12.435 6.136c-4.411.589-7.983 3.039-9.085 6.27l.946.323c.967-2.836 4.209-5.059 8.271-5.602l-.132-.991zM3.347 16.584c1.101 3.243 4.689 5.701 9.117 6.283l.13-.991c-4.079-.537-7.335-2.767-8.301-5.613l-.947.321zM16.554 22.865c4.381-.582 7.94-3 9.071-6.2l-.943-.333c-.994 2.811-4.224 5.006-8.26 5.542l.132.991zM25.646 12.394c-1.107-3.225-4.675-5.668-9.078-6.257l-.133.991c4.056.542 7.293 2.76 8.265 5.591l.946-.325z"/><path d="M14.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM25.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29 31" width="29" height="31"><g fill-rule="nonzero"><path d="M15.3 22l8.187-8.187c.394-.394.395-1.028.004-1.418l-4.243-4.243c-.394-.394-1.019-.395-1.407-.006l-11.325 11.325c-.383.383-.383 1.018.007 1.407l1.121 1.121h7.656zm-9.484-.414c-.781-.781-.779-2.049-.007-2.821l11.325-11.325c.777-.777 2.035-.78 2.821.006l4.243 4.243c.781.781.78 2.048-.004 2.832l-8.48 8.48h-8.484l-1.414-1.414z"/><path d="M13.011 22.999h7.999v-1h-7.999zM13.501 11.294l6.717 6.717.707-.707-6.717-6.717z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4.354 25.354l5-5-.707-.707-5 5z"/><path d="M12.354 17.354l5-5-.707-.707-5 5z"/><path d="M20.354 9.354l5-5-.707-.707-5 5z"/><path d="M18.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.463 12.026l13.537-7.167-.468-.884-13.537 7.167z"/><path d="M22.708 16.824l-17.884 9.468.468.884 17.884-9.468z"/><path d="M22.708 9.824l-15.839 8.386.468.884 15.839-8.386z"/><path d="M5.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 5c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M23.868 7.825c2.791 3.916 2.918 9.33-.065 13.435-3.733 5.138-10.925 6.277-16.063 2.544l.721-.714c4.682 3.294 11.157 2.229 14.534-2.418 2.641-3.635 2.657-8.502.153-12.133l.721-.714z"/><path d="M8.477 5.899c3.584-2.509 8.298-2.514 11.865-.127l.718-.721c-3.845-2.669-9.099-2.813-13.157.028-5.203 3.643-6.467 10.814-2.824 16.016l.718-.721c-3.201-4.737-2.022-11.185 2.68-14.476z"/><path d="M14.5 22c4.142 0 7.5-3.358 7.5-7.5 0-4.142-3.358-7.5-7.5-7.5-4.142 0-7.5 3.358-7.5 7.5 0 4.142 3.358 7.5 7.5 7.5zm0 1c-4.694 0-8.5-3.806-8.5-8.5s3.806-8.5 8.5-8.5 8.5 3.806 8.5 8.5-3.806 8.5-8.5 8.5z"/><path d="M14.5 19c2.485 0 4.5-2.015 4.5-4.5s-2.015-4.5-4.5-4.5-4.5 2.015-4.5 4.5 2.015 4.5 4.5 4.5zm0 1c-3.038 0-5.5-2.462-5.5-5.5s2.462-5.5 5.5-5.5 5.5 2.462 5.5 5.5-2.462 5.5-5.5 5.5z"/><path d="M22.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M3 5h22v-1h-22z"/><path d="M3 17h22v-1h-22z"/><path d="M3 11h19.5v-1h-19.5z"/><path d="M5.5 23h19.5v-1h-19.5z"/><path d="M3.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8 9.5c0 3.038 2.462 5.5 5.5 5.5s5.5-2.462 5.5-5.5v-.5h-1v.5c0 2.485-2.015 4.5-4.5 4.5s-4.5-2.015-4.5-4.5v-.5h-1v.5z"/><path d="M0 9.5c0 7.456 6.044 13.5 13.5 13.5s13.5-6.044 13.5-13.5v-.5h-1v.5c0 6.904-5.596 12.5-12.5 12.5s-12.5-5.596-12.5-12.5v-.5h-1v.5z"/><path d="M4 9.5c0 4.259 2.828 7.964 6.86 9.128l.48.139.277-.961-.48-.139c-3.607-1.041-6.137-4.356-6.137-8.167v-.5h-1v.5z"/><path d="M16.141 18.628c4.032-1.165 6.859-4.869 6.859-9.128v-.5h-1v.5c0 3.811-2.53 7.125-6.136 8.167l-.48.139.278.961.48-.139z"/><path d="M13.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM13.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4 2v19.5h1v-19.5zM15.5 10h-11v1h11zM17 12.5v11h1v-11zM6.29 22.417l10.162-10.162-.707-.707-10.162 10.162z" id="Line"/><path d="M19.264 9.443l6.589-6.589-.707-.707-6.589 6.589z"/><path d="M6.577 23.381l19.071-5.903-.296-.955-19.071 5.903z"/><path d="M5.573 21.724l5.905-19.076-.955-.296-5.905 19.076z"/><path d="M6.5 24h19.5v-1h-19.5z"/><path d="M4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4.395 10.18c3.432-4.412 10.065-4.998 13.675-.973l.745-.668c-4.044-4.509-11.409-3.858-15.209 1.027l.789.614z"/><path d="M19.991 12.494c.877 2.718.231 5.487-1.897 7.543-2.646 2.556-6.752 2.83-9.188.477-1.992-1.924-2.027-5.38-.059-7.281 1.582-1.528 3.78-1.587 5.305-.115 1.024.99 1.386 2.424.876 3.491l.902.431c.709-1.482.232-3.37-1.084-4.641-1.921-1.855-4.734-1.78-6.695.115-2.378 2.297-2.337 6.405.059 8.719 2.846 2.749 7.563 2.435 10.577-.477 2.407-2.325 3.147-5.493 2.154-8.569l-.952.307z"/><path d="M21.01 9.697l3.197-3.197-.707-.707-3.197 3.197z"/><path d="M14.989 15.719l3.674-3.674-.707-.707-3.674 3.674z"/><path d="M13.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM19.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M17 4v21h1v-21z"/><path d="M23 4v21h1v-21z"/><path d="M5 16.5v8.5h1v-8.5z"/><path d="M5 4v8.5h1v-8.5z"/><path d="M11 16.5v8.5h1v-8.5z"/><path d="M11 4v8.5h1v-8.5z"/><path d="M5.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM11.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M21.5 23h-14v1h14zM5 7.5v14h1v-14z"/><path d="M12 23c0-3.314-2.686-6-6-6h-.5v1h.5c2.761 0 5 2.239 5 5v.5h1v-.5z"/><path d="M20 23c0-7.732-6.268-14-14-14h-.5v1h.5c7.18 0 13 5.82 13 13v.5h1v-.5z"/><path d="M16 23c0-5.523-4.477-10-10-10h-.5v1h.5c4.971 0 9 4.029 9 9v.5h1v-.5z"/><path d="M5.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M7.382 16h14.483l-4.167-5 4.167-5h-15.865v12.764l1.382-2.764zm-2.382 7v-18h19l-5 6 5 6h-16l-3 6z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.5 23h13v-1h-13z"/><path d="M7.55 13.088l13.29-6.254-.426-.905-13.29 6.254z"/><path d="M5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 15c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path d="M19 11h5l-2.5 3z"/><circle cx="21.5" cy="16.5" r="1.5"/><path fill-rule="nonzero" d="M22 11v-6h-1v6z"/><path d="M14 18h1v3h-1z" id="Path"/><path d="M14 5h1v6h-1z"/><path d="M7 19h1v3h-1z"/><path d="M7 6h1v7h-1z"/><path fill-rule="nonzero" d="M7 13v6h1v-6h-1zm-1-1h3v8h-3v-8zM14 18h1v-7h-1v7zm-1-8h3v9h-3v-9z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M3.5 11h21v-1h-21z"/><path d="M3.5 18h21v-1h-21z"/><path d="M10 3.5v21h1v-21z"/><path d="M17 3.5v21h1v-21z"/><path d="M22.5 4v-1h-19.5v19.5h1v-18.5z"/><path d="M24 24h-18.507v1h19.507v-19.5h-1z"/><path d="M3.5 26c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 5c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.354 21.354l7.097-7.097-.707-.707-7.097 7.097z"/><path d="M17.249 11.458l7.105-7.105-.707-.707-7.105 7.105z"/><path d="M7.542 22.683l17.296-2.739-.156-.988-17.296 2.739z" id="Line"/><path d="M7.538 22.062l15.708-7.661-.438-.899-15.708 7.661z"/><path d="M6.802 20.97l7.695-15.777-.899-.438-7.695 15.777z"/><path d="M6.285 20.741l2.76-17.423-.988-.156-2.76 17.423z"/><path d="M5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM15.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M22.5 4v-1h-19.5v19.5h1v-18.5z"/><path d="M5.493 24v1h19.507v-19.5h-1v18.5z"/><path d="M5.275 23.432l18.213-18.213-.707-.707-18.213 18.213z"/><path d="M5.568 24.383l19.079-5.906-.296-.955-19.079 5.906z" id="Line-Copy-18"/><path d="M4.587 22.68l5.891-19.032-.955-.296-5.891 19.032z"/><path d="M3.5 11h21v-1h-21z"/><path d="M3.5 18h21v-1h-21z"/><path d="M10 3.5v21h1v-21z"/><path d="M17 3.5v21h1v-21z"/><path d="M23.975 23.475l1.025 1.025c0-11.874-9.626-21.5-21.5-21.5l1.025 1.025c10.506.517 18.932 8.944 19.45 19.45z"/><path d="M3.5 26c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 5c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M4.529 18.21l3.157-1.292-.379-.926-3.157 1.292z"/><path fill-rule="nonzero" d="M9.734 16.081l2.97-1.215-.379-.926-2.97 1.215z"/><path fill-rule="nonzero" d="M14.725 14.039l2.957-1.21-.379-.926-2.957 1.21z"/><path fill-rule="nonzero" d="M19.708 12.001l3.114-1.274-.379-.926-3.114 1.274z"/><path d="M8 18h1v3h-1z" id="Path"/><path d="M8 9h1v5h-1z"/><path fill-rule="nonzero" d="M8 18h1v-4h-1v4zm-1-5h3v6h-3v-6z" id="Rectangle-44"/><path d="M18 16h1v3h-1z" id="Path"/><path d="M18 3h1v6h-1z"/><path fill-rule="nonzero" d="M18 16h1v-7h-1v7zm-1-8h3v9h-3v-9z" id="Rectangle-44"/><path d="M13 6h1v5h-1z"/><path d="M13 15h1v5h-1z"/><path fill-rule="nonzero" d="M13 15h1v-4h-1v4zm-1-5h3v6h-3v-6z"/><path fill-rule="nonzero" d="M2.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4.436 21.667l2.083-9.027-.974-.225-2.083 9.027zM10.046 16.474l-2.231-4.463-.894.447 2.231 4.463zM13.461 6.318l-2.88 10.079.962.275 2.88-10.079zM18.434 16.451l-2.921-10.224-.962.275 2.921 10.224zM21.147 12.089l-2.203 4.405.894.447 2.203-4.405zM25.524 21.383l-2.09-9.055-.974.225 2.09 9.055z"/><path d="M1 19h7.5v-1h-7.5z"/><path d="M12.5 19h4v-1h-4z"/><path d="M20.5 19h6.5v-1h-6.5z"/><path d="M6.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM25.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4 15h8.5v-1h-8.5zM16.5 15h8.5v-1h-8.5z"/><path d="M14.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.5 15h16.5v-1h-16.5z"/><path d="M6.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M6.5 23h12v-1h-12z" id="Line"/><path d="M21.596 20.715l3.091-9.66-.952-.305-3.091 9.66z"/><path d="M8.413 22.664l1.95-6.094-.952-.305-1.95 6.094z"/><path d="M11.602 12.695l3.085-9.641-.952-.305-3.085 9.641z"/><path d="M11.783 16.167l6.817 5.454.625-.781-6.817-5.454z"/><path d="M15.976 18.652l3.711-11.598-.952-.305-3.711 11.598z"/><path d="M4.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM20.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M7.354 21.354l14-14-.707-.707-14 14z"/><path d="M21 7l-8 3 5 5z"/><path fill-rule="nonzero" d="M22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.354 21.354l14-14-.707-.707-14 14z"/><path d="M22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M6 6h19v-1h-19z" id="Line"/><path fill-rule="nonzero" d="M6 24h19v-1h-19z"/><path fill-rule="nonzero" d="M6 17h17v-1h-17z"/><path d="M14.5 7l2.5 3h-5z"/><path d="M14.5 22l2.5-3h-5z"/><path fill-rule="nonzero" d="M14 10v10h1v-10z"/><path fill-rule="nonzero" d="M4.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M14 10a2 2 0 0 0-2 2v11H6V12c0-4.416 3.584-8 8-8s8 3.584 8 8v11h-6V12a2 2 0 0 0-2-2zm-3 2a3 3 0 0 1 6 0v10h4V12c0-3.864-3.136-7-7-7s-7 3.136-7 7v10h4V12z"/><path d="M6.5 18h5v1h-5zm10 0h5v1h-5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M15 20v3h1v-3zm5 0v3h1v-3zm-10 0v3h1v-3zm-2-3H5v1h3zm0-5H5v1h3z"/><path fill-rule="nonzero" d="M8 20h18v5H3V8h5v12zM4 9v15h21v-3H7V9H4z"/><path d="M21 14h1v4h-1zm0-9h1v5h-1z"/><path fill-rule="nonzero" d="M20 14h3v-4h-3v4zm-1-5h5v6h-5V9z"/><path d="M13 3h1v4h-1zm0 10h1v3h-1z"/><path fill-rule="nonzero" d="M12 7v6h3V7h-3zm-1-1h5v8h-5V6z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.854 22.854l14-14-.707-.707-14 14z"/><path d="M8.336 13.043l8.621 8.621.707-.707-8.621-8.621zM9.149 10.558l7.058-7.058-.707-.707-7.058 7.058z" id="Line"/><path d="M20.149 21.558l7.058-7.058-.707-.707-7.058 7.058z"/><path d="M5.5 23h11v-1h-11z"/><path d="M7.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M20 11c0-3.314-2.686-6-6-6s-6 2.686-6 6c0 2.913 2.872 8.112 6 11.551 3.128-3.438 6-8.638 6-11.551zm-6 13c-3-3-7-9.134-7-13 0-3.866 3.134-7 7-7s7 3.134 7 7-4 10-7 13z"/><ellipse cx="14" cy="11" rx="2" ry="2"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M14 18.634l-.307-.239-7.37-5.73-2.137-1.665 9.814-7.633 9.816 7.634-.509.394-1.639 1.269-7.667 5.969zm7.054-6.759l1.131-.876-8.184-6.366-8.186 6.367 1.123.875 7.063 5.491 7.054-5.492z"/><path d="M7 14.5l-1 .57 8 6.43 8-6.5-1-.5-7 5.5z"/><path d="M7 17.5l-1 .57 8 6.43 8-6.5-1-.5-7 5.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.354 18.354l10-10-.707-.707-10 10zM12.354 25.354l5-5-.707-.707-5 5z"/><path d="M20.354 17.354l5-5-.707-.707-5 5z"/><path d="M19.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M20.349 20.654l4.489-.711-.156-.988-4.489.711z"/><path d="M7.254 22.728l9.627-1.525-.156-.988-9.627 1.525z"/><path d="M7.284 22.118l15.669-8.331-.469-.883-15.669 8.331z"/><path d="M6.732 21.248l8.364-15.731-.883-.469-8.364 15.731z"/><path d="M17.465 18.758l-8.188-8.188-.707.707 8.188 8.188z"/><path d="M6.273 20.818l1.499-9.467-.988-.156-1.499 9.467z"/><path d="M8.329 7.834l.715-4.516-.988-.156-.715 4.516z"/><path d="M7.354 21.354l17-17-.707-.707-17 17z"/><path d="M5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM7.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 22c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.275 21.432l12.579-12.579-.707-.707-12.579 12.579z"/><path d="M6.69 13.397l7.913 7.913.707-.707-7.913-7.913zM7.149 10.558l7.058-7.058-.707-.707-7.058 7.058z"/><path d="M18.149 21.558l7.058-7.058-.707-.707-7.058 7.058z"/><path d="M5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM16.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M16.5 6h4v-1h-4z" id="Line"/><path d="M16.5 15h4v-1h-4z"/><path d="M8.5 23h4v-1h-4z"/><path d="M8.298 11.591l5.097-4.46-.659-.753-5.097 4.46zM22 7.5v5h1v-5z"/><path d="M14 16.5v4h1v-4z"/><path d="M6 14.5v6h1v-6z"/><path d="M6.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M6.995 5c.008 0 .005 15.5.005 15.5h-1v-15.493c0-.556.451-1.007.995-1.007h17.01c.549 0 .995.45.995 1.007v11.986c0 .556-.45 1.007-1.007 1.007h-12.993l-3.104 3.104-.707-.707 3.397-3.397h13.407c.004 0 .007-11.993.007-11.993 0-.007-17.005-.007-17.005-.007z"/><path d="M6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M4 5h16.5v-1h-16.5zM25 24h-16.5v1h16.5z" id="Line"/><path fill-rule="nonzero" d="M6.5 26c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path fill-rule="nonzero" d="M14 9v14h1v-14z"/><path d="M14.5 6l2.5 3h-5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M23.886 21.431c-.953-8.558-7.742-15.354-16.299-16.315l-.112.994c8.093.909 14.516 7.338 15.417 15.432l.994-.111z"/><path d="M5 7.5v14h1v-14zM21.5 23h-14v1h14z"/><path d="M5.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.354 20.354l5-5-.707-.707-5 5z"/><path d="M16.354 12.354l8-8-.707-.707-8 8z"/><path d="M14.5 15c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.5 6h13v-1h-13z" id="Line"/><path d="M7.5 23h13v-1h-13z"/><path d="M5 7.5v13h1v-13z"/><path d="M22 7.5v13h1v-13z"/><path d="M5.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.551 17.98l13.284-7.033-.468-.884-13.284 7.033z"/><path d="M6 11.801l16-8.471v4.17h1v-5.83l-18 9.529v5.301h1z"/><path d="M6 24.67v-4.17h-1v5.83l18-9.529v-5.301h-1v4.699z"/><path d="M5.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M8 21c0 1.1.825 2 1.833 2h7.333c1.008 0 1.833-.9 1.833-2v-12h-11v12zm-1 0v-13h13v13c0 1.634-1.252 3-2.833 3h-7.333c-1.581 0-2.833-1.366-2.833-3z"/><path d="M17 6l-1-1h-5l-1 1h-3v1h13v-1z"/><path fill-rule="nonzero" d="M10 11v9.062h1v-9.062z"/><path fill-rule="nonzero" d="M13 11v9.062h1v-9.062z"/><path fill-rule="nonzero" d="M16 11v9.062h1v-9.062z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M14.743 3.55l-4.208 4.208.707.707 4.208-4.208zM7.71 10.583l-4.187 4.187.707.707 4.187-4.187zM3.536 18.244l6.171 6.171.707-.707-6.171-6.171zM13.232 24.475l4.22-4.22-.707-.707-4.22 4.22zM20.214 17.494l4.217-4.217-.707-.707-4.217 4.217zM24.423 9.716l-6.218-6.218-.707.707 6.218 6.218z"/><path d="M2.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM9.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM16.5 4c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM11.5 27c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM25.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M10.275 20.432l11.579-11.579-.707-.707-11.579 11.579z"/><path d="M8.336 13.043l8.621 8.621.707-.707-8.621-8.621zM9.149 10.558l7.058-7.058-.707-.707-7.058 7.058z" id="Line"/><path d="M20.149 21.558l7.058-7.058-.707-.707-7.058 7.058z"/><path d="M6.5 23h10v-1h-10z"/><path d="M4.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM7.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M6 6h19v-1h-19z" id="Line"/><path fill-rule="nonzero" d="M6 24h19v-1h-19z"/><path fill-rule="nonzero" d="M6 13h17v-1h-17z"/><path d="M14.5 7l2.5 3h-5z"/><path d="M14.5 22l2.5-3h-5z"/><path fill-rule="nonzero" d="M14 10v10h1v-10z"/><path fill-rule="nonzero" d="M4.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M5.205 14.111l-.013-.172c-.054-.906.022-1.966.327-2.961.395-1.289 1.111-2.215 2.221-2.666l-.377-.926c-1.42.578-2.324 1.746-2.8 3.3-.346 1.128-.429 2.299-.369 3.313l.017.219.994-.106z"/><path d="M11.051 8.554c1.12.893 1.766 2.343 2.973 6.099 1.274 3.963 1.947 5.48 3.28 6.557l.629-.778c-1.112-.899-1.754-2.345-2.956-6.085-1.28-3.982-1.957-5.503-3.302-6.575l-.623.782z"/><path d="M21.722 21.558c1.439-.634 2.428-1.886 3.046-3.551.311-.836.509-1.726.618-2.616.066-.539.088-.967.088-1.227l-1 .002-.01.304c-.012.241-.035.51-.071.798-.101.818-.282 1.634-.563 2.39-.533 1.434-1.354 2.474-2.512 2.985l.403.915z"/><path d="M9.5 9c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM19.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M14.039 6.969l-.019-.019-2.828 2.828.707.707 2.474-2.474c1.367-1.367 3.582-1.367 4.949 0s1.367 3.582 0 4.949l-2.474 2.474.707.707 2.828-2.828-.019-.019c1.415-1.767 1.304-4.352-.334-5.99-1.638-1.638-4.224-1.749-5.99-.334zM6.968 14.039l-.019-.019 2.828-2.828.707.707-2.475 2.475c-1.367 1.367-1.367 3.582 0 4.949s3.582 1.367 4.949 0l2.474-2.474.707.707-2.828 2.828-.019-.019c-1.767 1.415-4.352 1.304-5.99-.334-1.638-1.638-1.749-4.224-.334-5.99z"/><path d="M10.485 16.141l5.656-5.656.707.707-5.656 5.656z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M15.039 5.969l-.019-.019-2.828 2.828.707.707 2.474-2.474c1.367-1.367 3.582-1.367 4.949 0s1.367 3.582 0 4.949l-2.474 2.474.707.707 2.828-2.828-.019-.019c1.415-1.767 1.304-4.352-.334-5.99-1.638-1.638-4.224-1.749-5.99-.334zM5.97 15.038l-.019-.019 2.828-2.828.707.707-2.475 2.475c-1.367 1.367-1.367 3.582 0 4.949s3.582 1.367 4.949 0l2.474-2.474.707.707-2.828 2.828-.019-.019c-1.767 1.415-4.352 1.304-5.99-.334-1.638-1.638-1.749-4.224-.334-5.99z"/><path d="M10.485 16.141l5.656-5.656.707.707-5.656 5.656z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M14 5.5v17h1v-17z" id="Line"/><path d="M9 8.5v-2.001c0-.272.229-.499.502-.499h9.995c.28 0 .502.221.502.499v2.001h1v-2.001c0-.832-.672-1.499-1.502-1.499h-9.995c-.824 0-1.502.673-1.502 1.499v2.001h1z"/><path d="M12 23h5v-1h-5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M.303 17.674l1.104.473.394-.919-1.104-.473z"/><path d="M5.133 19.744l3.335 1.429.394-.919-3.335-1.429z"/><path d="M12.134 22.744l3.352 1.436.394-.919-3.352-1.436z"/><path d="M19.203 25.774l1.6.686.394-.919-1.6-.686z"/><path d="M.3 4.673l1.13.484.394-.919-1.13-.484-.394.919zm.394-.919l1.13.484-.394.919-1.13-.484.394-.919z"/><path d="M5.141 6.747l3.325 1.425.394-.919-3.325-1.425z"/><path d="M12.133 9.744l3.353 1.437.394-.919-3.353-1.437z"/><path d="M19.221 12.782l5.838 2.502.394-.919-5.838-2.502z"/><path d="M3 7.473v8.969h1v-8.969zM8.93 9.871l-4.616 6.594.819.573 4.616-6.594zM11 19.5v-9h-1v9zM15.898 12.916l-4.616 6.594.819.573 4.616-6.594zM18 22.5v-9h-1v9zM24.313 5.212l-6.57 17.247.934.356 6.57-17.247z"/><path d="M3.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM25.5 5c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 26c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 10c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M27.186 9.411c-.691-.27-1.429-.411-2.186-.411-3.314 0-6 2.686-6 6h1c0-2.761 2.239-5 5-5 .632 0 1.246.117 1.821.342l.364-.931z"/><path fill-rule="nonzero" d="M9 15c0-3.314-2.686-6-6-6-.754 0-1.489.139-2.177.407l.363.932c.573-.223 1.185-.339 1.814-.339 2.761 0 5 2.239 5 5h1z"/><path d="M8 15h1v1h-1v-1zm11 0h1v1h-1v-1zm1 0h-1c0-2.761-2.239-5-5-5s-5 2.239-5 5h-1c0-3.314 2.686-6 6-6s6 2.686 6 6z"/><path fill-rule="nonzero" d="M8.5 19c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM19.5 19c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M17.537 7.635l-.789.789c-.886-.275-1.812-.424-2.748-.424-3.841 0-7.521 2.503-8.962 6 .562 1.364 1.465 2.577 2.585 3.549l-.709.709c-1.265-1.112-2.274-2.506-2.881-4.077l-.07-.18.07-.18c1.535-3.975 5.645-6.82 9.966-6.82 1.213 0 2.409.224 3.537.635zm3.549 2.108c1.265 1.112 2.274 2.506 2.881 4.077l.07.18-.07.18c-1.535 3.975-5.646 6.82-9.966 6.82-1.213 0-2.409-.224-3.537-.635l.789-.789c.886.275 1.812.424 2.748.424 3.84 0 7.521-2.503 8.962-6-.562-1.364-1.465-2.577-2.585-3.549l.709-.709zm-6.049.392l-4.902 4.902c-.088-.33-.135-.677-.135-1.036 0-2.213 1.788-4.001 4.001-4.001.358 0 .705.047 1.036.135zm2.828 2.829c.088.331.135.679.135 1.038 0 2.213-1.786 3.999-3.999 3.999-.359 0-.707-.047-1.038-.135l4.901-4.901zm-12.365 10.243l-.707-.707 17.707-17.707.707.707-17.707 17.707z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M7 13.003v8.994c0 .557.445 1.003.994 1.003h12.012c.547 0 .994-.449.994-1.003v-8.994c0-.557-.445-1.003-.994-1.003h-12.012c-.547 0-.994.449-.994 1.003zm-1 0c0-1.106.895-2.003 1.994-2.003h12.012c1.101 0 1.994.894 1.994 2.003v8.994c0 1.106-.895 2.003-1.994 2.003h-12.012c-1.101 0-1.994-.894-1.994-2.003v-8.994z"/><path fill-rule="nonzero" d="M11 11v-3h-1v3z"/><path fill-rule="nonzero" d="M18 11v-3h-1v3z"/><path fill-rule="nonzero" d="M10 8c0-2.209 1.791-4 4-4s4 1.791 4 4h-1c0-1.657-1.343-3-3-3s-3 1.343-3 3h-1zm1 0h-1c0-2.209 1.791-4 4-4s4 1.791 4 4h-1c0-1.657-1.343-3-3-3s-3 1.343-3 3z"/><rect width="2" height="4" rx="1" x="13" y="17"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M7 13.003v8.994c0 .557.445 1.003.994 1.003h12.012c.547 0 .994-.449.994-1.003v-8.994c0-.557-.445-1.003-.994-1.003h-12.012c-.547 0-.994.449-.994 1.003zm-1 0c0-1.106.895-2.003 1.994-2.003h12.012c1.101 0 1.994.894 1.994 2.003v8.994c0 1.106-.895 2.003-1.994 2.003h-12.012c-1.101 0-1.994-.894-1.994-2.003v-8.994z"/><path fill-rule="nonzero" d="M11 11v-4h-1v4z"/><path fill-rule="nonzero" d="M10 7c0-2.209 1.791-4 4-4s4 1.791 4 4h-1c0-1.657-1.343-3-3-3s-3 1.343-3 3h-1zm1 0h-1c0-2.209 1.791-4 4-4s4 1.791 4 4h-1c0-1.657-1.343-3-3-3s-3 1.343-3 3z"/><rect width="2" height="4" rx="1" x="13" y="17"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M4.034 14.18l-.07-.18.07-.18c1.535-3.975 5.645-6.82 9.966-6.82 4.32 0 8.431 2.845 9.966 6.82l.07.18-.07.18c-1.535 3.975-5.646 6.82-9.966 6.82-4.321 0-8.431-2.845-9.966-6.82zm9.966 5.82c3.84 0 7.521-2.503 8.962-6-1.441-3.497-5.122-6-8.962-6-3.841 0-7.521 2.503-8.962 6 1.441 3.497 5.121 6 8.962 6z"/><path d="M11 14.001c0 1.66 1.341 2.999 3.001 2.999s2.999-1.339 2.999-2.999c0-1.66-1.339-3.001-2.999-3.001-1.66 0-3.001 1.341-3.001 3.001z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M15.5 22.5c0-2.697-1.073-5.225-2.947-7.089l-.705.709c1.687 1.679 2.652 3.952 2.652 6.38h1z"/><path d="M7.354 21.354l14-14-.707-.707-14 14z"/><path d="M7.5 23h16.5v-1h-16.5z"/><path d="M22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4 25h22v-1h-22z" id="Line"/><path d="M4 21h22v-1h-22z"/><path d="M6.5 17h19.5v-1h-19.5z"/><path d="M5 14.5v-3h-1v3zM6.617 9.275l10.158-3.628-.336-.942-10.158 3.628z"/><path d="M18.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M20 2v22h1v-22z"/><path d="M24 2v22h1v-22z"/><path d="M4.673 11.471l3.69 10.333.942-.336-3.69-10.333z"/><path d="M17 21.535v-19.535h-1v19.535z"/><path d="M11.5 24h3v-1h-3z"/><path d="M4.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM9.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM16.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M9.457 18.844l-5.371 2.4.408.913 5.371-2.4z"/><path d="M13.13 17.203l.408.913 13.688-6.116-6.736-3.01-.408.913 4.692 2.097z"/><path d="M11.077 5.88l5.34 2.386.408-.913-5.34-2.386z"/><path d="M7.401 4.237l.408-.913-5.809-2.595v19.771h1v-18.229z"/><path d="M3.708 20.772l5.51-14.169-.932-.362-5.51 14.169zM9.265 6.39l1.46 10.218.99-.141-1.46-10.218zM13.059 17.145l4.743-6.775-.819-.573-4.743 6.775z"/><path d="M9.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM11.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 10c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM2.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.5 23h11v-1h-11zM6 8.5v12h1v-12zM7.483 8.28l12.293 13.112.73-.684-12.293-13.112z"/><path d="M6.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM21.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M15 12.5v-8.5h-1v8.5zM14 16.5v8.5h1v-8.5z"/><path d="M14.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M20.449 8.505l2.103 9.112.974-.225-2.103-9.112zM13.943 14.011l7.631 4.856.537-.844-7.631-4.856zM14.379 11.716l4.812-3.609-.6-.8-4.812 3.609zM10.96 13.828l-4.721 6.744.819.573 4.721-6.744zM6.331 20.67l2.31-13.088-.985-.174-2.31 13.088zM9.041 7.454l1.995 3.492.868-.496-1.995-3.492z"/><path d="M8.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM12.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM20.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M17.646 18.354l4 4 .708-.708-4-4z"/><path d="M12.5 21a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17zm0-1a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15z"/><path d="M9 13h7v-1H9z"/><path d="M13 16V9h-1v7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M17.646 18.354l4 4 .708-.708-4-4z"/><path d="M12.5 21a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17zm0-1a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15z"/><path d="M9 13h7v-1H9z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 13"><path d="M1 11.571C1 12.357 1.6 13 2.333 13h5.333c.733 0 1.333-.643 1.333-1.429V3h-8v8.571zM8.5 1L6.786 0H3.215L1.501 1h-1.5v1h10V1h-1.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path d="M15 13.4C15 4.1 7.5 5 7.5 5V1.7L0 6.5l7.5 4.9V8.2c5.8 0 7.5 5.1 7.5 5.2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 18" width="26" height="18"><path d="M12 0C8.4 0 5.4 2.8 5.1 6.3 2 6.1.1 9 0 11.1 0 13.9 2.2 16 4.7 16H9v-1H4.7C2.8 15 1 13.3 1 11.2 1 9 3 6.7 6 7.4 6 3 9 1 12 1s3.7 1.2 5.1 2.9c1.5.1 3.3.6 4.2 1.7 1 1.5 1.2 2.6 1.2 4.2 1.4.4 2.5 1.5 2.5 2.7-.2 1.6-1.3 2.5-2.6 2.5H17v1h5.3c2.8 0 3.7-1.9 3.7-3.5s-1-3-2.5-3.4c0-1.6-.5-2.9-1.4-4.1-.9-1.2-2.7-2-4.5-2.1C16.3 1.2 14.3 0 12 0zm1 6l-6 6h3v5h6v-5h3l-6-6z"/></svg>'},,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg"><line x2="100%" y2="100%"/><line x2="100%" y1="100%"/></svg>'},,function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" width="9px" height="9px"><path d="M2 1L1 2l2.5 2.5L1 7l1 1 2.5-2.5L7 8l1-1-2.5-2.5L8 2 7 1 4.5 3.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M1 0v1h11V0H1zm11 1v11h1V1h-1zm0 11H1v1h11v-1zM1 12V1H0v11h1zM6 2v4H2v1h4v4h1V7h4V6H7V2H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M1 0v1h11V0H1zm11 1v11h1V1h-1zm0 11H1v1h11v-1zM1 12V1H0v11h1zm1-6v1h9V6H2z"/></svg>'},,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18px" height="18px"><path fill-rule="evenodd" d="M12.5 11h-.79l-.28-.27A6.47 6.47 0 0 0 13 6.5 6.5 6.5 0 1 0 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="16" height="16"><path d="M28 50h65v17H28z"/></svg>'},,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="16" height="16"><path d="M112 60H78V26H61v34H27v17h34v34h17V77h34z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-58 -18 120 120" width="16" height="16"><path d="M31 13C23.4 5.3 12.8.5 1.1.5c-23.3 0-42.3 19-42.3 42.5s18.9 42.5 42.3 42.5c13.8 0 26-6.6 33.7-16.9l-16.5-1.8C13.5 70.4 7.5 72.5 1 72.5c-16.2 0-29.3-13.2-29.3-29.4S-15.2 13.7 1 13.7c8.1 0 15.4 3.3 20.7 8.6l-10.9 11h32.5V.5L31 13z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 19" width="28" height="19" id="ss"><defs><style>.tv-powered__logo { fill: #3BB3E4; } .tv-powered__logo--stroke { fill: #000; stroke: #000; opacity: 0.6; stroke-width: 3.5px; stroke-linecap: round; stroke-linejoin: round; }</style></defs><path d="M9.57 8.028c0-.79.642-1.433 1.433-1.433.792 0 1.433.642 1.433 1.433 0 .166-.03.325-.082.474l3.354 3.87c.164-.06.34-.095.525-.095.128 0 .252.017.37.048l5.043-5.47c-.91-1.078-2.247-1.783-3.75-1.856-1.058-1.452-2.77-2.396-4.703-2.396-3.033 0-5.523 2.323-5.79 5.286-.112-.01-.225-.015-.338-.015C4.82 7.875 3 9.695 3 11.94c0 .722.19 1.4.52 1.988L9.59 8.25c-.012-.073-.02-.147-.02-.222zm13.32 2.202c0-.52-.078-1.02-.22-1.495l-4.992 4.616c.04.138.064.283.064.434 0 .832-.675 1.507-1.507 1.507-.833 0-1.507-.674-1.507-1.506 0-.177.03-.345.087-.502L11.477 9.38c-.15.05-.307.08-.474.08-.142 0-.28-.02-.41-.06L4.03 14.645C4.777 15.48 5.86 16 7.066 16h14.992C23.683 16 25 14.68 25 13.055c0-1.337-.89-2.465-2.112-2.824" class="tv-powered__logo tv-powered__logo--stroke"/><path d="M9.57 8.028c0-.79.642-1.433 1.433-1.433.792 0 1.433.642 1.433 1.433 0 .166-.03.325-.082.474l3.354 3.87c.164-.06.34-.095.525-.095.128 0 .252.017.37.048l5.043-5.47c-.91-1.078-2.247-1.783-3.75-1.856-1.058-1.452-2.77-2.396-4.703-2.396-3.033 0-5.523 2.323-5.79 5.286-.112-.01-.225-.015-.338-.015C4.82 7.875 3 9.695 3 11.94c0 .722.19 1.4.52 1.988L9.59 8.25c-.012-.073-.02-.147-.02-.222zm13.32 2.202c0-.52-.078-1.02-.22-1.495l-4.992 4.616c.04.138.064.283.064.434 0 .832-.675 1.507-1.507 1.507-.833 0-1.507-.674-1.507-1.506 0-.177.03-.345.087-.502L11.477 9.38c-.15.05-.307.08-.474.08-.142 0-.28-.02-.41-.06L4.03 14.645C4.777 15.48 5.86 16 7.066 16h14.992C23.683 16 25 14.68 25 13.055c0-1.337-.89-2.465-2.112-2.824" class="tv-powered__logo"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 19" width="28" height="19" id="ss"><defs><style>.tv-powered__logo { fill: #3BB3E4; } .tv-powered__logo--stroke { fill: #fff; stroke: #fff; opacity: 0.6; stroke-width: 3.5px; stroke-linecap: round; stroke-linejoin: round; }</style></defs><path d="M9.57 8.028c0-.79.642-1.433 1.433-1.433.792 0 1.433.642 1.433 1.433 0 .166-.03.325-.082.474l3.354 3.87c.164-.06.34-.095.525-.095.128 0 .252.017.37.048l5.043-5.47c-.91-1.078-2.247-1.783-3.75-1.856-1.058-1.452-2.77-2.396-4.703-2.396-3.033 0-5.523 2.323-5.79 5.286-.112-.01-.225-.015-.338-.015C4.82 7.875 3 9.695 3 11.94c0 .722.19 1.4.52 1.988L9.59 8.25c-.012-.073-.02-.147-.02-.222zm13.32 2.202c0-.52-.078-1.02-.22-1.495l-4.992 4.616c.04.138.064.283.064.434 0 .832-.675 1.507-1.507 1.507-.833 0-1.507-.674-1.507-1.506 0-.177.03-.345.087-.502L11.477 9.38c-.15.05-.307.08-.474.08-.142 0-.28-.02-.41-.06L4.03 14.645C4.777 15.48 5.86 16 7.066 16h14.992C23.683 16 25 14.68 25 13.055c0-1.337-.89-2.465-2.112-2.824" class="tv-powered__logo tv-powered__logo--stroke"/><path d="M9.57 8.028c0-.79.642-1.433 1.433-1.433.792 0 1.433.642 1.433 1.433 0 .166-.03.325-.082.474l3.354 3.87c.164-.06.34-.095.525-.095.128 0 .252.017.37.048l5.043-5.47c-.91-1.078-2.247-1.783-3.75-1.856-1.058-1.452-2.77-2.396-4.703-2.396-3.033 0-5.523 2.323-5.79 5.286-.112-.01-.225-.015-.338-.015C4.82 7.875 3 9.695 3 11.94c0 .722.19 1.4.52 1.988L9.59 8.25c-.012-.073-.02-.147-.02-.222zm13.32 2.202c0-.52-.078-1.02-.22-1.495l-4.992 4.616c.04.138.064.283.064.434 0 .832-.675 1.507-1.507 1.507-.833 0-1.507-.674-1.507-1.506 0-.177.03-.345.087-.502L11.477 9.38c-.15.05-.307.08-.474.08-.142 0-.28-.02-.41-.06L4.03 14.645C4.777 15.48 5.86 16 7.066 16h14.992C23.683 16 25 14.68 25 13.055c0-1.337-.89-2.465-2.112-2.824" class="tv-powered__logo"/></svg>'}]);
