19 lines
54 KiB
JavaScript
19 lines
54 KiB
JavaScript
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7260],{62092:e=>{e.exports={loader:"loader-MuZZSHRY",static:"static-MuZZSHRY",item:"item-MuZZSHRY","tv-button-loader":"tv-button-loader-MuZZSHRY",medium:"medium-MuZZSHRY",small:"small-MuZZSHRY",black:"black-MuZZSHRY",white:"white-MuZZSHRY",gray:"gray-MuZZSHRY",primary:"primary-MuZZSHRY","loader-initial":"loader-initial-MuZZSHRY","loader-appear":"loader-appear-MuZZSHRY"}},32925:e=>{e.exports={button:"button-WhrIKIq9",hover:"hover-WhrIKIq9",inner:"inner-WhrIKIq9"}},55576:e=>{e.exports={button:"button-9pA37sIi",hover:"hover-9pA37sIi",isInteractive:"isInteractive-9pA37sIi",isGrouped:"isGrouped-9pA37sIi",newStyles:"newStyles-9pA37sIi",isActive:"isActive-9pA37sIi",isOpened:"isOpened-9pA37sIi",isDisabled:"isDisabled-9pA37sIi",text:"text-9pA37sIi",icon:"icon-9pA37sIi"}},78966:e=>{e.exports={title:"title-mAu74Mtg"}},71123:e=>{e.exports={button:"button-khcLBZEz",hover:"hover-khcLBZEz",arrow:"arrow-khcLBZEz",arrowWrap:"arrowWrap-khcLBZEz",newStyles:"newStyles-khcLBZEz",isOpened:"isOpened-khcLBZEz"}},43527:e=>{e.exports={toolbar:"toolbar-sFd8og5Y",dateRangeWrapper:"dateRangeWrapper-sFd8og5Y",seriesControlWrapper:"seriesControlWrapper-sFd8og5Y",dateRangeExpanded:"dateRangeExpanded-sFd8og5Y",dateRangeCollapsed:"dateRangeCollapsed-sFd8og5Y",item:"item-sFd8og5Y",first:"first-sFd8og5Y",last:"last-sFd8og5Y",inline:"inline-sFd8og5Y",timezone:"timezone-sFd8og5Y",session:"session-sFd8og5Y",icon:"icon-sFd8og5Y",hidden:"hidden-sFd8og5Y",collapsed:"collapsed-sFd8og5Y"}},47393:e=>{e.exports={button:"button-YwWuPcCo",separator:"separator-YwWuPcCo"}},25033:e=>{e.exports={button:"button-wNyKS1Qc",hover:"hover-wNyKS1Qc",icon:"icon-wNyKS1Qc"}},71922:e=>{e.exports={separator:"separator-ArqK8T1e"}},70439:e=>{e.exports={headerMenuText:"headerMenuText-suXx3uas"}},17963:e=>{e.exports={button:"button-U8Px2hz6"}},22880:e=>{e.exports={item:"item-G1QqQDLk",hover:"hover-G1QqQDLk",isActive:"isActive-G1QqQDLk",isFirst:"isFirst-G1QqQDLk",isLast:"isLast-G1QqQDLk"}},72767:e=>{e.exports={slider:"slider-eR7xmZ00",inner:"inner-eR7xmZ00"}},38952:e=>{e.exports={sliderRow:"sliderRow-DtHrLXA3"}},19119:e=>{e.exports={item:"item-tPYeYcJa",interactive:"interactive-tPYeYcJa",hovered:"hovered-tPYeYcJa",disabled:"disabled-tPYeYcJa",active:"active-tPYeYcJa",shortcut:"shortcut-tPYeYcJa",normal:"normal-tPYeYcJa",big:"big-tPYeYcJa",iconCell:"iconCell-tPYeYcJa",icon:"icon-tPYeYcJa",checkmark:"checkmark-tPYeYcJa",content:"content-tPYeYcJa",label:"label-tPYeYcJa",checked:"checked-tPYeYcJa",toolbox:"toolbox-tPYeYcJa",showToolboxOnHover:"showToolboxOnHover-tPYeYcJa",arrowIcon:"arrowIcon-tPYeYcJa",subMenu:"subMenu-tPYeYcJa",invisibleHotkey:"invisibleHotkey-tPYeYcJa"}},61999:e=>{e.exports={item:"item-zoYF2FPa",emptyIcons:"emptyIcons-zoYF2FPa",loading:"loading-zoYF2FPa",disabled:"disabled-zoYF2FPa",interactive:"interactive-zoYF2FPa",hovered:"hovered-zoYF2FPa",normal:"normal-zoYF2FPa",big:"big-zoYF2FPa",icon:"icon-zoYF2FPa",label:"label-zoYF2FPa",title:"title-zoYF2FPa",nested:"nested-zoYF2FPa",
|
|
shortcut:"shortcut-zoYF2FPa",remove:"remove-zoYF2FPa"}},66998:e=>{e.exports={wrap:"wrap-3HaHQVJm",positionBottom:"positionBottom-3HaHQVJm",backdrop:"backdrop-3HaHQVJm",drawer:"drawer-3HaHQVJm",positionLeft:"positionLeft-3HaHQVJm"}},91626:e=>{e.exports={separator:"separator-jtAq6E4V"}},23576:e=>{e.exports={"tablet-small-breakpoint":"screen and (max-width: 428px)",item:"item-4TFSfyGO",hovered:"hovered-4TFSfyGO",isDisabled:"isDisabled-4TFSfyGO",isActive:"isActive-4TFSfyGO",shortcut:"shortcut-4TFSfyGO",toolbox:"toolbox-4TFSfyGO",withIcon:"withIcon-4TFSfyGO",icon:"icon-4TFSfyGO",labelRow:"labelRow-4TFSfyGO",label:"label-4TFSfyGO",showOnHover:"showOnHover-4TFSfyGO"}},524:e=>{e.exports={separator:"separator-GzmeVcFo",small:"small-GzmeVcFo",normal:"normal-GzmeVcFo",large:"large-GzmeVcFo"}},37740:e=>{e.exports={tabs:"tabs-rKFlMYkc",tab:"tab-rKFlMYkc",noBorder:"noBorder-rKFlMYkc",disabled:"disabled-rKFlMYkc",active:"active-rKFlMYkc",defaultCursor:"defaultCursor-rKFlMYkc",slider:"slider-rKFlMYkc",content:"content-rKFlMYkc"}},40367:e=>{e.exports={icon:"icon-AL2odtws",dropped:"dropped-AL2odtws"}},26996:(e,t,s)=>{"use strict";s.d(t,{Loader:()=>c});var n,i=s(59496),a=s(97754),o=s(74991),r=s(62092),l=s.n(r);!function(e){e[e.Initial=0]="Initial",e[e.Appear=1]="Appear",e[e.Active=2]="Active"}(n||(n={}));class c extends i.PureComponent{constructor(e){super(e),this._stateChangeTimeout=null,this.state={state:n.Initial}}render(){const{className:e,color:t="black",size:s="medium",staticPosition:n}=this.props,o=a(l().item,l()[t],l()[s]);return i.createElement("span",{className:a(l().loader,n&&l().static,this._getStateClass(),e)},i.createElement("span",{className:o}),i.createElement("span",{className:o}),i.createElement("span",{className:o}))}componentDidMount(){this.setState({state:n.Appear}),this._stateChangeTimeout=setTimeout(()=>{this.setState({state:n.Active})},2*o.dur)}componentWillUnmount(){this._stateChangeTimeout&&(clearTimeout(this._stateChangeTimeout),this._stateChangeTimeout=null)}_getStateClass(){switch(this.state.state){case n.Initial:return l()["loader-initial"];case n.Appear:return l()["loader-appear"];default:return""}}}},90186:(e,t,s)=>{"use strict";function n(e){return a(e,o)}function i(e){return a(e,r)}function a(e,t){const s=Object.entries(e).filter(t),n={};for(const[e,t]of s)n[e]=t;return n}function o(e){const[t,s]=e;return 0===t.indexOf("data-")&&"string"==typeof s}function r(e){return 0===e[0].indexOf("aria-")}s.d(t,{filterDataProps:()=>n,filterAriaProps:()=>i,filterProps:()=>a,isDataAttribute:()=>o,isAriaAttribute:()=>r})},40233:(e,t,s)=>{"use strict";s.d(t,{VerticalAttachEdge:()=>n,HorizontalAttachEdge:()=>i,VerticalDropDirection:()=>a,HorizontalDropDirection:()=>o,getPopupPositioner:()=>c});var n,i,a,o,r=s(88537);!function(e){e[e.Top=0]="Top",e[e.Bottom=1]="Bottom"}(n||(n={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right"}(i||(i={})),function(e){e[e.FromTopToBottom=0]="FromTopToBottom",e[e.FromBottomToTop=1]="FromBottomToTop"}(a||(a={})),function(e){e[e.FromLeftToRight=0]="FromLeftToRight",
|
|
e[e.FromRightToLeft=1]="FromRightToLeft"}(o||(o={}));const l={verticalAttachEdge:n.Bottom,horizontalAttachEdge:i.Left,verticalDropDirection:a.FromTopToBottom,horizontalDropDirection:o.FromLeftToRight,verticalMargin:0,horizontalMargin:0,matchButtonAndListboxWidths:!1};function c(e,t){return(s,c)=>{const h=(0,r.ensureNotNull)(e).getBoundingClientRect(),{verticalAttachEdge:d=l.verticalAttachEdge,verticalDropDirection:u=l.verticalDropDirection,horizontalAttachEdge:m=l.horizontalAttachEdge,horizontalDropDirection:p=l.horizontalDropDirection,horizontalMargin:g=l.horizontalMargin,verticalMargin:v=l.verticalMargin,matchButtonAndListboxWidths:b=l.matchButtonAndListboxWidths}=t,_=d===n.Top?-1*v:v,C=m===i.Right?h.right:h.left,f=d===n.Top?h.top:h.bottom,S={x:C-(p===o.FromRightToLeft?s:0)+g,y:f-(u===a.FromBottomToTop?c:0)+_};return b&&(S.overrideWidth=h.width),S}}},4825:(e,t,s)=>{"use strict";s.d(t,{DEFAULT_TOOL_WIDGET_BUTTON_THEME:()=>l,ToolWidgetButton:()=>c});var n=s(59496),i=s(97754),a=s(9745),o=s(37669),r=s(55576);const l=r,c=n.forwardRef((e,t)=>{const{icon:s,isActive:l,isOpened:c,isDisabled:h,isGrouped:d,isHovered:u,onClick:m,text:p,textBeforeIcon:g,title:v,theme:b=r,className:_,forceInteractive:C,"data-name":f,...S}=e,x=i(_,b.button,v&&"apply-common-tooltip",{[b.isActive]:l,[b.isOpened]:c,[b.isInteractive]:(C||Boolean(m))&&!h,[b.isDisabled]:h,[b.isGrouped]:d,[b.hover]:u,[b.newStyles]:o.hasNewHeaderToolbarStyles}),E=s&&("string"==typeof s?n.createElement(a.Icon,{className:b.icon,icon:s}):n.cloneElement(s,{className:i(b.icon,s.props.className)}));return n.createElement("div",{...S,ref:t,"data-role":"button",className:x,onClick:h?void 0:m,title:v,"data-name":f},g&&p&&n.createElement("div",{className:i("js-button-text",b.text)},p),E,!g&&p&&n.createElement("div",{className:i("js-button-text",b.text)},p))})},49466:(e,t,s)=>{"use strict";s.d(t,{ToolWidgetMenuSummary:()=>o});var n=s(59496),i=s(97754),a=s(78966);function o(e){return n.createElement("div",{className:i(e.className,a.title)},e.children)}},35390:(e,t,s)=>{"use strict";s.d(t,{ToolWidgetMenu:()=>p});var n=s(59496),i=s(97754),a=s(50628),o=s(10381),r=s(90186),l=s(37558),c=s(41590),h=s(40233),d=s(90692),u=s(37669),m=s(71123);class p extends n.PureComponent{constructor(e){super(e),this._wrapperRef=null,this._controller=n.createRef(),this._handleWrapperRef=e=>{this._wrapperRef=e,this.props.reference&&this.props.reference(e)},this._handleClick=e=>{e.target instanceof Node&&e.currentTarget.contains(e.target)&&(this._handleToggleDropdown(),this.props.onClick&&this.props.onClick(e,!this.state.isOpened))},this._handleToggleDropdown=e=>{const{onClose:t,onOpen:s}=this.props,{isOpened:n}=this.state,i="boolean"==typeof e?e:!n;this.setState({isOpened:i}),i&&s&&s(),!i&&t&&t()},this._handleClose=()=>{this.close()},this.state={isOpened:!1}}render(){const{id:e,arrow:t,content:s,isDisabled:a,isDrawer:l,isShowTooltip:c,title:h,className:m,hotKey:p,theme:g,drawerBreakpoint:v}=this.props,{isOpened:b}=this.state,_=i(m,g.button,{"apply-common-tooltip":c||!a,[g.isDisabled]:a,[g.isOpened]:b,
|
|
[g.newStyles]:u.hasNewHeaderToolbarStyles});return n.createElement("div",{id:e,className:_,onClick:a?void 0:this._handleClick,title:h,"data-tooltip-hotkey":p,ref:this._handleWrapperRef,"data-role":"button",...(0,r.filterDataProps)(this.props)},s,t&&n.createElement("div",{className:g.arrow},n.createElement("div",{className:g.arrowWrap},n.createElement(o.ToolWidgetCaret,{dropped:b}))),this.state.isOpened&&(v?n.createElement(d.MatchMedia,{rule:v},e=>this._renderContent(e)):this._renderContent(l)))}close(){this._handleToggleDropdown(!1)}update(){null!==this._controller.current&&this._controller.current.update()}_renderContent(e){const{menuDataName:t,minWidth:s,menuClassName:i,maxHeight:o,drawerPosition:r="Bottom",children:d}=this.props,{isOpened:u}=this.state,m={horizontalMargin:this.props.horizontalMargin||0,verticalMargin:this.props.verticalMargin||2,verticalAttachEdge:this.props.verticalAttachEdge,horizontalAttachEdge:this.props.horizontalAttachEdge,verticalDropDirection:this.props.verticalDropDirection,horizontalDropDirection:this.props.horizontalDropDirection,matchButtonAndListboxWidths:this.props.matchButtonAndListboxWidths},p=Boolean(u&&e&&r),g=function(e){return"function"==typeof e}(d)?d({isDrawer:p}):d;return p?n.createElement(l.DrawerManager,null,n.createElement(c.Drawer,{onClose:this._handleClose,position:r,"data-name":t},g)):n.createElement(a.PopupMenu,{controller:this._controller,closeOnClickOutside:this.props.closeOnClickOutside,doNotCloseOn:this,isOpened:u,minWidth:s,onClose:this._handleClose,position:(0,h.getPopupPositioner)(this._wrapperRef,m),className:i,maxHeight:o,"data-name":t},g)}}p.defaultProps={arrow:!0,closeOnClickOutside:!0,theme:m}},50168:(e,t,s)=>{"use strict";s.r(t),s.d(t,{BottomToolbarRenderer:()=>nt});var n=s(59496),i=s(87995),a=s(28353),o=s(19036),r=s(97754),l=s(9837),c=s(67337),h=s(35390),d=s(40233),u=s(59064),m=s(90692),p=s(16396),g=s(51613),v=s(88537),b=s(51768),_=s(55402),C=s(2872),f=s.n(C),S=s(16654);class x{constructor(e){this._state={ranges:[]},this._change=new(f()),this._rangeChangedListenerBound=this._onRangeChanged.bind(this);const{chartWidget:t}=this._context=e;t.withModel(null,()=>{const e=t.model(),s=e.mainSeries();s.onStatusChanged().subscribe(this,this._updateAvailableRanges),c.enabled("update_timeframes_set_on_symbol_resolve")&&s.dataEvents().symbolResolved().subscribe(this,this._updateAvailableRanges),s.priceScale().properties().childs().lockScale.subscribe(this,this._updateAvailableRanges);const n=e.model().appliedTimeFrame();n.subscribe(this._rangeChangedListenerBound),this._rangeChangedListenerBound(n.value()),this._updateAvailableRanges()})}state(){return this._state}onChange(){return this._change}selectRange(e){this._setState({activeRange:e.value.value});const{chartWidgetCollection:t}=this._context,s={val:e.value,res:e.targetResolution};t.setTimeFrame(s)}destroy(){const{chartWidget:e}=this._context;e.withModel(null,()=>{const t=e.model(),s=t.mainSeries();s.onStatusChanged().unsubscribe(this,this._updateAvailableRanges),
|
|
c.enabled("update_timeframes_set_on_symbol_resolve")&&s.dataEvents().symbolResolved().unsubscribe(this,this._updateAvailableRanges),s.priceScale().properties().childs().lockScale.unsubscribe(this,this._updateAvailableRanges),t.model().appliedTimeFrame().unsubscribe(this._rangeChangedListenerBound)}),this._change.destroy()}_setState(e){this._state=Object.assign({},this._state,e),this._change.fire(this._state)}_onRangeChanged(e){let t;null!==e&&"period-back"===e.val.type&&(t=e.val.value),this._setState({activeRange:t})}_updateAvailableRanges(){const{availableTimeFrames:e,chartWidget:t}=this._context;if(!t.hasModel())return;const s=t.model().mainSeries(),n=s.status();if(n===S.STATUS_LOADING||n===S.STATUS_RESOLVING)return;const i=e(s.symbolInfo(),s.status());0!==i.length&&this._setState({ranges:i})}}const E=(0,_.registryContextType)();function y(e){var t;return(t=class extends n.PureComponent{constructor(e,t){super(e,t),this._handleUpdate=e=>{this.setState(e)},this._handleSelectRange=e=>{var t,s;(0,b.trackEvent)("GUI","Chart Bottom Toolbar","range "+e.value),null===(s=(t=this.props).onSelectRange)||void 0===s||s.call(t,e),this._binding.selectRange(e)},(0,_.validateRegistry)(t,{availableTimeFrames:o.any.isRequired,chartWidgetCollection:o.any.isRequired,chartWidget:o.any.isRequired}),M.has(t.chartWidget)||M.set(t.chartWidget,new x(t));const s=this._binding=(0,v.ensureDefined)(M.get(t.chartWidget));this.state=s.state()}componentDidMount(){this._binding.onChange().subscribe(this,this._handleUpdate)}componentWillUnmount(){this._binding.onChange().unsubscribe(this,this._handleUpdate)}render(){return n.createElement(e,{goToDateButton:this.props.goToDateButton,className:this.props.className,ranges:this.state.ranges,activeRange:this.state.activeRange,onSelectRange:this._handleSelectRange})}}).contextType=E,t}const M=new WeakMap;var w=s(94420),T=s(23829),k=s(1109),R=s(82724),A=s(52360),N=s(47393);function D(e){const{ranges:t,activeRange:s,onSelectRange:i}=e;return n.createElement(n.Fragment,null,t.map(e=>n.createElement(T.ContextMenuItem,{key:e.value.value,label:e.description||e.text,active:s===e.value.value,checked:s===e.value.value,checkable:!0,disabled:!1,onClick:a.bind(null,e),doNotCloseOnClick:!1,subItems:[]})));function a(e){e&&i&&i(e),(0,u.globalCloseMenu)()}}function B(e){const{onGoToDateClick:t}=e;return n.createElement(n.Fragment,null,n.createElement(k.Separator,{className:N.separator}),n.createElement(T.ContextMenuItem,{icon:A,label:(0,R.appendEllipsis)((0,a.t)("Go to")),onClick:t,active:!1,checked:!1,checkable:!1,disabled:!1,doNotCloseOnClick:!1,subItems:[]}))}const W={title:(0,a.t)("Date Range"),goToDate:(0,R.appendEllipsis)((0,a.t)("Go to"))},F=(0,_.registryContextType)();class P extends n.PureComponent{constructor(e,t){super(e,t),this._handleGoToDateClick=()=>{const{chartWidget:e}=this.context;(0,w.showGoToDateDialog)(e),(0,u.globalCloseMenu)()},this._handleRangeSelect=e=>{e&&this.props.onSelectRange&&this.props.onSelectRange(e),(0,u.globalCloseMenu)()},this._renderChildren=e=>{
|
|
const{ranges:t,activeRange:s,goToDateButton:i}=this.props;return e?n.createElement(n.Fragment,null,n.createElement(D,{ranges:t,activeRange:s,onSelectRange:this._handleRangeSelect}),i&&n.createElement(B,{onGoToDateClick:this._handleGoToDateClick})):n.createElement(n.Fragment,null,t.map(e=>n.createElement(p.PopupMenuItem,{key:e.value.value,label:e.description||e.text,isActive:s===e.value.value,onClick:this._handleRangeSelect,onClickArg:e})),i&&n.createElement(g.PopupMenuSeparator,null),i&&n.createElement(p.PopupMenuItem,{label:W.goToDate,onClick:this._handleGoToDateClick}))},(0,_.validateRegistry)(t,{chartWidget:o.any.isRequired})}render(){return n.createElement(m.MatchMedia,{rule:"screen and (max-width: 428px)"},e=>n.createElement(h.ToolWidgetMenu,{className:N.button,content:W.title,arrow:!0,verticalAttachEdge:d.VerticalAttachEdge.Top,verticalDropDirection:d.VerticalDropDirection.FromBottomToTop,horizontalMargin:4,"data-name":"date-ranges-menu",isDrawer:e,onClick:this._trackClick},this._renderChildren(e)))}_trackClick(){0}}P.contextType=F;const z=y(P);var L=s(64205),I=s(22880);function H(e){const t=r(e.className,I.item,{[I.isActive]:e.isActive,[I.isFirst]:e.isFirst,[I.isLast]:e.isLast});return n.createElement("div",{className:t,onClick:e.onClick,ref:e.reference},e.children)}var Y=s(40173),O=s(72767);const j=(0,Y.mergeThemes)(L.DEFAULT_SLIDER_THEME,O);var G=s(38952);const Z=(0,L.factory)((function(e){return n.createElement("div",{className:r(e.className,j.slider),ref:e.reference},n.createElement("div",{className:j.inner}))}));const V=y((function(e){const{className:t,ranges:s,activeRange:i,onSelectRange:a}=e;return n.createElement(Z,{className:r(G.sliderRow,t),"data-name":"date-ranges-tabs"},s.map((e,t)=>n.createElement(H,{key:e.value.value,value:e.value.value,isFirst:0===t,isLast:t===s.length-1,isActive:i===e.value.value,onClick:a&&a.bind(null,e)},n.createElement("div",{title:e.description||e.text,className:"apply-common-tooltip"},e.text))))}));var U=s(9745),q=s(61814),J=s(68335),K=s(68139),Q=s(25033);const X=(0,q.hotKeySerialize)({keys:[(0,J.humanReadableModifiers)(J.Modifiers.Alt,!1),"G"],text:"{0} + {1}"}),$=(0,_.registryContextType)();class ee extends n.PureComponent{constructor(e,t){super(e,t),this._handleClick=()=>{const{chartWidget:e}=this.context;(0,b.trackEvent)("GUI","Chart Bottom Toolbar","go to"),(0,w.showGoToDateDialog)(e)},(0,_.validateRegistry)(t,{chartWidget:o.any.isRequired})}render(){const{className:e,ranges:t}=this.props;return t.length>0&&n.createElement("div",{className:r("apply-common-tooltip",Q.button,e),"data-name":"go-to-date","data-tooltip-hotkey":X,onClick:this._handleClick,title:(0,a.t)("Go to")},n.createElement(U.Icon,{className:Q.icon,icon:K}))}}ee.contextType=$;const te=y(ee);var se=s(32925);function ne(e){const{reference:t,className:s,children:i,...a}=e;return n.createElement("button",{...a,className:r(s,se.button),ref:t},n.createElement("span",{className:se.inner},i))}var ie=s(23095),ae=s(64806),oe=s(28296),re=s(97056);class le extends n.PureComponent{constructor(e){super(e),
|
|
this._element=null,this._menuShown=!1,this._preventShowingMenu=!1,this._handleRef=e=>{this._element=e},this._onMouseDown=()=>{this._preventShowingMenu=this._menuShown},this._showMenu=()=>{if(this._preventShowingMenu)return void re.ContextMenuManager.hideAll();const{getActions:e}=this.props,t=(0,v.ensureNotNull)(this._element),s=e();if(0===s.length)return;const n=t.getBoundingClientRect();re.ContextMenuManager.showMenu(s,{clientX:n.left,clientY:n.top,attachToYBy:"bottom"},void 0,{menuName:"TimezoneMenuContextMenu"},()=>{this._menuShown=!1}).then(()=>{this._menuShown=!0})}}render(){const{children:e}=this.props;return n.createElement("span",{onClick:this._showMenu,onMouseDown:this._onMouseDown,ref:this._handleRef},e)}}var ce=s(10480),he=s(17963);const de={hint:(0,a.t)("Timezone")};const ue=(0,_.registryContextType)();class me extends n.PureComponent{constructor(e,t){super(e,t),this._timeFormatter=new ae.TimeFormatter,this._tickInterval=void 0,this._tickClock=()=>{const{chartApiInstance:e}=this.context;if(void 0!==this._timezone){const t=(0,ce.utc_to_cal)(this._timezone,e.serverTime());this.setState({time:this._timeFormatter.format(t)})}},this._getActions=()=>{if(!this.props.withMenu)return[];const{chartWidget:e}=this.context;return function(e){e.updateActions();const t=e.actions();return t&&t.applyTimeZone instanceof oe.Action?t.applyTimeZone.getSubItems():[]}(e)},(0,_.validateRegistry)(t,{chartWidget:o.any.isRequired,chartApiInstance:o.any.isRequired}),this.state={time:""}}componentDidMount(){const{chartWidget:e}=this.context;this._tickInterval=setInterval(this._tickClock,1e3),e.withModel(null,()=>{const t=e.model();t.model().mainSeries().dataEvents().symbolResolved().subscribe(this,this.updateTimezonesButton),t.model().properties().childs().timezone.subscribe(this,this.updateTimezonesButton)})}componentWillUnmount(){const{chartWidget:e}=this.context;clearInterval(this._tickInterval),e.withModel(null,()=>{const t=e.model();t.model().mainSeries().dataEvents().symbolResolved().unsubscribe(this,this.updateTimezonesButton),t.model().properties().childs().timezone.unsubscribe(this,this.updateTimezonesButton)})}render(){const{className:e,withMenu:t}=this.props,{time:s}=this.state,i=void 0!==this._timezone?(0,ie.parseTzOffset)(this._timezone.name()).string:null;return n.createElement(le,{getActions:this._getActions},n.createElement(ne,{className:r(e,he.button,"apply-common-tooltip"),title:t?de.hint:void 0,disabled:!t,"data-name":"time-zone-menu"},s&&i&&`${s} (${i})`))}updateTimezonesButton(){const{chartWidget:e}=this.context;if(!e.hasModel())return;if(null===e.model().mainSeries().symbolInfo())return;let t=e.model().model().timezone();if("exchange"===t){const s=(0,v.ensureNotNull)(e.model().mainSeries().symbolInfo()).timezone;s&&(t=s)}this._timezone=(0,ce.get_timezone)(t),this._tickClock()}}me.contextType=ue;var pe=s(71922);function ge(e){return n.createElement("span",{className:r(pe.separator,e.className)})}var ve=s(4825),be=s(24980),_e=s(49483);class Ce{constructor(e,t,s){this._highlighted=!1,this._chartWidget=e,
|
|
this._priceScaleGetter=t,this._owner=s,this._setHighlight=this._setHighlight.bind(this),this._removeHighlight=this._removeHighlight.bind(this)}destroy(){this._highlighted&&this._removeHighlight()}handlers(){const e=_e.CheckMobile.any();return{onMouseEnter:e?void 0:this._setHighlight,onMouseLeave:e?void 0:this._removeHighlight}}_setHighlight(){if(!this._chartWidget.hasModel())return;const e=this._chartWidget.model().model(),t=e.paneForSource(e.mainSeries()),s=this._priceScaleGetter();if(null===t||null===s)return;const n=this._chartWidget.paneByState(t);if(null!==n){const t=n.rightPriceAxisesContainer().findAxisWidgetForScale(s);let i=null;null!==t&&(i=t.axisInfo());const a=n.leftPriceAxisesContainer().findAxisWidgetForScale(s);null!==a&&(i=a.axisInfo());const o=n.highlightedPriceAxis();null!==i&&o.value().axis!==i&&(o.setValue({owner:this._owner,axis:i}),e.lightUpdate(),this._highlighted=!0)}}_removeHighlight(){if(!this._chartWidget.hasModel())return;const e=this._chartWidget.model().model(),t=e.paneForSource(e.mainSeries());if(null===t)return;const s=this._chartWidget.paneByState(t);if(null!==s){const t=s.highlightedPriceAxis(),n=t.value();null!==n.axis&&n.owner===this._owner&&(t.setValue({owner:this._owner,axis:null}),e.lightUpdate(),this._highlighted=!1)}}}const fe=(0,_.registryContextType)(),Se=new be.TranslatedString("toggle log scale",(0,a.t)("toggle log scale"));const xe=(0,_.registryContextType)(),Ee=new be.TranslatedString("toggle auto scale",(0,a.t)("toggle auto scale"));const ye=(0,_.registryContextType)(),Me=new be.TranslatedString("toggle percentage scale",(0,a.t)("toggle percentage scale"));const we=(0,_.registryContextType)();var Te=s(42142),ke=s(54475),Re=s(49466),Ae=s(56450),Ne=s(70439);const De=new be.TranslatedString("change session",(0,a.t)("change session")),Be={hint:(0,a.t)("Session"),headerMenuText:(0,a.t)("Sessions")},We=(0,_.registryContextType)();class Fe extends n.PureComponent{constructor(e,t){super(e,t),(0,_.validateRegistry)(t,{chartWidget:o.any.isRequired,chartApiInstance:o.any.isRequired}),this.state={availableSessions:[]}}componentDidMount(){const{chartWidget:e}=this.context;e.withModel(null,()=>{const t=e.model();t.model().mainSeries().dataEvents().symbolResolved().subscribe(this,this.updateSessionButton),t.model().mainSeries().properties().childs().sessionId.subscribe(this,this.updateSessionButton),this.updateSessionButton()})}componentWillUnmount(){const{chartWidget:e}=this.context;e.withModel(null,()=>{const t=e.model();t.model().mainSeries().dataEvents().symbolResolved().unsubscribe(this,this.updateSessionButton),t.model().mainSeries().properties().childs().sessionId.unsubscribe(this,this.updateSessionButton)})}render(){const{className:e,withMenu:t}=this.props,{sessionName:s}=this.state;return n.createElement(h.ToolWidgetMenu,{arrow:!1,isDisabled:!t,content:s,className:e,closeOnClickOutside:!0,title:t?Be.hint:void 0,"data-name":"session-menu",verticalDropDirection:d.VerticalDropDirection.FromBottomToTop,verticalAttachEdge:d.VerticalAttachEdge.Top,onClick:this._trackClick
|
|
},this._menuItems())}updateSessionButton(){var e,t;const{chartWidget:s}=this.context;if(!s.model())return;const n=s.model().mainSeries().symbolInfo();if(null===n)return;const i=n.subsession_id,a=null!==(t=null===(e=n.subsessions)||void 0===e?void 0:e.filter(e=>!e.private))&&void 0!==t?t:[],o=a.find(e=>e.id===i);this.setState({sessionId:i,sessionName:(0,Ae.translateSessionShortDescription)((null==o?void 0:o.description)||""),availableSessions:a})}_menuItems(){if(!this.props.withMenu)return[];const{chartWidget:e}=this.context,{availableSessions:t}=this.state;if(!e.model())return[];const s=e.model().mainSeries(),i=[n.createElement(Re.ToolWidgetMenuSummary,{key:"header_menu_text",className:Ne.headerMenuText},Be.headerMenuText.toUpperCase())];for(const a of t){const t={category:"SetSession",event:a.id},o=()=>{e.model().setProperty(s.properties().childs().sessionId,a.id,De)};i.push(n.createElement(p.PopupMenuItem,{key:a.id,label:(0,Ae.translateSessionDescription)(a.description),isActive:this.state.sessionId===a.id,trackEventObject:t,onClick:o}))}return i}_trackClick(){0}}Fe.contextType=We;var Pe=s(99499),ze=s(11178),Le=s(43527);const Ie={extLabel:(0,a.t)("ext"),extHint:(0,a.t)("Extended Hours is available only for intraday charts"),percentageHint:(0,a.t)("Toggle Percentage"),logLabel:(0,a.t)("log",{context:"scale"}),logHint:(0,a.t)("Toggle Log Scale"),autoLabel:(0,a.t)("auto",{context:"scale"}),autoHint:(0,a.t)("Toggle Auto Scale"),fullscreenHint:(0,a.t)("Toggle Maximize Chart"),adjLabel:(0,a.t)("adj",{context:"adjustments"}),adjHint:(0,a.t)("Adjust data for dividends"),adjForDividendsOnlyHint:(0,a.t)("Main symbol data is adjusted for dividends only"),adjForSplitsOnlyHint:(0,a.t)("Main symbol data is adjusted for splits only"),backAdjustLabel:(0,a.t)("b-adj",{context:"adjustments"}),backAdjustHint:(0,a.t)("Adjust for contract changes"),settlementAsCloseLabel:(0,a.t)("set",{context:"adjustments"}),settlementAsCloseHint:(0,a.t)("Use settlement as close on daily interval")},He=(Ye=e=>n.createElement(ve.ToolWidgetButton,{text:Ie.logLabel,title:Ie.logHint,className:e.className,isActive:e.isLogarithm,isGrouped:!0,onClick:Qe(e.onClick,"log",e.isLogarithm),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,"data-name":"logarithm"}),(Oe=class extends n.PureComponent{constructor(e,t){super(e,t),this._priceScale=null,this._handleSelect=()=>{const e=this.context.chartWidget.model(),t=(0,v.ensureNotNull)(this.state.series),s=t.priceScale(),n=s.mode();t.priceScale().isLockScale()||e.setPriceScaleMode({log:!n.log},s,Se)},(0,_.validateRegistry)(t,{chartWidget:o.any.isRequired}),this.state={isActive:!1,series:null},this._priceAxisHighlighter=new Ce(this.context.chartWidget,()=>this._priceScale,"logarithm")}componentDidMount(){const e=this.context.chartWidget;e.withModel(null,()=>{const t=e.model().mainSeries(),s=t.priceScale();this._handleMainSeriesPriceScaleChanged(s),t.priceScaleChanged().subscribe(this,this._handleMainSeriesPriceScaleChanged),this._handleModeChanged({},s.mode()),this.setState({isActive:t.priceScale().isLog(),
|
|
series:t})})}componentWillUnmount(){const e=this.context.chartWidget;e.withModel(null,()=>{e.model().mainSeries().priceScaleChanged().unsubscribe(this,this._handleMainSeriesPriceScaleChanged)}),null!==this._priceScale&&(this._priceScale.modeChanged().unsubscribeAll(this),this._priceScale=null),this._priceAxisHighlighter.destroy()}render(){const{className:e}=this.props,{isActive:t,series:s}=this.state;return n.createElement(Ye,{...this._priceAxisHighlighter.handlers(),className:e,isLogarithm:t,isDisabled:null===s,onClick:this._handleSelect})}_handleMainSeriesPriceScaleChanged(e){null!==this._priceScale&&this._priceScale.modeChanged().unsubscribe(this,this._handleModeChanged),this._priceScale=e,this._priceScale.modeChanged().subscribe(this,this._handleModeChanged),this._handleModeChanged({},e.mode())}_handleModeChanged(e,t){Boolean(t.log)!==this.state.isActive&&this.setState({isActive:Boolean(t.log)})}}).contextType=fe,Oe);var Ye,Oe;const je=function(e){var t;return(t=class extends n.PureComponent{constructor(e,t){super(e,t),this._priceScale=null,this._handleSelect=()=>{const e=this.context.chartWidget.model(),t=(0,v.ensureNotNull)(this.state.series).priceScale(),s=t.mode();e.setPriceScaleMode({autoScale:!s.autoScale},t,Ee)},(0,_.validateRegistry)(t,{chartWidget:o.any.isRequired}),this.state={isActive:!1,series:null},this._priceAxisHighlighter=new Ce(this.context.chartWidget,()=>this._priceScale,"auto")}componentDidMount(){const e=this.context.chartWidget;e.withModel(null,()=>{const t=e.model().mainSeries(),s=t.priceScale();this._handleMainSeriesPriceScaleChanged(s),t.priceScaleChanged().subscribe(this,this._handleMainSeriesPriceScaleChanged),this._handleModeChanged({},s.mode()),this.setState({isActive:t.priceScale().isAutoScale(),series:t})})}componentWillUnmount(){const e=this.context.chartWidget;e.withModel(null,()=>{e.model().mainSeries().priceScaleChanged().unsubscribe(this,this._handleMainSeriesPriceScaleChanged)}),null!==this._priceScale&&(this._priceScale.modeChanged().unsubscribeAll(this),this._priceScale=null),this._priceAxisHighlighter.destroy()}render(){const{className:t}=this.props,{isActive:s,series:i}=this.state;return n.createElement(e,{...this._priceAxisHighlighter.handlers(),className:t,isAuto:s,isDisabled:null===i,onClick:this._handleSelect})}_handleMainSeriesPriceScaleChanged(e){null!==this._priceScale&&this._priceScale.modeChanged().unsubscribe(this,this._handleModeChanged),this._priceScale=e,this._priceScale.modeChanged().subscribe(this,this._handleModeChanged),this._handleModeChanged({},e.mode())}_handleModeChanged(e,t){Boolean(t.autoScale)!==this.state.isActive&&this.setState({isActive:Boolean(t.autoScale)})}}).contextType=xe,t}(e=>n.createElement(ve.ToolWidgetButton,{text:Ie.autoLabel,title:Ie.autoHint,className:e.className,isActive:e.isAuto,isGrouped:!0,onClick:Qe(e.onClick,"auto",e.isAuto),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,"data-name":"auto"})),Ge=function(e){var t;return(t=class extends n.PureComponent{constructor(e,t){super(e,t),this._priceScale=null,
|
|
this._handleSelect=()=>{const e=this.context.chartWidget.model(),t=(0,v.ensureNotNull)(this.state.series),s=t.priceScale(),n=s.mode();t.priceScale().isLockScale()||e.setPriceScaleMode({percentage:!n.percentage},s,Me)},(0,_.validateRegistry)(t,{chartWidget:o.any.isRequired}),this.state={isActive:!1,series:null},this._priceAxisHighlighter=new Ce(this.context.chartWidget,()=>this._priceScale,"percentage")}componentDidMount(){const e=this.context.chartWidget;e.withModel(null,()=>{const t=e.model().mainSeries(),s=t.priceScale();this._handleMainSeriesPriceScaleChanged(s),t.priceScaleChanged().subscribe(this,this._handleMainSeriesPriceScaleChanged),this._handleScaleChange({},s.mode()),this.setState({isActive:t.priceScale().isPercentage(),series:t})})}componentWillUnmount(){const e=this.context.chartWidget;e.withModel(null,()=>{e.model().mainSeries().priceScaleChanged().unsubscribe(this,this._handleMainSeriesPriceScaleChanged)}),null!==this._priceScale&&(this._priceScale.modeChanged().unsubscribeAll(this),this._priceScale=null),this._priceAxisHighlighter.destroy()}render(){const{className:t}=this.props,{isActive:s,series:i}=this.state;return n.createElement(e,{...this._priceAxisHighlighter.handlers(),className:t,isPercentage:s,isDisabled:null===i,onClick:this._handleSelect})}_handleMainSeriesPriceScaleChanged(e){null!==this._priceScale&&this._priceScale.modeChanged().unsubscribe(this,this._handleScaleChange),this._priceScale=e,this._priceScale.modeChanged().subscribe(this,this._handleScaleChange),this._handleScaleChange({},e.mode())}_handleScaleChange(e,t){Boolean(t.percentage)!==this.state.isActive&&this.setState({isActive:Boolean(t.percentage)})}}).contextType=ye,t}(e=>n.createElement(ve.ToolWidgetButton,{icon:Pe,title:Ie.percentageHint,className:e.className,isActive:e.isPercentage,isDisabled:e.isDisabled,isGrouped:!0,onClick:Qe(e.onClick,"percent",e.isPercentage),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,"data-name":"percentage"}));const Ze=(0,q.hotKeySerialize)({keys:[(0,J.humanReadableModifiers)(J.Modifiers.Alt,!1),"Enter"],text:"{0} + {1}"}),Ve=function(e){var t;return(t=class extends n.PureComponent{constructor(e,t){super(e,t),this._handleClick=e=>{const{resizerDetacher:t,chartWidgetCollection:s}=this.context;e.shiftKey&&t.detachable.value()?t.detach():this.state.isFullscreen?t.exitFullscreen():t.requestFullscreen()},this._handleLayoutChange=e=>{this.setState({isFullscreen:e})},this._handlePhoneSize=()=>{0},(0,_.validateRegistry)(t,{chartWidgetCollection:o.any.isRequired,resizerDetacher:o.any.isRequired});const{resizerDetacher:s}=t;this.state={isFullscreen:s.fullscreen.value(),isChangeLayoutButton:this._isChangeLayoutButton()}}componentDidMount(){const{resizerDetacher:e,chartWidgetCollection:t}=this.context,{mobileChangeLayoutEnabled:s}=this.props;e.fullscreen.subscribe(this._handleLayoutChange)}componentWillUnmount(){const{resizerDetacher:e,chartWidgetCollection:t}=this.context,{mobileChangeLayoutEnabled:s}=this.props;e.fullscreen.unsubscribe(this._handleLayoutChange)}render(){
|
|
const{className:t}=this.props,{isFullscreen:s,isChangeLayoutButton:i}=this.state;return n.createElement(e,{className:t,isFullscreen:s,onClick:this._handleClick})}_isChangeLayoutButton(){return!1}}).contextType=we,t}(e=>n.createElement(ve.ToolWidgetButton,{icon:ze,title:Ie.fullscreenHint,className:e.className,isActive:e.isFullscreen,onClick:Qe(e.onClick,"maximize chart",e.isFullscreen),"data-tooltip-hotkey":Ze,"data-name":"fullscreen"})),Ue={properties:!0,fullscreen:!0,preventPhoneLayout:!0},qe={fullscreen:Number.MIN_SAFE_INTEGER,preventPhoneLayout:Number.MIN_SAFE_INTEGER,properties:Number.MIN_SAFE_INTEGER,separator:-2,timeZones:-1,auto:0,logarithm:1,percentage:2,session:3,adj:4,backAdj:5,settlementAsClose:6},Je=(()=>{const e=new Map;return e.set(He,"logarithm"),e.set(Ge,"percentage"),e.set(je,"auto"),e.set(Fe,"session"),e.set(Ve,"fullscreen"),e})();function Ke(e){0}function Qe(e,t,s){return t=>{e(t)}}const Xe={dateRangeMode:"hidden",separator:!0,timeZones:!0,fullscreen:!0,preventPhoneLayout:!0,properties:!0,auto:!0,logarithm:!0,percentage:!0,session:!0,adj:!0,backAdj:!0,settlementAsClose:!0},$e=(0,_.registryContextType)();class et extends n.PureComponent{constructor(e,t){var s,a;super(e,t),this._timezoneButtonRef=null,this._layout=Object.assign({},Xe),this._raf=null,this._toolbar=null,this._rangeExpanded=null,this._rangeCollapsed=null,this._seriesComponents={},this._injector=(s=()=>this._layout,a=(e,t)=>this._seriesComponents[t]=e,(e,t,i)=>{if(n.isValidElement(e)&&"string"!=typeof e.type){const{props:o}=e;if("string"==typeof o.className){const l={className:r(o.className,0===t&&Le.first,t===i.length-1&&Le.last)},c=s(),h=(0,v.ensureDefined)(Je.get(e.type));return n.createElement("div",{key:null===e.key?void 0:e.key,className:r(Le.inline,c[h]&&Le.collapsed),ref:e=>a(e,h),onClick:()=>Ke()},n.cloneElement(e,l))}}return e}),this._updateButtonsVisibility=()=>{const{chartWidget:e}=this.context,t=e.model().model(),s=t.mainSeries(),n=s.symbolInfo(),i=!s.isDWMProperty().value();if(s.symbolResolvingActive().value())return void this._setStateWithResize({intervalAllowsSessionButton:i});const a=((null==n?void 0:n.subsessions)||[]).filter(e=>!e.private).length>1;this._setStateWithResize({intervalAllowsSessionButton:i,symbolAllowsSessionButton:a})},this._handleResize=()=>{null===this._raf&&(this._raf=requestAnimationFrame(()=>{const e=this._layout,t=(0,v.ensureNotNull)(this._toolbar),s=(0,v.ensureNotNull)(this._rangeExpanded),n=(a=function(e){const t={};return Object.keys(e).forEach(s=>{const n=e[s];if(null!==n){const e=i.findDOMNode(n);null!==e&&(t[s]=e)}}),t}(this._seriesComponents),Object.keys(a).map(e=>({name:e,width:a[e].offsetWidth})).sort((e,t)=>qe[e.name]-qe[t.name]));var a;const o=t.offsetWidth,r=n.reduce((e,t)=>e+t.width,0),l=s.offsetWidth,c=!Boolean(s.textContent)||o-r-l<=0?"collapsed":"expanded";if(Object.assign(e,{dateRangeMode:c}),"expanded"!==c){const t=o-(0,v.ensureNotNull)(this._rangeCollapsed).offsetWidth-0;let s=0,i=0;for(const a of n)s+=a.width,a.name in Ue?(i+=a.width,Object.assign(e,{[a.name]:!1
|
|
})):Object.assign(e,{[a.name]:t<=s});t<=i&&Object.assign(e,{dateRangeMode:"hidden"})}else Object.assign(e,{separator:!1,timeZones:!1,fullscreen:!1,preventPhoneLayout:!1,properties:!1,auto:!1,logarithm:!1,percentage:!1,session:!1,adj:!1,settlementAsClose:!1,backAdj:!1});this._applyResizing(),this._raf=null}))},this._handleTimezoneButtonRef=e=>{this._timezoneButtonRef=e},this._handleMeasure=()=>{null!==this._toolbar&&this.resizeUI()},this._handleFullscreenableChange=e=>{this._setStateWithResize({isFullscreenable:e})},this._handlePreventPhoneLayoutButtonVisibility=()=>{0},this._handleToolbarRef=e=>this._toolbar=e,this._handleRangeCollapsedRef=e=>this._rangeCollapsed=e,this._handleRangeExpandedRef=e=>this._rangeExpanded=e,this._handleTimeZonesRef=e=>{this._seriesComponents.timeZones=e},this._handleSessionsRef=e=>{this._seriesComponents.session=e},this._handleSeparatorRef=e=>{this._seriesComponents.separator=e},(0,_.validateRegistry)(t,{onContentBoxChanged:o.any.isRequired,chartApiInstance:o.any.isRequired,chartWidget:o.any.isRequired,chartWidgetCollection:o.any.isRequired,resizerDetacher:o.any.isRequired});const{resizerDetacher:l}=this.context;this.state={isFullscreenable:l.fullscreenable.value(),isPreventPhoneLayoutButton:this._isPreventPhoneLayoutButton()}}componentDidMount(){const{onContentBoxChanged:e,resizerDetacher:t,chartWidgetCollection:s,chartWidget:n}=this.context;e.subscribe(this,this._handleResize),t.fullscreenable.subscribe(this._handleFullscreenableChange),n.withModel(null,()=>{const e=n.model(),t=e.model();e.mainSeries().isDWMProperty().subscribe(this,this._updateButtonsVisibility),t.symbolSourceResolvingActive().subscribe(this._updateButtonsVisibility),t.symbolSourceCollectionChanged().subscribe(this,this._updateButtonsVisibility),this._updateButtonsVisibility()}),this.updateTimezonesButton(),this.resizeUI()}componentWillUnmount(){const{onContentBoxChanged:e,resizerDetacher:t,chartWidgetCollection:s,chartWidget:n}=this.context;e.unsubscribe(this,this._handleResize),t.fullscreenable.unsubscribe(this._handleFullscreenableChange),n.withModel(null,()=>{const e=n.model(),t=e.model();e.mainSeries().isDWMProperty().unsubscribe(this,this._updateButtonsVisibility),e.mainSeries().isBackAdjustmentForbiddenProperty().unsubscribe(this,this._updateButtonsVisibility),e.mainSeries().isSettlementAsCloseForbiddenProperty().unsubscribe(this,this._updateButtonsVisibility),t.symbolSourceCollectionChanged().unsubscribe(this,this._updateButtonsVisibility),t.symbolSourceResolvingActive().unsubscribe(this._updateButtonsVisibility)}),null!==this._raf&&(cancelAnimationFrame(this._raf),this._raf=null)}render(){const e=this._layout,{timeFramesWidgetEnabled:t,timeWidgetEnabled:s,percentageScaleButtonEnabled:i,logScaleButtonEnabled:a,autoScaleButtonEnabled:o,fullscreenButtonEnabled:h}=this.props;return n.createElement("div",{className:Le.toolbar,ref:this._handleToolbarRef,onContextMenu:ke.preventDefault},t&&n.createElement(Te.FragmentMap,null,n.createElement("div",{
|
|
className:r(Le.dateRangeWrapper,"collapsed"!==e.dateRangeMode&&Le.collapsed),ref:this._handleRangeCollapsedRef},n.createElement("div",{className:r(Le.dateRangeCollapsed)},n.createElement(z,{goToDateButton:this.props.goToDateEnabled}))),n.createElement(l,{onMeasure:this._handleMeasure},n.createElement("div",{className:r(Le.dateRangeWrapper,"expanded"!==e.dateRangeMode&&Le.collapsed),ref:this._handleRangeExpandedRef},n.createElement("div",{className:r(Le.dateRangeExpanded)},n.createElement(V,{onSelectRange:this._trackRangeButtonClick}),this.props.goToDateEnabled&&n.createElement(ge,null),this.props.goToDateEnabled&&n.createElement(te,null))))),n.createElement("div",{className:Le.seriesControlWrapper},s&&n.createElement(l,{onMeasure:this._handleMeasure},n.createElement("div",{className:r(Le.inline,e.timeZones&&Le.collapsed),ref:this._handleTimeZonesRef},n.createElement("div",{className:Le.inline,onClick:this._trackTimezonesButtonClick},n.createElement(me,{className:Le.timezone,withMenu:this.props.timezoneMenuEnabled,ref:this._handleTimezoneButtonRef})))),this.props.sessionIdButtonEnabled&&this.state.symbolAllowsSessionButton&&this.state.intervalAllowsSessionButton&&n.createElement(l,{onMeasure:this._handleMeasure},n.createElement("div",{className:r(Le.inline,e.session&&Le.collapsed),ref:this._handleSessionsRef},n.createElement("div",{className:Le.inline},n.createElement(Fe,{className:Le.session,withMenu:this.props.sessionIdButtonEnabled})))),n.createElement("div",{ref:this._handleSeparatorRef,className:r(Le.inline,e.separator&&Le.collapsed)},n.createElement(ge,null)),n.createElement(Te.FragmentMap,{map:this._injector},!1,!1,!1,i&&!c.enabled("fundamental_widget")&&n.createElement(Ge,{className:Le.icon}),a&&n.createElement(He,{className:Le.item}),o&&n.createElement(je,{className:Le.item}),h&&this.state.isFullscreenable&&n.createElement(Ve,{className:Le.icon,mobileChangeLayoutEnabled:this.props.mobileChangeLayoutEnabled}),!1)))}updateTimezonesButton(){null!==this._timezoneButtonRef&&this._timezoneButtonRef.updateTimezonesButton()}resizeUI(){this._handleResize()}_trackRangeButtonClick(e){0}_trackTimezonesButtonClick(){Ke()}_setStateWithResize(e){Object.assign(this._layout,Xe),this._applyResizing(),this.setState(e,()=>this._handleResize())}_applyResizing(){const{dateRangeMode:e,...t}=this._layout;this._rangeExpanded&&this._rangeExpanded.classList.toggle(Le.collapsed,"expanded"!==e),this._rangeCollapsed&&this._rangeCollapsed.classList.toggle(Le.collapsed,"collapsed"!==e),Object.keys(t).forEach(e=>{const s=e,n=this._seriesComponents[s];n&&n.classList.toggle(Le.collapsed,t[s])})}_isPreventPhoneLayoutButton(){return!1}}et.contextType=$e;const tt={onContentBoxChanged:o.any,computeContentBox:o.any,chartWidget:o.any,chartApiInstance:o.any,chartWidgetCollection:o.any,resizerDetacher:o.any,availableTimeFrames:o.any};class st extends n.PureComponent{constructor(e){super(e),this._setActiveChart=e=>{this._defineRegistry(e),this.setState({chartWidget:e})};const t=this.props.chartWidgetCollection.activeChartWidget.value();this.state={
|
|
chartWidget:t},this._defineRegistry(t)}componentDidMount(){this.props.chartWidgetCollection.activeChartWidget.subscribe(this._setActiveChart)}componentWillUnmount(){this.props.chartWidgetCollection.activeChartWidget.unsubscribe(this._setActiveChart)}render(){const{chartWidget:e}=this.state;if(!e)return null;const{options:t}=this.props,s={timeFramesWidgetEnabled:t.timeFramesWidgetEnabled,goToDateEnabled:t.timeFramesWidget.goToDateEnabled,timeWidgetEnabled:t.timeWidgetEnabled,timezoneMenuEnabled:t.timeWidget&&t.timeWidget.timezoneMenuEnabled,sessionIdButtonEnabled:t.sessionIdButtonEnabled,backAdjustmentButtonEnabled:t.backAdjustmentButtonEnabled,settlementAsCloseButtonEnabled:t.settlementAsCloseButtonEnabled,adjustForDividendsButtonEnabled:t.adjustForDividendsButtonEnabled,logScaleButtonEnabled:t.logScaleButtonEnabled,percentageScaleButtonEnabled:t.percentageScaleButtonEnabled,autoScaleButtonEnabled:t.autoScaleButtonEnabled,fullscreenButtonEnabled:t.fullscreenButtonEnabled,mobileChangeLayoutEnabled:t.mobileChangeLayoutEnabled};return n.createElement(_.RegistryProvider,{validation:tt,value:this._registry},n.createElement(et,{key:e.id(),...s}))}_defineRegistry(e){const{onContentBoxChanged:t,computeContentBox:s,chartApiInstance:n,chartWidgetCollection:i,options:{timeFramesWidgetEnabled:a,timeFramesWidget:o}}=this.props,r=a?o.availableTimeFrames:void 0;this._registry={onContentBoxChanged:t,computeContentBox:s,chartWidget:e,availableTimeFrames:r,chartApiInstance:n,chartWidgetCollection:i,resizerDetacher:e.getResizerDetacher()}}}class nt{constructor(e,t,s,a,o,r,l){this._container=e;const c=n.createElement(st,{onContentBoxChanged:t,computeContentBox:s,chartWidgetCollection:a,chartApiInstance:o,chartWidgetOptions:r,options:l});i.render(c,e),e.setAttribute("data-initialized","true")}destroy(){i.unmountComponentAtNode(this._container),this._container.removeAttribute("data-initialized")}}},37669:(e,t,s)=>{"use strict";s.d(t,{hasNewHeaderToolbarStyles:()=>n});s(67337);const n=!1},55402:(e,t,s)=>{"use strict";s.d(t,{validateRegistry:()=>r,RegistryProvider:()=>l,registryContextType:()=>c});var n=s(59496),i=s(19036),a=s.n(i);const o=n.createContext({});function r(e,t){a().checkPropTypes(t,e,"context","RegistryContext")}function l(e){const{validation:t,value:s}=e;return r(s,t),n.createElement(o.Provider,{value:s},e.children)}function c(){return o}},56450:(e,t,s)=>{"use strict";s.d(t,{translateSessionDescription:()=>a,translateSessionShortDescription:()=>r});var n=s(28353);const i=new Map([["Premarket",(0,n.t)("Premarket",{context:"sessions"})],["Postmarket",(0,n.t)("Postmarket",{context:"sessions"})],["Regular Trading Hours",(0,n.t)("Regular trading hours",{context:"sessions"})],["Extended Trading Hours",(0,n.t)("Extended trading hours",{context:"sessions"})],["Electronic Trading Hours",(0,n.t)("Electronic trading hours",{context:"sessions"})]]);function a(e){var t;return null!==(t=i.get(e))&&void 0!==t?t:e}const o=new Map([["Premarket",(0,n.t)("PRE",{context:"sessions"})],["Postmarket",(0,n.t)("POST",{context:"sessions"
|
|
})],["Regular Trading Hours",(0,n.t)("RTH",{context:"sessions"})],["Extended Trading Hours",(0,n.t)("ETH",{context:"sessions"})],["Electronic Trading Hours",(0,n.t)("ETH",{context:"sessions"})]]);function r(e){var t;return null!==(t=o.get(e))&&void 0!==t?t:e}},42142:(e,t,s)=>{"use strict";s.d(t,{FragmentMap:()=>i});var n=s(59496);function i(e){if(e.map){return n.Children.toArray(e.children).map(e.map)}return e.children}},99025:(e,t,s)=>{"use strict";s.d(t,{Hint:()=>r});var n=s(59496),i=s(97754),a=s.n(i),o=s(19119);function r(e){const{text:t="",className:s}=e;return n.createElement("span",{className:a()(o.shortcut,s)},t)}},23829:(e,t,s)=>{"use strict";s.d(t,{ContextMenuItem:()=>p});var n=s(59496),i=s(97754),a=s.n(i),o=s(9745),r=s(26996),l=s(54627),c=s(99025),h=s(86440),d=s(4585),u=s(74471),m=s(61999);function p(e){const{isTitle:t,isLoading:s,isHovered:i,active:p,checkable:g,disabled:v,checked:b,icon:_,iconChecked:C,hint:f,subItems:S,label:x,onClick:E,children:y,toolbox:M,jsxLabel:w,size:T="normal"}=e,k=(0,n.useContext)(l.EmptyIconsContext),R=!!S.length;return s?n.createElement("li",{className:a()(m.item,m.loading,m[T])},n.createElement(r.Loader,null)):n.createElement("li",{className:a()(m.item,m.interactive,t&&m.title,v&&m.disabled,i&&m.hovered,p&&m.active,k&&m.emptyIcons,m[T]),onClick:E},n.createElement(o.Icon,{className:a()(m.icon),icon:function(){if(g&&b)return C||_||h;return _}()}),n.createElement("span",{className:a()(m.label)},null!=w?w:x),!!M&&n.createElement(o.Icon,{onClick:function(){M&&M.action()},className:m.remove,icon:u}),!R&&f&&n.createElement(c.Hint,{className:m.shortcut,text:f}),R&&n.createElement(o.Icon,{className:m.nested,icon:d}),y)}},54627:(e,t,s)=>{"use strict";s.d(t,{EmptyIconsContext:()=>n});const n=s(59496).createContext(!1)},37558:(e,t,s)=>{"use strict";s.d(t,{DrawerManager:()=>i,DrawerContext:()=>a});var n=s(59496);class i extends n.PureComponent{constructor(e){super(e),this._addDrawer=()=>{const e=this.state.currentDrawer+1;return this.setState({currentDrawer:e}),e},this._removeDrawer=()=>{const e=this.state.currentDrawer-1;return this.setState({currentDrawer:e}),e},this.state={currentDrawer:0}}render(){return n.createElement(a.Provider,{value:{addDrawer:this._addDrawer,removeDrawer:this._removeDrawer,currentDrawer:this.state.currentDrawer}},this.props.children)}}const a=n.createContext(null)},41590:(e,t,s)=>{"use strict";s.d(t,{Drawer:()=>m});var n=s(59496),i=s(88537),a=s(97754),o=s(59142),r=s(43989),l=s(65718),c=s(37558),h=s(49483),d=s(29197),u=s(66998);function m(e){const{position:t="Bottom",onClose:s,children:m,className:p,theme:g=u}=e,v=(0,i.ensureNotNull)((0,n.useContext)(c.DrawerContext)),[b,_]=(0,n.useState)(0),C=(0,n.useRef)(null),f=(0,n.useContext)(d.CloseDelegateContext);return(0,n.useEffect)(()=>{const e=(0,i.ensureNotNull)(C.current);return e.focus({preventScroll:!0}),f.subscribe(v,s),0===v.currentDrawer&&(0,r.setFixedBodyState)(!0),h.CheckMobile.iOS()&&(0,o.disableBodyScroll)(e),_(v.addDrawer()),()=>{f.unsubscribe(v,s);const t=v.removeDrawer();h.CheckMobile.iOS()&&(0,
|
|
o.enableBodyScroll)(e),0===t&&(0,r.setFixedBodyState)(!1)}},[]),n.createElement(l.Portal,null,n.createElement("div",{className:a(u.wrap,u["position"+t])},b===v.currentDrawer&&n.createElement("div",{className:u.backdrop,onClick:s}),n.createElement("div",{className:a(u.drawer,g.drawer,u["position"+t],p),ref:C,tabIndex:-1,"data-name":e["data-name"]},m)))}},1109:(e,t,s)=>{"use strict";s.d(t,{Separator:()=>o});var n=s(59496),i=s(97754),a=s(91626);function o(e){return n.createElement("div",{className:i(a.separator,e.className)})}},16396:(e,t,s)=>{"use strict";s.d(t,{DEFAULT_POPUP_MENU_ITEM_THEME:()=>c,PopupMenuItem:()=>u});var n=s(59496),i=s(97754),a=s(59064),o=s(51768),r=s(90186),l=s(23576);const c=l;function h(e){const{reference:t,...s}=e,i={...s,ref:t};return n.createElement(e.href?"a":"div",i)}function d(e){e.stopPropagation()}function u(e){const{id:t,role:s,"aria-selected":c,className:u,title:m,labelRowClassName:p,labelClassName:g,shortcut:v,forceShowShortcuts:b,icon:_,isActive:C,isDisabled:f,isHovered:S,appearAsDisabled:x,label:E,link:y,showToolboxOnHover:M,target:w,rel:T,toolbox:k,reference:R,onMouseOut:A,onMouseOver:N,suppressToolboxClick:D=!0,theme:B=l}=e,W=(0,r.filterDataProps)(e),F=(0,n.useRef)(null);return n.createElement(h,{...W,id:t,role:s,"aria-selected":c,className:i(u,B.item,_&&B.withIcon,{[B.isActive]:C,[B.isDisabled]:f||x,[B.hovered]:S}),title:m,href:y,target:w,rel:T,reference:function(e){F.current=e,"function"==typeof R&&R(e);"object"==typeof R&&(R.current=e)},onClick:function(t){const{dontClosePopup:s,onClick:n,onClickArg:i,trackEventObject:r}=e;if(f)return;r&&(0,o.trackEvent)(r.category,r.event,r.label);n&&n(i,t);s||(0,a.globalCloseMenu)()},onContextMenu:function(t){const{trackEventObject:s,trackRightClick:n}=e;s&&n&&(0,o.trackEvent)(s.category,s.event,s.label+"_rightClick")},onMouseUp:function(t){const{trackEventObject:s,trackMouseWheelClick:n}=e;if(1===t.button&&y&&s){let e=s.label;n&&(e+="_mouseWheelClick"),(0,o.trackEvent)(s.category,s.event,e)}},onMouseOver:N,onMouseOut:A},void 0!==_&&n.createElement("div",{className:B.icon,dangerouslySetInnerHTML:{__html:_}}),n.createElement("div",{className:i(B.labelRow,p)},n.createElement("div",{className:i(B.label,g)},E)),(void 0!==v||b)&&n.createElement("div",{className:B.shortcut},(P=v)&&P.split("+").join(" + ")),void 0!==k&&n.createElement("div",{onClick:D?d:void 0,className:i(B.toolbox,{[B.showOnHover]:M})},k));var P}},51613:(e,t,s)=>{"use strict";s.d(t,{PopupMenuSeparator:()=>r});var n=s(59496),i=s(97754),a=s.n(i),o=s(524);function r(e){const{size:t="normal",className:s}=e;return n.createElement("div",{className:a()(o.separator,"small"===t&&o.small,"normal"===t&&o.normal,"large"===t&&o.large,s)})}},64205:(e,t,s)=>{"use strict";s.d(t,{DEFAULT_SLIDER_THEME:()=>r,SliderItem:()=>l,factory:()=>c});var n=s(59496),i=s(97754),a=s(88537),o=s(37740);const r=o;function l(e){const t=i(e.className,o.tab,{[o.active]:e.isActive,[o.disabled]:e.isDisabled,[o.defaultCursor]:!!e.shouldUseDefaultCursor,[o.noBorder]:!!e.noBorder});return n.createElement("div",{className:t,
|
|
onClick:e.onClick,ref:e.reference,"data-type":"tab-item","data-value":e.value,"data-name":"tab-item-"+e.value.toString().toLowerCase()},e.children)}function c(e){return class extends n.PureComponent{constructor(){super(...arguments),this.activeTab={current:null}}componentDidUpdate(){(0,a.ensureNotNull)(this._slider).style.transition="transform 350ms",this._componentDidUpdate()}componentDidMount(){this._componentDidUpdate()}render(){const{className:t}=this.props,s=this._generateTabs();return n.createElement("div",{className:i(t,o.tabs),"data-name":this.props["data-name"]},s,n.createElement(e,{reference:e=>{this._slider=e}}))}_generateTabs(){return this.activeTab.current=null,n.Children.map(this.props.children,e=>{const t=e,s=Boolean(t.props.isActive),i={reference:e=>{s&&(this.activeTab.current=e),t.props.reference&&t.props.reference(e)}};return n.cloneElement(t,i)})}_componentDidUpdate(){const e=(0,a.ensureNotNull)(this._slider).style;if(this.activeTab.current){const t=this.activeTab.current.offsetWidth,s=this.activeTab.current.offsetLeft;e.transform=`translateX(${s}px)`,e.width=t+"px",e.opacity="1"}else e.opacity="0"}}}c((function(e){return n.createElement("div",{className:o.slider,ref:e.reference})}))},10381:(e,t,s)=>{"use strict";s.d(t,{ToolWidgetCaret:()=>l});var n=s(59496),i=s(97754),a=s(9745),o=s(40367),r=s(81268);function l(e){const{dropped:t,className:s}=e;return n.createElement(a.Icon,{className:i(s,o.icon,{[o.dropped]:t}),icon:r})}},81268:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 8" width="16" height="8"><path fill="currentColor" d="M0 1.475l7.396 6.04.596.485.593-.49L16 1.39 14.807 0 7.393 6.122 8.58 6.12 1.186.08z"/></svg>'},4585:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M8 5l3.5 3.5L8 12"/></svg>'},11178:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18"><path fill="none" stroke="currentColor" d="M11 1.5h3.5a2 2 0 0 1 2 2V7m0 5v2.5a2 2 0 0 1-2 2H11m-4 0H3.5a2 2 0 0 1-2-2V11m0-4V3.5a2 2 0 0 1 2-2H7"/></svg>'},99499:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14"><g fill="none" stroke="currentColor"><circle cx="3.5" cy="3.5" r="2"/><circle cx="10.5" cy="10.5" r="2"/><path stroke-linecap="square" d="M9.5 1.5l-5 11"/></g></svg>'},86440:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M7 15l5 5L23 9"/></svg>'},74471:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.7 9l4.65-4.65-.7-.7L9 8.29 4.35 3.65l-.7.7L8.29 9l-4.64 4.65.7.7L9 9.71l4.65 4.64.7-.7L9.71 9z"/></svg>'},52360:e=>{
|
|
e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28" fill="none"><path stroke="currentColor" d="M5.5 13v-2.5m8.5 11h6.5a2 2 0 0 0 2-2v-9m-17 0v-2c0-1.1.9-2 2-2h13a2 2 0 0 1 2 2v2m-17 0h17"/><path fill="currentColor" d="M10 4h1v4h-1V4zM17 4h1v4h-1V4z"/><path stroke="currentColor" d="M4 18.5h7.5m0 0L8 22m3.5-3.5L8 15"/></svg>'},68139:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M1.5 8V6.5m7.5 9h5.5a2 2 0 0 0 2-2v-7m-15 0v-2c0-1.1.9-2 2-2h11a2 2 0 0 1 2 2v2m-15 0h15"/><path fill="currentColor" d="M5 1h1v3H5V1zM12 1h1v3h-1V1z"/><path stroke="currentColor" d="M0 12.5h7.5m0 0L4 16m3.5-3.5L4 9"/></svg>'}}]); |