/* 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').appendTo(this._panelFigure.find("table"))},t.prototype._generateTrendLine=function(){$('').appendTo(this._panelFigureTrendLinePanel.find("table"))},t.prototype._generateRetracementsOptions=function(){$('
').appendTo(this._panelFigureRetracementsOptionsPanel.find("table"))},t.prototype._generateLevelParameters=function(){$('
').appendTo(this._panelFigureLevelParametersPanel.find("table"))},t.prototype._generateLabelsParameters=function(){$('
').appendTo(this._panelFigureLabelsParametersPanel.find("table"))},t.prototype._generateBackgroundParameters=function(){$('').appendTo(this._panelFigureBackgroundPanel.find("table"))},t.prototype._defineDomObjects=function(){this._panelFigureTrendLine=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_trendLine"),this._panelFigureLevelParameters=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_levelParameters"),this._panelFigureRetracementsOptions=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_retracementsOptions"),this._panelFigureLabelsParameters=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_labels"),this._panelFigureBackground=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_background"),this._input_trendLineColor=this._panelFigureTrendLinePanel.find(".scxFibonacciDrawingDialog_input_lineColor"),this._input_trendLineWidth=this._panelFigureTrendLinePanel.find(".scxFibonacciDrawingDialog_input_lineWidth"),this._input_trendLineStyle=this._panelFigureTrendLinePanel.find(".scxFibonacciDrawingDialog_input_lineStyle"),this._input_labelsPosition=this._panelFigureLabelsParametersPanel.find(".scxFibonacciDrawingDialog_input_labelsPosition"),this._input_labelsTextPosition=this._panelFigureLabelsParametersPanel.find(".scxFibonacciDrawingDialog_input_labelsTextPosition"),this._chk_trendLineEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_trendLine"),this._chk_levelsValueEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_levelsValue"),this._chk_levelsPriceEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_levelsPrice"),this._chk_levelsPercentEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_levelsPercent"),this._chk_linesReverseEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_linesReverse"),this._chk_extendLinesLeftEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_extendLinesLeft"),this._chk_extendLinesRightEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_extendLinesRight"),this._chk_extendLinesTopEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_extendLinesTop"),this._chk_extendLinesBottomEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_extendLinesBottom"),this._chk_backgroundEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_background"),this._levelsPriceEnabled=this._dialog.find(".scxFibonacciDrawingDialog_levelsPrice"),this._levelsPercentEnabled=this._dialog.find(".scxFibonacciDrawingDialog_levelsPercent"),this._levelsExtendHorEnabled=this._dialog.find(".scxFibonacciDrawingDialog_extendHor"),this._levelsExtendVerEnabled=this._dialog.find(".scxFibonacciDrawingDialog_extendVer"),this._labelsHorEnabled=this._dialog.find(".scxFibonacciDrawingDialog_labelsPosition"),this._levelsReverseEnabled=this._dialog.find(".scxFibonacciDrawingDialog_reverse"),this._label_trendLine=this._dialog.find(".scxFibonacciDrawingDialog_label_trendLine"),this._label_extendLinesLeft=this._dialog.find(".scxFibonacciDrawingDialog_label_extendLinesLeft"),this._label_extendLinesRight=this._dialog.find(".scxFibonacciDrawingDialog_label_extendLinesRight"),this._label_extendLinesTop=this._dialog.find(".scxFibonacciDrawingDialog_label_extendLinesTop"),this._label_extendLinesBottom=this._dialog.find(".scxFibonacciDrawingDialog_label_extendLinesBottom"),this._label_reverse=this._dialog.find(".scxFibonacciDrawingDialog_label_linesReverse"),this._label_levels=this._dialog.find(".scxFibonacciDrawingDialog_label_levels"),this._label_levelPercents=this._dialog.find(".scxFibonacciDrawingDialog_label_percents"),this._label_levelPrices=this._dialog.find(".scxFibonacciDrawingDialog_label_prices"),this._label_background=this._dialog.find(".scxFibonacciDrawingDialog_label_background")},t.prototype._defineDomLevelObjects=function(){var e=this this._panelFigureLine=this._dialog.find(".scxFibonacciDrawingDialog_panel_figure_linePanel"),this._input_lineLevel=this._dialog.find(".scxFibonacciDrawingDialog_input_lineLevel"),this._input_lineColor=this._dialog.find(".scxFibonacciDrawingDialog_input_lineColor"),this._input_lineWidth=this._dialog.find(".scxFibonacciDrawingDialog_input_lineWidth"),this._input_lineStyle=this._dialog.find(".scxFibonacciDrawingDialog_input_lineStyle"),this._chk_lineEnabledHTMLObj=this._dialog.find(".scxFibonacciDrawingDialog_chk_lineEnable"),this._dialog.find(".scxFibonacciDrawingDialog_panel_deleteLinePanel").on("click",function(i){e._deleteLinePanel(i)})},t._numericFieldConfig={showArrows:!1,maxValue:10,minValue:1,value:1},t._numericDoubleFieldConfig={showArrows:!1,priceDecimals:2,maxValue:500,minValue:0,value:1},t._numericTimeZoneFieldConfig={showArrows:!1,maxValue:1e4,minValue:0,value:1},t._switcherySettings={color:"#64bd63",secondaryColor:"#ddd",className:"scx_switchery",disabled:!1,disabledOpacity:.5,speed:"0.4s"},t}(i.Dialog) i.FibonacciDrawingSettingsDialog=t}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(e){var i=jQuery,t=function(){function e(){this._componentsContainer=i('
').appendTo(i("body")),this._elements=[],i(document).on("scxFullscreenChange",this,this._onBrowserFullScreenChange)}return Object.defineProperty(e.prototype,"componentsContainer",{get:function(){return this._componentsContainer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elements",{get:function(){return this._elements},enumerable:!0,configurable:!0}),Object.defineProperty(e,"instance",{get:function(){return null==e._instance&&(e._instance=new e),e._instance},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t,n){void 0===n&&(n=!0) var o=null return t&&(o=n?i(t).appendTo(this.componentsContainer):i(t),this._elements.push({name:e,element:o})),o},e.prototype.resetSelf=function(e){e&&!e.isInFullScreenMode?this.reset():e&&e.isInFullScreenMode&&this.reset(e.container)},e.prototype.reset=function(e){e=e||i("body"),i.contains(e.get(0),this._componentsContainer.get(0))&&this._componentsContainer.detach(),this._componentsContainer.appendTo(e)},e.prototype._onBrowserFullScreenChange=function(e,i){var t=e.data i&&i.isInFullScreenMode?t.reset():i&&!i.isInFullScreenMode&&t.reset(i.container)},e._instance=null,e}() e.HtmlContainer=t}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(i){var t=jQuery,n=function(){function e(e){this._html="",this._subscribers=[],void 0!==e&&this._subscribers.push(e)}return e.prototype._isHtmlLoaded=function(){return 0 h1").remove(),e=e.length?e:n._generateHelpDoesntExistContent(),s._insertContent(e)})}else l=o.indicator.getName()||"Indicator Help",o=n._getIndicatorOwnAbout(o.indicator)||n._generateHelpDoesntExistContent(),this._setTitle(l),this._insertContent(o)},n.prototype._setTitle=function(e){this._title.text(e)},n.prototype._insertContent=function(e){this._hideWaitingBar(),this._helpContainer.append(e),this.resize()},n.prototype._clear=function(){this._helpContainer.empty()},n._getIndicatorOwnAbout=function(e){return(e=e.getInfoAbout())?$(e):null},n._generateHelpDoesntExistContent=function(){return $('

Sorry. There is no help for this indicator yet

')},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

')),i.css({display:"block"}).addClass("scxIndicators_tooltipWrapper"),e.addClass("scxHasTooltip").popover({trigger:"manual",placement:"auto",delay:{show:500,hide:100},container:"body",viewport:{selector:"body",padding:0},html:!0,content:function(){return $("
").append(i).html()}})}},s.prototype._disableItemHelpTooltip=function(e){e.removeClass("scxHasTooltip").popover("destroy")},s.prototype._generateIndicatorGroup=function(e){var i=$('

    ') 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=$('
    No results
    '),null!=t.instruments&&Array.isArray(t.instruments)&&0 .active") 0").text(this._inputField.val()).html()},t.prototype._highlightDropDownItem=function(e){var i=this._resultsDropDown.find(" > .active"),t=this._resultsDropDown.children() 0===i.length?e?t.last().addClass("active"):t.first().addClass("active"):(i.removeClass("active"),e?i.is(t.first())?t.last().addClass("active"):i.prev().addClass("active"):i.is(t.last())?t.first().addClass("active"):i.next().addClass("active")),i=this._resultsDropDown.find(" > .active"),e=i.outerHeight()*i.index(),i=e+i.outerHeight(),ethis._resultsDropDown.scrollTop()+this._resultsDropDown.outerHeight()&&this._resultsDropDown.scrollTop(i-this._resultsDropDown.height())},t.prototype._setValue=function(i,t){this._inputField.val(i),this._currentText=this._value=i,t&&e.JsUtil.isFunction(this._config.onChange)&&this._config.onChange(this._getInstrumentBySymbol(i))},t.prototype._hideDropDown=function(){this._isDropDownVisible=!1,this._resultsDropDown.hide(),this._currentText=this._inputField.val()},t.prototype._showDropDown=function(){var e=$(window).width() this._resultsDropDown.width("41.6651em") var i=this._resultsDropDown.outerWidth(!0) if(e
    '+this._highlightHTMLText(e,i)+'
    '+this._highlightHTMLText(e,t)+'
    '+n+"
    "},t.prototype._highlightHTMLText=function(e,i){if(""===e)return i var t=this._searchTextPositions(e,i),n="",o=0 if(1===e.length&&1'+i.substr(t[s].pos,t[s].len)+"",o=t[s].pos+t[s].len return o$(window).height()){var t=i._wrapperTheme.position().top+i._wrapperTheme.outerHeight(!0)-i._dialogBody.height() i._dialogBody.scrollTop(e'+i+"")},t.prototype._setUpBarBorderState=function(e){e?(this._fieldUpBarBorderColor.spectrum("enable"),this._labelUpBarBorderColor.removeClass("disabled"),this._chkUpBarBorderEnabled.isChecked()||this._chkUpBarBorderEnabled.setPosition(!0)):(this._fieldUpBarBorderColor.spectrum("disable"),this._labelUpBarBorderColor.addClass("disabled"),this._chkUpBarBorderEnabled.isChecked()&&this._chkUpBarBorderEnabled.setPosition(!0))},t.prototype._setDownBarBorderState=function(e){e?(this._fieldDownBarBorderColor.spectrum("enable"),this._labelDownBarBorderColor.removeClass("disabled"),this._chkDownBarBorderEnabled.isChecked()||this._chkDownBarBorderEnabled.setPosition(!0)):(this._fieldDownBarBorderColor.spectrum("disable"),this._labelDownBarBorderColor.addClass("disabled"),this._chkDownBarBorderEnabled.isChecked()&&this._chkDownBarBorderEnabled.setPosition(!0))},t.prototype._setValues=function(){var i=this._config.theme this._setTitle(i.name),this._fieldLineBarColor.spectrum("set",i.plot.line.simple.strokeColor),this._fieldUpBarColor.spectrum("set",i.plot.bar.candle.upCandle.fill.fillColor),this._fieldDownBarColor.spectrum("set",i.plot.bar.candle.downCandle.fill.fillColor),this._fieldUpBarBorderColor.spectrum("set",i.plot.bar.candle.upCandle.border.strokeColor),this._setUpBarBorderState(i.plot.bar.candle.upCandle.border.strokeEnabled),this._fieldDownBarBorderColor.spectrum("set",i.plot.bar.candle.downCandle.border.strokeColor),this._setDownBarBorderState(i.plot.bar.candle.downCandle.border.strokeEnabled),this._fieldWickColor.spectrum("set",i.plot.bar.candle.upCandle.wick.strokeColor),this._fieldTextFont.selectpicker("val",i.valueScale.text.fontFamily).selectpicker("refresh"),this._fieldTextSize.selectpicker("val",i.valueScale.text.fontSize).selectpicker("refresh"),this._fieldTextColor.spectrum("set",i.valueScale.text.fillColor),this._fieldGradient1Color.spectrum("set",i.chart.background[0]),this._fieldGradient2Color.spectrum("set",i.chart.background[1]),this._fieldGridColor.spectrum("set",i.chartPanel.grid.strokeColor) var n,i=[] for(n in e.Theme)e.Theme.hasOwnProperty(n)&&i.push(t._generateThemeSelectorItem(e.Theme[n].name)) this._fieldTheme.empty().append(i),this._fieldTheme.selectpicker("val",this._config.theme.name).selectpicker("refresh")},t.prototype._getValues=function(){var e=$.extend(!0,{},this._config.theme),i=this._fieldLineBarColor.spectrum("get").toRgbString() return e.plot.line.simple.strokeColor=i,e.plot.line.mountain.line.strokeColor=i,e.plot.bar.OHLC.strokeColor=i,e.plot.bar.HLC.strokeColor=i,e.plot.bar.HL.strokeColor=i,i=this._fieldUpBarColor.spectrum("get").toRgbString(),e.plot.bar.candle.upCandle.fill.fillColor=i,e.plot.bar.coloredOHLC.upBar.strokeColor=i,e.plot.bar.coloredHLC.upBar.strokeColor=i,e.plot.bar.coloredHL.upBar.strokeColor=i,e.plot.bar.candle.upCandle.fill.fillColor=i,e.plot.bar.hollowCandle.upCandle.fill.fillColor=i,e.plot.bar.hollowCandle.upHollowCandle.border.strokeColor=i,e.plot.bar.hollowCandle.upHollowCandle.wick.strokeColor=i,e.plot.bar.heikinAshi.upCandle.fill.fillColor=i,e.plot.bar.renko.upCandle.fill.fillColor=i,e.plot.bar.lineBreak.upCandle.fill.fillColor=i,e.plot.bar.pointAndFigure.upCandle.border.strokeColor=i,e.plot.bar.kagi.upCandle.border.strokeColor=i,i=this._fieldDownBarColor.spectrum("get").toRgbString(),e.plot.bar.candle.downCandle.fill.fillColor=i,e.plot.bar.coloredOHLC.downBar.strokeColor=i,e.plot.bar.coloredHLC.downBar.strokeColor=i,e.plot.bar.coloredHL.downBar.strokeColor=i,e.plot.bar.candle.downCandle.fill.fillColor=i,e.plot.bar.hollowCandle.downCandle.fill.fillColor=i,e.plot.bar.hollowCandle.downHollowCandle.border.strokeColor=i,e.plot.bar.hollowCandle.downHollowCandle.wick.strokeColor=i,e.plot.bar.heikinAshi.downCandle.fill.fillColor=i,e.plot.bar.renko.downCandle.fill.fillColor=i,e.plot.bar.lineBreak.downCandle.fill.fillColor=i,e.plot.bar.pointAndFigure.downCandle.border.strokeColor=i,e.plot.bar.kagi.downCandle.border.strokeColor=i,e.plot.bar.candle.upCandle.border.strokeColor=this._fieldUpBarBorderColor.spectrum("get").toRgbString(),e.plot.bar.candle.upCandle.border.strokeEnabled=this._chkUpBarBorderEnabled.isChecked(),e.plot.bar.candle.downCandle.border.strokeColor=this._fieldDownBarBorderColor.spectrum("get").toRgbString(),e.plot.bar.candle.downCandle.border.strokeEnabled=this._chkDownBarBorderEnabled.isChecked(),i=this._fieldWickColor.spectrum("get").toRgbString(),e.plot.bar.candle.upCandle.wick.strokeColor=i,e.plot.bar.candle.downCandle.wick.strokeColor=i,e.plot.bar.hollowCandle.upCandle.wick.strokeColor=i,e.plot.bar.hollowCandle.downCandle.wick.strokeColor=i,e.plot.bar.heikinAshi.upCandle.wick.strokeColor=i,e.plot.bar.heikinAshi.downCandle.wick.strokeColor=i,(i=this._fieldTextFont.selectpicker("val"))&&(e.chartPanel.title.fontFamily=i,e.valueScale.text.fontFamily=i,e.valueScale.valueMarker.text.fontFamily=i,e.dateScale.text.fontFamily=i,e.dateScale.dateMarker.text.fontFamily=i),i=parseInt(this._fieldTextSize.selectpicker("val"),10),e.chartPanel.title.fontSize=i,e.valueScale.text.fontSize=i,e.valueScale.valueMarker.text.fontSize=i,e.dateScale.text.fontSize=i,e.dateScale.dateMarker.text.fontSize=i,i=this._fieldTextColor.spectrum("get").toHexString(),e.chartPanel.title.fillColor=i,e.valueScale.text.fillColor=i,e.valueScale.valueMarker.text.fillColor=i,e.dateScale.text.fillColor=i,e.dateScale.dateMarker.text.fillColor=i,e.chart.background[0]=this._fieldGradient1Color.spectrum("get").toRgbString(),e.chart.background[1]=this._fieldGradient2Color.spectrum("get").toRgbString(),i=this._fieldGridColor.spectrum("get").toHexString(),e.chartPanel.grid.strokeColor=i,e.dateScale.line.strokeColor=i,e},t.prototype._apply=function(i){e.JsUtil.isFunction(this._config.done)&&(null==i&&(i=this._getValues()),this._config.done(i))},t.prototype._highlightNewThemeNameInvalid=function(e){e?(this._fieldNewThemeName.addClass(t.CLASS_INVALID_VALUE),this._btnNewThemeConfirm.addClass(t.CLASS_INVALID_VALUE)):(this._fieldNewThemeName.removeClass(t.CLASS_INVALID_VALUE),this._btnNewThemeConfirm.removeClass(t.CLASS_INVALID_VALUE))},t.prototype._initFields=function(){this._dialogBody=this._dialog.find(".scxThemeDialog-body"),this._dialogTitle=this._dialog.find("#scxThemeDialog_headerTitle"),this._btnApply=this._dialog.find("#scxThemeDialog_btn_save"),this._fieldLineBarColor=this._dialog.find("#scxThemeDialog_input_lineBarColor"),this._fieldUpBarColor=this._dialog.find("#scxThemeDialog_input_upBarColor"),this._fieldDownBarColor=this._dialog.find("#scxThemeDialog_input_downBarColor"),this._labelUpBarBorderColor=this._dialog.find("#scxThemeDialog_label_upBarBorderColor"),this._fieldUpBarBorderColor=this._dialog.find("#scxThemeDialog_input_upBarBorderColor"),this._fieldUpBarBorderEnabled=this._dialog.find("#scxThemeDialog_chk_upBarBorderColor"),this._labelDownBarBorderColor=this._dialog.find("#scxThemeDialog_label_downBarBorderColor"),this._fieldDownBarBorderColor=this._dialog.find("#scxThemeDialog_input_downBarBorderColor"),this._fieldDownBarBorderEnabled=this._dialog.find("#scxThemeDialog_chk_downBarBorderColor"),this._fieldWickColor=this._dialog.find("#scxThemeDialog_input_wickColor"),this._fieldTextFont=this._dialog.find("#scxThemeDialog_input_textFont"),this._fieldTextSize=this._dialog.find("#scxThemeDialog_input_textSize"),this._fieldTextColor=this._dialog.find("#scxThemeDialog_input_textColor"),this._fieldGradient1Color=this._dialog.find("#scxThemeDialog_input_gradient1Color"),this._fieldGradient2Color=this._dialog.find("#scxThemeDialog_input_gradient2Color"),this._fieldGridColor=this._dialog.find("#scxThemeDialog_input_gridColor"),this._fieldTheme=this._dialog.find("#scxThemeDialog_input_theme"),this._wrapperTheme=this._dialog.find("#scxThemeDialog_newThemeWrapper"),this._btnNewTheme=this._dialog.find("#scxThemeDialog_btn_newTheme"),this._btnNewThemeConfirm=this._dialog.find("#scxThemeDialog_btn_newThemeConfirm"),this._fieldNewThemeName=this._dialog.find("#scxThemeDialog_input_newThemeName"),this._btnSaveTheme=this._dialog.find("#scxThemeDialog_btn_saveTheme")},t.CLASS_INVALID_VALUE="scxInvalidValue",t.CLASS_BTN_PRIMARY="btn-primary",t.CLASS_BTN_DEFAULT="btn-default",t._switcherySettings={color:"#64bd63",secondaryColor:"#ddd",className:"scx_switchery",disabled:!1,disabledOpacity:.5,speed:"0.4s"},t}(i.Dialog) i.ThemeDialog=t}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(i){var t={LEFT:0,RIGHT:1} Object.freeze(t) var n=function(){function n(i,t){this._hasCustomPicker=this._isActive=!1,this._last=new e.TimeFrame(e.Periodicity.MINUTE,1),t.timeInterval||(t.timeInterval=t.chart&&t.chart.timeInterval||e.TimeSpan.MILLISECONDS_IN_MINUTE),this._rootDomElement=i,this._config=t,this._init()}return Object.defineProperty(n.prototype,"chart",{get:function(){return this._config.chart},set:function(e){this._config.chart=e},enumerable:!0,configurable:!0}),n.prototype.set=function(i){this._setValue(e.TimeFrame.timeIntervalToTimeFrame(i))},n.prototype._init=function(){var t=this if(this._domObjects=n._getDomObjects(this._rootDomElement),this._btnWrapper=this._rootDomElement.find(".scxToolbarButton-buttonWrapper"),i.HtmlContainer.instance.register("TimeFramePicker",this._domObjects.dropdown.wrapper),this._hasCustomPicker=0'+l+""))}this._domObjects.dropdown.inputPeriodicity.empty().append(a)}this._domObjects.dropdown.inputPeriodicity.selectpicker({container:"body"}),this._domObjects.head.dropdownToggler.click(function(e){t._toggleDropDown(),$(e.currentTarget).blur()}),this._domObjects.head.activator.click(function(){t._domObjects.head.dropdownToggler.click()}),$(window).on("scroll resize",function(){t._hideDropDown()}),$("body").click(function(e){t._isActive&&0===$(e.target).parents(t._rootDomElement.selector).length&&0===$(e.target).parents(".scxTimeFramePickerDropDown").length&&0===$(e.target).parents(".scxTimeFramePicker-CustomValueUnits").length&&t._hideDropDown()}),this._domObjects.predefinedItems.click(function(e){t._setPredefinedValue($(e.currentTarget).index())}),this._hasCustomPicker&&(e.Environment.isMobile?(this._hasCustomPicker=!1,this._domObjects.dropdown.customValueWrapper.remove()):(this._domObjects.dropdown.btnPlus.click(function(e){t._domObjects.predefinedItems.removeClass("active"),$(e.currentTarget).blur(),t._domObjects.dropdown.inputInterval.scxNumericField("setValue",t._getPickerIntervalValue()+1)}),this._domObjects.dropdown.btnMinus.click(function(e){t._domObjects.predefinedItems.removeClass("active"),$(e.currentTarget).blur(),1<(e=t._getPickerIntervalValue())&&t._domObjects.dropdown.inputInterval.scxNumericField("setValue",e-1)}))),this._setValue(e.TimeFrame.timeIntervalToTimeFrame(this._config.timeInterval))},n.prototype._setValue=function(e){this._domObjects.predefinedItems.removeClass("active"),this._last=e,this._setCustomPickerValues(),this._setLabels(),this._hideDropDown()},n.prototype._setPredefinedValue=function(e){e=this._domObjects.predefinedItems.eq(e),this._activateItem(e),this._last=n._extractDataFromItem(e),this._setCustomPickerValues(),this._setLabels(),this._hideDropDown(),this._fire()},n._extractDataFromItem=function(i){return new e.TimeFrame(i.attr("data-scxUnits"),parseInt(i.attr("data-scxValue"),10))},n.prototype._activateItem=function(e){this._domObjects.predefinedItems.removeClass("active"),e.addClass("active")},n.prototype._setLabels=function(){this._domObjects.head.labelInterval.text(this._last.interval),this._domObjects.head.labelPeriodicity.text(this._last.periodicity)},n.prototype._setCustomPickerValues=function(){this._hasCustomPicker&&(this._domObjects.dropdown.inputInterval.scxNumericField("setValue",this._last.interval),this._domObjects.dropdown.inputPeriodicity.selectpicker("val",this._last.periodicity).selectpicker("refresh"))},n.prototype._toggleDropDown=function(){this._isActive?this._hideDropDown():this._showDropDown()},n.prototype._showDropDown=function(){this._isActive=!0 var e=this._rootDomElement.addClass("active"),i=this._domObjects.dropdown.wrapper,n=this._domObjects.dropdown.container,o=window.innerWidth,s=window.innerHeight-1,a=e.offset().top-$(window).scrollTop(),l=e.offset().left-$(window).scrollLeft() n.css({width:"auto",height:"auto"}),i.css({top:0,left:0,right:"auto"}).show() var r=i.outerWidth(!0),c=i.outerHeight(!0) i.hide() var _=l+r>o&&o-ls-a.top&&(c=s-a.top),_){case t.RIGHT:a.left=l,a.right="auto",i.removeClass("scxLeft").addClass("scxRight"),r>o-a.left&&(r=o-a.left-2) break case t.LEFT:a.left="auto",a.right=o-l-e.outerWidth(!0),i.removeClass("scxRight").addClass("scxLeft"),r>o-a.right&&(r=o-a.right-2,a.left=0)}n.outerWidth(r).outerHeight(c),i.css(a).show()},n.prototype._hideDropDown=function(){this._domObjects.dropdown.wrapper.hide(),this._rootDomElement.removeClass("active"),this._btnWrapper.removeClass("hover"),this._isActive=!1,this._synchronizeWithCustomPicker()},n.prototype._synchronizeWithCustomPicker=function(){if(this._hasCustomPicker){var e=this._getPickerIntervalValue(),i=this._domObjects.dropdown.inputPeriodicity.selectpicker("val") e===this._last.interval&&i===this._last.periodicity||(this._last.interval=e,this._last.periodicity=i,this._setLabels(),this._fire())}},n.prototype._fire=function(){"function"==typeof this._config.selectionChanged&&this._config.selectionChanged(this._last)},n.prototype._getPickerIntervalValue=function(){var e=$("
    ").text(this._domObjects.dropdown.inputInterval.scxNumericField("getValue")).html() return parseInt(e,10)},n.prototype._selectDistinctPredefinedPeriodicities=function(){var i,t=[] return this._domObjects.predefinedItems.each(function(n,o){i=$(o).attr("data-scxUnits").toLowerCase() try{e.TimeFrame.periodicityToString(i)}catch(e){i=null}null!==i&&0>t.indexOf(i)&&t.push(i)}),t},n._getDomObjects=function(e){return{head:{activator:e.find(".scxToolbarButton-activateBtn"),dropdownToggler:e.find(".scxToolbarButton-toggleDropdownBtn"),labelInterval:e.find(".scxTimeFramePicker-button-value"),labelPeriodicity:e.find(".scxTimeFramePicker-button-units")},dropdown:{wrapper:e.find(".scxTimeFramePickerDropDown"),container:e.find(".scxTimeFramePicker-dropdownContainer"),customValueWrapper:e.find(".scxTimeFramePicker-CustomValueWrapper"),btnPlus:e.find(".scxTimeFramePicker-CustomValuePlus"),btnMinus:e.find(".scxTimeFramePicker-CustomValueMinus"),inputInterval:e.find(".scxTimeFramePicker-CustomValueText"),inputPeriodicity:e.find(".scxTimeFramePicker-CustomValueUnits")},predefinedItems:e.find(".scxToolbarButton-dropdownElement")}},n}() i.TimeFramePicker=n}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(i){var t=function(){function t(e){var t=this i.HtmlLoader.getView("Toolbar.html",function(i){t._init(i,e)})}return Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},set:function(e){this._chart!==e&&(this._unsubscribeEvents(),this._chart=e,this._subscribeEvents(),this._updateForNewChart())},enumerable:!0,configurable:!0}),t.prototype._init=function(i,t){var n=this,o=this._container=$(i).prependTo(t.parent),s=this._controls={} e.Environment.isPhone&&this._container.addClass("scxPhone"),s.instrument=o.find(".symbolSearch").scx().instrumentSearch({onChange:function(e){n._handleInstrumentChange(e)}}),s.timeFrame=o.find(".scxTimeFramePicker").scx().timeFramePicker({selectionChanged:function(e){n._handleTimeFrameChange(e)}}),o.find(".scxToolbar-btn").hover(function(e){$(e.target).addClass("hover")},function(e){$(e.target).removeClass("hover")}),o.find(".scxToolbar-btn-indicators").on("click",function(e){$(e.target).removeClass("hover"),n._handleIndicatorsClick()}),o.find(".scxToolbar-btn-theme").on("click",function(e){$(e.target).removeClass("hover"),n._handleThemeClick()}),s.priceStyle=o.find(".scxToolbarBarStyle").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handlePriceStyleChange(e,i)}}),s.crossHair=o.find(".scxToolbarCrossHair").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleCrossHairChange(e,i)}}),s.markerDrawings=o.find(".scxToolbarMarkerDrawings").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleDrawingClick(e,i)}}),s.geometricDrawings=o.find(".scxToolbarGeometricDrawings").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleDrawingClick(e,i)}}),s.fibonacciDrawings=o.find(".scxToolbarFibonacciDrawings").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleDrawingClick(e,i)}}),s.trendDrawings=o.find(".scxToolbarTrendDrawings").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleDrawingClick(e,i)}}),s.generalDrawings=o.find(".scxToolbarGeneralDrawings").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleDrawingClick(e,i)}}),s.zoomIn=o.find(".scxToolbarZoomIn").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleZoomInClick(e,i)}}),s.hideDrawings=o.find(".scxToolbar-btn-hideDrawings").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleHideDrawingsClick(i)}}),s.stayInDrawingMode=o.find(".scxToolbar-btn-stayInDrawingMode").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleDrawingModeClick(i)}}),s.deleteObject=o.find(".scxToolbarDelete").scx().toolbarDropDownButton({selectionChanged:function(e,i){n._handleDeleteClick(e,i)}}),e.Environment.isIOS?o.find(".scxToolbarSaveImage").remove():o.find(".scxToolbarSaveImage").on("click",function(e){$(e.target).removeClass("hover"),n._handleSaveImageClick()}),o=o.find(".scxToolbarViewMode"),!1===t.showViewMode?o.remove():e.Environment.isMobile?o.on("click",function(){n._handleViewModeChange("toggleFullWindow",!1)}).removeClass("scxToolbarButtonWithDropdown").removeClass("scxToolbarButton").addClass("scxToolbar-btn").children().remove():o.scx().toolbarDropDownButton({chart:this.chart,selectionChanged:function(e,i){n._handleViewModeChange(e,i)}}),(o=this.chart=t.chart)&&o.fireValueChanged(e.ChartEvent.TOOLBAR_LOADED),this._updateForNewChart()},t.prototype.prependTo=function(e){e&&(this._container.detach(),this._container=this._container.prependTo(e))},t.prototype._subscribeEvents=function(){var i=this,t=this.chart t&&t.on(e.ChartEvent.INSTRUMENT_CHANGED+".scxToolbar",function(e){i._controls.instrument.set(e.value)}).on(e.ChartEvent.TIME_INTERVAL_CHANGED+".scxToolbar",function(e){i._controls.timeFrame.set(e.value)}).on(e.ChartEvent.PRICE_STYLE_CHANGED+".scxToolbar",function(){var t=i.chart&&i.chart.priceStyle t&&(t instanceof e.HLBarPriceStyle||t instanceof e.HLCBarPriceStyle||t instanceof e.ColoredHLBarPriceStyle||t instanceof e.ColoredHLCBarPriceStyle||i._controls.priceStyle.selectItem(i.chart.priceStyleKind,!1))}).on(e.ChartEvent.CROSS_HAIR_CHANGED+".scxToolbar",function(){i._controls.crossHair.selectItem(i.chart.crossHairType,!1)}).on(e.ChartEvent.ZOOM_IN_FINISHED+".scxToolbar "+e.ChartEvent.ZOOM_IN_CANCELLED+".scxToolbar",function(){i._controls.zoomIn.deactivate()}).on([e.ChartEvent.USER_DRAWING_FINISHED,e.ChartEvent.USER_DRAWING_CANCELLED,""].join(".scxToolbar "),function(){var e=i._controls t.stayInDrawingMode||(e.markerDrawings.deactivate(),e.geometricDrawings.deactivate(),e.fibonacciDrawings.deactivate(),e.trendDrawings.deactivate(),e.generalDrawings.deactivate())}).on(e.ChartEvent.STATE_LOADED+".scxToolbar",function(){i._controls.priceStyle.selectItem(i.chart.priceStyleKind,!1),i._controls.crossHair.selectItem(i.chart.crossHairType,!1)})},t.prototype._unsubscribeEvents=function(){this._chart&&(this._chart.cancelUserDrawing(),this._chart.cancelZoomIn(),this._chart.off(".scxToolbar"))},t.prototype._updateForNewChart=function(){var e=this.chart,t=this._controls if(e&&t){for(var n in t)t.hasOwnProperty(n)&&t[n]instanceof i.ToolbarDropDownButton&&(t[n].chart=e,"hideDrawings"!==n&&"stayInDrawingMode"!==n&&t[n].deactivate()) t.instrument.set(e.instrument),t.timeFrame.chart=e,t.timeFrame.set(e.timeInterval),t.priceStyle.selectItem(e.priceStyleKind,!1),t.crossHair.selectItem(e.crossHairType,!1),e.showDrawings?t.hideDrawings.deactivate():t.hideDrawings.activate(),e.stayInDrawingMode?t.stayInDrawingMode.activate():t.stayInDrawingMode.deactivate(),e.isInFullWindowMode&&e._handleFullWindowResize()}},t.prototype._handleInstrumentChange=function(i){if(i){var t=this.chart t&&i.symbol.toUpperCase()!==t.instrument.symbol&&t.fireValueChanged(e.ChartEvent.SYMBOL_ENTERED,i)}},t.prototype._handleTimeFrameChange=function(i){var t=this.chart t&&t.fireValueChanged(e.ChartEvent.TIME_FRAME_CHANGED,i)},t.prototype._handleIndicatorsClick=function(){var i=this e.UI.ViewLoader.indicatorsDialog(function(t){t.show({chart:i.chart,done:function(t){var n=i.chart n&&(87===t?n.addIndicators(new e.IchimokuIndicator):n.addIndicators(t),n.update())}})})},t.prototype._handleThemeClick=function(){var i=this e.UI.ViewLoader.themeDialog(function(e){e.show({chart:i.chart,theme:i.chart.theme,done:function(e){var t=i.chart t&&(t.theme=e,t.setNeedsUpdate())}})})},t.prototype._handlePriceStyleChange=function(e,i){var t=this.chart t&&i&&e&&(t.priceStyleKind=e,t.setNeedsUpdate())},t.prototype._handleCrossHairChange=function(e,i){var t=this.chart t&&i&&e&&(t.crossHairType=e)},t.prototype._handleDrawingClick=function(i,t){var n=this.chart if(n)if(t){if(t&&i){var o=e.Drawing.deserialize({className:i}) n.startUserDrawing(o)}}else n.cancelUserDrawing()},t.prototype._handleZoomInClick=function(e,i){var t=this.chart t&&(i?e&&i&&t.startZoomIn(e):t.cancelZoomIn())},t.prototype._handleHideDrawingsClick=function(e){var i=this.chart i&&(i.showDrawings=!e,i.setNeedsUpdate())},t.prototype._handleDrawingsTooltipClick=function(e){var i=this.chart i&&(i.showDrawingTooltips=e,i.setNeedsUpdate())},t.prototype._handleDrawingModeClick=function(e){var i=this.chart i&&(i.stayInDrawingMode=e,e||i.cancelUserDrawing())},t.prototype._handleDeleteClick=function(i,t){var n=this.chart if(n){if("deleteDrawing"===i){var o=n.selectedObject,s=o instanceof e.Drawing&&o.chartPanel s&&(s.removeDrawings(o),s.update())}t&&"deleteAllDrawings"===i&&(n.removeDrawings(),n.setNeedsUpdate(!0)),t&&"deleteAllIndicators"===i&&(n.removeIndicators(),n.setNeedsUpdate(!0))}},t.prototype._handleSaveImageClick=function(){var e=this.chart e&&e.saveImage()},t.prototype._handleViewModeChange=function(i,t){var n=this.chart n&&("toggleFullWindow"===i?(n.toggleFullWindow(),n.fireValueChanged(e.ChartEvent.WINDOW_MODE_CHANGED)):"toggleFullScreen"===i&&t&&(n.toggleFullScreen(),n.fireValueChanged(e.ChartEvent.WINDOW_MODE_CHANGED)))},t}() i.Toolbar=t}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(e){var i={LEFT:0,RIGHT:1} Object.freeze(i) var t=function(){function t(e,i){this._canToggle=!0,this._isActive=this._isActivated=this._hasChildren=!1,this._config=i,this._rootElement=e,this._body=$("body"),this._init()}return Object.defineProperty(t.prototype,"chart",{get:function(){return this._config.chart},set:function(e){this._config.chart=e},enumerable:!0,configurable:!0}),t.prototype.selectItem=function(e,i){this._setValue(e,i)},t.prototype.deactivate=function(){this._deactivateButton()},t.prototype.activate=function(){this._activateButton()},t.prototype._init=function(){var i=this this._btnWrapper=this._rootElement.find(".scxToolbarButton-buttonWrapper"),this._btnActivate=this._rootElement.find(".scxToolbarButton-activateBtn"),this._btn_toggleDropDown=this._rootElement.find(".scxToolbarButton-toggleDropdownBtn"),this._itemsWrapper=this._rootElement.find(".scxToolbarButton-dropdownWrapper"),this._itemsContainer=this._rootElement.find(".scxToolbarButton-dropdownElementsContainer"),this._items=this._rootElement.find(".scxToolbarButton-dropdownElement"),e.HtmlContainer.instance.register("scxToolbarButton-dropdownWrapper",this._itemsWrapper,!1),this._canToggle=this._rootElement.hasClass("scxToolbarCanToggle"),this._canFireFromHead=this._rootElement.hasClass("scxToolbarCanFireFromHead"),this._rootElement.hasClass("scxToolbarButtonWithDropdown")&&0o&&o-ls-a.top&&(c=s-a.top),_){case i.RIGHT:a.left=l,t.removeClass("scxLeft").addClass("scxRight"),r>o-a.left&&(r=o-a.left) break case i.LEFT:e=l+e.outerWidth(!0),a.left=e-r-2,t.removeClass("scxRight").addClass("scxLeft"),r>e&&(r=e-2,a.left=0)}n.outerWidth(r).outerHeight(c),t.css(a).show()},t.prototype._hideDropDown=function(){this._itemsWrapper.hide(),this._rootElement.removeClass("active"),this._btnWrapper.removeClass("hover"),this._isActive=!1},t.prototype._toggleDropDown=function(){this._isActive?this._hideDropDown():this._showDropDown()},t}() e.ToolbarDropDownButton=t}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(i){var t=(jQuery,{DRAWING_DIALOG:"DrawingSettingsDialog.html",FIBONACCI_DRAWING_DIALOG:"FibonacciDrawingSettingsDialog.html",ICHIMOKU_INDICATOR_DIALOG:"IchimokuIndicatorSettingsDialog.html",INDICATOR_INFO_DIALOG:"IndicatorInfoDialog.html",INDICATORS_DIALOG:"IndicatorsDialog.html",INDICATOR_DIALOG:"IndicatorSettingsDialog.html",PRICE_STYLE_DIALOG:"PriceStyleSettingsDialog.html",THEME_DIALOG:"ThemeDialog.html"}) Object.freeze(t) var n=function(){function n(){}return n.drawingSettingsDialog=function(e){var n=this return this._drawingSettingsDialog?void this._invokeOnLoad(e,this._drawingSettingsDialog):void i.HtmlLoader.getView(t.DRAWING_DIALOG,function(t){t=i.HtmlContainer.instance.register("DrawingSettingsDialog",t),n._drawingSettingsDialog=new i.DrawingSettingsDialog(t),n._invokeOnLoad(e,n._drawingSettingsDialog)})},n.fibonacciDrawingSettingsDialog=function(e){var n=this return this._fibonacciDrawingSettingsDialog?void this._invokeOnLoad(e,this._fibonacciDrawingSettingsDialog):void i.HtmlLoader.getView(t.FIBONACCI_DRAWING_DIALOG,function(t){t=i.HtmlContainer.instance.register("FibonacciDrawingSettingsDialog",t),n._fibonacciDrawingSettingsDialog=new i.FibonacciDrawingSettingsDialog(t),n._invokeOnLoad(e,n._fibonacciDrawingSettingsDialog)})},n.ichimokuIndicatorSettingsDialog=function(e){var n=this return this._ichimokuIndicatorSettingsDialog?void this._invokeOnLoad(e,this._ichimokuIndicatorSettingsDialog):void i.HtmlLoader.getView(t.ICHIMOKU_INDICATOR_DIALOG,function(t){t=i.HtmlContainer.instance.register("IchimokuIndicatorSettingsDialog",t),n._ichimokuIndicatorSettingsDialog=new i.IchimokuIndicatorSettingsDialog(t),n._invokeOnLoad(e,n._ichimokuIndicatorSettingsDialog)})},n.indicatorInfoDialog=function(e){var n=this return this._indicatorInfoDialog?void this._invokeOnLoad(e,this._indicatorInfoDialog):void i.HtmlLoader.getView(t.INDICATOR_INFO_DIALOG,function(t){t=i.HtmlContainer.instance.register("IndicatorInfoDialog",t),n._indicatorInfoDialog=new i.IndicatorInfoDialog(t),n._invokeOnLoad(e,n._indicatorInfoDialog)})},n.indicatorsDialog=function(e){var n=this return this._indicatorsDialog?void this._invokeOnLoad(e,this._indicatorsDialog):void i.HtmlLoader.getView(t.INDICATORS_DIALOG,function(t){t=i.HtmlContainer.instance.register("IndicatorsDialog",t),n._indicatorsDialog=new i.IndicatorsDialog(t),n._invokeOnLoad(e,n._indicatorsDialog)})},n.indicatorSettingsDialog=function(e){var n=this return this._indicatorPropertiesDialog?void this._invokeOnLoad(e,this._indicatorPropertiesDialog):void i.HtmlLoader.getView(t.INDICATOR_DIALOG,function(t){t=i.HtmlContainer.instance.register("IndicatorSettingsDialog",t),n._indicatorPropertiesDialog=new i.IndicatorSettingsDialog(t),n._invokeOnLoad(e,n._indicatorPropertiesDialog)})},n.priceStyleSettingsDialog=function(e){var n=this return this._priceStyleSettingsDialog?void this._invokeOnLoad(e,this._priceStyleSettingsDialog):void i.HtmlLoader.getView(t.PRICE_STYLE_DIALOG,function(t){t=i.HtmlContainer.instance.register("PriceStyleSettingsDialog",t),n._priceStyleSettingsDialog=new i.PriceStyleSettingsDialog(t),n._invokeOnLoad(e,n._priceStyleSettingsDialog)})},n.themeDialog=function(e){var n=this return this._themeDialog?void this._invokeOnLoad(e,this._themeDialog):void i.HtmlLoader.getView(t.THEME_DIALOG,function(t){t=i.HtmlContainer.instance.register("ThemeDialog",t),n._themeDialog=new i.ThemeDialog(t),n._invokeOnLoad(e,n._themeDialog)})},n._invokeOnLoad=function(i,t){e.JsUtil.isFunction(i)&&i(t)},n}() i.ViewLoader=n}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(e){var i=jQuery,t=function(){function e(e){this._callersCount=0,this._parentContainer=e}return e.prototype.show=function(e){1<++this._callersCount||(this._config=i.extend({text:"Loading...",dotsCount:7},e),this._createDom(),this._container.show())},e.prototype.hide=function(e){this._callersCount&&(this._callersCount=e?0:this._callersCount-1,this._callersCount||this._destroy())},e.prototype.isShown=function(){return!!this._callersCount},e.prototype._createDom=function(){this._container=i('
    ').appendTo(this._parentContainer),i(''+this._config.text+"").appendTo(this._container) for(var e=i('
    ').appendTo(this._container),t=[],n=0;n')) e.append(t)},e.prototype._destroy=function(){this._container.remove(),this._container=null},e}() e.WaitingBar=t}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(e){var i=function(){function e(){}return e.warning=function(e){toastr.warning(e,"Warning",this._options)},e.error=function(e){toastr.error(e,"Error",this._options)},e.success=function(e){toastr.success(e,"Error",this._options)},e.info=function(e){toastr.info(e,"Error",this._options)},e._options={closeButton:!0,debug:!1,newestOnTop:!1,progressBar:!1,positionClass:"toast-top-right",preventDuplicates:!1,onclick:null,showDuration:300,hideDuration:1e3,timeOut:5e3,extendedTimeOut:1e3,showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"},e}() e.Notification=i}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(i){i.TooltipPosition={AUTO:"auto",TOP:"top",BOTTOM:"bottom"},i.TooltipContentKind={TEXT:"text",IMAGE:"image",HTML:"html"},Object.freeze(i.TooltipContentKind) var t=jQuery,n=function(){function n(e){this._maxContentWidth=270,this._minSize={width:280,height:29},this._isInDom=!1,this._options=e.options||t.extend(!0,{},n.defaults),this._parent=e.parent,this.initDomObjects()}return Object.defineProperty(n.prototype,"UID",{get:function(){return("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this._isInDom?{width:this._tooltipElement.outerWidth(),height:this._tooltipElement.outerHeight()}:this._minSize},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"theme",{get:function(){return this._options.theme},set:function(e){this._options.theme=e,this.applyTheme()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"actualTheme",{get:function(){var e=this.theme return e||this.defaultTheme},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"defaultTheme",{get:function(){var i=this._parent.chart return i?e.JsUtil.clone(i.theme.drawing.note.tooltip):null},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this._visible},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"contentKind",{get:function(){return this._options.kind},set:function(e){this._options.kind=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this._options.position},set:function(e){this._options.position=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"text",{get:function(){return this._options.text},set:function(e){this._options.text=e,this._applyText()},enumerable:!0,configurable:!0}),n.prototype.initDomObjects=function(){this._id="tooltip-"+this.UID var e=this._tooltipElement=t('
    ') e.addClass("scxTooltip").addClass("scxArrowBox"),this._arrowAfter=e.find(".scxTooltipArrowStyleAfter"),this._arrowBefore=e.find(".scxTooltipArrowStyleBefore"),this._arrowMainAfter=e.find(".scxTooltipThemeArrowStyleAfter"),this._arrowMainBefore=e.find(".scxTooltipThemeArrowStyleBefore"),this._contentElement=e.find(".scxTooltipContent"),this._applyText()},n.prototype._applyText=function(){var n=this.text,o=this.actualTheme,s=1 o&&(s=o.border.enabled?o.border.width:0),this._contentElement.empty() try{switch(this.contentKind){case i.TooltipContentKind.TEXT:this._contentElement.text(n).css("white-space","pre-wrap"),this._tooltipElement.css("pointer-events","none") break case i.TooltipContentKind.IMAGE:t('').appendTo(this._contentElement),this._tooltipElement.css("pointer-events","none") break case i.TooltipContentKind.HTML:this._contentElement.css("white-space","normal"),e.HtmlUtil.removeUnsecureTags(n).appendTo(this._contentElement),this._tooltipElement.css("pointer-events","auto")}}catch(e){}},n.prototype.saveState=function(){return e.JsUtil.clone(this._options)},n.prototype.loadState=function(e){this._options=e||t.extend(!0,{},n.defaults),this.applyTheme(),this._applyText()},n.prototype.show=function(e){this.text&&(this._visible=!0,this._isInDom||(this._tooltipElement=i.HtmlContainer.instance.register(this._id,this._tooltipElement),this._isInDom=!0),this.moveTo(e),this._tooltipElement.css("visibility","visible"))},n.prototype.hide=function(){this._visible=!1,this._tooltipElement.css("visibility","hidden")},n.prototype._actualPosition=function(e){var t=this.layoutRect if(!t)return i.TooltipPosition.TOP var n=this.size.height+15 return e.y-n>=t.top?i.TooltipPosition.TOP:e.y+n<=t.top+t.height?i.TooltipPosition.BOTTOM:i.TooltipPosition.TOP},n.prototype._adjustArrow=function(e,t){var n=this.theme,o=n?n.border.color:"transparent",n=(n?n.fill.enabled:1)&&n?n.fill.color:"transparent",s=t===i.TooltipPosition.BOTTOM,a=s?"bottom: 100%; top: auto;":"top: 100%; bottom: auto;",l=s?"border-top-color: transparent;":"border-bottom-color: transparent;",r=5>e||95a&&(s=a-o.width)),{x:s,y:n}},n.prototype.destroy=function(){this._tooltipElement&&(this._tooltipElement.remove(),this._tooltipElement=null,this._isInDom=!1)},n.defaults={text:"",kind:i.TooltipContentKind.TEXT},n}() i.Tooltip=n}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={}))