(window.webpackJsonp=window.webpackJsonp||[]).push([["chart-widget-gui"],{"+jnJ":function(t,e,i){"use strict";i.d(e,"a",(function(){return s})),i.d(e,"b",(function(){return a}));i("YFKU"),i("EsMY");var s,o=i("m/cY"),n=i("Vdly");function l(t){return t===s.AlwaysOn||t===s.AlwaysOff?t:s.VisibleOnMouseOver}function a(t,e){var i,a;function r(){if(!i){i=Object(o.a)();var s=n.getValue(t);void 0===s&&void 0!==e&&(s=n.getValue(e)),i.setValue(l(s)),i.subscribe(i,(function(e){n.setValue(t,l(e.value()))}))}return i}return{property:r,availableValues:function(){return[{value:s.VisibleOnMouseOver,title:window.t("Visible on Mouse Over")},{value:s.AlwaysOn,title:window.t("Always Visible")},{value:s.AlwaysOff,title:window.t("Always Invisible")}]},actualBehavior:function(){if(!a){a=Object(o.a)();var t=r(),e=function(){var e=t.value();e!==s.AlwaysOn&&e!==s.AlwaysOff&&(e=Modernizr.mobiletouch?s.AlwaysOn:s.VisibleOnMouseOver),a&&a.setValue(e)};t.subscribe(a,e),e()}return a}}}!function(t){t.AlwaysOn="alwaysOn",t.VisibleOnMouseOver="visibleOnMouseOver",t.AlwaysOff="alwaysOff"}(s||(s={}))},"/NcV":function(t,e){t.exports=''},"0jws":function(t,e,i){t.exports={blockHidden:"blockHidden-pECc1q1w","pane-button":"pane-button-3IbFaPrJ"}},"1ANp":function(t,e,i){"use strict";i.d(e,"c",(function(){return n})),i.d(e,"d",(function(){return l})),i.d(e,"b",(function(){return a})),i.d(e,"a",(function(){return r}));var s,o=i("+jnJ"),n="NavigationButtons.visibility",l=(s=Object(o.b)(n)).property,a=s.availableValues,r=s.actualBehavior},"1Wf8":function(t,e){t.exports=''},"25b6":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return l})),i.d(e,"a",(function(){return a}));var s=/[<"'&>]/g,o=function(t){return"&#"+t.charCodeAt(0)+";"};function n(t){return t.replace(s,o)}function l(t){return void 0===t&&(t=""),t.replace(/\s+/g,"")}function a(t){return void 0===t&&(t=""),t.replace(/\b\w/g,(function(t){return t.toUpperCase()}))}},"2CEX":function(t,e){ t.exports=''},"5Alx":function(t,e,i){t.exports={legend:"legend-29zvAld0",item:"item-3eXPhOmy",series:"series-12hzsxbp",withAction:"withAction-1y86Ymm9",selected:"selected-2qw9PFUJ",last:"last-3Xus0HXW",text:"text-1pYqyE6B",noWrapWrapper:"noWrapWrapper-AC879h-w",noWrap:"noWrap-ODIQgNap",valuesAdditionalWrapper:"valuesAdditionalWrapper-3BfAIuML",valueItem:"valueItem-3JDGGSt_",valueTitle:"valueTitle-1myNPdtH",valueValue:"valueValue-3kA0oJs5",valuesWrapper:"valuesWrapper-1ukbb5SP",directionColumn:"directionColumn-abL_Vsle",titleWrapper:"titleWrapper-1Zs2rjQ6",button:"button-22Ex8G2W",statusesWrapper:"statusesWrapper-GnubQvDb",buttonsWrapper:"buttonsWrapper-3eBZpnXm",buttons:"buttons-1-XhYDHM",noActions:"noActions-1D515O5o",title:"title-bcHj6pEn",title2nd:"title2nd-2igtq1cH",disabled:"disabled-3P6bUcMx",withCustomTextColor:"withCustomTextColor-Pw_dabsC",study:"study-lgC0tuTJ",title1st:"title1st-2at68hKe",hideValues:"hideValues-3JtC3-Os",has5Buttons:"has5Buttons-3tuydZU5",stayInHoveredMode:"stayInHoveredMode-3K55nNni",withTail:"withTail-2tfD0t7T",loading:"loading-37LPn65g",loader:"loader-iCjkbLoX",withDot:"withDot-VrJCTK--",title3rd:"title3rd-2bpagZ7H",title4th:"title4th-28_-ZX9R",miniHidden2Title:"miniHidden2Title-1xHUL0G8",microHidden2Title:"microHidden2Title-37EAZYGX",hidden3Title:"hidden3Title-22u6NoOK",flagged:"flagged-3lOrkL__",medium:"medium-2Vr6MA2I",minimized:"minimized-25_VM9I8",micro:"micro-1-90nTmg",onlyOneButtonCanBeStick:"onlyOneButtonCanBeStick-16Vrffc6",touchMode:"touchMode-2jC98z1-",buttonIcon:"buttonIcon-2lrp9MHZ",flag:"flag-1kqFt7GH",invisibleHover:"invisibleHover-qowat1V5",eye:"eye-3mqNMkLJ",hiddenLoading:"hiddenLoading-hcuRRcWh","eye-animation":"eye-animation-1pyfCZvS",markerContainer:"markerContainer-3MnDLQVD",flagWrapper:"flagWrapper-14Sd7MtI",sourcesWrapper:"sourcesWrapper-2JcXD9TK",newCollapser:"newCollapser-1F6pNRDi",sources:"sources-6Hp4M7li",toggler:"toggler-_SUZ7r_5 pane-button-3IbFaPrJ",counter:"counter-1hG1zy7A",iconArrow:"iconArrow-3q7vxxnz",objectTree:"objectTree-2tLil0dm",onlyOneSourceShown:"onlyOneSourceShown-1dCmMKoj",closed:"closed-1Sz6CztG",objectsTreeCanBeShown:"objectsTreeCanBeShown-2R_D8NJP"}},"61S9":function(t,e){ t.exports=''},"6dGu":function(t,e){t.exports=''},"94TV":function(t,e){t.exports=''},"956S":function(t,e){t.exports=''},"9Crk":function(t,e){ t.exports=''},"9lPX":function(t,e){t.exports=''},AH3n:function(t,e){t.exports=''},AvGy:function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i("qFKp"),o=s.CheckMobile.any()},D8x7:function(t,e){t.exports=''},EV8o:function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var s=i("ogJP");function o(t,e,i,o,n){var l=document.createElement("div");l.className=e,l.classList.toggle(o,!t.visible.value()),Object.assign(l.dataset,t.dataset),void 0!==t.className&&l.classList.add(t.className),void 0!==t.title&&(l.classList.add("apply-common-tooltip"),l.setAttribute("title",t.title.value()),void 0!==t.hotKeyTitle&&(l.dataset.tooltipHotkey=t.hotKeyTitle)),l.addEventListener("touchend",t.action),l.addEventListener("mousedown",(function(e){0===e.button&&t.action(e)}));var a=document.createElement("div");a.classList.add(i);var r=t.iconMap.get(n)||"";return Object(s.isString)(r)?a.innerHTML=r:a.appendChild(r),l.appendChild(a),l}},G2LI:function(t,e){t.exports=''},GOhO:function(t,e,i){"use strict";var s=i("+DwS");i("tc+8");var o=i("m/cY");function n(t){for(var e=[],i=1;io.timeStamp)){var n=o.target;void 0!==i&&null!==e&&null!==n&&n.ownerDocument===s&&(e.contains(n)||i(o))}}return o.click&&s.addEventListener("click",n,!1),o.mouseDown&&s.addEventListener("mousedown",n,!1),o.touchEnd&&s.addEventListener("touchend",n,!1),o.touchStart&&s.addEventListener("touchstart",n,!1),function(){s.removeEventListener("click",n,!1),s.removeEventListener("mousedown",n,!1),s.removeEventListener("touchend",n,!1),s.removeEventListener("touchstart",n,!1)}}i.d(e,"a",(function(){return s}))},RgOa:function(t,e){t.exports=''},RspR:function(t,e,i){"use strict";i.d(e,"c",(function(){return l})),i.d(e,"b",(function(){return a})),i.d(e,"a",(function(){return r}));var s,o=i("+jnJ"),n=i("1ANp"),l=(s=Object(o.b)("PaneButtons.visibility",n.c)).property,a=s.availableValues,r=s.actualBehavior},S48P:function(t,e){ t.exports=''},TGRH:function(t,e,i){"use strict";i.r(e),i.d(e,"ControlBarNavigation",(function(){return H}));var s,o=i("Eyy1"),n=(i("YFKU"),i("1ANp")),l=i("Ialn"),a=i("gWrr"),r=i("/DW5"),u=i("qFKp"),d=i("/3z9"),h=i("d700"),c=(i("JWMC"),i("MjtL")),p=i("e8Rm"),_=i("e2QN"),b=i("vg09"),g=i("/NcV"),m=i("94TV"),v=i("qfuz"),w=i("MQEA"),y=i("eYcT"),f=i("nFx7"),S=(i("jrhZ"),Object(r.b)({keys:["Alt","R"],text:"{0} + {1}"})),M=Object(r.b)({keys:["Alt","Click","Alt","Enter"],text:"{0} + {1}, {2} + {3}"}),C=Object(r.b)({keys:[v],text:"{0}"}),E=Object(r.b)({keys:[w],text:"{0}"}),V='
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t'+p+'\n\t\t\t
\n\t\t\t
\n\t\t\t\t'+b+'\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t'+y+'\n\t\t\t
\n\t\t\t
\n\t\t\t\t'+f+'\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t'+c+'\n\t\t\t
\n\t\t\t
\n\t\t\t\t'+g+'\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t'+_+"\n\t\t\t
\n\t\t
\n\t
\n
",k='
\n\t'+m+"\n
",T=u.CheckMobile.any(),x=((s={}).moving="wait_finishing",s.wait_finishing="stop",s.stop="moving",s),L={zoomInOut:!0,maximize:!0,scrollLeftRight:!0,resetScale:!0,goToRealtime:!0},H=function(){function t(t,e,i){ this._widget=Object(o.ensureNotNull)(Object(a.a)(V).querySelector(".control-bar-wrapper")),this._controlBar=Object(o.ensureNotNull)(this._widget.querySelector(".control-bar")),this._back=Object(o.ensureNotNull)(Object(a.a)(k).querySelector(".control-bar__btn--back-present")),this._btnGroups=Array.from(this._controlBar.querySelectorAll(".js-btn-group")),this._backButtonVisible=!1,this._boundKeydownHandler=null,this._boundKeyupHandler=null,this._boundMouseHandler=null,this._chartModel=null,this._checkIntervalId=0,this._controlBarVisible=!1,this._currentDistance=0,this._deferredFinishTimeout=0,this._finishingTimeout=0,this._moveType="",this._movingTimeout=0,this._pressedKey=[],this._priceAxisChanged=null,this._resetAvailabilityChanged=null,this._priceAxisName="",this._rafId=0,this._startTime=0,this._state="stop",this._visibilityTypeProperty=null,this._boundUpdateMaximizeButtonsVisibility=this._updateMaximizeButtonsVisibility.bind(this),this._boundToggleFullscreenButtons=this._toggleFullscreenButtons.bind(this),this._paneWidth=0,this._leftPriceScaleWidth=0,this._rightPriceScaleWidth=0,this._chart=t,this._parent=e,this._options=Object.assign({},L,i),this._visibilityPrioritizedGroups=this._initGroupDescriptions(),this._init(),this._initHandlers(),this.updatePosition()}return t.prototype.destroy=function(){if(null!==this._visibilityTypeProperty&&(this._visibilityTypeProperty.unsubscribe(this,this._onVisibilityTypeChange),this._visibilityTypeProperty=null),null!==this._boundMouseHandler&&(this._parent.removeEventListener("mousemove",this._boundMouseHandler,!1),this._parent.removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null),null!==this._boundKeydownHandler&&(this._parent.ownerDocument.removeEventListener("keydown",this._boundKeydownHandler),this._boundKeydownHandler=null),null!==this._boundKeyupHandler&&(this._parent.ownerDocument.removeEventListener("keyup",this._boundKeyupHandler),this._boundKeyupHandler=null),clearTimeout(this._movingTimeout),null!==this._priceAxisChanged&&(this._priceAxisChanged.unsubscribe(this,this._updateBackBtnPosition),this._priceAxisChanged=null),clearInterval(this._checkIntervalId),null!==this._resetAvailabilityChanged){this._resetAvailabilityChanged.unsubscribe(this,this._updateResetScalesButtonVisibility);var t=this._chart.getResizerDetacher();t.fullscreenable.unsubscribe(this._boundUpdateMaximizeButtonsVisibility),t.fullscreen.unsubscribe(this._boundToggleFullscreenButtons),this._resetAvailabilityChanged=null}this._chart=null},t.prototype.updatePosition=function(){var t=this._chart.paneWidgets();if(0!==t.length){this._paneWidth=t[0].width(),this._leftPriceScaleWidth=this._chart.getPriceAxisMaxWidthByName("left"),this._rightPriceScaleWidth=this._chart.getPriceAxisMaxWidthByName("right");var e=this._chart.timeAxisHeight()+this._bottomMargin();this._widget.style.bottom=e+"px",this._back.style.bottom=e+"px",this._updateBtnGroupVisibility()}},t.prototype._bottomMargin=function(){var t,e=this._chart.paneWidgets() ;return(null!==(t=this._chart.maximizedPaneWidget())&&void 0!==t?t:e[e.length-1]).containsMainSeries()?32:5},t.prototype._init=function(){var t=this;if(u.CheckMobile.any())for(var e=0,i=this._btnGroups;e=i.left-100&&t.clientX<=i.right+100&&t.clientY>=i.top-s&&t.clientY<=i.bottom+100}this._controlBarVisible!==e&&(this._controlBarVisible=e,null===this._rafId&&(this._rafId=this._controlBar.ownerDocument.defaultView.requestAnimationFrame(this._updateControlBarVisibility.bind(this))))}},t.prototype._updateControlBarVisibility=function(){this._rafId=null,this._controlBar.classList.toggle("control-bar--hidden",!this._controlBarVisible)},t.prototype._updateBackBtnPosition=function(){if("left"===this._priceAxisName||"right"===this._priceAxisName){ var t=this._chart.getPriceAxisMaxWidthByName(this._priceAxisName)+14;t&&(this._back.style.marginRight=t+"px")}},t.prototype._updateBtnGroupVisibility=function(){for(var t=this._leftPriceScaleWidth+this._paneWidth,e=(t+this._rightPriceScaleWidth)/2,i=2*Math.min(t-e,e-this._leftPriceScaleWidth)-50-50,s=!1,o=0,n=this._visibilityPrioritizedGroups;o=0&&!s,s=s||!l.enoughSpaceForGroup),!l.enoughSpaceForGroup!==l.element.classList.contains("js-hidden")&&l.element.classList.toggle("js-hidden",!l.enoughSpaceForGroup)}this._updateControlBarPosition()},t.prototype._getBtnGroup=function(t){return Object(o.ensureDefined)(this._btnGroups.find((function(e){return e.classList.contains(t)})))},t.prototype._updateControlBarPosition=function(){var t=this._visibilityPrioritizedGroups.reduce((function(t,e){return t+(e.enoughSpaceForGroup?e.totalWidth:0)}),0),e=(this._paneWidth+this._leftPriceScaleWidth+this._rightPriceScaleWidth)/2-Math.ceil(t/2);this._widget.style.left=e+"px"},t.prototype._updateResetScalesButtonVisibility=function(){if(null!==this._chartModel){var t=this._chartModel.model().isScalesResetAvailable();this._buttons.turn.classList.toggle("control-bar__btn--btn-hidden",!t)}},t.prototype._updateMaximizeButtonsVisibility=function(){this._updateBtnGroupVisibility()},t.prototype._toggleFullscreenButtons=function(){var t=this._chart.getResizerDetacher().fullscreen.value();this._buttons.maximize.classList.toggle("js-hidden",t),this._buttons.minimize.classList.toggle("js-hidden",!t)},t.prototype._isMaximizeButtonAvailable=function(){return this._options.maximize,!1},t.prototype._move=function(t){var e=this;if(null!==this._chartModel&&"stop"===this._state&&this._chartModel.beginUndoMacro(1===t?"Move Left":"Move Right"),this._state=x.stop,this._moveType="animated",this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0),this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0),this._startTime=Date.now(),0===this._movingTimeout){var i=this._startTime,s=function(){e._moveStep(i,0,50*t,1e3),e._movingTimeout=setTimeout(s,10)};this._movingTimeout=setTimeout(s,10)}},t.prototype._moveStep=function(t,e,i,s){if(null!==this._chartModel&&!this._chartModel.timeScale().isEmpty()){var o=Date.now();o1||!isFinite(n))&&(n=1);var l=1-Math.pow(1-n,3);return this._currentDistance=(i-e)*l+e,this._chartModel.scrollChart(this._currentDistance),n}},t.prototype._finishMove=function(){var t=this;clearTimeout(this._movingTimeout),this._movingTimeout=0,this._deferredFinishTimeout=0;var e=this._currentDistance,i=Date.now(),s=function(){var o=t._moveStep(i,e,0,700);o&&o<1?t._finishingTimeout=setTimeout(s,10):null!==t._chartModel&&(t._state=x.wait_finishing,t._moveType="",t._movingTimeout=0,t._currentDistance=0,t._chartModel.endUndoMacro())};this._finishingTimeout=setTimeout(s,10)},t.prototype._stopMove=function(){ "moving"===this._state&&(this._state=x.moving,Date.now()-this._startTime<200?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-(Date.now()-this._startTime)):this._finishMove())},t.prototype._moveByBar=function(t){var e=this;if(null!==this._chartModel){var i=this._chartModel.timeScale();if(i.isEmpty())return;if("stop"===this._state&&this._chartModel.beginUndoMacro(1===t?"Move Left":"Move Right"),null!==i.visibleBarsStrictRange()){var s=i.indexToCoordinate(i.visibleBarsStrictRange().lastBar())+i.barSpacing()/2;Math.abs(i.width()-s)>i.barSpacing()/6&&this._chartModel.scrollChart(i.width()-s)}if(this._state=x.stop,this._moveType="by_bar",this._startTime=Date.now(),!this._movingTimeout){var o=0,n=150,l=function(){e._moveByBarStep(t),o++,n>100&&(n-=o/5*20),e._movingTimeout=setTimeout(l,n)};this._movingTimeout=setTimeout(l,400),this._moveByBarStep(t)}}},t.prototype._moveByBarStep=function(t){if(null!==this._chartModel){if(this._chartModel.timeScale().isEmpty())return;this._chartModel.scrollChartByBar(t)}},t.prototype._stopMoveByBar=function(){"moving"===this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state=x.wait_finishing,this._moveType="",this._movingTimeout=0,this._currentDistance=0,null!==this._chartModel&&this._chartModel.endUndoMacro())},t.prototype._keydownHandler=function(t){var e,i=Object(d.hashFromEvent)(t),s=255&i,o=Object(d.modifiersFromEvent)(t);if(37===s)e=1;else{if(39!==s)return;e=-1}d.isMacKeyboard&&o===d.Modifiers.Mod||o!==d.Modifiers.Mod&&o!==d.Modifiers.Alt&&o!==d.Modifiers.None||Object(h.a)(i,t.target)||this._pressedKey[s]||(this._pressedKey[s]=!0,o===d.Modifiers.None?this._moveByBar(e):this._move(e),t.preventDefault())},t.prototype._keyupHandler=function(t){var e=Object(d.hashFromEvent)(t);if(!Object(h.a)(e,t.target)){var i=255&e,s=Object(d.modifiersFromEvent)(t);37!==i&&39!==i||s!==d.Modifiers.Mod&&s!==d.Modifiers.Alt&&s!==d.Modifiers.None||(this._pressedKey[i]=!1,"by_bar"===this._moveType?this._stopMoveByBar():this._stopMove())}},t.prototype._trackEvent=function(t){0},t}()},Tq3g:function(t,e){t.exports=''},Uua9:function(t,e){t.exports=''},VrXG:function(t,e){ t.exports=''},VrrN:function(t,e){t.exports=''},WYzw:function(t,e){t.exports=''},"Y+EN":function(t,e){t.exports=''},YGQl:function(t,e){t.exports=''},ZKFq:function(t,e,i){t.exports={"css-value-pane-controls-padding-left":"1px","css-value-pane-controls-padding-right":"5px",paneControls:"paneControls-3t_VmRy0",hasTopMargin:"hasTopMargin-2samtQKI",hidden:"hidden-3ndYaA31",forceHidden:"forceHidden-2qoGxuLX",button:"button-1T73noHe pane-button-3IbFaPrJ",buttonIcon:"buttonIcon-1vsadlK4",minimize:"minimize-UL6CPYKt",newButton:"newButton-2UJTRB7V",touchMode:"touchMode-33C2amJm",maximize:"maximize-2gtRCsC0","maximize-animation-up-bracket":"maximize-animation-up-bracket-PKA42SoI","maximize-animation-down-bracket":"maximize-animation-down-bracket-6VpX9y4d","minimize-animation-up-bracket":"minimize-animation-up-bracket-1ZcEx180","minimize-animation-down-bracket":"minimize-animation-down-bracket-2sZM5-ln",up:"up-3-Dp9Ytc","up-animation":"up-animation-2oGxHhg9",down:"down-2qp_j-xN","down-animation":"down-animation-28i3s7Bs",buttonsWrapper:"buttonsWrapper-326cDko9"}},bNWL:function(t,e){ t.exports=''},cbig:function(t,e){t.exports=''},e2QN:function(t,e){t.exports=''},e8Rm:function(t,e){t.exports=''},eYcT:function(t,e){t.exports=''},fBig:function(t,e,i){t.exports={loader:"loader-1ON1rkY9",loaderItem:"loaderItem-6asdclOe","loader-animation":"loader-animation-1vbmOmyN",shown:"shown-1QFCxvPl",touchMode:"touchMode-I-CBM3V3"}},fk9O:function(t,e){t.exports=''},gKdq:function(t,e){t.exports=''},i9xP:function(t,e){ t.exports=''},jXu8:function(t,e){t.exports=''},jrhZ:function(t,e,i){t.exports={"animation-minimize-corner-left-top":"animation-minimize-corner-left-top-1QFR0TYG","animation-minimize-corner-right-top":"animation-minimize-corner-right-top-2OigqFDd","animation-minimize-corner-right-bottom":"animation-minimize-corner-right-bottom-171Xjuh0","animation-minimize-corner-left-bottom":"animation-minimize-corner-left-bottom-Gj_EWVOk","animation-maximize-corner-left-top":"animation-maximize-corner-left-top-1dOMET94","animation-maximize-corner-right-top":"animation-maximize-corner-right-top-X6SjWmdM","animation-maximize-corner-right-bottom":"animation-maximize-corner-right-bottom-2lZ_pYbV","animation-maximize-corner-left-bottom":"animation-maximize-corner-left-bottom-28bRbB5v"}},ku84:function(t,e){t.exports=''},lvAK:function(t,e,i){"use strict";i.r(e);var s=i("RspR"),o=i("3ClC"),n=(i("LVLx"),i("Eyy1")),l=i("eJTA"),a=i("+jnJ"),r=i("AvGy"),u=i("EV8o"),d=i("ZKFq"),h=i("0jws"),c=function(){function t(t,e,i){this._parentEl=document.createElement("div"),this._listActionsWrapperEl=null,this._listActionsElements={},this._actionsSpawns={},this._onMouseEnterLeaveEventHandler=null,this._mouseOverWidget=!1,this._wrapEl=t,this._onMouseEnterLeaveEventHandler=this._onMouseEnterLeaveEvent.bind(this),this._wrapEl.addEventListener("mouseenter",this._onMouseEnterLeaveEventHandler),this._wrapEl.addEventListener("mouseleave",this._onMouseEnterLeaveEventHandler),this._actions=e,this._globalVisibility=i.globalVisibility.spawn(),this._globalVisibility.subscribe(this._updatePaneControlsWidgetVisibility.bind(this)),this._visibilityType=i.visibilityType.spawn(),this._visibilityType.subscribe(this._updatePaneControlsWidgetVisibility.bind(this)),this._doNotSwitchToContextMenuMode=i.doNotSwitchToContextMenuMode,this._themedColor=i.themedColor.spawn(),this._themedColor.subscribe(this._updateThemedColor.bind(this));for(var s=0,o=Object.entries(this._actions);s0){var e=Object(l.parseRgb)(t),i=e[0],s=e[1],o=e[2];this._parentEl.style.color=Object(l.rgbaToString)([i,s,o,Object(l.normalizeAlphaComponent)(.8)])}else this._parentEl.style.removeProperty("color")},t}(),p=i("7KDR"),_=i("5VQP"),b=i("obM5"),g=i("fk9O"),m=i("gKdq"),v=i("WYzw");function w(t,e){var i=Object(n.ensureNotNull)(e.target);return function(t){var e=[];if(t.maximize.visible.value()){var i=Object(n.ensure)(t.maximize.title),s=Object(n.ensureNotNull)(t.maximize.action);e.push(new p.Action({icon:v,label:i.value(),statName:"Maximize Pane",shortcutHint:y,onExecute:function(){return s()}}))}else if(t.minimize.visible.value()){i=Object(n.ensure)(t.minimize.title);var o=Object(n.ensureNotNull)(t.minimize.action);e.push(new p.Action({icon:v,label:i.value(),statName:"Minimize Pane",shortcutHint:y,onExecute:function(){return o()}}))}if(t.up.visible.value()){i=Object(n.ensure)(t.up.title);var l=Object(n.ensureNotNull)(t.up.action);e.push(new p.Action({icon:g,label:i.value(),statName:"Move pane up",onExecute:function(){return l()}}))}if(t.down.visible.value()){i=Object(n.ensure)(t.down.title);var a=Object(n.ensureNotNull)(t.down.action);e.push(new p.Action({icon:m,label:i.value(),statName:"Move pane down",onExecute:function(){return a()}}))}if(t.close.visible.value()){i=Object(n.ensure)(t.close.title);var r=Object(n.ensureNotNull)(t.close.action);e.push(new p.Action({icon:b,label:i.value(),statName:"Delete pane",onExecute:function(){return r()}}))}return _.ContextMenuManager.createMenu(e)}(t).then((function(t){return t.show((function(t){var e=i.getBoundingClientRect();return{clientX:e.right-t,clientY:e.top+e.height+3}})),t}))}var y=window.t("Double click");var f=i("hY0g"),S=i.n(f),M=i("EsvI"),C=i("/DW5"),E=i("OJSF"),V=i("PXSR"),k=i("QEZv"),T=i("ku84"),x=i("i9xP"),L=i("1Wf8"),H=i("956S");i.d(e,"PaneControlsWidget",(function(){return I}));var B=Modernizr.mobiletouch,W=window.t("Delete pane"),A=window.t("Move pane up"),O=window.t("Move pane down"),P=window.t("Maximize pane"),D=window.t("Restore pane"),z=window.t("Manage panes"),j=window.t("Double click"),N=Object(C.b)({keys:[""],text:j}),I=function(){function t(t,e,i,o,n){var l=this;this._actions={},this._moreActionCM=null,this._themedColor=new S.a(""),this._model=t,this._paneWidget=e,this._callbacks=o,this._closeButtonVisibility=new S.a(this._getCloseButtonVisibility()),this._upButtonVisibility=new S.a(this._getUpButtonVisibility()), this._downButtonVisibility=new S.a(this._getDownButtonVisibility()),this._maximizeButtonVisibility=new S.a(this._getMaximizeButtonVisibility()),this._minimizeButtonVisibility=new S.a(this._getMinimizeButtonVisibility()),this._createActions(),this._visibilityTypeProperty=Object(s.a)(),this._visibilityTypeProperty.subscribe(this,(function(t){l._visibilityType.setValue(t.value())})),this._visibilityType=new S.a(this._visibilityTypeProperty.value()),this._isPaneMaximize=new S.a(this._getIsPaneMaximizeValue()),this._isWidgetShow=new S.a(this._getIsWidgetShow()),this._backgroundThemeName=i.backgroundThemeName,this._renderer=new c(n,this._actions,{visibilityType:this._visibilityType.readonly(),globalVisibility:this._isWidgetShow.readonly(),doNotSwitchToContextMenuMode:this._isPaneMaximize.readonly(),themedColor:this._themedColor.readonly()})}return t.prototype.destroy=function(){this._visibilityTypeProperty.unsubscribeAll(this),this._renderer.destroy()},t.prototype.getElement=function(){return this._renderer.getElement()},t.prototype.action=function(){return this._actions},t.prototype.update=function(){this._updateButtonsVisibility(),this._isPaneMaximize.setValue(this._getIsPaneMaximizeValue()),this._isWidgetShow.setValue(this._getIsWidgetShow())},t.prototype.updateWidgetModeByWidth=function(t){this._renderer.updateWidgetModeByWidth(t)},t.prototype.updateThemedColors=function(t){null===t&&(t=Object(M.getStdThemedValue)("chartProperties.paneProperties.background",this._backgroundThemeName.value())),this._themedColor.setValue(t||"")},t.prototype._updateButtonsVisibility=function(){this._closeButtonVisibility.setValue(this._getCloseButtonVisibility()),this._upButtonVisibility.setValue(this._getUpButtonVisibility()),this._downButtonVisibility.setValue(this._getDownButtonVisibility()),this._maximizeButtonVisibility.setValue(this._getMaximizeButtonVisibility()),this._minimizeButtonVisibility.setValue(this._getMinimizeButtonVisibility())},t.prototype._createActions=function(){this._actions.up={iconMap:new Map([["large",V],["small",V]]),action:this._onUpDownButton.bind(this,"up"),visible:this._upButtonVisibility,title:new S.a(A),className:d.up,dataset:{name:"pane-button-up"}},this._actions.down={iconMap:new Map([["large",k],["small",k]]),action:this._onUpDownButton.bind(this,"down"),visible:this._downButtonVisibility,title:new S.a(O),className:d.down,dataset:{name:"pane-button-down"}},this._actions.close={iconMap:new Map([["large",E],["small",E]]),action:this._onCloseButton.bind(this),visible:this._closeButtonVisibility,title:new S.a(W),dataset:{name:"pane-button-close"}},this._actions.maximize={iconMap:new Map([["large",L],["small",T]]),action:this._onToggleMaximizeButton.bind(this),visible:this._maximizeButtonVisibility,title:new S.a(P),hotKeyTitle:N,className:d.maximize,dataset:{name:"pane-button-maximize"}},this._actions.minimize={iconMap:new Map([["large",L],["small",T]]),action:this._onToggleMaximizeButton.bind(this),visible:this._minimizeButtonVisibility,title:new S.a(D),hotKeyTitle:N,className:d.minimize,dataset:{ name:"pane-button-minimize"}},this._actions.more={iconMap:new Map([["large",H],["small",x]]),action:this._showButtonsInContextMenu.bind(this),visible:new S.a(!B),title:new S.a(z),dataset:{name:"pane-button-more"}}},t.prototype._getCloseButtonVisibility=function(){var t=this._paneWidget.state(),e=!1;return t.containsMainSeries()||t.isMaximized()||B||(e=t.dataSources().some((function(t){return Object(o.isStudy)(t)}))),e},t.prototype._onCloseButton=function(){var t=this._model.model().panes().indexOf(this._paneWidget.state());this._model.removePane(t)},t.prototype._getUpButtonVisibility=function(){var t=this._paneWidget.state();return this._model.model().panes().indexOf(t)>0&&!t.isMaximized()&&!B},t.prototype._getDownButtonVisibility=function(){var t=this._paneWidget.state(),e=this._model.model().panes();return e.indexOf(t)1&&!t.isMaximized()&&!B},t.prototype._getMinimizeButtonVisibility=function(){var t=this._paneWidget.state();return this._model.model().panes().length>1&&t.isMaximized()},t.prototype._onToggleMaximizeButton=function(){this._callbacks.toggleMaximizePane(this._paneWidget)},t.prototype._showButtonsInContextMenu=function(t){var e=this;t.preventDefault(),null!==this._moreActionCM&&this._moreActionCM.isShown()?this._moreActionCM=null:w(this._actions,t).then((function(t){e._moreActionCM=t}))},t.prototype._getIsPaneMaximizeValue=function(){return this._paneWidget.state().isMaximized()},t.prototype._getIsWidgetShow=function(){return this._model.model().panes().length>1},t}()},nFx7:function(t,e){t.exports=''},obM5:function(t,e){t.exports=''}, qfuz:function(t,e){t.exports=''},rGGD:function(t,e){t.exports=''},rh3U:function(t,e,i){t.exports={"css-value-small-size":"18px","css-value-border-radius-small-size":"9px","css-value-large-size":"22px","css-value-border-radius-large-size":"11px",statuses:"statuses-29yrFaoA",statusItem:"statusItem-1gsKvHgg",small:"small-3_g6DSwX",large:"large-2E_Sb0cV",blinking:"blinking-2Xm4xMXd",oneWidgetsVisible:"oneWidgetsVisible-17p3P_dQ",twoWidgetsVisible:"twoWidgetsVisible-3kEfsgAz",threeWidgetsVisible:"threeWidgetsVisible-sIjrbNL1","blinking-animation":"blinking-animation-1jTWzbXG",marketStatusOpen:"marketStatusOpen-2d8WAYHQ",marketStatusClose:"marketStatusClose-2LgI3IBx",marketStatusPre:"marketStatusPre-3tiNWinG",marketStatusPost:"marketStatusPost-1wCjJrHi",marketStatusHoliday:"marketStatusHoliday-HyAcvqXa",invalidSymbol:"invalidSymbol-2tnvnmzm",replayMode:"replayMode-2O_B03jx",notAccurate:"notAccurate-2qEIEgim","blinking-color-animation-notaccurate":"blinking-color-animation-notaccurate-IBDzDS-b",delay:"delay-NXuSKUfA","blinking-color-animation-delay":"blinking-color-animation-delay-37meAg0d",eod:"eod-TNCDZArR","blinking-color-animation-eod":"blinking-color-animation-eod-1k5aef9K",dataProblemHigh:"dataProblemHigh-2SJE6Anp",dataProblemLow:"dataProblemLow-iRGvvWWe"}},sAH5:function(t,e,i){"use strict";i.r(e);var s=i("mrSG"),o=i("Eyy1"),n=i("hY0g"),l=i.n(n),a=i("ogJP"),r=i("eJTA"),u=i("Kxc7"),d=i("AvGy"),h=(i("LVLx"),i("bdgK")),c=i("EV8o"),p=i("S8xo"),_=i("GUQs"),b=i("fBig"),g=function(){function t(t,e){void 0===e&&(e={}),this._loadingEl=null,this._parentEl=t,this._options=e,this._renderLoading()}return t.prototype.toggleVisibility=function(t){null!==this._loadingEl&&this._loadingEl.classList.toggle(b.shown,t)},t.prototype._renderLoading=function(){this._loadingEl=document.createElement("span"),this._loadingEl.classList.add(b.loader),this._options.className&&this._loadingEl.classList.add(this._options.className),this._loadingEl.innerHTML='\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t',this._parentEl.appendChild(this._loadingEl)},t}(),m=i("5Alx"),v=i("0jws"),w=i("qFKp");function y(t,e){null===t.firstChild?t.textContent=e:t.firstChild.nodeValue=e}var f=w.CheckMobile.any(),S=[m.title1st,m.title2nd,m.title3rd,m.title4th];var M=function(){function t(t,e,i){this._el=null,this._firstBlockWrapper=null,this._titleParentEl=null,this._titleElements=[],this._valuesParentEl=null,this._valuesAdditionalWrapperEl=null,this._valuesElements=[],this._actionsParentEl=null,this._actionAdditionalWrapperEl=null,this._stayInHoveredMode=!1,this._mode=4,this._statusesWrapper=null, this._resizeObserver=null,this._hideInvisibleHover=null,this._hideValues=null,this._allButtonsWidth=null,this._lastStatusesWrapperWidth=null,this._lastActionsWrapperWidth=null,this._showActionsHandler=null,this._hideActionsHandler=null,this._selectedSourceHandler=null,this._mouseEventHandlers=[],this._disableTimeout=null,this._loader=null,this._model=t,this._parentEl=e,this._disabled=this._model.disabled().spawn(),this._disabled.subscribe(this._updateDisabledState.bind(this)),this._selected=this._model.selected().spawn(),this._selected.subscribe(this._updateSelectedState.bind(this)),this._loading=this._model.loading().spawn(),this._loading.subscribe(function(t,e){var i=0;return function(s){clearTimeout(i),Boolean(s)?t():i=setTimeout(t,e,!1)}}(this._updateLoadingState.bind(this),700)),this._isTitleHidden=this._model.isTitleHidden().spawn(),this._isValuesHidden=this._model.isValuesHidden().spawn(),this._isRowHidden=this._model.isRowHidden().spawn(),this._isTitleHidden.subscribe(this._updateShowTitles.bind(this)),this._isValuesHidden.subscribe(this._updateShowValues.bind(this)),this._isRowHidden.subscribe(this._updateShowLine.bind(this)),this._titlesSpawns=this._model.titles().map((function(t){return t.spawn()}));for(var s=0;s0?(i.appendChild(document.createTextNode(s)),i.classList.add(m.withDot)):i.classList.add(v.blockHidden),t.appendChild(i),this._titleElements.push(i)}},t.prototype._renderActions=function(){if(this._withActions){null===this._actionsParentEl&&(this._actionsParentEl=document.createElement("div"),this._actionsParentEl.classList.add(m.buttonsWrapper),this._parentEl.append(this._actionsParentEl),this._actionAdditionalWrapperEl=document.createElement("div"),this._actionAdditionalWrapperEl.classList.add(m.buttons),this._actionsParentEl.appendChild(this._actionAdditionalWrapperEl));for(var t=Object(o.ensureNotNull)(this._actionAdditionalWrapperEl),e=d.a?"large":"small",i=0,s=this._model.actions();i0}))},t.prototype._addStatusesWidget=function(t,e,i){this._statusesWrapper=document.createElement("div"),this._statusesWrapper.classList.add(m.statusesWrapper),this._statusesWrapper.appendChild(t),Object(o.ensureNotNull)(this._firstBlockWrapper).appendChild(this._statusesWrapper),this._hideInvisibleHover=e.spawn(),this._hideInvisibleHover.subscribe(this._updateInvisibleHoverMode.bind(this),{callWithLast:!0}),this._hideValues=i.spawn(),this._hideValues.subscribe(this._updateHideValuesMode.bind(this),{callWithLast:!0}),this._updateStatusWidgetVisibility(this._disabled.value()),this._resizeObserver=new h.default(this._handlerRestrictTitleWidth.bind(this)),null!==this._actionsParentEl&&this._resizeObserver.observe(this._actionsParentEl),this._resizeObserver.observe(this._statusesWrapper)},t.prototype._updateTitleMaxWidth=function(){if(null!==this._firstBlockWrapper){var t=this._allButtonsWidth||0,e=(this._lastActionsWrapperWidth||0)+(this._lastStatusesWrapperWidth||0);this._isWidthButtonsMode()?this._firstBlockWrapper.style.maxWidth="calc(100% - "+Math.max(t,e)+"px)":this._firstBlockWrapper.style.maxWidth=e>0?"calc(100% - "+e+"px)":""}},t.prototype._updateAllButtonsWidth=function(){this._allButtonsWidth=this._getButtonsCount()*z,this._updateTitleMaxWidth()},t.prototype._updateInvisibleHoverMode=function(t){null!==this._el&&this._el.classList.toggle(m.invisibleHover,!t)},t.prototype._updateHideValuesMode=function(t){null!==this._el&&this._el.classList.toggle(m.hideValues,t)},t.prototype._showActions=function(){if(null!==this._el&&this._withActions){this._el.classList.add(m.withAction);var t=null!==this._valuesParentEl&&null!==this._titleParentEl&&this._valuesParentEl.offsetTop===this._titleParentEl.offsetTop;this._el.classList.toggle(m.withTail,t),this._updateTitleMaxWidth()}},t.prototype._hideActions=function(){null!==this._el&&this._withActions&&!this._stayInHoveredMode&&(this._el.classList.remove(m.withAction),null!==this._valuesParentEl&&this._valuesParentEl.classList.remove(m.withTail),this._updateTitleMaxWidth())},t.prototype._handlerRestrictTitleWidth=function(t){if(null!==this._actionsParentEl&&null!==this._firstBlockWrapper){for(var e=null,i=null,s=0,o=t;s0||(t.title.value()||"").length>0}))},e.prototype._updateValuesTitleHTMLElHandler=function(t,e){void 0===e&&(e="");var i=Object(o.ensure)(this._valuesElements[t].title);y(i,e),i.classList.toggle(v.blockHidden,0===e.length),this._updateShowValues()}, e.prototype._isWidthButtonsMode=function(){return null!==this._el&&(void 0!==this._flagged&&Boolean(this._flagged.value())||t.prototype._isWidthButtonsMode.call(this))},e.prototype._updateFlaggedState=function(){void 0!==this._flagged&&(Object(o.ensureNotNull)(this._el).classList.toggle(m.flagged,Boolean(this._flagged.value())),this._updateTitleMaxWidth())},e}(M),E=w.isSafari?"click":"auxclick",V=function(t){function e(e,i,s){var o=t.call(this,e,i,s)||this;return o._wheelClickHandler=null,o._canUpdateRowVisibility=!0,o._globalRowVisibility=o._model.globalVisibility().spawn(),o._globalRowVisibility.subscribe(o._updateShowLine.bind(o),{callWithLast:!0}),o._has5Buttons=o._model.isPineScriptDataSource().spawn(),o._has5Buttons.subscribe(o._update5ButtonsStyles.bind(o)),o._updateStates(!o._disabled.value()),s.statusWidgetEl&&o._addStatusesWidget(s.statusWidgetEl,s.hideInvisibleHover,s.hideValues),o._selected.subscribe(o._updateTitleMaxWidth.bind(o)),s.withActions&&(o._wheelClickHandler=o._onWheelClicked.bind(o),null!==o._titleParentEl&&o._titleParentEl.addEventListener(E,o._wheelClickHandler)),o}return Object(s.__extends)(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this._has5Buttons.destroy(),this._globalRowVisibility&&this._globalRowVisibility.destroy(),null!==this._wheelClickHandler&&null!==this._titleParentEl&&this._titleParentEl.removeEventListener(E,this._wheelClickHandler)},e.prototype._updateShowLine=function(){if(null!==this._el&&this._canUpdateRowVisibility){var e=!this._globalRowVisibility.value();e?this._el.classList.toggle(v.blockHidden,e):t.prototype._updateShowLine.call(this)}},e.prototype._getButtonsCount=function(){switch(this._mode){case 4:return this._has5Buttons.value()?5:4;case 3:return 3;default:return 2}},e.prototype._render=function(){t.prototype._render.call(this);var e=Object(o.ensureNotNull)(this._el);e.classList.add(m.item,m.study),e.dataset.name="legend-source-item"},e.prototype._renderValues=function(){null===this._valuesParentEl&&(this._valuesParentEl=document.createElement("div"),this._valuesParentEl.classList.add(m.valuesWrapper),this._valuesAdditionalWrapperEl=document.createElement("div"),this._valuesAdditionalWrapperEl.classList.add(m.valuesAdditionalWrapper),this._valuesParentEl.appendChild(this._valuesAdditionalWrapperEl));for(var t=Object(o.ensureNotNull)(this._valuesAdditionalWrapperEl),e=0,i=this._values.value();e0){var e=Object(r.parseRgb)(t),i=e[0],s=e[1],o=e[2];this._el.style.backgroundColor=Object(r.rgbaToString)([i,s,o,Object(r.normalizeAlphaComponent)(.8)])}else this._el.style.removeProperty("background-color")}, t.prototype._updateSourceCount=function(t){y(Object(o.ensureNotNull)(this._counterEl),String(t));var e=Object(o.ensureNotNull)(this._el),i=t<1;e.classList.toggle(v.blockHidden,i);var s=1===t;e.classList.toggle(m.onlyOneSourceShown,s)},t.prototype._updateCounterVisibility=function(t){if(null!==this._counterEl){var e=1===t;this._counterEl.classList.toggle(v.blockHidden,e)}},t.prototype._updateState=function(){var t=!this._isStateOpen.value();this._parentEl.classList.toggle(m.closed,t),this._updateTooltip(),Ai((t?"Hide":"Show")+" not main sources")},t.prototype._tooltip=function(){return 1===this._mode?W:this._isStateOpen.value()?H:B},t.prototype._updateTooltip=function(){null!==this._el&&this._el.setAttribute("title",this._tooltip())},t.prototype._updateObjectTreeVisibility=function(t){Object(o.ensureNotNull)(this._el).classList.toggle(m.objectsTreeCanBeShown,t)},t}(),O=i("+6II"),P=i("R5JZ");function D(t,e){var i=new l.a(e(t.value()));t.subscribe((function(t){i.setValue(e(t))}));return i.readonly().spawn((function(){return t.unsubscribe()}))}var z=d.a?44:28,j=u.enabled("object_tree_legend_mode"),N=function(){function t(t,e){this._renderToggler=null,this._mainDataSourceRenderer=null,this._dataSourceRenderers=[],this._wrapText=null,this._parentEl=document.createElement("div"),this._mainDataSourceEl=null,this._dataSourcesEl=null,this._dataSourcesAdditionalWrapperEl=null,this._collapsedDataSourcesWrapperEl=null,this._collapsedDataSourcesEl=null,this._outsideEventForCollapsedTooltip=null,this._options=t,this._togglerOptions=e,this._isStudiesLegendHidden=t.isStudiesLegendHidden.spawn(),this._isStudiesLegendHidden.subscribe(this._updateLegendVisibility.bind(this)),this._isAllLegendHidden=t.isAllLegendHidden.spawn(),this._isAllLegendHidden.subscribe(this._updateLegendVisibility.bind(this)),this._updateLegendVisibility(),this._themedColor=t.themedColor.spawn(),this._themedColor.subscribe(this._setCustomBg.bind(this)),this._showBackground=t.showBackground.spawn(),this._showBackground.subscribe(this._setCustomBg.bind(this)),this._backgroundTransparency=t.backgroundTransparency.spawn(),this._backgroundTransparency.subscribe(this._setCustomBg.bind(this)),this._collapsedDataSourcesCountSpawn=t.collapsedDataSourcesCount.spawn(),this._collapsedDataSourcesCountSpawn.subscribe(this._updateCollapsedSourcesCount.bind(this)),this._showCollapsedDataSourcesTooltipHandler=this._showCollapsedDataSourcesTooltip.bind(this),d.a||(this._wrapText=t.wrapText.spawn(),this._wrapText.subscribe(this._updateWrapText.bind(this)),this._updateWrapText(this._wrapText.value())),this._parentEl.classList.add(m.legend),this._parentEl.classList.toggle(m.noActions,!this._options.withActions),this._parentEl.classList.toggle(m.touchMode,d.a),this._parentEl.classList.toggle(m.newCollapser,!0),this._parentEl.dataset.name="legend",this._parentEl.style.setProperty("--legend-source-item-button-width",z+"px"),this._parentEl.addEventListener("contextmenu",(function(e){e.preventDefault(),t.showLegendWidgetContextMenu(e)}))}return t.prototype.destroy=function(){ if(this._isStudiesLegendHidden.destroy(),this._isAllLegendHidden.destroy(),this._themedColor.destroy(),this._showBackground.destroy(),this._backgroundTransparency.destroy(),this._collapsedDataSourcesCountSpawn.destroy(),d.a&&null!==this._collapsedDataSourcesWrapperEl&&this._collapsedDataSourcesWrapperEl.removeEventListener("touchend",this._showCollapsedDataSourcesTooltipHandler),this._outsideEventForCollapsedTooltip&&this._outsideEventForCollapsedTooltip(),null!==this._wrapText&&this._wrapText.destroy(),null!==this._dataSourcesAdditionalWrapperEl&&(this._dataSourcesAdditionalWrapperEl.innerHTML="",this._dataSourcesAdditionalWrapperEl=null),null!==this._dataSourcesEl&&(this._dataSourcesEl.innerHTML="",this._dataSourcesEl=null),null!==this._renderToggler&&(this._renderToggler.destroy(),this._renderToggler=null),null!==this._mainDataSourceRenderer&&(this._mainDataSourceRenderer.destroy(),this._mainDataSourceRenderer=null),0!==this._dataSourceRenderers.length){for(var t=0,e=this._dataSourceRenderers;t0},t.prototype._getEyeTitle=function(){return this._disabled.value()?q:J},t.prototype._getDisabledState=function(){return!this._source.properties().visible.value()},t.prototype._updateRowVisibilities=function(){this._isRowHidden.setValue(this._getRowHiddenValue())},t.prototype._getRowHiddenValue=function(){return this._options.readOnlyMode&&this._disabled.value()||this._isTitleHidden.value()&&(this._isValuesHidden.value()||this._disabled.value())},t.prototype._calcNewPosition=function(t){var e={};if(function(t){return t.hasOwnProperty("touches")}(t)&&t.touches.length>0)e={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY};else if(null!==t.target){var i=t.target.getBoundingClientRect();e={clientX:Object(G.isRtl)()?i.right:i.left,clientY:i.top+i.height+3}}else{var s=t;e={clientX:s.clientX,clientY:s.clientY}}return e},t}(),Q=i("z4c1"),$=i("61S9"),tt=i("vWJB"),et=i("wZiV"),it=window.t("More"),st=window.t("Flag Symbol"),ot=window.t("Unflag Symbol"),nt=u.enabled("show_hide_button_in_legend"),lt=function(t){function e(e,i,s,o,n){var a=t.call(this,e,i,s,o,n)||this;a._titles=[new l.a(""),new l.a(""),new l.a(""),new l.a("")],a._symbolMarker=null,a._symbolMarkerIcon=null,a._flagged=new l.a(null),a._symbolAction=null,a._symbol=null,a._isOneButtonCanBeStick=!1,a._createActions(),a._updateSymbolMarker(),a._model.model().properties().paneProperties.legendProperties.showSeriesTitle.subscribe(a,(function(){a._isTitleHidden.setValue(a._getTitleHiddenValue())}));for(var r=0,u=[a._model.model().properties().paneProperties.legendProperties.showSeriesOHLC,a._model.model().properties().paneProperties.legendProperties.showBarChange];r0;if(0===e.length){var o={value:new l.a(""),color:new l.a(""),visible:new l.a(s),title:new l.a(i)},n=t.items().map((function(t){return{value:new l.a(t.value()),color:new l.a(Z(t.color())),visible:new l.a(t.visible()),title:new l.a(t.title())}}));this._values.setValue([o].concat(n))}else{e[0].title.setValue(i),e[0].visible.setValue(s);for(var a=t.items(),r=0;r0&&(n.push.apply(n,a),n.push(new Ct.Separator))}var r=t.model().properties().paneProperties.legendProperties;n.push(new Ct.Action({checkable:!0,checked:r.showSeriesTitle.value(),label:Lt,statName:"Show Symbol",onExecute:function(){return Tt(t,r.showSeriesTitle,"Change Symbol Description Visibility")}})),e.showOpenMarketStatus&&n.push(new Ct.Action({checkable:!0,checked:Vt.b.value(),label:Ht,statName:"Show Open market status",onExecute:function(){return Tt(t,Vt.b,"Change open market status visibility")}}));if(n.push(new Ct.Action({checkable:!0,checked:r.showSeriesOHLC.value(),label:Bt,statName:"Show OHLC Values",onExecute:function(){return Tt(t,r.showSeriesOHLC,"Change OHLC Values Visibility")}})),n.push(new Ct.Action({checkable:!0,checked:r.showBarChange.value(),label:Wt,statName:"Show Bar Change Values",onExecute:function(){return Tt(t,r.showBarChange,"Change Bar Change Visibility")}})),n.push(new Ct.Separator),void 0!==l){var u=l.get(0);void 0!==u&&u.length>0&&(n.push.apply(n,u),n.push(new Ct.Separator))}var d=s.get(1);if(void 0!==d){var h=d.get(1);void 0!==h&&h.length>0&&(n.push.apply(n,h),n.push(new Ct.Separator))}if(n.push(new Ct.Action({checkable:!0,checked:r.showStudyTitles.value(),label:At, statName:"Show Indicator Titles",onExecute:function(){return Tt(t,r.showStudyTitles,"Change Indicator Titles Visibility")}})),n.push(new Ct.Action({checkable:!0,checked:r.showStudyArguments.value(),label:Ot,statName:"Show Indicator Arguments",onExecute:function(){return Tt(t,r.showStudyArguments,"Change Indicator Arguments Visibility")}})),n.push(new Ct.Action({checkable:!0,checked:r.showStudyValues.value(),label:Pt,statName:"Show Indicator Values",onExecute:function(){return Tt(t,r.showStudyValues,"Change Indicator Values Visibility")}})),void 0!==d){var c=d.get(0);void 0!==c&&c.length>0&&(n.push.apply(n,c),n.push(new Ct.Separator))}0;e.settings&&(n.push(new Ct.Separator),n.push(new Ct.Action({label:window.t("Settings..."),icon:kt,statName:"Settings...",onExecute:function(){return i(U.TabNames.legend)}})));return Et.ContextMenuManager.createMenu(n,{},o)}(t,e,i,s,n).then((function(t){return t.show(o),t}))}var Lt=window.t("Show Symbol"),Ht=window.t("Show Open market status"),Bt=window.t("Show OHLC Values"),Wt=window.t("Show Bar Change Values"),At=window.t("Show Indicator Titles"),Ot=window.t("Show Indicator Arguments"),Pt=window.t("Show Indicator Values");window.t("Wrap text"),w.CheckMobile.any();var Dt=i("+DwS"),zt=i("HGP3"),jt=i("GOhO"),Nt=i("25b6"),It=i("rh3U"),Rt=function(){function t(t){this.isBlinkingMode=new l.a(!1),this._status=new l.a(null),this._fullTooltip=new l.a(null),this._iconClassNames=new l.a(null),this._visible=new l.a(!1),this._tooltip=new l.a(null),this._icon=new l.a(null),this._className=new l.a(null),this._infoMaps=t,this._size=t.size||"small",this._status.subscribe(this._updateByStatus.bind(this),{callWithLast:!0}),this._className.subscribe(this._updateIconClassName.bind(this))}return t.prototype.turnOffBlinkingMode=function(){},t.prototype.status=function(){return this._status},t.prototype.tooltip=function(){return this._tooltip},t.prototype.icon=function(){return this._icon},t.prototype.className=function(){return this._className},t.prototype.visible=function(){return this._visible},t.prototype.size=function(){return this._size},t.prototype.fullInfo=function(){return this._fullTooltip},t.prototype._getTooltip=function(t){var e,i;return null!==(i=null===(e=this._infoMaps.tooltipMap)||void 0===e?void 0:e.get(t))&&void 0!==i?i:null},t.prototype._getIcon=function(t){var e,i=this._infoMaps.iconMap.get(t);return void 0!==i&&(e=i.get(this._size)),e||null},t.prototype._getClassName=function(t){return this._infoMaps.classNameMap.get(t)||null},t.prototype._getTitle=function(t){var e,i;return null!==(i=null===(e=this._infoMaps.titleMap)||void 0===e?void 0:e.get(t))&&void 0!==i?i:null},t.prototype._getTitleColor=function(t){var e,i;return null!==(i=null===(e=this._infoMaps.titleColorMap)||void 0===e?void 0:e.get(t))&&void 0!==i?i:null},t.prototype._getHtml=function(t){var e,i,o;return Object(s.__awaiter)(this,void 0,void 0,(function(){return Object(s.__generator)(this,(function(s){ return[2,null!==(o=null===(i=null===(e=this._infoMaps.htmlMap)||void 0===e?void 0:e.get(t))||void 0===i?void 0:i.map(Nt.b))&&void 0!==o?o:null]}))}))},t.prototype._getAction=function(t){var e,i;return null!==(i=null===(e=this._infoMaps.actionMap)||void 0===e?void 0:e.get(t))&&void 0!==i?i:null},t.prototype._updateFullTooltipByStatus=function(t){return Object(s.__awaiter)(this,void 0,void 0,(function(){var e;return Object(s.__generator)(this,(function(i){switch(i.label){case 0:return[4,this._getHtml(t)];case 1:return e=i.sent(),this._status.value()!==t?[2]:(this._fullTooltip.setValue([{icon:this._icon.value(),iconClassName:this._iconClassNames.value(),title:this._getTitle(t),titleColor:this._getTitleColor(t),html:e,size:this._size,action:this._getAction(t)}]),[2])}}))}))},t.prototype._updateByStatus=function(t){if(null===t)return this._icon.setValue(null),this._tooltip.setValue(null),void this._visible.setValue(!1);this._icon.setValue(this._getIcon(t)),this._className.setValue(this._getClassName(t)),this._tooltip.setValue(this._getTooltip(t)),this._visible.setValue(!0),this._updateFullTooltipByStatus(t)},t.prototype._updateIconClassName=function(t){null!==t?this._iconClassNames.setValue([It.statusItem,t]):this._iconClassNames.setValue(null)},t}(),Ft=i("Vdly"),Gt=[];function Ut(){return Ft.getJSON("tv.alreadyBlinkedStatuses",Gt)}var Xt=new l.a(Ut());Ft.onSync.subscribe(null,(function(){return Xt.setValue(Ut())})) ;var Kt=Xt,Zt=i("Cf1E"),qt=i("VrrN"),Jt=i("VrXG"),Yt=i("LIcf"),Qt=i("Uua9"),$t=i("9Crk"),te=i("Tq3g"),ee=Object(dt.getLogger)("Chart.LegendWidget"),ie=new Map([["DelayToRealtime",new Map([["small",qt],["large",Jt]])],["DelayNoRealtime",new Map([["small",qt],["large",Jt]])],["TFEXDelayForGuest",new Map([["small",qt],["large",Jt]])],["MOEXDelayForGuest",new Map([["small",qt],["large",Jt]])],["EOD",new Map([["small",Yt],["large",Qt]])],["TickByTick",new Map([["small",$t],["large",te]])],["BATSToRealtime",new Map([["small",$t],["large",te]])]]),se=new Map([["DelayToRealtime",It.delay],["DelayNoRealtime",It.delay],["TFEXDelayForGuest",It.delay],["MOEXDelayForGuest",It.delay],["EOD",It.eod],["TickByTick",It.notAccurate],["BATSToRealtime",It.notAccurate]]),oe=new Map([["DelayToRealtime",zt.colorsPalette["color-delay-mode"]],["DelayNoRealtime",zt.colorsPalette["color-delay-mode"]],["TFEXDelayForGuest",zt.colorsPalette["color-delay-mode"]],["MOEXDelayForGuest",zt.colorsPalette["color-delay-mode"]],["EOD",zt.colorsPalette["color-eod-mode"]],["TickByTick",zt.colorsPalette["color-notaccurate-mode"]],["BATSToRealtime",zt.colorsPalette["color-notaccurate-mode"]]]),ne=window.t("Data is delayed"),le=window.t("End of day data"),ae=window.t("One update per second"),re=window.t("Cboe BZX"),ue=Object(Nt.b)(window.t("{symbolName} data is delayed by {time} minutes.")),de=Object(Nt.b)(window.t("{listedExchange} real-time data is available for free to registered users.")),he=Object(Nt.b)(window.t("To get real-time data for {description}, please buy the real-time data package.")),ce=Object(Nt.b)(window.t("Real-time data for {description} is not supported right now. We may support it in the future.")),pe=Object(Nt.b)(window.t("Data is updated once a day.")),_e=Object(Nt.b)(window.t("Data on our Basic plan is updated once per second, even if there are more updates on the market.")),be=Object(Nt.b)(window.t("Data is updated once per second, even if there are more updates on the market.")),ge=Object(Nt.b)(window.t("Paid plans feature faster data updates.")),me=Object(Nt.b)(window.t("Real-time data for {symbolName} is provided by {exchange} exchange.")),ve=Object(Nt.b)(window.t("This data is real-time, but it’s slightly different to its official counterpart coming from primary exchanges.")),we=(window.t("Create a free account"),window.t("Learn more"),function(t){function e(e,i,s){var o=t.call(this,{iconMap:ie,classNameMap:se,titleColorMap:oe,size:i})||this;return o._dataUpdatedMode=new l.a(null).spawn(),o._options=s,o._model=e,o._dataModeBlinkingStatuses=Kt.spawn(),o._dataModeBlinkingStatuses.subscribe(o._updateBlinkingMode.bind(o)),o.turnOffBlinkingMode=o._turnOffBlinking.bind(o),o.setModel(e),o}return Object(s.__extends)(e,t),e.prototype.destroy=function(){this._dataUpdatedMode.destroy(),this._dataModeBlinkingStatuses.destroy()},e.prototype.setModel=function(t){if(this._dataUpdatedMode.destroy(),null===t)return this._model=t,void(this._dataUpdatedMode=new l.a(null).spawn());this._dataUpdatedMode=t.status().spawn(), this._dataUpdatedMode.subscribe(this._updateStatus.bind(this),{callWithLast:!0})},e.prototype._getTooltip=function(){var t=this._getShortTexts();return null===t?null:Object.values(t).join(" · ")},e.prototype._updateFullTooltipByStatus=function(){return Object(s.__awaiter)(this,void 0,void 0,(function(){var t,e,i,o,n,l,a,r;return Object(s.__generator)(this,(function(s){switch(s.label){case 0:return null===(t=this._dataUpdatedMode.value())?(this._fullTooltip.setValue(null),[2]):(e=this._getShortTexts(),[4,this._getHtmls()]);case 1:return i=s.sent(),[4,this._getActions()];case 2:if(o=s.sent(),t!==this._dataUpdatedMode.value())return[2];for(n=[],l=0,a=t;l"+o+""})),null!==o&&"DelayNoRealtime"===u&&e[u].push(ce.format({description:""+o+""})),this._options.subscriptionFullInfo&&(u.includes("TFEXDelayForGuest")||u.includes("MOEXDelayForGuest"))&&e[u].push(de.format({listedExchange:this._model.listedExchange()}))),"EOD"===u&&(e[u]=[pe]),"TickByTick"===u&&(e[u].push(this._options.subscriptionFullInfo?_e:be),this._options.subscriptionFullInfo&&e[u].push(ge)),null!==n&&"BATSToRealtime"===u&&e[u].push(me.format({symbolName:i,exchange:n}),ve);return Object.keys(e).length>0?[2,e]:[2,null]}}))}))},e.prototype._getActions=function(){return Object(s.__awaiter)(this,void 0,void 0,(function(){var t,e,i,o,n;return Object(s.__generator)(this,(function(s){switch(s.label){case 0:return null===this._dataUpdatedMode.value()||null===this._model?[2,null]:(t={},[3,4]);case 1:return i0?[2,t]:[2,null]}}))}))},e.prototype._getShortTexts=function(){var t=this._dataUpdatedMode.value();if(null===t)return null;for(var e={},i=0,s=t;i0?e:null},e.prototype._updateBlinkingMode=function(){var t=this._dataUpdatedMode.value();if(null!==t){for(var e=this._dataModeBlinkingStatuses.value(),i=0,s=t;i1&&(o-=2);var n=this.element.getBoundingClientRect(),l={x:n.left-o,y:n.bottom+4};this._onClickCallback(l)},t.prototype._updateTooltip=function(){this.element.setAttribute("title",this._tooltips.value().join(" · "))},t.prototype._updateSpecialClassAndTooltip=function(){var t=this._visibleWidgetsCount.value();this.element.classList.toggle(It.oneWidgetsVisible,1===t),this.element.classList.toggle(It.twoWidgetsVisible,2===t),this.element.classList.toggle(It.threeWidgetsVisible,3===t),this._updateTooltip()},t.prototype._updateBlinkingMode=function(){var t=this._blinkingSpawns.some((function(t){return t.value()}));this.element.classList.toggle(It.blinking,t)},t }(),qe=i("9lPX"),Je=i("MyT/"),Ye=i("jXu8"),Qe=i("cbig"),$e=i("G2LI"),ti=i("QkND"),ei=i("Gp/h"),ii=i("S48P"),si=window.t("Market open"),oi=window.t("Pre-market"),ni=window.t("Post-market"),li=window.t("Market closed"),ai=window.t("Holiday"),ri=window.t("All's well — Market is open."),ui=window.t("Morning. Market is open for pre-market trading."),di=window.t("Evening. Market is open for post-market trading."),hi=window.t("Time for a walk — this market is closed."),ci=window.t("Market is currently on holiday. Lucky them."),pi=new Map([["market",new Map([["small",Je],["large",Ye]])],["pre_market",new Map([["small",ei],["large",ii]])],["post_market",new Map([["small",$e],["large",ti]])],["out_of_session",new Map([["small",qe],["large",qe]])],["holiday",new Map([["small",Qe],["large",Qe]])]]),_i=new Map([["market",It.marketStatusOpen],["pre_market",It.marketStatusPre],["post_market",It.marketStatusPost],["out_of_session",It.marketStatusClose],["holiday",It.marketStatusHoliday]]),bi=new Map([["market",si],["pre_market",oi],["post_market",ni],["out_of_session",li],["holiday",ai]]),gi=new Map([["market",si],["pre_market",oi],["post_market",ni],["out_of_session",li],["holiday",ai]]),mi=new Map([["market",zt.colorsPalette["color-market-open"]],["pre_market",zt.colorsPalette["color-pre-market"]],["post_market",zt.colorsPalette["color-post-market"]],["out_of_session",zt.colorsPalette["color-market-closed"]],["holiday",zt.colorsPalette["color-market-holiday"]]]),vi=new Map([["market",[ri]],["pre_market",[ui]],["post_market",[di]],["out_of_session",[hi]],["holiday",[ci]]]),wi=new Map([["market",null],["pre_market",null],["post_market",null],["out_of_session",null],["holiday",null]]),yi=window.t("You can turn this data on or off."),fi=function(t){function e(e,i,s){var o=t.call(this,{tooltipMap:bi,iconMap:pi,classNameMap:_i,titleMap:gi,titleColorMap:mi,htmlMap:vi,actionMap:wi,size:i})||this;return o._marketStatus=new l.a(null).spawn(),o._options=s,o.setModel(e),o}return Object(s.__extends)(e,t),e.prototype.destroy=function(){this._marketStatus.destroy()},e.prototype.setModel=function(t){this._marketStatus.destroy(),null!==t?(this._marketStatus=t.status().spawn(),this._marketStatus.subscribe(this._updateStatus.bind(this),{callWithLast:!0})):this._marketStatus=new l.a(null).spawn()},e.prototype._getHtml=function(e){return Object(s.__awaiter)(this,void 0,void 0,(function(){var i;return Object(s.__generator)(this,(function(s){switch(s.label){case 0:return[4,t.prototype._getHtml.call(this,e)];case 1:return null!==(i=s.sent())&&(this._options.preMarketSolution||this._options.postMarketSolution)&&("pre_market"===e&&this._options.preMarketSolution&&i.push(yi),"post_market"===e&&this._options.postMarketSolution&&i.push(yi)),[2,i]}}))}))},e.prototype._getAction=function(e){return t.prototype._getAction.call(this,e)},e.prototype._updateStatus=function(t){this._status.setValue(t)},e}(Rt),Si=i("JWMC");var Mi=function(){function t(t,e,i){this.visibleWidgetsCount=new l.a(0),this.errorWidgetIsShown=new l.a(!1),this._size=d.a?"large":"small", this._tooltips=new l.a([]),this._visibilitySpawns=[],this._tooltipSpawns=[],this._statusWidgetInfos=[],this._renderer=new Ze(this._size,this.visibleWidgetsCount,this._tooltips,{onClick:this._handleToggleDropdown.bind(this)}),this._symbolInvalidViewModel=null,this._dataSourceErrorStatusViewModel=null,this._marketStatusViewModel=null,this._dataUpdatedModeViewModel=null,this._dataProblemViewModel=null,this._isSymbolInvalid=null,this._dataSourceHasErrorVisible=null,this._studyErrorCanBeShown=new l.a(!1),this._marketStatusCanBeShown=new l.a(!1),this._dataUpdatedModeCanBeShown=new l.a(!1),this._dataProblemCanBeShown=new l.a(!1),this._isDataProblemCritical=null,this._container=document.createElement("div"),this._menuOpened=!1,this._menuPosition=null,this._source=t,this._model=e,this._options=i,this._recreateWidgets(),this._addSubscriptionForSymbolInvalid(),null!==this._dataSourceHasErrorVisible&&(this._dataSourceHasErrorVisible.subscribe(this._updateStatusWidgetsVisibilities.bind(this)),this._dataSourceHasErrorVisible.subscribe(this._updateErrorWidgetIsShown.bind(this))),this._options.dataProblemEnabled&&null!==this._isDataProblemCritical&&this._isDataProblemCritical.subscribe(this._updateStatusWidgetsVisibilities.bind(this));for(var s=0,o=this._tooltipSpawns;s0&&t.push(i)}this._tooltips.setValue(t)},t.prototype._recreateWidgets=function(){var t,e=this;if(this._options.sourceStatusesEnabled){if(Object(at.isStudy)(this._source)||Object(at.isStudyStub)(this._source)||this._source===this._model.mainSeries()){null===(t=this._isSymbolInvalid)||void 0===t||t.destroy();var i=this._source;if(this._isSymbolInvalid=Object(Dt.a)(i.isSymbolInvalid.bind(this._source),i.onStatusChanged()),null===this._symbolInvalidViewModel){this._symbolInvalidViewModel=new Oe(this._isSymbolInvalid,{tooltipMap:Re,iconMap:Ne,classNameMap:Ie,titleMap:Fe,titleColorMap:Ge,htmlMap:Ue,actionMap:Xe,size:this._size});var s=this._symbolInvalidViewModel.visible().spawn();this._visibilitySpawns.push(s),this._tooltipSpawns.push(this._symbolInvalidViewModel.tooltip().spawn());var n={visible:s,model:this._symbolInvalidViewModel};this._statusWidgetInfos.push(n),this._renderer.addStatusModel(n)}else this._symbolInvalidViewModel.updateStatus(this._isSymbolInvalid),this._addSubscriptionForSymbolInvalid()}if(Object(at.isStudy)(this._source)||Object(at.isStudyStub)(this._source))if(null===this._dataSourceErrorStatusViewModel){this._dataSourceErrorStatusViewModel=new Te(this._source,this._size,this._options.sourceStatuses),this._dataSourceHasErrorVisible=Object(X.a)((function(){return e._studyErrorCanBeShown.value()&&Object(o.ensureNotNull)(e._dataSourceErrorStatusViewModel).visible().value()}),this._studyErrorCanBeShown,this._dataSourceErrorStatusViewModel.visible()),this._visibilitySpawns.push(this._dataSourceHasErrorVisible),this._tooltipSpawns.push(this._dataSourceErrorStatusViewModel.tooltip().spawn());var l={visible:this._dataSourceHasErrorVisible,model:this._dataSourceErrorStatusViewModel};this._statusWidgetInfos.push(l),this._renderer.addStatusModel(l)}else this._dataSourceErrorStatusViewModel.setSource(this._source)}if(this._options.marketStatusEnabled){var a=this._source.marketStatusModel();if(null===this._marketStatusViewModel){this._marketStatusViewModel=new fi(a,this._size,this._options.marketStatus);s=Object(X.a)((function(){return e._marketStatusCanBeShown.value()&&Object(o.ensureNotNull)(e._marketStatusViewModel).visible().value()}),this._marketStatusCanBeShown,this._marketStatusViewModel.visible());this._visibilitySpawns.push(s),this._tooltipSpawns.push(this._marketStatusViewModel.tooltip().spawn());var r={visible:s,model:this._marketStatusViewModel};this._statusWidgetInfos.push(r), this._renderer.addStatusModel(r)}else this._marketStatusViewModel.setModel(a)}if(this._options.dataUpdateModeEnabled){var u=this._source.dataUpdatedModeModel();if(null===this._dataUpdatedModeViewModel){this._dataUpdatedModeViewModel=new we(u,this._size,this._options.dataUpdateMode);s=Object(X.a)((function(){return e._dataUpdatedModeCanBeShown.value()&&Object(o.ensureNotNull)(e._dataUpdatedModeViewModel).visible().value()}),this._dataUpdatedModeCanBeShown,this._dataUpdatedModeViewModel.visible());this._visibilitySpawns.push(s),this._tooltipSpawns.push(this._dataUpdatedModeViewModel.tooltip().spawn());var d={visible:s,model:this._dataUpdatedModeViewModel};this._statusWidgetInfos.push(d),this._renderer.addStatusModel(d)}else this._dataUpdatedModeViewModel.setModel(u)}if(this._options.dataProblemEnabled){var h=this._source.dataProblemModel();if(null===this._dataProblemViewModel){this._dataProblemViewModel=new Ae(h,this._size),this._isDataProblemCritical=this._dataProblemViewModel.isDataProblemCritical().spawn();s=Object(X.a)((function(){return e._dataProblemCanBeShown.value()&&Object(o.ensureNotNull)(e._dataProblemViewModel).visible().value()}),this._dataProblemCanBeShown,this._dataProblemViewModel.visible());this._visibilitySpawns.push(s),this._tooltipSpawns.push(this._dataProblemViewModel.tooltip().spawn());d={visible:s,model:this._dataProblemViewModel};this._statusWidgetInfos.push(d),this._renderer.addStatusModel(d)}else this._dataProblemViewModel.setModel(h)}},t.prototype._addSubscriptionForSymbolInvalid=function(){this._options.sourceStatusesEnabled&&null!==this._isSymbolInvalid&&(this._isSymbolInvalid.subscribe(this._updateStatusWidgetsVisibilities.bind(this)),this._isSymbolInvalid.subscribe(this._updateErrorWidgetIsShown.bind(this),{callWithLast:!0}))},t.prototype._updateErrorWidgetIsShown=function(){var t,e,i,s,o=null!==(e=null===(t=this._isSymbolInvalid)||void 0===t?void 0:t.value())&&void 0!==e&&e,n=null!==(s=null===(i=this._dataSourceHasErrorVisible)||void 0===i?void 0:i.value())&&void 0!==s&&s;this.errorWidgetIsShown.setValue(o||n)},t.prototype._handleToggleDropdown=function(t){var e;this._menuPosition=t,this._menuOpened=!this._menuOpened,this._menuOpened&&(this._source.properties().hasChild("symbol")&&this._source.properties().symbol.listeners().subscribe(this,this._handleDropdownMenuClose),e="Open full tooltip for statuses: "+this._tooltips.value().join(", "),Object(Si.trackEvent)("GUI","Statuses widget's action",e)),this._updateDropdownMenu()},t.prototype._handleDropdownMenuClose=function(){this._menuOpened=!1,this._source.properties().hasChild("symbol")&&this._source.properties().symbol.listeners().unsubscribeAll(this),this._updateDropdownMenu()},t.prototype._updateDropdownMenu=function(){var t=this;Promise.all([i.e("react"),i.e(4),i.e(24),i.e(92),i.e(0),i.e(2),i.e("full-tooltips-popup")]).then(i.bind(null,"vR7+")).then((function(e){e.render(t._menuOpened,t._container,t._renderer.element,t._statusWidgetInfos,t._handleDropdownMenuClose.bind(t),Object(o.ensureNotNull)(t._menuPosition))}))},t }(),Ci=i("AH3n"),Ei=window.t("Replay mode"),Vi=window.t("You're in Replay mode. You're in Replay mode. You're in Replay mode."),ki=(new Map([[!0,new Map([["small",Ci],["large",Ci]])],[!1,new Map([["small",""],["large",""]])]]),new Map([[!0,It.replayMode],[!1,null]]),new Map([[!0,Ei],[!1,null]]),new Map([[!0,Ei],[!1,null]]),new Map([[!0,zt.colorsPalette["color-replay-mode"]],[!1,null]]),new Map([[!0,[Vi]],[!1,null]]),new Map([[!0,null],[!1,null]]),function(t){function e(e,i,s){var o=t.call(this,e,i,s)||this;return o._isInReplay=new l.a(!1).readonly().spawn(),o._isInReplayCanBeShown=null,o._inited=!1,o}return Object(s.__extends)(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this)},e.prototype._updateStatusWidgetsVisibilities=function(){t.prototype._updateStatusWidgetsVisibilities.call(this)},e.prototype._isPrimaryWidgetShown=function(){var e,i;return t.prototype._isPrimaryWidgetShown.call(this)||null!==(i=null===(e=this._isInReplay)||void 0===e?void 0:e.value())&&void 0!==i&&i},e}(Mi)),Ti=i("PoSe"),xi=i.n(Ti),Li=i("EsvI");i.d(e,"trackLegendEvent",(function(){return Ai})),i.d(e,"LegendWidget",(function(){return Oi}));var Hi={readOnlyMode:!1,contextMenu:{settings:!0,mainSeries:!0,studies:!0,showOpenMarketStatus:!1},symbolMarkerEnabled:!1,showToggleButton:!0,canShowSourceCode:!1,statusesWidgets:{sourceStatusesEnabled:!1,sourceStatuses:{errorSolution:!0},marketStatusEnabled:!1,marketStatus:{preMarketSolution:!0,postMarketSolution:!0},dataUpdateModeEnabled:!1,dataUpdateMode:{subscriptionFullInfo:!0},dataProblemEnabled:!1}},Bi=(u.enabled("hide_legend_by_default"),u.enabled("fundamental_widget")),Wi=u.enabled("legend_context_menu");function Ai(t){Object(Si.trackEvent)("GUI","Legend action",t)}var Oi=function(){function t(t,e,i,o,n,r){var u=this;this._mainSeriesViewModel=null,this._dataSourceViewModels=[],this._visibleDataSourceCount=new l.a(0),this._themedColor=new l.a(""),this._mainSeriesRowHidden=null,this._dataSourceRowsHidden=[],this._customWidgetsVisibilities=[],this._allLegendHidden=new l.a(!1),this._studiesLegendHidden=new l.a(!1),this._onLegendVisibilityToggled=null,this._availableHeight=0,this._collapsedDataSourcesCount=new l.a(0),this._collapsedDataSourcesTitle=new l.a(""),this._mainSeriesStatusWidget=null,this._dataSourcesStatusesWidgets=[],this._size=null,this._customLegendWidgetsFactoriesMap=new Map,this._customLegendWidgetsMap=new Map,this._model=t,this._paneWidget=e,this._options=Object(a.merge)(Object(a.clone)(Hi),n),this._callbacks=r,this._mainSeriesViewModelsOptions={readOnlyMode:this._options.readOnlyMode,symbolMarkerEnabled:this._options.symbolMarkerEnabled},this._dataSourceViewModelsOptions=Object(s.__assign)(Object(s.__assign)({},this._mainSeriesViewModelsOptions),{canShowSourceCode:this._options.canShowSourceCode}),this._backgroundThemeName=i;var d=this._showLegendCalculatedProperty();this._isDataSourcesCollapsed=new l.a(d.value()),d.subscribe(this,(function(){u._isDataSourcesCollapsed.setValue(d.value())}));var h=new l.a(this._getCustomTextColorValue()) ;this._model.model().properties().scalesProperties.textColor.subscribe(this,(function(){h.setValue(u._getCustomTextColorValue())}));var c=this._model.model().properties().paneProperties.legendProperties.showBackground,p=new l.a(c.value());c.subscribe(this,(function(){p.setValue(c.value())}));var _=this._model.model().properties().paneProperties.legendProperties.backgroundTransparency,b=new l.a(_.value());_.subscribe(this,(function(){b.setValue(_.value())})),this._wrapText=new l.a(!1),this._hideNotMainSources=o.spawn(),this._hideNotMainSources.subscribe(this._updateVisibilityNotMainSources.bind(this)),this._isPaneMain=new l.a(this._getIsPaneMainValue()),this._updateCollapsedSourcesModeThrottle=xi()(this._updateCollapsedSourcesMode.bind(this),100),this._renderer=new N({withActions:!this._options.readOnlyMode,showToggleButton:this._options.showToggleButton,isStudiesLegendHidden:this._studiesLegendHidden.readonly(),isAllLegendHidden:this._allLegendHidden.readonly(),customTextColor:h.readonly(),themedColor:this._themedColor.readonly(),showBackground:p.readonly(),backgroundTransparency:b.readonly(),wrapText:this._wrapText.readonly(),collapsedDataSourcesCount:this._collapsedDataSourcesCount.readonly(),collapsedDataSourcesTitle:this._collapsedDataSourcesTitle.readonly(),showLegendWidgetContextMenu:this.onShowLegendWidgetContextMenu.bind(this)},{visibleDataSourceCount:this._visibleDataSourceCount.readonly(),isDataSourcesCollapsed:this._isDataSourcesCollapsed.readonly(),showObjectsTree:this._isPaneMain.readonly(),onCollapseDataSources:this.onCollapseDataSources.bind(this),onShowObjectsTreeDialog:this._callbacks.showObjectsTreeDialog})}return t.prototype.destroy=function(){this._hideNotMainSources.destroy(),null!==this._mainSeriesViewModel&&this._destroyMainDataSource();for(var t=0,e=this._dataSourceViewModels;t-1?(i.splice(n,1),Bi||null!==this._mainSeriesViewModel||(this._mainSeriesViewModel=new lt(this._model,s,this._mainSeriesViewModelsOptions,this._callbacks,this._options.contextMenu),this._mainSeriesStatusWidget=new ki(s,this._model.model(),this._options.statusesWidgets),this._renderer.addMainDataSource(this._mainSeriesViewModel,this._mainSeriesStatusWidget)),this._addCustomWidgetForLayerBlock(0)):null!==this._mainSeriesViewModel&&(this._destroyMainDataSource(),this._destroyCustomWidgetFromLayerBlock(0));var l=[],a=[],r=this._dataSourceViewModels.length;if(0===r)for(var u=i.length-1;u>=0;u--)l.push(new Mt(this._model,i[u],this._dataSourceViewModelsOptions,this._callbacks,this._options.contextMenu)),a.push(new Mi(i[u],this._model.model(),this._options.statusesWidgets));else{var d=0;for(u=i.length-1;u>=0;u--)this._dataSourceViewModels[d]?(this._dataSourceViewModels[d].updateSource(i[u]),this._dataSourcesStatusesWidgets[d].updateSource(i[u])):(l.push(new Mt(this._model,i[u],this._dataSourceViewModelsOptions,this._callbacks,this._options.contextMenu)),a.push(new Mi(i[u],this._model.model(),this._options.statusesWidgets))),d++;for(;this._dataSourceViewModels.length>d;)Object(o.ensureDefined)(this._dataSourceViewModels.pop()).destroy();for(;this._dataSourcesStatusesWidgets.length>d;)Object(o.ensureDefined)(this._dataSourcesStatusesWidgets.pop()).destroy()}0!==l.length&&(this._renderer.addDataSources(l,a),(t=this._dataSourceViewModels).push.apply(t,l),(e=this._dataSourcesStatusesWidgets).push.apply(e,a)),r!==this._dataSourceViewModels.length&&this._updateCollapsedSourcesMode(),this._dataSourceViewModels.length>0?this._addCustomWidgetForLayerBlock(1):this._destroyCustomWidgetFromLayerBlock(1),this._recreateVisibilitiesSubscriptions(),this._isPaneMain.setValue(this._getIsPaneMainValue()),this.update(),this._updateWidgetModeByWidth()},t.prototype.update=function(){null!==this._mainSeriesViewModel&&this._mainSeriesViewModel.update();for(var t=0,e=this._dataSourceViewModels;t0&&t>2){var e=this._renderer.getMainSourceHeight(),i=this._renderer.getDataSourceHeight();if(null!==e&&null!==i){var s=Math.floor((this._availableHeight-e)/i),o=Math.max(s,2)-1;if(t>o+1){for(var n="",l=0;l'},vYP1:function(t,e){t.exports=''},vg09:function(t,e){ t.exports=''},wZiV:function(t,e){t.exports=''},z4c1:function(t,e){ t.exports='' }}]);