webpackJsonp([6,12],{1077:function(t,e,o){"use strict";e.createInputsPropertyPage=function(t,e){var o=t.getInputsPropertyPage();return null==o?null:new o(t.properties(),e,t)},e.createStudyStrategyPropertyPage=function(t,e){var o=t.getStrategyPropertyPage();return null==o?null:new o(t.properties(),e,t)},e.createStylesPropertyPage=function(t,e){var o=t.getStylesPropertyPage();return null==o?null:new o(t.properties(),e,t)},e.createDisplayPropertyPage=function(t,e){var o=t.getDisplayPropertyPage();return null==o?null:new o(t.properties(),e,t)},e.createVisibilitiesPropertyPage=function(t,e){var o=t.getVisibilitiesPropertyPage();return null==o?null:new o(t.properties(),e,t)},e.hasInputsPropertyPage=function(t){return null!==t.getInputsPropertyPage()},e.hasStylesPropertyPage=function(t){return null!==t.getStylesPropertyPage()}},1192:function(t,e,o){"use strict";(function(e){function i(t,e){this.options=t||{},this._chartWidget=t.chartWidget,this._model=e}function r(t,e){e.__init||(t.initView(),e.__init=!0)}var s,n=o(1285),a=o(1298),l=o(1).LineDataSource,c=o(415).createTabbedDialog,d=o(40).trackEvent;o(1300),s=null,i.prototype.getSourceProperties=function(){var t,e,o,i,r,s,n,a={groups:[],drawings:[],currentSymbol:this._model.mainSeries().symbol()};for(t=0;t"),l=this.getSourceProperties.bind(this),h=$("
"),u=new n(l,this._chartWidget,this._model,h,i),o=o.add(i),t.push({customControl:i,name:$.t("Objects Tree"),page:h,onActivate:r.bind(null,u)}),p=null,e.enabled("support_manage_drawings")&&(_=$("
"),v=$("
"),p=new a(l,this._chartWidget,this._model,v,_),o=o.add(_),t.push({customControl:_,name:$.t("Manage Drawings"),page:v,onActivate:r.bind(null,p)})),m=c({tabs:t,width:520,tabStateSaveKey:"ObjectsTreeDialog.tab",activeTab:this.options.activeTab,customControlsContainerAddClass:"tv-objects-tree-dialog__custom-controls-container",customControls:o,destroyOnClose:!0,height:480,withScroll:!1,contentAddClass:"js-dialog__scroll-wrap",isClickOutFn:function(t){if($(t.target).parents().andSelf().is("._tv-dialog, .properties-toolbar, .colorpicker, .tvcolorpicker-popup, .symbol-edit-popup, .context-menu, .js-dialog"))return!1}}),m.tabs.tabChanged.subscribe(null,function(e){t[e].onActivate(t[e]);for(var o=0;o').appendTo(this._$tabContainer),this._list=new s(this._chartModel,e),this._list.setItemActivateListener(this._onActiveSourceChanged.bind(this)),this._sourceRemovedHandler=this._onSourceRemoved.bind(this),this._sourcesRemovedHandler=this._onSourcesRemoved.bind(this)}var r=o(173).SidebarCustomScroll,s=o(1289).ObjectTreeItemsController,n=o(22),a=o(172).unifiedSpinner;o(1296),i.prototype._removeSourceFromView=function(t){},i.prototype._removeSourcesFromView=function(t){},i.prototype._renderViewInternal=function(t){},i.prototype.destroy=function(){this._unsubscribeListeners()},i.prototype.initView=function(){this._chartModel.selectedSource()&&(this._selectedItemId=this._chartModel.selectedSource().id()),this._subscribeListeners(),this._renderView(null),this._addScroll()},i.prototype._sourceForId=function(t){return this._chartModel.dataSourceForId(t)},i.prototype._selectedSourceId=function(){return this._selectedItemId},i.prototype._onActiveSourceChanged=function(t){if(!t)return void(this._selectedItemId="");this._selectedItemId=t.id(),this._chartModel.setSelectedSource(t),this._chartModel.invalidate(new n(n.LIGHT_UPDATE))},i.prototype._getItemForSourceId=function(t){return this._$contentWrapper.find("#"+t)},i.prototype._markItemForSource=function(t,e){t.attr("id",e.id())},i.prototype._getSourceIdForItem=function(t){return t.attr("id")},i.prototype._getSourceForItem=function(t){return this._sourceForId(this._getSourceIdForItem(t))},i.prototype._listAccessor=function(){return this._list},i.prototype._showSpinner=function(){this.spinner=a().spin(this._$tabContainer.get(0)),this._$contentWrapper.css("visibility","hidden")},i.prototype._hideSpinner=function(){this.spinner&&(this.spinner.stop(),this._$contentWrapper.css("visibility","visible"))},i.prototype._onSourceRemoved=function(t){t&&(this._removeSourceFromView(t),this._scroll.updateScrollBar())},i.prototype._onSourcesRemoved=function(t){Array.isArray(t)&&(this._removeSourcesFromView(t),this._scroll.updateScrollBar())},i.prototype._subscribeListeners=function(){this._chartModel.on("removeSource",this._sourceRemovedHandler),this._chartModel.on("removeSources",this._sourcesRemovedHandler)},i.prototype._unsubscribeListeners=function(){this._chartModel.removeListener("removeSource",this._sourceRemovedHandler),this._chartModel.removeListener("removeSources",this._sourcesRemovedHandler)},i.prototype._getItems=function(){return this._items},i.prototype._reloadItems=function(){this._items=this._sourcesPropertiesGetter()},i.prototype._renderView=function(t){this._$contentWrapper.empty(),this._hideSpinner(),this._showSpinner(),this._reloadItems(),this._renderViewInternal(function(){this._hideSpinner(),t&&t()}.bind(this))},i.prototype._addScroll=function(){this._scroll=new r(this._$tabContainer,this._$contentWrapper,{showTopShadow:!1, showBottomShadow:!1,scrollMarginTop:0})},t.exports=i},1285:function(t,e,o){"use strict";function i(t,e,o,i,r){s.call(this,t,e,o,i),this._delayedRenderIntervals={},this._$filterContainer=r,this._boundUpdateView=this._updateView.bind(this),this._boundRenderView=this._renderView.bind(this,null),this._zorderChangedHandler=this._onZorderChanged.bind(this)}var r=o(1286).ObjectsTreeTabFilter,s=o(1247);o(1297),inherit(i,s),i.prototype.destroy=function(){Object.keys(this._delayedRenderIntervals).forEach(function(t){clearInterval(t)}),this._delayedRenderIntervals=null,s.prototype.destroy.call(this)},i.prototype.initView=function(){this._filter=new r(this._$filterContainer),this._filter.onChange.subscribe(this,function(){this._renderView(this._scroll.scrollToStart.bind(this._scroll))}.bind(this)),s.prototype.initView.call(this)},i.prototype._addSortableToList=function(t,e){var o=0;this._listAccessor().createSortableForItemsList(t,function(t,e){o=e.item.index()},function(t,i){var r,s,n,a,l,c,d,h,u,p=i.item.index();if(o!==p){for(r=o>p?i.item.next():i.item.prev(),s=this._getSourceIdForItem(i.item),n=this._getSourceIdForItem(r),a=-1,l=-1,c=0;cl?1:-1,c=0;c=0;--i)r=o.children[i],s=this._getItemForSourceId(r.datasource.id()),0!==s.length&&this._listAccessor().updateItem(s,r)},i._groupRenderSize=50,i.prototype._renderGroup=function(t){var e,o;t=t||{},e=0,o=setInterval(function(){var r=t.items.slice(e,e+i._groupRenderSize);r.forEach(function(e){var o=this._list.createItem(e,{lockUnlock:t.showLocks,showHide:!0,draggable:!0,addContextMenu:!0});this._markItemForSource(o,e.datasource),e.datasource.id()===this._selectedSourceId()&&this._listAccessor().activateItem(o,e.datasource),t.$group.append(o)}.bind(this)),e+=i._groupRenderSize,r.length||(clearInterval(o),delete this._delayedRenderIntervals[o],0===--this._fillListGroupsCount&&t.callback())}.bind(this),100),this._delayedRenderIntervals[o]=!0},i.prototype._renderViewInternal=function(t){var e,o,i,r,s="studies"!==this._filter.value()&&this._items.drawings.length;for(this._fillListGroupsCount=0,e=this._getItems().groups,o=0;o').appendTo(this._$contentWrapper),this._addSortableToList(r,e[o].children),i.reverse(),this._renderGroup({showLocks:s,callback:t,items:i,$group:r}),this._fillListGroupsCount++)},t.exports=i},1286:function(t,e,o){"use strict";(function(e,i){function r(t){this._$filter=$(e.render(s,{filters:this._getActions()})).appendTo(t).tvDropdown();var o=this;this._$filter.on(Modernizr.touch?"touchend":"click",".js-dropdown-item",function(t){o._$filter.tvDropdown("close"),o._$filter.find(".js-dropdown-item.i-active").removeClass("i-active"),$(this).addClass("i-active")}),this._$filter.on("afterCloseMenu",function(){o.setValue(o._$filter.find(".js-dropdown-item.i-active").attr("data-name"))}),this._$filter.on("beforeOpenMenu",function(){o._$filter.find(".js-dropdown-item").each(function(){var t=$(this);t.toggleClass("i-active",t.attr("data-name")===o._value)})}),this.onChange=new i,this.setValue("all"),this._$filter.find('.js-dropdown-item[data-name="'+this._value+'"]').addClass("i-active")}var s,n=o(35).Study,a=o(77),l=o(1).LineDataSource;o(175),o(1287),o(1288),o(394), s='
{{#filters}}
{{title}}
{{/filters}}
',r.prototype.value=function(){return this._value},r.prototype.setValue=function(t){if(t!==this._value){this._value=t;var e=this._getActions().filter(function(e){return e.name===t})[0];this._$filter.find(".js-filter-title").text(e.title),this.onChange.fire(t)}},r.prototype.applyToGroup=function(t){var e,o,i,r,s;if("all"===this._value)return t;for(e=[],o=0;o{{#draggable}}
'+s+'
{{/draggable}}{{#treeNode}}
'+n+''+a+'
{{/treeNode}}{{^treeNode}}
{{/treeNode}}
{{#lockUnlockIcon}}'+l+'{{/lockUnlockIcon}}{{#showHideIcon}}'+c+"{{/showHideIcon}}{{^treeNode}}"+(e.enabled("property_pages")?''+d+"":"")+'{{/treeNode}}'+h+"
",r.prototype.setItemActivateListener=function(t){this._itemActivateCallback=t},r.prototype.setNodeExpandCollapseCallback=function(t){ this._nodeExpandCollapseCallback=t},r.prototype.setNodeRemoveCallback=function(t){this._nodeRemoveCallback=t},r.prototype.activateItem=function(t,e,o){o&&o.originalEvent.defaultPrevented||(this._$activeItem&&0!==this._$activeItem.length&&this._$activeItem.removeClass("i-active"),this._$activeItem=t,this._$activeItem&&0!==this._$activeItem.length&&this._$activeItem.addClass("i-active"),this._itemActivateCallback&&this._itemActivateCallback(e))},r.prototype.createSortableForItemsList=function(t,e,o){m(t).sortable({scroll:!0,scrollSensitivity:100,scrollSpeed:100,axis:"y",handle:".js-drag-icon",placeholder:"tv-objects-tree-item tv-objects-tree-item--placeholder",start:e,stop:o})},r.prototype.createTreeNodeItem=function(t,e,o){var r,s=$(i.render(u,{draggable:!1,lockUnlockIcon:!1,formatIcon:!1,showHideIcon:!1,treeNode:!0,title:t,wideTitle:!0}));return this.updateNodeItem(s,t,e,o),s.click(this._onNodeToggleExpandCollapse.bind(this,s,t)),r=s.find(".js-remove-btn").attr("title",$.t("Delete all drawing for this symbol")),r.click(function(e){e.preventDefault(),this._nodeRemoveCallback&&this._nodeRemoveCallback(s,t)}.bind(this)),s},r.prototype.createItem=function(t,e){var o,r,s;return e=e||{},o=t.datasource,r=!1,s=$(i.render(u,{draggable:e.draggable,lockUnlockIcon:e.lockUnlock,showHideIcon:e.showHide,editAlert:r,treeNode:!1,largeLeftPadding:e.largeLeftPadding})),this.updateItem(s,t),s.click(this.activateItem.bind(this,s,o)),o.userEditEnabled()&&(e.lockUnlock&&this._setupLockUnlockButton(s.find(".js-lock-unlock-btn"),o),e.showHide&&this._setupItemPropertyButton(s.find(".js-show-hide-btn"),o,"visible",$.t("Show/Hide"),"Show/Hide ",!0),r&&this._setupEditAlertButton(s.find(".js-edit-alert-btn"),o),this._setupFormatButton(s.find(".js-format-btn"),o),this._canShowEditObjectDialog(o)&&(s.dblclick(function(){v(o,this._chartModel)}.bind(this)),e.addContextMenu&&s.on("contextmenu",function(t){this._showContextMenu(t,o),t.preventDefault()}.bind(this))),this._setupItemRemoveButton(s.find(".js-remove-btn"),o)),s},r.prototype.updateNodeItem=function(t,e,o,i){var r=t.find(".js-title-container");r.toggleClass("i-bold",i.isCurrent),r[0].innerHTML=e+" ("+o.length+")"},r.prototype.updateItem=function(t,e){t.find(".js-title-container")[0].innerHTML=TradingView.clean($.t(e.name)),this._setDataSourceIcon(t,e.datasource),this._setItemVisible(t,e.datasource)},r.prototype._showContextMenu=function(t,o){if(e.enabled("objects_tree_context_menu")){this._chartWidget.paneByState(this._chartModel.paneForSource(o)).showContextMenuForSource(o,t)}},r.prototype._canShowEditObjectDialog=function(t){return!(t instanceof p&&!t.isActualSymbol())&&((t!==this._chartModel.mainSeries()||!this._chartWidget||!this._chartWidget.onWidget())&&(_.hasStylesPropertyPage(t)||_.hasInputsPropertyPage(t)))},r.prototype._setupLockUnlockButton=function(t,e){TradingView.isInherited(e.constructor,p)?this._setupItemPropertyButton(t,e,"frozen",$.t("Lock/Unlock"),"Lock/Unlock ",!1):t.addClass("i-hidden")},r.prototype._setupEditAlertButton=function(t,e){}, r.prototype._setupFormatButton=function(t,e){if(!this._canShowEditObjectDialog(e))return void t.addClass("i-hidden");t.attr("title",$.t("Format")).click(function(){v(e,this._chartModel)}.bind(this))},r.prototype._setItemVisible=function(t,e){var o=e.properties().visible.value();t.toggleClass("i-prop-hidden",!o)},r.prototype._setDataSourceIcon=function(t,e){var o,i=t.find(".js-icon-container").empty();i.removeClass("i-text-icon i-empty"),o=e.getSourceIcon(),null===o?i.addClass("i-empty"):"svg"===o.type?$(o.svgCode).attr({width:20,height:20}).appendTo(i):"text"===o.type&&(i.addClass("i-text-icon"),i.text(o.text)),t.prepend(i)},r.prototype._onItemPropertyButtonClicked=function(t,e){this._chartModel.setProperty(t,!t.value(),e)},r.prototype._onItemPropertyChanged=function(t,e,o){t.toggleClass("i-active",e?!o.value():o.value())},r.prototype._syncStateAndSubscribe=function(t,e,o){e.subscribe(null,this._onItemPropertyChanged.bind(this,t,o)),this._onItemPropertyChanged(t,o,e)},r.prototype._setupItemPropertyButton=function(t,e,o,i,r,s){t.attr("title",i).click(function(t){this._onItemPropertyButtonClicked(e.properties()[o],r+e.title())}.bind(this)),this._syncStateAndSubscribe(t,e.properties()[o],s)},r.prototype._setupItemRemoveButton=function(t,e){e!==this._chartModel.mainSeries()&&e.isUserDeletable()?t.attr("title",$.t("Delete")).click(function(t){t.preventDefault(),this._chartModel.removeSource(e)}.bind(this)):t.addClass("i-transparent")},r.prototype._onNodeToggleExpandCollapse=function(t,e){var o="i-expanded",i=t.hasClass(o);t.toggleClass(o,!i),this._nodeExpandCollapseCallback&&this._nodeExpandCollapseCallback(t,e,!i)},t.exports.ObjectTreeItemsController=r}).call(e,o(5),o(41))},1290:function(t,e){},1291:function(t,e){t.exports=''},1292:function(t,e){t.exports=''},1293:function(t,e){t.exports=''},1294:function(t,e){ t.exports=''},1295:function(t,e){t.exports=''},1296:function(t,e){},1297:function(t,e){},1298:function(t,e,o){"use strict";function i(t,e,o,i,s){r.call(this,t,e,o,i),this._clearRemoveNodeTimerId=null,this._$emptyListMessage=$('
').text($.t("No drawings yet")),this._$emptyListMessage.appendTo(this._$tabContainer),this._$totalValueContainer=$("
").appendTo(s)}var r=o(1247);o(1299),inherit(i,r),i.prototype.destroy=function(){this._clearRemoveNodeTimer(),r.prototype.destroy.call(this)},i.prototype.initView=function(){this._listAccessor().setNodeExpandCollapseCallback(this._renderViewForSymbol.bind(this)),this._listAccessor().setNodeRemoveCallback(this._onNodeRemoveClick.bind(this)),r.prototype.initView.call(this)},i.prototype._clearRemoveNodeTimer=function(){clearInterval(this._clearRemoveNodeTimerId),this._clearRemoveNodeTimerId=null},i.prototype._renderViewForSymbol=function(t,e,o){var i,r,s,n,a,l="tv-manage-drawings-tab__symbol-drawings";if(t.next().hasClass(l))return t.next().toggleClass("i-expanded",o),void this._scroll.updateScrollBar();for(i=$('
'),r=this._symbolDrawingsMap[e],s=0;s