").appendTo(r)}var s=o(299);o(505),inherit(i,s),i.prototype.destroy=function(){this._clearRemoveNodeTimer(),s.prototype.destroy.call(this)},i.prototype.initView=function(){this._listAccessor().setNodeExpandCollapseCallback(this._renderViewForSymbol.bind(this)),
this._listAccessor().setNodeRemoveCallback(this._onNodeRemoveClick.bind(this)),s.prototype.initView.call(this)},i.prototype._clearRemoveNodeTimer=function(){clearInterval(this._clearRemoveNodeTimerId),this._clearRemoveNodeTimerId=null},i.prototype._renderViewForSymbol=function(t,e,o){var i,s,r,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=$('
'),s=this._symbolDrawingsMap[e],r=0;r
{{#draggable}}'+r+'
{{/draggable}}{{#treeNode}}'+n+''+a+'
{{/treeNode}}{{^treeNode}}{{/treeNode}}{{#lockUnlockIcon}}'+l+'{{/lockUnlockIcon}}{{#showHideIcon}}'+c+"{{/showHideIcon}}{{^treeNode}}"+(e.enabled("property_pages")?''+d+"":"")+'{{/treeNode}}'+h+"
",s.prototype.setItemActivateListener=function(t){this._itemActivateCallback=t},s.prototype.setNodeExpandCollapseCallback=function(t){this._nodeExpandCollapseCallback=t},s.prototype.setNodeRemoveCallback=function(t){this._nodeRemoveCallback=t},s.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))},s.prototype.createSortableForItemsList=function(t,e,o){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})},s.prototype.createTreeNodeItem=function(t,e,o){var s,r=$(i.render(p,{draggable:!1,lockUnlockIcon:!1,formatIcon:!1,showHideIcon:!1,treeNode:!0,title:t,wideTitle:!0}));return this.updateNodeItem(r,t,e,o),r.click(this._onNodeToggleExpandCollapse.bind(this,r,t)),s=r.find(".js-remove-btn").attr("title",$.t("Delete all drawing for this symbol")),s.click(function(e){e.preventDefault(),this._nodeRemoveCallback&&this._nodeRemoveCallback(r,t)}.bind(this)),r},s.prototype.createItem=function(t,e){var o,s
;return e=e||{},o=$(i.render(p,{draggable:e.draggable,lockUnlockIcon:e.lockUnlock,showHideIcon:e.showHide,treeNode:!1,largeLeftPadding:e.largeLeftPadding})),this.updateItem(o,t),s=t.datasource,o.click(this.activateItem.bind(this,o,s)),s.userEditEnabled()&&(e.lockUnlock&&this._setupLockUnlockButton(o.find(".js-lock-unlock-btn"),s),e.showHide&&this._setupItemPropertyButton(o.find(".js-show-hide-btn"),s,"visible",$.t("Show/Hide"),"Show/Hide ",!0),this._setupFormatButton(o.find(".js-format-btn"),s),this._canShowEditObjectDialog(s)&&(o.dblclick(this._showEditObjectDialog.bind(this,s)),e.addContextMenu&&o.on("contextmenu",function(t){this._showContextMenu(t,s),t.preventDefault()}.bind(this))),this._setupItemRemoveButton(o.find(".js-remove-btn"),s)),o},s.prototype.updateNodeItem=function(t,e,o,i){var s=t.find(".js-title-container");s.toggleClass("i-bold",i.isCurrent),s[0].innerHTML=e+" ("+o.length+")"},s.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)},s.prototype._showContextMenu=function(t,o){if(e.enabled("objects_tree_context_menu")){this._chartWidget.paneByState(this._chartModel.paneForSource(o)).showContextMenuForSource(o,t)}},s.prototype._canShowEditObjectDialog=function(t){return!(t instanceof u&&!t.isActualSymbol())&&((t!==this._chartModel.mainSeries()||!this._chartWidget||!this._chartWidget.onWidget())&&(m.hasStylesPropertyPage(t)||m.hasInputsPropertyPage(t)))},s.prototype._showEditObjectDialog=function(t){new v(t,this._chartModel).show()},s.prototype._setupLockUnlockButton=function(t,e){TradingView.isInherited(e.constructor,u)?this._setupItemPropertyButton(t,e,"frozen",$.t("Lock/Unlock"),"Lock/Unlock ",!1):t.addClass("i-hidden")},s.prototype._setupFormatButton=function(t,e){if(!this._canShowEditObjectDialog(e))return void t.addClass("i-hidden");t.attr("title",$.t("Format")).click(this._showEditObjectDialog.bind(this,e))},s.prototype._setItemVisible=function(t,e){var o=e.properties().visible.value();t.toggleClass("i-prop-hidden",!o)},s.prototype._setDataSourceIcon=function(t,e){var o,i,s,r,n,a,l=t.find(".js-icon-container").empty();l.removeClass("i-text-icon i-empty"),o=e instanceof u,i=e instanceof _,s=e===this._chartModel.mainSeries(),o&&!i||s?(r=null,s?r=g[e.properties().style.value()]:(n=b[e.getType()])&&(r=n.icon),r?$(r).attr({width:20,height:20}).appendTo(l):l.addClass("i-empty")):i?(a=e.properties().icon.value(),l.addClass("i-text-icon"),l.text(String.fromCharCode(a))):l.addClass("i-empty"),t.prepend(l)},s.prototype._onItemPropertyButtonClicked=function(t,e){this._chartModel.setProperty(t,!t.value(),e)},s.prototype._onItemPropertyChanged=function(t,e,o){t.toggleClass("i-active",e?!o.value():o.value())},s.prototype._syncStateAndSubscribe=function(t,e,o){e.subscribe(null,this._onItemPropertyChanged.bind(this,t,o)),this._onItemPropertyChanged(t,o,e)},s.prototype._setupItemPropertyButton=function(t,e,o,i,s,r){t.attr("title",i).click(function(t){
this._onItemPropertyButtonClicked(e.properties()[o],s+e.title())}.bind(this)),this._syncStateAndSubscribe(t,e.properties()[o],r)},s.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")},s.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=s}).call(e,o(3),o(30))},655:function(t,e,o){(function(e,i){"use strict";function s(t){this._$filter=$(e.render(r,{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 r,n=o(31).Study,a=o(42),l=o(1).LineDataSource;o(137),o(518),o(509),o(261),r='
',s.prototype.value=function(){return this._value},s.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)}},s.prototype.applyToGroup=function(t){var e,o,i,s,r;if("all"===this._value)return t;for(e=[],o=0;o
u?i.item.next():i.item.prev(),r=this._getSourceIdForItem(i.item),n=this._getSourceIdForItem(s),a=-1,l=-1,c=0;cl?1:-1,c=0;c=0;--i)s=o.children[i],r=this._getItemForSourceId(s.datasource.id()),0!==r.length&&this._listAccessor().updateItem(r,s)},i._groupRenderSize=50,i.prototype._renderGroup=function(t){var e,o;t=t||{},e=0,o=setInterval(function(){var s=t.items.slice(e,e+i._groupRenderSize);s.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,s.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,s,r="studies"!==this._filter.value()&&this._items.drawings.length;for(this._fillListGroupsCount=0,e=this._getItems().groups,o=0;o').appendTo(this._$contentWrapper),this._addSortableToList(s,e[o].children),i.reverse(),this._renderGroup({showLocks:r,callback:t,items:i,$group:s}),this._fillListGroupsCount++)},t.exports=i},840:function(t,e){t.exports=''},841:function(t,e){t.exports=''},842:function(t,e){
t.exports=''},843:function(t,e){t.exports=''},844:function(t,e){t.exports=''}});