(window.webpackJsonp=window.webpackJsonp||[]).push([["restricted-toolset","series-icons-map"],{"0x0R":function(e,t){e.exports=''},"1Tx8":function(e,t,n){e.exports={button:"button-YsN2vRuA-",withText:"withText-JhQdRoPu-",withoutText:"withoutText-f6SoijeW-"}},"1uoO":function(e,t){e.exports=''},"23di":function(e,t,n){e.exports={label:"label-1LxfyrID-",icon:"icon-3bTRbX0U-",text:"text-2BJe_3ce-"}},"2xRE":function(e,t){e.exports=''},"4hTN":function(e,t,n){e.exports={value:"value-DWZXOdoK-",selected:"selected-2V87KUXm-"}},"9NBK":function(e,t,n){e.exports={item:"item-b8AKccvl-",round:"round-2UQxqNA1-"}},CX26:function(e,t,n){e.exports={form:"form-2itceCqS-",interacting:"interacting-3joY26dg-",input:"input-z46tLQgj-",menu:"menu-35lWsSKr-",add:"add-1NrfSAvb-",hovered:"hovered-1nwOcWv8-",hover:"hover-2JY1kj4n-",wrap:"wrap-1oB2WI2R-"}},EsZh:function(e,t,n){"use strict";var i,o,a,s,r,l,c,h,d,u,v;n.r(t),n.d(t,"SERIES_ICONS",function(){return v}),i=n("G2sT"),o=n("Jtxf"),a=n("pqsj"),s=n("1uoO"),r=n("FO3N"),l=n("t2Sj"),c=n("fD7T"),h=n("VgwI"),(u={})[(d=n("dfhE")).STYLE_AREA]=i,u[d.STYLE_BARS]=o,u[d.STYLE_CANDLES]=a,u[d.STYLE_HEIKEN_ASHI]=s,u[d.STYLE_HOLLOW_CANDLES]=r,u[d.STYLE_LINE]=l,u[d.STYLE_BASELINE]=c,u[d.STYLE_HILO]=h,v=u},EvtC:function(e,t,n){e.exports={button:"button-2-lC3gh4-"}},FO3N:function(e,t){e.exports=''},G2sT:function(e,t){
e.exports=''},GWvR:function(e,t){e.exports=''},GgvM:function(e,t){e.exports=''},HBiQ:function(e,t,n){e.exports={button:"button-1IIz2ju4-",first:"first-bfrNico9-",last:"last-3h-LFsOr-"}},HHbT:function(e,t){e.exports=''},Jtxf:function(e,t){
e.exports=''},RGo6:function(e,t,n){e.exports={opened:"opened-GQFVkrpV-",hover:"hover-1s0KqpdE-",autoSaveWrapper:"autoSaveWrapper-1MJY41zr-",sharingWrapper:"sharingWrapper-2a3BKnuf-",button:"button-X9fdkr3t-",buttonSmallPadding:"buttonSmallPadding-3OtdkF4f-"}},RYBj:function(e,t){e.exports=''},"S+Ii":function(e,t,n){e.exports={buttonUndo:"buttonUndo-342XpPC1-",buttonRedo:"buttonRedo-3o_XdU_J-"}},SchQ:function(e,t,n){e.exports={button:"button-1EU5-JL7-",isDisabled:"isDisabled-1RjJSnJ7-",text:"text-1HWeUAzA-"}},UJ4t:function(e,t,n){e.exports={wrap:"wrap-18oKCBRc-"}},VgwI:function(e,t){e.exports=''},X7WP:function(e,t,n){e.exports={wrap:"wrap-CUt4Mg1V-",inner:"inner-32OP7ejC-",actions:"actions-1cGPn1dW-",input:"input-3lfOzLDc-",isExpanded:"isExpanded-1pdStI5Z-"}},XWsk:function(e,t){e.exports=''},YEs3:function(e,t,n){e.exports={button:"button-1F3Go35E-",menu:"menu-16FRUKka-"}},aVq2:function(e,t,n){e.exports={button:"button-1XkSWU32-",first:"first-2UbSFGzF-",last:"last-1rdUnwE6-",menu:"menu-1fA401bY-",dropdown:"dropdown-1zOBoqnG-",menuContent:"menuContent-1vyIDg3J-"}},cjOe:function(e,t){e.exports=''},fD7T:function(e,t){e.exports=''},fEjm:function(e,t,n){e.exports={star:"star-uhAI7sV4-",checked:"checked-2bhy04CF-"
}},kXJy:function(e,t,n){e.exports={button:"button-1scLo53s-",hidden:"hidden-2GRQzIQ1-"}},"koZ+":function(e,t){e.exports=''},lAXe:function(e,t){e.exports=''},miV2:function(e,t,n){"use strict";function i(e){var t=e.text,n=e.className,i=e.displayMode,o=e.collapseWhen,a=void 0===o?H:o,s=h.__rest(e,["text","className","displayMode","collapseWhen"]),r=!a.includes(i);return d.createElement(w.a,h.__assign({},s,{text:r?t:void 0,className:C(n,L.button,r?L.withText:L.withoutText)}))}function o(e){var t=e.className,n=h.__rest(e,["className"]);return d.createElement(w.a,h.__assign({},n,{className:C(t,F.button)}))}function a(e){var t;return d.createElement("div",{className:C(q.value,(t={},t[q.selected]=e.isSelected,t))},e.value,e.metric)}function s(e,t){return void 0===t&&(t=!1),{name:ce[e],items:[],mayOmitSeparator:t}}function r(e){return d.createElement(g.a,{label:d.createElement("div",{className:et.label},d.createElement(f.a,{className:et.icon,icon:tt}),d.createElement("div",{className:et.text},nt.text)),onClick:e.onClick})}function l(){return{Bars:c.enabled("header_chart_type")?I:void 0,Compare:c.enabled("header_compare")?N:void 0,Custom:wt,Fullscreen:c.enabled("header_fullscreen_button")?P:void 0,Indicators:c.enabled("header_indicators")?K:void 0,Intervals:c.enabled("header_resolutions")?ve:void 0,OpenPopup:ge,Properties:c.enabled("header_settings")&&c.enabled("show_chart_property_page")?ye:void 0,SaveLoad:c.enabled("header_saveload")?Ve:void 0,Screenshot:c.enabled("header_screenshot")?Qe:void 0,SymbolSearch:c.enabled("header_symbol_search")?$e:void 0,Templates:c.enabled("study_templates")?ct:void 0,UndoRedo:c.enabled("header_undo_redo")?Ct:void 0,Layout:void 0}}var c,h,d,u,v,p,m,f,g,_,C,S,y,w,b,k,x,E,M,A,z,T,I,L,H,R,O,N,F,W,D,P,j,B,U,V,K,Y,G,q,Q,X,J,Z,$,ee,te,ne,ie,oe,ae,se,re,le,ce,he,de,ue,ve,pe,me,fe,ge,_e,Ce,Se,ye,we,be,ke,xe,Ee,Me,Ae,ze,Te,Ie,Le,He,Re,Oe,Ne,Fe,We,De,Pe,je,Be,Ue,Ve,Ke,Ye,Ge,qe,Qe,Xe,Je,Ze,$e,et,tt,nt,it,ot,at,st,rt,lt,ct,ht,dt,ut,vt,pt,mt,ft,gt,_t,Ct,St,yt,wt,bt,kt;n.r(t),c=n("Kxc7"),h=n("mrSG"),d=n("q1tI"),u=n("17x9"),v=n("dfhE"),p=n("EsZh"),m=n("pr86"),f=n("jjrI"),g=n("N5tr"),_=n("82wv"),C=n("TSYQ"),
S=n("UJ4t"),y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.children,n=e.className,i=h.__rest(e,["children","className"]);return d.createElement("div",h.__assign({className:C(n,S.wrap)},i),t)},t}(d.PureComponent),w=n("tU7i"),b=n("QpNh"),k=n("HBiQ"),x=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._handleClick=function(){var e=t.props,n=e.onClick,i=e.onClickArg;n&&n(i)},t}return h.__extends(t,e),t.prototype.render=function(){var e,t=this.props,n=t.isFirst,i=t.isLast,o=t.hint,a=t.text,s=t.icon,r=t.isActive,l=t.isDisabled,c=t.className,u=Object(b.a)(this.props);return d.createElement(w.a,h.__assign({},u,{icon:s,text:a,title:o,isDisabled:l,isActive:r,isGrouped:!0,onClick:this._handleClick,className:C(c,k.button,(e={},e[k.first]=n,e[k.last]=i,e))}))},t}(d.PureComponent),E=n("KKsp"),M=n("YEs3"),(A={})[v.STYLE_BARS]=window.t("Bars"),A[v.STYLE_CANDLES]=window.t("Candles"),A[v.STYLE_HOLLOW_CANDLES]=window.t("Hollow Candles"),A[v.STYLE_HEIKEN_ASHI]=window.t("Heikin Ashi"),A[v.STYLE_LINE]=window.t("Line"),A[v.STYLE_AREA]=window.t("Area"),A[v.STYLE_BASELINE]=window.t("Baseline"),A[v.STYLE_HILO]=window.t("High-Low"),z=A,T={barsStyle:window.t("Bar's Style"),labels:z},I=function(e){function t(t,n){var i,o,a,s,r,l=e.call(this,t,n)||this;return l._handleChangeStyle=function(e){var t=l.state,n=t.favorites,i=t.lastSelectedNotFavorite,o=t.activeStyle;l.setState({activeStyle:e,lastSelectedNotFavorite:n.includes(o)?i:o})},l._handleSelectStyle=function(e){var t=l.context.chartWidgetCollection;e!==t.activeChartStyle.value()&&t.trySetChartStyleToActiveWidget(e)},l._handleClickFavorite=function(e){l._isStyleFavorited(e)?l._handleRemoveFavorite(e):l._handleAddFavorite(e)},i=n.chartWidgetCollection,o=n.favoriteChartStylesService,a=i.activeChartStyle.value(),s=o.get(),c.enabled("japanese_chart_styles"),r=[],l.state={activeStyle:a,favorites:s,styles:[v.STYLE_BARS,v.STYLE_CANDLES,v.STYLE_HOLLOW_CANDLES,v.STYLE_HEIKEN_ASHI,v.STYLE_LINE,v.STYLE_AREA,v.STYLE_BASELINE],japaneseStyles:r},c.enabled("chart_style_hilo")&&l.state.styles.push(v.STYLE_HILO),l}return h.__extends(t,e),t.prototype.componentDidMount=function(){var e=this.context,t=e.chartWidgetCollection,n=e.favoriteChartStylesService;t.activeChartStyle.subscribe(this._handleChangeStyle),n.getOnChange().subscribe(this,this._handleChangeSettings)},t.prototype.componentWillUnmount=function(){var e=this.context,t=e.chartWidgetCollection,n=e.favoriteChartStylesService;t.activeChartStyle.unsubscribe(this._handleChangeStyle),n.getOnChange().unsubscribe(this,this._handleChangeSettings)},t.prototype.render=function(){var e,t,n,i=this,o=this.props,a=o.isShownQuicks,s=o.displayMode,r=void 0===s?"full":s,l=o.id,c=this.state,h=c.activeStyle,u=c.favorites,m=c.styles,g=c.japaneseStyles,C=c.lastSelectedNotFavorite,S="small"!==r&&a&&0!==u.length,w=u.slice();return w.includes(h)?void 0!==C&&w.push(C):w.push(h),e=S&&w.length>1,t=m.map(function(e){
return i._renderPopupMenuItem(e,e===h)}),n=g.map(function(e){return i._renderPopupMenuItem(e,e===h)}),d.createElement(y,{id:l},e&&w.map(function(e,t){return d.createElement(x,{className:M.button,icon:p.SERIES_ICONS[e],isActive:S&&h===e,key:t,hint:T.labels[e],isFirst:0===t,isLast:t===w.length-1,onClick:S?i._handleSelectStyle:void 0,onClickArg:e,"data-value":v.STYLE_SHORT_NAMES[e]})}),d.createElement(_.a,{arrow:Boolean(e),content:e?void 0:d.createElement(y,null,d.createElement(f.a,{icon:p.SERIES_ICONS[h]})),title:e?T.barsStyle:T.labels[h],className:M.menu},t,!!n.length&&d.createElement(E.a,null),n))},t.prototype._renderPopupMenuItem=function(e,t){var n=this.props.isFavoritingAllowed,i=this._isStyleFavorited(e);return d.createElement(g.a,{key:e,icon:p.SERIES_ICONS[e],isActive:t,label:T.labels[e]||"",onClick:this._handleSelectStyle,onClickArg:e,showToolboxOnHover:!i,toolbox:n&&d.createElement(m.a,{isFilled:i,onClick:this._handleClickFavorite,onClickArg:e}),"data-value":v.STYLE_SHORT_NAMES[e]})},t.prototype._handleChangeSettings=function(e){this.setState({lastSelectedNotFavorite:void 0,favorites:e})},t.prototype._isStyleFavorited=function(e){return-1!==this.state.favorites.indexOf(e)},t.prototype._handleAddFavorite=function(e){var t=this.state.favorites,n=this.context.favoriteChartStylesService;n.set(t.concat([e]))},t.prototype._handleRemoveFavorite=function(e){var t=this.state.favorites,n=this.context.favoriteChartStylesService;n.set(t.filter(function(t){return t!==e}))},t.contextTypes={chartWidgetCollection:u.any.isRequired,favoriteChartStylesService:u.any.isRequired},t}(d.PureComponent),n("YFKU"),L=n("1Tx8"),H=["medium","small"],R=n("RYBj"),O={compare:window.t("Compare"),compareOrAddSymbol:window.t("Compare or Add Symbol")},N=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i._handleClick=function(){i.setState({isActive:!0}),i.context.chartWidgetCollection.showAddCompareDialog().then(function(e){e.on("afterOpen",function(){return i.setState({isActive:!0})}),e.on("beforeClose",function(){return i.setState({isActive:!1})})})},i.state={isActive:!1},i}return h.__extends(t,e),t.prototype.render=function(){var e=this.state.isActive;return d.createElement(i,h.__assign({},this.props,{icon:R,isOpened:e,onClick:this._handleClick,text:O.compare,title:O.compareOrAddSymbol}))},t.contextTypes={chartWidgetCollection:u.any.isRequired},t}(d.PureComponent),F=n("EvtC"),W=n("GgvM"),D={hint:window.t("Fullscreen mode")},P=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._handleClick=function(){t.context.chartWidgetCollection.startFullscreen()},t}return h.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.id;return d.createElement(o,{id:n,icon:W,onClick:this._handleClick,title:D.hint,className:C(t)})},t.contextTypes={chartWidgetCollection:u.any.isRequired},t}(d.PureComponent),j=n("XWsk"),B=n("ei7k"),U={text:window.t("Indicators"),hint:c.enabled("study_dialog_fundamentals_economy_addons")?window.t("Indicators & Strategies"):window.t("Indicators")},V=Object(B.b)({
keys:["/"],text:"{0}"}),K=function(e){function t(t){var n=e.call(this,t)||this;return n._handleClick=function(){var e=n.props.studyMarket;n.setState({isActive:!0},function(){e.isVisible()?e.hide():e.show()})},n.state={isActive:!1},n}return h.__extends(t,e),t.prototype.componentDidMount=function(){this.props.studyMarket.visibilityChanged.subscribe(this,this._setActiveState)},t.prototype.componentWillUnmount=function(){this.props.studyMarket.visibilityChanged.unsubscribe(this,this._setActiveState)},t.prototype.render=function(){var e=this.state.isActive,t=this.props,n=t.className,o=t.displayMode,a=t.id;return d.createElement(i,{id:a,displayMode:o,className:n,icon:j,isOpened:e,onClick:this._handleClick,text:U.text,title:U.hint,"data-tooltip-hotkey":V})},t.prototype._setActiveState=function(e){this.setState({isActive:e})},t}(d.PureComponent),Y=n("PT1i"),G=n("pPtI"),q=n("4hTN"),Q=n("Eyy1"),X=n("9dlw"),J=n("ML8+"),Z=n("CX26"),$={add:window.t("Add")},ee=[{name:"1",label:window.t("minutes",{context:"interval"})},{name:"H",label:window.t("hours",{context:"interval"})},{name:"D",label:window.t("days",{context:"interval"})},{name:"W",label:window.t("weeks",{context:"interval"})},{name:"M",label:window.t("months",{context:"interval"})}],te=function(e){function t(t){var n=e.call(this,t)||this;return n._timeMenu=null,n._setMenuRef=function(e){n._timeMenu=e},n._handleChangeInput=function(e){var t=e.currentTarget.value;/^[0-9]*$/.test(t)&&n.setState({inputValue:t})},n._handleSelectTime=function(e){n.setState({selectedTime:e}),n._closeMenu()},n._handleClickAdd=function(){var e,t,i=n.state,o=i.inputValue,a=i.selectedTime,s=parseInt(o);s===(e=s,t=a,Math.max(1,Math.min(e,Object(G.getMaxResolutionValue)(t))))&&n.props.onAdd(isNaN(parseInt(a))?String(s)+a:String(s*Number(a)))},n._toggleMenu=function(){n.state.isOpenedMenu?n._closeMenu():n._openMenu()},n._closeMenu=function(){n.props.onCloseMenu(),n.setState({isOpenedMenu:!1})},n._openMenu=function(){n.props.onOpenMenu(),n.setState({isOpenedMenu:!0})},n._getMenuPosition=function(){var e=Object(Q.ensureNotNull)(n._timeMenu),t=e.getBoundingClientRect();return{overrideWidth:t.width,x:t.left,y:t.bottom+1}},n.state={inputValue:"1",isOpenedMenu:!1,selectedTime:ee[0].name},n}return h.__extends(t,e),t.prototype.render=function(){var e,t=this,n=this.state,i=n.inputValue,o=n.isOpenedMenu,a=n.menuWidth,s=n.selectedTime;return d.createElement("div",{className:C(Z.form,(e={},e[Z.interacting]=o,e))},d.createElement("input",{className:Z.input,maxLength:4,onChange:this._handleChangeInput,value:i}),d.createElement("div",{className:Z.menu,onClick:this._toggleMenu,ref:this._setMenuRef},ee.find(function(e){return e.name===s}).label,d.createElement(J.a,{dropped:o})),d.createElement("div",{className:Z.add,onClick:this._handleClickAdd},$.add),d.createElement(X.a,{doNotCloseOn:this,isOpened:o,minWidth:a,onClose:this._closeMenu,position:this._getMenuPosition},ee.map(function(e){return d.createElement(g.a,{dontClosePopup:!0,key:e.name,label:e.label,onClick:t._handleSelectTime,onClickArg:e.name})})))},t
}(d.PureComponent),n("bf9a"),ne=n("kXJy"),ie=n("0x0R"),oe={remove:window.t("Remove")},ae=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._handleClick=function(e){var n=t.props,i=n.onClick,o=n.onClickArg;i&&i(o,e)},t}return h.__extends(t,e),t.prototype.render=function(){return d.createElement("span",{className:C(ne.button,"apply-common-tooltip",this.props.hidden&&ne.hidden),dangerouslySetInnerHTML:{__html:ie},onClick:this._handleClick,title:oe.remove})},t}(d.PureComponent),se=function(e){function t(t){var n=e.call(this,t)||this;return n._handleMouseEnter=function(){n.setState({isHovered:!0})},n._handleMouseLeave=function(){n.setState({isHovered:!1})},n.state={isHovered:!1},n}return h.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.interval,n=e.hint,i=e.isActive,o=e.isDisabled,a=e.isFavorite,s=e.isSignaling,r=e.onClick,l=Object(b.a)(this.props);return d.createElement("div",{onMouseEnter:this._handleMouseEnter,onMouseLeave:this._handleMouseLeave},d.createElement(g.a,h.__assign({},l,{isActive:i,isDisabled:o,isHovered:s,onClick:r,onClickArg:t,toolbox:this._toolbox(),showToolboxOnHover:!a,label:n})))},t.prototype._toolbox=function(){var e=this.props,t=e.interval,n=e.isDisabled,i=e.isFavorite,o=e.isRemovable,a=e.isFavoritingAllowed,s=e.onClickFavorite,r=e.onClickRemove,l=this.state.isHovered,c=d.createElement(ae,{key:"remove",hidden:!Modernizr.mobiletouch&&!l,onClick:r,onClickArg:t}),h=d.createElement(m.a,{key:"favorite",isFilled:i,onClick:s,onClickArg:t});return[o&&c,!n&&a&&h]},t}(d.PureComponent),(le={})[(re=n("LxhU")).ResolutionKind.Seconds]=window.t("Second",{context:"interval_group_name"}),le[re.ResolutionKind.Minutes]=window.t("Minute",{context:"interval_group_name"}),le[re.ResolutionKind.Hours]=window.t("Hour",{context:"interval_group_name"}),le[re.ResolutionKind.Days]=window.t("Day",{context:"interval_group_name"}),le[re.ResolutionKind.Weeks]=window.t("Week",{context:"interval_group_name"}),le[re.ResolutionKind.Months]=window.t("Month",{context:"interval_group_name"}),le[re.ResolutionKind.Range]=window.t("Range",{context:"interval_group_name"}),le[re.ResolutionKind.Invalid]="",ce=le,he=n("aVq2"),de={openDialog:window.t("Open Interval Dialog"),timeInterval:window.t("Time Interval")},ue=Object(B.b)({keys:[","],text:window.t("Number or {0}")}),ve=function(e){function t(t,n){var i,o,a,s,r,l,h,u=e.call(this,t,n)||this;return u._renderResolutionsGroup=function(e){var t=e.items.map(function(e){return u._renderPopupMenuItem(e)});return(!e.mayOmitSeparator||e.items.length>1)&&(t.unshift(d.createElement(E.a,{key:"begin-"+e.name})),t.push(d.createElement(E.a,{key:"end-"+e.name}))),t},u._handleChangeInterval=function(e){var t=u.state,n=t.activeInterval,i=t.lastNotQuicked,o=u._getQuicks();u.setState({activeInterval:Object(G.normalizeIntervalString)(e),lastNotQuicked:void 0===n||o.includes(n)?i:n})},u._handleCloseMenu=function(){u.setState({isOpenedFormMenu:!1})},u._handleOpenMenu=function(){u.setState({isOpenedFormMenu:!0})},u._bindedForceUpdate=function(){u.forceUpdate()},
u._handleSelectInterval=function(e){void 0!==e&&e!==Y.linking.interval.value()&&(Object(G.setLastUsedResolution)(e),Y.linking.interval.setValue(e))},u._handleClickFavorite=function(e){e=Object(Q.ensureDefined)(e),u._isIntervalFavorite(e)?u._handleRemoveFavorite(e):u._handleAddFavorite(e)},u._handleAddFavorite=function(e){var t=u.state.favorites;u.context.favoriteIntervalsService.set(t.concat([e]))},u._handleRemoveFavorite=function(e){var t=u.state.favorites;u.context.favoriteIntervalsService.set(t.filter(function(t){return t!==e}))},u._handleAddInterval=function(e){var t=u.state.customs,n=u.context.customIntervalsService,i=Object(G.normalizeIntervalString)(e);void 0!==n&&(u._isIntervalDefault(i)||t.includes(i)||n.set(Object(G.sortResolutions)(t.concat([i])))),u.setState({lastAddedInterval:i})},u._handleRemoveInterval=function(e){var t,n;window.user.is_pro&&(t=u.context.customIntervalsService,n=u.state.customs,void 0!==t&&(t.set(n.filter(function(t){return t!==e})),u._handleRemoveFavorite(e)))},i=n.chartApiInstance,o=n.favoriteIntervalsService,a=n.customIntervalsService,u._customIntervals=c.enabled("custom_resolutions"),r=(s=Y.linking.interval.value())&&Object(G.normalizeIntervalString)(s),l=o.get(),h=void 0!==a?a.get():[],u._defaultsIntervals=i.defaultResolutions().map(G.normalizeIntervalString),u.state={isOpenedFormMenu:!1,activeInterval:r,favorites:l,customs:h},u}return h.__extends(t,e),t.prototype.componentDidMount=function(){var e=this.context,t=e.favoriteIntervalsService,n=e.customIntervalsService;t.getOnChange().subscribe(this,this._handleChangeFavorites),void 0!==n&&n.getOnChange().subscribe(this,this._handleChangeCustoms),Y.linking.interval.subscribe(this._handleChangeInterval),Y.linking.intraday.subscribe(this._bindedForceUpdate),Y.linking.supportedResolutions.subscribe(this._bindedForceUpdate)},t.prototype.componentWillUnmount=function(){var e=this.context,t=e.favoriteIntervalsService,n=e.customIntervalsService;t.getOnChange().unsubscribe(this,this._handleChangeFavorites),n&&n.getOnChange().unsubscribe(this,this._handleChangeCustoms),Y.linking.interval.unsubscribe(this._handleChangeInterval),Y.linking.intraday.unsubscribe(this._bindedForceUpdate),Y.linking.supportedResolutions.unsubscribe(this._bindedForceUpdate)},t.prototype.componentDidUpdate=function(e,t){var n=this;this.state.lastAddedInterval&&setTimeout(function(){return n.setState({lastAddedInterval:void 0})},400)},t.prototype.render=function(){var e,t,n,i,o,s=this,r=this.props,l=r.isShownQuicks,c=r.id,h=this.state,u=h.activeInterval,v=h.customs,p=h.lastNotQuicked,m=this._defaultsIntervals,f=this._getQuicks(),g=Object(G.sortResolutions)(f.slice());return void 0!==u&&g.includes(u)?void 0!==p&&g.push(p):void 0!==u&&g.push(u),e=(!(!l||0===f.length)||void 0)&&g.length>1,t={},n=Object(G.mergeResolutions)(m,v),(void 0!==u?n.concat(u):n).filter(G.isAvailable).forEach(function(e){return t[e]=!0}),i=this._createMenuItems(n).concat(this._createIntervalForm()),o=void 0!==u?Object(G.getTranslatedResolutionModel)(u):null,d.createElement(y,{id:c
},e&&g.map(function(e,n){var i,o=Object(G.getTranslatedResolutionModel)(e);return d.createElement(x,{key:n,className:C(he.button,(i={},i[he.first]=0===n,i[he.last]=n===g.length-1,i)),text:d.createElement(a,{value:o.mayOmitMultiplier?void 0:o.multiplier,metric:o.shortKind}),hint:o.hint,isActive:u===e,isDisabled:!t[e]&&e!==p,onClick:s._handleSelectInterval,onClickArg:e,"data-value":e})}),d.createElement(_.a,{arrow:Boolean(e),closeOnClickOutside:!0,content:e||null===o?void 0:d.createElement(y,{className:he.menuContent},d.createElement(a,{value:o.mayOmitMultiplier?void 0:o.multiplier,metric:o.shortKind})),title:e||null===o?de.timeInterval:o.hint,hotKey:e?ue:void 0,className:he.menu},d.createElement("div",{className:he.dropdown},i)))},t.prototype._createMenuItems=function(e){var t,n,i,o,a,r,l,c,h,d,u=(n=e,i=s(re.ResolutionKind.Seconds),o=s(re.ResolutionKind.Minutes),a=s(re.ResolutionKind.Hours),r=s(re.ResolutionKind.Days,!0),l=s(re.ResolutionKind.Weeks,!0),c=s(re.ResolutionKind.Months,!0),h=s(re.ResolutionKind.Range),n.forEach(function(e){var t=new re.Interval(e);t.isHours()?a.items.push(e):t.isMinutes()?Object(re.isHour)(Number(t.multiplier()))?a.items.push(e):o.items.push(e):t.isSeconds()?i.items.push(e):t.isDays()?r.items.push(e):t.isWeeks()?l.items.push(e):t.isMonths()?c.items.push(e):t.isRange()&&h.items.push(e)}),[i,o,a,r,l,c,h].filter(function(e){return 0!==e.items.length})).map(this._renderResolutionsGroup),v=(t=[]).concat.apply(t,u);return d=!1,v.filter(function(e,t,n){var i=!0;return e.type===E.a&&(0!==t&&t!==n.length-1||(i=!1),d&&(i=!1)),d=e.type===E.a,i})},t.prototype._createIntervalForm=function(){return this._customIntervals?[d.createElement(E.a,{key:"custom-interval-separator"}),d.createElement(te,{key:"add-form",onAdd:this._handleAddInterval,onCloseMenu:this._handleCloseMenu,onOpenMenu:this._handleOpenMenu})]:[]},t.prototype._handleChangeFavorites=function(e){this.setState({lastNotQuicked:void 0,favorites:e})},t.prototype._handleChangeCustoms=function(e){this.setState({customs:e})},t.prototype._renderPopupMenuItem=function(e){var t=this.props.isFavoritingAllowed,n=this.state,i=n.activeInterval,o=n.lastAddedInterval,a=e===i,s=Object(G.isAvailable)(e),r=this._isIntervalFavorite(e),l=this._isIntervalDefault(e),c=Object(G.getTranslatedResolutionModel)(e);return d.createElement(se,{key:e,interval:e,hint:c.hint,isSignaling:o===e,isFavoritingAllowed:t,isDisabled:!s,isFavorite:r,isRemovable:!l,isActive:a,onClick:this._handleSelectInterval,onClickRemove:this._handleRemoveInterval,onClickFavorite:this._handleClickFavorite,"data-value":e})},t.prototype._isIntervalDefault=function(e){return this._defaultsIntervals.includes(e)},t.prototype._isIntervalFavorite=function(e){return this.state.favorites.includes(e)},t.prototype._getQuicks=function(e){var t=this;return this.props.isShownQuicks&&"small"!==this.props.displayMode?(void 0===e?this.state.favorites:e).filter(function(e){return t._isIntervalDefault(e)}):[]},t.contextTypes={chartApiInstance:u.any.isRequired,favoriteIntervalsService:u.any.isRequired,
customIntervalsService:u.any},t}(d.PureComponent),pe=n("sbT4"),me=n("lAXe"),fe={hint:window.t("Open chart in popup")},ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._handleClick=function(){var e=t.context,n=e.chartWidgetCollection,i=e.windowMessageService,o=e.isFundamental,a=n.activeChartWidget.value();a.withModel(null,function(){i.post(parent,"openChartInPopup",{symbol:a.model().mainSeries().actualSymbol(),interval:a.model().mainSeries().interval(),fundamental:o})})},t}return h.__extends(t,e),t.prototype.render=function(){var e=this.props.className;return d.createElement(o,{className:C(e,pe.button),icon:me,onClick:this._handleClick,title:fe.hint})},t.contextTypes={isFundamental:u.any,chartWidgetCollection:u.any.isRequired,windowMessageService:u.any.isRequired},t}(d.PureComponent),_e=n("uafl"),Ce=n("QloM"),Se={hint:window.t("Chart Properties")},ye=function(e){function t(t){var n=e.call(this,t)||this;return n._handleClick=function(){var e=n.context.chartWidgetCollection;n.setState({isActive:!0}),setTimeout(function(){e.activeChartWidget.value().showGeneralChartProperties(Ce.TabNames.style).then(n._resolveDialogState)},0)},n._resolveDialogState=function(e){null!==e?(n.setState({isActive:!0}),e.dialogWidget().on("destroy",function(){return n.setState({isActive:!1})})):n.setState({isActive:!1})},n.state={isActive:!1},n}return h.__extends(t,e),t.prototype.render=function(){var e=this.state.isActive;return d.createElement(o,h.__assign({},this.props,{icon:_e,title:Se.hint,onClick:this._handleClick,isOpened:e}))},t.contextTypes={chartWidgetCollection:u.any.isRequired},t}(d.PureComponent),n("bSeV"),we=n("beCu"),be=n("j1f4"),ke=n("nrMg"),xe="M21.5 21.5h-14a5 5 0 1 1 .42-9.983 7.5 7.5 0 0 1 14.57 2.106 4.002 4.002 0 0 1-.99 7.877z",Te={strokeDashOffset:ze=.79*(Ee=62.332908630371094),strokeDash:Me=.8*Ee,strokeGap:Ae=.21*Ee,strokeDashCheck:0},Ie={strokeDashOffset:Ae+Me,strokeGap:0,strokeDash:Me+Ae,strokeDashCheck:200},Le=function(e){function t(t){var n=e.call(this,t)||this;return n.state=Te,n}return h.__extends(t,e),t.prototype.componentDidMount=function(){"saved"===this.props.state?this.setState(Ie):this._goToNextState(this.props.state)},t.prototype.componentWillUnmount=function(){this._currentAnimation=void 0},t.prototype.componentWillReceiveProps=function(e){this.props.state!==e.state&&this._goToNextState(e.state)},t.prototype.render=function(){var e,t=this.state,n=t.strokeDashOffset,i=t.strokeDash,o=t.strokeGap,a=t.strokeDashCheck,s=this.props,r=s.className,l=s.size,c=s.onClick,h=s.state,u=s.isHovered,v=void 0!==u&&u,p=C(ke.container,r,v&&ke.hovered,((e={})[ke.unsaved]="unsaved"===h,e[ke.saving]="saving"===h,e[ke.saved]="saved"===h,e));return d.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:p,version:"1.1",width:l,height:l,viewBox:"0 0 28 28",onClick:c},d.createElement("g",{fill:"none"},d.createElement("path",{className:ke.dottedCloud,stroke:"currentColor",strokeDasharray:"3.5,2.5",d:xe}),d.createElement("path",{className:ke.spinningCloud,stroke:"currentColor",
strokeDasharray:i+" "+o,strokeDashoffset:n,d:xe}),d.createElement("path",{className:ke.arrowGap,d:"M11 20h6v5h-6z"}),d.createElement("g",{className:ke.arrow,stroke:"currentColor"},d.createElement("path",{strokeLinecap:"square",d:"M14.5 14.5v10"}),d.createElement("path",{d:"M11 17l3.5-3.5L18 17"})),d.createElement("g",{className:ke.check,stroke:"currentColor"},d.createElement("path",{strokeDasharray:a+"% "+(200-a)+"%",d:"M10 15l2.5 2.5L18 12"}))))},t.prototype._goToNextState=function(e){var t=this;switch(e){case"unsaved":this.setState(Te);break;case"saving":"unsaved"!==this.props.state&&this.setState(Te),this._currentAnimation=Promise.resolve(this._currentAnimation).then(function(){return t._createSpinAnimationWhile(function(){return"saving"===t.props.state})});break;case"saved":this._currentAnimation=Promise.resolve(this._currentAnimation).then(this._createFillGapAnimation.bind(this)).then(this._createCheckAnimation.bind(this))}},t.prototype._createSpinAnimationWhile=function(e){var t=this;return this._createSpinAnimation().then(function(){return e()?t._createSpinAnimationWhile(e):Promise.resolve()})},t.prototype._createSpinAnimation=function(){var e=this;return new Promise(function(t){Object(we.doAnimate)({onStep:function(t,n){void 0!==e._currentAnimation&&e.setState({strokeDashOffset:n})},onComplete:function(){return t()},from:ze,to:ze+Ee,easing:be.easingFunc.linear,duration:1e3})})},t.prototype._createCheckAnimation=function(){var e=this;return new Promise(function(t){Object(we.doAnimate)({onStep:function(t,n){void 0!==e._currentAnimation&&e.setState({strokeDashCheck:Math.round(n)})},onComplete:function(){return t()},from:0,to:200,easing:be.easingFunc.linear,duration:1e3})})},t.prototype._createFillGapAnimation=function(){var e=this;return new Promise(function(t){Object(we.doAnimate)({onStep:function(t,n){void 0!==e._currentAnimation&&e.setState({strokeDashOffset:Ae+Me-n,strokeGap:n,strokeDash:Me+Ae-n})},onComplete:function(){return t()},from:Ae,to:0,easing:be.easingFunc.linear,duration:200})})},t}(d.PureComponent),He=n("nPPD"),Re=n("RGo6"),Oe=n("bQ7Y"),Ne=n("SchQ"),Fe=c.enabled("widget"),We=Object(He.b)(Oe,Ne),De=h.__assign({},Oe,We),Pe={copy:window.t("Copy"),makeCopy:window.t("Make a Copy"),newChartLayout:window.t("New Chart Layout"),loadChartLayout:window.t("Load Chart Layout..."),rename:window.t("Rename..."),renameChartLayout:window.t("Rename Chart Layout"),saveAs:window.t("Make a Copy..."),saveChartLayout:window.t("Save"),saveChartLayoutLong:window.t("Save all charts for all symbols and intervals on your layout"),manageChartLayouts:window.t("Manage Chart Layouts")},je=[],Be=Object(B.b)({keys:["Ctrl","S"],text:"{0} + {1}"}),Ue=function(e){function t(t){var n=e.call(this,t)||this;return n._handleSaveHoverBegin=function(){n.setState({iconHovered:!0})},n._handleSaveHoverEnd=function(){n.setState({iconHovered:!1})},n.state={iconHovered:!1},n}return h.__extends(t,e),t.prototype.render=function(){
var e=this.props,t=e.id,n=e.isReadOnly,o=e.displayMode,a=e.isProcessing,s=e.title,r=e.chartId,l=e.wasChanges,c=e.onCloneChart,h=e.onSaveChart,u=e.hideMenu,v=this.state.iconHovered,p=!n&&!u,m="saved";return!l&&s||(m="unsaved"),a&&(m="saving"),d.createElement(y,null,n?d.createElement(y,null,d.createElement(i,{id:t,displayMode:o,icon:d.createElement(Le,{size:28,state:"unsaved",isHovered:v}),isDisabled:a,onClick:c,text:Pe.copy,title:Pe.makeCopy,onMouseEnter:this._handleSaveHoverBegin,onMouseLeave:this._handleSaveHoverEnd,collapseWhen:je})):d.createElement(y,null,d.createElement(i,{id:t,className:C(Re.button,p&&Re.buttonSmallPadding),displayMode:o,icon:d.createElement(Le,{size:28,state:m,isHovered:v}),isDisabled:r&&!l||a,onClick:h,text:s||Pe.saveChartLayout,title:Pe.saveChartLayoutLong,onMouseEnter:this._handleSaveHoverBegin,onMouseLeave:this._handleSaveHoverEnd,theme:De,collapseWhen:je,"data-tooltip-hotkey":Fe?"":Be}),p&&d.createElement(_.a,{className:"js-save-load-menu-open-button",arrow:!0,title:Pe.manageChartLayouts},this._renderMenuItems())))},t.prototype._renderMenuItems=function(){var e=this.props,t=e.wasChanges,n=e.isProcessing,i=e.chartId,o=e.onSaveChart,a=e.onRenameChart,s=e.onSaveAsChart,r=e.onLoadChart,l=(e.onNewChart,e.isAutoSaveEnabled,e.autoSaveId,e.sharingId,e.onAutoSaveChanged,e.isSharingEnabled,e.onSharingChanged,[]);return l.push(d.createElement(g.a,{key:"save",isDisabled:Boolean(n||!t&&i),label:Pe.saveChartLayout,onClick:o,shortcut:"Ctrl+S"})),void 0!==i&&(l.push(d.createElement(E.a,{key:"existing-chart-section-begin"})),l.push.apply(l,[d.createElement(g.a,{key:"rename",label:Pe.rename,onClick:a}),d.createElement(g.a,{key:"save-as",label:Pe.saveAs,onClick:s})])),l.push(d.createElement(E.a,{key:"platform-section-begin"})),l.push(d.createElement(g.a,{key:"load-chart",className:"js-save-load-menu-item-load-chart",label:Pe.loadChartLayout,onClick:r})),l},t}(d.PureComponent),Ve=function(e){function t(t,n){var i,o,a=e.call(this,t,n)||this;return a._syncState=function(e){a.setState(e)},a._onChangeHasChanges=function(e){a.setState({wasChanges:e})},a._onChangeAutoSaveEnabled=function(e){0},a._onChangeSharingEnabled=function(e){a.setState({isSharingEnabled:e})},a._onChangeTitle=function(e){a.setState({title:e})},a._onChangeId=function(e){a.setState({id:e})},a._onChartAboutToBeSaved=function(){a.setState({isProcessing:!0})},a._onChartSaved=function(){a.setState({isProcessing:!1})},a._handleAutoSaveEnabled=function(e){0},a._handleSharingEnabled=function(e){0},a._handleClickSave=function(){a.context.saveChartService.saveChartOrShowTitleDialog()},a._handleClickClone=function(){a.context.saveChartService.cloneChart()},a._handleClickSaveAs=function(){a.context.saveChartService.saveChartAs()},a._handleClickNew=function(){0},a._handleClickLoad=function(){a.context.loadChartService.showLoadDialog()},a._handleHotkey=function(e){return!e.ctrlKey&&e.target===document.body&&(190===e.keyCode&&(a.context.loadChartService.showLoadDialog(),e.preventDefault(),e.stopPropagation(),!0))},a._handleClickRename=function(){
a.context.saveChartService.renameChart()},i=n.chartWidgetCollection,o=n.chartChangesWatcher,n.saveChartService,n.sharingChartService,a.state={isAuthenticated:window.is_authenticated,isProcessing:!1,id:i.metaInfo.id.value(),title:i.metaInfo.name.value(),wasChanges:o.hasChanges(),iconHovered:!1},a}return h.__extends(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.chartSaver,n=e.isFake,i=e.stateSyncEmitter,o=this.context,a=o.chartWidgetCollection,s=o.chartChangesWatcher;o.saveChartService,o.sharingChartService;n?i.on("change",this._syncState):(s.getOnChange().subscribe(this,this._onChangeHasChanges),a.metaInfo.name.subscribe(this._onChangeTitle),a.metaInfo.id.subscribe(this._onChangeId),document.addEventListener("keydown",this._handleHotkey),t.chartSaved().subscribe(this,this._onChartSaved),t.chartAboutToBeSaved().subscribe(this,this._onChartAboutToBeSaved),window.loginStateChange.subscribe(this,this._onLoginStateChange))},t.prototype.componentDidUpdate=function(e,t){this.props.isFake||t!==this.state&&this.props.stateSyncEmitter.emit("change",this.state)},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.chartSaver,n=e.isFake,i=e.stateSyncEmitter,o=this.context,a=o.chartWidgetCollection,s=o.chartChangesWatcher;o.saveChartService,o.sharingChartService;n?i.off("change",this._syncState):(s.getOnChange().unsubscribe(this,this._onChangeHasChanges),a.metaInfo.name.unsubscribe(this._onChangeTitle),a.metaInfo.id.unsubscribe(this._onChangeId),document.removeEventListener("keydown",this._handleHotkey),t.chartSaved().unsubscribe(this,this._onChartSaved),t.chartAboutToBeSaved().unsubscribe(this,this._onChartAboutToBeSaved),window.loginStateChange.unsubscribe(this,this._onLoginStateChange))},t.prototype.render=function(){var e=this.props,t=e.isReadOnly,n=e.displayMode,i=e.id,o=(e.isFake,this.state),a=o.isProcessing,s=o.isAuthenticated,r=o.title,l=o.id,c=o.wasChanges,u=(o.isAutoSaveEnabled,o.isSharingEnabled,{displayMode:n,isReadOnly:t,isAuthenticated:s,isProcessing:a,wasChanges:c,title:r,id:i,chartId:null!==l?l:void 0,onCloneChart:this._handleClickClone,onSaveChart:this._handleClickSave,onRenameChart:this._handleClickRename,onSaveAsChart:this._handleClickSaveAs,onLoadChart:this._handleClickLoad});return d.createElement(Ue,h.__assign({},u))},t.prototype._onLoginStateChange=function(){this.setState({isAuthenticated:window.is_authenticated})},t.contextTypes={chartWidgetCollection:u.any.isRequired,chartChangesWatcher:u.any.isRequired,saveChartService:u.any.isRequired,sharingChartService:u.any,loadChartService:u.any.isRequired},t}(d.PureComponent),Ke=n("FQhm"),Ye={takeSnapshot:window.t("Take a snapshot")},Ge=Object(B.b)({keys:["Alt","S"],text:"{0} + {1}"}),qe=n("koZ+"),bt=function(e){return d.createElement(w.a,{id:e.id,className:e.className,isDisabled:e.isProcessing,onClick:e.onClick,title:e.tooltip,"data-tooltip-hotkey":e.hotkey,icon:qe})},(kt=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i._handleClick=function(e){if(!c.enabled("show_dialog_on_snapshot_ready")){
if(i.state.isProcessing)return;i.setState({isProcessing:!0}),Ke.subscribe("onScreenshotReady",function(){return i.setState({isProcessing:!1})},null,!0)}i.context.chartWidgetCollection.takeScreenshot()},i.state={isProcessing:!1},i}return h.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.id,i=this.state.isProcessing;return d.createElement(bt,{id:n,className:t,isProcessing:i,onClick:this._handleClick,tooltip:Ye.takeSnapshot,hotkey:Ge})},t}(d.PureComponent)).contextTypes={chartWidgetCollection:u.any.isRequired},Qe=kt,Xe=n("pZll"),Je=n("h24c"),Ze=n("X7WP"),$e=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._actions=null,t._input=null,t._promise=null,t._preventDefault=function(e){e.preventDefault()},t}return h.__extends(t,e),t.prototype.componentDidMount=function(){var e=this,t=Object(Q.ensureNotNull)(this._input),n=this._promise=Object(Xe.symbolSearchUIService)().bindToInput(t,{spreadActions:this._actions||void 0,syncWithChartWidget:!0,syncOnBlur:!0}).then(function(){n===e._promise&&null!==e._actions&&Array.from(e._actions.querySelectorAll("button")).forEach(function(e){return e.tabIndex=-1})})},t.prototype.componentWillUnmount=function(){this._promise=null},t.prototype.render=function(){var e,t=this,n=this.props,i=n.isActionsVisible,o=n.isExpanded,a=n.onFocus,s=n.onBlur,r=n.id,l=n.className;return d.createElement("div",{id:r,className:C(Ze.wrap,l)},d.createElement("div",{className:C(Ze.inner,(e={},e[Ze.isExpanded]=o,e))},d.createElement("input",{className:Ze.input,maxLength:1e3,onBlur:s,onFocus:a,ref:function(e){return t._input=e},type:"text",tabIndex:-1}),Object(Je.canShowSpreadActions)()&&i&&d.createElement("div",{className:Ze.actions,onMouseDown:this._preventDefault,ref:function(e){return t._actions=e}})))},t}(d.PureComponent),et=n("23di"),tt=n("cjOe"),nt={text:window.t("Save Indicator Template...")},it=function(e){function t(t){var n=e.call(this,t)||this;return n._handleMouseEnter=function(){n.setState({isHovered:!0})},n._handleMouseLeave=function(){n.setState({isHovered:!1})},n._handleApply=function(){var e=n.props,t=e.item;(0,e.onApply)(t)},n._handleRemove=function(){var e=n.props,t=e.item;(0,e.onRemove)(t)},n._handleFavor=function(){var e=n.props,t=e.item,i=e.onFavor;i&&i(t)},n.state={isHovered:!1},n}return h.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.item,n=e.onFavor,i=e.favorite,o=e.isFavoritingAllowed,a=this.state.isHovered;return d.createElement("div",{onMouseEnter:this._handleMouseEnter,onMouseLeave:this._handleMouseLeave},d.createElement(g.a,{label:t.name,showToolboxOnHover:!i,onClick:this._handleApply,toolbox:[d.createElement(ae,{key:"remove",hidden:!Modernizr.mobiletouch&&!a,onClick:this._handleRemove}),Boolean(n)&&o&&d.createElement(m.a,{key:"favorite",isFilled:Boolean(i),onClick:this._handleFavor})]}))},t}(d.PureComponent),ot=n("9NBK"),at=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._handleClick=function(e){e.stopPropagation();var n=t.props;(0,n.onApply)(n.item)},t}
return h.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.item;return d.createElement("div",{className:C(t,ot.item,"apply-common-tooltip"),onClick:this._handleClick,title:n.name},d.createElement("div",{className:ot.round},n.name.length>0?n.name[0].toUpperCase():" "))},t}(d.PureComponent),st=n("zgWb"),rt=n("yGrx"),lt={title:window.t("Templates"),tooltip:window.t("Indicator Templates")},ct=function(e){function t(t,n){var i,o,a,s,r=e.call(this,t)||this;return r._handleFavorTemplate=function(e){if(r.props.isShownQuicks){var t=e.name;r._isTemplateFavorite(t)?r._removeFavoriteTemplate(t):r._addFavoriteTemplate(t)}},r._handleSaveTemplate=function(){r.context.studyTemplates.showSaveAsDialog()},r._handleApplyTemplate=function(e){r._handleClose(),r.context.studyTemplates.applyTemplate(e.name)},r._handleRemoveTemplate=function(e){r._handleClose(),r.context.studyTemplates.deleteStudyTemplate(e.name)},r._handleClose=function(){r._handleToggleDropdown(!1)},r._handleToggleDropdown=function(e){var t=r.state.isActive,n="boolean"==typeof e?e:!t;r.setState({isActive:n})},r._syncStateChange=function(e){r.setState(e)},i=n.favoriteStudyTemplatesService,o=n.studyTemplates,a=void 0!==i?i.get():[],s=o.list(),r.state={isActive:!1,studyTemplatesList:s,favorites:a},r}return h.__extends(t,e),t.prototype.componentDidMount=function(){if(this.props.isFake)this.props.stateSyncEmitter.on("change",this._syncStateChange);else{var e=this.context,t=e.favoriteStudyTemplatesService,n=e.studyTemplates;n.getOnChange().subscribe(this,this._handleTemplatesChange),n.refreshStudyTemplateList(),void 0!==t&&t.getOnChange().subscribe(this,this._handleFavoritesChange)}},t.prototype.componentWillUnmount=function(){if(this.props.isFake)this.props.stateSyncEmitter.off("change",this._syncStateChange);else{var e=this.context,t=e.favoriteStudyTemplatesService;e.studyTemplates.getOnChange().unsubscribe(this,this._handleTemplatesChange),void 0!==t&&t.getOnChange().unsubscribe(this,this._handleFavoritesChange)}},t.prototype.componentDidUpdate=function(e,t){this.props.isFake||t===this.state||this.props.stateSyncEmitter.emit("change",{favorites:this.state.favorites,studyTemplatesList:this.state.studyTemplatesList})},t.prototype.render=function(){var e,t=this.state,n=t.isActive,o=t.studyTemplatesList,a=t.favorites,s=this.props,l=s.isShownQuicks,c=s.className,h=s.displayMode,u=s.id,v=o.filter(function(e){return a.includes(e.name)}),p="small"!==h&&l&&v.length>0,m=C(c,rt.wrap,((e={})[rt.full]="full"===h,e[rt.medium]="medium"===h,e));return d.createElement(y,{id:u,className:m},d.createElement(_.a,{content:d.createElement(i,{className:C(p&&rt.buttonWithFavorites),displayMode:h,isOpened:n,icon:st,text:lt.title,title:lt.tooltip,forceInteractive:!0}),arrow:!1},d.createElement(r,{onClick:this._handleSaveTemplate}),o.length>0&&d.createElement(E.a,null),this._renderMenuItems()),p&&this._renderQuicks(v))},t.prototype._renderQuicks=function(e){var t=this;return e.map(function(e,n,i){var o;return d.createElement(at,{key:e.name,item:e,
onApply:t._handleApplyTemplate,className:C((o={},o[rt.first]=0===n,o[rt.last]=n===i.length-1,o))})})},t.prototype._renderMenuItems=function(){var e=this,t=this.state.studyTemplatesList,n=this.props.isFavoritingAllowed;return t.map(function(t){return d.createElement(it,{key:t.name,item:t,isFavoritingAllowed:n,favorite:e._isTemplateFavorite(t.name),onApply:e._handleApplyTemplate,onFavor:e._handleFavorTemplate,onRemove:e._handleRemoveTemplate})})},t.prototype._handleTemplatesChange=function(){this.setState({studyTemplatesList:this.context.studyTemplates.list()})},t.prototype._handleFavoritesChange=function(e){this.props.isShownQuicks&&this.setState({favorites:e})},t.prototype._removeFavoriteTemplate=function(e){var t,n=this.context.favoriteStudyTemplatesService;void 0!==n&&(t=this.state.favorites,n.set(t.filter(function(t){return t!==e})))},t.prototype._addFavoriteTemplate=function(e){var t,n=this.context.favoriteStudyTemplatesService;void 0!==n&&(t=this.state.favorites,n.set(t.concat([e])))},t.prototype._isTemplateFavorite=function(e){return this.state.favorites.includes(e)},t.contextTypes={favoriteStudyTemplatesService:u.any,studyTemplates:u.any.isRequired},t}(d.PureComponent),n("HbRj"),ht=n("tITk"),dt=n("S+Ii"),ut=n("wnRL"),vt=n("2xRE"),pt={undoHint:window.t("Undo {0}"),redoHint:window.t("Redo {0}")},mt={undoHotKey:Object(B.b)({keys:["Ctrl","Z"],text:"{0} + {1}"}),redoHotKey:Object(B.b)({keys:["Ctrl","Y"],text:"{0} + {1}"})},ft=Object(He.b)(Oe,dt,{buttonUndo:"button",buttonRedo:"button"}),gt=h.__assign({},Oe,{button:ft.buttonUndo}),_t=h.__assign({},Oe,{button:ft.buttonRedo}),Ct=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i._handleClickUndo=function(){Object(ht.trackEvent)("GUI","Undo"),i.context.chartWidgetCollection.undoHistory.undo()},i._handleClickRedo=function(){Object(ht.trackEvent)("GUI","Redo"),i.context.chartWidgetCollection.undoHistory.redo()},i.state=i._getStateFromUndoHistory(),i}return h.__extends(t,e),t.prototype.componentDidMount=function(){var e=this.context.chartWidgetCollection;e.undoHistory.redoStack().onChange().subscribe(this,this._onChangeStack),e.undoHistory.undoStack().onChange().subscribe(this,this._onChangeStack)},t.prototype.componentWillUnmount=function(){var e=this.context.chartWidgetCollection;e.undoHistory.redoStack().onChange().unsubscribe(this,this._onChangeStack),e.undoHistory.undoStack().onChange().unsubscribe(this,this._onChangeStack)},t.prototype.render=function(){var e=this.props.id,t=this.state,n=t.isEnabledRedo,i=t.isEnabledUndo,o=t.redoStack,a=t.undoStack;return d.createElement(y,{id:e},d.createElement(w.a,{icon:ut,isDisabled:!i,onClick:this._handleClickUndo,title:i?pt.undoHint.format(a):void 0,"data-tooltip-hotkey":i?mt.undoHotKey:void 0,theme:gt}),d.createElement(w.a,{icon:vt,isDisabled:!n,onClick:this._handleClickRedo,title:n?pt.redoHint.format(o):void 0,"data-tooltip-hotkey":n?mt.redoHotKey:void 0,theme:_t}))},t.prototype._onChangeStack=function(){var e=this._getStateFromUndoHistory();this.setState(e)},t.prototype._getStateFromUndoHistory=function(){
var e=this.context.chartWidgetCollection,t=e.undoHistory.undoStack(),n=e.undoHistory.redoStack(),i=n.head(),o=t.head();return{isEnabledRedo:!n.isEmpty(),isEnabledUndo:!t.isEmpty(),redoStack:i?i.text():"",undoStack:o?o.text():""}},t.contextTypes={chartWidgetCollection:u.any.isRequired},t}(d.PureComponent),St=n("i8i4"),yt=n("XmVn"),wt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._ref=null,t._update=function(){t.forceUpdate()},t._setRef=function(e){t._ref=e},t._handleMeasure=function(e){var n=e.width;t.props.width.setValue(n)},t}return h.__extends(t,e),t.prototype.componentDidMount=function(){var e,t=this.props,n=t.element,i=t.isFake,o=t.width;i?o.subscribe(this._update):(e=Object(Q.ensureNotNull)(this._ref),St.findDOMNode(e).appendChild(n))},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.width;e.isFake&&t.unsubscribe(this._update)},t.prototype.render=function(){var e=this.props,t=e.isFake,n=void 0!==t&&t,i=e.width;return d.createElement(yt,{shouldMeasure:!n,whitelist:["width"],onMeasure:this._handleMeasure},d.createElement(y,{ref:this._setRef,style:n?{width:i.value()}:void 0}))},t}(d.PureComponent),n.d(t,"getRestrictedToolSet",function(){return l})},nrMg:function(e,t,n){e.exports={dottedCloud:"dottedCloud-1Vw3lVny-",check:"check-3V48_rMp-",spinningCloud:"spinningCloud-2fkbB-rw-",arrow:"arrow-1zkKEROH-",arrowGap:"arrowGap-gjAe6jEn-",container:"container-riYIb01a-",unsaved:"unsaved-2Kg_w3Vw-",hovered:"hovered-18DzoW0E-",saving:"saving-31YVVfHU-",saved:"saved-2kLd4nmd-"}},pqsj:function(e,t){e.exports=''},pr86:function(e,t,n){"use strict";var i,o,a,s,r,l,c,h;n.d(t,"a",function(){return h}),i=n("mrSG"),n("YFKU"),o=n("q1tI"),a=n("TSYQ"),s=n("fEjm"),r=n("HHbT"),l=n("GWvR"),c={add:window.t("Add to favorites"),remove:window.t("Remove from favorites")},h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._handleClick=function(e){var n=t.props,i=n.onClick,o=n.onClickArg;i&&i(o,e)},t}return i.__extends(t,e),t.prototype.render=function(){var e,t=this.props.isFilled;return o.createElement("span",{className:a(s.star,"apply-common-tooltip",(e={},e[s.checked]=t,e)),dangerouslySetInnerHTML:{__html:t?r:l},onClick:this._handleClick,title:t?c.remove:c.add})},t}(o.PureComponent)},sbT4:function(e,t,n){e.exports={button:"button-3wAyKO3i-"}},t2Sj:function(e,t){e.exports=''},uafl:function(e,t){
e.exports=''},wnRL:function(e,t){e.exports=''},yGrx:function(e,t,n){e.exports={wrap:"wrap-15BhAobm-",full:"full-2VMT2UlC-",first:"first-1vAzGgSq-",last:"last-xMjAcadb-",medium:"medium-1BEsHMFf-",loader:"loader-1uURoPBh-",buttonWithFavorites:"buttonWithFavorites-3S-vuMxR-"}},zgWb:function(e,t){e.exports=''}}]);