Release v17.021 (from 7210b52e)
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -324,7 +324,7 @@ this._symbolProperty().unsubscribe(this,this._onSymbolPropertyChange),this._watc
|
|||||||
;return this._activeChartWidget.model().mainSeries()},e.prototype._properties=function(){return this._mainSeries().properties()},e.prototype._symbolProperty=function(){return this._properties().symbol},e.prototype._intervalProperty=function(){return this._properties().interval},e.prototype._timeFrameProperty=function(){if(!this._activeChartWidget)throw new Error("ChartWidget is undefined");return this._activeChartWidget.model().model().appliedTimeFrame()},e.prototype._timeFramePropertyState=function(){return Object(l.timeFramePropertyState)(this._timeFrameProperty())},e.prototype._watchedSymbolListener=function(e){this._symbolProperty().value()!==e&&this._chartWidgetCollection.setSymbol(e)},e.prototype._sendSnowplowAnalytics=function(){if(!window.user.do_not_track)throw new Error("unsupported")},e.prototype._onSymbolPropertyChange=function(){var e=this._symbolProperty().value()!==this._watchedSymbol.value();this._watchedSymbol.setValue(this._symbolProperty().value()),e&&this._chartWidgetCollection.setSymbol(this._symbolProperty().value())},e.prototype._onSymbolResolved=function(e){var t=this._mainSeries().symbolInfo();t&&this._applyValuesFromSymbolInfo(t)},e.prototype._applyValuesFromSymbolInfo=function(e){var t=e.pro_name||s.enabled("trading_terminal")&&(e.full_name||e.name)||"";this._proSymbol.setValue(t),e.aliases&&this._symbolNamesList.setValue(e.aliases)},e.prototype._updateSeriesSymbolInfo=function(){this._seriesShortSymbol.setValue(this._properties().shortName.value());var e=this._mainSeries().symbolInfo();e?(this._applyValuesFromSymbolInfo(e),e.hasOwnProperty("supported_resolutions")?this._watchedSupportedResolutions.setValue(e.supported_resolutions):this._watchedSupportedResolutions.setValue(void 0),this._watchedIntraday.setValue(!!e.has_intraday)):(this._watchedIntraday.deleteValue(),this._proSymbol.deleteValue())},e.prototype._watchedIntervalListener=function(e){this._intervalProperty().value()!==e&&this._chartWidgetCollection.setResolution(e)},e.prototype._onIntervalPropertyChange=function(){var e=this._intervalProperty().value()!==this._watchedInterval.value();this._watchedInterval.setValue(this._intervalProperty().value()),e&&this._chartWidgetCollection.setResolution(this._intervalProperty().value())},e.prototype._watchedTimeFrameListener=function(e){h(this._timeFramePropertyState(),e)||this._chartWidgetCollection.setTimeFrame(e)},e.prototype._onTimeFramePropertyChange=function(){var e=this._timeFramePropertyState(),t=!h(e,this._watchedTimeFrame.value());this._watchedTimeFrame.setValue(e),t&&this._chartWidgetCollection.setTimeFrame(e)},e.prototype._onChartModelCreated=function(e){if(!this._activeChartWidget)throw new Error("ChartWidget is undefined");this._chartWidgetBindingState=r.BoundToModel,this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated);var t=this._symbolProperty();t.subscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.setValue(t.value()),this._watchedSymbol.subscribe(this._watchedSymbolListenerBound);var i=this._mainSeries()
|
;return this._activeChartWidget.model().mainSeries()},e.prototype._properties=function(){return this._mainSeries().properties()},e.prototype._symbolProperty=function(){return this._properties().symbol},e.prototype._intervalProperty=function(){return this._properties().interval},e.prototype._timeFrameProperty=function(){if(!this._activeChartWidget)throw new Error("ChartWidget is undefined");return this._activeChartWidget.model().model().appliedTimeFrame()},e.prototype._timeFramePropertyState=function(){return Object(l.timeFramePropertyState)(this._timeFrameProperty())},e.prototype._watchedSymbolListener=function(e){this._symbolProperty().value()!==e&&this._chartWidgetCollection.setSymbol(e)},e.prototype._sendSnowplowAnalytics=function(){if(!window.user.do_not_track)throw new Error("unsupported")},e.prototype._onSymbolPropertyChange=function(){var e=this._symbolProperty().value()!==this._watchedSymbol.value();this._watchedSymbol.setValue(this._symbolProperty().value()),e&&this._chartWidgetCollection.setSymbol(this._symbolProperty().value())},e.prototype._onSymbolResolved=function(e){var t=this._mainSeries().symbolInfo();t&&this._applyValuesFromSymbolInfo(t)},e.prototype._applyValuesFromSymbolInfo=function(e){var t=e.pro_name||s.enabled("trading_terminal")&&(e.full_name||e.name)||"";this._proSymbol.setValue(t),e.aliases&&this._symbolNamesList.setValue(e.aliases)},e.prototype._updateSeriesSymbolInfo=function(){this._seriesShortSymbol.setValue(this._properties().shortName.value());var e=this._mainSeries().symbolInfo();e?(this._applyValuesFromSymbolInfo(e),e.hasOwnProperty("supported_resolutions")?this._watchedSupportedResolutions.setValue(e.supported_resolutions):this._watchedSupportedResolutions.setValue(void 0),this._watchedIntraday.setValue(!!e.has_intraday)):(this._watchedIntraday.deleteValue(),this._proSymbol.deleteValue())},e.prototype._watchedIntervalListener=function(e){this._intervalProperty().value()!==e&&this._chartWidgetCollection.setResolution(e)},e.prototype._onIntervalPropertyChange=function(){var e=this._intervalProperty().value()!==this._watchedInterval.value();this._watchedInterval.setValue(this._intervalProperty().value()),e&&this._chartWidgetCollection.setResolution(this._intervalProperty().value())},e.prototype._watchedTimeFrameListener=function(e){h(this._timeFramePropertyState(),e)||this._chartWidgetCollection.setTimeFrame(e)},e.prototype._onTimeFramePropertyChange=function(){var e=this._timeFramePropertyState(),t=!h(e,this._watchedTimeFrame.value());this._watchedTimeFrame.setValue(e),t&&this._chartWidgetCollection.setTimeFrame(e)},e.prototype._onChartModelCreated=function(e){if(!this._activeChartWidget)throw new Error("ChartWidget is undefined");this._chartWidgetBindingState=r.BoundToModel,this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated);var t=this._symbolProperty();t.subscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.setValue(t.value()),this._watchedSymbol.subscribe(this._watchedSymbolListenerBound);var i=this._mainSeries()
|
||||||
;i.dataEvents().symbolResolved().subscribe(this,this._onSymbolResolved),this._watchedSymbol.hook=function(e){return i.symbolSameAsCurrent(e)&&(e=i.symbol()),e},i.dataEvents().symbolResolved().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolError().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolGroupNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().extendedHoursNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo();var n=this._intervalProperty();n.subscribe(this,this._onIntervalPropertyChange),this._watchedInterval.setValue(n.value()),this._watchedInterval.subscribe(this._watchedIntervalListenerBound),this._timeFrameProperty().subscribe(this,this._onTimeFramePropertyChange),this._watchedTimeFrame.setValue(this._timeFramePropertyState()),this._watchedTimeFrame.subscribe(this._watchedTimeFrameListenerBound),this._activeChartWidget.readOnly()&&(this._watchedSymbol.writeLock=!0)},e}();window.TradingView=window.TradingView||{};var p=new d;window.TradingView.Linking=p},PYn8:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Three Drives Pattern");function a(e,t){this._constructor="LineToolThreeDrivers";var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("S6aM").LineToolThreeDrivesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return 7},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Three Drives Pattern"},a.prototype.getStylesPropertyPage=function(){return o.LineToolABCDPatternStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("y4pE").AbcdPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolthreedrivers",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolThreeDrivers=a},PgQx:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd"><path stroke="currentColor" d="M7.5 8.5h12v12a3 3 0 0 1-3 3h-6a3 3 0 0 1-3-3v-12z"/><path fill="currentColor" d="M17 6l-1-1h-5l-1 1H7v1h13V6z"/><path stroke="currentColor" stroke-linecap="square" d="M10.5 11.5v8m3-8v8m3-8v8"/></g></svg>'},PoSe:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i){var r,n,o,s=null,a=0;i=i||{};var l=function(){a=!1===i.leading?0:Date.now(),s=null,o=e.apply(r,n),s||(r=n=null)};return function(){var c=Date.now();a||!1!==i.leading||(a=c);var u=t-(c-a);return r=this,n=arguments,u<=0||u>t?(s&&(clearTimeout(s),s=null),a=c,o=e.apply(r,n),s||(r=n=null)):s||!1===i.trailing||(s=setTimeout(l,u)),o}},
|
;i.dataEvents().symbolResolved().subscribe(this,this._onSymbolResolved),this._watchedSymbol.hook=function(e){return i.symbolSameAsCurrent(e)&&(e=i.symbol()),e},i.dataEvents().symbolResolved().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolError().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolGroupNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().extendedHoursNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo();var n=this._intervalProperty();n.subscribe(this,this._onIntervalPropertyChange),this._watchedInterval.setValue(n.value()),this._watchedInterval.subscribe(this._watchedIntervalListenerBound),this._timeFrameProperty().subscribe(this,this._onTimeFramePropertyChange),this._watchedTimeFrame.setValue(this._timeFramePropertyState()),this._watchedTimeFrame.subscribe(this._watchedTimeFrameListenerBound),this._activeChartWidget.readOnly()&&(this._watchedSymbol.writeLock=!0)},e}();window.TradingView=window.TradingView||{};var p=new d;window.TradingView.Linking=p},PYn8:function(e,t,i){"use strict";var r=i("Ss5c").LineDataSource,n=i("Ocx9").DefaultProperty,o=i("hayr").propertyPages,s=window.t("Three Drives Pattern");function a(e,t){this._constructor="LineToolThreeDrivers";var n=t||a.createProperties();r.call(this,e,n),i.e("lt-pane-views").then(function(e){var t=i("S6aM").LineToolThreeDrivesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(a,r),a.prototype.pointsCount=function(){return 7},a.prototype.translatedType=function(){return s},a.prototype.name=function(){return"Three Drives Pattern"},a.prototype.getStylesPropertyPage=function(){return o.LineToolABCDPatternStylesPropertyPage},a.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("y4pE").AbcdPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},a.createProperties=function(e){var t=new n("linetoolthreedrivers",e);return a._configureProperties(t),t},a._configureProperties=function(e){r._configureProperties(e)},t.LineToolThreeDrivers=a},PgQx:function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><g fill="none" fill-rule="evenodd"><path stroke="currentColor" d="M7.5 8.5h12v12a3 3 0 0 1-3 3h-6a3 3 0 0 1-3-3v-12z"/><path fill="currentColor" d="M17 6l-1-1h-5l-1 1H7v1h13V6z"/><path stroke="currentColor" stroke-linecap="square" d="M10.5 11.5v8m3-8v8m3-8v8"/></g></svg>'},PoSe:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i){var r,n,o,s=null,a=0;i=i||{};var l=function(){a=!1===i.leading?0:Date.now(),s=null,o=e.apply(r,n),s||(r=n=null)};return function(){var c=Date.now();a||!1!==i.leading||(a=c);var u=t-(c-a);return r=this,n=arguments,u<=0||u>t?(s&&(clearTimeout(s),s=null),a=c,o=e.apply(r,n),s||(r=n=null)):s||!1===i.trailing||(s=setTimeout(l,u)),o}},
|
||||||
e.exports=t.default},Q19o:function(e,t,i){"use strict";(function(t,r){var n=i("Eyy1").ensureNotNull,o=i("jA0t"),s=i("9iCb").applyOverridesToStudy,a=i("0YCj"),l=i("5JMW"),c=l.LineDataSourceApi,u=l.isLineToolRiskReward,h=i("N1UO").StudyApi,d=i("ltKl").SeriesApi,p=i("QrSB").SelectionApi,f=i("mf9N").PaneApi,_=i("IiTo"),m=i("LxhU").Interval,y=i("jCNj"),g=i("2jXJ").supportedLineTools,v=i("7MZv").showTooManyStudiesNotice,S=i("ogJP").isNumber,b=i("ogJP").inherit,w=i("vu5c").onSeriesCompletedOrErrorReceived,P=i("CW80").createLineToolProperties,C=i("96Yh"),x=C.lineToolEntityInfo,T=C.studyEntityInfo,L=i("lReN").LineToolsGroupControllerApi,I=i("ocrj").RemoveSourcesCommand,M=i("FDyI").ChartWidgetApiBase,O=i("mMWL"),A=function(e,i){M.call(this,e),this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap,this._activateChart=i,this._selectionApi=null,this._visibleBarsChanged=new t,this._chartWidget.onAboutToBeDestroyed().subscribe(this,this._destroy,!0),this._chartWidget.withModel(this,(function(){this._chartWidget.model().timeScale().visibleBarsStrictRangeChanged().subscribe(this,this._onVisibleBarsChanged)}))};function k(e,t){return t.map((function(t){return e.dataSourceForId(t)}))}function E(e,t){var i=r.utc_to_cal(t.timezone,1e3*e),n=t.spec.correctTradingDay(i);return r.set_hms(n,0,0,0,0,y.get_timezone("Etc/UTC")),n.getTime()/1e3}b(A,M),A.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new f(e,this._chartWidget),this._panes.set(e,t)),t},A.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget.model()),this._studies.set(e,t)),t},A.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 r=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(r.time_t,r.offset)}}))}.bind(this)}),this._lineDataSources.set(e,t)),t},A.prototype._makeSubscriptionFromDelegate=function(e){return{subscribe:e.subscribe.bind(e),unsubscribe:e.unsubscribe.bind(e),unsubscribeAll:e.unsubscribeAll.bind(e)}},A.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},A.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},A.prototype.setZoomEnabled=function(e){this._chartWidget.model().model().setZoomEnabled(e)},A.prototype.setScrollEnabled=function(e){this._chartWidget.model().model().setScrollEnabled(e)},A.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},A.prototype.clearMarks=function(){this._chartWidget.clearMarks()},A.prototype.symbol=function(){return this._chartWidget.getSymbol()},A.prototype.symbolExt=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name,
|
e.exports=t.default},Q19o:function(e,t,i){"use strict";(function(t,r){var n=i("Eyy1").ensureNotNull,o=i("jA0t"),s=i("9iCb").applyOverridesToStudy,a=i("0YCj"),l=i("5JMW"),c=l.LineDataSourceApi,u=l.isLineToolRiskReward,h=i("N1UO").StudyApi,d=i("ltKl").SeriesApi,p=i("QrSB").SelectionApi,f=i("mf9N").PaneApi,_=i("IiTo"),m=i("LxhU").Interval,y=i("jCNj"),g=i("2jXJ").supportedLineTools,v=i("7MZv").showTooManyStudiesNotice,S=i("ogJP").isNumber,b=i("ogJP").inherit,w=i("vu5c").onSeriesCompletedOrErrorReceived,P=i("CW80").createLineToolProperties,C=i("96Yh"),x=C.lineToolEntityInfo,T=C.studyEntityInfo,L=i("lReN").LineToolsGroupControllerApi,I=i("ocrj").RemoveSourcesCommand,M=i("FDyI").ChartWidgetApiBase,O=i("mMWL"),A=function(e,i){M.call(this,e),this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap,this._activateChart=i,this._selectionApi=null,this._visibleBarsChanged=new t,this._chartWidget.onAboutToBeDestroyed().subscribe(this,this._destroy,!0),this._chartWidget.withModel(this,(function(){this._chartWidget.model().timeScale().visibleBarsStrictRangeChanged().subscribe(this,this._onVisibleBarsChanged)}))};function k(e,t){return t.map((function(t){return e.dataSourceForId(t)}))}function E(e,t){var i=r.utc_to_cal(t.timezone,1e3*e),n=t.spec.correctTradingDay(i);return r.set_hms(n,0,0,0,0,y.get_timezone("Etc/UTC")),n.getTime()/1e3}b(A,M),A.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new f(e,this._chartWidget),this._panes.set(e,t)),t},A.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new h(e,this._chartWidget.model()),this._studies.set(e,t)),t},A.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 r=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(r.time_t,r.offset)}}))}.bind(this)}),this._lineDataSources.set(e,t)),t},A.prototype._makeSubscriptionFromDelegate=function(e){return{subscribe:e.subscribe.bind(e),unsubscribe:e.unsubscribe.bind(e),unsubscribeAll:e.unsubscribeAll.bind(e)}},A.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},A.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},A.prototype.setZoomEnabled=function(e){this._chartWidget.model().model().setZoomEnabled(e)},A.prototype.setScrollEnabled=function(e){this._chartWidget.model().model().setScrollEnabled(e)},A.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},A.prototype.clearMarks=function(){this._chartWidget.clearMarks()},A.prototype.symbol=function(){return this._chartWidget.getSymbol()},A.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},A.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},A.prototype.setSymbol=function(e,t){if(e!==this.symbol()){var i=this._chartWidget.model().mainSeries().dataEvents();t&&w(i,(function(e){e||t()})),this._activateChart(),this._chartWidget.setSymbol(e)}},A.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},A.prototype.setResolution=function(e,t){var i=m.normalize(e);if(null!==i&&i!==this.resolution()){var r=this._chartWidget.model().mainSeries().dataEvents();t&&w(r,(function(e){e||t()})),this._activateChart(),this._chartWidget.setResolution(i)}},A.prototype.setEntityVisibility=function(e,t){console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead");var i=this._chartWidget.model().model().dataSourceForId(e);if(i){var r=i.properties();r&&r.visible&&r.visible.setValue(t)}},A.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(T)},A.prototype.availableZOrderOperations=function(e){var t=k(this._chartWidget.model().model(),e);return this._chartWidget.model().availableZOrderOperations(t)},A.prototype.sendToBack=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().sendToBack(t)},A.prototype.bringToFront=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().bringToFront(t)},A.prototype.insertAfter=function(e,t){var i=this._chartWidget.model().model(),r=k(i,e),n=i.dataSourceForId(t);this._chartWidget.model().insertAfter(r,n)},A.prototype.insertBefore=function(e,t){var i=this._chartWidget.model().model(),r=k(i,e),n=i.dataSourceForId(t);this._chartWidget.model().insertBefore(r,n)},A.prototype.bringForward=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().bringForward(t)},A.prototype.sendBackward=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().sendBackward(t)},A.prototype.showPropertiesDialog=function(e){var t=this._chartWidget.model().model().dataSourceForId(e);if(null===t)throw new Error("Study or shape "+e+" does not exist");this._chartWidget.showChartPropertiesForSource(t)},A.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(x).filter((function(e){return null!==e.name}))},A.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},A.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},A.prototype.removeEntity=function(e,t){var i=this._chartWidget.model().chartModel().dataSourceForId(e);i?t&&t.disableUndo?new I(this._chartWidget.model().chartModel(),[i],"").redo():this._chartWidget.model().removeSource(i,!0):console.warn("Can't find a source with id: "+e)},A.prototype.removeEntityWithUndo=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);this._chartWidget.model().removeSource(t,!1)},A.prototype.selection=function(){
|
exchange:e.exchange,description:e.description,type:e.type}:null},A.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},A.prototype.setSymbol=function(e,t){if(e!==this.symbol()){var i=this._chartWidget.model().mainSeries().dataEvents();t&&w(i,(function(e){e||t()})),this._activateChart(),this._chartWidget.setSymbol(e)}},A.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},A.prototype.setResolution=function(e,t){var i=m.normalize(e);if(null!==i&&i!==this.resolution()){var r=this._chartWidget.model().mainSeries().dataEvents();t&&w(r,(function(e){e||t()})),this._activateChart(),this._chartWidget.setResolution(i)}},A.prototype.setEntityVisibility=function(e,t){console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead");var i=this._chartWidget.model().model().dataSourceForId(e);if(i){var r=i.properties();r&&r.visible&&r.visible.setValue(t)}},A.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(T)},A.prototype.availableZOrderOperations=function(e){var t=k(this._chartWidget.model().model(),e);return this._chartWidget.model().availableZOrderOperations(t)},A.prototype.sendToBack=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().sendToBack(t)},A.prototype.bringToFront=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().bringToFront(t)},A.prototype.insertAfter=function(e,t){var i=this._chartWidget.model().model(),r=k(i,e),n=i.dataSourceForId(t);this._chartWidget.model().insertAfter(r,n)},A.prototype.insertBefore=function(e,t){var i=this._chartWidget.model().model(),r=k(i,e),n=i.dataSourceForId(t);this._chartWidget.model().insertBefore(r,n)},A.prototype.bringForward=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().bringForward(t)},A.prototype.sendBackward=function(e){var t=k(this._chartWidget.model().model(),e);this._chartWidget.model().sendBackward(t)},A.prototype.showPropertiesDialog=function(e){var t=this._chartWidget.model().model().dataSourceForId(e);if(null===t)throw new Error("Study or shape "+e+" does not exist");this._chartWidget.showChartPropertiesForSource(t)},A.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(x).filter((function(e){return null!==e.name}))},A.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},A.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},A.prototype.removeEntity=function(e,t){var i=this._chartWidget.model().chartModel().dataSourceForId(e);i?t&&t.disableUndo?new I(this._chartWidget.model().chartModel(),[i],"").redo():this._chartWidget.model().removeSource(i,!0,!0):console.warn("Can't find a source with id: "+e)},A.prototype.removeEntityWithUndo=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);this._chartWidget.model().removeSource(t,!1)},A.prototype.selection=function(){
|
||||||
return null===this._selectionApi&&(this._selectionApi=new p(this._chartWidget.model().model())),this._selectionApi},A.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveSymbol,e.saveInterval)},A.prototype.drawOnAllCharts=function(e){O.drawOnAllCharts.setValue(e)},A.prototype.applyStudyTemplate=function(e){this._chartWidget.model().applyStudyTemplate(e,""+1e3*Math.random())},A.prototype.setVisibleRange=function(e,t){if(void 0!==e&&e.from&&e.to&&!isNaN(e.from)&&!isNaN(e.to)){var i=[parseInt(e.from),parseInt(e.to)],r=this._alignPoints(i),n=r[0],o=r[1],s=void 0!==t&&"function"==typeof t,a=new Promise(function(e){this._chartWidget.setVisibleTimeRange(n,o,s?{}:t,e)}.bind(this));return s&&(console.warn("setVisibleRange now returns a Promise object and don't accept callback as the last argument"),a.then(t)),a}console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.')},A.prototype._getSession=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return new _.SessionInfo(e.timezone,e.session,e.holidays,e.corrections)},A.prototype.getVisibleRange=function(){var e={from:0,to:0},t=this._chartWidget.model().timeScale(),i=t.visibleBarsStrictRange();if(null===i)return e;var r=this._chartWidget.model().mainSeries(),o=r.syncModel();if(null===o)return e;var s=n(r.data().last()),a=i.lastBar()-s.index,l=a<=0?t.indexToTimePoint(i.lastBar()):o.projectTime(s.value[TradingView.TIME_PLOT],a);if(e.from=+t.indexToTimePoint(Math.max(0,i.firstBar()))||0,e.to=+l||0,m.isDWM(r.interval())){var c=this._getSession();e.from=E(e.from,c),e.to=E(e.to,c)}return e},A.prototype.getTimeScaleLogicalRange=function(){return this._chartWidget.model().timeScale().logicalRange()},A.prototype.getVisiblePriceRange=function(){return console.warn("`getVisiblePriceRange` is deprecated. Use Price Scale API instead"),this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},A.prototype.scrollPosition=function(){return this._chartWidget.model().timeScale().rightOffset()},A.prototype.defaultScrollPosition=function(){return this._chartWidget.model().timeScale().defaultRightOffsetProperty().value()},A.prototype._createTradingPrimitive=function(e,t){var i=this;var r,o,s=this._chartWidget.model().model(),a=s.paneForSource(s.mainSeries());return(t?s:this._chartWidget.model()).createLineTool(a,(r=TradingView.CLOSE_PLOT,{index:(o=n(i._chartWidget.model().mainSeries().bars().last())).index,price:o.value[r]}),e)._adapter},A.prototype.createOrderLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},A.prototype.createPositionLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},A.prototype.createExecutionShape=function(e){e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},A.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},A.prototype._alignPoints=function(e){
|
return null===this._selectionApi&&(this._selectionApi=new p(this._chartWidget.model().model())),this._selectionApi},A.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveSymbol,e.saveInterval)},A.prototype.drawOnAllCharts=function(e){O.drawOnAllCharts.setValue(e)},A.prototype.applyStudyTemplate=function(e){this._chartWidget.model().applyStudyTemplate(e,""+1e3*Math.random())},A.prototype.setVisibleRange=function(e,t){if(void 0!==e&&e.from&&e.to&&!isNaN(e.from)&&!isNaN(e.to)){var i=[parseInt(e.from),parseInt(e.to)],r=this._alignPoints(i),n=r[0],o=r[1],s=void 0!==t&&"function"==typeof t,a=new Promise(function(e){this._chartWidget.setVisibleTimeRange(n,o,s?{}:t,e)}.bind(this));return s&&(console.warn("setVisibleRange now returns a Promise object and don't accept callback as the last argument"),a.then(t)),a}console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.')},A.prototype._getSession=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return new _.SessionInfo(e.timezone,e.session,e.holidays,e.corrections)},A.prototype.getVisibleRange=function(){var e={from:0,to:0},t=this._chartWidget.model().timeScale(),i=t.visibleBarsStrictRange();if(null===i)return e;var r=this._chartWidget.model().mainSeries(),o=r.syncModel();if(null===o)return e;var s=n(r.data().last()),a=i.lastBar()-s.index,l=a<=0?t.indexToTimePoint(i.lastBar()):o.projectTime(s.value[TradingView.TIME_PLOT],a);if(e.from=+t.indexToTimePoint(Math.max(0,i.firstBar()))||0,e.to=+l||0,m.isDWM(r.interval())){var c=this._getSession();e.from=E(e.from,c),e.to=E(e.to,c)}return e},A.prototype.getTimeScaleLogicalRange=function(){return this._chartWidget.model().timeScale().logicalRange()},A.prototype.getVisiblePriceRange=function(){return console.warn("`getVisiblePriceRange` is deprecated. Use Price Scale API instead"),this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},A.prototype.scrollPosition=function(){return this._chartWidget.model().timeScale().rightOffset()},A.prototype.defaultScrollPosition=function(){return this._chartWidget.model().timeScale().defaultRightOffsetProperty().value()},A.prototype._createTradingPrimitive=function(e,t){var i=this;var r,o,s=this._chartWidget.model().model(),a=s.paneForSource(s.mainSeries());return(t?s:this._chartWidget.model()).createLineTool(a,(r=TradingView.CLOSE_PLOT,{index:(o=n(i._chartWidget.model().mainSeries().bars().last())).index,price:o.value[r]}),e)._adapter},A.prototype.createOrderLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},A.prototype.createPositionLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},A.prototype.createExecutionShape=function(e){e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},A.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},A.prototype._alignPoints=function(e){
|
||||||
var t=this._chartWidget.model().model(),i=t.mainSeries(),r=i.interval();if(t.timeScale().isEmpty()||!m.isDWM(r))return e;var n=_.createAligner(r,i.symbolInfo(),!0);return null===n?e:e.map((function(e){return e?(n.moveTo(1e3*e),n.startOfBar(0)/1e3):e}))},A.prototype._convertUserPointsToDataSource=function(e){var t=this._chartWidget.model().model(),i=t.mainSeries(),r=t.timeScale().points(),n=i.data();if(t.timeScale().isEmpty())return null;var o=e.map((function(e){return e.time})),s=this._alignPoints(o);function a(e,t,o){var s=r.closestIndexLeft(e)||0,a={index:s},l=r.valueAt(s);if(e>l&&s===r.lastIndex()){var c=i.syncModel().distance(l,e);c.success&&(a.index=a.index+c.result)}if(S(t))a.price=t;else{var u=o?["open","high","low","close"].indexOf(o)+1:1;u<=0&&(u=1),a.price=n.valueAt(s)[u]}return a}for(var l=[],c=0;c<e.length;c++){var u=e[c];l.push(a(s[c],u.price,u.channel))}return l},A.prototype.createMultipointShape=function(e,t,i){var r=t.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),n=this._chartWidget.model().model(),o=n.mainSeries();if(!n.timeScale().isEmpty()){var s=n.dataSourceForId(t.ownerStudyId)||o,a=n.paneForSource(s),l=this._convertUserPointsToDataSource(e),c=g[t.shape]||g.flag;if(c.onlySelectable)throw new Error('Cannot create "'+t.shape+'" shape');if("LineToolPolyline"===c.name)l[0].price===l[l.length-1].price&&l[0].index===l[l.length-1].index||l.push(l[0]);else if("LineToolIcon"===c.name){if(t.icon=t.icon||t.overrides&&t.overrides.icon,!t.hasOwnProperty("icon"))throw new Error("icon must be specified in options");t.overrides=t.overrides||{},t.overrides.icon=t.icon}var h=P(c.name);if(h.currencyId.setValue(s.symbolSource().currency()),t.overrides)for(var d in t.overrides)h[d]?h[d].setValue(t.overrides[d]):u(c.name)&&-1!==["profitLevel","stopLevel"].indexOf(d)&&h.addProperty(d,t.overrides[d]);void 0!==h.text&&t.text&&h.text.setValue(t.text);var p=r.createLineTool(a,l[0],c.name,h,void 0,s);if(u(c.name)){if(l.length>2)throw new Error("Wrong points count for "+t.shape+". Required 1 or 2");2===l.length&&(p.startChanging(1,l[1]),p.setPoint(1,l[1]),p.endChanging())}else{var f=p.pointsCount();if(f!==l.length&&-1!==f)throw new Error("Wrong points count for "+t.shape+". Required "+f);for(var _=1;_<l.length&&this._chartWidget.model().lineBeingCreated();_++)r.coninueCreatingLine(l[_],null,_<l.length-1)}if(t.lock&&p.setUserEditEnabled(!1),t.disableSelection&&(p.customization.disableSelection=!0),t.disableSave&&(p.customization.disableSave=!0),t.hasOwnProperty("showInObjectsTree")&&(p.customization.showInObjectsTree=t.showInObjectsTree),t.zOrder){var m=this._chartWidget.model().availableZOrderOperations([p]);"top"===t.zOrder&&m.bringToFrontEnabled?r.bringToFront([p]):"bottom"===t.zOrder&&m.sendToBackEnabled&&r.sendToBack([p])}return p.id()}},A.prototype.getShapeById=function(e){var t=this._chartWidget.model().model().getLineToolById(e);if(null===t)throw new Error("There is no such shape");return this._getLineDataSourceApi(t)},A.prototype.createStudy=function(e,t,i,r,n,l){
|
var t=this._chartWidget.model().model(),i=t.mainSeries(),r=i.interval();if(t.timeScale().isEmpty()||!m.isDWM(r))return e;var n=_.createAligner(r,i.symbolInfo(),!0);return null===n?e:e.map((function(e){return e?(n.moveTo(1e3*e),n.startOfBar(0)/1e3):e}))},A.prototype._convertUserPointsToDataSource=function(e){var t=this._chartWidget.model().model(),i=t.mainSeries(),r=t.timeScale().points(),n=i.data();if(t.timeScale().isEmpty())return null;var o=e.map((function(e){return e.time})),s=this._alignPoints(o);function a(e,t,o){var s=r.closestIndexLeft(e)||0,a={index:s},l=r.valueAt(s);if(e>l&&s===r.lastIndex()){var c=i.syncModel().distance(l,e);c.success&&(a.index=a.index+c.result)}if(S(t))a.price=t;else{var u=o?["open","high","low","close"].indexOf(o)+1:1;u<=0&&(u=1),a.price=n.valueAt(s)[u]}return a}for(var l=[],c=0;c<e.length;c++){var u=e[c];l.push(a(s[c],u.price,u.channel))}return l},A.prototype.createMultipointShape=function(e,t,i){var r=t.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),n=this._chartWidget.model().model(),o=n.mainSeries();if(!n.timeScale().isEmpty()){var s=n.dataSourceForId(t.ownerStudyId)||o,a=n.paneForSource(s),l=this._convertUserPointsToDataSource(e),c=g[t.shape]||g.flag;if(c.onlySelectable)throw new Error('Cannot create "'+t.shape+'" shape');if("LineToolPolyline"===c.name)l[0].price===l[l.length-1].price&&l[0].index===l[l.length-1].index||l.push(l[0]);else if("LineToolIcon"===c.name){if(t.icon=t.icon||t.overrides&&t.overrides.icon,!t.hasOwnProperty("icon"))throw new Error("icon must be specified in options");t.overrides=t.overrides||{},t.overrides.icon=t.icon}var h=P(c.name);if(h.currencyId.setValue(s.symbolSource().currency()),t.overrides)for(var d in t.overrides)h[d]?h[d].setValue(t.overrides[d]):u(c.name)&&-1!==["profitLevel","stopLevel"].indexOf(d)&&h.addProperty(d,t.overrides[d]);void 0!==h.text&&t.text&&h.text.setValue(t.text);var p=r.createLineTool(a,l[0],c.name,h,void 0,s);if(u(c.name)){if(l.length>2)throw new Error("Wrong points count for "+t.shape+". Required 1 or 2");2===l.length&&(p.startChanging(1,l[1]),p.setPoint(1,l[1]),p.endChanging())}else{var f=p.pointsCount();if(f!==l.length&&-1!==f)throw new Error("Wrong points count for "+t.shape+". Required "+f);for(var _=1;_<l.length&&this._chartWidget.model().lineBeingCreated();_++)r.coninueCreatingLine(l[_],null,_<l.length-1)}if(t.lock&&p.setUserEditEnabled(!1),t.disableSelection&&(p.customization.disableSelection=!0),t.disableSave&&(p.customization.disableSave=!0),t.hasOwnProperty("showInObjectsTree")&&(p.customization.showInObjectsTree=t.showInObjectsTree),t.zOrder){var m=this._chartWidget.model().availableZOrderOperations([p]);"top"===t.zOrder&&m.bringToFrontEnabled?r.bringToFront([p]):"bottom"===t.zOrder&&m.sendToBackEnabled&&r.sendToBack([p])}return p.id()}},A.prototype.getShapeById=function(e){var t=this._chartWidget.model().model().getLineToolById(e);if(null===t)throw new Error("There is no such shape");return this._getLineDataSourceApi(t)},A.prototype.createStudy=function(e,t,i,r,n,l){
|
||||||
if("function"==typeof n)return console.warn('"createStudy" does not take "callback" parameter anymore'),Promise.resolve(null);if((l=l||{}).checkLimit&&!this._chartWidget.model().canCreateStudy())return v(),Promise.resolve(null);e=e.toLowerCase();var c=l.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),u=a.findStudyMetaInfoByDescription(c.studiesMetaData(),e).id,h=c.createStudyInserter({type:"java",studyId:u});return h.setForceOverlay(t),l.priceScale&&h.setPreferredPriceScale(function(e){switch(e){case"no-scale":return"overlay";case"as-series":return"as-series";case"new-left":return"left";case"new-right":return"right";default:throw new Error('The pricescale "'+e+'" is invalid, the only valid options are "no-scale", "as-series", "new-left" and "new-right".')}}(l.priceScale)),l.allowChangeCurrency&&h.setAllowChangeCurrency(l.allowChangeCurrency),r&&(r=o.getStudyRecordFromArray([e].concat(r),this._chartWidget).inputs),h.insert((function(){return Promise.resolve(r||{})})).then((function(e){return n&&s(e,n),i&&e.setUserEditEnabled(!1),e.id()}))},A.prototype.getStudyById=function(e){var t=this._chartWidget.model().model().getStudyById(e);if(null===t)throw new Error("There is no such study");return this._getStudyApi(t)},A.prototype.getSeries=function(){var e=this._chartWidget.model().model(),t=e.mainSeries();return new d(t,e)},A.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},A.prototype.setChartType=function(e){this._chartWidget.model().mainSeries().properties().style.setValue(e)},A.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},A.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().completed())},A.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().symbolResolved())},A.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},A.prototype.onVisibleRangeChanged=function(){return this._makeSubscriptionFromDelegate(this._visibleBarsChanged)},A.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},A.prototype.crossHairMoved=function(e){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,e)},A.prototype._onVisibleBarsChanged=function(){var e=this._chartWidget.model().mainSeries(),t=e.data().isEmpty();null!==this._chartWidget.model().timeScale().visibleBarsStrictRange()&&t?e.dataEvents().completed().subscribe(this,this._onVisibleBarsChanged,!0):this._visibleBarsChanged.fire(this.getVisibleRange())},A.prototype._destroy=function(){var e=this._chartWidget.model()
|
if("function"==typeof n)return console.warn('"createStudy" does not take "callback" parameter anymore'),Promise.resolve(null);if((l=l||{}).checkLimit&&!this._chartWidget.model().canCreateStudy())return v(),Promise.resolve(null);e=e.toLowerCase();var c=l.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),u=a.findStudyMetaInfoByDescription(c.studiesMetaData(),e).id,h=c.createStudyInserter({type:"java",studyId:u});return h.setForceOverlay(t),l.priceScale&&h.setPreferredPriceScale(function(e){switch(e){case"no-scale":return"overlay";case"as-series":return"as-series";case"new-left":return"left";case"new-right":return"right";default:throw new Error('The pricescale "'+e+'" is invalid, the only valid options are "no-scale", "as-series", "new-left" and "new-right".')}}(l.priceScale)),l.allowChangeCurrency&&h.setAllowChangeCurrency(l.allowChangeCurrency),r&&(r=o.getStudyRecordFromArray([e].concat(r),this._chartWidget).inputs),h.insert((function(){return Promise.resolve(r||{})})).then((function(e){return n&&s(e,n),i&&e.setUserEditEnabled(!1),e.id()}))},A.prototype.getStudyById=function(e){var t=this._chartWidget.model().model().getStudyById(e);if(null===t)throw new Error("There is no such study");return this._getStudyApi(t)},A.prototype.getSeries=function(){var e=this._chartWidget.model().model(),t=e.mainSeries();return new d(t,e)},A.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},A.prototype.setChartType=function(e){this._chartWidget.model().mainSeries().properties().style.setValue(e)},A.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},A.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().completed())},A.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().dataEvents().symbolResolved())},A.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},A.prototype.onVisibleRangeChanged=function(){return this._makeSubscriptionFromDelegate(this._visibleBarsChanged)},A.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},A.prototype.crossHairMoved=function(e){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,e)},A.prototype._onVisibleBarsChanged=function(){var e=this._chartWidget.model().mainSeries(),t=e.data().isEmpty();null!==this._chartWidget.model().timeScale().visibleBarsStrictRange()&&t?e.dataEvents().completed().subscribe(this,this._onVisibleBarsChanged,!0):this._visibleBarsChanged.fire(this.getVisibleRange())},A.prototype._destroy=function(){var e=this._chartWidget.model()
|
||||||
@@ -579,7 +579,7 @@ this._environment.endUndoMacro();var d=Object(n.ensureNotNull)(u.createdGroupId(
|
|||||||
var o=e.call(this,"Paste Drawing")||this;return o._needCopyToOtherCharts=!1,o._sourceState=null,o._model=t,o._clipboardData=i,o._paneIndex=o._model.panes().indexOf(r||Object(n.ensureNotNull)(o._model.paneForSource(o._model.mainSeries()))),o}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=this._model.panes()[this._paneIndex],t=e.dataSourceForId(this._clipboardData.source.id),i=null!==t?Object(n.ensureNotNull)(t.ownerSource()):Object(n.ensureNotNull)(e.mainDataSource());null===this._sourceState&&(this._sourceState=this._getSourceState(i));var r=e.restoreLineTool(this._sourceState,!1,!1),o=Object(n.ensureNotNull)(i.priceScale());r.setOwnerSource(i),r.setPriceScale(o),o.addDataSource(r),r.calcIsActualSymbol(),r.createServerPoints();var s=Object(ve.isSymbolSource)(i)||i.metaInfo().is_price_study;this._needCopyToOtherCharts=Boolean(s&&(Object(re.drawOnAllCharts)().value()||r.linkKey&&r.isSynchronizable())),this._model.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){if(this._sourceState){var e=this.source();this._model.removeSource(e)}else Se.logError("This command was never executed - nothing to undo")},t.prototype.source=function(){return Object(n.ensureNotNull)(this._model.dataSourceForId(Object(n.ensureNotNull)(this._sourceState).id))},t.prototype.needCopyToOtherCharts=function(){return this._needCopyToOtherCharts},t.prototype._getSourceState=function(e){var t=Object(R.clone)(this._clipboardData.source);delete t.state.symbol,null!=t.linkKey&&(t.linkKey=Object(ge.randomHash)());var i=Object(n.ensureNotNull)(e.priceScale()),r=this._model,o=!1;this._clipboardData.source.state.symbol===Object(n.ensureNotNull)(e.symbolSource()).symbol()&&(Object(ve.isSymbolSource)(e)?o=!0:Object(pe.isStudy)(e)&&(o=Boolean(e.metaInfo().is_price_study)));var s,a,l,c=Object(n.ensureNotNull)(e.firstValue());if(this._model.id()===this._clipboardData.modelId||!o)for(var u=0;u<this._clipboardData.geometry.length;++u){var h=(s=this._clipboardData.geometry[u],a=void 0,l=void 0,a=s.x*r.timeScale().width(),l=s.y*i.height()-40,new ye.Point(a,l)),d=r.timeScale().coordinateToIndex(h.x),p=r.timeScale().normalizeBarIndex(d);if(o){var f=i.priceToCoordinate(t.points[u].price,c)+-40;p.price=i.coordinateToPrice(f,c)}else p.price=i.coordinateToPrice(h.y,c);t.points[u]=p}return t.id=Object(ge.guid)(),t},t}(d.UndoCommand),we=i("xo8u"),Pe=i("/ToI"),Ce=function(e){function t(t,i,r){var n=e.call(this,"Change Symbol")||this;n._newSymbol=t;var o=i.model().mainSeries();return n._prevSymbol=o.symbol(),n._prevCurrency=r?o.currency():null,n._chartWidget=i,n._changeCurrencyToOriginal=r,n}return Object(r.__extends)(t,e),t.prototype.redo=function(){this._chartWidget.screen.show(),this._changeCurrencyToOriginal&&this._currencyProperty().setValue(null),this._symbolProperty().setValue(this._newSymbol,!1)},t.prototype.undo=function(){this._chartWidget.screen.show(),this._changeCurrencyToOriginal&&this._currencyProperty().setValue(this._prevCurrency),this._symbolProperty().setValue(this._prevSymbol,!1)},t.prototype._symbolProperty=function(){
|
var o=e.call(this,"Paste Drawing")||this;return o._needCopyToOtherCharts=!1,o._sourceState=null,o._model=t,o._clipboardData=i,o._paneIndex=o._model.panes().indexOf(r||Object(n.ensureNotNull)(o._model.paneForSource(o._model.mainSeries()))),o}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=this._model.panes()[this._paneIndex],t=e.dataSourceForId(this._clipboardData.source.id),i=null!==t?Object(n.ensureNotNull)(t.ownerSource()):Object(n.ensureNotNull)(e.mainDataSource());null===this._sourceState&&(this._sourceState=this._getSourceState(i));var r=e.restoreLineTool(this._sourceState,!1,!1),o=Object(n.ensureNotNull)(i.priceScale());r.setOwnerSource(i),r.setPriceScale(o),o.addDataSource(r),r.calcIsActualSymbol(),r.createServerPoints();var s=Object(ve.isSymbolSource)(i)||i.metaInfo().is_price_study;this._needCopyToOtherCharts=Boolean(s&&(Object(re.drawOnAllCharts)().value()||r.linkKey&&r.isSynchronizable())),this._model.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){if(this._sourceState){var e=this.source();this._model.removeSource(e)}else Se.logError("This command was never executed - nothing to undo")},t.prototype.source=function(){return Object(n.ensureNotNull)(this._model.dataSourceForId(Object(n.ensureNotNull)(this._sourceState).id))},t.prototype.needCopyToOtherCharts=function(){return this._needCopyToOtherCharts},t.prototype._getSourceState=function(e){var t=Object(R.clone)(this._clipboardData.source);delete t.state.symbol,null!=t.linkKey&&(t.linkKey=Object(ge.randomHash)());var i=Object(n.ensureNotNull)(e.priceScale()),r=this._model,o=!1;this._clipboardData.source.state.symbol===Object(n.ensureNotNull)(e.symbolSource()).symbol()&&(Object(ve.isSymbolSource)(e)?o=!0:Object(pe.isStudy)(e)&&(o=Boolean(e.metaInfo().is_price_study)));var s,a,l,c=Object(n.ensureNotNull)(e.firstValue());if(this._model.id()===this._clipboardData.modelId||!o)for(var u=0;u<this._clipboardData.geometry.length;++u){var h=(s=this._clipboardData.geometry[u],a=void 0,l=void 0,a=s.x*r.timeScale().width(),l=s.y*i.height()-40,new ye.Point(a,l)),d=r.timeScale().coordinateToIndex(h.x),p=r.timeScale().normalizeBarIndex(d);if(o){var f=i.priceToCoordinate(t.points[u].price,c)+-40;p.price=i.coordinateToPrice(f,c)}else p.price=i.coordinateToPrice(h.y,c);t.points[u]=p}return t.id=Object(ge.guid)(),t},t}(d.UndoCommand),we=i("xo8u"),Pe=i("/ToI"),Ce=function(e){function t(t,i,r){var n=e.call(this,"Change Symbol")||this;n._newSymbol=t;var o=i.model().mainSeries();return n._prevSymbol=o.symbol(),n._prevCurrency=r?o.currency():null,n._chartWidget=i,n._changeCurrencyToOriginal=r,n}return Object(r.__extends)(t,e),t.prototype.redo=function(){this._chartWidget.screen.show(),this._changeCurrencyToOriginal&&this._currencyProperty().setValue(null),this._symbolProperty().setValue(this._newSymbol,!1)},t.prototype.undo=function(){this._chartWidget.screen.show(),this._changeCurrencyToOriginal&&this._currencyProperty().setValue(this._prevCurrency),this._symbolProperty().setValue(this._prevSymbol,!1)},t.prototype._symbolProperty=function(){
|
||||||
return this._mainSeries().properties().symbol},t.prototype._currencyProperty=function(){return this._mainSeries().properties().currencyId},t.prototype._mainSeries=function(){return this._chartWidget.model().mainSeries()},t}(d.UndoCommand),xe=i("PC8g"),Te=i("gaBL"),Le=function(e){function t(t,i,r,n,o){var s=e.call(this,"",!1)||this;return s._model=t,s._paneA=i,s._paneB=r,s._prevStretchA=n,s._currStretchA=o,s}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=this._paneA.stretchFactor()+this._paneB.stretchFactor();this._paneA.setStretchFactor(this._currStretchA),this._paneB.setStretchFactor(e-this._currStretchA),this._model.fullUpdate()},t.prototype.undo=function(){var e=this._paneA.stretchFactor()+this._paneB.stretchFactor();this._paneA.setStretchFactor(this._prevStretchA),this._paneB.setStretchFactor(e-this._prevStretchA),this._model.fullUpdate()},t}(d.UndoCommand);i.d(t,"ChartUndoModelBase",(function(){return De}));var Ie=window.t("Send {title} backward"),Me=window.t("Bring {title} forward"),Oe=window.t("Insert {title} after {target}"),Ae=window.t("Insert {title} before {target}"),ke=window.t("Create {name} line tool");function Ee(e,t){return{bringForwardEnabled:e.bringForwardEnabled||t.bringForwardEnabled,bringToFrontEnabled:e.bringToFrontEnabled||t.bringToFrontEnabled,sendBackwardEnabled:e.sendBackwardEnabled||t.sendBackwardEnabled,sendToBackEnabled:e.sendToBackEnabled||t.sendToBackEnabled}}var De=function(e){function t(t){var i=e.call(this)||this;return i._createLineCommand=null,i._initialTimeScrollState=null,i._initialTimeScrollPos=null,i._currentLineMoveCommand=null,i._currentLineChangeCommand=null,i._undoHistory=t,i._lineToolsGroupController=new de({model:i._model.bind(i),pushUndoCommand:i._pushUndoCommand.bind(i),beginUndoMacro:i._undoHistory.beginUndoMacro.bind(i._undoHistory),endUndoMacro:i._undoHistory.endUndoMacro.bind(i._undoHistory),emitEvent:i.emitEvent.bind(i)}),i}return Object(r.__extends)(t,e),t.prototype.undoHistory=function(){return this._undoHistory},t.prototype.lineToolsGroupController=function(){return this._lineToolsGroupController},t.prototype.mergeAllScales=function(e){!function(e,t){e.beginUndoMacro("left"===t?c:u),e.model().panes().forEach((function(i){var r="left"===t?i.rightPriceScales():i.leftPriceScales(),n=("left"===t?i.leftPriceScales():i.rightPriceScales()).concat(r),o="overlay"===i.priceScalePosition(i.defaultPriceScale())?n[0]:i.defaultPriceScale();e.movePriceScale(i,o,t,0),n.forEach((function(t){if(t!==o)for(var r=t.mainSource();null!==r;){e.moveToScale(r,i,o,"",!0);var n=t.mainSource();if(n===r){h.logError("Loop detected while trying to merge scales");break}r=n}}))})),e.endUndoMacro(),e.model().fullUpdate()}(this,e)},t.prototype.movePriceScale=function(e,t,i,r){var n=new p(this._model(),e,t,i,r,window.t("Move scale"));this._pushUndoCommand(n)},t.prototype.createLineTool=function(e,t,i,r,s,a,l){var c=ke.format({name:i});if(("LineToolRegressionTrend"===i||"LineToolAnchoredVWAP"===i)&&!this.canCreateStudy())return Object(o.showTooManyStudiesNotice)(),null
|
return this._mainSeries().properties().symbol},t.prototype._currencyProperty=function(){return this._mainSeries().properties().currencyId},t.prototype._mainSeries=function(){return this._chartWidget.model().mainSeries()},t}(d.UndoCommand),xe=i("PC8g"),Te=i("gaBL"),Le=function(e){function t(t,i,r,n,o){var s=e.call(this,"",!1)||this;return s._model=t,s._paneA=i,s._paneB=r,s._prevStretchA=n,s._currStretchA=o,s}return Object(r.__extends)(t,e),t.prototype.redo=function(){var e=this._paneA.stretchFactor()+this._paneB.stretchFactor();this._paneA.setStretchFactor(this._currStretchA),this._paneB.setStretchFactor(e-this._currStretchA),this._model.fullUpdate()},t.prototype.undo=function(){var e=this._paneA.stretchFactor()+this._paneB.stretchFactor();this._paneA.setStretchFactor(this._prevStretchA),this._paneB.setStretchFactor(e-this._prevStretchA),this._model.fullUpdate()},t}(d.UndoCommand);i.d(t,"ChartUndoModelBase",(function(){return De}));var Ie=window.t("Send {title} backward"),Me=window.t("Bring {title} forward"),Oe=window.t("Insert {title} after {target}"),Ae=window.t("Insert {title} before {target}"),ke=window.t("Create {name} line tool");function Ee(e,t){return{bringForwardEnabled:e.bringForwardEnabled||t.bringForwardEnabled,bringToFrontEnabled:e.bringToFrontEnabled||t.bringToFrontEnabled,sendBackwardEnabled:e.sendBackwardEnabled||t.sendBackwardEnabled,sendToBackEnabled:e.sendToBackEnabled||t.sendToBackEnabled}}var De=function(e){function t(t){var i=e.call(this)||this;return i._createLineCommand=null,i._initialTimeScrollState=null,i._initialTimeScrollPos=null,i._currentLineMoveCommand=null,i._currentLineChangeCommand=null,i._undoHistory=t,i._lineToolsGroupController=new de({model:i._model.bind(i),pushUndoCommand:i._pushUndoCommand.bind(i),beginUndoMacro:i._undoHistory.beginUndoMacro.bind(i._undoHistory),endUndoMacro:i._undoHistory.endUndoMacro.bind(i._undoHistory),emitEvent:i.emitEvent.bind(i)}),i}return Object(r.__extends)(t,e),t.prototype.undoHistory=function(){return this._undoHistory},t.prototype.lineToolsGroupController=function(){return this._lineToolsGroupController},t.prototype.mergeAllScales=function(e){!function(e,t){e.beginUndoMacro("left"===t?c:u),e.model().panes().forEach((function(i){var r="left"===t?i.rightPriceScales():i.leftPriceScales(),n=("left"===t?i.leftPriceScales():i.rightPriceScales()).concat(r),o="overlay"===i.priceScalePosition(i.defaultPriceScale())?n[0]:i.defaultPriceScale();e.movePriceScale(i,o,t,0),n.forEach((function(t){if(t!==o)for(var r=t.mainSource();null!==r;){e.moveToScale(r,i,o,"",!0);var n=t.mainSource();if(n===r){h.logError("Loop detected while trying to merge scales");break}r=n}}))})),e.endUndoMacro(),e.model().fullUpdate()}(this,e)},t.prototype.movePriceScale=function(e,t,i,r){var n=new p(this._model(),e,t,i,r,window.t("Move scale"));this._pushUndoCommand(n)},t.prototype.createLineTool=function(e,t,i,r,s,a,l){var c=ke.format({name:i});if(("LineToolRegressionTrend"===i||"LineToolAnchoredVWAP"===i)&&!this.canCreateStudy())return Object(o.showTooManyStudiesNotice)(),null
|
||||||
;this.beginUndoMacro(c);var u=!l;this._createLineCommand=new w(this._model(),e,i,a||Object(n.ensureNotNull)(e.mainDataSource()),u);var h=this._createLineCommand.startCreatingLine(t,r,s||null),d=Object(n.ensureNotNull)(this._createLineCommand.line()),p=null;if(h&&(this._pushUndoCommand(this._createLineCommand),this._createLineCommand=null,p={points:d.normalizedPoints(),interval:this.mainSeries().interval()}),u&&void 0===s&&Object(re.drawOnAllCharts)().value()&&d.isSynchronizable()){var f=Object(n.ensureNotNull)(this.model().externalTimeStamp(t.index));Object(re.createLineTool)({point:{price:t.price,timeStamp:f},linetool:i,properties:d.properties(),symbol:this.mainSeries().symbol(),model:this.model(),linkKey:Object(n.ensureNotNull)(d.getLinkKey()),finalState:p})}return this.endUndoMacro(),d},t.prototype.coninueCreatingLine=function(e,t,i,r){var o=Object(n.ensureNotNull)(this._createLineCommand);this.beginUndoMacro(o.text());var s=Object(n.ensureNotNull)(this._model().lineBeingCreated()),a=o.continueCreatingLine(e,t,i,r),l=null;if(a&&(this._pushUndoCommand(o),this._createLineCommand=null,l={points:s.normalizedPoints(),interval:this.mainSeries().interval()}),o.needCopyToOtherCharts()&&Object(re.drawOnAllCharts)().value()&&s.isSynchronizable()){var c=Object(n.ensureNotNull)(this._model().externalTimeStamp(e.index));Object(re.continueLineTool)({point:{price:e.price,timeStamp:c},envState:t,finalState:l,model:this._model()})}return this.endUndoMacro(),a},t.prototype.continueExternalLine=function(e,t,i){var r=Object(n.ensureNotNull)(this._createLineCommand),o=r.continueCreatingLine(e,t,i);return o&&(this._pushUndoCommand(r),this._createLineCommand=null),o},t.prototype.finishLineTool=function(e){this._model().finishLineTool(e)},t.prototype.loadRange=function(e){this._pushUndoCommand(new q(this._model(),e))},t.prototype.withMacro=function(e,t){var i=this.beginUndoMacro(e);try{t()}finally{this.endUndoMacro()}return i},t.prototype.canZoomIn=function(){return this.model().canZoomIn()},t.prototype.canZoomOut=function(){return this.model().canZoomOut()},t.prototype.zoomOut=function(){var e=this,t=this.timeScale().width();if(this.canZoomOut()){try{this.beginUndoMacro("Zoom Out")}catch(i){return}Object(K.doAnimate)({to:t/5,onStep:function(t){e.startScaleTime(0),e.scaleTimeTo(t),e.endScaleTime()},onComplete:function(){return e.endUndoMacro()}})}},t.prototype.zoomIn=function(){var e=this,t=this.timeScale().width();if(this.canZoomIn()){try{this.beginUndoMacro("Zoom In")}catch(i){return}Object(K.doAnimate)({to:t/5,onStep:function(t){e.startScaleTime(t),e.scaleTimeTo(0),e.endScaleTime()},onComplete:function(){return e.endUndoMacro()}})}},t.prototype.startMovingSources=function(e,t,i,r){e.filter((function(e){return e.doesMovingAffectsUndo()})).length&&(this._currentLineMoveCommand=new g.SaveLineToolStateUndoCommand(this.model(),e,"Move Drawing(s)",!1)),this.model().startMovingSources(e,t,i,r)},t.prototype.moveSources=function(e,t){this.model().moveSources(e,t)},t.prototype.endMovingSource=function(e){this.model().endMovingSources(e),
|
;this.beginUndoMacro(c);var u=!l;this._createLineCommand=new w(this._model(),e,i,a||Object(n.ensureNotNull)(e.mainDataSource()),u);var h=this._createLineCommand.startCreatingLine(t,r,s||null),d=Object(n.ensureNotNull)(this._createLineCommand.line()),p=null;if(h&&(this._pushUndoCommand(this._createLineCommand),this._createLineCommand=null,p={points:d.normalizedPoints(),interval:this.mainSeries().interval()}),u&&void 0===s&&Object(re.drawOnAllCharts)().value()&&d.isSynchronizable()){var f=Object(n.ensureNotNull)(this.model().externalTimeStamp(t.index));Object(re.createLineTool)({point:{price:t.price,timeStamp:f},linetool:i,properties:d.properties(),symbol:this.mainSeries().symbol(),model:this.model(),linkKey:Object(n.ensureNotNull)(d.getLinkKey()),finalState:p})}return this.endUndoMacro(),d},t.prototype.coninueCreatingLine=function(e,t,i,r){var o=Object(n.ensureNotNull)(this._createLineCommand);this.beginUndoMacro(o.text());var s=Object(n.ensureNotNull)(this._model().lineBeingCreated()),a=o.continueCreatingLine(e,t,i,r),l=null;if(a&&(this._pushUndoCommand(o),this._createLineCommand=null,l={points:s.normalizedPoints(),interval:this.mainSeries().interval()}),o.needCopyToOtherCharts()&&Object(re.drawOnAllCharts)().value()&&s.isSynchronizable()){var c=Object(n.ensureNotNull)(this._model().externalTimeStamp(e.index));Object(re.continueLineTool)({point:{price:e.price,timeStamp:c},envState:t,finalState:l,model:this._model()})}return this.endUndoMacro(),a},t.prototype.continueExternalLine=function(e,t,i){var r=Object(n.ensureNotNull)(this._createLineCommand),o=r.continueCreatingLine(e,t,i);return o&&(this._pushUndoCommand(r),this._createLineCommand=null),o},t.prototype.finishLineTool=function(e){this._model().finishLineTool(e)},t.prototype.loadRange=function(e){this._pushUndoCommand(new q(this._model(),e))},t.prototype.withMacro=function(e,t){var i=this.beginUndoMacro(e);try{t()}finally{this.endUndoMacro()}return i},t.prototype.canZoomIn=function(){return this.model().canZoomIn()},t.prototype.canZoomOut=function(){return this.model().canZoomOut()},t.prototype.zoomOut=function(){var e=this,t=this.timeScale().width();if(this.canZoomOut()){try{this.beginUndoMacro("Zoom Out")}catch(i){return}Object(K.doAnimate)({to:t/5,onStep:function(t){e.startScaleTime(0),e.scaleTimeTo(t),e.endScaleTime()},onComplete:function(){return e.endUndoMacro()}})}},t.prototype.zoomIn=function(){var e=this,t=this.timeScale().width();if(this.canZoomIn()){try{this.beginUndoMacro("Zoom In")}catch(i){return}Object(K.doAnimate)({to:t/5,onStep:function(t){e.startScaleTime(t),e.scaleTimeTo(0),e.endScaleTime()},onComplete:function(){return e.endUndoMacro()}})}},t.prototype.startMovingSources=function(e,t,i,r){e.filter((function(e){return e.doesMovingAffectsUndo()})).length&&(this._currentLineMoveCommand=new g.SaveLineToolStateUndoCommand(this.model(),e,"Move Drawing(s)",!1)),this.model().startMovingSources(e,t,i,r)},t.prototype.moveSources=function(e,t){this.model().moveSources(e,t)},t.prototype.endMovingSource=function(e){this.model().endMovingSources(e),
|
||||||
null!==this._currentLineMoveCommand&&(this._currentLineMoveCommand.saveNewState(),this._pushUndoCommand(this._currentLineMoveCommand)),this._currentLineMoveCommand=null},t.prototype.startChangingLinetool=function(e,t,i,r,n){this._currentLineChangeCommand=new g.SaveLineToolStateUndoCommand(this.model(),[e],"Change "+i+"point",!1),this.model().startChangingLinetool(e,t,i,r,n)},t.prototype.changeLinePoint=function(e,t,i){this.model().changeLinePoint(e,t,i)},t.prototype.endChangingLinetool=function(e){this.model().endChangingLinetool(e),null!==this._currentLineChangeCommand&&(this._currentLineChangeCommand.saveNewState(),this._pushUndoCommand(this._currentLineChangeCommand)),this._currentLineChangeCommand=null},t.prototype.setChartStyleProperty=function(e,t,i){if(e.value()!==t){var r=new Y(e,t,this.mainSeries(),i,this.model(),this.chartWidget());this._pushUndoCommand(r),this.emitEvent("setChartStyleProperty"),Object(j.trackChartStyleChanged)(e.value())}},t.prototype.applyStudyTemplate=function(e,t){var i=new me(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.cloneLineTools=function(e,t){for(var i=this,r=0;r<Math.min(5,e.length);++r)Object(j.trackDrawingCloned)(e[r]);this.beginUndoMacro(window.t("Clone line tools"));var o=new _(this._model(),e,t,window.t("Clone line tools"));if(this._pushUndoCommand(o),Object(re.drawOnAllCharts)().value()){var s=o.newIds().map((function(e){return Object(n.ensureNotNull)(i.model().dataSourceForId(e))}));this.copyToOtherCharts(s)}return this.endUndoMacro(),this.emitEvent("cloneLineTools"),o.newIds()},t.prototype.removeSource=function(e,t){if(this.lineBeingCreated()!==e){var i="Remove "+e.title();this.removeSources([e],t,i)}else this.cancelCreatingLine()},t.prototype.removeSelectedSources=function(){var e=this._model().selection().sources();if(e.length){var t=e.length>1?"Remove drawings group":"Remove "+e[0].title();this.removeSources(e,!1,t)}},t.prototype.removeSources=function(e,t,i){var r=this;e=e.filter((function(e){return e.isUserDeletable()}));var o=this._model(),s=o.lineToolsGroupModel();this.beginUndoMacro(i),o.selectionMacro((function(a){var l=new Map;e.forEach((function(e){if(Object(f.isLineTool)(e)){var t=s.groupForLineTool(e);if(null!==t){var i=l.get(t)||[];i.push(e),l.set(t,i)}null!==e.getLinkKey()&&Object(re.removeLineTool)({model:r.model(),linkKey:Object(n.ensureNotNull)(e.getLinkKey())})}})),l.forEach((function(e,t){var i=new y.a(o,t,e);r._pushUndoCommand(i)}));var c=new m.RemoveSourcesCommand(o,e,i),u=c.removedIds();r._pushUndoCommand(c),!t&&u.length>0&&(1===u.length?r.emitEvent("removeSource",[u[0]]):r.emitEvent("removeSources",[u]))})),this.endUndoMacro()},t.prototype.mergeSourceUp=function(e){var t=new S.c(this._model(),e,"Merge up");this._mergeUnmergeSource(e,t)},t.prototype.mergeSourceDown=function(e){var t=new S.a(this._model(),e,"Merge down");this._mergeUnmergeSource(e,t)},t.prototype.mergeToPane=function(e,t){var i=this._model().panes().indexOf(t),r=new S.b(this._model(),e,i,"Merge to pane");this._mergeUnmergeSource(e,r)},
|
null!==this._currentLineMoveCommand&&(this._currentLineMoveCommand.saveNewState(),this._pushUndoCommand(this._currentLineMoveCommand)),this._currentLineMoveCommand=null},t.prototype.startChangingLinetool=function(e,t,i,r,n){this._currentLineChangeCommand=new g.SaveLineToolStateUndoCommand(this.model(),[e],"Change "+i+"point",!1),this.model().startChangingLinetool(e,t,i,r,n)},t.prototype.changeLinePoint=function(e,t,i){this.model().changeLinePoint(e,t,i)},t.prototype.endChangingLinetool=function(e){this.model().endChangingLinetool(e),null!==this._currentLineChangeCommand&&(this._currentLineChangeCommand.saveNewState(),this._pushUndoCommand(this._currentLineChangeCommand)),this._currentLineChangeCommand=null},t.prototype.setChartStyleProperty=function(e,t,i){if(e.value()!==t){var r=new Y(e,t,this.mainSeries(),i,this.model(),this.chartWidget());this._pushUndoCommand(r),this.emitEvent("setChartStyleProperty"),Object(j.trackChartStyleChanged)(e.value())}},t.prototype.applyStudyTemplate=function(e,t){var i=new me(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.cloneLineTools=function(e,t){for(var i=this,r=0;r<Math.min(5,e.length);++r)Object(j.trackDrawingCloned)(e[r]);this.beginUndoMacro(window.t("Clone line tools"));var o=new _(this._model(),e,t,window.t("Clone line tools"));if(this._pushUndoCommand(o),Object(re.drawOnAllCharts)().value()){var s=o.newIds().map((function(e){return Object(n.ensureNotNull)(i.model().dataSourceForId(e))}));this.copyToOtherCharts(s)}return this.endUndoMacro(),this.emitEvent("cloneLineTools"),o.newIds()},t.prototype.removeSource=function(e,t,i){if(this.lineBeingCreated()!==e){var r="Remove "+e.title();this.removeSources([e],t,r,i)}else this.cancelCreatingLine()},t.prototype.removeSelectedSources=function(){var e=this._model().selection().sources();if(e.length){var t=e.length>1?"Remove drawings group":"Remove "+e[0].title();this.removeSources(e,!1,t)}},t.prototype.removeSources=function(e,t,i,r){var o=this;r||(e=e.filter((function(e){return e.isUserDeletable()})));var s=this._model(),a=s.lineToolsGroupModel();this.beginUndoMacro(i),s.selectionMacro((function(r){var l=new Map;e.forEach((function(e){if(Object(f.isLineTool)(e)){var t=a.groupForLineTool(e);if(null!==t){var i=l.get(t)||[];i.push(e),l.set(t,i)}null!==e.getLinkKey()&&Object(re.removeLineTool)({model:o.model(),linkKey:Object(n.ensureNotNull)(e.getLinkKey())})}})),l.forEach((function(e,t){var i=new y.a(s,t,e);o._pushUndoCommand(i)}));var c=new m.RemoveSourcesCommand(s,e,i),u=c.removedIds();o._pushUndoCommand(c),!t&&u.length>0&&(1===u.length?o.emitEvent("removeSource",[u[0]]):o.emitEvent("removeSources",[u]))})),this.endUndoMacro()},t.prototype.mergeSourceUp=function(e){var t=new S.c(this._model(),e,"Merge up");this._mergeUnmergeSource(e,t)},t.prototype.mergeSourceDown=function(e){var t=new S.a(this._model(),e,"Merge down");this._mergeUnmergeSource(e,t)},t.prototype.mergeToPane=function(e,t){var i=this._model().panes().indexOf(t),r=new S.b(this._model(),e,i,"Merge to pane");this._mergeUnmergeSource(e,r)},
|
||||||
t.prototype.unmergeSourceUp=function(e){var t=new v.c(this._model(),e,"Unmerge up");this._mergeUnmergeSource(e,t)},t.prototype.unmergeSourceDown=function(e){var t=new v.a(this._model(),e,"Unmerge down");this._mergeUnmergeSource(e,t)},t.prototype.unmergeToNewBottomPane=function(e){var t=new v.b(this._model(),e,"Unmerge to new bottom pane");this._mergeUnmergeSource(e,t)},t.prototype.availableZOrderOperations=function(e){var t=this._model().lineToolsGroupModel(),i=e.filter(f.isLineTool),r=i.map((function(e){return t.groupForLineTool(e)}));Object(n.assert)(new Set(r).size<=1,"Cannot move line tools from different group");for(var o=0===r.length?null:r[0],s={bringForwardEnabled:!1,bringToFrontEnabled:!1,sendBackwardEnabled:!1,sendToBackEnabled:!1},a=new Set(i),l=function(e){if(Object(f.isLineTool)(e)&&null!==o){var t=Object(b.sortSources)(o.lineTools().filter((function(t){return!a.has(t)||t===e})));return s=Ee(s,{bringForwardEnabled:e!==t[t.length-1],bringToFrontEnabled:e!==t[t.length-1],sendBackwardEnabled:e!==t[0],sendToBackEnabled:e!==t[0]}),"continue"}var i=Object(n.ensureNotNull)(c._model().paneForSource(e)).allOrderedSourcesWithoutSpecial();if(0===i.length)return"continue";var r=e.zorder(),l=i[0].zorder(),u=i[i.length-1].zorder();s=Ee(s,{bringForwardEnabled:r!==u,bringToFrontEnabled:r!==u,sendBackwardEnabled:r!==l,sendToBackEnabled:r!==l})},c=this,u=0,h=Object(b.sortSources)(e);u<h.length;u++){l(h[u])}return s},t.prototype.sendToBack=function(e){if(!this.availableZOrderOperations(e).sendToBackEnabled)throw new Error("Send to back operation is unavailable");var t=null,i=e[0];if(Object(f.isLineTool)(i)){var r=this._model().lineToolsGroupModel().groupForLineTool(i);if(null!==r){var n=r.lineTools();t=new M(this.model(),Object(b.sortSources)(e),n[0])}}null===t&&(t=new x(this.model(),Object(b.sortSources)(e))),this._pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},t.prototype.bringToFront=function(e){if(!this.availableZOrderOperations(e).bringToFrontEnabled)throw new Error("Bring to front operation is unavailable");var t=null,i=e[0];if(Object(f.isLineTool)(i)){var r=this._model().lineToolsGroupModel().groupForLineTool(i);if(null!==r){var n=r.lineTools();t=new L(this.model(),Object(b.sortSources)(e),n[n.length-1])}}null===t&&(t=new C(this.model(),Object(b.sortSources)(e))),this._pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},t.prototype.sendBackward=function(e){var t=this;if(!this.availableZOrderOperations(e).sendBackwardEnabled)throw new Error("Send backward operation is unavailable");var i=Ie.format({title:e[0].title()});this._sendBackOrBringForward(i,Object(b.sortSources)(e),(function(e,i){return new A(t.model(),e,i)}))},t.prototype.bringForward=function(e){var t=this;if(!this.availableZOrderOperations(e).bringForwardEnabled)throw new Error("Bring forward operation is unavailable");var i=Me.format({title:e[0].title()});this._sendBackOrBringForward(i,Object(b.sortSources)(e),(function(e,i){return new E(t.model(),e,i)}))},t.prototype.insertAfter=function(e,t){var i=this;e=Object(b.sortSources)(e)
|
t.prototype.unmergeSourceUp=function(e){var t=new v.c(this._model(),e,"Unmerge up");this._mergeUnmergeSource(e,t)},t.prototype.unmergeSourceDown=function(e){var t=new v.a(this._model(),e,"Unmerge down");this._mergeUnmergeSource(e,t)},t.prototype.unmergeToNewBottomPane=function(e){var t=new v.b(this._model(),e,"Unmerge to new bottom pane");this._mergeUnmergeSource(e,t)},t.prototype.availableZOrderOperations=function(e){var t=this._model().lineToolsGroupModel(),i=e.filter(f.isLineTool),r=i.map((function(e){return t.groupForLineTool(e)}));Object(n.assert)(new Set(r).size<=1,"Cannot move line tools from different group");for(var o=0===r.length?null:r[0],s={bringForwardEnabled:!1,bringToFrontEnabled:!1,sendBackwardEnabled:!1,sendToBackEnabled:!1},a=new Set(i),l=function(e){if(Object(f.isLineTool)(e)&&null!==o){var t=Object(b.sortSources)(o.lineTools().filter((function(t){return!a.has(t)||t===e})));return s=Ee(s,{bringForwardEnabled:e!==t[t.length-1],bringToFrontEnabled:e!==t[t.length-1],sendBackwardEnabled:e!==t[0],sendToBackEnabled:e!==t[0]}),"continue"}var i=Object(n.ensureNotNull)(c._model().paneForSource(e)).allOrderedSourcesWithoutSpecial();if(0===i.length)return"continue";var r=e.zorder(),l=i[0].zorder(),u=i[i.length-1].zorder();s=Ee(s,{bringForwardEnabled:r!==u,bringToFrontEnabled:r!==u,sendBackwardEnabled:r!==l,sendToBackEnabled:r!==l})},c=this,u=0,h=Object(b.sortSources)(e);u<h.length;u++){l(h[u])}return s},t.prototype.sendToBack=function(e){if(!this.availableZOrderOperations(e).sendToBackEnabled)throw new Error("Send to back operation is unavailable");var t=null,i=e[0];if(Object(f.isLineTool)(i)){var r=this._model().lineToolsGroupModel().groupForLineTool(i);if(null!==r){var n=r.lineTools();t=new M(this.model(),Object(b.sortSources)(e),n[0])}}null===t&&(t=new x(this.model(),Object(b.sortSources)(e))),this._pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},t.prototype.bringToFront=function(e){if(!this.availableZOrderOperations(e).bringToFrontEnabled)throw new Error("Bring to front operation is unavailable");var t=null,i=e[0];if(Object(f.isLineTool)(i)){var r=this._model().lineToolsGroupModel().groupForLineTool(i);if(null!==r){var n=r.lineTools();t=new L(this.model(),Object(b.sortSources)(e),n[n.length-1])}}null===t&&(t=new C(this.model(),Object(b.sortSources)(e))),this._pushUndoCommand(t),this.emitEvent("changeZOrder",[e])},t.prototype.sendBackward=function(e){var t=this;if(!this.availableZOrderOperations(e).sendBackwardEnabled)throw new Error("Send backward operation is unavailable");var i=Ie.format({title:e[0].title()});this._sendBackOrBringForward(i,Object(b.sortSources)(e),(function(e,i){return new A(t.model(),e,i)}))},t.prototype.bringForward=function(e){var t=this;if(!this.availableZOrderOperations(e).bringForwardEnabled)throw new Error("Bring forward operation is unavailable");var i=Me.format({title:e[0].title()});this._sendBackOrBringForward(i,Object(b.sortSources)(e),(function(e,i){return new E(t.model(),e,i)}))},t.prototype.insertAfter=function(e,t){var i=this;e=Object(b.sortSources)(e)
|
||||||
;var r=Oe.format({title:e[0].title(),target:t.title()});this._insertAfterOrBefore(r,e,t,(function(){return new L(i.model(),e,t)}))},t.prototype.insertBefore=function(e,t){var i=this;e=Object(b.sortSources)(e);var r=Ae.format({title:e[0].title(),target:t.title()});this._insertAfterOrBefore(r,e,t,(function(){return new M(i.model(),e,t)}))},t.prototype.detachToRight=function(e,t){Object(xe.trackEvent)("Chart","Move to new right scale");var i=window.t("Move {title} To New Price Scale").format({title:e.title()}),r=new Pe.b(this.model(),e,t,"right",i);this._pushUndoCommand(r),this.emitEvent("moveSource",[e])},t.prototype.detachToLeft=function(e,t){Object(xe.trackEvent)("Chart","Move to new left scale");var i=window.t("Move {title} To New Left Scale").format({title:e.title()}),r=new Pe.b(this.model(),e,t,"left",i);this._pushUndoCommand(r),this.emitEvent("moveSource",[e])},t.prototype.detachNoScale=function(e,t){Object(xe.trackEvent)("Chart","Make source no scale");var i=window.t("Make {title} No Scale (Full Screen)").format({title:e.title()}),r=new Pe.b(this.model(),e,t,"overlay",i);this._pushUndoCommand(r),this.emitEvent("moveSource",[e])},t.prototype.moveToScale=function(e,t,i,r,n){Object(xe.trackEvent)("Chart","Move source to target scale"),this.beginUndoMacro(r);var o=new Pe.a(this.model(),e,t,i,r),s=n?null:Object(Te.sourceNewCurrencyOnPinningToPriceScale)(e,i,this._model());this._pushUndoCommand(o),null!==s&&this.setPriceScaleCurrency(i,s),this.endUndoMacro(),this.emitEvent("moveSource",[e])},t.prototype.startScrollTime=function(e){var t=this.timeScale();this._initialTimeScrollState={rightOffset:t.rightOffset(),barSpacing:t.barSpacing()},this._initialTimeScrollPos=e,this.model().startScrollTime(e)},t.prototype.scrollTimeTo=function(e){var t=!1;return null!==this._initialTimeScrollPos&&null!==this._initialTimeScrollState&&Math.abs(e-this._initialTimeScrollPos)>20&&(this._pushUndoCommand(new F.a(this.model(),this._initialTimeScrollState,"Scroll Time")),this._initialTimeScrollPos=null,this._initialTimeScrollState=null,t=!0),this.model().scrollTimeTo(e),t},t.prototype.endScrollTime=function(){this.model().endScrollTime(),this._initialTimeScrollPos=null,this._initialTimeScrollState=null},t.prototype.startScaleTime=function(e){var t=this.timeScale(),i={rightOffset:t.rightOffset(),barSpacing:t.barSpacing()};this._pushUndoCommand(new F.a(this.model(),i,"Scale Time")),this.model().startScaleTime(e)},t.prototype.scaleTimeTo=function(e){this.model().scaleTimeTo(e)},t.prototype.endScaleTime=function(){this.model().endScaleTime()},t.prototype.resetTimeScale=function(){var e=this.timeScale(),t={rightOffset:e.rightOffset(),barSpacing:e.barSpacing()};this._pushUndoCommand(new F.a(this.model(),t,"Reset Time Scale")),this.model().resetTimeScale()},t.prototype.rearrangePanes=function(e,t){var i=new N(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.movePane=function(e,t){var i=new N(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.pasteLineTool=function(e,t){var i=new be(this.model(),t,e);this._pushUndoCommand(i)
|
;var r=Oe.format({title:e[0].title(),target:t.title()});this._insertAfterOrBefore(r,e,t,(function(){return new L(i.model(),e,t)}))},t.prototype.insertBefore=function(e,t){var i=this;e=Object(b.sortSources)(e);var r=Ae.format({title:e[0].title(),target:t.title()});this._insertAfterOrBefore(r,e,t,(function(){return new M(i.model(),e,t)}))},t.prototype.detachToRight=function(e,t){Object(xe.trackEvent)("Chart","Move to new right scale");var i=window.t("Move {title} To New Price Scale").format({title:e.title()}),r=new Pe.b(this.model(),e,t,"right",i);this._pushUndoCommand(r),this.emitEvent("moveSource",[e])},t.prototype.detachToLeft=function(e,t){Object(xe.trackEvent)("Chart","Move to new left scale");var i=window.t("Move {title} To New Left Scale").format({title:e.title()}),r=new Pe.b(this.model(),e,t,"left",i);this._pushUndoCommand(r),this.emitEvent("moveSource",[e])},t.prototype.detachNoScale=function(e,t){Object(xe.trackEvent)("Chart","Make source no scale");var i=window.t("Make {title} No Scale (Full Screen)").format({title:e.title()}),r=new Pe.b(this.model(),e,t,"overlay",i);this._pushUndoCommand(r),this.emitEvent("moveSource",[e])},t.prototype.moveToScale=function(e,t,i,r,n){Object(xe.trackEvent)("Chart","Move source to target scale"),this.beginUndoMacro(r);var o=new Pe.a(this.model(),e,t,i,r),s=n?null:Object(Te.sourceNewCurrencyOnPinningToPriceScale)(e,i,this._model());this._pushUndoCommand(o),null!==s&&this.setPriceScaleCurrency(i,s),this.endUndoMacro(),this.emitEvent("moveSource",[e])},t.prototype.startScrollTime=function(e){var t=this.timeScale();this._initialTimeScrollState={rightOffset:t.rightOffset(),barSpacing:t.barSpacing()},this._initialTimeScrollPos=e,this.model().startScrollTime(e)},t.prototype.scrollTimeTo=function(e){var t=!1;return null!==this._initialTimeScrollPos&&null!==this._initialTimeScrollState&&Math.abs(e-this._initialTimeScrollPos)>20&&(this._pushUndoCommand(new F.a(this.model(),this._initialTimeScrollState,"Scroll Time")),this._initialTimeScrollPos=null,this._initialTimeScrollState=null,t=!0),this.model().scrollTimeTo(e),t},t.prototype.endScrollTime=function(){this.model().endScrollTime(),this._initialTimeScrollPos=null,this._initialTimeScrollState=null},t.prototype.startScaleTime=function(e){var t=this.timeScale(),i={rightOffset:t.rightOffset(),barSpacing:t.barSpacing()};this._pushUndoCommand(new F.a(this.model(),i,"Scale Time")),this.model().startScaleTime(e)},t.prototype.scaleTimeTo=function(e){this.model().scaleTimeTo(e)},t.prototype.endScaleTime=function(){this.model().endScaleTime()},t.prototype.resetTimeScale=function(){var e=this.timeScale(),t={rightOffset:e.rightOffset(),barSpacing:e.barSpacing()};this._pushUndoCommand(new F.a(this.model(),t,"Reset Time Scale")),this.model().resetTimeScale()},t.prototype.rearrangePanes=function(e,t){var i=new N(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.movePane=function(e,t){var i=new N(this._model(),e,t);this._pushUndoCommand(i)},t.prototype.pasteLineTool=function(e,t){var i=new be(this.model(),t,e);this._pushUndoCommand(i)
|
||||||
;var r=i.source();return i.needCopyToOtherCharts()&&this.copyToOtherCharts([r]),r},t.prototype.setPriceScaleCurrency=function(e,t){var i=new we.a(e,t,this.chartWidget(),"Change currency");this._pushUndoCommand(i)},t.prototype.setMainSeriesSymbol=function(e){if(this.mainSeries().symbol()!==e){var t=!1;if(this._model().currencyLabelEnabled()&&null!==this.mainSeries().currency()){var i=this._model().availableCurrenciesSet(),r=this.mainSeries().priceScale().currency(i);t=null===r||!r.readOnly&&(null===r.selectedCurrency||r.allCurrenciesAreOriginal||1===r.symbolSourceCount)}this._pushUndoCommand(new Ce(e,this.chartWidget(),t))}},t.prototype.copyToOtherCharts=function(e){var t=this,i=this.mainSeries(),o=i.syncModel(),s=this.timeScale();if(o)for(var a=0,l=e;a<l.length;a++){var c=l[a],u=c.linkKey||Object(ge.randomHash)();c.linkKey=u;var h=c.state(!1),d=c.normalizedPoints().map((function(e){var i=Object(n.ensureNotNull)(s.timePointToIndex(e.time_t))+e.offset;return{price:e.price,timeStamp:Object(n.ensureNotNull)(t.model().externalTimeStamp(i))}})),p=Object(r.__assign)(Object(r.__assign)({},h),{linkKey:u,points:d,linetool:c.getType(),model:this.model(),symbol:i.symbol(),finalState:{points:c.normalizedPoints(),interval:i.interval()}});Object(re.copyLineTool)(p)}},t.prototype.addPaneStretchFactorUndoCommand=function(e,t,i,r){var n=new Le(this.model(),e,t,i,r);this._pushUndoCommand(n)},t.prototype._mergeUnmergeSource=function(e,t){var i=this;this.beginUndoMacro(t.text());var r=Object(n.ensureNotNull)(this._model().paneForSource(e)),o=new Set(r.orderedSources().filter((function(t){return Object(f.isLineTool)(t)&&t.ownerSource()===e})));this._model().lineToolsGroupModel().groups().filter((function(e){var t=e.lineTools().some((function(e){return o.has(e)})),i=e.lineTools().some((function(e){return!o.has(e)}));return t&&i})).forEach((function(e){i._pushUndoCommand(new y.a(i._model(),e,e.lineTools()))})),this._pushUndoCommand(t),this.endUndoMacro()},t.prototype._insertAfterOrBefore=function(e,t,i,r){var o=this,s=Object(n.ensureNotNull)(this._model().paneForSource(i));if(t.some((function(e){return Object(f.isLineTool)(e)&&o._model().paneForSource(e)!==s})))throw new Error("Cannot insert line tool after target on another pane");this.beginUndoMacro(e),t.forEach((function(e){Object(n.ensureNotNull)(o.model().paneForSource(e))!==s&&o.mergeToPane(e,s)}));var a=r();this._pushUndoCommand(a),this.emitEvent("changeZOrder",[t]),this.endUndoMacro()},t.prototype._sendBackOrBringForward=function(e,t,i){var r=this,o=new Map;t.forEach((function(e){var t=Object(n.ensureNotNull)(r._model().paneForSource(e)),i=o.get(t)||[];i.push(e),o.set(t,i)})),this.beginUndoMacro(e),o.forEach((function(e,t){r._pushUndoCommand(i(t,e))})),this.endUndoMacro(),this.emitEvent("changeZOrder",[t])},t}(a.a)},opke:function(e,t){
|
;var r=i.source();return i.needCopyToOtherCharts()&&this.copyToOtherCharts([r]),r},t.prototype.setPriceScaleCurrency=function(e,t){var i=new we.a(e,t,this.chartWidget(),"Change currency");this._pushUndoCommand(i)},t.prototype.setMainSeriesSymbol=function(e){if(this.mainSeries().symbol()!==e){var t=!1;if(this._model().currencyLabelEnabled()&&null!==this.mainSeries().currency()){var i=this._model().availableCurrenciesSet(),r=this.mainSeries().priceScale().currency(i);t=null===r||!r.readOnly&&(null===r.selectedCurrency||r.allCurrenciesAreOriginal||1===r.symbolSourceCount)}this._pushUndoCommand(new Ce(e,this.chartWidget(),t))}},t.prototype.copyToOtherCharts=function(e){var t=this,i=this.mainSeries(),o=i.syncModel(),s=this.timeScale();if(o)for(var a=0,l=e;a<l.length;a++){var c=l[a],u=c.linkKey||Object(ge.randomHash)();c.linkKey=u;var h=c.state(!1),d=c.normalizedPoints().map((function(e){var i=Object(n.ensureNotNull)(s.timePointToIndex(e.time_t))+e.offset;return{price:e.price,timeStamp:Object(n.ensureNotNull)(t.model().externalTimeStamp(i))}})),p=Object(r.__assign)(Object(r.__assign)({},h),{linkKey:u,points:d,linetool:c.getType(),model:this.model(),symbol:i.symbol(),finalState:{points:c.normalizedPoints(),interval:i.interval()}});Object(re.copyLineTool)(p)}},t.prototype.addPaneStretchFactorUndoCommand=function(e,t,i,r){var n=new Le(this.model(),e,t,i,r);this._pushUndoCommand(n)},t.prototype._mergeUnmergeSource=function(e,t){var i=this;this.beginUndoMacro(t.text());var r=Object(n.ensureNotNull)(this._model().paneForSource(e)),o=new Set(r.orderedSources().filter((function(t){return Object(f.isLineTool)(t)&&t.ownerSource()===e})));this._model().lineToolsGroupModel().groups().filter((function(e){var t=e.lineTools().some((function(e){return o.has(e)})),i=e.lineTools().some((function(e){return!o.has(e)}));return t&&i})).forEach((function(e){i._pushUndoCommand(new y.a(i._model(),e,e.lineTools()))})),this._pushUndoCommand(t),this.endUndoMacro()},t.prototype._insertAfterOrBefore=function(e,t,i,r){var o=this,s=Object(n.ensureNotNull)(this._model().paneForSource(i));if(t.some((function(e){return Object(f.isLineTool)(e)&&o._model().paneForSource(e)!==s})))throw new Error("Cannot insert line tool after target on another pane");this.beginUndoMacro(e),t.forEach((function(e){Object(n.ensureNotNull)(o.model().paneForSource(e))!==s&&o.mergeToPane(e,s)}));var a=r();this._pushUndoCommand(a),this.emitEvent("changeZOrder",[t]),this.endUndoMacro()},t.prototype._sendBackOrBringForward=function(e,t,i){var r=this,o=new Map;t.forEach((function(e){var t=Object(n.ensureNotNull)(r._model().paneForSource(e)),i=o.get(t)||[];i.push(e),o.set(t,i)})),this.beginUndoMacro(e),o.forEach((function(e,t){r._pushUndoCommand(i(t,e))})),this.endUndoMacro(),this.emitEvent("changeZOrder",[t])},t}(a.a)},opke:function(e,t){
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user