(window.webpackJsonp=window.webpackJsonp||[]).push([["editobjectdialog"],{KFNk:function(t,e,i){},Kqsj:function(t,e,i){"use strict";(function(t){function o(t,e,i){this._source=t,this._model=e,this._undoCheckpoint=i}var a,n,r,s,l,p,c,d,u,h;i("jgM0"),i("KFNk"),i("pay7"),i("ohga"),a=i("Ss5c").LineDataSource,n=i("GVHu").Study,r=i("qJq3").Series,s=i("fgLi").DataSource,l=i("FQhm"),p=i("bR4N").bindPopupMenu,c=i("QloM"),d=i("GAqT").TVOldDialogs,u=i("PC8g").trackEvent,h=i("CW80").isLineTool,i("PVgW"),o.prototype.hide=function(t){d.destroy(this._dialogTitle,{undoChanges:!!t})},o.prototype._onDestroy=function(t,e){var i,o,a=(e||{}).undoChanges;$(window).unbind("keyup.hidePropertyDialog"),a?(i=this._undoCheckpoint?this._undoCheckpoint:this._undoCheckpointOnShow)&&this._model.undoToCheckpoint(i):this._source.hasAlert.value()&&(o=this._source,setTimeout(function(){o.localAndServerAlersMismatch&&o.synchronizeAlert(!0)})),this._undoCheckpointOnShow&&delete this._undoCheckpointOnShow,window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.refresh()},o.prototype.isVisible=function(){return this._dialog&&this._dialog.is(":visible")},o.prototype.focusOnText=function(){this._dialog.find('input[type="text"]').focus().select()},o.prototype.switchTab=function(t,e){var i,o;if(this._tabs)return i=null,t?t=t.valueOf():null===t&&(t=void 0),"string"==typeof t&&$.each(this._tabs,function(e,o){if(o.name===t)return i=o,!1}),"object"==typeof t&&$.each(this._tabs,function(e,o){if(t===o||$(o.labelObject).is(t)||$(o.wrapperObject).is(t))return i=o,!1}),i||(i=this._tabs[~~t]),!!i&&($.each(this._tabs,function(t,e){var o=e===i;$(e.wrapperObject)[o?"show":"hide"](),$(e.labelObject)[o?"addClass":"removeClass"]("active")}),e&&(o=this.activeTabSettingsName())&&TVSettings.setValue(o,i.name),this._dialog.height()+100>$(window).height()&&!i.isScrollable&&this.makeScrollable(i),$(":focus").blur(),!0)},o.prototype.makeScrollable=function(t){var e=t.wrapperObject,i=$(t.objects[0]),o=i.width();e.css({height:$(window).height()/1.4,overflow:"auto"}),i.css("width",o+20),t.isScrollable=!0},o.prototype.appendToTab=function(t,e,i,o,a,n){var r,s;$(t).is("table")&&!$(t).find("tr").size()||(this._tabs||(this._tabs=[]),$.each(this._tabs,function(t,i){if(i.name===e)return r=t,!1}),void 0===r&&(this._tabs.push({name:e,localizedName:$.t(e),objects:$(),displayPriority:0,defaultOpen:0,isButton:!!a,callback:a?n||function(){}:null}),r=this._tabs.length-1),(s=this._tabs[r]).objects=s.objects.add(t),s.displayPriority=Math.max(s.displayPriority||0,i||0),s.defaultOpen=Math.max(s.defaultOpen||0,o||0))},o.prototype.insertTabs=function(){function t(t){a&&a.toLowerCase()===t.name.toLowerCase()&&(t.defaultOpen=Math.max(~~t.defaultOpen,c.TabOpenFrom.UserSave)),(!i||~~i.defaultOpen<~~t.defaultOpen)&&(i=t),t.labelObject=$('').text(t.localizedName).appendTo(e._tabContainer),t.labelObject.on("mousedown",function(t){function i(t){var e;n=n||(e=t,Math.abs(o-e.pageX)>5||Math.abs(a-e.pageY)>5)}var o=t.pageX,a=t.pageY,n=!1,r=this ;$(r).on("mousemove",i),$(r).one("mouseup",function(){n||e.switchTab(r,!0),$(r).off("mousemove",i)})});var o=$('
');t.wrapperObject=$().add(o),t.objects.each(function(e,i){var a=$(i);a.is("table")?(a.data("layout-separated")&&(t.wrapperObject=t.wrapperObject.add('
').add(o=$('
')),a.removeData("layout-separated")),o.append(a),a.children("tbody").each(function(e,a){if(0!==e&&$(a).data("layout-separated")){t.wrapperObject=t.wrapperObject.add('
').add(o=$('
'));var n=$(i).clone(!0,!1).appendTo(o);n.children().remove(),n.append(a),$(a).removeData("layout-separated")}})):o.append(a)}),t.wrapperObject.appendTo(e._container)}var e,i,o,a;this._tabs&&(this._tabs.sort(function(t,e){return(e.displayPriority||0)-(t.displayPriority||0)}),e=this,i=null,(o=this.activeTabSettingsName())&&(a=TVSettings.getValue(o)),$.each(this._tabs,function(i,o){var a;o.isButton?((a=o).labelObject=$('').text(a.localizedName).appendTo(e._tabContainer),a.labelObject.bind("click",a.callback)):t(o)}),this.switchTab(i))},o.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 n?"properties_dialog.active_tab.study":void 0},o.prototype.show=function(e){function o(t,e){g.hide(!!e)}var b,f,_,y,g,m,T,v,w,P,C,S,O,k,D,x,j,I,N,L,B,V,R,F,A;if(t.enabled("property_pages")&&(b=i("kSsA"),f=(e=e||{}).onWidget||!1,_=null,TradingView.isInherited(this._source.constructor,r)&&(_="series-properties-dialog",u("GUI","Series Properties")),TradingView.isInherited(this._source.constructor,n)&&(_="indicator-properties-dialog",y=!this._source.isPine()||this._source.isStandardPine()?this._source.metaInfo().description:"Custom Pine",u("GUI","Study Properties",y)),h(this._source)&&(_="drawing-properties-dialog",u("GUI","Drawing Properties",this._source.name())),TradingView.isInherited(this._source.constructor,s)&&(g=this,this._model.selectionMacro(function(t){t.addSourceToSelection(g._source)})),m=b.createStudyStrategyPropertyPage(this._source,this._model),T=b.createInputsPropertyPage(this._source,this._model),v=b.createStylesPropertyPage(this._source,this._model),w=b.createVisibilitiesPropertyPage(this._source,this._model),P=b.createDisplayPropertyPage(this._source,this._model),T&&!T.widget().is(":empty")||v||m))return g=this,C=null!==T,S=this._source.title(),O=e.ownerDocument||this._model._chartWidget.widget().prop("ownerDocument"),k=d.createDialog(S,{hideTitle:!0,dragHandle:".properties-tabs",ownerDocument:O}).attr("data-dialog-type",_),D=k.find("._tv-dialog-content"),x=$('
').appendTo(D),j=[],I=400,this._tabs=j,this._dialog=k,this._dialogTitle=S,this._container=D,this._tabContainer=x,this._undoCheckpointOnShow=this._model.createUndoCheckpoint(), k.on("destroy",function(t,e){e=e||{};T&&T.destroy(),m&&m.destroy(),v&&v.destroy(),P&&P.destroy(),w&&w.destroy(),$("select",D).each(function(){$(this).selectbox("detach")}),g._onDestroy(t,e)}),!this._model.readOnly()&&m&&m.widget().each(function(t,e){var i,o,a=+$(e).data("layout-tab-priority");isNaN(a)&&(a=c.TabPriority.Properties),i=~~$(e).data("layout-tab-open"),void 0===(o=$(e).data("layout-tab"))&&(o=c.TabNames.properties),g.appendToTab(e,o,a,i)}),this._model.readOnly()||!C||T.widget().is(":empty")||T.widget().each(function(t,e){var o,a,n=i("n3Kh"),r=T instanceof n,s=+$(e).data("layout-tab-priority");TradingView.isNaN(s)&&(s=r?c.TabPriority.Coordinates:c.TabPriority.Inputs),o=~~$(e).data("layout-tab-open"),void 0===(a=$(e).data("layout-tab"))&&(a=r?c.TabNames.coordinates:c.TabNames.inputs),g.appendToTab(e,a,s,o)}),v&&v.widget().each(function(t,e){var o,a,n,r=+$(e).data("layout-tab-priority");TradingView.isNaN(r)&&(r=c.TabPriority.Style),o=~~$(e).data("layout-tab-open"),a=i("Yc1q"),!o&&v instanceof a&&(o=c.TabOpenFrom.Default),void 0===(n=$(e).data("layout-tab"))&&(n=c.TabNames.style),g.appendToTab(e,n,r,o)}),P&&P.widget().each(function(t,e){var i,o,a=+$(e).data("layout-tab-priority");TradingView.isNaN(a)&&(a=c.TabPriority.Display),i=~~$(e).data("layout-tab-open"),void 0===(o=$(e).data("layout-tab"))&&(o=c.TabNames.properties),g.appendToTab(e,o,a,i)}),w&&w.widget().each(function(t,e){g.appendToTab(e,c.TabNames.visibility,c.TabPriority.Display,!1)}),this._source instanceof n&&!!this._source.metaInfo().pine&&this._source.metaInfo(),this.insertTabs(),this._helpItemRequired()&&this._createHelp(),B=110,$(".js-dialog").each(function(){var t=parseInt($(this).css("z-index"),10);t>B&&(B=t)}),k.css("z-index",B),N=$('
').appendTo(D),L=$('
').appendTo(N),V=function(){w&&w.loadData(),T&&T.loadData()},(!f||window.is_authenticated)&&v&&"function"==typeof v.createTemplateButton&&t.enabled("linetoolpropertieswidget_template_button")?g._templateButton=v.createTemplateButton({popupZIndex:B,defaultsCallback:e.onResetToDefault,loadTemplateCallback:V}).addClass("tv-left").appendTo(L):TradingView.isInherited(this._source.constructor,n)?(R=[{title:$.t("Reset Settings"),action:e.onResetToDefault},{title:$.t("Save As Default"),action:function(){g._source.properties().saveDefaults()}}],(F=$(''+$.t("Defaults")+'')).on("click",function(t){t.preventDefault();var e=$(this);e.is(".active")||e.trigger("button-popup",[R,!0])}).appendTo(L),p(F,null,{direction:"down",event:"button-popup",notCloseOnButtons:!0,zIndex:B})):$(''+$.t("Defaults")+"").appendTo(L).click(e.onResetToDefault),$(''+$.t("OK")+"").appendTo(L).click(function(){g.hide()}),$(''+$.t("Cancel")+"").appendTo(L).on("click",function(t){o(0,!0)}),k.find("._tv-dialog-title a").on("click",o), $(window).bind("keyup.hidePropertyDialog",function(t){13===t.keyCode&&"textarea"!==t.target.tagName.toLowerCase()&&(g._templateButton&&g._templateButton.trigger("hide-popup"),g.hide())}),$("select",D).each(function(){var t=$(this),e="tv-select-container dialog";t.hasClass("tv-select-container-fontsize")&&(e+=" tv-select-container-fontsize"),t.selectbox({speed:100,classHolder:e})}),$('input[type="text"]',D).addClass("tv-text-input inset dialog"),$("input.ticker",D).TVTicker(),k.css("min-width",I+"px"),d.applyHandlers(k,e),A={top:($(window).height()-k.height())/2,left:($(window).width()-k.width())/2},v&&"function"==typeof v.dialogPosition&&(A=v.dialogPosition(A,k)||A),d.positionDialog(k,A),window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.hide(),l.emit("edit_object_dialog",{objectType:this._source===this._model.mainSeries()?"mainSeries":this._source instanceof a?"drawing":this._source instanceof n?"study":"other",scriptTitle:this._source.title()}),k},o.prototype._helpItemRequired=function(){return this._source._metaInfo&&!!this._source._metaInfo.helpURL},o.prototype._createHelp=function(){var t=$('');t.attr("href",this._source._metaInfo.helpURL),this._tabContainer.prepend(t)},o.prototype.dialogWidget=function(){return this._dialog},e.EditObjectDialog=o}).call(this,i("Kxc7"))},Yc1q:function(t,e,i){"use strict";function o(t){function e(e,i,o){t.call(this,e,i,o),this._linetool=o}return inherit(e,t),e.prototype.applyTemplate=function(t){this.model().applyLineToolTemplate(this._linetool,t,"Apply Drawing Template"),this.loadData()},e}function a(t,e,i){r.call(this,t,e),this._linetool=i}var n=i("DxCR"),r=n.PropertyPage,s=n.ColorBinding,l=i("jNEI").addColorPicker;inherit(a,r),a.prototype.createOneColorForAllLinesWidget=function(){var t=$("");return this.bindControl(new s(l(t),this._linetool.properties().collectibleColors,!0,this.model(),"Change All Lines Color",0)),{label:$(""+$.t("Use one color")+""),editor:t}},a.prototype.addOneColorPropertyWidget=function(t){var e=this.createOneColorForAllLinesWidget(),i=$("");i.append($("")).append(e.label).append(e.editor),i.appendTo(t)},(a=o(a)).createTemplatesPropertyPage=o,t.exports=a},n3Kh:function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e),this._linetool=i,this.prepareLayout()}var a=i("DxCR"),n=a.PropertyPage,r=a.GreateTransformer,s=a.LessTransformer,l=a.ToIntTransformer,p=a.SimpleStringBinder;i("PVgW"),inherit(o,n),o.BarIndexPastLimit=-5e4,o.BarIndexFutureLimit=15e3,o.prototype.bindBarIndex=function(t,e,i,a){var n=[l(t.value()),r(o.BarIndexPastLimit),s(o.BarIndexFutureLimit)];this.bindControl(this.createStringBinder(e,t,n,!0,i,a))},o.prototype.createPriceEditor=function(t){var e,i,o,a=this._linetool,n=a.ownerSource().formatter(),r=function(t){return n.format(t)},s=function(t){var e=n.parse(t);if(e.res)return null!=e.price?e.price:e.value},l=$("");return l.TVTicker({step:n._minMove/n._priceScale||1,formatter:r,parser:s}), t&&(e=[function(e){var i=s(e);return void 0===i?t.value():i}],i="Change "+a.title()+" point price",(o=this.createStringBinder(l,t,e,!1,this.model(),i)).addFormatter(function(t){return n.format(t)}),this.bindControl(o)),l},o.prototype._createPointRow=function(t,e,i){var o,a,n,r,s=$(""),l=$("");return l.html($.t("Price")+i),l.appendTo(s),(o=$("")).appendTo(s),this.createPriceEditor(e.price).appendTo(o),(a=$("")).html($.t("Bar #")),a.appendTo(s),(n=$("")).appendTo(s),(r=$("")).appendTo(n),r.addClass("ticker"),this.bindBarIndex(e.bar,r,this.model(),"Change "+this._linetool.title()+" point bar index"),s},o.prototype.prepareLayoutForTable=function(t){var e,i,o,a,n=this._linetool.points(),r=n.length;for(e=0;e1?" "+(e+1):"",this._createPointRow(i,o,a).appendTo(t))},o.prototype.prepareLayout=function(){this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.prepareLayoutForTable(this._table),this.loadData()},o.prototype.widget=function(){return this._table},o.prototype.createStringBinder=function(t,e,i,o,a,n){return new p(t,e,i,o,a,n)},t.exports=o},ohga:function(t,e,i){}}]);