BarterDEX/gui/js/charts/StockChartX.UI.min.js

572 lines
185 KiB
JavaScript

/* 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 [email protected].*/
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&&t<o.minValue&&(t=o.minValue),null!=o.maxValue&&t>o.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<n?"\\.":"$")+")",t=t.toFixed(Math.max(0,~~n)).replace(new RegExp(o,"g"),"$1,")),e.val(t),t}function o(e,t){var n,o=i(e).settings
n=e.val()
for(var r=o.canBeNegative,c=0<o.priceDecimals,_=n.length-1;0<=_;_--)a(n[_],r,c)||(n=l(n,_))
return"-"===n?null:0===n.replace(/-/gi,"").length?null:(""!==n&&"."!==n||(n="0"),n=0<o.priceDecimals?s(n,t):s(n),parseFloat(n))}function s(e,i){void 0===i&&(i=""),-1<e.indexOf("-")&&(e="-"+e.replace(/-/g,""))
var t
if(t=i.length){t=e
for(var n=[],o=-1;-1!==(o=t.indexOf(".",o+1));)n.push(o)
t=1<n.length}return t&&(t=i.indexOf("."),n=i.length-t,t=e.substr(0,t)===i.substr(0,t)?t:e.length-n,e=l(e,t)),e.replace(/,/g,"")}function a(e,i,t){switch(void 0===i&&(i=!1),void 0===t&&(t=!1),e){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case",":return!0
case".":return t
case"-":return i
default:return!1}}function l(e,i,t){void 0===t&&(t="")
var n=0===t.length?i+1:i+t.length
return e.substr(0,i)+t+e.substr(n)}function r(e){return null===e?0:("string"==typeof e&&(e=parseInt(e,10)),Math.ceil(e.toString().length/3)-1)}function c(e){var i=d('<div class="'+p.FIELD_WRAPPER+'">'),t=d('<div class="'+p.ARROW_WRAPPER+" "+p.ARROW_UP+'"><span class="'+p.ARROW+'"></span></div>'),n=d('<div class="'+p.ARROW_WRAPPER+" "+p.ARROW_DOWN+'"><span class="'+p.ARROW+'"></span></div>'),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&&0<e.minValue?e.minValue:0)
0<e.priceDecimals&&c&&(t=2),c=r(l),c!==a&&(t+=c-a),0===e.priceDecimals&&!e.canBeNegative&&-1<i.val().indexOf("-")&&--t,s=null===l?n(i,"-"):n(i,l),i[0].setSelectionRange(t,t),a=c}),i.on("blur",function(){var i=d(this)
0===e.priceDecimals&&""===i.val()?n(i,s):n(i,o(i),!0)}),s=n(i,e.value),a=r(e.value)})},show:function(){return this.each(function(){i(this).settings.showArrows?d(this).parent().show():d(this).show()})},hide:function(){return this.each(function(){i(this).settings.showArrows?d(this).parent().hide():d(this).hide()})},disable:function(){return this.each(function(){d(this).attr("disabled","disabled")})},enable:function(){return this.each(function(){d(this).removeAttr("disabled")})},isDisabled:function(){var e=d(this).attr("disabled")
return void 0!==e&&!1!==e},isEnabled:function(){var e=d(this).attr("disabled")
return!(void 0!==e&&!1!==e)},highlightInvalid:function(){return this.each(function(){d(this).addClass(p.INVALID_VALUE)})},unhighlightInvalid:function(){return this.each(function(){d(this).removeClass(p.INVALID_VALUE)})},setValue:function(e){return this.each(function(){n(d(this),e)})},getValue:function(){return o(d(this))},setBounds:function(e,t){return this.each(function(){if(null!=e||null!=t){var s=i(this).settings
null!=e&&(s.minValue=e),null!=t&&(s.maxValue=t),d(this).trigger("input"),n(d(this),o(d(this)),!0)}})},onChange:function(e){return this.each(function(){i(this).settings.onChange=e})}}
d.fn.scxNumericField=function(e){return g[e]?g[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void d.error("Method "+e+" doesn't exist for jQuery.numericField"):g.init.apply(this,arguments)}}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(i){var t=jQuery,n=function(){function i(e,i){var n=this._getInitParams()
this._picker=e.spectrum(t.extend(n,i))}return i.prototype.getColor=function(){return this._picker.spectrum("get").toRgbString()},i.prototype.setColor=function(e){this._picker.spectrum("set",e)},i.prototype.spectrum=function(e,i){this._picker.spectrum(e,i)},i.prototype._getInitParams=function(){return e.Environment.isPhone?{color:"#000",showInput:!1,showInitial:!0,allowEmpty:!1,showAlpha:!1,disabled:!1,maxSelectionSize:1,showPalette:!0,showSelectionPalette:!1,showPaletteOnly:!0,palette:this._getPalette()}:{color:"#000",showInput:!1,showInitial:!0,allowEmpty:!1,showAlpha:!1,disabled:!1,maxSelectionSize:1,showPalette:!0,showSelectionPalette:!0,showPaletteOnly:!0,togglePaletteOnly:!0,palette:this._getPalette(),cancelText:"Cancel",chooseText:"Choose",togglePaletteMoreText:"More",togglePaletteLessText:"Less"}},i.prototype._getPalette=function(){return e.Environment.isPhone?["#000 #444 #666 #999 #ccc #eee #f3f3f3 #fff".split(" "),"#f00 #f90 #ff0 #0f0 #0ff #00f #90f #f0f".split(" "),"#ea9999 #f9cb9c #ffe599 #b6d7a8 #a2c4c9 #9fc5e8 #b4a7d6 #d5a6bd".split(" "),"#80c00000 #80b45f06 #80bf9000 #8038761d #80134f5c #800b5394 #80351c75 #80741b47".split(" ")]:["#000 #444 #666 #999 #ccc #eee #f3f3f3 #fff".split(" "),"#f00 #f90 #ff0 #0f0 #0ff #00f #90f #f0f".split(" "),"#f4cccc #fce5cd #fff2cc #d9ead3 #d0e0e3 #cfe2f3 #d9d2e9 #ead1dc".split(" "),"#ea9999 #f9cb9c #ffe599 #b6d7a8 #a2c4c9 #9fc5e8 #b4a7d6 #d5a6bd".split(" "),"#e06666 #f6b26b #ffd966 #93c47d #76a5af #6fa8dc #8e7cc3 #c27ba0".split(" "),"#c00 #e69138 #f1c232 #6aa84f #45818e #3d85c6 #674ea7 #a64d79".split(" "),"#900 #b45f06 #bf9000 #38761d #134f5c #0b5394 #351c75 #741b47".split(" "),"#600 #783f04 #7f6000 #274e13 #0c343d #073763 #20124d #4c1130".split(" ")]},i}()
i.ColorPicker=n}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(e){var i=jQuery,t=function(){function e(e,t){var n=this
this._isShown=!1,this._config=e
var o=i("body")
t&&(t.on("contextmenu",function(e){return o.trigger("scxContextMenuOpen"),n.show(e),!1}),e.showOnClick&&t.on("click",function(e){return o.trigger("scxContextMenuOpen"),n.show(e),!1})),i(document).on("click touchstart",function(e){2!==e.button&&n._isShown&&n.hide()}),i(window).on("scroll resize",function(){n._isShown&&n.hide()}),o.on("scxContextMenuOpen",function(){n._isShown&&n.hide()})}return e.prototype.hide=function(){this._isShown=!1,this._config.menuContainer.hide()},e.prototype.show=function(t){var n=this
this._config.onShow&&this._config.onShow(),this._config.menuContainer&&(this._config.menuContainer.data("target",i(t.target)).show().css(this._calculateMenuPosition(this._getLeftLocation(t),this._getTopLocation(t))).off("click").on("click",function(e){if(e.preventDefault(),n.hide(),!n._config.onItemSelected)return!1
if(e=i(e.target).blur().parent(),e.hasClass("disabled"))return!1
if(e.hasClass("scxMenuItemCheckable")){var t=e.hasClass("scxMenuItemChecked")
t?e.removeClass("scxMenuItemChecked"):e.addClass("scxMenuItemChecked"),n._config.onItemSelected(e,!t)}else n._config.onItemSelected(e)
return!1}).find(".scxMenuItemWithSubMenu").each(function(){e._getSubMenuTopLocation(i(this))}),this._isShown=!0)},e.prototype._getLeftLocation=function(e){e=e.pageX||e.originalEvent&&e.originalEvent.pageX
var t=i(window).width(),n=this._config.menuContainer.width()
return e+n>t&&n<e?e-n:e},e.prototype._getTopLocation=function(e){e=e.pageY||e.originalEvent&&e.originalEvent.pageY
var t=i(window).height(),n=this._config.menuContainer.height()
return e+n>t&&n<e?e-n:e},e.prototype._calculateMenuPosition=function(e,t){var n=this._config.menuContainer
n.css({width:"auto",height:"auto"})
var o=i(window).height(),s=n.outerHeight(!0),a=t
return s>o&&(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(e<i){var i=i-this._dialogContent.dialog.height(),t=this._dialogContent.body.outerHeight(!0)-this._dialogContent.body.height(),n=this._dialogContent.header.outerHeight(!0),o=this._dialogContent.footer.outerHeight(!0)
this._dialogContent.body.height(e-n-o-t-i)}},t}()
e.Dialog=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,{CLONE:"clone",DELETE:"delete",SETTINGS:"settings"})
Object.freeze(i)
var t=function(t){function n(i,o){t.call(this,i,o),e.HtmlLoader.getView("DrawingContextMenu.html",function(t){n._container||(n._container=e.HtmlContainer.instance.register("DrawingContextMenu",t)),i.menuContainer=n._container})}return __extends(n,t),n._container=null,n.MenuItem=i,n}(e.ContextMenu)
e.DrawingContextMenu=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(i){var t=function(t){function s(e){t.call(this,e),this._isApplyClicked=!1,this._initFields(),this._init()}return __extends(s,t),s.prototype.show=function(e){this._config=e,this._isApplyClicked=!1,this._switchView(),this._tabs.activate(0),this._setValues(this._config.drawing),t.prototype.show.call(this,e)},s.prototype.hide=function(){!this._isApplyClicked&&this._config.cancel&&this._config.cancel(),this._config.always&&this._config.always(),this._config=null,t.prototype.hide.call(this)},s.prototype._init=function(){var e=this
this._tabs=new i.Tabs({tabsContainer:this._tabItemsContainer,panelsContainer:this._tabPanelsContainer,onChange:function(i){e.resize()}}),this._input_lineWidth.scxNumericField(s._numericFieldConfig),this._chk_lineEnabled=new Switchery(document.querySelector("#scxDrawingDialog_chk_lineColor"),s._switcherySettings),this._chk_lineEnabled.setPosition(!0),this._chk_fillEnabled=new Switchery(document.querySelector("#scxDrawingDialog_chk_fillColor"),s._switcherySettings),this._chk_fillEnabled.setPosition(!0),this._chk_fill2Enabled=new Switchery(document.querySelector("#scxDrawingDialog_chk_fillColor2"),s._switcherySettings),this._chk_fill2Enabled.setPosition(!0),this._input_labelFont.selectpicker({container:"body"}).change(function(i){e._input_labelFont.next().css({"font-family":i.target.value})}),this._input_labelSize.selectpicker({container:"body"}),this._input_lineStyle.selectpicker({container:"body"}),this._input_textFont.selectpicker({container:"body"}).change(function(i){e._input_textFont.next().css({"font-family":i.target.value})}),this._input_textSize.selectpicker({container:"body"}),this._textStylesChooser=new n(this._inputs_textStyles),this._initImagePreview(this._input_imageUrl,this._input_imagePreview),this._input_tooltipBorderWidth.scxNumericField(s._numericFieldConfig),this._input_tooltipBorderStyle.selectpicker({container:"body"}),this._chk_tooltipBorderEnabled=new Switchery(document.querySelector("#scxDrawingDialog_chk_tooltipBorderColor"),s._switcherySettings),this._chk_tooltipBorderEnabled.setPosition(!0),this._chk_tooltipFillEnabled=new Switchery(document.querySelector("#scxDrawingDialog_chk_tooltipFillColor"),s._switcherySettings),this._chk_tooltipFillEnabled.setPosition(!0),this._tooltipKindChooser=new o({onChange:function(){e.resize()},buttons:this._inputs_tooltipKind,panelText:this._panelToolipText,panelTextStyle:this._panelToolipTextStyle,panelImage:this._panelTooltipImage}),this._input_tooltipTextFont.selectpicker({container:"body"}).change(function(i){e._input_tooltipTextFont.next().css({"font-family":i.target.value})}),this._input_tooltipTextSize.selectpicker({container:"body"}),this._tooltipTextStylesChooser=new n(this._inputs_tooltipTextStyles),this._initImagePreview(this._input_tooltipImageUrl,this._input_tooltipImagePreview),this._dialog.find(".scxSpectrum").scx().colorPicker({containerClassName:"scxSpectrumDrawingDialog",localStorageKey:"scxThemeDialog_spectrum",showAlpha:!0}),$("body").bind("scxSwitcherChanged",function(i,t){var n=$(t.target),o=t.checked
n.is(e._chk_lineEnabledHTMLObj)?e._setLineState(o):n.is(e._chk_fillEnabledHTMLObj)?e._setFillState(o):n.is(e._chk_textBackgroundEnabledHTMLObj)?e._setTextBackgroundState(o):n.is(e._chk_textBorderEnabledHTMLObj)?e._setTextBorderState(o):n.is(e._chk_tooltipBorderEnabledHTMLObj)?e._setTooltipBorderState(o):n.is(e._chk_tooltipFillEnabledHTMLObj)&&e._setTooltipFillState(o)}),this._dialog.find("#scxDrawingDialog_btn_resetToDefaults").on("click",function(){e.resetToDefaults()}),this._dialog.find("#scxDrawingDialog_btn_save").on("click",function(){e._save()}),this._dialog.find("#scxDrawingDialog_btn_apply").on("click",function(){e._apply()})},s.prototype._initImagePreview=function(e,i){var t=null
e.on("keyup",function(){var n=e.val()
i.parent().addClass("scxLoading"),i.hide(),t&&clearTimeout(t),t=setTimeout(function(){i.attr("src",n)},1e3)}),i.load(function(e){$(e.currentTarget).show(),$(e.currentTarget).parent().removeClass("scxHasBg"),$(e.currentTarget).parent().removeClass("scxLoading")}),i.error(function(e){$(e.currentTarget).parent().addClass("scxHasBg"),$(e.currentTarget).parent().removeClass("scxLoading"),$(e.currentTarget).hide()})},s.prototype._resetImagePreview=function(e){e.attr("src","").hide().parent().addClass("scxHasBg").removeClass("scxLoading")},s.prototype.resetToDefaults=function(){var t=e.JsUtil.clone(this._config.drawing)
if(0==this._tabs.activeIndex())switch(t.theme=t.defaultTheme,t.className){case e.NoteDrawing.className:$.extend(!0,t,e.NoteDrawing.defaults)
break
case e.ImageDrawing.className:t.url=""
break
case e.TextDrawing.className:case e.BalloonDrawing.className:t.text=""}1==this._tabs.activeIndex()&&(t.tooltip=e.JsUtil.clone(t.tooltip),t.tooltip.theme=t.tooltip.defaultTheme,t.tooltip.contentKind=i.TooltipContentKind.TEXT,t.tooltip.text=""),this._setValues(t,!0)},s.prototype._setLineState=function(e){e?(this._input_lineColor.spectrum("enable"),this._label_lineEnabled.removeClass("disabled"),this._input_lineStyle.removeAttr("disabled").selectpicker("refresh"),this._input_lineWidth.scxNumericField("enable"),this._chk_lineEnabled.isChecked()||this._chk_lineEnabled.setPosition(!0)):(this._input_lineColor.spectrum("disable"),this._label_lineEnabled.addClass("disabled"),this._input_lineStyle.attr("disabled","disabled").selectpicker("refresh"),this._input_lineWidth.scxNumericField("disable"),this._chk_lineEnabled.isChecked()&&this._chk_lineEnabled.setPosition(!0))},s.prototype._setFillState=function(e){e?(this._input_fillColor.spectrum("enable"),this._label_fillEnabled.removeClass("disabled"),this._chk_fillEnabled.isChecked()||this._chk_fillEnabled.setPosition(!0)):(this._input_fillColor.spectrum("disable"),this._label_fillEnabled.addClass("disabled"),this._chk_fillEnabled.isChecked()&&this._chk_fillEnabled.setPosition(!0))},s.prototype._setFill2State=function(e){e?(this._input_fillColor2.spectrum("enable"),this._label_fill2Enabled.removeClass("disabled"),this._chk_fill2Enabled.isChecked()||this._chk_fill2Enabled.setPosition(!0)):(this._input_fillColor2.spectrum("disable"),this._label_fill2Enabled.addClass("disabled"),this._chk_fill2Enabled.isChecked()&&this._chk_fill2Enabled.setPosition(!0))},s.prototype._setTextBackgroundState=function(e){e?(this._input_textBackColor.spectrum("enable"),this._label_textBackgroundEnabled.removeClass("disabled")):(this._input_textBackColor.spectrum("disable"),this._label_textBackgroundEnabled.addClass("disabled"))},s.prototype._setTextBorderState=function(e){e?(this._input_textBorderColor.spectrum("enable"),this._label_textBorderEnabled.removeClass("disabled")):(this._input_textBorderColor.spectrum("disable"),this._label_textBorderEnabled.addClass("disabled"))},s.prototype._setTooltipBorderState=function(e){e?(this._label_tooltipBorderEnabled.removeClass("disabled"),this._input_tooltipBorderColor.spectrum("enable"),this._input_tooltipBorderStyle.removeAttr("disabled").selectpicker("refresh"),this._input_tooltipBorderWidth.scxNumericField("enable"),this._chk_tooltipBorderEnabled.isChecked()||this._chk_tooltipBorderEnabled.setPosition(!0)):(this._label_tooltipBorderEnabled.addClass("disabled"),this._input_tooltipBorderColor.spectrum("disable"),this._input_tooltipBorderStyle.attr("disabled","disabled").selectpicker("refresh"),this._input_tooltipBorderWidth.scxNumericField("disable"),this._chk_tooltipBorderEnabled.isChecked()&&this._chk_tooltipBorderEnabled.setPosition(!0))},s.prototype._setTooltipFillState=function(e){e?(this._label_tooltipFillEnabled.removeClass("disabled"),this._input_tooltipFillColor.spectrum("enable"),this._chk_tooltipFillEnabled.isChecked()||this._chk_tooltipFillEnabled.setPosition(!0)):(this._label_tooltipFillEnabled.addClass("disabled"),this._input_tooltipFillColor.spectrum("disable"),this._chk_tooltipFillEnabled.isChecked()&&this._chk_tooltipFillEnabled.setPosition(!0))},s.prototype._switchView=function(){switch(this._dialog.find(".scxSpectrum").spectrum("enable"),this._panelFigure.hide(),this._panelImage.hide(),this._panelText.hide(),this._panelFigureLine.hide(),this._panelFigureLineEnabled.hide(),this._panelFigureFill.hide(),this._panelFigureFillEnabled.hide(),this._panelFigureFill2.hide(),this._panelFigureFill2Enabled.hide(),this._panelFigureLabel.hide(),this._title.text(this._getDrawingTitle()),this._tooltipKindChooser.setKind(this._config.drawing.tooltip.contentKind),this._config.drawing.className){case e.DotDrawing.className:case e.SquareDrawing.className:case e.DiamondDrawing.className:case e.ArrowUpDrawing.className:case e.ArrowDownDrawing.className:case e.ArrowLeftDrawing.className:case e.ArrowRightDrawing.className:case e.Arrow.className:this._panelFigureFill.show(),this._panelFigure.show()
break
case e.NoteDrawing.className:this._panelFigureFill.show(),this._panelFigureFillEnabled.show(),this._panelFigureFill2.show(),this._panelFigureFill2Enabled.show(),this._panelFigureLabel.show(),this._panelFigure.show()
break
case e.LineSegmentDrawing.className:case e.HorizontalLineDrawing.className:case e.VerticalLineDrawing.className:case e.TrendChannelDrawing.className:case e.ErrorChannelDrawing.className:case e.TironeLevelsDrawing.className:case e.QuadrantLinesDrawing.className:case e.RaffRegressionDrawing.className:case e.SpeedLinesDrawing.className:case e.GannFanDrawing.className:case e.PolylineDrawing.className:case e.AndrewsPitchforkDrawing.className:this._panelFigureLine.show(),this._panelFigure.show()
break
case e.RectangleDrawing.className:case e.TriangleDrawing.className:case e.CircleDrawing.className:case e.EllipseDrawing.className:case e.PolygonDrawing.className:this._panelFigureLine.show(),this._panelFigureLineEnabled.show(),this._panelFigureFill.show(),this._panelFigureFillEnabled.show(),this._panelFigure.show()
break
case e.TextDrawing.className:this._panelText.show(),this._input_text.show(),this._inputs_textStyles.show()
break
case e.ImageDrawing.className:this._panelImage.show()
break
case e.BalloonDrawing.className:this._panelFigureLine.show(),this._panelFigureLineEnabled.show(),this._panelFigureFill.show(),this._panelFigureFillEnabled.show(),this._panelFigure.show(),this._input_text.show(),this._inputs_textStyles.show(),this._panelText.show()
break
case e.MeasureDrawing.className:this._panelFigureLine.show(),this._panelFigureLineEnabled.show(),this._panelFigureFill.show(),this._panelFigureFillEnabled.show(),this._panelFigure.show(),this._panelText.show(),this._input_text.hide(),this._inputs_textStyles.hide()
break
case e.FreeHandDrawing.className:this._panelFigure.show(),this._panelFigureLine.show()}},s.prototype._getDrawingTitle=function(){switch(this._config.drawing.className){case e.LineSegmentDrawing.className:return"Line Segment Settings"
case e.DotDrawing.className:return"Dot Marker Settings"
case e.SquareDrawing.className:return"Square Marker Settings"
case e.DiamondDrawing.className:return"Diamond Marker Settings"
case e.ArrowUpDrawing.className:return"Arrow Up Marker Settings"
case e.MeasureDrawing.className:return"Measure Settings"
case e.ArrowDownDrawing.className:return"Arrow Down Marker Settings"
case e.ArrowLeftDrawing.className:return"Arrow Left Marker Settings"
case e.ArrowRightDrawing.className:return"Arrow Right Marker Settings"
case e.NoteDrawing.className:return"Note Marker Settings"
case e.Arrow.className:return"Arrow Drawing Settings"
case e.HorizontalLineDrawing.className:return"Horizontal Line Settings"
case e.VerticalLineDrawing.className:return"Vertical Line Settings"
case e.PolylineDrawing.className:return"Polyline Settings"
case e.RectangleDrawing.className:return"Rectangle Settings"
case e.PolygonDrawing.className:return"Polygon Settings"
case e.TriangleDrawing.className:return"Triangle Settings"
case e.CircleDrawing.className:return"Circle Settings"
case e.EllipseDrawing.className:return"Ellipse Settings"
case e.TextDrawing.className:return"Text Settings"
case e.BalloonDrawing.className:return"Balloon Settings"
case e.ImageDrawing.className:return"Image Settings"
case e.TrendChannelDrawing.className:return"Trend Channel Settings"
case e.ErrorChannelDrawing.className:return"Error Channel Settings"
case e.TironeLevelsDrawing.className:return"Tirone Levels Settings"
case e.QuadrantLinesDrawing.className:return"Quadrant Lines Settings"
case e.RaffRegressionDrawing.className:return"Raff Regression Settings"
case e.SpeedLinesDrawing.className:return"Speed Lines Settings"
case e.GannFanDrawing.className:return"Gann Fan Settings"
case e.FreeHandDrawing.className:return"Free Hand Settings"
case e.AndrewsPitchforkDrawing.className:return"Andrews Pitchfork Settings"
default:throw Error("Unknown drawing: "+this._config.drawing.className)}},s.prototype._setValues=function(t,n){if(!(n=!!n)||n&&1==this._tabs.activeIndex()){var o=t.tooltip,s=o.theme||o.actualTheme
this._setLineState(s.border.enabled),this._setTooltipBorderState(s.border.enabled),this._input_tooltipBorderColor.spectrum("set",s.border.color),this._input_tooltipBorderStyle.selectpicker("val",s.border.lineStyle||e.LineStyle.SOLID).selectpicker("refresh"),this._input_tooltipBorderWidth.scxNumericField("setValue",s.border.width),this._setTooltipFillState(s.fill.enabled),this._input_tooltipFillColor.spectrum("set",s.fill.color),o.contentKind==i.TooltipContentKind.IMAGE?(this._input_tooltipText.val(""),this._input_tooltipImageUrl.val(o.text),this._input_tooltipImagePreview.attr("src",o.text),!o.text&&this._resetImagePreview(this._input_tooltipImagePreview)):(this._input_tooltipText.val(o.text),this._input_tooltipImageUrl.val(""),this._resetImagePreview(this._input_tooltipImagePreview)),this._input_tooltipTextColor.spectrum("set",s.text.fillColor),this._input_tooltipTextFont.selectpicker("val",s.text.fontFamily).selectpicker("refresh"),this._input_tooltipTextSize.selectpicker("val",s.text.fontSize).selectpicker("refresh"),this._tooltipTextStylesChooser.setStyle("b","bold"===s.text.fontWeight),this._tooltipTextStylesChooser.setStyle("i","italic"===s.text.fontStyle),this._tooltipTextStylesChooser.setStyle("u","underline"===s.text.decoration)}if(!n||n&&0==this._tabs.activeIndex())switch(o=t.theme||t.actualTheme,t.className){case e.DotDrawing.className:case e.SquareDrawing.className:case e.DiamondDrawing.className:case e.ArrowUpDrawing.className:case e.ArrowDownDrawing.className:case e.ArrowLeftDrawing.className:case e.ArrowRightDrawing.className:this._setFillState(!0),this._input_fillColor.spectrum("set",o.fill.fillColor)
break
case e.NoteDrawing.className:this._setFillState(void 0===o.fill.fillEnabled||o.fill.fillEnabled),this._input_fillColor.spectrum("set",o.fill.fillColor),this._setFill2State(void 0===o.centerPointFill.fillEnabled||o.centerPointFill.fillEnabled),this._input_fillColor2.spectrum("set",o.centerPointFill.fillColor),this._input_labelText.val(t.label),this._input_labelColor.spectrum("set",o.text.fillColor),this._input_labelFont.selectpicker("val",o.text.fontFamily).selectpicker("refresh"),this._input_labelSize.selectpicker("val",o.text.fontSize).selectpicker("refresh")
break
case e.LineSegmentDrawing.className:case e.HorizontalLineDrawing.className:case e.VerticalLineDrawing.className:case e.TrendChannelDrawing.className:case e.ErrorChannelDrawing.className:case e.TironeLevelsDrawing.className:case e.QuadrantLinesDrawing.className:case e.RaffRegressionDrawing.className:case e.SpeedLinesDrawing.className:case e.GannFanDrawing.className:case e.PolylineDrawing.className:case e.AndrewsPitchforkDrawing.className:this._setLineState(!0),this._input_lineColor.spectrum("set",o.line.strokeColor),this._input_lineStyle.selectpicker("val",o.line.lineStyle||e.LineStyle.SOLID).selectpicker("refresh"),this._input_lineWidth.scxNumericField("setValue",o.line.width)
break
case e.RectangleDrawing.className:case e.TriangleDrawing.className:case e.CircleDrawing.className:case e.EllipseDrawing.className:case e.PolygonDrawing.className:this._setLineState(void 0===o.line.strokeEnabled||o.line.strokeEnabled),this._input_lineColor.spectrum("set",o.line.strokeColor),this._input_lineStyle.selectpicker("val",o.line.lineStyle||e.LineStyle.SOLID).selectpicker("refresh"),this._input_lineWidth.scxNumericField("setValue",o.line.width),this._setFillState(void 0===o.fill.fillEnabled||o.fill.fillEnabled),this._input_fillColor.spectrum("set",o.fill.fillColor)
break
case e.TextDrawing.className:this._input_text.val(t.text),this._input_textColor.spectrum("set",o.text.fillColor),this._input_textFont.selectpicker("val",o.text.fontFamily).selectpicker("refresh"),this._input_textSize.selectpicker("val",o.text.fontSize).selectpicker("refresh"),this._textStylesChooser.setStyle("b","bold"===o.text.fontWeight),this._textStylesChooser.setStyle("i","italic"===o.text.fontStyle),this._textStylesChooser.setStyle("u","underline"===o.text.decoration)
break
case e.ImageDrawing.className:o=t.url,this._input_imageUrl.val(o),this._input_imagePreview.attr("src",o),!o&&this._resetImagePreview(this._input_imagePreview)
break
case e.BalloonDrawing.className:this._setLineState(void 0===o.line.strokeEnabled||o.line.strokeEnabled),this._input_lineColor.spectrum("set",o.line.strokeColor),this._input_lineStyle.selectpicker("val",o.line.lineStyle||e.LineStyle.SOLID).selectpicker("refresh"),this._input_lineWidth.scxNumericField("setValue",o.line.width),this._setFillState(void 0===o.fill.fillEnabled||o.fill.fillEnabled),this._input_fillColor.spectrum("set",o.fill.fillColor),this._input_text.val(t.text),this._input_textColor.spectrum("set",o.text.fillColor),this._input_textFont.selectpicker("val",o.text.fontFamily).selectpicker("refresh"),this._input_textSize.selectpicker("val",o.text.fontSize).selectpicker("refresh"),this._textStylesChooser.setStyle("b","bold"===o.text.fontWeight),this._textStylesChooser.setStyle("i","italic"===o.text.fontStyle),this._textStylesChooser.setStyle("u","underline"===o.text.decoration)
break
case e.MeasureDrawing.className:this._setLineState(void 0===o.line.strokeEnabled||o.line.strokeEnabled),this._input_lineColor.spectrum("set",o.line.strokeColor),this._input_lineStyle.selectpicker("val",o.line.lineStyle||e.LineStyle.SOLID).selectpicker("refresh"),this._input_lineWidth.scxNumericField("setValue",o.line.width),this._setFillState(void 0===o.fill.fillEnabled||o.fill.fillEnabled),this._input_fillColor.spectrum("set",o.fill.fillColor),this._input_text.val(t.text),this._input_textColor.spectrum("set",o.balloon.text.fillColor),this._input_textFont.selectpicker("val",o.balloon.text.fontFamily).selectpicker("refresh"),this._input_textSize.selectpicker("val",o.balloon.text.fontSize).selectpicker("refresh")
break
case e.FreeHandDrawing.className:this._setLineState(!0),this._input_lineColor.spectrum("set",o.line.strokeColor),this._input_lineStyle.selectpicker("val",o.line.lineStyle||e.LineStyle.SOLID).selectpicker("refresh"),this._input_lineWidth.scxNumericField("setValue",o.line.width)}},s.prototype._save=function(){this._apply(),this._validateInputValue()&&this.hide()},s.prototype._apply=function(){var t=this._config.drawing,n=$.extend(!0,{},t.actualTheme),o=t.tooltip,s=$.extend(!0,{},o.actualTheme)
switch(s.border.enabled=this._chk_tooltipBorderEnabled.isChecked(),s.border.color=this._input_tooltipBorderColor.spectrum("get").toRgbString(),s.border.lineStyle=this._input_tooltipBorderStyle.selectpicker("val"),s.border.width=this._input_tooltipBorderWidth.scxNumericField("getValue"),s.fill.enabled=this._chk_tooltipFillEnabled.isChecked(),s.fill.color=this._input_tooltipFillColor.spectrum("get").toRgbString(),o.contentKind=this._tooltipKindChooser.getKind(),o.contentKind){case i.TooltipContentKind.IMAGE:o.text=e.JsUtil.filterText(this._input_tooltipImageUrl.val())
break
case i.TooltipContentKind.TEXT:o.text=this._input_tooltipText.val().trim()
break
case i.TooltipContentKind.HTML:o.text=this._input_tooltipText.val().trim()}switch(s.text.fillColor=this._input_tooltipTextColor.spectrum("get").toRgbString(),s.text.fontFamily=this._input_tooltipTextFont.selectpicker("val"),s.text.fontSize=this._input_tooltipTextSize.selectpicker("val"),s.text.fontWeight=this._tooltipTextStylesChooser.getStyle("b")?"bold":"normal",s.text.fontStyle=this._tooltipTextStylesChooser.getStyle("i")?"italic":"normal",s.text.decoration=this._tooltipTextStylesChooser.getStyle("u")?"underline":"",t.className){case e.DotDrawing.className:case e.SquareDrawing.className:case e.DiamondDrawing.className:case e.ArrowUpDrawing.className:case e.ArrowDownDrawing.className:case e.ArrowLeftDrawing.className:case e.ArrowRightDrawing.className:case e.Arrow.className:s.fill.color=this._input_fillColor.spectrum("get").toRgbString(),n.fill.fillColor=this._input_fillColor.spectrum("get").toRgbString()
break
case e.NoteDrawing.className:n.fill.fillColor=this._input_fillColor.spectrum("get").toRgbString(),n.fill.fillEnabled=this._chk_fillEnabled.isChecked(),n.centerPointFill.fillColor=this._input_fillColor2.spectrum("get").toRgbString(),n.centerPointFill.fillEnabled=this._chk_fill2Enabled.isChecked(),t.label=this._input_labelText.val(),n.text.fillColor=this._input_labelColor.spectrum("get").toRgbString(),n.text.fontFamily=this._input_labelFont.selectpicker("val"),n.text.fontSize=this._input_labelSize.selectpicker("val")
break
case e.LineSegmentDrawing.className:case e.HorizontalLineDrawing.className:case e.VerticalLineDrawing.className:case e.TrendChannelDrawing.className:case e.ErrorChannelDrawing.className:case e.TironeLevelsDrawing.className:case e.QuadrantLinesDrawing.className:case e.RaffRegressionDrawing.className:case e.SpeedLinesDrawing.className:case e.GannFanDrawing.className:case e.PolylineDrawing.className:case e.AndrewsPitchforkDrawing.className:n.line.strokeColor=this._input_lineColor.spectrum("get").toRgbString(),n.line.width=this._input_lineWidth.scxNumericField("getValue"),n.line.lineStyle=this._input_lineStyle.selectpicker("val")
break
case e.RectangleDrawing.className:case e.TriangleDrawing.className:case e.CircleDrawing.className:case e.EllipseDrawing.className:case e.PolygonDrawing.className:n.line.strokeEnabled=this._chk_lineEnabled.isChecked(),n.line.strokeColor=this._input_lineColor.spectrum("get").toRgbString(),n.line.width=this._input_lineWidth.scxNumericField("getValue"),n.line.lineStyle=this._input_lineStyle.selectpicker("val"),n.fill.fillEnabled=this._chk_fillEnabled.isChecked(),n.fill.fillColor=this._input_fillColor.spectrum("get").toRgbString()
break
case e.ImageDrawing.className:if(!this._validateInputValue())return void e.UI.Notification.warning("Image URL is not specified")
t.url=e.JsUtil.filterText(this._input_imageUrl.val())
break
case e.TextDrawing.className:if(!this._validateInputValue())return void e.UI.Notification.warning("Text is not specified")
o=e.JsUtil.filterText(this._input_text.val()),t.text=o.length?o:t.text,n.text.fillColor=this._input_textColor.spectrum("get").toRgbString(),n.text.fontFamily=this._input_textFont.selectpicker("val"),n.text.fontSize=parseInt(this._input_textSize.selectpicker("val"),10),n.text.fontWeight=this._textStylesChooser.getStyle("b")?"bold":"normal",n.text.fontStyle=this._textStylesChooser.getStyle("i")?"italic":"normal",n.text.decoration=this._textStylesChooser.getStyle("u")?"underline":""
break
case e.BalloonDrawing.className:if(!this._validateInputValue())return void e.UI.Notification.warning("Text is not specified")
o=e.JsUtil.filterText(this._input_text.val()),t.text=o.length?o:t.text,n.text.fillColor=this._input_textColor.spectrum("get").toRgbString(),n.text.fontFamily=this._input_textFont.selectpicker("val"),n.text.fontSize=parseInt(this._input_textSize.selectpicker("val"),10),n.text.fontWeight=this._textStylesChooser.getStyle("b")?"bold":"normal",n.text.fontStyle=this._textStylesChooser.getStyle("i")?"italic":"normal",n.text.decoration=this._textStylesChooser.getStyle("u")?"underline":"",n.line.strokeEnabled=this._chk_lineEnabled.isChecked(),n.line.strokeColor=this._input_lineColor.spectrum("get").toRgbString(),n.line.width=this._input_lineWidth.scxNumericField("getValue"),n.line.lineStyle=this._input_lineStyle.selectpicker("val"),n.fill.fillEnabled=this._chk_fillEnabled.isChecked(),n.fill.fillColor=this._input_fillColor.spectrum("get").toRgbString()
break
case e.MeasureDrawing.className:n.line.strokeEnabled=this._chk_lineEnabled.isChecked(),n.line.strokeColor=this._input_lineColor.spectrum("get").toRgbString(),n.line.width=this._input_lineWidth.scxNumericField("getValue"),n.line.lineStyle=this._input_lineStyle.selectpicker("val"),n.border.strokeEnabled=this._chk_lineEnabled.isChecked(),n.border.strokeColor=this._input_lineColor.spectrum("get").toRgbString(),n.border.width=this._input_lineWidth.scxNumericField("getValue"),n.border.lineStyle=this._input_lineStyle.selectpicker("val"),n.fill.fillEnabled=this._chk_fillEnabled.isChecked(),n.fill.fillColor=this._input_fillColor.spectrum("get").toRgbString(),n.balloon.fill.fillEnabled=this._chk_fillEnabled.isChecked(),n.balloon.fill.fillColor=this._input_fillColor.spectrum("get").toRgbString(),n.balloon.text.fillColor=this._input_textColor.spectrum("get").toRgbString(),n.balloon.text.fontFamily=this._input_textFont.selectpicker("val"),n.balloon.text.fontSize=parseInt(this._input_textSize.selectpicker("val"),10)
break
case e.FreeHandDrawing.className:n.line.strokeColor=this._input_lineColor.spectrum("get").toRgbString(),n.line.width=this._input_lineWidth.scxNumericField("getValue"),n.line.lineStyle=this._input_lineStyle.selectpicker("val")}this._config.drawing.theme=n,this._config.drawing.tooltip.theme=s,this._config.drawing.chartPanel.update(),this._isApplyClicked=!0},s.prototype._validateInputValue=function(){switch(this._config.drawing.className){case e.ImageDrawing.className:if(!e.JsUtil.filterText(this._input_imageUrl.val()).length)return!1
break
case e.TextDrawing.className:case e.BalloonDrawing.className:if(!e.JsUtil.filterText(this._input_text.val()))return!1}return!0},s.prototype._initFields=function(){this._title=this._dialog.find("#scxDrawingDialog_title"),this._tabItemsContainer=this._dialog.find(".scxTabs"),this._tabPanelsContainer=this._dialog.find(".scxTabsContent"),this._panelFigure=this._dialog.find("#scxDrawingDialog_panel_figure"),this._panelFigureLine=this._dialog.find("#scxDrawingDialog_panel_figure_linePanel"),this._panelFigureLineEnabled=this._dialog.find("#scxDrawingDialog_panel_figure_lineEnabled"),this._panelFigureFill=this._dialog.find("#scxDrawingDialog_panel_figure_fillColorPanel"),this._panelFigureFillEnabled=this._dialog.find("#scxDrawingDialog_panel_figure_fillColorPanel_fillEnabled"),this._panelFigureFill2=this._dialog.find("#scxDrawingDialog_panel_figure_fillColorPanel2"),this._panelFigureFill2Enabled=this._dialog.find("#scxDrawingDialog_panel_figure_fillColorPanel2_fillEnabled"),this._panelFigureLabel=this._dialog.find("#scxDrawingDialog_panel_figure_label"),this._panelText=this._dialog.find("#scxDrawingDialog_panel_text"),this._panelImage=this._dialog.find("#scxDrawingDialog_panel_image"),this._panelToolipText=this._dialog.find("#scxDrawingDialog_panel_tooltipText"),this._panelToolipTextStyle=this._dialog.find("#scxDrawingDialog_panel_tooltipText_style"),this._panelTooltipImage=this._dialog.find("#scxDrawingDialog_panel_tooltipImage"),this._input_lineColor=this._dialog.find("#scxDrawingDialog_input_lineColor"),this._input_lineWidth=this._dialog.find("#scxDrawingDialog_input_lineWidth"),this._input_lineStyle=this._dialog.find("#scxDrawingDialog_input_lineStyle"),this._input_fillColor=this._dialog.find("#scxDrawingDialog_input_fillColor"),this._input_fillColor2=this._dialog.find("#scxDrawingDialog_input_fillColor2"),this._input_labelText=this._dialog.find("#scxDrawingDialog_input_labelText"),this._input_labelColor=this._dialog.find("#scxDrawingDialog_input_labelColor"),this._input_labelFont=this._dialog.find("#scxDrawingDialog_input_labelFont"),this._input_labelSize=this._dialog.find("#scxDrawingDialog_input_labelSize"),this._input_text=this._dialog.find("#scxDrawingDialog_input_text"),this._input_textColor=this._dialog.find("#scxDrawingDialog_input_textColor"),this._input_textFont=this._dialog.find("#scxDrawingDialog_input_textFont"),this._input_textSize=this._dialog.find("#scxDrawingDialog_input_textSize"),this._input_textColor=this._dialog.find("#scxDrawingDialog_input_textColor"),this._inputs_textStyles=this._dialog.find(".scxDrawingDialog_textStyles"),this._textStylesChooser=null,this._input_textBackColor=this._dialog.find("#scxDrawingDialog_input_textBackgroundColor"),this._input_textBorderColor=this._dialog.find("#scxDrawingDialog_input_textBorderColor"),this._input_imageUrl=this._dialog.find("#scxDrawingDialog_input_imageURL"),this._input_imagePreview=this._dialog.find("#scxDrawingDialog_imagePreview"),this._input_tooltipBorderColor=this._dialog.find("#scxDrawingDialog_input_tooltipBorderColor"),this._input_tooltipBorderWidth=this._dialog.find("#scxDrawingDialog_input_tooltipBorderWidth"),this._input_tooltipBorderStyle=this._dialog.find("#scxDrawingDialog_input_tooltipBorderStyle"),this._input_tooltipFillColor=this._dialog.find("#scxDrawingDialog_input_tooltipFillColor"),this._inputs_tooltipKind=this._dialog.find(".scxDrawingDialog_tooltipKind").children(),this._input_tooltipText=this._dialog.find("#scxDrawingDialog_input_tooltipText"),this._input_tooltipTextColor=this._dialog.find("#scxDrawingDialog_input_tooltipTextColor"),this._input_tooltipTextFont=this._dialog.find("#scxDrawingDialog_input_tooltipTextFont"),this._input_tooltipTextSize=this._dialog.find("#scxDrawingDialog_input_tooltipTextSize"),this._inputs_tooltipTextStyles=this._dialog.find(".scxDrawingDialog_tooltipTextStyles"),this._input_tooltipImageUrl=this._dialog.find("#scxDrawingDialog_input_tooltipImageURL"),this._input_tooltipImagePreview=this._dialog.find("#scxDrawingDialog_tooltipImagePreview"),this._chk_lineEnabledHTMLObj=this._dialog.find("#scxDrawingDialog_chk_lineColor"),this._chk_fillEnabledHTMLObj=this._dialog.find("#scxDrawingDialog_chk_fillColor"),this._chk_fill2EnabledHTMLObj=this._dialog.find("#scxDrawingDialog_chk_fillColor2"),this._chk_textBackgroundEnabledHTMLObj=this._dialog.find("#scxDrawingDialog_chk_textBackgroundColor"),this._chk_textBorderEnabledHTMLObj=this._dialog.find("#scxDrawingDialog_chk_textBorderColor"),this._chk_textBackgroundEnabled=this._dialog.find("#scxDrawingDialog_chk_textBackgroundColor"),this._chk_textBorderEnabled=this._dialog.find("#scxDrawingDialog_chk_textBorderColor"),this._chk_tooltipBorderEnabledHTMLObj=this._dialog.find("#scxDrawingDialog_chk_tooltipBorderColor"),this._chk_tooltipFillEnabledHTMLObj=this._dialog.find("#scxDrawingDialog_chk_tooltipFillColor"),this._label_lineEnabled=this._dialog.find("#scxDrawingDialog_label_lineColor"),this._label_fillEnabled=this._dialog.find("#scxDrawingDialog_label_fillColor"),this._label_fill2Enabled=this._dialog.find("#scxDrawingDialog_label_fillColor2"),this._label_textBackgroundEnabled=this._dialog.find("#scxDrawingDialog_label_textBackgroundColor"),this._label_textBorderEnabled=this._dialog.find("#scxDrawingDialog_label_textBorderColor"),this._label_tooltipBorderEnabled=this._dialog.find("#scxDrawingDialog_label_tooltipBorder"),this._label_tooltipFillEnabled=this._dialog.find("#scxDrawingDialog_label_tooltipFill")},s._numericFieldConfig={showArrows:!1,maxValue:10,minValue:1,value:1},s._switcherySettings={color:"#64bd63",secondaryColor:"#ddd",className:"scx_switchery",disabled:!1,disabledOpacity:.5,speed:"0.4s"},s}(i.Dialog)
i.DrawingSettingsDialog=t
var n=function(){function e(e){this._selector=e,this._init()}return e.prototype.getStyle=function(e){switch(e.toLowerCase()){case"b":return this._checkboxes.eq(0).prop("checked")
case"i":return this._checkboxes.eq(1).prop("checked")
case"u":return this._checkboxes.eq(2).prop("checked")
default:return!1}},e.prototype.setStyle=function(e,i){switch(e.toLowerCase()){case"b":i?this._labels.eq(0).addClass("active"):this._labels.eq(0).removeClass("active"),this._checkboxes.eq(0).prop("checked",i)
break
case"i":i?this._labels.eq(1).addClass("active"):this._labels.eq(1).removeClass("active"),this._checkboxes.eq(1).prop("checked",i)
break
case"u":i?this._labels.eq(2).addClass("active"):this._labels.eq(2).removeClass("active"),this._checkboxes.eq(2).prop("checked",i)}},e.prototype._init=function(){this._labels=this._selector.find(">label"),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<this._levels.length;i++){var t=this._levels[i]
this._input_lineLevel[i].value=this._config.drawing.className===e.FibonacciTimeZonesDrawing.className?t.value:100*t.value
var n=this._dialog.find(".scxFibonacciDrawingDialog_input_lineColor").eq(i),o=this._dialog.find(".scxFibonacciDrawingDialog_input_lineWidth").eq(i),s=this._dialog.find(".scxFibonacciDrawingDialog_input_lineStyle:even").eq(i),t=t.theme&&t.theme.line||this._config.drawing.actualTheme.line
n.spectrum("set",t.strokeColor),o.scxNumericField("setValue",t.width),s.selectpicker("val",t.lineStyle||e.LineStyle.SOLID).selectpicker("refresh")}this._config.drawing.className!==e.FibonacciFanDrawing.className&&(this._input_trendLineColor.spectrum("set",this._config.drawing.actualTheme.trendLine.strokeColor),this._input_trendLineWidth.scxNumericField("setValue",this._config.drawing.actualTheme.trendLine.width),this._input_trendLineStyle.selectpicker("val",this._config.drawing.actualTheme.trendLine.lineStyle||e.LineStyle.SOLID).selectpicker("refresh"))},t.prototype._getValues=function(){for(var i=0;i<this._levels.length;i++){var t,n=this._levels[i]
t=this._config.drawing.className!==e.FibonacciTimeZonesDrawing.className,n.value=parseInt(this._input_lineLevel[i].value,10),t&&(n.value/=100),t=this._dialog.find(".scxFibonacciDrawingDialog_input_lineColor").eq(i)
var o=this._dialog.find(".scxFibonacciDrawingDialog_input_lineWidth").eq(i),s=this._dialog.find(".scxFibonacciDrawingDialog_input_lineStyle:even").eq(i)
n.theme||(n.theme={}),n.theme.line||(n.theme.line={}),n.theme.fill||(n.theme.fill={}),n.theme.text||(n.theme.text=this._config.drawing.actualTheme.text?$.extend(!0,{},this._config.drawing.actualTheme.text):{}),n.theme.line.strokeColor=t.spectrum("get").toRgbString(),n.theme.line.width=o.scxNumericField("getValue"),n.theme.line.lineStyle=s.val(),t=t.spectrum("get").toRgb(),n.theme.text.fillColor=tinycolor(t).toRgbString(),t.a=.3,n.theme.fill.fillColor=tinycolor(t).toRgbString()}i=this._config.drawing.theme=$.extend(!0,{},this._config.drawing.actualTheme),this._config.drawing.className!==e.FibonacciFanDrawing.className&&(i.trendLine.strokeColor=this._input_trendLineColor.spectrum("get").toRgbString(),i.trendLine.width=this._input_trendLineWidth.scxNumericField("getValue"),i.trendLine.lineStyle=this._input_trendLineStyle.val()),this._levelTextHorPosition=this._input_labelsPosition.val(),this._levelTextVerPosition=this._input_labelsTextPosition.val()},t.prototype.resetToDefaults=function(){var i,t=this._config.drawing.defaultTheme
switch(this._config.drawing.className){case e.FibonacciArcsDrawing.className:i=e.FibonacciArcsDrawing.defaults
break
case e.FibonacciEllipsesDrawing.className:i=e.FibonacciEllipsesDrawing.defaults
break
case e.FibonacciRetracementsDrawing.className:i=e.FibonacciRetracementsDrawing.defaults
break
case e.FibonacciFanDrawing.className:i=e.FibonacciFanDrawing.defaults
break
case e.FibonacciExtensionsDrawing.className:i=e.FibonacciExtensionsDrawing.defaults
break
case e.FibonacciTimeZonesDrawing.className:i=e.FibonacciTimeZonesDrawing.defaults}i=$.extend(!1,e.FibonacciDrawingBase.defaults,i),this._clearDialogFields(),this._setDrawingConfig(i),this._setDialogFields(),this._config.drawing.className!==e.FibonacciFanDrawing.className&&(this._input_trendLineColor.spectrum("set",t.trendLine.strokeColor),this._input_trendLineWidth.scxNumericField("setValue",t.trendLine.width),this._input_trendLineStyle.selectpicker("val",t.trendLine.lineStyle).selectpicker("refresh"))},t.prototype._apply=function(){this._getValues(),this._config.drawing.showTrendLine=this._showTrendLine,this._config.drawing.showLevels=this._showLevelValues,this._config.drawing.showLevelPrices=this._showLevelPrices,this._config.drawing.showLevelPercents=this._showLevelPercents,this._config.drawing.showLevelBackgrounds=this._showLevelBackgrounds,void 0!==this._config.drawing.levelLinesExtension&&(this._config.drawing.levelLinesExtension=this._levelLinesExtension),void 0!==this._config.drawing.reverse&&(this._config.drawing.reverse=this._reverse),this._config.drawing.levelTextHorPosition=this._levelTextHorPosition,this._config.drawing.levelTextVerPosition=this._levelTextVerPosition,this._config.drawing.levels=this._levels,this._config.drawing.chartPanel.update(),this._isApplyClicked=!0},t.prototype._save=function(){this._apply(),this.hide()},t.prototype._addNewLinePanel=function(){var e=this._config.drawing.actualTheme
this._getValues(),this._levels.push({value:0,visible:!0,theme:$.extend(!0,{},{line:e.line})}),this._clearLinePanel(),this._addLinePanel(),this._setValues(),this.resize()},t.prototype._addLinePanel=function(){var e=this
this._levels.forEach(function(){e._generateLinePanel()}),this._defineDomLevelObjects(),this._setLinePanelsProperties()},t.prototype._deleteLinePanel=function(e){this._getValues(),e=$(e.currentTarget).index(".scxFibonacciDrawingDialog_panel_deleteLinePanel"),this._levels.splice(e,1),this._panelFigureLine.eq(e).remove(),this._clearLinePanel(),this._addLinePanel(),this._setValues(),this.resize()},t.prototype._clearDialogFields=function(){this._clearLinePanel(),this._clearDialogParameters()},t.prototype._clearLinePanel=function(){this._panelFigureLine.remove(),$("body").find(".scxSpectrumDrawingDialog").remove()},t.prototype._clearDialogParameters=function(){this._panelFigureRetracementsOptions.remove(),this._panelFigureTrendLine.remove(),this._panelFigureLevelParameters.remove(),this._panelFigureLabelsParameters.remove(),this._panelFigureBackground.remove()},t.prototype._setBackgroundParameters=function(){var e=this._dialog.find(".scxFibonacciDrawingDialog_chk_background")
new Switchery(e[0],t._switcherySettings).setPosition(this._showLevelBackgrounds),this._setLabelState(this._label_background,this._showLevelBackgrounds)},t.prototype._setLabelsParameters=function(){this._input_labelsPosition.selectpicker({container:"body"}),this._input_labelsPosition.selectpicker("val",this._levelTextHorPosition).selectpicker("refresh"),this._input_labelsTextPosition.selectpicker({container:"body"}),this._input_labelsTextPosition.selectpicker("val",this._levelTextVerPosition).selectpicker("refresh")},t.prototype._setRetracementsOptions=function(){var i=this._dialog.find(".scxFibonacciDrawingDialog_chk_extendLinesLeft"),i=new Switchery(i[0],t._switcherySettings),n=this._dialog.find(".scxFibonacciDrawingDialog_chk_extendLinesRight"),n=new Switchery(n[0],t._switcherySettings),o=this._dialog.find(".scxFibonacciDrawingDialog_chk_extendLinesTop"),o=new Switchery(o[0],t._switcherySettings),s=this._dialog.find(".scxFibonacciDrawingDialog_chk_extendLinesBottom"),s=new Switchery(s[0],t._switcherySettings),a=this._dialog.find(".scxFibonacciDrawingDialog_chk_linesReverse")
switch(new Switchery(a[0],t._switcherySettings).setPosition(this._reverse),this._setLabelState(this._label_reverse,this._reverse),this._levelLinesExtension){case e.FibonacciLevelLineExtension.NONE:return i.setPosition(!1),n.setPosition(!1),o.setPosition(!1),s.setPosition(!1),this._setLabelState(this._label_extendLinesLeft,!1),this._setLabelState(this._label_extendLinesRight,!1),this._setLabelState(this._label_extendLinesTop,!1),void this._setLabelState(this._label_extendLinesBottom,!1)
case e.FibonacciLevelLineExtension.LEFT:return i.setPosition(!0),void this._setLabelState(this._label_extendLinesLeft,!0)
case e.FibonacciLevelLineExtension.RIGHT:return n.setPosition(!0),void this._setLabelState(this._label_extendLinesRight,!0)
case e.FibonacciLevelLineExtension.TOP:return o.setPosition(!0),void this._setLabelState(this._label_extendLinesTop,!0)
case e.FibonacciLevelLineExtension.BOTTOM:return s.setPosition(!0),void this._setLabelState(this._label_extendLinesBottom,!0)
case e.FibonacciLevelLineExtension.BOTH:return i.setPosition(!0),n.setPosition(!0),o.setPosition(!0),s.setPosition(!0),this._setLabelState(this._label_extendLinesLeft,!0),this._setLabelState(this._label_extendLinesRight,!0),this._setLabelState(this._label_extendLinesTop,!0),void this._setLabelState(this._label_extendLinesBottom,!0)}},t.prototype._setLevelParameters=function(){var e=this._dialog.find(".scxFibonacciDrawingDialog_chk_levelsValue"),e=new Switchery(e[0],t._switcherySettings),i=this._dialog.find(".scxFibonacciDrawingDialog_chk_levelsPrice")
this._chk_levelsPriceEnabled=new Switchery(i[0],t._switcherySettings),i=this._dialog.find(".scxFibonacciDrawingDialog_chk_levelsPercent"),this._chk_levelsPercentEnabled=new Switchery(i[0],t._switcherySettings),this._chk_levelsPriceEnabled.setPosition(this._showLevelPrices),this._chk_levelsPercentEnabled.setPosition(this._showLevelPercents),e.setPosition(this._showLevelValues),this._showLevelValues||this._setLevelsState(this._showLevelValues)},t.prototype._setTrendLineParameters=function(){this._input_trendLineWidth.scxNumericField(t._numericFieldConfig)
var e=Array.prototype.slice.call(this._panelFigureTrendLinePanel.find(".js-switch"))
0!==e.length&&(this._chk_trendLineEnabled=new Switchery(e[0],t._switcherySettings),this._chk_trendLineEnabled.setPosition(this._showTrendLine),this._setTrendLineState(this._showTrendLine))},t.prototype._setLinePanelsProperties=function(){this._config.drawing.className===e.FibonacciTimeZonesDrawing.className?this._input_lineLevel.scxNumericField(t._numericTimeZoneFieldConfig):this._input_lineLevel.scxNumericField(t._numericDoubleFieldConfig),this._input_lineWidth.scxNumericField(t._numericFieldConfig),this._input_lineStyle.selectpicker({container:"body"}),this._dialog.find(".scxSpectrum").scx().colorPicker({containerClassName:"scxSpectrumDrawingDialog",localStorageKey:"scxThemeDialog_spectrum",showAlpha:!0})
for(var i=Array.prototype.slice.call(this._panelFigureLine.find(".js-switch")),n=0;n<i.length;n++){var o=new Switchery(i[n],t._switcherySettings)
void 0===this._levels[n].visible&&(this._levels[n].visible=!0),o.setPosition(this._levels[n].visible),this._setLineState(this._levels[n].visible,n)}},t.prototype._generateLinePanel=function(){$('<tr class="scxFibonacciDrawingDialog_panel_figure_linePanel"><td><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_lineEnable js-switch" type="checkbox"/></span><input class="scxFibonacciDrawingDialog_input_lineLevel form-control" type="text"><input class="scxFibonacciDrawingDialog_input_lineColor scxSpectrum" type="text"><input class="scxFibonacciDrawingDialog_input_lineWidth form-control" type="text"><select class="scxFibonacciDrawingDialog_input_lineStyle scxLineStyleSelector scxDropdown"><option value="solid">&nbsp;</option><option value="dash">&nbsp;</option><option value="dot">&nbsp;</option><option value="dash-dot">&nbsp;</option></select><a href="#" aria-hidden="true" class="close scxFibonacciDrawingDialog_panel_deleteLinePanel">&#215;</a></td></tr>').appendTo(this._panelFigure.find("table"))},t.prototype._generateTrendLine=function(){$('<tr class="scxFibonacciDrawingDialog_panel_figure_trendLine"><td><span class="scxFibonacciDrawingDialog_panel_figure_trendEnabled"><input class="scxFibonacciDrawingDialog_chk_trendLine js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_trendLine">Trend Line</label><input class="scxFibonacciDrawingDialog_input_lineColor scxSpectrum" type="text"><input class="scxFibonacciDrawingDialog_input_lineWidth form-control" type="text"><select class="scxFibonacciDrawingDialog_input_lineStyle scxLineStyleSelector scxDropdown"><option value="solid">&nbsp;</option><option value="dash">&nbsp;</option><option value="dot">&nbsp;</option><option value="dash-dot">&nbsp;</option></select></td></tr>').appendTo(this._panelFigureTrendLinePanel.find("table"))},t.prototype._generateRetracementsOptions=function(){$('<tr class="scxFibonacciDrawingDialog_panel_figure_retracementsOptions"><td><div class="scxFibonacciDrawingDialog_extendHor"><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_extendLinesLeft js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_extendLinesLeft">Extend Left</label><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_extendLinesRight js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_extendLinesRight">Extend Right</label></div><div class="scxFibonacciDrawingDialog_extendVer"><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_extendLinesTop js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_extendLinesTop">Extend Top</label><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_extendLinesBottom js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_extendLinesBottom">Extend Bottom</label></div><div class="scxFibonacciDrawingDialog_reverse"><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_linesReverse js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_linesReverse">Reverse</label></div></td></tr>').appendTo(this._panelFigureRetracementsOptionsPanel.find("table"))},t.prototype._generateLevelParameters=function(){$('<tr class="scxFibonacciDrawingDialog_panel_figure_levelParameters"><td><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_levelsValue js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_levels">Levels</label><div class="scxFibonacciDrawingDialog_levelsPrice"><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_levelsPrice js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_prices">Prices</label> </div><div class="scxFibonacciDrawingDialog_levelsPercent"><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_levelsPercent js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_percents">Percents</label></div></td></tr>').appendTo(this._panelFigureLevelParametersPanel.find("table"))},t.prototype._generateLabelsParameters=function(){$('<tr class="scxFibonacciDrawingDialog_panel_figure_labels"><td><label class="scxFibonacciDrawingDialog_label">Labels</label><div class="scxFibonacciDrawingDialog_labelsPosition"><select class="scxFibonacciDrawingDialog_input_labelsPosition scxDropdown"><option value="left">Left</option><option value="center">Center</option><option value="right">Right</option></select></div><select class="scxFibonacciDrawingDialog_input_labelsTextPosition scxDropdown"><option value="top">Top</option><option value="middle">Middle</option><option value="bottom">Bottom</option></select></td></tr>').appendTo(this._panelFigureLabelsParametersPanel.find("table"))},t.prototype._generateBackgroundParameters=function(){$('<tr class="scxFibonacciDrawingDialog_panel_figure_background"><td><span class="scxFibonacciDrawingDialog_panel_figure_lineEnabled"><input class="scxFibonacciDrawingDialog_chk_background js-switch" type="checkbox"/></span><label class="scxFibonacciDrawingDialog_label_background">Background</label></td></tr>').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('<div class="scxComponentsContainer"></div>').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<this._html.length},e.prototype._getHtml=function(){return this._html},e.prototype.pushHtml=function(e){for(this._html=e,e=this._subscribers.length-1;0<=e;e--)this._subscribers[e](this._getHtml()),this._subscribers.splice(e,1)},e.prototype.subscribe=function(e){this._isHtmlLoaded()?e(this._getHtml()):this._subscribers.push(e)},e}(),o=function(){function i(){}return i.getView=function(e,t){var o=i._getDataItem(e)
null==o?(i._dataItems.add(e,new n(t)),i._receiveFileContent(e)):o.subscribe(t)},i._getDataItem=function(e){return i._dataItems.get(e)},i._receiveFileContent=function(n){"Toolbar.html"==n?i._onFileContentReceived(n,Toolbar_html):"ChartContextMenu.html"==n?i._onFileContentReceived(n,ChartContextMenu_html):"IndicatorContextMenu.html"==n?i._onFileContentReceived(n,IndicatorContextMenu_html):"Navigation.html"==n?i._onFileContentReceived(n,Navigation_html):"ThemeDialog.html"==n?i._onFileContentReceived(n,ThemeDialog_html):"IndicatorsDialog.html"==n?i._onFileContentReceived(n,IndicatorsDialog_html):"IndicatorSettingsDialog.html"==n?i._onFileContentReceived(n,IndicatorSettingsDialog_html):"IndicatorsHelp.html"==n?i._onFileContentReceived(n,IndicatorsHelp_html):"PriceStyleSettingsDialog.html"==n?i._onFileContentReceived(n,PriceStyleSettingsDialog_html):"DrawingContextMenu.html"==n?i._onFileContentReceived(n,DrawingContextMenu_html):"DrawingSettingsDialog.html"==n?i._onFileContentReceived(n,DrawingSettingsDialog_html):"IchimokuIndicatorSettingsDialog.html"==n?i._onFileContentReceived(n,IchimokuIndicatorSettingsDialog_html):"IndicatorInfoDialog.html"==n?i._onFileContentReceived(n,IndicatorInfoDialog_html):t.get(e.ViewsPath+n,function(e){i._onFileContentReceived(n,e)}).fail(function(){alert("Load "+n+" failed")})},i._onFileContentReceived=function(e,t){var n=i._getDataItem(e)
null!=n&&n.pushHtml(t)},i._dataItems=new e.Dictionary,i}()
i.HtmlLoader=o}(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._lineEnabled=[],this._initFields(),this._init()}return __extends(t,i),t.prototype.show=function(e){this._config=e,this._isApplyClicked=!1,this._setValues(),i.prototype.show.call(this,e)},t.prototype.hide=function(){this._config=null,i.prototype.hide.call(this)},t.prototype._init=function(){var e=this
$("body").bind("scxSwitcherChanged",function(i,t){var n=$(t.target),o=t.checked
n.is(e._chk_tenkanLineEnabledHTMLObj)?e._setLineState(o,0):n.is(e._chk_kijunLineEnabledHTMLObj)?e._setLineState(o,1):n.is(e._chk_chikouLineEnabledHTMLObj)?e._setLineState(o,2):n.is(e._chk_senkouALineEnabledHTMLObj)?e._setLineState(o,3):n.is(e._chk_senkouBLineEnabledHTMLObj)?e._setLineState(o,4):n.is(e._chk_kumoEnabledHTMLObj)&&e._setLineState(o,5)}),this._input_conversion.scxNumericField(t._numericFieldConfig),this._input_base.scxNumericField(t._numericFieldConfig),this._input_lagging.scxNumericField(t._numericFieldConfig),this._input_lineWidth.scxNumericField(t._numericFieldWidthConfig),this._input_lineStyle.selectpicker({container:"body"}),this._dialog.find(".scxSpectrum").scx().colorPicker({containerClassName:"scxSpectrumDrawingDialog",localStorageKey:"scxThemeDialog_spectrum",showAlpha:!0})
var i=new Switchery(document.querySelector(".scxIchimokuIndicatorDialog_chk_tenkanLine"),t._switcherySettings)
this._lineEnabled.push(i),i=new Switchery(document.querySelector(".scxIchimokuIndicatorDialog_chk_kijunLine"),t._switcherySettings),this._lineEnabled.push(i),i=new Switchery(document.querySelector(".scxIchimokuIndicatorDialog_chk_chikouLine"),t._switcherySettings),this._lineEnabled.push(i),i=new Switchery(document.querySelector(".scxIchimokuIndicatorDialog_chk_senkouALine"),t._switcherySettings),this._lineEnabled.push(i),i=new Switchery(document.querySelector(".scxIchimokuIndicatorDialog_chk_senkouBLine"),t._switcherySettings),this._lineEnabled.push(i),i=new Switchery(document.querySelector(".scxIchimokuIndicatorDialog_chk_kumo"),t._switcherySettings),this._lineEnabled.push(i),this._dialog.find("#scxIchimokuIndicatorDialog_btn_save").on("click",function(){e._save()}),this._dialog.find("#scxIchimokuIndicatorDialog_btn_apply").on("click",function(){e._apply()})},t.prototype._setLineState=function(e,i){var t=this._panelFigureLinesStylePanel.find(".scxIchimokuIndicatorDialog_label").eq(i),n=this._panelFigureLinesStylePanel.find(".scxIchimokuIndicatorDialog_input_lineColor").eq(i),o=this._panelFigureLinesStylePanel.find(".scxIchimokuIndicatorDialog_input_lineWidth").eq(i),s=this._panelFigureLinesStylePanel.find(".scxIchimokuIndicatorDialog_input_lineStyle:even").eq(i)
e?(t.removeClass("disabled"),n.spectrum("enable"),s.removeAttr("disabled"),s.selectpicker("refresh"),o.scxNumericField("enable"),this._config.ichimokuIndicator.lines[i].visible=!0):(t.addClass("disabled"),n.spectrum("disable"),s.attr("disabled","disabled"),s.selectpicker("refresh"),o.scxNumericField("disable"),this._config.ichimokuIndicator.lines[i].visible=!1)},t.prototype._setValues=function(){for(var i=this._config.ichimokuIndicator.lines.length,t=0;t<i;t++){var n=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineColor").eq(t),o=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineWidth").eq(t),s=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineStyle:even").eq(t),a=this._config.ichimokuIndicator.lines[t].theme
n.spectrum("set",a.strokeColor),o.scxNumericField("setValue",a.width),s.selectpicker("val",a.lineStyle||e.LineStyle.SOLID).selectpicker("refresh"),this._config.ichimokuIndicator.lines[t].visible!=this._lineEnabled[t].isChecked()&&this._lineEnabled[t].setPosition(!0),this._setLineState(this._config.ichimokuIndicator.lines[t].visible,t)}this._dialog.find(".scxIchimokuIndicatorDialog_input_lineColor").eq(i-1).spectrum("set",this._config.ichimokuIndicator.lines[i-1].theme.fillColor),this._input_conversion.scxNumericField("setValue",this._config.ichimokuIndicator.conversionLinePeriods),this._input_base.scxNumericField("setValue",this._config.ichimokuIndicator.baseLinePeriods),this._input_lagging.scxNumericField("setValue",this._config.ichimokuIndicator.loggingSpan2Periods)},t.prototype._getValues=function(){for(var e=this._config.ichimokuIndicator.lines.length,i=0;i<e-1;i++){var t=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineColor").eq(i),n=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineWidth").eq(i),o=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineStyle:even").eq(i),s=this._config.ichimokuIndicator.lines[i].theme
s.strokeColor=t.spectrum("get").toRgbString(),s.width=n.scxNumericField("getValue"),s.lineStyle=o.val()}i=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineColor").eq(e-1).spectrum("get").toRgb(),this._config.ichimokuIndicator.lines[e-1].theme.fillColor=tinycolor(i).toRgbString(),this._config.ichimokuIndicator.conversionLinePeriods=this._input_conversion.scxNumericField("getValue"),this._config.ichimokuIndicator.baseLinePeriods=this._input_base.scxNumericField("getValue"),this._config.ichimokuIndicator.loggingSpan2Periods=this._input_lagging.scxNumericField("getValue")},t.prototype._save=function(){this._apply(),this.hide()},t.prototype._apply=function(){this._getValues(),this._config.ichimokuIndicator.update(),this._isApplyClicked=!0},t.prototype._initFields=function(){this._panelFigureLinesStylePanel=this._dialog.find(".scxIchimokuIndicatorDialog_panel_figure_linesStylePanel"),this._input_conversion=this._dialog.find(".scxIchimokuIndicatorDialog_input_conversionLinePeriods"),this._input_base=this._dialog.find(".scxIchimokuIndicatorDialog_input_baseLinePeriods"),this._input_lagging=this._dialog.find(".scxIchimokuIndicatorDialog_input_laggingSpanPeriods"),this._input_lineColor=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineColor"),this._input_lineWidth=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineWidth"),this._input_lineStyle=this._dialog.find(".scxIchimokuIndicatorDialog_input_lineStyle"),this._chk_tenkanLineEnabledHTMLObj=this._dialog.find(".scxIchimokuIndicatorDialog_chk_tenkanLine"),this._chk_kijunLineEnabledHTMLObj=this._dialog.find(".scxIchimokuIndicatorDialog_chk_kijunLine"),this._chk_chikouLineEnabledHTMLObj=this._dialog.find(".scxIchimokuIndicatorDialog_chk_chikouLine"),this._chk_senkouALineEnabledHTMLObj=this._dialog.find(".scxIchimokuIndicatorDialog_chk_senkouALine"),this._chk_senkouBLineEnabledHTMLObj=this._dialog.find(".scxIchimokuIndicatorDialog_chk_senkouBLine"),this._chk_kumoEnabledHTMLObj=this._dialog.find(".scxIchimokuIndicatorDialog_chk_kumo")},t._numericFieldConfig={showArrows:!0,maxValue:2e3,minValue:1,value:1},t._numericFieldWidthConfig={showArrows:!1,maxValue:100,minValue:1,value:1},t._switcherySettings={color:"#64bd63",secondaryColor:"#ddd",className:"scx_switchery",disabled:!1,disabledOpacity:.5,speed:"0.4s"},t}(i.Dialog)
i.IchimokuIndicatorSettingsDialog=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(i){var t=function(t){function n(e){t.call(this,e),this._waitingBarConfig={text:"",dotsCount:5},this._title=this._dialog.find(".scxIndicatorInfoDialog__title"),this._helpContainer=this._dialog.find(".scxIndicatorInfoDialog__help-content"),this._waitingBar=this._dialogContent.body.scx().waitingBar()}return __extends(n,t),n.prototype.show=function(o){var s=this
if(this._config=o,this._clear(),this._showWaitingBar(),t.prototype.show.call(this,o),this._setTitle("..."),"object"==typeof o.indicator&&o.indicator instanceof e.TAIndicator){var a=o.indicator.taIndicator,l=a===e.VolumeIndicator?"Volume":TASdk.indicatorToString(a)
this._setTitle(l),i.HtmlLoader.getView("IndicatorsHelp.html",function(e){e=$(e).find("#scxIndicatorTooltip_id"+a).clone().show(),e.find("> 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 $('<p class="scxIndicatorInfoDialog__noInfo">Sorry. There is no help for this indicator yet</p>')},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_minAF)?(e._input_maxAF.addClass("scxInvalidValue"),e._input_minAF.addClass("scxInvalidValue")):(e._input_maxAF.removeClass("scxInvalidValue"),e._input_minAF.removeClass("scxInvalidValue"))})
break
case TASdk.MACD:case TASdk.MACDHistogram:case TASdk.SchaffTrendCycle:this._input_shortCycle.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(),1<t.fieldNames.length&&(this._input_line2_color.setColor(t.getParameterValue(i.LINE2_COLOR)),this.updateNumericFromIndicator(this._input_line2_width,i.LINE2_WIDTH),this._input_line2_style.val(t.getParameterValue(i.LINE2_STYLE)),this._dialog.find("#scxIndicatorDialog_container_line2").show()),2<t.fieldNames.length&&(this._input_line3_color.setColor(t.getParameterValue(i.LINE3_COLOR)),this.updateNumericFromIndicator(this._input_line3_width,i.LINE3_WIDTH),this._input_line3_style.val(t.getParameterValue(i.LINE3_STYLE)),this._dialog.find("#scxIndicatorDialog_container_line3").show(),this._label_line1.text("Top"),this._label_line2.text("Median"),this._label_line3.text("Bottom")),t.hasParameter(i.SOURCE)&&(this._input_source.val(t.getParameterValue(i.SOURCE)),this._dialog.find("#scxIndicatorDialog_container_source").show()),t.hasParameter(i.PERIODS)&&(this.updateNumericFromIndicator(this._input_periods,i.PERIODS),this._dialog.find("#scxIndicatorDialog_container_periods").show()),t.hasParameter(i.MA_TYPE)&&(this._input_maType.val(t.getParameterValue(i.MA_TYPE)),this._dialog.find("#scxIndicatorDialog_container_maType").show()),t.hasParameter(i.STANDARD_DEVIATIONS)&&(this.updateNumericFromIndicator(this._input_standardDeviations,i.STANDARD_DEVIATIONS),this._dialog.find("#scxIndicatorDialog_container_standardDeviations").show()),t.hasParameter(i.SHORT_CYCLE)&&(this.updateNumericFromIndicator(this._input_shortCycle,i.SHORT_CYCLE),this._dialog.find("#scxIndicatorDialog_container_shortCycle").show()),t.hasParameter(i.LONG_CYCLE)&&(this.updateNumericFromIndicator(this._input_longCycle,i.LONG_CYCLE),this._dialog.find("#scxIndicatorDialog_container_longCycle").show()),t.hasParameter(i.SIGNAL_PERIODS)&&(this.updateNumericFromIndicator(this._input_signalPeriods,i.SIGNAL_PERIODS),this._dialog.find("#scxIndicatorDialog_container_signalPeriods").show()),t.hasParameter(i.CYCLE_1)&&(this.updateNumericFromIndicator(this._input_cycle1,i.CYCLE_1),this._container_cycle1.show()),t.hasParameter(i.CYCLE_2)&&(this.updateNumericFromIndicator(this._input_cycle2,i.CYCLE_2),this._container_cycle2.show()),t.hasParameter(i.SHIFT)&&(this.updateNumericFromIndicator(this._input_shift,i.SHIFT),this._dialog.find("#scxIndicatorDialog_container_shift").show()),t.taIndicator){case TASdk.MACD:this._label_line1.text("Signal"),this._label_line2.text("Histogram"),this._input_line3_width.hide(),this._input_line3_style.selectpicker("hide")
break
case TASdk.VIDYA:this.updateNumericFromIndicator(this._input_r2scale,i.R2_SCALE),this._dialog.find("#scxIndicatorDialog_container_r2scale").show()
break
case TASdk.HighLowBands:this._label_line1.text("High"),this._label_line2.text("Median"),this._label_line3.text("Low")
break
case TASdk.FractalChaosBands:this._label_line1.text("High"),this._label_line2.text("Low")
break
case TASdk.PrimeNumberBands:this._label_line1.text("Top"),this._label_line2.text("Bottom")
break
case TASdk.TradeVolumeIndex:this.updateNumericFromIndicator(this._input_minTick,i.MIN_TICK),this._dialog.find("#scxIndicatorDialog_container_minTick").show()
break
case TASdk.SwingIndex:case TASdk.AccumulativeSwingIndex:this.updateNumericFromIndicator(this._input_limitMove,i.LIMIT_MOVE),this._dialog.find("#scxIndicatorDialog_container_limitMove").show()
break
case TASdk.ComparativeRelativeStrength:this._input_source2.val(t.getParameterValue(i.SOURCE2)),this._dialog.find("#scxIndicatorDialog_container_source2").show()
break
case TASdk.StochasticMomentumIndex:this.updateNumericFromIndicator(this._input_kPeriods,i.PCT_K_PERIODS),this.updateNumericFromIndicator(this._input_kSmoothing,i.PCT_K_SMOOTHING),this.updateNumericFromIndicator(this._input_kDoubleSmoothing,i.PCT_K_DOUBLE_SMOOTHING),this.updateNumericFromIndicator(this._input_dPeriods,i.PCT_D_PERIODS),this._input_pctDMovingAverageType.val(t.getParameterValue(i.PCT_D_MA_TYPE)),this._container_kPeriods.show(),this._container_kSmoothing.show(),this._dialog.find("#scxIndicatorDialog_container_kDoubleSmoothing").show(),this._container_dPeriods.show(),this._dialog.find("#scxIndicatorDialog_container_pctDMovingAverageType").show(),this._label_line1.text("%D"),this._label_line2.text("%K")
break
case TASdk.UltimateOscillator:this.updateNumericFromIndicator(this._input_cycle3,i.CYCLE_3),this._dialog.find("#scxIndicatorDialog_container_cycle3").show()
break
case TASdk.VolumeOscillator:this.updateNumericFromIndicator(this._input_shortTerm,i.SHORT_TERM),this.updateNumericFromIndicator(this._input_longTerm,i.LONG_TERM),this._input_pointsOrPercent.val(t.getParameterValue(i.CYCLE_3)),this._dialog.find("#scxIndicatorDialog_container_shortTerm").show(),this._dialog.find("#scxIndicatorDialog_container_longTerm").show(),this._dialog.find("#scxIndicatorDialog_container_pointsOrPercent").show()
break
case TASdk.ChaikinVolatility:this.updateNumericFromIndicator(this._input_roc,i.RATE_OF_CHANGE),this._dialog.find("#scxIndicatorDialog_container_rateOfChange").show()
break
case TASdk.StochasticOscillator:this.updateNumericFromIndicator(this._input_kPeriods,i.PCT_K_PERIODS),this.updateNumericFromIndicator(this._input_kSmoothing,i.PCT_K_SMOOTHING),this.updateNumericFromIndicator(this._input_dPeriods,i.PCT_D_PERIODS),this._container_kPeriods.show(),this._container_kSmoothing.show(),this._container_dPeriods.show(),this._label_line1.text("%D"),this._label_line2.text("%K")
break
case TASdk.MACDHistogram:this._label_line1.text("Color"),this._input_line1_width.hide(),this._input_line1_style.selectpicker("hide")
break
case TASdk.ParabolicSAR:this.updateNumericFromIndicator(this._input_minAF,i.MIN_AF),this.updateNumericFromIndicator(this._input_maxAF,i.MAX_AF),this._dialog.find("#scxIndicatorDialog_container_minAF").show(),this._dialog.find("#scxIndicatorDialog_container_maxAF").show()
break
case TASdk.RainbowOscillator:this.updateNumericFromIndicator(this._input_levels,i.LEVELS),this._dialog.find("#scxIndicatorDialog_container_levels").show()
break
case TASdk.ElderRay:this._label_line1.text("Bull Power"),this._label_line2.text("Bear Power")
break
case TASdk.ElderForceIndex:this._label_line2.text("Signal")
break
case TASdk.EhlerFisherTransform:this._label_line1.text("Indicator"),this._label_line2.text("Signal")
break
case e.ColoredVolumeIndicator:this._dialog.find("#scxIndicatorDialog_container_line1").hide(),this._dialog.find("#scxIndicatorDialog_container_histogram_colors").show(),i=null!=t.coloredVolumeTheme?t.coloredVolumeTheme:t.chart.theme.plot.bar.candle,this._input_histogram_line1_color.setColor(i.upCandle.fill.fillColor),this._input_histogram_line2_color.setColor(i.downCandle.fill.fillColor)}[this._input_source,this._input_source2,this._input_pointsOrPercent,this._input_maType,this._input_pctDMovingAverageType,this._input_line1_style,this._input_line2_style,this._input_line3_style].forEach(function(e){e.selectpicker("refresh")})},o.prototype._updateIndicatorFromUI=function(){var i=e.IndicatorParam,t=this._indicator
switch(t.setParameterValue(i.LINE_COLOR,this._input_line1_color.getColor()),this.updateIndicatorFromNumeric(i.LINE_WIDTH,this._input_line1_width),this.updateIndicatorLineStyle(i.LINE_STYLE,this._input_line1_style),1<t.fieldNames.length&&(t.setParameterValue(i.LINE2_COLOR,this._input_line2_color.getColor()),this.updateIndicatorFromNumeric(i.LINE2_WIDTH,this._input_line2_width),this.updateIndicatorLineStyle(i.LINE2_STYLE,this._input_line2_style)),2<t.fieldNames.length&&(t.setParameterValue(i.LINE3_COLOR,this._input_line3_color.getColor()),this.updateIndicatorFromNumeric(i.LINE3_WIDTH,this._input_line3_width),this.updateIndicatorLineStyle(i.LINE3_STYLE,this._input_line3_style)),t.hasParameter(i.PERIODS)&&this.updateIndicatorFromNumeric(i.PERIODS,this._input_periods),t.hasParameter(i.SOURCE)&&t.setParameterValue(i.SOURCE,this._getSource(this._input_source.val())),t.hasParameter(i.MA_TYPE)&&t.setParameterValue(i.MA_TYPE,o._getMAType(this._input_maType.val())),t.hasParameter(i.SHORT_CYCLE)&&this.updateIndicatorFromNumeric(i.SHORT_CYCLE,this._input_shortCycle),t.hasParameter(i.LONG_CYCLE)&&this.updateIndicatorFromNumeric(i.LONG_CYCLE,this._input_longCycle),t.hasParameter(i.STANDARD_DEVIATIONS)&&this.updateIndicatorFromNumeric(i.STANDARD_DEVIATIONS,this._input_standardDeviations),t.hasParameter(i.CYCLE_1)&&this.updateIndicatorFromNumeric(i.CYCLE_1,this._input_cycle1),t.hasParameter(i.CYCLE_2)&&this.updateIndicatorFromNumeric(i.CYCLE_2,this._input_cycle2),t.hasParameter(i.SHIFT)&&this.updateIndicatorFromNumeric(i.SHIFT,this._input_shift),t.taIndicator){case TASdk.HistoricalVolatility:this.updateIndicatorFromNumeric(i.BAR_HISTORY,this._input_barHistory)
break
case TASdk.VIDYA:this.updateIndicatorFromNumeric(i.R2_SCALE,this._input_r2scale)
break
case TASdk.TradeVolumeIndex:this.updateIndicatorFromNumeric(i.MIN_TICK,this._input_minTick)
break
case TASdk.SwingIndex:case TASdk.AccumulativeSwingIndex:this.updateIndicatorFromNumeric(i.LIMIT_MOVE,this._input_limitMove)
break
case TASdk.ComparativeRelativeStrength:t.setParameterValue(i.SOURCE2,this._getSource(this._input_source2.val()))
break
case TASdk.StochasticMomentumIndex:this.updateIndicatorFromNumeric(i.PCT_K_PERIODS,this._input_kPeriods),this.updateIndicatorFromNumeric(i.PCT_K_SMOOTHING,this._input_kSmoothing),this.updateIndicatorFromNumeric(i.PCT_K_DOUBLE_SMOOTHING,this._input_kDoubleSmoothing),this.updateIndicatorFromNumeric(i.PCT_D_PERIODS,this._input_dPeriods),t.setParameterValue(i.PCT_D_MA_TYPE,o._getMAType(this._input_pctDMovingAverageType.val()))
break
case TASdk.UltimateOscillator:this.updateIndicatorFromNumeric(i.CYCLE_3,this._input_cycle3)
break
case TASdk.VolumeOscillator:this.updateIndicatorFromNumeric(i.SHORT_TERM,this._input_shortTerm),this.updateIndicatorFromNumeric(i.LONG_TERM,this._input_longTerm),t.setParameterValue(i.POINTS_OR_PERCENT,o._getPointsOrPercent(this._input_pointsOrPercent.val()))
break
case TASdk.ChaikinVolatility:this.updateIndicatorFromNumeric(i.RATE_OF_CHANGE,this._input_roc)
break
case TASdk.StochasticOscillator:this.updateIndicatorFromNumeric(i.PCT_K_PERIODS,this._input_kPeriods),this.updateIndicatorFromNumeric(i.PCT_K_SMOOTHING,this._input_kSmoothing),this.updateIndicatorFromNumeric(i.PCT_D_PERIODS,this._input_dPeriods)
break
case TASdk.ParabolicSAR:this.updateIndicatorFromNumeric(i.MIN_AF,this._input_minAF),this.updateIndicatorFromNumeric(i.MAX_AF,this._input_maxAF)
break
case TASdk.RainbowOscillator:this.updateIndicatorFromNumeric(i.LEVELS,this._input_levels)
break
case TASdk.MACD:case TASdk.MACDHistogram:this.updateIndicatorFromNumeric(i.SIGNAL_PERIODS,this._input_signalPeriods)
break
case e.ColoredVolumeIndicator:null==t.coloredVolumeTheme&&(t.coloredVolumeTheme=e.JsUtil.clone(t.chart.theme.plot.histogram.coloredColumn)),t.coloredVolumeTheme.upCandle.fill.fillColor=this._input_histogram_line1_color.getColor(),t.coloredVolumeTheme.downCandle.fill.fillColor=this._input_histogram_line2_color.getColor()}},o.prototype._save=function(){this._restoreFields(),this._apply(),this.hide()},o.prototype._apply=function(){this._updateIndicatorFromUI(),this._config.done()&&this._config.done()},o.prototype._initFields=function(){var e=this._dialog
this._input_source=e.find("#scxIndicatorDialog_input_source"),this._container_cycle1=e.find("#scxIndicatorDialog_container_cycle1"),this._container_cycle2=e.find("#scxIndicatorDialog_container_cycle2"),this._container_kPeriods=e.find("#scxIndicatorDialog_container_kPeriods"),this._container_kSmoothing=e.find("#scxIndicatorDialog_container_kSmoothing"),this._container_dPeriods=e.find("#scxIndicatorDialog_container_dPeriods"),this._input_pointsOrPercent=e.find("#scxIndicatorDialog_input_pointsOrPercent"),this._input_source2=e.find("#scxIndicatorDialog_input_source2"),this._input_maType=e.find("#scxIndicatorDialog_input_maType"),this._input_pctDMovingAverageType=e.find("#scxIndicatorDialog_input_pctDMovingAverageType"),this._input_periods=e.find("#scxIndicatorDialog_input_periods").scxNumericField(t),this._input_r2scale=e.find("#scxIndicatorDialog_input_r2scale").scxNumericField(n),this._input_standardDeviations=e.find("#scxIndicatorDialog_input_standardDeviations").scxNumericField(n),this._input_shift=e.find("#scxIndicatorDialog_input_shift").scxNumericField(n),this._input_minTick=e.find("#scxIndicatorDialog_input_minTick").scxNumericField(n),this._input_limitMove=e.find("#scxIndicatorDialog_input_limitMove").scxNumericField(n),this._input_kPeriods=e.find("#scxIndicatorDialog_input_kPeriods").scxNumericField(t),this._input_kSmoothing=e.find("#scxIndicatorDialog_input_kSmoothing").scxNumericField(t),this._input_kDoubleSmoothing=e.find("#scxIndicatorDialog_input_kDoubleSmoothing").scxNumericField(t),this._input_dPeriods=e.find("#scxIndicatorDialog_input_dPeriods").scxNumericField(t),this._input_barHistory=e.find("#scxIndicatorDialog_input_barHistory").scxNumericField(t),this._input_cycle1=e.find("#scxIndicatorDialog_input_cycle1").scxNumericField(n),this._input_cycle2=e.find("#scxIndicatorDialog_input_cycle2").scxNumericField(n),this._input_cycle3=e.find("#scxIndicatorDialog_input_cycle3").scxNumericField(n),this._input_shortTerm=e.find("#scxIndicatorDialog_input_shortTerm").scxNumericField(t),this._input_longTerm=e.find("#scxIndicatorDialog_input_longTerm").scxNumericField(t),this._input_roc=e.find("#scxIndicatorDialog_input_rateOfChange").scxNumericField(n),this._input_signalPeriods=e.find("#scxIndicatorDialog_input_signalPeriods").scxNumericField(t),this._input_shortCycle=e.find("#scxIndicatorDialog_input_shortCycle").scxNumericField(t),this._input_longCycle=e.find("#scxIndicatorDialog_input_longCycle").scxNumericField(t),this._input_minAF=e.find("#scxIndicatorDialog_input_minAF").scxNumericField(n),this._input_maxAF=e.find("#scxIndicatorDialog_input_maxAF").scxNumericField(n),this._input_levels=e.find("#scxIndicatorDialog_input_levels").scxNumericField(n),this._label_line1=e.find("#scxIndicatorDialog_label_line1"),this._input_line1_width=e.find("#scxIndicatorDialog_input_line1_width").scxNumericField(t),this._input_line1_color=null,this._input_line1_style=e.find("#scxIndicatorDialog_input_line1_style"),this._label_line2=e.find("#scxIndicatorDialog_label_line2"),this._input_line2_width=e.find("#scxIndicatorDialog_input_line2_width").scxNumericField(t),this._input_line2_color=null,this._input_line2_style=e.find("#scxIndicatorDialog_input_line2_style"),this._label_line3=e.find("#scxIndicatorDialog_label_line3"),this._input_line3_width=e.find("#scxIndicatorDialog_input_line3_width").scxNumericField(t),this._input_line3_color=null,this._input_line3_style=e.find("#scxIndicatorDialog_input_line3_style"),this._input_histogram_line2_color=this._input_histogram_line1_color=null},o}(i.Dialog)
i.IndicatorSettingsDialog=o}(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={Bands:1,General:2,Index:3,MovingAverage:4,Oscillator:5,Regression:6},n={Bands:{},General:{},Index:{},MovingAverage:{},Oscillator:{},Regression:{}},o=function(o){function s(e){o.call(this,e),this._helpEnabled=this._helpDownloaded=!1,this._tooltipHoverTimer=null,this._tooltipBodyHovered=!1,this._tooltipHTMLObj=this._lastHoveredLi=null,this._initFields(),this._init()}return __extends(s,o),s.prototype.show=function(i){this._config=i,this._inp_search.val(""),this._filterIndicators(""),o.prototype.show.call(this,i),!e.Environment.isMobile&&this._inp_search.focus()},s.prototype.hide=function(){this._config=null,this._dialogContent.body.find(".scxHasTooltip").popover("hide"),o.prototype.hide.call(this)},s.prototype._init=function(){var t=this,o=$("body")
this._noResultObj.hide(),this._generateObjects()
for(var s in n)n.hasOwnProperty(s)&&this._resultContainer.append(n[s].group.root)
if(this._inp_search.on("keyup",function(e){t._filterIndicators($(e.currentTarget).val())}),this._btnClearInput.on("click",function(){t._inp_search.val().length&&t._clearInput()}),this._resultContainer.on("click",".scxIndicatorItem",function(i){var n=$(i.currentTarget)
n.addClass("active"),setTimeout(function(){n.removeClass("active")},200)
try{if(t._config.done){var o=parseInt(n.attr("data-scx_id"),10)
t._config.done(o)}}catch(i){e.UI.Notification.warning("There are no space to add more indicators")}}),this._resultContainer.on("mouseover",".scxIndicatorItem",function(e){if(t._helpEnabled){var i=$(e.currentTarget)
t._tooltipBodyHovered=!1,t._tooltipHoverTimer=setTimeout(function(){t._lastHoveredLi=i,t._lastHoveredLi.popover("show"),t._tooltipHoverTimer=null},500)}}),this._resultContainer.on("mouseout",".scxIndicatorItem",function(){t._helpEnabled&&(t._tooltipHoverTimer&&(clearTimeout(t._tooltipHoverTimer),t._tooltipHoverTimer=null),setTimeout(function(){t._tooltipBodyHovered||t._lastHoveredLi&&t._lastHoveredLi.popover("hide")},100))}),o.on("mouseover","div.popover",function(){t._helpEnabled&&(t._tooltipBodyHovered=!0)}),o.on("mouseleave","div.popover",function(){t._helpEnabled&&(t._lastHoveredLi&&t._lastHoveredLi.popover("hide"),t._tooltipBodyHovered=!1)}),e.Environment.isMobile)this._helpPanel.remove()
else{var a=new Switchery(document.querySelector("#scxIndicators_chkHelpSwitcher"),{color:"#64bd63",secondaryColor:"#ddd",className:"scx_switchery",disabled:!1,disabledOpacity:.5,speed:"0.4s"})
o.bind("scxSwitcherChanged",function(e,n){$(n.target).is(t._tooltipSwitcher)&&(!1===t._helpDownloaded?(t._tooltipLabel.hide(),t._tooltipDownloading.show(),a.disable(),i.HtmlLoader.getView("IndicatorsHelp.html",function(e){t._helpDownloaded=!0,t._tooltipDownloading.hide(),t._tooltipLabel.show(),a.enable(),t._tooltipHTMLObj=$(e),t._helpEnabled=!0,t._switchHelpTooltips()})):(t._helpEnabled=n.checked,t._switchHelpTooltips()))})}},s.prototype._generateObjects=function(){var i,o={Bands:e.Indicator.bands(),General:e.Indicator.general(),Index:e.Indicator.indices(),MovingAverage:e.Indicator.movingAverages(),Oscillator:e.Indicator.oscillators(),Regression:e.Indicator.regressions()}
for(i in o){var s=i
if(o.hasOwnProperty(s)){for(var a=this._generateIndicatorGroup(t[s]),l=[],r=0;r<o[s].length;r++)l.push(this._generateIndicatorItem(o[s][r]))
a.itemsContainer.append(l),this._sortItems(a.itemsContainer),this._applyColumns(a.itemsContainer),n[s]={indicators:l,group:a}}}},s.prototype._filterIndicators=function(e){e=e.toString().trim().toLowerCase()
var i,t,o,s,a=0
for(s in n)if(n.hasOwnProperty(s)){for(var l=0;l<n[s].indicators.length;l++)n[s].indicators[l].detach()
for(i=n[s].group,i.itemsContainer.empty(),l=o=0;l<n[s].indicators.length;l++)t=n[s].indicators[l],0<=t.text().toLowerCase().indexOf(e)&&(o++,a++,i.itemsContainer.append(t))
o?(this._sortItems(i.itemsContainer),this._applyColumns(i.itemsContainer),i.root.show()):i.root.hide()}a?this._noResultObj.hide():this._noResultObj.show()},s.prototype._sortItems=function(e){var i=e.children().detach()
i.sort(function(e,i){return $(e).text()<$(i).text()?-1:1}),e.append(i)},s.prototype._applyColumns=function(e){e.autocolumnlist({columns:3,classname:"scxIndicatorColumn"})},s.prototype._switchHelpTooltips=function(){for(var e in n)if(n.hasOwnProperty(e))for(var i=0;i<n[e].indicators.length;i++)this._helpEnabled?this._enableItemHelpTooltip(n[e].indicators[i]):this._disableItemHelpTooltip(n[e].indicators[i])},s.prototype._enableItemHelpTooltip=function(e){if(this._helpEnabled){var i=this._tooltipHTMLObj.find("#scxIndicatorTooltip_id"+e.attr("data-scx_id")).clone()
i.length||(i=$('<p style="margin-bottom: 0;">Sorry. There is no help for this indicator yet</p>')),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 $("<div></div>").append(i).html()}})}},s.prototype._disableItemHelpTooltip=function(e){e.removeClass("scxHasTooltip").popover("destroy")},s.prototype._generateIndicatorGroup=function(e){var i=$('<div class="scxIndicatorsGroup"><h4 class="scxIndicatorsGroup_header"></h4><div class="scxIndicatorsGroup_indicators"><ul></ul></div></div>')
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),$('<li class="scxIndicatorItem" data-scx_id=""></li>').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=$('<div class="scxInstrumentSearchResults"></div>'),this._noResults=$('<div class="scxInstrumentSearchNoResults">No results</div>'),null!=t.instruments&&Array.isArray(t.instruments)&&0<t.instruments.length?this._config.instruments=t.instruments:this._getInstruments=function(){return e.getAllInstruments()},this._init()}return t.prototype.set=function(e){this.setText(e&&e.symbol)},t.prototype.setText=function(e){void 0===e&&(e=""),this._setValue(e)},t.prototype.getSymbol=function(){return this._getInstrumentBySymbol(this._value)},t.prototype._init=function(){var e=this
this._inputField.addClass("scxInstrumentSearchInputField"),this._inputField.attr("type","text"),this._config.value?(this._inputField.val(this._value),this._currentText=this._value):this._inputField.val(""),i.HtmlContainer.instance.register("searchResult",this._resultsDropDown),i.HtmlContainer.instance.componentsContainer,this._inputField.on("input",function(){clearTimeout(e._searchDelayTimer),e._searchDelayTimer=setTimeout(function(){var i=e._getInputValue()
if(i!==e._currentText){e._currentText=i,e._showDropDown()
var t=e._search(i)
e._resultsCount=t.length,e._generateSearchResults(i.toUpperCase(),t)}},250)}),this._inputField.focus(function(e){$(e.currentTarget).addClass("active")}),this._inputField.blur(function(e){$(e.currentTarget).removeClass("active")}),$(window).scroll(function(){e._hideDropDown()}),$(window).resize(function(){e._hideDropDown()}),this._inputField.keyup(function(i){if(27===i.which&&(e._inputField.val(e._value),e._hideDropDown(),e._inputField.blur()),13===i.which){var t=e._getInputValue()
if(e._isDropDownVisible){var n=e._resultsDropDown.find(" > .active")
0<n.length&&(t=n.attr("data-scxinstrument"))}e._setValue(t,!0),e._hideDropDown(),e._inputField.blur()}e._isDropDownVisible||40!==i.which&&38!==i.which||(e._showDropDown(),e._generateSearchResults(e._getInputValue().toUpperCase(),e._search(e._getInputValue()))),0<e._resultsCount&&(40===i.which&&e._highlightDropDownItem(!1),38===i.which&&e._highlightDropDownItem(!0))}),this._resultsDropDown.on("click",".scxInstrumentSearchItem",function(i){e._setValue($(i.currentTarget).attr("data-scxinstrument"),!0),e._hideDropDown()}),this._resultsDropDown.on("mouseover",".scxInstrumentSearchItem",function(e){$(e.currentTarget).parent().children().removeClass("active"),$(e.currentTarget).addClass("active")}),$(document).on("click",function(i){e._isDropDownVisible&&!$(i.currentTarget).is(e._inputField)&&0===$(i.currentTarget).parents(".scxInstrumentSearchResults").length&&(e._inputField.val(e._value),e._hideDropDown())}),$("body").bind("scxContextMenuOpen",function(i){e._inputField.val(e._value),e._hideDropDown()})},t.prototype._getInputValue=function(){return $("<div></div>").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(),e<this._resultsDropDown.scrollTop()?this._resultsDropDown.scrollTop(e):i>this._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<i&&this._resultsDropDown.outerWidth(e),!this._isDropDownVisible){this._isDropDownVisible=!0
var t=this._inputField.outerHeight(),n=(this._inputField.outerWidth(!0),$(window).scrollTop()),o=$(window).scrollLeft(),s=this._inputField.offset().left
0<o&&(s-=o),0<n&&(t-=n),this._resultsDropDown.css({top:this._inputField.offset().top+t+2,left:s,maxHeight:$(window).height()-this._inputField.offset().top-t-10}),e<i&&this._resultsDropDown.width(e),this._resultsDropDown.show()}},t.prototype._generateSearchResults=function(e,i){if(this._noResults.detach(),this._resultsDropDown.empty(),0===i.length)return void this._noResults.appendTo(this._resultsDropDown)
var t,n=""
for(t in i)i.hasOwnProperty(t)&&(n+=this._generateListElement(e,i[t].symbol,i[t].company,i[t].exchange))
""!==n&&this._resultsDropDown.append($(n))},t.prototype._generateListElement=function(e,i,t,n){return'<div class="scxInstrumentSearchItem" data-scxinstrument="'+i+'"><div class="scxInstrumentSearchItem_SymbolContainer"><span class="scxInstrumentSearchItem_Symbol">'+this._highlightHTMLText(e,i)+'</span></div><div class="scxInstrumentSearchItem_NameContainer"><span class="scxInstrumentSearchItem_Name">'+this._highlightHTMLText(e,t)+'</span></div><div class="scxInstrumentSearchItem_ExchangeContainer"><span class="scxInstrumentSearchItem_Exchange">'+n+"</span></div></div>"},t.prototype._highlightHTMLText=function(e,i){if(""===e)return i
var t=this._searchTextPositions(e,i),n="",o=0
if(1===e.length&&1<t.length)for(var s=t.length-1;0<s;s--)t[s].pos-1===t[s-1].pos&&(t[s-1].len+=1,t.splice(s,1))
for(s=0;s<t.length;s++)n+=i.substr(o,t[s].pos-o)+'<span class="scxHighlightedText">'+i.substr(t[s].pos,t[s].len)+"</span>",o=t[s].pos+t[s].len
return o<i.length&&(n+=i.substr(o,i.length-o)),n},t.prototype._searchTextPositions=function(e,i){var t
t=0
var n=[],o=e.length
for(e=e.toLowerCase(),i=i.toLowerCase();-1<(t=i.indexOf(e,t));)n.push({pos:t,len:o}),t+=1
return n},t.prototype._search=function(e){e=e.toLowerCase()||""
for(var i=[],t=this._getInstruments(),n=0;n<t.length;n++)(-1<t[n].symbol.toLowerCase().indexOf(e)||-1<t[n].company.toLowerCase().indexOf(e))&&i.push(t[n])
return i},t.prototype._getInstrumentBySymbol=function(e){for(var i=this._getInstruments(),t=0;t<i.length;t++)if(i[t].symbol===e)return i[t]
return null},t.prototype._getInstruments=function(){return this._config.instruments},t}()
i.InstrumentSearch=t}(e.UI||(e.UI={}))}(StockChartX||(StockChartX={})),function(e){!function(e){var i=jQuery,t=function(){function t(i){var t=this
e.HtmlLoader.getView("Navigation.html",function(e){t._init(e,i)})}return t.prototype._init=function(e,t){var n=i(e).appendTo(t.target),o=t.chart
n.find(".scxNavigation-btn-scrollLeft").on("click",function(){o.scrollOnPixels(o.size.width/5),o.setNeedsUpdate(!0)}),n.find(".scxNavigation-btn-scrollRight").on("click",function(){o.scrollOnPixels(-o.size.width/5),o.setNeedsUpdate(!0)}),n.find(".scxNavigation-btn-zoomIn").on("click",function(){o.zoomOnPixels(o.size.width/5),o.setNeedsUpdate(!0)}),n.find(".scxNavigation-btn-zoomOut").on("click",function(){o.zoomOnPixels(-o.size.width/5),o.setNeedsUpdate(!0)}),n.find(".scxNavigation-btn-scrollToFirst").on("click",function(){var e=o.lastVisibleRecord-o.firstVisibleRecord
1<e&&(o.firstVisibleRecord=0,o.lastVisibleRecord=Math.min(e,o.recordCount-1),o.setNeedsUpdate(!0))}),n.find(".scxNavigation-btn-scrollToLast").on("click",function(){var e=o.recordCount
if(0<e){var i=o.firstVisibleRecord,t=o.lastVisibleRecord
o.lastVisibleRecord=e-1,o.firstVisibleRecord=Math.max(e-(t-i+1),0),o.setNeedsUpdate(!0)}})},t}()
e.ChartNavigation=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(i){var t={showArrows:!0,maxValue:100,minValue:1,value:1},n={showArrows:!0,maxValue:100,minValue:.01,priceDecimals:5,value:1},o=function(i){function o(e){i.call(this,e),this._isApplyClicked=!1,this._initFields(),this._init()}return __extends(o,i),o.prototype.show=function(e){this._config=e,this._priceStyleKind=e.priceStyle.chart.priceStyleKind,this._setValues(this._priceStyleKind),this._switchView(this._priceStyleKind),this._isApplyClicked=!1,i.prototype.show.call(this,e)},o.prototype.hide=function(){this._config=null,i.prototype.hide.call(this)},o.prototype._init=function(){var e=this
this._input_ATRlength.scxNumericField(t),this._input_boxSize.scxNumericField(n),this._input_reversalAmount.scxNumericField(t),this._input_reversalDoubleAmount.scxNumericField(n),this._input_numberOfLine.scxNumericField(t),this._input_source.selectpicker({container:"body"}),this._input_boxSizeKind.selectpicker({container:"body"}),this._input_barStyle.selectpicker({container:"body"}),this._input_coloredBarStyle.selectpicker({container:"body"}),this._input_source.on("change",function(){e._source=e._input_source.val(),e._switchPriceStyleMethod()}),this._input_boxSizeKind.on("change",function(){e._boxSizeKind=e._input_boxSizeKind.val(),e._switchPriceStyleMethod()}),this._input_barStyle.on("change",function(){e._barsStyle=e._input_barStyle.val()}),this._input_coloredBarStyle.on("change",function(){e._coloredBarsStyle=e._input_coloredBarStyle.val()}),this._dialog.find("#scxPriceStyleDialog_btn_save").on("click",function(){e._apply()})},o.prototype._switchView=function(i){switch(this._title.text(o._getTitle(i)),this._panelFigureInputsPanel.show(),i){case e.PointAndFigurePriceStyle.className:return this._switchPriceStyleMethod(),this._panelFigureNumberOfLine.hide(),this._panelFigureSource.show(),this._panelFigureBoxCalculationMethods.show(),this._panelFigureReversalAmount.show(),this._panelFigureReversalDoubleAmount.hide(),this._panelFigureBarStyle.hide(),void this._panelFigureColoredBarStyle.hide()
case e.RenkoPriceStyle.className:return this._switchPriceStyleMethod(),this._panelFigureNumberOfLine.hide(),this._panelFigureSource.hide(),this._panelFigureBoxCalculationMethods.show(),this._panelFigureReversalAmount.hide(),this._panelFigureReversalDoubleAmount.hide(),this._panelFigureBarStyle.hide(),void this._panelFigureColoredBarStyle.hide()
case e.KagiPriceStyle.className:return this._switchPriceStyleMethod(),this._panelFigureNumberOfLine.hide(),this._panelFigureSource.hide(),this._panelFigureBoxCalculationMethods.show(),this._panelFigureBoxSize.hide(),this._panelFigureATRLength.hide(),this._panelFigureBarStyle.hide(),void this._panelFigureColoredBarStyle.hide()
case e.LineBreakPriceStyle.className:return this._panelFigureNumberOfLine.show(),this._panelFigureSource.hide(),this._panelFigureBoxCalculationMethods.hide(),this._panelFigureReversalAmount.hide(),this._panelFigureBoxSize.hide(),this._panelFigureATRLength.hide(),this._panelFigureReversalDoubleAmount.hide(),this._panelFigureBarStyle.hide(),void this._panelFigureColoredBarStyle.hide()
case e.BarPriceStyle.className:case e.HLBarPriceStyle.className:case e.HLCBarPriceStyle.className:return this._panelFigureBarStyle.show(),this._panelFigureNumberOfLine.hide(),this._panelFigureSource.hide(),this._panelFigureBoxCalculationMethods.hide(),this._panelFigureReversalAmount.hide(),this._panelFigureBoxSize.hide(),this._panelFigureATRLength.hide(),this._panelFigureReversalDoubleAmount.hide(),void this._panelFigureColoredBarStyle.hide()
case e.ColoredBarPriceStyle.className:case e.ColoredHLBarPriceStyle.className:case e.ColoredHLCBarPriceStyle.className:return this._panelFigureColoredBarStyle.show(),this._panelFigureBarStyle.hide(),this._panelFigureNumberOfLine.hide(),this._panelFigureSource.hide(),this._panelFigureBoxCalculationMethods.hide(),this._panelFigureReversalAmount.hide(),this._panelFigureBoxSize.hide(),this._panelFigureATRLength.hide(),void this._panelFigureReversalDoubleAmount.hide()}},o.prototype._switchPriceStyleMethod=function(){this._boxSizeKind===e.PointAndFigureBoxSizeKind.ATR?(this._panelFigureBoxSize.hide(),this._panelFigureATRLength.show()):(this._panelFigureBoxSize.show(),this._panelFigureATRLength.hide()),this._priceStyleKind===e.KagiPriceStyle.className&&(this._boxSizeKind===e.KagiReversalKind.ATR?(this._panelFigureATRLength.hide(),this._panelFigureReversalAmount.show(),this._panelFigureReversalDoubleAmount.hide()):(this._panelFigureBoxSize.hide(),this._panelFigureReversalAmount.hide(),this._panelFigureReversalDoubleAmount.show()))},o.prototype._setValues=function(i){switch(i){case e.PointAndFigurePriceStyle.className:return i=this._config.priceStyle,this._source=i.source,this._input_source.selectpicker("val",this._source||e.PointAndFigureSource.CLOSE).selectpicker("refresh"),this._boxSizeKind=i.boxSize.kind,this._input_boxSizeKind.selectpicker("val",this._boxSizeKind||e.PointAndFigureBoxSizeKind.ATR).selectpicker("refresh"),this._boxSizeKind===e.PointAndFigureBoxSizeKind.ATR?this._input_ATRlength.scxNumericField("setValue",i.boxSize.value||1):this._input_boxSize.scxNumericField("setValue",i.boxSize.value||1),void this._input_reversalAmount.scxNumericField("setValue",i.reversal||1)
case e.RenkoPriceStyle.className:return i=this._config.priceStyle,this._boxSizeKind=i.boxSize.kind,this._input_boxSizeKind.selectpicker("val",this._boxSizeKind||e.RenkoBoxSizeKind.ATR).selectpicker("refresh"),void(this._boxSizeKind===e.RenkoBoxSizeKind.ATR?this._input_ATRlength.scxNumericField("setValue",i.boxSize.value||1):this._input_boxSize.scxNumericField("setValue",i.boxSizeValue||1))
case e.KagiPriceStyle.className:return i=this._config.priceStyle,this._boxSizeKind=i.reversal.kind,this._input_boxSizeKind.selectpicker("val",this._boxSizeKind||e.KagiReversalKind.ATR).selectpicker("refresh"),void(this._boxSizeKind===e.KagiReversalKind.ATR?this._input_reversalAmount.scxNumericField("setValue",i.reversal.value||1):this._input_reversalDoubleAmount.scxNumericField("setValue",i.reversal.value||1))
case e.LineBreakPriceStyle.className:return void this._input_numberOfLine.scxNumericField("setValue",this._config.priceStyle.lines||1)
case e.BarPriceStyle.className:case e.HLBarPriceStyle.className:case e.HLCBarPriceStyle.className:return void this._setBarStyle(i)
case e.ColoredBarPriceStyle.className:case e.ColoredHLBarPriceStyle.className:case e.ColoredHLCBarPriceStyle.className:return void this._setBarStyle(i,!0)
default:return void this.hide()}},o.prototype._setBarStyle=function(e,i){i?(this._coloredBarsStyle=e,this._input_coloredBarStyle.selectpicker("val",e).selectpicker("refresh")):(this._barsStyle=e,this._input_barStyle.selectpicker("val",e).selectpicker("refresh"))},o.prototype._getValues=function(){var i=this._config.chart
switch(this._priceStyleKind){case e.PointAndFigurePriceStyle.className:i=this._config.priceStyle,i.source=this._input_source.val(),i.boxSize.kind=this._input_boxSizeKind.val(),i.boxSize.kind===e.PointAndFigureBoxSizeKind.ATR?i.boxSize.value=this._input_ATRlength.scxNumericField("getValue"):i.boxSize.value=this._input_boxSize.scxNumericField("getValue"),i.reversal=this._input_reversalAmount.scxNumericField("getValue")
break
case e.RenkoPriceStyle.className:i=this._config.priceStyle,i.boxSize.kind=this._input_boxSizeKind.val(),i.boxSize.kind===e.RenkoBoxSizeKind.ATR?i.boxSize.value=this._input_ATRlength.scxNumericField("getValue"):i.boxSize.value=this._input_boxSize.scxNumericField("getValue")
break
case e.KagiPriceStyle.className:i=this._config.priceStyle,i.reversal.kind=this._input_boxSizeKind.val(),i.reversal.kind===e.KagiReversalKind.ATR?i.reversal.value=this._input_reversalAmount.scxNumericField("getValue"):i.reversal.value=this._input_reversalDoubleAmount.scxNumericField("getValue")
break
case e.LineBreakPriceStyle.className:this._config.priceStyle.lines=this._input_numberOfLine.scxNumericField("getValue")
break
case e.BarPriceStyle.className:case e.HLBarPriceStyle.className:case e.HLCBarPriceStyle.className:i.priceStyleKind=this._barsStyle,i.update()
break
case e.ColoredBarPriceStyle.className:case e.ColoredHLBarPriceStyle.className:case e.ColoredHLCBarPriceStyle.className:i.priceStyleKind=this._coloredBarsStyle,i.update()
break
default:throw Error("Unknown price style: "+this._priceStyleKind)}},o.prototype._apply=function(){this._getValues()
var i=this._config.chart.priceStyleKind
i!==e.BarPriceStyle.className&&i!==e.HLBarPriceStyle.className&&i!==e.HLCBarPriceStyle.className&&i!==e.ColoredBarPriceStyle.className&&i!==e.ColoredHLBarPriceStyle.className&&i!==e.ColoredHLCBarPriceStyle.className&&this._config.priceStyle.apply(),this._isApplyClicked=!0,this.hide()},o._getTitle=function(i){switch(i){case e.PointAndFigurePriceStyle.className:i="Point and Figure"
break
case e.RenkoPriceStyle.className:i="Renko"
break
case e.KagiPriceStyle.className:i="Kagi"
break
case e.LineBreakPriceStyle.className:i="Line Break"
break
case e.BarPriceStyle.className:case e.HLBarPriceStyle.className:case e.HLCBarPriceStyle.className:i="Bars"
break
case e.ColoredBarPriceStyle.className:case e.ColoredHLBarPriceStyle.className:case e.ColoredHLCBarPriceStyle.className:i="Colored Bars"
break
default:throw Error("Unknown price style: "+i)}return i+" Settings"},o.prototype._initFields=function(){var e=this._dialog
this._title=e.find("#scxPriceStyleDialog_title"),this._panelFigureInputsPanel=e.find(".scxPriceStyleDialog_panel_ntb_inputsPanel"),this._input_source=e.find(".scxPriceStyleDialog_input_source"),this._input_boxSizeKind=e.find(".scxPriceStyleDialog_input_boxSizeKind"),this._input_ATRlength=e.find(".scxPriceStyleDialog_input_ATRLength"),this._input_boxSize=e.find(".scxPriceStyleDialog_input_boxSize"),this._input_reversalAmount=e.find(".scxPriceStyleDialog_input_reversalAmount"),this._input_reversalDoubleAmount=e.find(".scxPriceStyleDialog_input_reversalDoubleAmount"),this._input_numberOfLine=e.find(".scxPriceStyleDialog_input_numberOfLine"),this._panelFigureSource=e.find(".scxPriceStyleDialog_panel_ntb_source"),this._panelFigureBoxCalculationMethods=e.find(".scxPriceStyleDialog_panel_ntb_boxSizeKind"),this._panelFigureATRLength=e.find(".scxPriceStyleDialog_panel_ntb_ATRLength"),this._panelFigureBoxSize=e.find(".scxPriceStyleDialog_panel_ntb_boxSize"),this._panelFigureReversalAmount=e.find(".scxPriceStyleDialog_panel_ntb_reversalAmount"),this._panelFigureReversalDoubleAmount=e.find(".scxPriceStyleDialog_panel_ntb_reversalDoubleAmount"),this._panelFigureNumberOfLine=e.find(".scxPriceStyleDialog_panel_ntb_numberOfLine"),this._panelFigureBarStyle=e.find(".scxPriceStyleDialog_panel_ntb_barStyle"),this._input_barStyle=e.find(".scxPriceStyleDialog_input_barStyle"),this._panelFigureColoredBarStyle=e.find(".scxPriceStyleDialog_panel_ntb_coloredBarStyle"),this._input_coloredBarStyle=e.find(".scxPriceStyleDialog_input_coloredBarStyle")},o}(i.Dialog)
i.PriceStyleSettingsDialog=o}(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._initFields(),this._init()}return __extends(t,i),t.prototype.show=function(e){this._config=$.extend(!0,{},e),this._setValues(),this._hideNewThemeForm(),i.prototype.show.call(this,e)},t.prototype.hide=function(){this._config=null,i.prototype.hide.call(this)},t.prototype._init=function(){var i=this
this._fieldTextFont.selectpicker({container:"body"}).change(function(e){i._fieldTextFont.next().css({"font-family":e.target.value})}),this._fieldTextSize.selectpicker({container:"body"}),this._fieldTheme.selectpicker({container:"body"}).change(function(t){t=$(t.currentTarget).val(),i._config.theme.name!==t&&(i._setTitle(t),i._config.theme=e.Theme[t],i._setValues())}),this._btnNewTheme.on("click",function(){var e=i._dialogBody.scrollTop()
if(i._showNewThemeForm(),i.resize(),i._dialogBody[0].scrollHeight>$(window).height()){var t=i._wrapperTheme.position().top+i._wrapperTheme.outerHeight(!0)-i._dialogBody.height()
i._dialogBody.scrollTop(e<t?t:e)}}),this._fieldNewThemeName.keyup(function(e){13===e.which&&i._addNewTheme()}),this._fieldNewThemeName.on("input",function(e){i._highlightNewThemeNameInvalid(!1),i._switchNewThemeConfirmButton($(e.currentTarget).val().length)}),this._btnNewThemeConfirm.on("click",function(){i._addNewTheme()}),this._dialog.find(".scxSpectrum").scx().colorPicker({localStorageKey:"scxThemeDialog_spectrum"}),this._chkUpBarBorderEnabled=new Switchery(document.querySelector("#scxThemeDialog_chk_upBarBorderColor"),t._switcherySettings),this._chkDownBarBorderEnabled=new Switchery(document.querySelector("#scxThemeDialog_chk_downBarBorderColor"),t._switcherySettings),this._chkUpBarBorderEnabled.setPosition(!1),this._chkDownBarBorderEnabled.setPosition(!1),$("body").bind("scxSwitcherChanged",function(e,t){var n=$(t.target),o=t.checked
n.is(i._fieldUpBarBorderEnabled)?i._setUpBarBorderState(o):n.is(i._fieldDownBarBorderEnabled)&&i._setDownBarBorderState(o)}),this._btnSaveTheme.on("click",function(){var e=i._getValues()
i._saveTheme(e),i._apply(e)}),this._btnApply.on("click",function(){i._apply()})},t.prototype._saveTheme=function(i){null==i&&(i=this._getValues()),i.name=this._config.theme.name,this._config.theme=i,e.Theme[this._config.theme.name]=this._config.theme},t.prototype._addNewTheme=function(){var i=e.JsUtil.filterText(this._fieldNewThemeName.val())
void 0===e.Theme[i]?(""!==i&&(this._setTitle(i),this._fieldTheme.append(t._generateThemeSelectorItem(i)),this._config.theme=this._getValues(),this._config.theme.name=i,e.Theme[i]=this._config.theme,this._fieldTheme.selectpicker("val",i).selectpicker("refresh")),this._hideNewThemeForm()):this._highlightNewThemeNameInvalid(!0)},t.prototype._showNewThemeForm=function(){this._btnNewTheme.hide(),this._wrapperTheme.show(),!e.Environment.isMobile&&this._fieldNewThemeName.focus()},t.prototype._hideNewThemeForm=function(){this._fieldNewThemeName.val(""),this._wrapperTheme.hide(),this._btnNewTheme.show()},t.prototype._switchNewThemeConfirmButton=function(e){e?this._btnNewThemeConfirm.text("OK").removeClass(t.CLASS_BTN_DEFAULT).addClass(t.CLASS_BTN_PRIMARY):this._btnNewThemeConfirm.text("Cancel").removeClass(t.CLASS_BTN_PRIMARY).addClass(t.CLASS_BTN_DEFAULT)},t.prototype._setTitle=function(e){this._dialogTitle.text(e)},t._generateThemeSelectorItem=function(i){return i=e.JsUtil.filterText(i),$('<option title="'+i+'" value="'+i+'">'+i+"</option>")},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<this._domObjects.dropdown.customValueWrapper.length,this._rootDomElement.addClass("activated"),this._rootDomElement.hover(function(){t._btnWrapper.addClass("hover")},function(){t._btnWrapper.removeClass("hover")}),this._domObjects.dropdown.inputInterval.scxNumericField({showArrows:!1,minValue:1,value:1}).keyup(function(e){13===e.which&&t._hideDropDown()}),!this._domObjects.dropdown.inputPeriodicity.children().length){var o,s=this._selectDistinctPredefinedPeriodicities(),a=[]
for(o in e.Periodicity)if(e.Periodicity.hasOwnProperty(o)&&0<=s.indexOf(e.Periodicity[o])){var l=e.TimeFrame.periodicityToString(e.Periodicity[o])
a.push($('<option value="'+e.Periodicity[o]+'">'+l+"</option>"))}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-l<l+e.outerWidth(!0)?t.LEFT:t.RIGHT,a={top:a+e.outerHeight(!0)-parseInt(e.css("margin-bottom"),10),left:null,right:null}
switch(c>s-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=$("<div></div>").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")&&0<this._btn_toggleDropDown.length&&0<this._items.length&&(this._hasChildren=!0),this._btnWrapper.on("click",function(e){var t=$(e.target)
t.is(i._btnActivate)?(i._btnWrapper.removeClass("hover"),i._canToggle?i._toggleButton(e):i._canFireFromHead?i._fireFromHead():!i._hasChildren||i._canToggle||i._canFireFromHead||i._toggleDropDown()):t.is(i._btn_toggleDropDown)?i._toggleDropDown():i._hasChildren&&i._toggleDropDown()}),this._btnWrapper.hover(function(){i._btnWrapper.addClass("hover")},function(){i._btnWrapper.removeClass("hover")}),this._btnActivate.focus(function(e){$(e.currentTarget).blur()}),this._body.bind("scxToolbarButton-anotherButtonActivated",function(e,t){i._triggerActiveButton(t),i._hideDropDown()}),this._hasChildren&&(this._itemsWrapper.hide().addClass(this._rootElement.attr("data-type")).appendTo(e.HtmlContainer.instance.componentsContainer),this._body.bind("scxToolbarButton-anotherDropdownActivated scxContextMenuOpen",function(){i._hideDropDown(),i._deactivateButton()}),this._canFireFromHead||this._btnActivate.attr("data-scxValue",this._items.first().attr("data-scxValue")),this._btn_toggleDropDown.focus(function(e){$(e.currentTarget).blur()}),this._body.click(function(e){i._isActive&&0===$(e.target).parents(i._rootElement.selector).length&&i._hideDropDown()}),this._body.on("touchstart",function(e){i._isActive&&0===$(e.target).parents(i._rootElement.selector).length&&i._hideDropDown()}),this._items.click(function(e){e=$(e.currentTarget).attr("data-scxValue"),i._setValue(e)}),this._config.selectedItem&&this._setValue(this._config.selectedItem),$(window).on("scroll resize",function(){i._hideDropDown()}))},t.prototype._setValue=function(e,i){this._deactivateButton(i),this._items.removeClass("active"),this._canFireFromHead||(this._items.parent().find('[data-scxValue="'+e+'"]').addClass("active"),this._btnActivate.attr("data-scxValue",e)),this._activateButton(i,e),this._hideDropDown()},t.prototype._triggerActiveButton=function(e){this._rootElement.hasClass("scxToolbarButtonManuallySwitchable")||!$(e).is(this._btnActivate)&&this._canToggle&&this._deactivateButton()},t.prototype._activateButton=function(e,i){this._isActivated=!0,this._canToggle&&(this._rootElement.addClass("activated"),this._itemsWrapper.addClass("activated"),this._body.trigger("scxToolbarButton-anotherButtonActivated",this._btnActivate)),this._canFireFromHead?this._config.selectionChanged(i,this._isActivated):!1!==e&&this._config.selectionChanged&&this._config.selectionChanged(this._btnActivate.attr("data-scxValue"),this._isActivated)},t.prototype._deactivateButton=function(e){this._isActivated&&(this._isActivated=!1,this._canToggle&&(this._rootElement.removeClass("activated"),this._itemsWrapper.removeClass("activated")),!1!==e&&this._config.selectionChanged&&!this._canFireFromHead&&this._config.selectionChanged(this._btnActivate.attr("data-scxValue"),this._isActivated))},t.prototype._toggleButton=function(e){this._isActivated?this._deactivateButton():this._activateButton()},t.prototype._fireFromHead=function(){if(this._isActive)this._hideDropDown()
else{var e=this._btnActivate.attr("data-scxValue")
this._config.selectionChanged(e)}},t.prototype._showDropDown=function(){this._body.trigger("scxToolbarButton-anotherDropdownActivated"),this._isActive=!0
var e=this._rootElement.addClass("active"),t=this._itemsWrapper,n=this._itemsContainer,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"}),t.css({top:0,left:0}).removeClass("visible").show()
var r=t.outerWidth(!0)+7,c=t.outerHeight(!0)
t.hide().addClass("visible")
var _=l+r>o&&o-l<l+e.outerWidth(!0)?i.LEFT:i.RIGHT,a={top:a+e.outerHeight(!0)-parseInt(e.css("margin-bottom"),10),left:null}
switch(c>s-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('<div class="scxWaitingBarContainer"></div>').appendTo(this._parentContainer),i('<span class="scxWaitingBarText">'+this._config.text+"</span>").appendTo(this._container)
for(var e=i('<div class="scxDotsContainer"></div>').appendTo(this._container),t=[],n=0;n<this._config.dotsCount;n++)t.push(i('<div class="scxWaitingBarDot"></div>'))
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('<div id="'+this._id+'"><style class="scxTooltipArrowStyleAfter"></style><style class="scxTooltipArrowStyleBefore"></style><style class="scxTooltipThemeArrowStyleAfter"></style><style class="scxTooltipThemeArrowStyleBefore"></style><div class="scxTooltipContent"></div></div>')
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('<img src="'+n+'" style="max-width: '+(this._maxContentWidth-2*s)+'px">').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||95<e?"display: none;":"display: block;",o="#"+this._id+":before {left: "+e+"%; "+(s?"border-bottom-color: "+o+";":"border-top-color: "+o+";")+" "+a+" "+l+" "+r+" }"
this._arrowAfter.text("#"+this._id+":after {left: "+e+"%; "+(s?"border-bottom-color: "+n+";":"border-top-color: "+n+";")+" "+a+" "+l+" "+r+" }"),this._arrowBefore.text(o)},n.prototype.applyTheme=function(){if(this._tooltipElement){var i=this.actualTheme
if(i){var t=i.border.enabled?i.border.width:0,n="solid",o=i.border.color,s=i.fill.enabled?i.fill.color:"transparent",a=i.text.fillColor,l=i.text.fontSize,r=i.text.fontFamily,c=i.text.fontWeight,_=i.text.fontStyle,h=i.text.decoration
switch(i.border.lineStyle){case e.LineStyle.DOT:n="dotted"
break
case e.LineStyle.DASH_DOT:n="dashed"
break
case e.LineStyle.DASH:n="dashed"}this._tooltipElement.css({background:s,"border-color":o,"border-width":t,"border-style":n}),this._contentElement.css({color:a,"font-family":r,"font-size":l+"px","font-weight":c,"font-style":_,"text-decoration":h,"word-wrap":"break-word"}),this._applyText(),this._arrowMainBefore.text("#"+this._id+":before { border-width: "+t+" }")}}},n.prototype.moveTo=function(e){var i=this._actualPosition(e),t=this._calculateLocation(i,e)
this._adjustArrow((e.x-t.x)/this.size.width*100,i),this._tooltipElement.css("left",t.x).css("top",t.y)},n.prototype._calculateLocation=function(e,t){var n,o=this.size,s=t.x-o.width/2
switch(n=o.height+15,e){case i.TooltipPosition.TOP:n=t.y-n
break
case i.TooltipPosition.BOTTOM:n=t.y+30
break
default:throw Error("Unknown tooltip position: "+e)}var a=this.layoutRect
return a&&(s<a.left&&(s=a.left),a=a.left+a.width,s+o.width>a&&(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={}))