(window.webpackJsonp=window.webpackJsonp||[]).push([["editobjectdialog"],{KFNk:function(t,e,i){},Kqsj:function(t,e,i){"use strict";(function(t){i("sZhh"),i("KFNk"),i("pay7"),i("ohga");var a=i("Ss5c").LineDataSource,o=i("GVHu").Study,r=i("qJq3").Series,n=i("fgLi").DataSource,s=i("FQhm"),l=i("bR4N").bindPopupMenu,p=i("QloM"),c=i("GAqT").TVOldDialogs,d=i("JWMC").trackEvent,u=i("CW80").isLineTool;function h(t,e,i){this._source=t,this._model=e,this._undoCheckpoint=i}i("PVgW"),h.prototype.hide=function(t){c.destroy(this._dialogTitle,{undoChanges:!!t})},h.prototype._onDestroy=function(t,e){var i=(e||{}).undoChanges;if($(window).unbind("keyup.hidePropertyDialog"),i){var a=this._undoCheckpoint?this._undoCheckpoint:this._undoCheckpointOnShow;a&&this._model.undoToCheckpoint(a)}else if(this._source.hasAlert&&this._source.hasAlert.value()){var o=this._source;setTimeout((function(){o.localAndServerAlertsMismatch&&o.synchronizeAlert(!0)}))}this._undoCheckpointOnShow&&delete this._undoCheckpointOnShow,window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.refresh()},h.prototype.isVisible=function(){return this._dialog&&this._dialog.is(":visible")},h.prototype.focusOnText=function(){this._dialog.find('input[type="text"]').focus().select()},h.prototype.switchTab=function(t,e){if(this._tabs){var i=null;if(t?t=t.valueOf():null===t&&(t=void 0),"string"==typeof t&&$.each(this._tabs,(function(e,a){if(a.name===t)return i=a,!1})),"object"==typeof t&&$.each(this._tabs,(function(e,a){if(t===a||$(a.labelObject).is(t)||$(a.wrapperObject).is(t))return i=a,!1})),i||(i=this._tabs[~~t]),!i)return!1;if($.each(this._tabs,(function(t,e){var a=e===i;$(e.wrapperObject)[a?"show":"hide"](),$(e.labelObject)[a?"addClass":"removeClass"]("active")})),e){var a=this.activeTabSettingsName();a&&TVSettings.setValue(a,i.name)}return this._dialog.height()+100>$(window).height()&&!i.isScrollable&&this.makeScrollable(i),$(":focus").blur(),!0}},h.prototype.makeScrollable=function(t){var e=t.wrapperObject,i=$(t.objects[0]),a=i.width();e.css({height:$(window).height()/1.4,overflow:"auto"}),i.css("width",a+20),t.isScrollable=!0},h.prototype.appendToTab=function(t,e,i,a,o,r){if(!$(t).is("table")||$(t).find("tr").size()){var n;this._tabs||(this._tabs=[]),$.each(this._tabs,(function(t,i){if(i.name===e)return n=t,!1})),void 0===n&&(this._tabs.push({name:e,localizedName:$.t(e),objects:$(),displayPriority:0,defaultOpen:0,isButton:!!o,callback:o?r||function(){}:null}),n=this._tabs.length-1);var s=this._tabs[n];s.objects=s.objects.add(t),s.displayPriority=Math.max(s.displayPriority||0,i||0),s.defaultOpen=Math.max(s.defaultOpen||0,a||0)}},h.prototype.insertTabs=function(){if(this._tabs){this._tabs.sort((function(t,e){return(e.displayPriority||0)-(t.displayPriority||0)}));var t=this,e=null,i=this.activeTabSettingsName();if(i)var a=TVSettings.getValue(i);$.each(this._tabs,(function(e,i){var a;i.isButton?((a=i).labelObject=$('').text(a.localizedName).appendTo(t._tabContainer), a.labelObject.bind("click",a.callback)):o(i)})),this.switchTab(e)}function o(i){a&&a.toLowerCase()===i.name.toLowerCase()&&(i.defaultOpen=Math.max(~~i.defaultOpen,p.TabOpenFrom.UserSave)),(!e||~~e.defaultOpen<~~i.defaultOpen)&&(e=i),i.labelObject=$('').text(i.localizedName).appendTo(t._tabContainer),i.labelObject.on("mousedown",(function(e){var i=e.pageX,a=e.pageY,o=!1,r=this;function n(t){var e;o=o||(e=t,Math.abs(i-e.pageX)>5||Math.abs(a-e.pageY)>5)}$(r).on("mousemove",n),$(r).one("mouseup",(function(){o||t.switchTab(r,!0),$(r).off("mousemove",n)}))}));var o=$('
');i.wrapperObject=$().add(o),i.objects.each((function(t,e){var a=$(e);a.is("table")?(a.data("layout-separated")&&(i.wrapperObject=i.wrapperObject.add('').add(o=$('')),a.removeData("layout-separated")),o.append(a),a.children("tbody").each((function(t,a){if(0!==t&&$(a).data("layout-separated")){i.wrapperObject=i.wrapperObject.add('').add(o=$(''));var r=$(e).clone(!0,!1).appendTo(o);r.children().remove(),r.append(a),$(a).removeData("layout-separated")}}))):o.append(a)})),i.wrapperObject.appendTo(t._container)}},h.prototype.activeTabSettingsName=function(){var t=this._source;if(t)return t instanceof r?"properties_dialog.active_tab.chart":t instanceof a?"properties_dialog.active_tab.drawing":t instanceof o?"properties_dialog.active_tab.study":void 0},h.prototype.show=function(e){if(t.enabled("property_pages")){var h=i("kSsA"),f=(e=e||{}).onWidget||!1,b=null;if(TradingView.isInherited(this._source.constructor,r)&&(b="series-properties-dialog",d("GUI","Series Properties")),TradingView.isInherited(this._source.constructor,o)){b="indicator-properties-dialog";var _=!this._source.isPine()||this._source.isStandardPine()?this._source.metaInfo().description:"Custom Pine";d("GUI","Study Properties",_)}if(u(this._source)&&(b="drawing-properties-dialog",d("GUI","Drawing Properties",this._source.name())),TradingView.isInherited(this._source.constructor,n)){var v=this;this._model.selectionMacro((function(t){t.addSourceToSelection(v._source)}))}var y=h.createInputsPropertyPage(this._source,this._model),g=h.createStylesPropertyPage(this._source,this._model),m=h.createVisibilitiesPropertyPage(this._source,this._model),T=h.createDisplayPropertyPage(this._source,this._model);if(y&&!y.widget().is(":empty")||g){v=this;var w,P,S=null!==y,C=this._source.title(),k=e.ownerDocument||this._model._chartWidget.widget().prop("ownerDocument"),D=c.createDialog(C,{hideTitle:!0,dragHandle:".properties-tabs",ownerDocument:k}).attr("data-dialog-type",b),O=D.find("._tv-dialog-content"),x=$('').appendTo(O);if(this._tabs=[],this._dialog=D,this._dialogTitle=C,this._container=O,this._tabContainer=x,this._undoCheckpointOnShow=this._model.createUndoCheckpoint(),D.on("destroy",(function(t,e){e=e||{};y&&y.destroy(), g&&g.destroy(),T&&T.destroy(),m&&m.destroy(),$("select",O).each((function(){$(this).selectbox("detach")})),v._onDestroy(t,e)})),this._model.readOnly()||!S||y.widget().is(":empty")||y.widget().each((function(t,e){var a=i("n3Kh"),o=y instanceof a,r=+$(e).data("layout-tab-priority");TradingView.isNaN(r)&&(r=o?p.TabPriority.Coordinates:p.TabPriority.Inputs);var n=~~$(e).data("layout-tab-open"),s=$(e).data("layout-tab");void 0===s&&(s=o?p.TabNames.coordinates:p.TabNames.inputs),v.appendToTab(e,s,r,n)})),g&&g.widget().each((function(t,e){var a=+$(e).data("layout-tab-priority");TradingView.isNaN(a)&&(a=p.TabPriority.Style);var o=~~$(e).data("layout-tab-open"),r=i("Yc1q");!o&&g instanceof r&&(o=p.TabOpenFrom.Default);var n=$(e).data("layout-tab");void 0===n&&(n=p.TabNames.style),v.appendToTab(e,n,a,o)})),T&&T.widget().each((function(t,e){var i=+$(e).data("layout-tab-priority");TradingView.isNaN(i)&&(i=p.TabPriority.Display);var a=~~$(e).data("layout-tab-open"),o=$(e).data("layout-tab");void 0===o&&(o=p.TabNames.properties),v.appendToTab(e,o,i,a)})),m&&m.widget().each((function(t,e){v.appendToTab(e,p.TabNames.visibility,p.TabPriority.Display,!1)})),this._source instanceof o&&!!this._source.metaInfo().pine)this._source.metaInfo();this.insertTabs(),this._helpItemRequired()&&this._createHelp();var I=110;$(".js-dialog").each((function(){var t=parseInt($(this).css("z-index"),10);t>I&&(I=t)})),D.css("z-index",I),w=$('').appendTo(O),P=$('