(window.webpackJsonp=window.webpackJsonp||[]).push([["chart-bottom-toolbar"],{"+GaQ":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n("q1tI");function i(e){return e.map?a.Children.toArray(e.children).map(e.map):e.children}},"02pg":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n("q1tI"),i=n("TSYQ"),o=n("XiJV");function r(e){return a.createElement("div",{className:i(o.separator,e.className)})}},"20PO":function(e,t){e.exports=''},"2mG+":function(e,t,n){e.exports={button:"button-37qwTsBL"}},"5o6O":function(e,t,n){e.exports={tabs:"tabs-1LGqoVz6",tab:"tab-1Yr0rq0J",noBorder:"noBorder-oc3HwerO",disabled:"disabled-s8cEYElA",active:"active-37sipdzm",defaultCursor:"defaultCursor-Np9BHjTg",slider:"slider-1-X4lOmE",content:"content-2asssfGq"}},"9VJd":function(e,t){e.exports=''},ApAi:function(e,t){e.exports=''},"J+f8":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n("q1tI"),i=a.createContext(!1)},J3OW:function(e,t,n){e.exports={button:"button-1VVj8kLG",separator:"separator-2I6DZkMH"}},K3s3:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u}));var a=n("mrSG"),i=n("q1tI"),o=n("TSYQ"),r=n("Eyy1"),s=n("5o6O"),c=s;function l(e){var t,n=o(e.className,s.tab,((t={})[s.active]=e.isActive,t[s.disabled]=e.isDisabled,t[s.defaultCursor]=!!e.shouldUseDefaultCursor,t[s.noBorder]=!!e.noBorder,t));return i.createElement("div",{className:n,onClick:e.onClick,ref:e.reference},e.children)}function u(e){return function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.activeTab={current:null},e}return Object(a.__extends)(n,t),n.prototype.componentDidUpdate=function(){Object(r.ensureNotNull)(this._slider).style.transition="transform 350ms",this._componentDidUpdate()},n.prototype.componentDidMount=function(){this._componentDidUpdate()},n.prototype.render=function(){var t=this,n=this.props.className,a=this._generateTabs();return i.createElement("div",{className:o(n,s.tabs),"data-name":this.props["data-name"]},a,i.createElement(e,{reference:function(e){t._slider=e}}))},n.prototype._generateTabs=function(){var e=this;return this.activeTab.current=null, i.Children.map(this.props.children,(function(t){var n=t,a=Boolean(n.props.isActive),o={reference:function(t){a&&(e.activeTab.current=t),n.props.reference&&n.props.reference(t)}};return i.cloneElement(n,o)}))},n.prototype._componentDidUpdate=function(){var e=Object(r.ensureNotNull)(this._slider).style;if(this.activeTab.current){var t=this.activeTab.current.offsetWidth,n=this.activeTab.current.offsetLeft;e.transform="translateX("+n+"px)",e.width=t+"px",e.opacity="1"}else e.opacity="0"},n}(i.PureComponent)}u((function(e){return i.createElement("div",{className:s.slider,ref:e.reference})}))},MfqI:function(e,t,n){"use strict";n.r(t);var a=n("q1tI"),i=n.n(a),o=n("i8i4"),r=n("mrSG"),s=n("YFKU"),c=n("17x9"),l=n("TSYQ"),u=n("cvc5"),d=n("Kxc7"),h=n("82wv"),p=n("Iksw"),m=n("tWVy"),g=n("/KDZ"),b=n("N5tr"),f=n("KKsp"),v=n("Eyy1"),_=n("JWMC"),C=n("1TxM"),y=n("aIyQ"),S=n.n(y),E=n("dfhE"),x=function(){function e(e){var t=this;this._state={ranges:[]},this._change=new S.a,this._rangeChangedListenerBound=this._onRangeChanged.bind(this);var n=(this._context=e).chartWidget;n.withModel(null,(function(){var e=n.model(),a=e.mainSeries();a.onStatusChanged().subscribe(t,t._updateAvailableRanges),d.enabled("update_timeframes_set_on_symbol_resolve")&&a.dataEvents().symbolResolved().subscribe(t,t._updateAvailableRanges),a.priceScale().properties().childs().lockScale.subscribe(t,t._updateAvailableRanges),e.appliedTimeFrame().subscribe(t._rangeChangedListenerBound),t._updateAvailableRanges()}))}return e.prototype.state=function(){return this._state},e.prototype.onChange=function(){return this._change},e.prototype.selectRange=function(e){this._setState({activeRange:e.value.value});var t=this._context.chartWidgetCollection,n={val:e.value,res:e.targetResolution};t.setTimeFrame(n)},e.prototype.destroy=function(){var e=this,t=this._context.chartWidget;t.withModel(null,(function(){var n=t.model(),a=n.mainSeries();a.onStatusChanged().unsubscribe(e,e._updateAvailableRanges),d.enabled("update_timeframes_set_on_symbol_resolve")&&a.dataEvents().symbolResolved().unsubscribe(e,e._updateAvailableRanges),a.priceScale().properties().childs().lockScale.unsubscribe(e,e._updateAvailableRanges),n.appliedTimeFrame().unsubscribe(e._rangeChangedListenerBound)})),this._change.destroy()},e.prototype._setState=function(e){this._state=Object.assign({},this._state,e),this._change.fire(this._state)},e.prototype._onRangeChanged=function(e){var t;null!==e&&"period-back"===e.val.type&&(t=e.val.value),this._setState({activeRange:t})},e.prototype._updateAvailableRanges=function(){var e=this._context,t=e.availableTimeFrames,n=e.chartWidget;if(n.model()){var a=n.model().mainSeries(),i=a.status();if(i!==E.STATUS_LOADING&&i!==E.STATUS_RESOLVING){var o=t(a.symbolInfo(),a.status());0!==o.length&&this._setState({ranges:o})}}},e}(),w=Object(C.b)();function R(e){var t;return(t=function(t){function n(e,n){var a=t.call(this,e,n)||this;a._handleUpdate=function(e){a.setState(e)},a._handleSelectRange=function(e){Object(_.trackEvent)("GUI","Chart Bottom Toolbar","range "+e.value), a._binding.selectRange(e)},Object(C.c)(n,{availableTimeFrames:c.any.isRequired,chartWidgetCollection:c.any.isRequired,chartWidget:c.any.isRequired}),N.has(n.chartWidget)||N.set(n.chartWidget,new x(n));var i=a._binding=Object(v.ensureDefined)(N.get(n.chartWidget));return a.state=i.state(),a}return Object(r.__extends)(n,t),n.prototype.componentDidMount=function(){this._binding.onChange().subscribe(this,this._handleUpdate)},n.prototype.componentWillUnmount=function(){this._binding.onChange().unsubscribe(this,this._handleUpdate)},n.prototype.render=function(){return a.createElement(e,{goToDateButton:this.props.goToDateButton,className:this.props.className,ranges:this.state.ranges,activeRange:this.state.activeRange,onSelectRange:this._handleSelectRange})},n}(a.PureComponent)).contextType=w,t}var N=new WeakMap,k=n("cdbK"),W=n("l4ku"),M=n("02pg"),T=n("9VJd"),O=n("J3OW");function j(e){var t=e.ranges,n=e.activeRange,a=e.onSelectRange;return i.a.createElement(i.a.Fragment,null,t.map((function(e){return i.a.createElement(W.a,{key:e.value.value,label:e.description||e.text,active:n===e.value.value,checked:n===e.value.value,checkable:!0,disabled:!1,onClick:o.bind(null,e),doNotCloseOnClick:!1,subItems:[]})})));function o(e){e&&a&&a(e),Object(m.b)()}}function A(e){var t=e.onGoToDateClick;return i.a.createElement(i.a.Fragment,null,i.a.createElement(M.a,{className:O.separator}),i.a.createElement(W.a,{icon:T,label:Object(s.t)("Go to..."),onClick:t,active:!1,checked:!1,checkable:!1,disabled:!1,doNotCloseOnClick:!1,subItems:[]}))}var B={title:window.t("Date Range"),goToDate:window.t("Go to...")},D=Object(C.b)(),z=R(function(e){function t(t,n){var i=e.call(this,t,n)||this;return i._handleGoToDateClick=function(){var e=i.context.chartWidget;Object(k.showGoToDateDialog)(e.model()),Object(m.b)()},i._handleRangeSelect=function(e){e&&i.props.onSelectRange&&i.props.onSelectRange(e),Object(m.b)()},i._renderChildren=function(e){var t=i.props,n=t.ranges,o=t.activeRange,r=t.goToDateButton;return e?a.createElement(a.Fragment,null,a.createElement(j,{ranges:n,activeRange:o,onSelectRange:i._handleRangeSelect}),r&&a.createElement(A,{onGoToDateClick:i._handleGoToDateClick})):a.createElement(a.Fragment,null,n.map((function(e){return a.createElement(b.b,{key:e.value.value,label:e.description||e.text,isActive:o===e.value.value,onClick:i._handleRangeSelect,onClickArg:e})})),r&&a.createElement(f.a,null),r&&a.createElement(b.b,{label:B.goToDate,onClick:i._handleGoToDateClick}))},Object(C.c)(n,{chartWidget:c.any.isRequired}),i}return Object(r.__extends)(t,e),t.prototype.render=function(){var e=this;return a.createElement(g.a,{rule:"screen and (max-width: 419px)"},(function(t){return a.createElement(h.a,{className:O.button,content:B.title,arrow:!0,verticalAttachEdge:p.a.Top,verticalDropDirection:p.b.FromBottomToTop,horizontalMargin:4,"data-name":"date-ranges-menu",isDrawer:t},e._renderChildren(t))}))},t.contextType=D,t}(a.PureComponent)),I=n("K3s3"),L=n("W9Y+");function F(e){var t,n=l(e.className,L.item,((t={})[L.isActive]=e.isActive,t[L.isFirst]=e.isFirst, t[L.isLast]=e.isLast,t));return a.createElement("div",{className:n,onClick:e.onClick,ref:e.reference},e.children)}var P=n("nPPD"),q=n("RZ2Z"),G=Object(P.a)(I.a,q);var U=n("qSb5"),H=Object(I.c)((function(e){return a.createElement("div",{className:l(e.className,G.slider),ref:e.reference},a.createElement("div",{className:G.inner}))}));var V=R((function(e){var t=e.className,n=e.ranges,i=e.activeRange,o=e.onSelectRange;return a.createElement(H,{className:l(U.sliderRow,t),"data-name":"date-ranges-tabs"},n.map((function(e,t){return a.createElement(F,{key:e.value.value,isFirst:0===t,isLast:t===n.length-1,isActive:i===e.value.value,onClick:o&&o.bind(null,e)},a.createElement("div",{title:e.description||e.text,className:"apply-common-tooltip"},e.text))})))})),Z=n("Iivm"),X=n("/DW5"),Q=n("ul7r"),K=n("c7H2"),J=Object(X.b)({keys:["Alt","G"],text:"{0} + {1}"}),Y=Object(C.b)(),$=R(function(e){function t(t,n){var a=e.call(this,t,n)||this;return a._handleClick=function(){var e=a.context.chartWidget;Object(_.trackEvent)("GUI","Chart Bottom Toolbar","go to"),Object(k.showGoToDateDialog)(e.model())},Object(C.c)(n,{chartWidget:c.any.isRequired}),a}return Object(r.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className;return e.ranges.length>0&&a.createElement("div",{className:l("apply-common-tooltip",K.button,t),"data-name":"go-to-date","data-tooltip-hotkey":J,onClick:this._handleClick,title:Object(s.t)("Go to")},a.createElement(Z.Icon,{className:K.icon,icon:Q}))},t.contextType=Y,t}(a.PureComponent)),ee=n("URQ3");function te(e){var t=e.reference,n=e.className,i=e.children,o=Object(r.__rest)(e,["reference","className","children"]);return a.createElement("button",Object(r.__assign)({},o,{className:l(n,ee.button),ref:t}),a.createElement("span",{className:ee.inner},i))}var ne=n("/+9u"),ae=n("4kQX"),ie=n("7KDR"),oe=n("5VQP"),re=function(e){function t(t){var n=e.call(this,t)||this;return n._element=null,n._menu=null,n._handleRef=function(e){n._element=e},n._showMenu=function(){if(n._menu&&n._menu.isShown())return n._menu.hide(),void n._menu.destroy();var e=n.props,t=e.getActions,a=e.right,i=Object(v.ensureNotNull)(n._element),o=t();0!==o.length&&oe.ContextMenuManager.createMenu(o).then((function(e){n._menu=e,e.show((function(e,t){var n=i.getBoundingClientRect();return{clientX:a?n.right-e:n.left,clientY:n.top-Math.min(t,n.top),overrideHeight:n.top'},URQ3:function(e,t,n){e.exports={button:"button-88UE6omC",hover:"hover-3_vVP91F",inner:"inner-2FptJsfC"}},"W9Y+":function(e,t,n){e.exports={item:"item-3cgIlGYO",hover:"hover-2y46_KNk",isActive:"isActive-2M6dwA7-",isFirst:"isFirst-2kfAV5tf",isLast:"isLast-voJ1bqZh"}},XXQ5:function(e,t,n){e.exports={item:"item-3uG--HK9",emptyIcons:"emptyIcons-m0h_sZp0",loading:"loading-cNheEKQv",disabled:"disabled-3ilLPdQ4",interactive:"interactive-2W_Hkhdy",hovered:"hovered-D1oc5kww",icon:"icon-1Mb1FjSX",label:"label-3O4C0UM-",fullWidth:"fullWidth-1uGfIWwz",title:"title-22oXfKpQ",nested:"nested-1ZM4Mhrc",shortcut:"shortcut-3ZjqDeQg",remove:"remove-3gWfSy1e"}},XiJV:function(e,t,n){e.exports={separator:"separator-1TZB5HZ-"}},Xy1d:function(e,t){e.exports=''},Xzy5:function(e,t){e.exports=''},c7H2:function(e,t,n){e.exports={button:"button-2gir_Bbb",hover:"hover-SrAyrKlT",icon:"icon-MwaAItz1"}},l4ku:function(e,t,n){"use strict";n.d(t,"a",(function(){return m})) ;var a=n("q1tI"),i=n.n(a),o=n("TSYQ"),r=n("Iivm"),s=n("6KyJ"),c=n("J+f8"),l=n("w+Rv"),u=n("Xy1d"),d=n("Xzy5"),h=n("20PO"),p=n("XXQ5");function m(e){var t=e.isTitle,n=e.isLoading,m=e.isHovered,g=e.active,b=e.checkable,f=e.disabled,v=e.checked,_=e.icon,C=e.iconChecked,y=e.hint,S=e.subItems,E=e.label,x=e.onClick,w=e.children,R=e.toolbox,N=e.fullWidthLabel,k=Object(a.useContext)(c.a),W=!!S.length;return n?i.a.createElement("li",{className:o(p.item,p.loading)},i.a.createElement(s.Loader,{color:"gray"})):i.a.createElement("li",{className:o(p.item,p.interactive,t&&p.title,f&&p.disabled,m&&p.hovered,g&&p.active,k&&p.emptyIcons),onClick:x},i.a.createElement(r.Icon,{className:o(p.icon),icon:function(){if(b&&v)return C||_||u;return _}()}),i.a.createElement("span",{className:o(p.label,N&&p.fullWidth)},E),!!R&&i.a.createElement(r.Icon,{onClick:function(){R&&R.action()},className:p.remove,icon:h}),!W&&y&&i.a.createElement(l.a,{className:p.shortcut,text:y}),W&&i.a.createElement(r.Icon,{className:p.nested,icon:d}),w)}},qSb5:function(e,t,n){e.exports={sliderRow:"sliderRow-Tv1W7hM5"}},ul7r:function(e,t){e.exports=''},"w+Rv":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n("q1tI"),i=n("TSYQ"),o=n.n(i),r=n("ycgn");function s(e){var t=e.text,n=void 0===t?"":t,i=e.className;return a.createElement("span",{className:o()(r.shortcut,i)},n)}},ycgn:function(e,t,n){e.exports={item:"item-stVdeCwG",interactive:"interactive-3E0jwVyG",hovered:"hovered-2HCCgw6c",disabled:"disabled-2K7FyUI3",active:"active-muW4lycL",shortcut:"shortcut-2P38AivB",iconCell:"iconCell-OhwVvlgA",icon:"icon-3DDcYD-t",checkmark:"checkmark-2UE1siCn",content:"content-1GXgstZ5",label:"label-1If3beUH",checked:"checked-5eQn8630",toolbox:"toolbox-2XX2mSNw",showToolboxOnHover:"showToolboxOnHover-iCrUIcOG",arrowIcon:"arrowIcon-2FMesq_x",subMenu:"subMenu-QM4GIDtY"}},z6ID:function(e,t,n){e.exports={separator:"separator-3bp1jCsV"}}}]);