commit 2019-10-18 11:00:34.696408

Pass the new visible range to the onVisibleRangeChanged() event #3208
This commit is contained in:
Jenkins
2019-10-18 14:00:36 +03:00
parent cecedf391b
commit 748a66462a
33 changed files with 37 additions and 37 deletions

File diff suppressed because one or more lines are too long

View File

@@ -559,11 +559,11 @@ e.prototype._processFullBarset=function(e,t){var i=e[0].time,n=e[e.length-1].tim
this._forEachThread(function(e,t){return t.destroy()}),this._threads={},delete this._datafeed},e.prototype.purgeCache=function(){this._forEachThread(function(e,t){return t.destroy()}),this._threads={}},e.prototype.subscribe=function(e,t,i,o,r){var s,a=n(e,t);return this._threads[a]||(this._threads[a]=this._createThread(e,t)),s=this._threads[a].addSubscription(i,o,r),a+'"'+s},e.prototype.unsubscribe=function(e){var t,i,n=e.split('"');if(2!==n.length)return void console.warn("Wrong guid format");t=n[0],i=parseInt(n[1]),this._threads.hasOwnProperty(t)?this._threads[t].removeSubscription(i):console.warn("Data thread doesnt exist: "+e)},e.prototype._createThread=function(e,t){return new c(this._datafeed,e,t,this._dwmAlignerCreator(t,e.timezone,e.session))},e.prototype._forEachThread=function(e){var t=this;Object.keys(this._threads).forEach(function(i){return e(i,t._threads[i])})},e}()},function(e,t,i){"use strict";(function(t,n){function o(e,i,n,o){this._chartWidgetCollection=e,this._chartApiInstance=i,this._saveChartService=n,this._loadChartService=o,this._proxyWatchListChangedDelegate=null,this._lockDrawingsWatchedValue=null,this._hideDrawingsWatchedValue=null,this._activeChangedChangedDelegate=new t,this._chartWidgetCollection.activeChartWidget.subscribe(function(){this._activeChangedChangedDelegate.fire()}.bind(this)),this._chartWidgets=new WeakMap}var r=i(62).linking,s=i(679),a=i(109).layouts,l=i(31),c=i(89),h=i(32),u=i(61),d=i(67),p=i(4),_=i(209).createNoticeDialog,f=i(83).createConfirmDialog,m=i(298),y=i(685).ThemesApi;o.prototype.subscribe=function(e,t){l.subscribe(e,t)},o.prototype.unsubscribe=function(e,t){l.unsubscribe(e,t)},o.prototype.onContextMenu=function(e){l.subscribe("onContextMenu",function(t){t.callback(e(t.unixtime,t.price))})},o.prototype.onGrayedObjectClicked=function(e){l.subscribe("onGrayedObjectClicked",e)},o.prototype.activeChart=function(){return this._getChartWidgetApi(this._chartWidgetCollection.activeChartWidget.value())},o.prototype._getChartWidgetApi=function(e){var t=this._chartWidgets.get(e);return void 0===t&&(t=new s(e),this._chartWidgets.set(e,t)),t},o.prototype.onActiveChartChanged=function(){return this._activeChangedChangedDelegate},o.prototype.changeSymbol=function(e,t,i){r.interval.setValue(t),r.symbol.setValue(e),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},o.prototype.setLayout=function(e){this._chartWidgetCollection.layout.setValue(e)},o.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},o.prototype.layoutName=function(){return this._chartWidgetCollection.metaInfo.name.value()},o.prototype.chartsCount=function(){return a[this.layout()].count},o.prototype.chart=function(e){if(void 0===e&&(e=0),e<0||e>=this.chartsCount())throw Error("Incorrect index: "+e);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[e])},o.prototype.getSymbolInterval=function(e){var t={symbol:r.symbol.value(),interval:r.interval.value()};return e&&e(t),t},o.prototype.saveChart=function(e){var t=this this._forEachThread(function(e,t){return t.destroy()}),this._threads={},delete this._datafeed},e.prototype.purgeCache=function(){this._forEachThread(function(e,t){return t.destroy()}),this._threads={}},e.prototype.subscribe=function(e,t,i,o,r){var s,a=n(e,t);return this._threads[a]||(this._threads[a]=this._createThread(e,t)),s=this._threads[a].addSubscription(i,o,r),a+'"'+s},e.prototype.unsubscribe=function(e){var t,i,n=e.split('"');if(2!==n.length)return void console.warn("Wrong guid format");t=n[0],i=parseInt(n[1]),this._threads.hasOwnProperty(t)?this._threads[t].removeSubscription(i):console.warn("Data thread doesnt exist: "+e)},e.prototype._createThread=function(e,t){return new c(this._datafeed,e,t,this._dwmAlignerCreator(t,e.timezone,e.session))},e.prototype._forEachThread=function(e){var t=this;Object.keys(this._threads).forEach(function(i){return e(i,t._threads[i])})},e}()},function(e,t,i){"use strict";(function(t,n){function o(e,i,n,o){this._chartWidgetCollection=e,this._chartApiInstance=i,this._saveChartService=n,this._loadChartService=o,this._proxyWatchListChangedDelegate=null,this._lockDrawingsWatchedValue=null,this._hideDrawingsWatchedValue=null,this._activeChangedChangedDelegate=new t,this._chartWidgetCollection.activeChartWidget.subscribe(function(){this._activeChangedChangedDelegate.fire()}.bind(this)),this._chartWidgets=new WeakMap}var r=i(62).linking,s=i(679),a=i(109).layouts,l=i(31),c=i(89),h=i(32),u=i(61),d=i(67),p=i(4),_=i(209).createNoticeDialog,f=i(83).createConfirmDialog,m=i(298),y=i(685).ThemesApi;o.prototype.subscribe=function(e,t){l.subscribe(e,t)},o.prototype.unsubscribe=function(e,t){l.unsubscribe(e,t)},o.prototype.onContextMenu=function(e){l.subscribe("onContextMenu",function(t){t.callback(e(t.unixtime,t.price))})},o.prototype.onGrayedObjectClicked=function(e){l.subscribe("onGrayedObjectClicked",e)},o.prototype.activeChart=function(){return this._getChartWidgetApi(this._chartWidgetCollection.activeChartWidget.value())},o.prototype._getChartWidgetApi=function(e){var t=this._chartWidgets.get(e);return void 0===t&&(t=new s(e),this._chartWidgets.set(e,t)),t},o.prototype.onActiveChartChanged=function(){return this._activeChangedChangedDelegate},o.prototype.changeSymbol=function(e,t,i){r.interval.setValue(t),r.symbol.setValue(e),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},o.prototype.setLayout=function(e){this._chartWidgetCollection.layout.setValue(e)},o.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},o.prototype.layoutName=function(){return this._chartWidgetCollection.metaInfo.name.value()},o.prototype.chartsCount=function(){return a[this.layout()].count},o.prototype.chart=function(e){if(void 0===e&&(e=0),e<0||e>=this.chartsCount())throw Error("Incorrect index: "+e);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[e])},o.prototype.getSymbolInterval=function(e){var t={symbol:r.symbol.value(),interval:r.interval.value()};return e&&e(t),t},o.prototype.saveChart=function(e){var t=this
;this._saveChartService.whenReadyToSave(function(){var i=t._saveChartService.saveToJSON();return e&&e(JSON.parse(i.content))})},o.prototype.loadChart=function(e){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(e.json),this._chartWidgetCollection.purgeUnusedWidgets(),e.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(e.extendedData.name)),r.symbol.setValue(this.activeChart().symbol()),l.emit("chart_loaded")},o.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter(function(e){return!e.is_hidden_study}).map(function(e){return e.name||e.description})},o.prototype.getSavedCharts=function(e){d.getCharts(e)},o.prototype.loadChartFromServer=function(e){d.loadChart(e)},o.prototype.saveChartToServer=function(e,t,i,n){this._saveChartService.saveChartSilently(e,i,t,n)},o.prototype.removeChartFromServer=function(e,t){d.removeChart(e,t)},o.prototype.getIntervals=function(){var e=[],t=u.getCustomResolutions();return null!==this._chartApiInstance&&(e=this._chartApiInstance.defaultResolutions()),u.mergeResolutions(e,t)},o.prototype.closePopupsAndDialogs=function(){var e,t,n=document.querySelectorAll("._tv-dialog-title-close");for(e=0;e<n.length;e++)n[e].click();t=i.c[690],t&&t.exports.closeAllDialogs(),c.hideAll()},o.prototype.selectLineTool=function(e){m.supportedLineTools[e]&&(e=m.supportedLineTools[e].name,h.tool.value()!==e&&h.tool.setValue(e))},o.prototype.selectedLineTool=function(){var e,t=Object.keys(m.supportedLineTools),i=h.tool.value();for(e=0;e<t.length;++e)if(m.supportedLineTools[t[e]].name===i)return t[e];return""},o.prototype.lockAllDrawingTools=function(){return null===this._lockDrawingsWatchedValue&&(this._lockDrawingsWatchedValue=new n(h.lockDrawings().value()),this._lockDrawingsWatchedValue.subscribe(function(e){h.lockDrawings().setValue(e)}),h.lockDrawings().subscribe(this,function(){this._lockDrawingsWatchedValue.setValue(h.lockDrawings().value())})),this._lockDrawingsWatchedValue},o.prototype.hideAllDrawingTools=function(){return null===this._hideDrawingsWatchedValue&&(this._hideDrawingsWatchedValue=new n(h.hideAllDrawings().value()),this._hideDrawingsWatchedValue.subscribe(function(e){h.hideAllDrawings().setValue(e)}),h.hideAllDrawings().subscribe(this,function(){this._hideDrawingsWatchedValue.setValue(h.hideAllDrawings().value())})),this._hideDrawingsWatchedValue},o.prototype.mainSeriesPriceFormatter=function(){return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()},o.prototype.showNoticeDialog=function(e){function t(){i&&(i(),i=null)}e=e||{};var i=e.callback;_({title:e.title,content:e.body||""}).then(function(e){e.on("action:ok",t),e.on("afterClose",t),e.open()})},o.prototype.showConfirmDialog=function(e){function t(e){i&&(i(e),i=null)}if(e=e||{}, ;this._saveChartService.whenReadyToSave(function(){var i=t._saveChartService.saveToJSON();return e&&e(JSON.parse(i.content))})},o.prototype.loadChart=function(e){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(e.json),this._chartWidgetCollection.purgeUnusedWidgets(),e.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(e.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(e.extendedData.name)),r.symbol.setValue(this.activeChart().symbol()),l.emit("chart_loaded")},o.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter(function(e){return!e.is_hidden_study}).map(function(e){return e.name||e.description})},o.prototype.getSavedCharts=function(e){d.getCharts(e)},o.prototype.loadChartFromServer=function(e){d.loadChart(e)},o.prototype.saveChartToServer=function(e,t,i,n){this._saveChartService.saveChartSilently(e,i,t,n)},o.prototype.removeChartFromServer=function(e,t){d.removeChart(e,t)},o.prototype.getIntervals=function(){var e=[],t=u.getCustomResolutions();return null!==this._chartApiInstance&&(e=this._chartApiInstance.defaultResolutions()),u.mergeResolutions(e,t)},o.prototype.closePopupsAndDialogs=function(){var e,t,n=document.querySelectorAll("._tv-dialog-title-close");for(e=0;e<n.length;e++)n[e].click();t=i.c[690],t&&t.exports.closeAllDialogs(),c.hideAll()},o.prototype.selectLineTool=function(e){m.supportedLineTools[e]&&(e=m.supportedLineTools[e].name,h.tool.value()!==e&&h.tool.setValue(e))},o.prototype.selectedLineTool=function(){var e,t=Object.keys(m.supportedLineTools),i=h.tool.value();for(e=0;e<t.length;++e)if(m.supportedLineTools[t[e]].name===i)return t[e];return""},o.prototype.lockAllDrawingTools=function(){return null===this._lockDrawingsWatchedValue&&(this._lockDrawingsWatchedValue=new n(h.lockDrawings().value()),this._lockDrawingsWatchedValue.subscribe(function(e){h.lockDrawings().setValue(e)}),h.lockDrawings().subscribe(this,function(){this._lockDrawingsWatchedValue.setValue(h.lockDrawings().value())})),this._lockDrawingsWatchedValue},o.prototype.hideAllDrawingTools=function(){return null===this._hideDrawingsWatchedValue&&(this._hideDrawingsWatchedValue=new n(h.hideAllDrawings().value()),this._hideDrawingsWatchedValue.subscribe(function(e){h.hideAllDrawings().setValue(e)}),h.hideAllDrawings().subscribe(this,function(){this._hideDrawingsWatchedValue.setValue(h.hideAllDrawings().value())})),this._hideDrawingsWatchedValue},o.prototype.mainSeriesPriceFormatter=function(){return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()},o.prototype.showNoticeDialog=function(e){function t(){i&&(i(),i=null)}e=e||{};var i=e.callback;_({title:e.title,content:e.body||""}).then(function(e){e.on("action:ok",t),e.on("afterClose",t),e.open()})},o.prototype.showConfirmDialog=function(e){function t(e){i&&(i(e),i=null)}if(e=e||{},
!e.callback)throw Error("callback must be exist");var i=e.callback;f({title:e.title,content:e.body||""}).then(function(e){e.on("action:yes",t.bind(null,!0)),e.on("action:no",t.bind(null,!1)),e.on("afterClose",t.bind(null,!1)),e.open()})},o.prototype.logs=function(){return{getLogHistory:p.getLogHistory,enable:p.loggingOn,disable:p.loggingOff}},o.prototype.showLoadChartDialog=function(){var e=this._loadChartService;e&&e.showLoadDialog()},o.prototype.showSaveAsChartDialog=function(){var e=this._saveChartService;e&&window.runOrSignIn(function(){e.saveChartAs()})},o.prototype.themes=function(){return new y({chartWidgetCollection:this._chartWidgetCollection})},o.prototype.undoRedoState=function(){return this._chartWidgetCollection.undoHistory.state()},o.prototype.takeScreenshot=function(){this._chartWidgetCollection.takeScreenshot()},e.exports=o}).call(t,i(8),i(16))},function(e,t,i){"use strict";(function(t){function n(e){var t,i,n=Object.keys(y),o=n.length;for(t=0;t<o;++t)if(i=n[t],y[i].name===e)return i;return null}function o(e){return"LineToolRiskRewardLong"===e||"LineToolRiskRewardShort"===e}var r=i(7).ensureNotNull,s=i(680),a=i(162).applyOverridesToStudy,l=i(26),c=i(681).LineDataSourceApi,h=i(682).StudyApi,u=i(683).PaneApi,d=i(3).DefaultProperty,p=i(335).availableIcons,_=i(37),f=i(15).Interval,m=i(35),y=i(298).supportedLineTools,g=i(292).showTooManyStudiesNotice,v=i(12).isNumber,S=i(684).onSeriesCompletedOrErrorReceived,b=function(e){this._chartWidget=e,this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap};b.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new u(e),this._panes.set(e,t)),t},b.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget.model().model()),this._studies.set(e,t)),t},b.prototype._getLineDataSourceApi=function(e){var t=this._lineDataSources.get(e);return void 0===t&&(t=new c(e,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(e){var t=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return e.map(function(e){var n=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(n.time_t,n.offset)}})}.bind(this)}),this._lineDataSources.set(e,t)),t},b.prototype._makeSubscriptionFromDelegate=function(e){var t=$.extend({},e);return delete t.fire,t},b.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},b.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},b.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},b.prototype.clearMarks=function(){this._chartWidget.clearMarks()},b.prototype.symbol=function(){return this._chartWidget.getSymbol()},b.prototype.symbolExt=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name,exchange:e.exchange,description:e.description,type:e.type}:null}, !e.callback)throw Error("callback must be exist");var i=e.callback;f({title:e.title,content:e.body||""}).then(function(e){e.on("action:yes",t.bind(null,!0)),e.on("action:no",t.bind(null,!1)),e.on("afterClose",t.bind(null,!1)),e.open()})},o.prototype.logs=function(){return{getLogHistory:p.getLogHistory,enable:p.loggingOn,disable:p.loggingOff}},o.prototype.showLoadChartDialog=function(){var e=this._loadChartService;e&&e.showLoadDialog()},o.prototype.showSaveAsChartDialog=function(){var e=this._saveChartService;e&&window.runOrSignIn(function(){e.saveChartAs()})},o.prototype.themes=function(){return new y({chartWidgetCollection:this._chartWidgetCollection})},o.prototype.undoRedoState=function(){return this._chartWidgetCollection.undoHistory.state()},o.prototype.takeScreenshot=function(){this._chartWidgetCollection.takeScreenshot()},e.exports=o}).call(t,i(8),i(16))},function(e,t,i){"use strict";(function(t){function n(e){var t,i,n=Object.keys(y),o=n.length;for(t=0;t<o;++t)if(i=n[t],y[i].name===e)return i;return null}function o(e){return"LineToolRiskRewardLong"===e||"LineToolRiskRewardShort"===e}var r=i(7).ensureNotNull,s=i(680),a=i(162).applyOverridesToStudy,l=i(26),c=i(681).LineDataSourceApi,h=i(682).StudyApi,u=i(683).PaneApi,d=i(3).DefaultProperty,p=i(335).availableIcons,_=i(37),f=i(15).Interval,m=i(35),y=i(298).supportedLineTools,g=i(292).showTooManyStudiesNotice,v=i(12).isNumber,S=i(684).onSeriesCompletedOrErrorReceived,b=function(e){this._chartWidget=e,this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap};b.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new u(e),this._panes.set(e,t)),t},b.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget.model().model()),this._studies.set(e,t)),t},b.prototype._getLineDataSourceApi=function(e){var t=this._lineDataSources.get(e);return void 0===t&&(t=new c(e,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(e){var t=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return e.map(function(e){var n=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(n.time_t,n.offset)}})}.bind(this)}),this._lineDataSources.set(e,t)),t},b.prototype._makeSubscriptionFromDelegate=function(e){var t=$.extend({},e);return delete t.fire,t},b.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},b.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},b.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},b.prototype.clearMarks=function(){this._chartWidget.clearMarks()},b.prototype.symbol=function(){return this._chartWidget.getSymbol()},b.prototype.symbolExt=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name,exchange:e.exchange,description:e.description,type:e.type}:null},
b.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},b.prototype.setSymbol=function(e,i){function n(e){e||i()}if(e!==this.symbol()||t.enabled("same_data_requery")){var o=this._chartWidget.model().mainSeries().dataEvents();return i&&S(o,n),this._chartWidget.setSymbol(e)}},b.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},b.prototype.setResolution=function(e,t){function i(e){e||t()}if((e=e.toUpperCase())!==this.resolution()){var n=this._chartWidget.model().mainSeries().dataEvents();return t&&S(n,i),this._chartWidget.setResolution(e)}},b.prototype.setEntityVisibility=function(e,t){var i,n;console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead"),(i=this._chartWidget.model().model().dataSourceForId(e))&&(n=i.properties())&&n.visible&&n.visible.setValue(t)},b.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(e){return{id:e.id(),name:e._metaInfo.description}})},b.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(function(e){return{id:e.id(),name:n(e.toolname)}}).filter(function(e){return null!==e.name})},b.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},b.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},b.prototype.removeEntity=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);if(!t)return void console.warn("Can't find a source with id: "+e);this._chartWidget.model().chartModel().removeSource(t,!0)},b.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveInterval)},b.prototype.applyStudyTemplate=function(e){this._chartWidget.model().model().restoreStudyTemplate(e,""+1e3*Math.random())},b.prototype.setVisibleRange=function(e,i){var n,o,r,s;if(void 0===e||!e.from||!e.to||isNaN(e.from)||isNaN(e.to))return void console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.');n=this._chartWidget.model().model(),o=n.mainSeries(),r=[parseInt(e.from),parseInt(e.to)],s=f.isDWM(o.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(r):r,e.from=s[0],e.to=s[1],this._chartWidget.setVisibleTimeRange(e.from,e.to,i)},b.prototype.getVisibleRange=function(){var e,t,i,n,o={from:0,to:0},s=this._chartWidget.model().timeScale(),a=s.visibleBars(),l=this._chartWidget.model().mainSeries(),c=l.syncModel();return null===a?o:(e=r(l.data().last()),t=a.lastBar()-e.index,i=t<=0,n=i?s.indexToTimePoint(a.lastBar()):c.projectTime(e.value[TradingView.TIME_PLOT],t),o.from=+s.indexToTimePoint(Math.max(0,a.firstBar()))||0,o.to=+n||0,o)},b.prototype.getVisiblePriceRange=function(){return this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},b.prototype._createTradingPrimitive=function(e,t){function i(){var e=TradingView.CLOSE_PLOT,t=r(n._chartWidget.model().mainSeries().bars().last()) b.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},b.prototype.setSymbol=function(e,i){function n(e){e||i()}if(e!==this.symbol()||t.enabled("same_data_requery")){var o=this._chartWidget.model().mainSeries().dataEvents();return i&&S(o,n),this._chartWidget.setSymbol(e)}},b.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},b.prototype.setResolution=function(e,t){function i(e){e||t()}if((e=e.toUpperCase())!==this.resolution()){var n=this._chartWidget.model().mainSeries().dataEvents();return t&&S(n,i),this._chartWidget.setResolution(e)}},b.prototype.setEntityVisibility=function(e,t){var i,n;console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead"),(i=this._chartWidget.model().model().dataSourceForId(e))&&(n=i.properties())&&n.visible&&n.visible.setValue(t)},b.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(e){return{id:e.id(),name:e._metaInfo.description}})},b.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(function(e){return{id:e.id(),name:n(e.toolname)}}).filter(function(e){return null!==e.name})},b.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},b.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},b.prototype.removeEntity=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);if(!t)return void console.warn("Can't find a source with id: "+e);this._chartWidget.model().chartModel().removeSource(t,!0)},b.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveInterval)},b.prototype.applyStudyTemplate=function(e){this._chartWidget.model().model().restoreStudyTemplate(e,""+1e3*Math.random())},b.prototype.setVisibleRange=function(e,i){var n,o,r,s;if(void 0===e||!e.from||!e.to||isNaN(e.from)||isNaN(e.to))return void console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.');n=this._chartWidget.model().model(),o=n.mainSeries(),r=[parseInt(e.from),parseInt(e.to)],s=f.isDWM(o.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(r):r,e.from=s[0],e.to=s[1],this._chartWidget.setVisibleTimeRange(e.from,e.to,i)},b.prototype.getVisibleRange=function(){var e,t,i,n,o,s,a={from:0,to:0},l=this._chartWidget.model().timeScale(),c=l.visibleBars();return null===c?a:(e=this._chartWidget.model().mainSeries(),null===(t=e.syncModel())?a:(i=r(e.data().last()),n=c.lastBar()-i.index,o=n<=0,s=o?l.indexToTimePoint(c.lastBar()):t.projectTime(i.value[TradingView.TIME_PLOT],n),a.from=+l.indexToTimePoint(Math.max(0,c.firstBar()))||0,a.to=+s||0,a))},b.prototype.getVisiblePriceRange=function(){return this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},b.prototype._createTradingPrimitive=function(e,t){function i(){
;return{index:t.index,price:t.value[e]}}var n=this,o=this._chartWidget.model().model(),s=o.paneForSource(o.mainSeries());return(t?o:this._chartWidget.model()).createLineTool(s,i(),e)._adapter},b.prototype.createOrderLine=function(e){var e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},b.prototype.createPositionLine=function(e){var e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},b.prototype.createExecutionShape=function(e){var e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},b.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},b.prototype._alignPoints=function(e){var t,i,n=this._chartWidget.model().model(),o=n.mainSeries(),r=o.symbolInfo(),s=m.get_timezone(r.timezone);return n.timeScale().isEmpty()?e:(t=(new _.Session).init(s,r.session),i=_.createDWMAligner(o.interval(),t),null===i?e:e.map(function(e){return e?(i.moveTo(1e3*e),i.startOfBar(0)/1e3):e}))},b.prototype._convertUserPointsToDataSource=function(e){function i(e,t,i){var n,o,r,s=h.closestIndexLeft(e)||0,a={index:s},l=h.valueAt(s);return e>l&&(n=c.syncModel().distance(l,e),n.success&&(a.index=a.index+n.result)),v(t)?a.price=t:(o=["open","high","low","close"],r=i?o.indexOf(i)+1:1,r<=0&&(r=1),a.price=u.valueAt(s)[r]),a}var n,o,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(n=e.map(function(e){return e.time}),o=f.isDWM(c.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(n):n,r=[],s=0;s<e.length;s++)a=e[s],r.push(i(o[s],a.price,a.channel));return r},b.prototype.createMultipointShape=function(e,t,i){var n,r,s,a,l,c,h,u=t.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),_=this._chartWidget.model().model(),f=_.mainSeries();if(!_.timeScale().isEmpty()){if(n=_.paneForSource(f),r=this._convertUserPointsToDataSource(e),s=y[t.shape]||y.flag,s.onlySelectable)throw Error('Cannot create "'+t.shape+'" shape');if("LineToolPolyline"===s.name)r[0].price===r[r.length-1].price&&r[0].index===r[r.length-1].index||r.push(r[0]);else if("LineToolIcon"===s.name){if(t.icon=t.icon||t.overrides&&t.overrides.icon,!t.hasOwnProperty("icon"))throw Error("icon must be specified in options");if(-1===p.indexOf(t.icon))throw Error("icon value must be valid");t.overrides=t.overrides||{},t.overrides.icon=t.icon}if(a=new d(s.name.toLowerCase()),t.overrides)for(l in t.overrides)a[l]?a[l].setValue(t.overrides[l]):o(s.name)&&-1!==["profitLevel","stopLevel"].indexOf(l)&&a.addProperty(l,t.overrides[l]);if(s.supportsText&&t.text&&a.text.setValue(t.text),c=u.createLineTool(n,r[0],s.name,a),c.pointsCount()!==r.length&&-1!==c.pointsCount())throw Error("Wrong points count for "+t.shape+". Required "+c.pointsCount());for(h=1;h<r.length&&this._chartWidget.model().lineBeingCreated();h++)u.coninueCreatingLine(r[h],{},h<r.length-1);return t.lock&&c.setUserEditEnabled(!1),t.disableSelection&&(c.customization.disableSelection=!0), var e=TradingView.CLOSE_PLOT,t=r(n._chartWidget.model().mainSeries().bars().last());return{index:t.index,price:t.value[e]}}var n=this,o=this._chartWidget.model().model(),s=o.paneForSource(o.mainSeries());return(t?o:this._chartWidget.model()).createLineTool(s,i(),e)._adapter},b.prototype.createOrderLine=function(e){var e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},b.prototype.createPositionLine=function(e){var e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},b.prototype.createExecutionShape=function(e){var e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},b.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},b.prototype._alignPoints=function(e){var t,i,n=this._chartWidget.model().model(),o=n.mainSeries(),r=o.symbolInfo(),s=m.get_timezone(r.timezone);return n.timeScale().isEmpty()?e:(t=(new _.Session).init(s,r.session),i=_.createDWMAligner(o.interval(),t),null===i?e:e.map(function(e){return e?(i.moveTo(1e3*e),i.startOfBar(0)/1e3):e}))},b.prototype._convertUserPointsToDataSource=function(e){function i(e,t,i){var n,o,r,s=h.closestIndexLeft(e)||0,a={index:s},l=h.valueAt(s);return e>l&&(n=c.syncModel().distance(l,e),n.success&&(a.index=a.index+n.result)),v(t)?a.price=t:(o=["open","high","low","close"],r=i?o.indexOf(i)+1:1,r<=0&&(r=1),a.price=u.valueAt(s)[r]),a}var n,o,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(n=e.map(function(e){return e.time}),o=f.isDWM(c.interval())&&!t.enabled("disable_resolution_rebuild")?this._alignPoints(n):n,r=[],s=0;s<e.length;s++)a=e[s],r.push(i(o[s],a.price,a.channel));return r},b.prototype.createMultipointShape=function(e,t,i){var n,r,s,a,l,c,h,u=t.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),_=this._chartWidget.model().model(),f=_.mainSeries();if(!_.timeScale().isEmpty()){if(n=_.paneForSource(f),r=this._convertUserPointsToDataSource(e),s=y[t.shape]||y.flag,s.onlySelectable)throw Error('Cannot create "'+t.shape+'" shape');if("LineToolPolyline"===s.name)r[0].price===r[r.length-1].price&&r[0].index===r[r.length-1].index||r.push(r[0]);else if("LineToolIcon"===s.name){if(t.icon=t.icon||t.overrides&&t.overrides.icon,!t.hasOwnProperty("icon"))throw Error("icon must be specified in options");if(-1===p.indexOf(t.icon))throw Error("icon value must be valid");t.overrides=t.overrides||{},t.overrides.icon=t.icon}if(a=new d(s.name.toLowerCase()),t.overrides)for(l in t.overrides)a[l]?a[l].setValue(t.overrides[l]):o(s.name)&&-1!==["profitLevel","stopLevel"].indexOf(l)&&a.addProperty(l,t.overrides[l]);if(s.supportsText&&t.text&&a.text.setValue(t.text),c=u.createLineTool(n,r[0],s.name,a),c.pointsCount()!==r.length&&-1!==c.pointsCount())throw Error("Wrong points count for "+t.shape+". Required "+c.pointsCount());for(h=1;h<r.length&&this._chartWidget.model().lineBeingCreated();h++)u.coninueCreatingLine(r[h],{},h<r.length-1);return t.lock&&c.setUserEditEnabled(!1),
t.disableSave&&(c.customization.disableSave=!0),t.hasOwnProperty("showInObjectsTree")&&(c.customization.showInObjectsTree=t.showInObjectsTree),t.zOrder&&("top"===t.zOrder?u.bringToFront(c):"bottom"===t.zOrder&&u.sendToBack(c)),c.id()}},b.prototype.getShapeById=function(e){var t=this._chartWidget.model().model().getLineToolById(e);if(null===t)throw Error("There is no such shape");return this._getLineDataSourceApi(t)},b.prototype.createStudy=function(e,t,i,n,o,c,h){var u,d,p,_,f,m;return h=h||{},h.checkLimit&&!this._chartWidget.model().canCreateStudy()?(g(),null):(e=e.toLowerCase(),u=this._chartWidget.model().chartModel(),d=l.findStudyMetaInfoByDescription(u.studiesMetaData(),e),d=$.extend({},d),delete d.state,d?(p={},n&&(p.inputs=s.getStudyRecordFromArray([e].concat(n),this._chartWidget).inputs),_=u.insertStudy(d,p,t,null,h.priceScale),c&&a(_,c),f=r(u.paneForSource(_)),m=f.priceScaleName(_.priceScale()),u.setPriceScaleVisibility(m,!0),i&&_.setUserEditEnabled(!1),o&&o(_.id()),_.id()):(console.warn("Study `"+e+"` not found."),null))},b.prototype.getStudyById=function(e){var t=this._chartWidget.model().model().getStudyById(e);if(null===t)throw Error("There is no such study");return this._getStudyApi(t)},b.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},b.prototype.setChartType=function(e){this._chartWidget.model().mainSeries().properties().style.setValue(e)},b.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},b.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().completed())},b.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().symbolResolved())},b.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},b.prototype.onVisibleRangeChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().timeScale().visibleBarsChanged())},b.prototype.dataReady=function(e){var t=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return e&&(t?this.onDataLoaded().subscribe(null,e,!0):e()),!t},b.prototype.crossHairMoved=function(e){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,e)},b.prototype.setTimezone=function(e){this._chartWidget.setTimezone(e)},b.prototype.getPanes=function(){return this._chartWidget.model().chartModel().panes().map(function(e){return this._getPaneApi(e)},this)},b.prototype.exportData=function(e){var t=this._chartWidget;return new Promise(function(n){i.e(26).then(function(o){var r=i(821).exportData;n(r(t.model().chartModel(),e))}.bind(null,i)).catch(i.oe)})},b.prototype.canZoomOut=function(){return!this._chartWidget.model().zoomStack().isEmpty()},b.prototype.zoomOut=function(){ t.disableSelection&&(c.customization.disableSelection=!0),t.disableSave&&(c.customization.disableSave=!0),t.hasOwnProperty("showInObjectsTree")&&(c.customization.showInObjectsTree=t.showInObjectsTree),t.zOrder&&("top"===t.zOrder?u.bringToFront(c):"bottom"===t.zOrder&&u.sendToBack(c)),c.id()}},b.prototype.getShapeById=function(e){var t=this._chartWidget.model().model().getLineToolById(e);if(null===t)throw Error("There is no such shape");return this._getLineDataSourceApi(t)},b.prototype.createStudy=function(e,t,i,n,o,c,h){var u,d,p,_,f,m;return h=h||{},h.checkLimit&&!this._chartWidget.model().canCreateStudy()?(g(),null):(e=e.toLowerCase(),u=this._chartWidget.model().chartModel(),d=l.findStudyMetaInfoByDescription(u.studiesMetaData(),e),d=$.extend({},d),delete d.state,d?(p={},n&&(p.inputs=s.getStudyRecordFromArray([e].concat(n),this._chartWidget).inputs),_=u.insertStudy(d,p,t,null,h.priceScale),c&&a(_,c),f=r(u.paneForSource(_)),m=f.priceScaleName(_.priceScale()),u.setPriceScaleVisibility(m,!0),i&&_.setUserEditEnabled(!1),o&&o(_.id()),_.id()):(console.warn("Study `"+e+"` not found."),null))},b.prototype.getStudyById=function(e){var t=this._chartWidget.model().model().getStudyById(e);if(null===t)throw Error("There is no such study");return this._getStudyApi(t)},b.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},b.prototype.setChartType=function(e){this._chartWidget.model().mainSeries().properties().style.setValue(e)},b.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},b.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().completed())},b.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().symbolResolved())},b.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},b.prototype.onVisibleRangeChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().timeScale().visibleBarsChanged())},b.prototype.dataReady=function(e){var t=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return e&&(t?this.onDataLoaded().subscribe(null,e,!0):e()),!t},b.prototype.crossHairMoved=function(e){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,e)},b.prototype.setTimezone=function(e){this._chartWidget.setTimezone(e)},b.prototype.getPanes=function(){return this._chartWidget.model().chartModel().panes().map(function(e){return this._getPaneApi(e)},this)},b.prototype.exportData=function(e){var t=this._chartWidget;return new Promise(function(n){i.e(26).then(function(o){var r=i(821).exportData;n(r(t.model().chartModel(),e))}.bind(null,i)).catch(i.oe)})},b.prototype.canZoomOut=function(){return!this._chartWidget.model().zoomStack().isEmpty()},
this.canZoomOut()&&this._chartWidget.model().zoomFromViewport()},e.exports=b}).call(t,i(5))},function(e,t,i){"use strict";var n=function(){function e(e){return e.is_price_study}function t(e,t){var i,n=t.slice(0).toLowerCase();if(e){for(i=0;i<e.length;++i)if(e[i].description.toLowerCase()===n||e[i].shortDescription.toLowerCase()===n)return e[i];throw Error("Can't find metainfo for `"+t+"`")}throw Error("There is no studies metainfo at all")}function i(e){return e.inputs.map(function(e){return{id:e.id,type:e.type,name:e.name}})}function n(n,o){var r,a,l,c,h,u,d,p,_;if(!Array.isArray(n))return r=t(o.model().studiesMetaData(),n),{id:r.id,overlay:e(r)};for(a=n.slice(0),l=a[0],r=t(o.model().studiesMetaData(),l),c=e(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 o(e,n,o){function r(e){return e.name.toLowerCase()===a}var s,a,l,c=t(o.model().studiesMetaData(),e),h=i(c),u={};for(s in n)a=s.toLowerCase(),l=h.filter(r),0!==l.length?(l=l[0],u[l.id]=n[s]):console.warn("Uknown input `"+s+"` of `"+e+"`");return{id:c.id,name:e,inputs:u}}var r={},s={bool:function(e){return!!e},integer:function(e){return parseInt(e)},float:function(e){return parseFloat(e)},string:function(e){return e}};return r.getStudyRecordFromArray=function(e,t){return t=t||chartWidget,n(e,t)},r.getStudyRecordFromObject=function(e,t,i){return i=i||chartWidget,o(e,t,i)},r}();e.exports=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineDataSourceApi",function(){return r}),n=i(12),i.n(n),o=["alwaysShowStats","clonable","entryPrice","interval","lastUpdateTime","points","singleChartOnly","snapTo45Degrees","stopPrice","symbol","targetPrice"],r=function(){function e(e,t,i){this._source=e,this._model=t,this._pointsConverter=i}return e.prototype.isSelectionEnabled=function(){return this._source.isSelectionEnabled()},e.prototype.setSelectionEnabled=function(e){this._source.setSelectionEnabled(e)},e.prototype.isSavingEnabled=function(){return this._source.isSavedInChart()},e.prototype.setSavingEnabled=function(e){this._source.setSavingInChartEnabled(e)},e.prototype.isShowInObjectsTreeEnabled=function(){return this._source.showInObjectTree()},e.prototype.setShowInObjectsTreeEnabled=function(e){this._source.setShowInObjectsTreeEnabled(e)},e.prototype.isUserEditEnabled=function(){return this._source.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._source.setUserEditEnabled(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._source)},e.prototype.sendToBack=function(){this._model.sendToBack(this._source)},e.prototype.getProperties=function(){return this._source.properties().state(o,!0)},e.prototype.setProperties=function(e){this._setProps(this._source.properties(),e,"")},e.prototype.getPoints=function(){return this._pointsConverter.dataSourcePointsToPriced(this._source.points())},e.prototype.setPoints=function(e){var t,i,n=this._source.pointsCount(),o=-1===n?this._source.points().length:n b.prototype.zoomOut=function(){this.canZoomOut()&&this._chartWidget.model().zoomFromViewport()},e.exports=b}).call(t,i(5))},function(e,t,i){"use strict";var n=function(){function e(e){return e.is_price_study}function t(e,t){var i,n=t.slice(0).toLowerCase();if(e){for(i=0;i<e.length;++i)if(e[i].description.toLowerCase()===n||e[i].shortDescription.toLowerCase()===n)return e[i];throw Error("Can't find metainfo for `"+t+"`")}throw Error("There is no studies metainfo at all")}function i(e){return e.inputs.map(function(e){return{id:e.id,type:e.type,name:e.name}})}function n(n,o){var r,a,l,c,h,u,d,p,_;if(!Array.isArray(n))return r=t(o.model().studiesMetaData(),n),{id:r.id,overlay:e(r)};for(a=n.slice(0),l=a[0],r=t(o.model().studiesMetaData(),l),c=e(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 o(e,n,o){function r(e){return e.name.toLowerCase()===a}var s,a,l,c=t(o.model().studiesMetaData(),e),h=i(c),u={};for(s in n)a=s.toLowerCase(),l=h.filter(r),0!==l.length?(l=l[0],u[l.id]=n[s]):console.warn("Uknown input `"+s+"` of `"+e+"`");return{id:c.id,name:e,inputs:u}}var r={},s={bool:function(e){return!!e},integer:function(e){return parseInt(e)},float:function(e){return parseFloat(e)},string:function(e){return e}};return r.getStudyRecordFromArray=function(e,t){return t=t||chartWidget,n(e,t)},r.getStudyRecordFromObject=function(e,t,i){return i=i||chartWidget,o(e,t,i)},r}();e.exports=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineDataSourceApi",function(){return r}),n=i(12),i.n(n),o=["alwaysShowStats","clonable","entryPrice","interval","lastUpdateTime","points","singleChartOnly","snapTo45Degrees","stopPrice","symbol","targetPrice"],r=function(){function e(e,t,i){this._source=e,this._model=t,this._pointsConverter=i}return e.prototype.isSelectionEnabled=function(){return this._source.isSelectionEnabled()},e.prototype.setSelectionEnabled=function(e){this._source.setSelectionEnabled(e)},e.prototype.isSavingEnabled=function(){return this._source.isSavedInChart()},e.prototype.setSavingEnabled=function(e){this._source.setSavingInChartEnabled(e)},e.prototype.isShowInObjectsTreeEnabled=function(){return this._source.showInObjectTree()},e.prototype.setShowInObjectsTreeEnabled=function(e){this._source.setShowInObjectsTreeEnabled(e)},e.prototype.isUserEditEnabled=function(){return this._source.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._source.setUserEditEnabled(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._source)},e.prototype.sendToBack=function(){this._model.sendToBack(this._source)},e.prototype.getProperties=function(){return this._source.properties().state(o,!0)},e.prototype.setProperties=function(e){this._setProps(this._source.properties(),e,"")},e.prototype.getPoints=function(){return this._pointsConverter.dataSourcePointsToPriced(this._source.points())},e.prototype.setPoints=function(e){
;if(o!==e.length)throw Error("Wrong points count. Required="+o);for(t=this._pointsConverter.apiPointsToDataSource(e),i=0;i<t.length;++i)this._source.setPoint(i,t[i])},e.prototype._setProps=function(e,t,i){var o,r,s;for(o in t)t.hasOwnProperty(o)&&(r=0===i.length?o:i+"."+o,e.hasOwnProperty(o)?(s=t[o],Object(n.isHashObject)(s)?this._setProps(e[o],s,r):e[o].setValue(s)):console.warn('Unknown property "'+r+'"'))},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyApi",function(){return s}),n=i(1),i(11),o=i(7),i.n(o),r=i(162),s=function(){function e(e,t){this._study=e,this._model=t}return e.prototype.isUserEditEnabled=function(){return this._study.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._study.setUserEditEnabled(e)},e.prototype.getInputsInfo=function(){return this._study.metaInfo().inputs.map(function(e){return n.a({},e,{localizedName:void 0!==e.name?window.t(e.name,{context:"input"}):""})})},e.prototype.getInputValues=function(){var e=this._study.inputs();return Object.keys(e).map(function(t){return{id:t,value:e[t]}})},e.prototype.setInputValues=function(e){var t,i,n,o=this.getInputValues(),r=function(e){void 0!==o.find(function(t){return t.id===e.id})?s._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},s=this;for(t=0,i=e;t<i.length;t++)n=i[t],r(n)},e.prototype.mergeUp=function(){this._model.mergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.mergeDown=function(){this._model.mergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.unmergeUp=function(){this._model.unmergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.unmergeDown=function(){this._model.unmergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.changePriceScale=function(e){var t,i,n,r=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),s=null;switch(e){case"left":s=r.priceScaleByName("left");break;case"right":s=r.priceScaleByName("right");break;case"no-scale":s=r.priceScaleByName("");break;case"as-series":if(t=this._model.mainSeries(),(i=Object(o.ensureNotNull)(this._model.paneForSource(t)))!==r)return void console.warn('BEWARE: Attempt to change price scale to "as-series", but series and study are on different panes');n=i.priceScaleName(i.priceScaleForSource(t)),s=r.priceScaleByName(n);break;default:throw Error("Cannot change study's price scale to unknown price scale (\""+e+'")')}this._model.move(this._study,r,s),this._showStudyPriceScale()},e.prototype.isVisible=function(){return this._study.properties().visible.value()},e.prototype.setVisible=function(e){this._study.properties().visible.setValue(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._study)},e.prototype.sendToBack=function(){this._model.sendToBack(this._study)},e.prototype.applyOverrides=function(e){Object(r.applyOverridesToStudy)(this._study,e)},e.prototype._showStudyPriceScale=function(){ var t,i,n=this._source.pointsCount(),o=-1===n?this._source.points().length:n;if(o!==e.length)throw Error("Wrong points count. Required="+o);for(t=this._pointsConverter.apiPointsToDataSource(e),i=0;i<t.length;++i)this._source.setPoint(i,t[i])},e.prototype._setProps=function(e,t,i){var o,r,s;for(o in t)t.hasOwnProperty(o)&&(r=0===i.length?o:i+"."+o,e.hasOwnProperty(o)?(s=t[o],Object(n.isHashObject)(s)?this._setProps(e[o],s,r):e[o].setValue(s)):console.warn('Unknown property "'+r+'"'))},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyApi",function(){return s}),n=i(1),i(11),o=i(7),i.n(o),r=i(162),s=function(){function e(e,t){this._study=e,this._model=t}return e.prototype.isUserEditEnabled=function(){return this._study.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._study.setUserEditEnabled(e)},e.prototype.getInputsInfo=function(){return this._study.metaInfo().inputs.map(function(e){return n.a({},e,{localizedName:void 0!==e.name?window.t(e.name,{context:"input"}):""})})},e.prototype.getInputValues=function(){var e=this._study.inputs();return Object.keys(e).map(function(t){return{id:t,value:e[t]}})},e.prototype.setInputValues=function(e){var t,i,n,o=this.getInputValues(),r=function(e){void 0!==o.find(function(t){return t.id===e.id})?s._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},s=this;for(t=0,i=e;t<i.length;t++)n=i[t],r(n)},e.prototype.mergeUp=function(){this._model.mergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.mergeDown=function(){this._model.mergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.unmergeUp=function(){this._model.unmergeSourceUp(this._study),this._showStudyPriceScale()},e.prototype.unmergeDown=function(){this._model.unmergeSourceDown(this._study),this._showStudyPriceScale()},e.prototype.changePriceScale=function(e){var t,i,n,r=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),s=null;switch(e){case"left":s=r.priceScaleByName("left");break;case"right":s=r.priceScaleByName("right");break;case"no-scale":s=r.priceScaleByName("");break;case"as-series":if(t=this._model.mainSeries(),(i=Object(o.ensureNotNull)(this._model.paneForSource(t)))!==r)return void console.warn('BEWARE: Attempt to change price scale to "as-series", but series and study are on different panes');n=i.priceScaleName(i.priceScaleForSource(t)),s=r.priceScaleByName(n);break;default:throw Error("Cannot change study's price scale to unknown price scale (\""+e+'")')}this._model.move(this._study,r,s),this._showStudyPriceScale()},e.prototype.isVisible=function(){return this._study.properties().visible.value()},e.prototype.setVisible=function(e){this._study.properties().visible.setValue(e)},e.prototype.bringToFront=function(){this._model.bringToFront(this._study)},e.prototype.sendToBack=function(){this._model.sendToBack(this._study)},e.prototype.applyOverrides=function(e){Object(r.applyOverridesToStudy)(this._study,e)},e.prototype._showStudyPriceScale=function(){
var e=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),t=e.priceScaleName(this._study.priceScale());this._model.setPriceScaleVisibility(t,!0)},e}()},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),n=function(){function e(e){this._priceScale=e}return e.prototype.getMode=function(){var e=this._priceScale.properties();return e.percentage.value()?2:e.indexedTo100.value()?3:e.log.value()?1:0},e.prototype.setMode=function(e){this._priceScale.setMode({percentage:2===e,log:1===e,indexedTo100:3===e})},e}(),i.d(t,"PaneApi",function(){return o}),o=function(){function e(e){this._priceScales=new WeakMap,this._pane=e}return e.prototype.hasMainSeries=function(){return this._pane.containsMainSeries()},e.prototype.getLeftPriceScale=function(){return this._getPriceScaleApi(this._pane.leftPriceScale())},e.prototype.getRightPriceScale=function(){return this._getPriceScaleApi(this._pane.rightPriceScale())},e.prototype.getMainSourcePriceScale=function(){var e,t=this._pane.mainDataSource();return null===t?null:(e=this._pane.priceScaleForSource(t),null===e?null:this._getPriceScaleApi(e))},e.prototype._getPriceScaleApi=function(e){var t=this._priceScales.get(e);return void 0===t&&(t=new n(e),this._priceScales.set(e,t)),t},e}()},function(e,t,i){"use strict";function n(e,t){var i=function(){e.completed().unsubscribe(null,n),t(!1)},n=function(){e.error().unsubscribe(null,i),t(!0)};e.completed().subscribe(null,i,!0),e.error().subscribe(null,n,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.onSeriesCompletedOrErrorReceived=n},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ThemesApi",function(){return o}),n=i(251),o=function(){function e(e){this._opts=e}return e.prototype.isStdTheme=function(){return Object(n.isStdTheme)(Object(n.extractThemeFromModel)(this._getActiveChartModel()))},e.prototype.setStdTheme=function(e){var t=this;return Object(n.getStdTheme)(e).then(function(i){t._opts.chartWidgetCollection.applyTheme(i.content),Object(n.setTheme)(e),Object(n.syncTheme)()})},e.prototype.setStdThemeForLayout=function(e){Object(n.setTheme)(e),Object(n.syncTheme)()},e.prototype.getCurrentThemeName=function(){return Object(n.getCurrentTheme)().name},e.prototype._getActiveChartModel=function(){return this._getActiveChartWidget().model()},e.prototype._getActiveChartWidget=function(){return this._opts.chartWidgetCollection.activeChartWidget.value()},e}()},function(e,t,i){"use strict";var n,o,r,s=i(25);i(183),n=i(687).pivotPointsStandardStudyItem,o=i(688).spreadStudyItem,r=i(689).ratioStudyItem,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", var e=Object(o.ensureNotNull)(this._model.paneForSource(this._study)),t=e.priceScaleName(this._study.priceScale());this._model.setPriceScaleVisibility(t,!0)},e}()},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),n=function(){function e(e){this._priceScale=e}return e.prototype.getMode=function(){var e=this._priceScale.properties();return e.percentage.value()?2:e.indexedTo100.value()?3:e.log.value()?1:0},e.prototype.setMode=function(e){this._priceScale.setMode({percentage:2===e,log:1===e,indexedTo100:3===e})},e}(),i.d(t,"PaneApi",function(){return o}),o=function(){function e(e){this._priceScales=new WeakMap,this._pane=e}return e.prototype.hasMainSeries=function(){return this._pane.containsMainSeries()},e.prototype.getLeftPriceScale=function(){return this._getPriceScaleApi(this._pane.leftPriceScale())},e.prototype.getRightPriceScale=function(){return this._getPriceScaleApi(this._pane.rightPriceScale())},e.prototype.getMainSourcePriceScale=function(){var e,t=this._pane.mainDataSource();return null===t?null:(e=this._pane.priceScaleForSource(t),null===e?null:this._getPriceScaleApi(e))},e.prototype._getPriceScaleApi=function(e){var t=this._priceScales.get(e);return void 0===t&&(t=new n(e),this._priceScales.set(e,t)),t},e}()},function(e,t,i){"use strict";function n(e,t){var i=function(){e.completed().unsubscribe(null,n),t(!1)},n=function(){e.error().unsubscribe(null,i),t(!0)};e.completed().subscribe(null,i,!0),e.error().subscribe(null,n,!0)}Object.defineProperty(t,"__esModule",{value:!0}),t.onSeriesCompletedOrErrorReceived=n},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ThemesApi",function(){return o}),n=i(251),o=function(){function e(e){this._opts=e}return e.prototype.isStdTheme=function(){return Object(n.isStdTheme)(Object(n.extractThemeFromModel)(this._getActiveChartModel()))},e.prototype.setStdTheme=function(e){var t=this;return Object(n.getStdTheme)(e).then(function(i){t._opts.chartWidgetCollection.applyTheme(i.content),Object(n.setTheme)(e),Object(n.syncTheme)()})},e.prototype.setStdThemeForLayout=function(e){Object(n.setTheme)(e),Object(n.syncTheme)()},e.prototype.getCurrentThemeName=function(){return Object(n.getCurrentTheme)().name},e.prototype._getActiveChartModel=function(){return this._getActiveChartWidget().model()},e.prototype._getActiveChartWidget=function(){return this._opts.chartWidgetCollection.activeChartWidget.value()},e}()},function(e,t,i){"use strict";var n,o,r,s=i(25);i(183),n=i(687).pivotPointsStandardStudyItem,o=i(688).spreadStudyItem,r=i(689).ratioStudyItem,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",isHidden:!0}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(1),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(e,t){var i,n,o,r,a;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=s.Std[t(0)](this._context),r=this._context.new_unlimited_var(o),this._context.select_sym(0),a=r.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(e,t){this._context=e,this._context.new_sym(t(0),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(e,t){var i,n,o,r,a,l;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=this._context.new_unlimited_var(s.Std.open(this._context)),r=this._context.new_unlimited_var(s.Std.high(this._context)),a=this._context.new_unlimited_var(s.Std.low(this._context)),l=this._context.new_unlimited_var(s.Std.close(this._context)),this._context.select_sym(0),[o.adopt(n,i,1),r.adopt(n,i,1),a.adopt(n,i,1),l.adopt(n,i,1)]}}},{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:"#eb4d5c",width:1,style:0},1:{color:"#53b987",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:"Falling"},1:{name:"Growing"}}}},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(e,t){return s.Std.gt(e,t)?0:1},this.f_1=function(e,t){return e?t:s.Std.na()},this.main=function(e,t){ 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",isHidden:!0}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(1),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(e,t){var i,n,o,r,a;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=s.Std[t(0)](this._context),r=this._context.new_unlimited_var(o),this._context.select_sym(0),a=r.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(e,t){this._context=e,this._context.new_sym(t(0),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(e,t){var i,n,o,r,a,l;return this._context=e,i=this._context.new_unlimited_var(this._context.symbol.time),this._context.select_sym(1),n=this._context.new_unlimited_var(this._context.symbol.time),o=this._context.new_unlimited_var(s.Std.open(this._context)),r=this._context.new_unlimited_var(s.Std.high(this._context)),a=this._context.new_unlimited_var(s.Std.low(this._context)),l=this._context.new_unlimited_var(s.Std.close(this._context)),this._context.select_sym(0),[o.adopt(n,i,1),r.adopt(n,i,1),a.adopt(n,i,1),l.adopt(n,i,1)]}}},{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:"#eb4d5c",width:1,style:0},1:{color:"#53b987",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:"Falling"},1:{name:"Growing"}}}},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(e,t){return s.Std.gt(e,t)?0:1},this.f_1=function(e,t){return e?t:s.Std.na()},this.main=function(e,t){
var i,n,o,r,a,l,c;return this._context=e,this._input=t,i=this._input(0),n=s.Std.volume(this._context),o=this.f_0(s.Std.open(this._context),s.Std.close(this._context)),r=s.Std.volume(this._context),a=this._context.new_var(r),l=s.Std.sma(a,this._input(1),this._context),c=this.f_1(i,l),[n,o,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(e,t){var i,n,o,r,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),n=this._input(1),o=i/100,r=n/2,a=s.Std.zigzag(o,r,this._context),l=s.Std.zigzagbars(o,r,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 e(e,t){return{id:e,time:e,extendBottom:!0,extendTop:!0}}this.init=function(){this._times=[]},this._getVerticalLineData=function(t){return s.Std.selectSessionBreaks(t,this._times).map(e)},this.main=function(e,t){var i,n,o;return s.Std.isdwm(e)?null:(i=s.Std.time(e),isNaN(i)?null:(n=this._times.length,0!==n&&this._times[n-1]===i||this._times.push(i),e.symbol.isLastBar&&e.symbol.isNewBar?(o=this._getVerticalLineData(e),0===o.length?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{styleId:"sessBreaks",data:o}]},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, var i,n,o,r,a,l,c;return this._context=e,this._input=t,i=this._input(0),n=s.Std.volume(this._context),o=this.f_0(s.Std.open(this._context),s.Std.close(this._context)),r=s.Std.volume(this._context),a=this._context.new_var(r),l=s.Std.sma(a,this._input(1),this._context),c=this.f_1(i,l),[n,o,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(e,t){var i,n,o,r,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),n=this._input(1),o=i/100,r=n/2,a=s.Std.zigzag(o,r,this._context),l=s.Std.zigzagbars(o,r,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 e(e,t){return{id:e,time:e,extendBottom:!0,extendTop:!0}}this.init=function(){this._times=[]},this._getVerticalLineData=function(t){return s.Std.selectSessionBreaks(t,this._times).map(e)},this.main=function(e,t){var i,n,o;return s.Std.isdwm(e)?null:(i=s.Std.time(e),isNaN(i)?null:(n=this._times.length,0!==n&&this._times[n-1]===i||this._times.push(i),e.symbol.isLastBar&&e.symbol.isNewBar?(o=this._getVerticalLineData(e),0===o.length?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{styleId:"sessBreaks",data:o}]},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,

View File

@@ -1,4 +1,4 @@
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n,r,o=window.webpackJsonp;window.webpackJsonp=function(n,i,a){for(var s,u,l,c=0,f=[];c<n.length;c++)u=n[c],r[u]&&f.push(r[u][0]),r[u]=0;for(s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s]);for(o&&o(n,i,a);f.length;)f.shift()();if(a)for(c=0;c<a.length;c++)l=t(t.s=a[c]);return l},n={},r={34:0},t.e=function(e){function n(){a.onerror=a.onload=null,clearTimeout(s);var t=r[e];0!==t&&(t&&t[1](Error("Loading chunk "+e+" failed.")),r[e]=void 0)}var o,i,a,s,u=r[e];return 0===u?new Promise(function(e){e()}):u?u[2]:(o=new Promise(function(t,n){u=r[e]=[t,n]}),u[2]=o,i=document.getElementsByTagName("head")[0],a=document.createElement("script"),a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,t.nc&&a.setAttribute("nonce",t.nc),a.src=t.p+""+({0:"lt-pane-views",1:"chart-widget-gui",2:"create-dialog",3:"floating-toolbars",4:"take-chart-image-dialog-impl",5:"drawing-toolbar",6:"ds-property-pages",7:"restricted-toolset",8:"objecttreedialog",9:"go-to-date-dialog-impl",10:"load-chart-layout-dialog",11:"ie-fallback-logos",12:"chart-bottom-toolbar",13:"symbol-info-dialog-impl",14:"add-compare-dialog",15:"study-market",16:"confirm-inputs-dialog",17:"editobjectdialog",18:"header-toolbar",19:"confirm-symbol-input-dialog",20:"symbolsearch",21:"change-interval-dialog",23:"lazy-velocity",24:"study-pane-views",25:"series-pane-views",26:"export-data",27:"propertypagesfactory",28:"hammerjs",29:"library",30:"line-tools-icons",31:"lazy-jquery-ui",32:"series-icons-map"}[e]||e)+"."+{0:"92236c4fd18131ce41f4",1:"67de12c05d134554ff1c",2:"b388c187425e521c5a70",3:"348bec38a5b37a3f388f",4:"8581642b95a39228d178",5:"b5c7b558d29b0ded0e45",6:"0ec3f0e39331586d5be1",7:"a0f7780efd28528934ba",8:"b9fa79f3c22b36c514bf",9:"193ed211cd4f2c07f45e",10:"7bca15b478667d4a383c",11:"ecdc2f1255ecbff1dc5f",12:"7bbb5f176039f7d3dc2b",13:"6812ea9f986a1db1a6a9",14:"99e6e22e5d6b137269e9",15:"c4fcdd9f755d64995795",16:"acb4dc0e002888e741f5",17:"6741e8ad1a77a4388d0f",18:"95cfaecb949c7e2261e3",19:"741858b9ef54b3611d31",20:"e22809c43539f903c28a",21:"90d98fd5c50c9ae968da",22:"d344a511955b43dbefcc",23:"b369bcf3fef7b3d24234",24:"a750dba6fc5340758064",25:"9ee45674170ad7836ba4",26:"c8730af5d9a5f56fecc4",27:"42f63d141baef6e836f7",28:"9f017652d0f77438961c",29:"f99a9dc4f2eb57d8bd32",30:"d4bcd6d038b2fea6feed",31:"d97968c821f676a52e9b",32:"359d3b9b312cf5f56733",33:"bf2a2fc98cda3004cc87"}[e]+".js",s=setTimeout(n,12e4),a.onerror=a.onload=n,i.appendChild(a),o)},t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="bundles/",t.p=window.WEBPACK_PUBLIC_PATH||t.p,t.oe=function(e){throw console.error(e),e},t(t.s=360)}([,,,,,,,,,,function(e,t,n){ !function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n,r,o=window.webpackJsonp;window.webpackJsonp=function(n,i,a){for(var s,u,l,c=0,f=[];c<n.length;c++)u=n[c],r[u]&&f.push(r[u][0]),r[u]=0;for(s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s]);for(o&&o(n,i,a);f.length;)f.shift()();if(a)for(c=0;c<a.length;c++)l=t(t.s=a[c]);return l},n={},r={34:0},t.e=function(e){function n(){a.onerror=a.onload=null,clearTimeout(s);var t=r[e];0!==t&&(t&&t[1](Error("Loading chunk "+e+" failed.")),r[e]=void 0)}var o,i,a,s,u=r[e];return 0===u?new Promise(function(e){e()}):u?u[2]:(o=new Promise(function(t,n){u=r[e]=[t,n]}),u[2]=o,i=document.getElementsByTagName("head")[0],a=document.createElement("script"),a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,t.nc&&a.setAttribute("nonce",t.nc),a.src=t.p+""+({0:"lt-pane-views",1:"chart-widget-gui",2:"create-dialog",3:"floating-toolbars",4:"take-chart-image-dialog-impl",5:"drawing-toolbar",6:"ds-property-pages",7:"restricted-toolset",8:"objecttreedialog",9:"go-to-date-dialog-impl",10:"load-chart-layout-dialog",11:"ie-fallback-logos",12:"chart-bottom-toolbar",13:"symbol-info-dialog-impl",14:"add-compare-dialog",15:"study-market",16:"confirm-inputs-dialog",17:"editobjectdialog",18:"header-toolbar",19:"confirm-symbol-input-dialog",20:"symbolsearch",21:"change-interval-dialog",23:"lazy-velocity",24:"study-pane-views",25:"series-pane-views",26:"export-data",27:"propertypagesfactory",28:"hammerjs",29:"library",30:"line-tools-icons",31:"lazy-jquery-ui",32:"series-icons-map"}[e]||e)+"."+{0:"92236c4fd18131ce41f4",1:"67de12c05d134554ff1c",2:"b388c187425e521c5a70",3:"348bec38a5b37a3f388f",4:"8581642b95a39228d178",5:"b5c7b558d29b0ded0e45",6:"0ec3f0e39331586d5be1",7:"a0f7780efd28528934ba",8:"b9fa79f3c22b36c514bf",9:"193ed211cd4f2c07f45e",10:"7bca15b478667d4a383c",11:"ecdc2f1255ecbff1dc5f",12:"7bbb5f176039f7d3dc2b",13:"6812ea9f986a1db1a6a9",14:"99e6e22e5d6b137269e9",15:"c4fcdd9f755d64995795",16:"acb4dc0e002888e741f5",17:"6741e8ad1a77a4388d0f",18:"95cfaecb949c7e2261e3",19:"741858b9ef54b3611d31",20:"e22809c43539f903c28a",21:"90d98fd5c50c9ae968da",22:"d344a511955b43dbefcc",23:"b369bcf3fef7b3d24234",24:"a750dba6fc5340758064",25:"9ee45674170ad7836ba4",26:"c8730af5d9a5f56fecc4",27:"42f63d141baef6e836f7",28:"9f017652d0f77438961c",29:"7b96d91f8c68cb387e8e",30:"d4bcd6d038b2fea6feed",31:"d97968c821f676a52e9b",32:"359d3b9b312cf5f56733",33:"bf2a2fc98cda3004cc87"}[e]+".js",s=setTimeout(n,12e4),a.onerror=a.onload=n,i.appendChild(a),o)},t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="bundles/",t.p=window.WEBPACK_PUBLIC_PATH||t.p,t.oe=function(e){throw console.error(e),e},t(t.s=360)}([,,,,,,,,,,function(e,t,n){
var r=n(22),o=n(90),i=n(74),a=n(75),s=n(55),u="prototype",l=function(e,t,n){var c,f,p,d,h=e&l.F,g=e&l.G,m=e&l.S,y=e&l.P,v=e&l.B,b=g?r:m?r[t]||(r[t]={}):(r[t]||{})[u],w=g?o:o[t]||(o[t]={}),x=w[u]||(w[u]={});g&&(n=t);for(c in n)f=!h&&b&&void 0!==b[c],p=(f?b:n)[c],d=v&&f?s(p,r):y&&"function"==typeof p?s(Function.call,p):p,b&&a(b,c,p,e&l.U),w[c]!=p&&i(w,c,d),y&&x[c]!=p&&(x[c]=p)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){"use strict";function r(e){window.t=e}function o(e){s.$||(s.$={}),s.$.t=e}function i(e){return e?(window._tv_languages||{})[e]||null:null}function a(){document.body&&document.body.dispatchEvent(new c.CustomEvent("tradingview-i18next-initialized"))}var s,u,l,c,f,p,d,h,g;Object.defineProperty(t,"__esModule",{value:!0}),s=window,u=function(e,t){return e},r(u),o(u),l=n(237),c=n(240),n.d(t,"translate",function(){return u}),p={translate:u},window.__tradingviewI18nextInited||(d=window.language||null,h=i(d),d&&h||(console.error("No translation data"),d="en",h=i("en")),d&&h?(g={interpolation:{prefix:"__",suffix:"__"},keySeparator:":::",lng:d,nsSeparator:":::",resources:(f={},f[d]={translation:h},f)},l.init(g,a),p.translate=l.t.bind(l),r(p.translate),o(p.translate)):a(),window.__tradingviewI18nextInited=!0)},,,function(e,t){function n(e){var t,n,r=kt[e]={};for(e=e.split(/\s+/),t=0,n=e.length;t<n;t++)r[e[t]]=!0;return r}function r(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(D,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:_t.isNumeric(n)?+n:M.test(n)?_t.parseJSON(n):n)}catch(e){}_t.data(e,t,n)}else n=void 0}return n}function o(e){for(var t in e)if(("data"!==t||!_t.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function i(e,t,n){var r=t+"defer",o=t+"queue",i=t+"mark",a=_t._data(e,r);!a||"queue"!==n&&_t._data(e,o)||"mark"!==n&&_t._data(e,i)||setTimeout(function(){_t._data(e,o)||_t._data(e,i)||(_t.removeData(e,r,!0),a.fire())},0)}function a(){return!1}function s(){return!0}function u(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function l(e,t,n){if(t=t||0,_t.isFunction(t))return _t.grep(e,function(e,r){return!!t.call(e,r,e)===n});if(t.nodeType)return _t.grep(e,function(e,r){return e===t===n});if("string"==typeof t){var r=_t.grep(e,function(e){return 1===e.nodeType});if(ie.test(t))return _t.filter(t,r,!n);t=_t.filter(t,r)}return _t.grep(e,function(e,r){return _t.inArray(e,t)>=0===n})}function c(e){var t=le.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function f(e,t){return _t.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function p(e,t){if(1===t.nodeType&&_t.hasData(e)){var n,r,o,i=_t._data(e),a=_t._data(t,i),s=i.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,o=s[n].length;r<o;r++)_t.event.add(t,n,s[n][r])}a.data&&(a.data=_t.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(), var r=n(22),o=n(90),i=n(74),a=n(75),s=n(55),u="prototype",l=function(e,t,n){var c,f,p,d,h=e&l.F,g=e&l.G,m=e&l.S,y=e&l.P,v=e&l.B,b=g?r:m?r[t]||(r[t]={}):(r[t]||{})[u],w=g?o:o[t]||(o[t]={}),x=w[u]||(w[u]={});g&&(n=t);for(c in n)f=!h&&b&&void 0!==b[c],p=(f?b:n)[c],d=v&&f?s(p,r):y&&"function"==typeof p?s(Function.call,p):p,b&&a(b,c,p,e&l.U),w[c]!=p&&i(w,c,d),y&&x[c]!=p&&(x[c]=p)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){"use strict";function r(e){window.t=e}function o(e){s.$||(s.$={}),s.$.t=e}function i(e){return e?(window._tv_languages||{})[e]||null:null}function a(){document.body&&document.body.dispatchEvent(new c.CustomEvent("tradingview-i18next-initialized"))}var s,u,l,c,f,p,d,h,g;Object.defineProperty(t,"__esModule",{value:!0}),s=window,u=function(e,t){return e},r(u),o(u),l=n(237),c=n(240),n.d(t,"translate",function(){return u}),p={translate:u},window.__tradingviewI18nextInited||(d=window.language||null,h=i(d),d&&h||(console.error("No translation data"),d="en",h=i("en")),d&&h?(g={interpolation:{prefix:"__",suffix:"__"},keySeparator:":::",lng:d,nsSeparator:":::",resources:(f={},f[d]={translation:h},f)},l.init(g,a),p.translate=l.t.bind(l),r(p.translate),o(p.translate)):a(),window.__tradingviewI18nextInited=!0)},,,function(e,t){function n(e){var t,n,r=kt[e]={};for(e=e.split(/\s+/),t=0,n=e.length;t<n;t++)r[e[t]]=!0;return r}function r(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(D,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:_t.isNumeric(n)?+n:M.test(n)?_t.parseJSON(n):n)}catch(e){}_t.data(e,t,n)}else n=void 0}return n}function o(e){for(var t in e)if(("data"!==t||!_t.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function i(e,t,n){var r=t+"defer",o=t+"queue",i=t+"mark",a=_t._data(e,r);!a||"queue"!==n&&_t._data(e,o)||"mark"!==n&&_t._data(e,i)||setTimeout(function(){_t._data(e,o)||_t._data(e,i)||(_t.removeData(e,r,!0),a.fire())},0)}function a(){return!1}function s(){return!0}function u(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function l(e,t,n){if(t=t||0,_t.isFunction(t))return _t.grep(e,function(e,r){return!!t.call(e,r,e)===n});if(t.nodeType)return _t.grep(e,function(e,r){return e===t===n});if("string"==typeof t){var r=_t.grep(e,function(e){return 1===e.nodeType});if(ie.test(t))return _t.filter(t,r,!n);t=_t.filter(t,r)}return _t.grep(e,function(e,r){return _t.inArray(e,t)>=0===n})}function c(e){var t=le.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function f(e,t){return _t.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function p(e,t){if(1===t.nodeType&&_t.hasData(e)){var n,r,o,i=_t._data(e),a=_t._data(t,i),s=i.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,o=s[n].length;r<o;r++)_t.event.add(t,n,s[n][r])}a.data&&(a.data=_t.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),
t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?t.outerHTML=e.outerHTML:"input"!==n||"checkbox"!==e.type&&"radio"!==e.type?"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text):(e.checked&&(t.defaultChecked=t.checked=e.checked),t.value!==e.value&&(t.value=e.value)),t.removeAttribute(_t.expando),t.removeAttribute("_submit_attached"),t.removeAttribute("_change_attached"))}function h(e){return void 0!==e.getElementsByTagName?e.getElementsByTagName("*"):void 0!==e.querySelectorAll?e.querySelectorAll("*"):[]}function g(e){"checkbox"!==e.type&&"radio"!==e.type||(e.defaultChecked=e.checked)}function m(e){var t=(e.nodeName||"").toLowerCase();"input"===t?g(e):"script"!==t&&void 0!==e.getElementsByTagName&&_t.grep(e.getElementsByTagName("input"),g)}function y(e){var t=bt.createElement("div");return ke.appendChild(t),t.innerHTML=e.outerHTML,t.firstChild}function v(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,o="width"===t?1:0,i=4;if(r>0){if("border"!==n)for(;o<i;o+=2)n||(r-=parseFloat(_t.css(e,"padding"+Ae[o]))||0),"margin"===n?r+=parseFloat(_t.css(e,n+Ae[o]))||0:r-=parseFloat(_t.css(e,"border"+Ae[o]+"Width"))||0;return r+"px"}if(r=Me(e,t),(r<0||null==r)&&(r=e.style[t]),Oe.test(r))return r;if(r=parseFloat(r)||0,n)for(;o<i;o+=2)r+=parseFloat(_t.css(e,"padding"+Ae[o]))||0,"padding"!==n&&(r+=parseFloat(_t.css(e,"border"+Ae[o]+"Width"))||0),"margin"===n&&(r+=parseFloat(_t.css(e,n+Ae[o]))||0);return r+"px"}function b(e){return function(t,n){if("string"!=typeof t&&(n=t,t="*"),_t.isFunction(n))for(var r,o,i,a=t.toLowerCase().split(Xe),s=0,u=a.length;s<u;s++)r=a[s],i=/^\+/.test(r),i&&(r=r.substr(1)||"*"),o=e[r]=e[r]||[],o[i?"unshift":"push"](n)}}function w(e,t,n,r,o,i){o=o||t.dataTypes[0],i=i||{},i[o]=!0;for(var a,s=e[o],u=0,l=s?s.length:0,c=e===Je;u<l&&(c||!a);u++)"string"==typeof(a=s[u](t,n,r))&&(!c||i[a]?a=void 0:(t.dataTypes.unshift(a),a=w(e,t,n,r,a,i)));return!c&&a||i["*"]||(a=w(e,t,n,r,"*",i)),a}function x(e,t){var n,r,o=_t.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);r&&_t.extend(!0,e,r)}function _(e,t,n,r){if(_t.isArray(t))_t.each(t,function(t,o){n||Fe.test(e)?r(e,o):_(e+"["+("object"==typeof o?t:"")+"]",o,n,r)});else if(n||"object"!==_t.type(t))r(e,t);else for(var o in t)_(e+"["+o+"]",t[o],n,r)}function k(e,t,n){var r,o,i,a,s=e.contents,u=e.dataTypes,l=e.responseFields;for(o in l)o in n&&(t[l[o]]=n[o]);for(;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("content-type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){u.unshift(o);break}if(u[0]in n)i=u[0];else{for(o in n){if(!u[0]||e.converters[o+" "+u[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==u[0]&&u.unshift(i),n[i]}function T(e,t){e.dataFilter&&(t=e.dataFilter(t,e.dataType));var n,r,o,i,a,s,u,l,c=e.dataTypes,f={},p=c.length,d=c[0];for(n=1;n<p;n++){if(1===n)for(r in e.converters)"string"==typeof r&&(f[r.toLowerCase()]=e.converters[r]);if(i=d,"*"===(d=c[n]))d=i;else if("*"!==i&&i!==d){ t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?t.outerHTML=e.outerHTML:"input"!==n||"checkbox"!==e.type&&"radio"!==e.type?"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text):(e.checked&&(t.defaultChecked=t.checked=e.checked),t.value!==e.value&&(t.value=e.value)),t.removeAttribute(_t.expando),t.removeAttribute("_submit_attached"),t.removeAttribute("_change_attached"))}function h(e){return void 0!==e.getElementsByTagName?e.getElementsByTagName("*"):void 0!==e.querySelectorAll?e.querySelectorAll("*"):[]}function g(e){"checkbox"!==e.type&&"radio"!==e.type||(e.defaultChecked=e.checked)}function m(e){var t=(e.nodeName||"").toLowerCase();"input"===t?g(e):"script"!==t&&void 0!==e.getElementsByTagName&&_t.grep(e.getElementsByTagName("input"),g)}function y(e){var t=bt.createElement("div");return ke.appendChild(t),t.innerHTML=e.outerHTML,t.firstChild}function v(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,o="width"===t?1:0,i=4;if(r>0){if("border"!==n)for(;o<i;o+=2)n||(r-=parseFloat(_t.css(e,"padding"+Ae[o]))||0),"margin"===n?r+=parseFloat(_t.css(e,n+Ae[o]))||0:r-=parseFloat(_t.css(e,"border"+Ae[o]+"Width"))||0;return r+"px"}if(r=Me(e,t),(r<0||null==r)&&(r=e.style[t]),Oe.test(r))return r;if(r=parseFloat(r)||0,n)for(;o<i;o+=2)r+=parseFloat(_t.css(e,"padding"+Ae[o]))||0,"padding"!==n&&(r+=parseFloat(_t.css(e,"border"+Ae[o]+"Width"))||0),"margin"===n&&(r+=parseFloat(_t.css(e,n+Ae[o]))||0);return r+"px"}function b(e){return function(t,n){if("string"!=typeof t&&(n=t,t="*"),_t.isFunction(n))for(var r,o,i,a=t.toLowerCase().split(Xe),s=0,u=a.length;s<u;s++)r=a[s],i=/^\+/.test(r),i&&(r=r.substr(1)||"*"),o=e[r]=e[r]||[],o[i?"unshift":"push"](n)}}function w(e,t,n,r,o,i){o=o||t.dataTypes[0],i=i||{},i[o]=!0;for(var a,s=e[o],u=0,l=s?s.length:0,c=e===Je;u<l&&(c||!a);u++)"string"==typeof(a=s[u](t,n,r))&&(!c||i[a]?a=void 0:(t.dataTypes.unshift(a),a=w(e,t,n,r,a,i)));return!c&&a||i["*"]||(a=w(e,t,n,r,"*",i)),a}function x(e,t){var n,r,o=_t.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);r&&_t.extend(!0,e,r)}function _(e,t,n,r){if(_t.isArray(t))_t.each(t,function(t,o){n||Fe.test(e)?r(e,o):_(e+"["+("object"==typeof o?t:"")+"]",o,n,r)});else if(n||"object"!==_t.type(t))r(e,t);else for(var o in t)_(e+"["+o+"]",t[o],n,r)}function k(e,t,n){var r,o,i,a,s=e.contents,u=e.dataTypes,l=e.responseFields;for(o in l)o in n&&(t[l[o]]=n[o]);for(;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("content-type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){u.unshift(o);break}if(u[0]in n)i=u[0];else{for(o in n){if(!u[0]||e.converters[o+" "+u[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==u[0]&&u.unshift(i),n[i]}function T(e,t){e.dataFilter&&(t=e.dataFilter(t,e.dataType));var n,r,o,i,a,s,u,l,c=e.dataTypes,f={},p=c.length,d=c[0];for(n=1;n<p;n++){if(1===n)for(r in e.converters)"string"==typeof r&&(f[r.toLowerCase()]=e.converters[r]);if(i=d,"*"===(d=c[n]))d=i;else if("*"!==i&&i!==d){
if(a=i+" "+d,!(s=f[a]||f["* "+d])){l=void 0;for(u in f)if(o=u.split(" "),(o[0]===i||"*"===o[0])&&(l=f[o[1]+" "+d])){u=f[u],!0===u?s=l:!0===l&&(s=u);break}}s||l||_t.error("No conversion from "+a.replace(" "," to ")),!0!==s&&(t=s?s(t):l(u(t)))}}return t}function E(){try{return new window.XMLHttpRequest}catch(e){}}function C(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function S(){return setTimeout(O,0),gt=_t.now()}function O(){gt=void 0}function N(e,t){var n={};return _t.each(ht.concat.apply([],ht.slice(0,t)),function(){n[this]=e}),n}function P(e){if(!ut[e]){var t=bt.body,n=_t("<"+e+">").appendTo(t),r=n.css("display");n.remove(),"none"!==r&&""!==r||(lt||(lt=bt.createElement("iframe"),lt.frameBorder=lt.width=lt.height=0),t.appendChild(lt),ct&&lt.createElement||(ct=(lt.contentWindow||lt.contentDocument).document,ct.write((_t.support.boxModel?"<!doctype html>":"")+"<html><body>"),ct.close()),n=ct.createElement(e),ct.body.appendChild(n),r=_t.css(n,"display"),t.removeChild(lt)),ut[e]=r}return ut[e]}function j(e){return _t.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}var A,M,D,L,R,F,I,H,U,W,B,z,q,$,V,K,X,G,Q,Y,J,Z,ee,te,ne,re,oe,ie,ae,se,ue,le,ce,fe,pe,de,he,ge,me,ye,ve,be,we,xe,_e,ke,Te,Ee,Ce,Se,Oe,Ne,Pe,je,Ae,Me,De,Le,Re,Fe,Ie,He,Ue,We,Be,ze,qe,$e,Ve,Ke,Xe,Ge,Qe,Ye,Je,Ze,et,tt,nt,rt,ot,it,at,st,ut,lt,ct,ft,pt,dt,ht,gt,mt,yt,vt,bt=window.document,wt=window.navigator,xt=window.location,_t=function(){function e(){if(!i.isReady){try{bt.documentElement.doScroll("left")}catch(t){return void setTimeout(e,1)}i.ready()}}var t,n,r,o,i=function(e,n){return new i.fn.init(e,n,t)},a=window.jQuery,s=window.$,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,l=/\S/,c=/^\s+/,f=/\s+$/,p=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,d=/^[\],:{}\s]*$/,h=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,g=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,y=/(webkit)[ \/]([\w.]+)/,v=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,x=/-([a-z]|[0-9])/gi,_=/^-ms-/,k=function(e,t){return(t+"").toUpperCase()},T=wt.userAgent,E=Object.prototype.toString,C=Object.prototype.hasOwnProperty,S=Array.prototype.push,O=Array.prototype.slice,N=String.prototype.trim,P=Array.prototype.indexOf,j={};return i.fn=i.prototype={constructor:i,init:function(e,t,n){var r,o,a,s;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("body"===e&&!t&&bt.body)return this.context=bt,this[0]=bt.body,this.selector=e,this.length=1,this;if("string"==typeof e){if(!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:u.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1])return t=t instanceof i?t[0]:t,s=t?t.ownerDocument||t:bt,a=p.exec(e),a?i.isPlainObject(t)?(e=[bt.createElement(a[1])],i.fn.attr.call(e,t,!0)):e=[s.createElement(a[1])]:(a=i.buildFragment([r[1]],[s]),e=(a.cacheable?i.clone(a.fragment):a.fragment).childNodes),i.merge(this,e);if((o=bt.getElementById(r[2]))&&o.parentNode){ if(a=i+" "+d,!(s=f[a]||f["* "+d])){l=void 0;for(u in f)if(o=u.split(" "),(o[0]===i||"*"===o[0])&&(l=f[o[1]+" "+d])){u=f[u],!0===u?s=l:!0===l&&(s=u);break}}s||l||_t.error("No conversion from "+a.replace(" "," to ")),!0!==s&&(t=s?s(t):l(u(t)))}}return t}function E(){try{return new window.XMLHttpRequest}catch(e){}}function C(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function S(){return setTimeout(O,0),gt=_t.now()}function O(){gt=void 0}function N(e,t){var n={};return _t.each(ht.concat.apply([],ht.slice(0,t)),function(){n[this]=e}),n}function P(e){if(!ut[e]){var t=bt.body,n=_t("<"+e+">").appendTo(t),r=n.css("display");n.remove(),"none"!==r&&""!==r||(lt||(lt=bt.createElement("iframe"),lt.frameBorder=lt.width=lt.height=0),t.appendChild(lt),ct&&lt.createElement||(ct=(lt.contentWindow||lt.contentDocument).document,ct.write((_t.support.boxModel?"<!doctype html>":"")+"<html><body>"),ct.close()),n=ct.createElement(e),ct.body.appendChild(n),r=_t.css(n,"display"),t.removeChild(lt)),ut[e]=r}return ut[e]}function j(e){return _t.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}var A,M,D,L,R,F,I,H,U,W,B,z,q,$,V,K,X,G,Q,Y,J,Z,ee,te,ne,re,oe,ie,ae,se,ue,le,ce,fe,pe,de,he,ge,me,ye,ve,be,we,xe,_e,ke,Te,Ee,Ce,Se,Oe,Ne,Pe,je,Ae,Me,De,Le,Re,Fe,Ie,He,Ue,We,Be,ze,qe,$e,Ve,Ke,Xe,Ge,Qe,Ye,Je,Ze,et,tt,nt,rt,ot,it,at,st,ut,lt,ct,ft,pt,dt,ht,gt,mt,yt,vt,bt=window.document,wt=window.navigator,xt=window.location,_t=function(){function e(){if(!i.isReady){try{bt.documentElement.doScroll("left")}catch(t){return void setTimeout(e,1)}i.ready()}}var t,n,r,o,i=function(e,n){return new i.fn.init(e,n,t)},a=window.jQuery,s=window.$,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,l=/\S/,c=/^\s+/,f=/\s+$/,p=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,d=/^[\],:{}\s]*$/,h=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,g=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,y=/(webkit)[ \/]([\w.]+)/,v=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,x=/-([a-z]|[0-9])/gi,_=/^-ms-/,k=function(e,t){return(t+"").toUpperCase()},T=wt.userAgent,E=Object.prototype.toString,C=Object.prototype.hasOwnProperty,S=Array.prototype.push,O=Array.prototype.slice,N=String.prototype.trim,P=Array.prototype.indexOf,j={};return i.fn=i.prototype={constructor:i,init:function(e,t,n){var r,o,a,s;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("body"===e&&!t&&bt.body)return this.context=bt,this[0]=bt.body,this.selector=e,this.length=1,this;if("string"==typeof e){if(!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:u.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1])return t=t instanceof i?t[0]:t,s=t?t.ownerDocument||t:bt,a=p.exec(e),a?i.isPlainObject(t)?(e=[bt.createElement(a[1])],i.fn.attr.call(e,t,!0)):e=[s.createElement(a[1])]:(a=i.buildFragment([r[1]],[s]),e=(a.cacheable?i.clone(a.fragment):a.fragment).childNodes),i.merge(this,e);if((o=bt.getElementById(r[2]))&&o.parentNode){