/* Your license agreement requires the use of the Modulus LicensePing.com licensing mechanism. The mechanism monitors the usage and distribution patterns of our intellectual property. If the usage or distribution patterns indicate that our licensing mechanism has either been removed, altered, tampered with or that our intellectual property may be misused in any form, our legal team may initiate contact with you to investigate the matter further. Removal or modification of this license mechanism by any means whatsoever (editing the code, removing the LicensePing.com URL reference, etc.) constitutes willful and criminal copyright infringement in addition to giving rise to claims by Modulus Financial Engineering, Inc. against you, as the developer, and your company as a whole for, among others: (1) Copyright Infringement; (2) False Designation of Origin; (3) Breach of Contract; (4) Misappropriation of Trade Secrets; (5) Interference with Contract; and (6) Interference with Prospective Business Relations. 17 USC 506 - Criminal offenses (a) Criminal Infringement. Any person who willfully infringes a copyright shall be punished as provided under section 2319 of title 18, if the infringement was committed for purposes of commercial advantage or private financial gain. 18 USC 2319 - Criminal infringement of a copyright (a) Any person who commits an offense under section 506 (a)(1)(A) of title 17 shall be imprisoned not more than 5 years, or fined in the amount set forth in this title (up to $150,000), or both, if the offense consists of the reproduction or distribution, including by electronic means, during any 180-day period, of at least 10 copies, of 1 or more copyrighted works, which have a total retail value of more than $2,500. For more information, review the license agreement associated with this software and source code at http://www.modulusfe.com/support/license.pdf or contact us at legal@modulusfe.com.*/
var StockChartX
!function(e){!function(e){jQuery.fn.scx=function(){var i=this
return{chartContextMenu:function(t){return new e.ChartContextMenu(i,t)},chartNavigation:function(t){return new e.ChartNavigation({target:i,chart:t})},colorPicker:function(t){return new e.ColorPicker(i,t)},indicatorContextMenu:function(t){return new e.IndicatorContextMenu(i,t)},instrumentSearch:function(t){return new e.InstrumentSearch(i,t)},numericField:function(e){return i.scxNumericField(e)},timeFramePicker:function(t){return new e.TimeFramePicker(i,t)},toolbar:function(t){return new e.Toolbar({parent:i,chart:t})},toolbarDropDownButton:function(t){return new e.ToolbarDropDownButton(i,t)},waitingBar:function(){return new e.WaitingBar(i)}}}}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(e){function i(e){return d(e).data(u)}function t(e,i,t){function s(){e.is("[disabled]")||(n(e,o(e)+l,!0),a=setTimeout(s,200))}var a,l
d(window).on("mouseup",function(){clearTimeout(a),l=0}),i.on("mousedown",function(){l=1,s()}),t.on("mousedown",function(){l=-1,s()})}function n(e,t,n){void 0===n&&(n=!1)
var o=i(e).settings
return"-"===t?t=o.canBeNegative?t:"":(!o.canBeNegative&&0>t&&(t=0),n&&(null!=o.minValue&&to.maxValue&&(t=o.maxValue)),"function"==typeof o.onChange&&o.value!==t&&o.onChange(t,e),o.value=t,n=o.priceDecimals,o="(\\d)(?=(\\d{3})+"+(0'),t=d('
'),n=d('
'),o=e.outerHeight(!0)
return i.height(o),t.height(o-2),n.height(o-2),e.css("padding-right",40),i.append(e).append(t).append(n),t.css("padding-top",Math.floor(o/2-11)),n.css("padding-top",Math.floor(o/2-11)),h(t),h(n),{wrapper:i,field:e,arrowUp:t,arrowDown:n}}function _(e,i,t){var n=e.children().length-1
return 0<=t&&t<=n?e.children().eq(t).before(i):e.append(i),e}function h(e){return e.attr("unselectable","on").css("user-select","none").on("selectstart",function(){return!1})}var d=jQuery,u="scxNumericField",p={FIELD:"scxNumericField",FIELD_WRAPPER:"scxNumericField-wrapper",INVALID_VALUE:"scxNumericField-invalidValue",ARROW_WRAPPER:"scxNumericField-arrowWrapper",ARROW_UP:"scxNumericField-arrowUp",ARROW_DOWN:"scxNumericField-arrowDown",ARROW:"scxNumericFieldArrow"},g={init:function(e){return this.each(function(){var i=d(this),s="",a=0
if(i.attr("type","text").addClass(p.FIELD),i.data(u,{target:i,settings:d.extend(!0,{canBeNegative:!1,priceDecimals:0,showArrows:!1,maxValue:null,minValue:null,value:0,onChange:null},e)}),e.showArrows){var l=i.parent(),h=i.index(),g=c(i)
_(l,g.wrapper,h),i=g.field,t(i,g.arrowUp,g.arrowDown)}i.on("input",function(){var i=d(this),t=i[0].selectionStart,l=o(i,s),c="."===i.val()
if(0===e.priceDecimals&&""===i.val())return void(s=null!=e.minValue&&0t&&nt&&no&&(n.height(o-20),s=o),2>o/s&&(a=o/2-s/2),{postiion:"fixed",top:a,left:e-i(window).scrollLeft()}},e._getSubMenuTopLocation=function(e){var i=e.parent().offset().top,t=e.offset().top
e.find(".scxSubMenu").css({top:t-i-5+"px"})},e}()
e.ContextMenu=t}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={}))
var __extends=this&&this.__extends||function(e,i){function t(){this.constructor=e}for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])
e.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t)}
!function(e){!function(i){var t={FORMAT:"format"}
Object.freeze(t)
var n=function(n){function o(e,t){var s=this
n.call(this,t,e),this._menuItems={},i.HtmlLoader.getView("ChartContextMenu.html",function(e){o._container||(o._container=i.HtmlContainer.instance.register("ChartContextMenu",e)),s._initMenu(t)})}return __extends(o,n),o.prototype._initMenu=function(i){var t=this
this._defineMenuItems(),i.menuContainer=o._container,i.onShow=function(){switch(i.chart.priceStyleKind){case e.BarPriceStyle.className:case e.HLBarPriceStyle.className:case e.HLCBarPriceStyle.className:case e.ColoredHLBarPriceStyle.className:case e.ColoredHLCBarPriceStyle.className:case e.ColoredBarPriceStyle.className:case e.KagiPriceStyle.className:case e.LineBreakPriceStyle.className:case e.PointAndFigurePriceStyle.className:case e.RenkoPriceStyle.className:t._menuItems.priceStyleFormat.removeClass("disabled")
break
default:t._menuItems.priceStyleFormat.addClass("disabled")}}},o.prototype._defineMenuItems=function(){this._menuItems.priceStyleFormat=o._container.find("[data-id=format]")},o._container=null,o.MenuItem=t,o}(i.ContextMenu)
i.ChartContextMenu=n}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(i){var t=jQuery,n=function(){function i(i){this._config=i,this._activeIndex=0,this._tabs=i.tabsContainer.children().removeClass("active"),this._panels=i.panelsContainer.children().removeClass("active"),this._config.activeIndex&&e.JsUtil.isNumber(this._config.activeIndex)&&(this._activeIndex=this._config.activeIndex),this._tabs.eq(this._activeIndex).addClass("active"),this._panels.eq(this._activeIndex).addClass("active"),this._tabs.css("width",100/this._tabs.length+"%"),this._tabs.on("click",this,this._onItemClicked)}return i.prototype.activate=function(i,t){i!=this._activeIndex&&(this._tabs.eq(this._activeIndex).removeClass("active"),this._panels.eq(this._activeIndex).removeClass("active"),this._tabs.eq(i).addClass("active"),this._panels.eq(i).addClass("active"),this._activeIndex=i),t&&e.JsUtil.isFunction(this._config.onChange)&&this._config.onChange(i)},i.prototype.activeIndex=function(){return this._activeIndex},i.prototype.destroy=function(){this._tabs.off("click",this._onItemClicked)},i.prototype._onItemClicked=function(e){e.data.activate(t(e.target).index(),!0)},i}()
i.Tabs=n}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(e){var i=jQuery,t=function(){function t(e){var t=this
this._isShown=!1,this._dialog=e,this._dialog.draggable({handle:".modal-header"}),this._dialog.attr("tabindex",-1),this._dialog.modal({backdrop:!0,keyboard:!0,show:!1}),this._dialog.on("hidden.bs.modal",function(){t._isShown&&t.hide()}),this._initDialogContentObj(),i(window).on("resize",this,this._onWindowResize)}return t.prototype.show=function(i){e.HtmlContainer.instance.resetSelf(i.chart),this._isShown=!0,this._dialog.attr("style",""),this._dialog.modal("show"),this.resize()},t.prototype.hide=function(){this._isShown&&(this._isShown=!1,this._dialog.modal("hide"))},t.prototype.resetToDefault=function(){},t.prototype.resize=function(){this._adjustHeight()},t.prototype.destroy=function(){i(window).off("resize",this._onWindowResize)},t.prototype._initDialogContentObj=function(){var e=this._dialog.find("> .modal-dialog"),i=e.find("> .modal-content")
this._dialogContent={dialog:e,root:i,header:i.find("> .modal-header"),body:i.find("> .modal-body"),footer:i.find("> .modal-footer")}},t.prototype._onWindowResize=function(e){e=e.data,e._isShown&&e.resize()},t.prototype._adjustHeight=function(){this._dialogContent.body.css("height","auto")
var e=window.innerHeight,i=this._dialogContent.dialog.outerHeight(!0)
if(elabel"),this._checkboxes=this._selector.find("input[type=checkbox]"),this._labels.click(function(e){var i=$(e.currentTarget).find("input[type=checkbox]")
i.prop("checked",!i.prop("checked")),i.prop("checked")?$(e.currentTarget).addClass("active"):$(e.currentTarget).removeClass("active")}).each(function(e){$(e.currentTarget).find("input[type=checkbox]").prop("checked")?$(e.currentTarget).addClass("active"):$(e.currentTarget).removeClass("active")})},e}(),o=function(){function e(e){this.DATA_KIND="data-kind",this._config=e,this.setKind(i.TooltipContentKind.TEXT),this._config.buttons.on("click",this,this._onButtonClicked)}return e.prototype.destroy=function(){this._config.buttons.off("click",this._onButtonClicked)},e.prototype.getKind=function(){return this._kind},e.prototype.setKind=function(e,t){if(e==this._kind)return!1
switch(e){case i.TooltipContentKind.TEXT:this._config.panelImage.hide(),this._config.panelTextStyle.show(),this._config.panelText.show()
break
case i.TooltipContentKind.HTML:this._config.panelImage.hide(),this._config.panelTextStyle.hide(),this._config.panelText.show()
break
case i.TooltipContentKind.IMAGE:this._config.panelText.hide(),this._config.panelImage.show()
break
default:return!1}return this._highlightButton(e),this._kind=e,!!t&&this._config.onChange(e),!0},e.prototype._highlightButton=function(e){this._config.buttons.removeClass("active"),this._config.buttons.filter("["+this.DATA_KIND+'="'+e+'"]').addClass("active")},e.prototype._onButtonClicked=function(e){e.data.setKind($(e.target).data().kind,!0)},e}()}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),__extends=this&&this.__extends||function(e,i){function t(){this.constructor=e}for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])
e.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t)},function(e){!function(i){var t=function(i){function t(e){i.call(this,e),this._isApplyClicked=!1,this._levels=[],this._initFields(),this._init()}return __extends(t,i),t.prototype.show=function(e){this._config=e,this._setDrawingConfig(this._config.drawing),this._isApplyClicked=!1,this._setDialogFields(),i.prototype.show.call(this,e)},t.prototype.hide=function(){this._config=null,this._clearDialogFields(),i.prototype.hide.call(this)},t.prototype._init=function(){var i=this
$("body").bind("scxSwitcherChanged",function(t,n){var o=$(n.target),s=!!n.checked
if(o.is(i._chk_lineEnabledHTMLObj)){var a=$(n.target).index(".scxFibonacciDrawingDialog_chk_lineEnable")
i._setLineState(s,a)}o.is(i._chk_trendLineEnabledHTMLObj)&&i._setTrendLineState(s),o.is(i._chk_levelsValueEnabledHTMLObj)&&(i._showLevelValues=s,i._setLevelsState(s)),o.is(i._chk_levelsPriceEnabledHTMLObj)&&(i._setLabelState(i._label_levelPrices,s),i._showLevelPrices=s),o.is(i._chk_levelsPercentEnabledHTMLObj)&&(i._setLabelState(i._label_levelPercents,s),i._showLevelPercents=s),o.is(i._chk_linesReverseEnabledHTMLObj)&&(i._setLabelState(i._label_reverse,s),i._reverse=s),o.is(i._chk_extendLinesLeftEnabledHTMLObj)&&(i._setLabelState(i._label_extendLinesLeft,s),i._setLevelLinesExtension(s,e.FibonacciLevelLineExtension.RIGHT,e.FibonacciLevelLineExtension.LEFT)),o.is(i._chk_extendLinesRightEnabledHTMLObj)&&(i._setLabelState(i._label_extendLinesRight,s),i._setLevelLinesExtension(s,e.FibonacciLevelLineExtension.LEFT,e.FibonacciLevelLineExtension.RIGHT)),o.is(i._chk_extendLinesTopEnabledHTMLObj)&&(i._setLabelState(i._label_extendLinesTop,s),i._setLevelLinesExtension(s,e.FibonacciLevelLineExtension.BOTTOM,e.FibonacciLevelLineExtension.TOP)),o.is(i._chk_extendLinesBottomEnabledHTMLObj)&&(i._setLabelState(i._label_extendLinesBottom,s),i._setLevelLinesExtension(s,e.FibonacciLevelLineExtension.TOP,e.FibonacciLevelLineExtension.BOTTOM)),o.is(i._chk_backgroundEnabledHTMLObj)&&(i._setLabelState(i._label_background,s),i._showLevelBackgrounds=s)}),this._dialog.find("#scxFibonacciDrawingDialog_btn_resetToDefaults").on("click",function(){i.resetToDefaults()}),this._dialog.find("#scxFibonacciDrawingDialog_btn_save").on("click",function(){i._save()}),this._dialog.find("#scxFibonacciDrawingDialog_btn_apply").on("click",function(){i._apply()}),this._dialog.find(".scxFibonacciDrawingDialog_panel_addLinePanel").on("click",function(){i._addNewLinePanel()})},t.prototype._initFields=function(){this._title=this._dialog.find("#scxFibonacciDrawingDialog_title"),this._panelFigure=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure"),this._panelFigureLine=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_linePanel"),this._panelFigureTrendLinePanel=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_trendLinePanel"),this._panelFigureTrendLine=null,this._panelFigureLevelParametersPanel=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_levelParametersPanel"),this._panelFigureLevelParameters=null,this._panelFigureRetracementsOptionsPanel=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_retracementsOptionsPanel"),this._panelFigureRetracementsOptions=null,this._panelFigureLabelsParametersPanel=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_labelsParametersPanel"),this._panelFigureLabelsParameters=null,this._panelFigureBackgroundPanel=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_backgroundPanel"),this._label_background=this._label_levelPercents=this._label_levelPrices=this._label_levels=this._label_reverse=this._label_extendLinesBottom=this._label_extendLinesTop=this._label_extendLinesRight=this._label_extendLinesLeft=this._label_trendLine=this._levelsReverseEnabled=this._labelsHorEnabled=this._levelsExtendVerEnabled=this._levelsExtendHorEnabled=this._levelsPercentEnabled=this._levelsPriceEnabled=this._chk_backgroundEnabledHTMLObj=this._chk_extendLinesBottomEnabledHTMLObj=this._chk_extendLinesTopEnabledHTMLObj=this._chk_extendLinesRightEnabledHTMLObj=this._chk_extendLinesLeftEnabledHTMLObj=this._chk_linesReverseEnabledHTMLObj=this._chk_levelsPercentEnabledHTMLObj=this._chk_levelsPriceEnabledHTMLObj=this._chk_levelsValueEnabledHTMLObj=this._chk_trendLineEnabled=this._chk_trendLineEnabledHTMLObj=this._chk_lineEnabledHTMLObj=this._input_labelsTextPosition=this._input_labelsPosition=this._input_trendLineStyle=this._input_trendLineWidth=this._input_trendLineColor=this._input_lineStyle=this._input_lineWidth=this._input_lineColor=this._input_lineLevel=this._panelFigureBackground=null},t.prototype._setDialogFields=function(){this._generateTrendLine(),this._addLinePanel(),this._generateRetracementsOptions(),this._generateLevelParameters(),this._generateLabelsParameters(),this._generateBackgroundParameters(),this._defineDomObjects(),this._setTrendLineParameters(),this._setRetracementsOptions(),this._setLevelParameters(),this._setLabelsParameters(),this._setBackgroundParameters(),this._setValues(),this._switchView()},t.prototype._setDrawingConfig=function(e){this._showTrendLine=e.showTrendLine,this._showLevelValues=e.showLevelValues,this._showLevelPrices=e.showLevelPrices,this._showLevelPercents=e.showLevelPercents,this._showLevelBackgrounds=e.showLevelBackgrounds,this._levelLinesExtension=e.levelLinesExtension,this._reverse=e.reverse,this._levelTextHorPosition=e.levelTextHorPosition,this._levelTextVerPosition=e.levelTextVerPosition,this._levels=$.extend(!0,[],e.levels)},t.prototype._setLabelState=function(e,i){i?e.removeClass("disabled"):e.addClass("disabled")},t.prototype._setLevelLinesExtension=function(i,t,n){i?this._levelLinesExtension=this._levelLinesExtension===t?e.FibonacciLevelLineExtension.BOTH:n:this._levelLinesExtension===e.FibonacciLevelLineExtension.BOTH?this._levelLinesExtension=t:this._levelLinesExtension=e.FibonacciLevelLineExtension.NONE},t.prototype._setLineState=function(e,i){var t=this._panelFigureLine.find(".scxFibonacciDrawingDialog_input_lineColor").eq(i),n=this._panelFigureLine.find(".scxFibonacciDrawingDialog_input_lineLevel").eq(i),o=this._panelFigureLine.find(".scxFibonacciDrawingDialog_input_lineWidth").eq(i),s=this._panelFigureLine.find(".scxFibonacciDrawingDialog_input_lineStyle:even").eq(i)
e?(t.spectrum("enable"),s.removeAttr("disabled"),s.selectpicker("refresh"),o.scxNumericField("enable"),n.scxNumericField("enable"),this._levels[i].visible=!0):(t.spectrum("disable"),s.attr("disabled","disabled"),s.selectpicker("refresh"),o.scxNumericField("disable"),n.scxNumericField("disable"),this._levels[i].visible=!1)},t.prototype._setTrendLineState=function(e){e?(this._label_trendLine.removeClass("disabled"),this._input_trendLineColor.spectrum("enable"),this._input_trendLineWidth.scxNumericField("enable"),this._input_trendLineStyle.removeAttr("disabled"),this._input_trendLineStyle.selectpicker("refresh"),this._showTrendLine=!0):(this._label_trendLine.addClass("disabled"),this._input_trendLineColor.spectrum("disable"),this._input_trendLineWidth.scxNumericField("disable"),this._input_trendLineStyle.attr("disabled","disabled"),this._input_trendLineStyle.selectpicker("refresh"),this._showTrendLine=!1)},t.prototype._setLevelsState=function(e){e?(this._label_levels.removeClass("disabled"),this._chk_levelsPriceEnabled.isChecked()&&this._label_levelPrices.removeClass("disabled"),this._chk_levelsPercentEnabled.isChecked()&&this._label_levelPercents.removeClass("disabled"),this._chk_levelsPriceEnabled.enable(),this._chk_levelsPercentEnabled.enable()):(this._label_levels.addClass("disabled"),this._label_levelPrices.addClass("disabled"),this._label_levelPercents.addClass("disabled"),this._chk_levelsPriceEnabled.disable(),this._chk_levelsPercentEnabled.disable()),t._switcherySettings.disabled=!1},t.prototype._switchView=function(){switch(this._panelFigureLine.show(),this._title.text(this._getDrawingTitle()),this._panelFigure.show(),this._config.drawing.className){case e.FibonacciArcsDrawing.className:return this._panelFigureRetracementsOptionsPanel.hide(),this._levelsPriceEnabled.hide(),this._labelsHorEnabled.show(),void this._panelFigureTrendLinePanel.show()
case e.FibonacciEllipsesDrawing.className:return this._panelFigureRetracementsOptionsPanel.hide(),this._labelsHorEnabled.show(),this._levelsPriceEnabled.hide(),void this._panelFigureTrendLinePanel.show()
case e.FibonacciTimeZonesDrawing.className:return this._levelsExtendHorEnabled.hide(),this._levelsExtendVerEnabled.show(),this._levelsReverseEnabled.hide(),this._panelFigureRetracementsOptionsPanel.show(),this._levelsPriceEnabled.hide(),this._levelsPercentEnabled.hide(),void this._panelFigureTrendLinePanel.show()
case e.FibonacciRetracementsDrawing.className:return this._levelsExtendHorEnabled.show(),this._levelsExtendVerEnabled.hide(),this._levelsReverseEnabled.show(),this._panelFigureRetracementsOptionsPanel.show(),void this._panelFigureTrendLinePanel.show()
case e.FibonacciFanDrawing.className:return this._panelFigureRetracementsOptionsPanel.hide(),this._panelFigureTrendLinePanel.hide(),void this._labelsHorEnabled.hide()
case e.FibonacciExtensionsDrawing.className:return this._levelsExtendHorEnabled.show(),this._levelsExtendVerEnabled.hide(),this._levelsReverseEnabled.show(),this._panelFigureRetracementsOptionsPanel.show(),void this._panelFigureTrendLinePanel.show()}},t.prototype._getDrawingTitle=function(){var i=""
switch(this._config.drawing.className){case e.FibonacciArcsDrawing.className:i+="Fibonacci Arcs"
break
case e.FibonacciEllipsesDrawing.className:i+="Fibonacci Ellipses"
break
case e.FibonacciTimeZonesDrawing.className:i+="Fibonacci Time Zones"
break
case e.FibonacciRetracementsDrawing.className:i+="Fibonacci Retracements"
break
case e.FibonacciFanDrawing.className:i+="Fibonacci Fan"
break
case e.FibonacciExtensionsDrawing.className:i+="Fibonacci Extensions"
break
default:throw Error("Unknown drawing: "+this._config.drawing.className)}return i+" Settings"},t.prototype._setValues=function(){for(var i=0;i
')},n.prototype._showWaitingBar=function(){this._waitingBar.show(this._waitingBarConfig)},n.prototype._hideWaitingBar=function(){this._waitingBar.hide()},n}(i.Dialog)
i.IndicatorInfoDialog=t}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),__extends=this&&this.__extends||function(e,i){function t(){this.constructor=e}for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])
e.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t)},function(e){!function(e){var i=(jQuery,"scxMenuItemChecked"),t={ABOUT:"about",SETTINGS:"settings",SHOW_PARAMS:"showParams",SHOW_MARKERS:"showMarkers",SHOW_VALUES:"showTitleValues",VISIBLE:"visible",DELETE:"delete"}
Object.freeze(t)
var n=function(n){function o(i,t){var s=this
n.call(this,t,i),this._menuItems={},e.HtmlLoader.getView("IndicatorContextMenu.html",function(i){o._container||(o._container=e.HtmlContainer.instance.register("IndicatorContextMenu",i)),s._initMenu(t)})}return __extends(o,n),o.prototype._initMenu=function(e){var t=this
this._defineMenuItems(),e.menuContainer=o._container,e.onShow=function(){var n=e.indicator,o=t._menuItems
n.allowSettingsDialog?o.settings.removeClass("disabled"):o.settings.addClass("disabled"),n.showParamsInTitle?o.showParams.addClass(i):o.showParams.removeClass(i),n.showValueMarkers?o.showValueMarkers.addClass(i):o.showValueMarkers.removeClass(i),n.showValuesInTitle?o.showTitleValues.addClass(i):o.showTitleValues.removeClass(i),n.visible?o.visible.addClass(i):o.visible.removeClass(i)}},o.prototype._defineMenuItems=function(){this._menuItems.settings=o._container.find("[data-id=settings]"),this._menuItems.showParams=o._container.find("[data-id=showParams]"),this._menuItems.showValueMarkers=o._container.find("[data-id=showMarkers]"),this._menuItems.showTitleValues=o._container.find("[data-id=showTitleValues]"),this._menuItems.visible=o._container.find("[data-id=visible]")},o._container=null,o.MenuItem=t,o}(e.ContextMenu)
e.IndicatorContextMenu=n}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),__extends=this&&this.__extends||function(e,i){function t(){this.constructor=e}for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])
e.prototype=null===i?Object.create(i):(t.prototype=i.prototype,new t)},function(e){!function(i){var t={value:1},n={canBeNegative:!0,priceDecimals:2,value:1},o=function(i){function o(e){i.call(this,e),this._indicator=TASdk.Unknown,this._initFields(),this._init()}return __extends(o,i),o.prototype.show=function(e){this._config=e,this._indicator=e.indicator
var t=this._indicator.getName()?this._indicator.getName():Array.isArray(this._indicator.fieldNames)&&this._indicator.fieldNames.length&&"Volume"==this._indicator.fieldNames[0]?"Volume":"Indicator"
this._dialog.find("#scxIndicatorDialog_title").text(t+" Settings"),this._setViewAndValues(),i.prototype.show.call(this,e)},o.prototype.hide=function(){this._dialog.find(".scxSpectrum").spectrum("hide"),this._config=null,i.prototype.hide.call(this)},o.prototype._init=function(){var e=this,i={containerClassName:"scxSpectrumIndicatorPropertiesDialog",localStorageKey:"scxIndicatorDialog_spectrum",showAlpha:!0}
this._input_line1_color=this._dialog.find("#scxIndicatorDialog_input_line1_color").scx().colorPicker(i),this._input_line2_color=this._dialog.find("#scxIndicatorDialog_input_line2_color").scx().colorPicker(i),this._input_line3_color=this._dialog.find("#scxIndicatorDialog_input_line3_color").scx().colorPicker(i),this._input_histogram_line1_color=this._dialog.find("#scxIndicatorDialog_input_histogram_line1_color").scx().colorPicker(i),this._input_histogram_line2_color=this._dialog.find("#scxIndicatorDialog_input_histogram_line2_color").scx().colorPicker(i),this._dialog.find(".scxComboBox").selectpicker({container:"body"}),this._dialog.find("#scxIndicatorDialog_btn_save").off("click").click(function(){0===e._dialog.find(".scxInvalidValue").length&&e._save()}),this._dialog.find("#scxIndicatorDialog_btn_apply").off("click").click(function(){0===e._dialog.find(".scxInvalidValue").length&&e._apply()})},o._getMAType=function(e){switch(e=parseInt(e,10)){case TASdk.Const.simpleMovingAverage:case TASdk.Const.exponentialMovingAverage:case TASdk.Const.timeSeriesMovingAverage:case TASdk.Const.triangularMovingAverage:case TASdk.Const.variableMovingAverage:case TASdk.Const.VIDYA:case TASdk.Const.wellesWilderSmoothing:case TASdk.Const.weightedMovingAverage:return e
default:return TASdk.Const.simpleMovingAverage}},o._getPointsOrPercent=function(i){return i=parseInt(i,10),i===e.IndicatorParamValue.POINT?i:e.IndicatorParamValue.PERCENT},o.prototype._getSource=function(i){return this._indicator.chart.findDataSeries(i)?i:e.DataSeriesSuffix.CLOSE},o._getLineStyle=function(i){switch(i){case e.LineStyle.SOLID:case e.LineStyle.DASH:case e.LineStyle.DOT:case e.LineStyle.DASH_DOT:return i
default:return e.LineStyle.SOLID}},o.prototype.numericValue=function(e){return e.scxNumericField("getValue")},o.prototype.setNumericValue=function(e,i){e.scxNumericField("setValue",i)},o.prototype.updateNumericFromIndicator=function(e,i){this.setNumericValue(e,this._indicator.getParameterValue(i))},o.prototype.updateIndicatorFromNumeric=function(e,i){this._indicator.setParameterValue(e,this.numericValue(i))},o.prototype.updateIndicatorLineStyle=function(e,i){this._indicator.setParameterValue(e,o._getLineStyle(i.val()))},o.prototype._hideFields=function(){this._dialogContent.body.find("[id^='scxIndicatorDialog_container_']").hide(),this._label_line1.text("Line")},o.prototype._restoreFields=function(){this._input_line1_width.show(),this._input_line1_style.selectpicker("show"),this._input_line3_width.show(),this._input_line3_style.selectpicker("show")},o.prototype._resetErrors=function(){this._dialog.find(".scxInvalidValue").each(function(e,i){$(i).removeClass("scxInvalidValue")})},o.prototype._setFieldValueBounds=function(){var e=parseInt(((this._indicator?this._indicator.chart.recordCount:0)/2).toString(),10)
this._input_periods.scxNumericField("setBounds",1,e),this._input_r2scale.scxNumericField("setBounds",.01,1),this._input_standardDeviations.scxNumericField("setBounds",0,5),this._input_shift.scxNumericField("setBounds",0,20),this._input_minTick.scxNumericField("setBounds",0,1),this._input_limitMove.scxNumericField("setBounds",0,1e3),this._input_kPeriods.scxNumericField("setBounds",2,e),this._input_kSmoothing.scxNumericField("setBounds",2,e),this._input_kDoubleSmoothing.scxNumericField("setBounds",2,e),this._input_dPeriods.scxNumericField("setBounds",2,e),this._input_barHistory.scxNumericField("setBounds",2,e),this._input_cycle1.scxNumericField("setBounds",2,e),this._input_cycle2.scxNumericField("setBounds",2,e),this._input_cycle3.scxNumericField("setBounds",2,e),this._input_shortTerm.scxNumericField("setBounds",2,e),this._input_longTerm.scxNumericField("setBounds",2,e),this._input_roc.scxNumericField("setBounds",0,100),this._input_signalPeriods.scxNumericField("setBounds",2,e),this._input_shortCycle.scxNumericField("setBounds",2,e),this._input_longCycle.scxNumericField("setBounds",2,e),this._input_minAF.scxNumericField("setBounds",0,1),this._input_maxAF.scxNumericField("setBounds",0,1),this._input_levels.scxNumericField("setBounds",0,100),this._input_line1_width.scxNumericField("setBounds",1,20),this._input_line2_width.scxNumericField("setBounds",1,20),this._input_line3_width.scxNumericField("setBounds",1,20),this._indicator.taIndicator===TASdk.HighLowBands&&this._input_periods.scxNumericField("setBounds",6,e)},o.prototype._setFieldsRestrictions=function(){var e=this
switch(this._input_shortTerm.scxNumericField("onChange",null),this._input_longTerm.scxNumericField("onChange",null),this._input_cycle1.scxNumericField("onChange",null),this._input_cycle2.scxNumericField("onChange",null),this._input_shortCycle.scxNumericField("onChange",null),this._input_longCycle.scxNumericField("onChange",null),this._input_minAF.scxNumericField("onChange",null),this._input_maxAF.scxNumericField("onChange",null),this._indicator.taIndicator){case TASdk.VolumeOscillator:this._input_shortTerm.scxNumericField("onChange",function(i){i>=e.numericValue(e._input_longTerm)?(e._input_shortTerm.addClass("scxInvalidValue"),e._input_longTerm.addClass("scxInvalidValue")):(e._input_shortTerm.removeClass("scxInvalidValue"),e._input_longTerm.removeClass("scxInvalidValue"))}),this._input_longTerm.scxNumericField("onChange",function(i){i<=e.numericValue(e._input_shortTerm)?(e._input_shortTerm.addClass("scxInvalidValue"),e._input_longTerm.addClass("scxInvalidValue")):(e._input_shortTerm.removeClass("scxInvalidValue"),e._input_longTerm.removeClass("scxInvalidValue"))})
break
case TASdk.PriceOscillator:this._input_cycle1.scxNumericField("onChange",function(i){i>=e.numericValue(e._input_cycle2)?(e._input_cycle1.addClass("scxInvalidValue"),e._input_cycle2.addClass("scxInvalidValue")):(e._input_cycle1.removeClass("scxInvalidValue"),e._input_cycle2.removeClass("scxInvalidValue"))}),this._input_cycle2.scxNumericField("onChange",function(i){i<=e.numericValue(e._input_cycle1)?(e._input_cycle1.addClass("scxInvalidValue"),e._input_cycle2.addClass("scxInvalidValue")):(e._input_cycle1.removeClass("scxInvalidValue"),e._input_cycle2.removeClass("scxInvalidValue"))})
break
case TASdk.ParabolicSAR:this._input_minAF.scxNumericField("onChange",function(i){i>e.numericValue(e._input_maxAF)?(e._input_minAF.addClass("scxInvalidValue"),e._input_maxAF.addClass("scxInvalidValue")):(e._input_minAF.removeClass("scxInvalidValue"),e._input_maxAF.removeClass("scxInvalidValue"))}),this._input_maxAF.scxNumericField("onChange",function(i){i=e.numericValue(e._input_longCycle)?(e._input_shortCycle.addClass("scxInvalidValue"),e._input_longCycle.addClass("scxInvalidValue")):(e._input_shortCycle.removeClass("scxInvalidValue"),e._input_longCycle.removeClass("scxInvalidValue"))}),this._input_longCycle.scxNumericField("onChange",function(i){i<=e.numericValue(e._input_shortCycle)?(e._input_shortCycle.addClass("scxInvalidValue"),e._input_longCycle.addClass("scxInvalidValue")):(e._input_shortCycle.removeClass("scxInvalidValue"),e._input_longCycle.removeClass("scxInvalidValue"))})}},o.prototype._setViewAndValues=function(){var i=e.IndicatorParam,t=this._indicator
switch(this._restoreFields(),this._hideFields(),this._resetErrors(),this._setFieldValueBounds(),this._setFieldsRestrictions(),this._input_line1_color.setColor(t.getParameterValue(i.LINE_COLOR)),this.updateNumericFromIndicator(this._input_line1_width,i.LINE_WIDTH),this._input_line1_style.val(t.getParameterValue(i.LINE_STYLE)),this._dialog.find("#scxIndicatorDialog_container_line1").show(),1Sorry. There is no help for this indicator yet
')
return i.find(".scxIndicatorsGroup_header").text(this._indicatorGroupToString(e)),{root:i,itemsContainer:i.find(".scxIndicatorsGroup_indicators ul")}},s.prototype._generateIndicatorItem=function(i){var t
return t=i===e.VolumeIndicator?"Volume":i===e.ColoredVolumeIndicator?"Colored Volume":TASdk.indicatorToString(i),$('').attr("data-scx_id",i).text(t)},s.prototype._clearInput=function(){this._inp_search.val(""),this._filterIndicators(""),this._inp_search.focus()},s.prototype._indicatorGroupToString=function(e){switch(parseInt(e,10)){case t.Bands:return"Bands"
case t.General:return"General"
case t.Index:return"Index"
case t.MovingAverage:return"Moving Average"
case t.Oscillator:return"Oscillator"
case t.Regression:return"Regression"
default:return""}},s.prototype._initFields=function(){this._inp_search=this._dialog.find("#scxIndicators_inp_search"),this._resultContainer=this._dialog.find("#scxIndicatorsResult"),this._noResultObj=this._dialog.find(".scxNoResult"),this._tooltipSwitcher=this._dialog.find("#scxIndicators_chkHelpSwitcher"),this._tooltipDownloading=this._dialog.find(".scxLabel_downloading"),this._tooltipLabel=this._dialog.find('label[for="scxIndicators_chkHelpSwitcher"]'),this._btnClearInput=this._dialog.find("#scxIndicators_btn_clearInput"),this._helpPanel=this._dialog.find(".scxIndicators_helpControlPanel")},s}(i.Dialog)
i.IndicatorsDialog=o}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(i){var t=function(){function t(i,t){this._inputField=i,this._config=t,this._value=t.value||"",this._config.onChange=t.onChange,this._isDropDownVisible=!1,this._resultsCount=0,this._currentText="",this._searchDelayTimer=null,this._resultsDropDown=$(''),this._noResults=$('