(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[3179],{5808:e=>{e.exports={menuWrap:"menuWrap-Kq3ruQo8",isMeasuring:"isMeasuring-Kq3ruQo8",scrollWrap:"scrollWrap-Kq3ruQo8",momentumBased:"momentumBased-Kq3ruQo8",menuBox:"menuBox-Kq3ruQo8",isHidden:"isHidden-Kq3ruQo8"}},43010:(e,t,n)=>{"use strict";n.d(t,{useIsomorphicLayoutEffect:()=>i});var s=n(50959);function i(e,t){("undefined"==typeof window?s.useEffect:s.useLayoutEffect)(e,t)}},27267:(e,t,n)=>{"use strict";function s(e,t,n,s,i){function o(i){if(e>i.timeStamp)return;const o=i.target;void 0!==n&&null!==t&&null!==o&&o.ownerDocument===s&&(t.contains(o)||n(i))}return i.click&&s.addEventListener("click",o,!1),i.mouseDown&&s.addEventListener("mousedown",o,!1),i.touchEnd&&s.addEventListener("touchend",o,!1),i.touchStart&&s.addEventListener("touchstart",o,!1),()=>{s.removeEventListener("click",o,!1),s.removeEventListener("mousedown",o,!1),s.removeEventListener("touchend",o,!1),s.removeEventListener("touchstart",o,!1)}}n.d(t,{addOutsideEventListener:()=>s})},36383:(e,t,n)=>{"use strict";n.d(t,{useOutsideEvent:()=>r});var s=n(50959),i=n(43010),o=n(27267);function r(e){const{click:t,mouseDown:n,touchEnd:r,touchStart:a,handler:l,reference:u}=e,c=(0,s.useRef)(null),d=(0,s.useRef)("undefined"==typeof window?0:new window.CustomEvent("timestamp").timeStamp);return(0,i.useIsomorphicLayoutEffect)((()=>{const e={click:t,mouseDown:n,touchEnd:r,touchStart:a},s=u?u.current:c.current;return(0,o.addOutsideEventListener)(d.current,s,l,document,e)}),[t,n,r,a,l]),u||c}},9745:(e,t,n)=>{"use strict";n.d(t,{Icon:()=>i});var s=n(50959);const i=s.forwardRef(((e,t)=>{const{icon:n="",title:i,ariaLabel:o,ariaLabelledby:r,ariaHidden:a,...l}=e,u=!!(i||o||r);return s.createElement("span",{role:"img",...l,ref:t,"aria-label":o,"aria-labelledby":r,"aria-hidden":a||!u,title:i,dangerouslySetInnerHTML:{__html:n}})}))},83021:(e,t,n)=>{"use strict";n.d(t,{SubmenuContext:()=>i,SubmenuHandler:()=>o});var s=n(50959);const i=s.createContext(null);function o(e){const[t,n]=(0,s.useState)(null),o=(0,s.useRef)(null),r=(0,s.useRef)(new Map);return(0,s.useEffect)((()=>()=>{null!==o.current&&clearTimeout(o.current)}),[]),s.createElement(i.Provider,{value:{current:t,setCurrent:function(e){null!==o.current&&(clearTimeout(o.current),o.current=null);null===t?n(e):o.current=setTimeout((()=>{o.current=null,n(e)}),100)},registerSubmenu:function(e,t){return r.current.set(e,t),()=>{r.current.delete(e)}},isSubmenuNode:function(e){return Array.from(r.current.values()).some((t=>t(e)))}}},e.children)}},19250:(e,t,n)=>{"use strict";n.d(t,{Portal:()=>u,PortalContext:()=>c});var s=n(50959),i=n(32227),o=n(25931),r=n(67961),a=n(34811),l=n(99663);class u extends s.PureComponent{constructor(){super(...arguments),this._uuid=(0,o.nanoid)()}componentWillUnmount(){this._manager().removeWindow(this._uuid)}render(){const e=this._manager().ensureWindow(this._uuid,this.props.layerOptions);e.style.top=this.props.top||"",e.style.bottom=this.props.bottom||"",e.style.left=this.props.left||"",e.style.right=this.props.right||"",
e.style.pointerEvents=this.props.pointerEvents||"";const t=this.props.className;return t&&("string"==typeof t?e.classList.add(t):e.classList.add(...t)),this.props.shouldTrapFocus&&!e.hasAttribute(a.FOCUS_TRAP_DATA_ATTRIBUTE)&&e.setAttribute(a.FOCUS_TRAP_DATA_ATTRIBUTE,"true"),this.props["aria-hidden"]&&e.setAttribute("aria-hidden","true"),i.createPortal(s.createElement(c.Provider,{value:this},this.props.children),e)}moveToTop(){this._manager().moveToTop(this._uuid)}_manager(){return null===this.context?(0,r.getRootOverlapManager)():this.context}}u.contextType=l.SlotContext;const c=s.createContext(null)},99663:(e,t,n)=>{"use strict";n.d(t,{Slot:()=>i,SlotContext:()=>o});var s=n(50959);class i extends s.Component{shouldComponentUpdate(){return!1}render(){return s.createElement("div",{style:{position:"fixed",zIndex:150,left:0,top:0},ref:this.props.reference})}}const o=s.createContext(null)},67961:(e,t,n)=>{"use strict";n.d(t,{OverlapManager:()=>r,getRootOverlapManager:()=>l});var s=n(50151),i=n(34811);class o{constructor(){this._storage=[]}add(e){this._storage.push(e)}remove(e){this._storage=this._storage.filter((t=>e!==t))}has(e){return this._storage.includes(e)}getItems(){return this._storage}}class r{constructor(e=document){this._storage=new o,this._windows=new Map,this._index=0,this._document=e,this._container=e.createDocumentFragment()}setContainer(e){const t=this._container,n=null===e?this._document.createDocumentFragment():e;!function(e,t){Array.from(e.childNodes).forEach((e=>{e.nodeType===Node.ELEMENT_NODE&&t.appendChild(e)}))}(t,n),this._container=n}registerWindow(e){this._storage.has(e)||this._storage.add(e)}ensureWindow(e,t={position:"fixed",direction:"normal"}){const n=this._windows.get(e);if(void 0!==n)return n;this.registerWindow(e);const s=this._document.createElement("div");if(s.style.position=t.position,s.style.zIndex=this._index.toString(),s.dataset.id=e,void 0!==t.index){const e=this._container.childNodes.length;if(t.index>=e)this._container.appendChild(s);else if(t.index<=0)this._container.insertBefore(s,this._container.firstChild);else{const e=this._container.childNodes[t.index];this._container.insertBefore(s,e)}}else"reverse"===t.direction?this._container.insertBefore(s,this._container.firstChild):this._container.appendChild(s);return this._windows.set(e,s),++this._index,s}unregisterWindow(e){this._storage.remove(e);const t=this._windows.get(e);void 0!==t&&(null!==t.parentElement&&t.parentElement.removeChild(t),this._windows.delete(e))}getZindex(e){const t=this.ensureWindow(e);return parseInt(t.style.zIndex||"0")}moveLastWindowToTop(){const e=this._storage.getItems(),t=e[e.length-1];t&&this.moveToTop(t)}moveToTop(e){if(this.getZindex(e)!==this._index){const t=this.ensureWindow(e);this._windows.forEach(((e,n)=>{e.hasAttribute(i.FOCUS_TRAP_DATA_ATTRIBUTE)&&e.setAttribute(i.FOCUS_TRAP_DATA_ATTRIBUTE,e===t?"true":"false")})),t.style.zIndex=(++this._index).toString()}}removeWindow(e){this.unregisterWindow(e)}}const a=new WeakMap;function l(e=document){const t=e.getElementById("overlap-manager-root")
;if(null!==t)return(0,s.ensureDefined)(a.get(t));{const t=new r(e),n=function(e){const t=e.createElement("div");return t.style.position="absolute",t.style.zIndex=150..toString(),t.style.top="0px",t.style.left="0px",t.id="overlap-manager-root",t.dataset.qaId="overlap-manager-root",t}(e);return a.set(n,t),t.setContainer(n),e.body.appendChild(n),t}}var u;!function(e){e[e.BaseZindex=150]="BaseZindex"}(u||(u={}))},99054:(e,t,n)=>{"use strict";n.d(t,{setFixedBodyState:()=>u});const s=(()=>{let e;return()=>{if(void 0===e){const t=document.createElement("div"),n=t.style;n.visibility="hidden",n.width="100px",n.msOverflowStyle="scrollbar",document.body.appendChild(t);const s=t.offsetWidth;t.style.overflow="scroll";const i=document.createElement("div");i.style.width="100%",t.appendChild(i);const o=i.offsetWidth;t.parentNode?.removeChild(t),e=s-o}return e}})();function i(e,t,n){null!==e&&e.style.setProperty(t,n)}function o(e,t){return getComputedStyle(e,null).getPropertyValue(t)}function r(e,t){return parseInt(o(e,t))}let a=0,l=!1;function u(e){const{body:t}=document,n=t.querySelector(".widgetbar-wrap");if(e&&1==++a){const e=o(t,"overflow"),a=r(t,"padding-right");"hidden"!==e.toLowerCase()&&t.scrollHeight>t.offsetHeight&&(i(n,"right",`${s()}px`),t.style.paddingRight=`${a+s()}px`,l=!0),t.classList.add("i-no-scroll")}else if(!e&&a>0&&0==--a&&(t.classList.remove("i-no-scroll"),l)){i(n,"right","0px");let e=0;0,t.scrollHeight<=t.clientHeight&&(e-=s()),t.style.paddingRight=(e<0?0:e)+"px",l=!1}}},90692:(e,t,n)=>{"use strict";n.d(t,{MatchMedia:()=>i});var s=n(50959);class i extends s.PureComponent{constructor(e){super(e),this._handleChange=()=>{this.forceUpdate()},this.state={query:window.matchMedia(this.props.rule)}}componentDidMount(){this._subscribe(this.state.query)}componentDidUpdate(e,t){this.state.query!==t.query&&(this._unsubscribe(t.query),this._subscribe(this.state.query))}componentWillUnmount(){this._unsubscribe(this.state.query)}render(){return this.props.children(this.state.query.matches)}static getDerivedStateFromProps(e,t){return e.rule!==t.query.media?{query:window.matchMedia(e.rule)}:null}_subscribe(e){e.addEventListener("change",this._handleChange)}_unsubscribe(e){e.removeEventListener("change",this._handleChange)}}},64706:(e,t,n)=>{"use strict";n.d(t,{MenuContext:()=>s});const s=n(50959).createContext(null)},27317:(e,t,n)=>{"use strict";n.d(t,{DEFAULT_MENU_THEME:()=>_,Menu:()=>v});var s=n(50959),i=n(97754),o=n.n(i),r=n(50151),a=n(77914),l=n(26867),u=n(50655),c=n(87713),d=n(67961),h=n(26709),p=n(83021),m=n(64706),f=n(5808);const _=f;var g;!function(e){e[e.IndentFromWindow=0]="IndentFromWindow"}(g||(g={}));class v extends s.PureComponent{constructor(e){super(e),this._containerRef=null,this._scrollWrapRef=null,this._raf=null,this._scrollRaf=null,this._scrollTimeout=void 0,this._manager=new d.OverlapManager,this._hotkeys=null,this._scroll=0,this._handleContainerRef=e=>{this._containerRef=e,this.props.reference&&("function"==typeof this.props.reference&&this.props.reference(e),
"object"==typeof this.props.reference&&(this.props.reference.current=e))},this._handleScrollWrapRef=e=>{this._scrollWrapRef=e,"function"==typeof this.props.scrollWrapReference&&this.props.scrollWrapReference(e),"object"==typeof this.props.scrollWrapReference&&(this.props.scrollWrapReference.current=e)},this._handleCustomRemeasureDelegate=()=>{this._resizeForced(),this._handleMeasure()},this._handleMeasure=({callback:e,forceRecalcPosition:t}={})=>{if(this.state.isMeasureValid&&!t)return;const{position:n}=this.props,s=(0,r.ensureNotNull)(this._containerRef);let i=s.getBoundingClientRect();const o=document.documentElement.clientHeight,l=document.documentElement.clientWidth,u=this.props.closeOnScrollOutsideOffset??0;let c=o-0-u;const d=i.height>c;if(d){(0,r.ensureNotNull)(this._scrollWrapRef).style.overflowY="scroll",i=s.getBoundingClientRect()}const{width:h,height:p}=i,m="function"==typeof n?n({contentWidth:h,contentHeight:p,availableWidth:l,availableHeight:o}):n,f=m?.indentFromWindow?.left??0,_=l-(m.overrideWidth??h)-(m?.indentFromWindow?.right??0),g=(0,a.clamp)(m.x,f,Math.max(f,_)),v=(m?.indentFromWindow?.top??0)+u,y=o-(m.overrideHeight??p)-(m?.indentFromWindow?.bottom??0);let w=(0,a.clamp)(m.y,v,Math.max(v,y));if(m.forbidCorrectYCoord&&w<m.y&&(c-=m.y-w,w=m.y),t&&void 0!==this.props.closeOnScrollOutsideOffset&&m.y<=this.props.closeOnScrollOutsideOffset)return void this._handleGlobalClose(!0);const b=m.overrideHeight??(d?c:void 0);this.setState({appearingMenuHeight:t?this.state.appearingMenuHeight:b,appearingMenuWidth:t?this.state.appearingMenuWidth:m.overrideWidth,appearingPosition:{x:g,y:w},isMeasureValid:!0},(()=>{this.props.doNotRestorePosition||this._restoreScrollPosition(),e&&e()}))},this._restoreScrollPosition=()=>{const e=document.activeElement,t=(0,r.ensureNotNull)(this._containerRef);if(null!==e&&t.contains(e))try{e.scrollIntoView()}catch(e){}else(0,r.ensureNotNull)(this._scrollWrapRef).scrollTop=this._scroll},this._resizeForced=()=>{this.setState({appearingMenuHeight:void 0,appearingMenuWidth:void 0,appearingPosition:void 0,isMeasureValid:void 0})},this._resize=()=>{null===this._raf&&(this._raf=requestAnimationFrame((()=>{this.setState({appearingMenuHeight:void 0,appearingMenuWidth:void 0,appearingPosition:void 0,isMeasureValid:void 0}),this._raf=null})))},this._handleGlobalClose=e=>{this.props.onClose(e)},this._handleSlot=e=>{this._manager.setContainer(e)},this._handleScroll=()=>{this._scroll=(0,r.ensureNotNull)(this._scrollWrapRef).scrollTop},this._handleScrollOutsideEnd=()=>{clearTimeout(this._scrollTimeout),this._scrollTimeout=setTimeout((()=>{this._handleMeasure({forceRecalcPosition:!0})}),80)},this._handleScrollOutside=e=>{e.target!==this._scrollWrapRef&&(this._handleScrollOutsideEnd(),null===this._scrollRaf&&(this._scrollRaf=requestAnimationFrame((()=>{this._handleMeasure({forceRecalcPosition:!0}),this._scrollRaf=null}))))},this.state={}}componentDidMount(){this._handleMeasure({callback:this.props.onOpen});const{customCloseDelegate:e=c.globalCloseDelegate,customRemeasureDelegate:t}=this.props
;e.subscribe(this,this._handleGlobalClose),t?.subscribe(null,this._handleCustomRemeasureDelegate),window.addEventListener("resize",this._resize);const n=null!==this.context;this._hotkeys||n||(this._hotkeys=h.createGroup({desc:"Popup menu"}),this._hotkeys.add({desc:"Close",hotkey:27,handler:()=>{this.props.onKeyboardClose&&this.props.onKeyboardClose(),this._handleGlobalClose()}})),this.props.repositionOnScroll&&window.addEventListener("scroll",this._handleScrollOutside,{capture:!0})}componentDidUpdate(){this._handleMeasure()}componentWillUnmount(){const{customCloseDelegate:e=c.globalCloseDelegate,customRemeasureDelegate:t}=this.props;e.unsubscribe(this,this._handleGlobalClose),t?.unsubscribe(null,this._handleCustomRemeasureDelegate),window.removeEventListener("resize",this._resize),window.removeEventListener("scroll",this._handleScrollOutside,{capture:!0}),this._hotkeys&&(this._hotkeys.destroy(),this._hotkeys=null),null!==this._raf&&(cancelAnimationFrame(this._raf),this._raf=null),null!==this._scrollRaf&&(cancelAnimationFrame(this._scrollRaf),this._scrollRaf=null),this._scrollTimeout&&clearTimeout(this._scrollTimeout)}render(){const{id:e,role:t,"aria-label":n,"aria-labelledby":i,"aria-activedescendant":r,"aria-hidden":a,"aria-describedby":c,"aria-invalid":d,children:h,minWidth:_,theme:g=f,className:v,maxHeight:w,onMouseOver:b,onMouseOut:x,onKeyDown:C,onFocus:E,onBlur:S}=this.props,{appearingMenuHeight:R,appearingMenuWidth:M,appearingPosition:W,isMeasureValid:T}=this.state,O={"--ui-kit-menu-max-width":`${W&&W.x}px`,maxWidth:"calc(100vw - var(--ui-kit-menu-max-width) - 6px)"};return s.createElement(m.MenuContext.Provider,{value:this},s.createElement(p.SubmenuHandler,null,s.createElement(u.SlotContext.Provider,{value:this._manager},s.createElement("div",{id:e,role:t,"aria-label":n,"aria-labelledby":i,"aria-activedescendant":r,"aria-hidden":a,"aria-describedby":c,"aria-invalid":d,className:o()(v,g.menuWrap,!T&&g.isMeasuring),style:{height:R,left:W&&W.x,minWidth:_,position:"fixed",top:W&&W.y,width:M,...this.props.limitMaxWidth&&O},"data-name":this.props["data-name"],"data-qa-id":this.props.dataQaId,"data-tooltip-show-on-focus":this.props["data-tooltip-show-on-focus"],ref:this._handleContainerRef,onScrollCapture:this.props.onScroll,onContextMenu:l.preventDefaultForContextMenu,tabIndex:this.props.tabIndex,onMouseOver:b,onMouseOut:x,onKeyDown:C,onFocus:E,onBlur:S},s.createElement("div",{className:o()(g.scrollWrap,!this.props.noMomentumBasedScroll&&g.momentumBased),style:{overflowY:void 0!==R?"scroll":"auto",maxHeight:w},onScrollCapture:this._handleScroll,ref:this._handleScrollWrapRef},s.createElement(y,{className:g.menuBox},h)))),s.createElement(u.Slot,{reference:this._handleSlot})))}update(e){e?this._resizeForced():this._resize()}focus(e){this._containerRef?.focus(e)}blur(){this._containerRef?.blur()}}function y(e){const t=(0,r.ensureNotNull)((0,s.useContext)(p.SubmenuContext)),n=s.useRef(null);return s.createElement("div",{ref:n,className:e.className,onMouseOver:function(e){
if(!(null!==t.current&&e.target instanceof Node&&(s=e.target,n.current?.contains(s))))return;var s;t.isSubmenuNode(e.target)||t.setCurrent(null)},"data-name":"menu-inner","data-qa-id":"menu-inner"},e.children)}v.contextType=p.SubmenuContext},29197:(e,t,n)=>{"use strict";n.d(t,{CloseDelegateContext:()=>o});var s=n(50959),i=n(87713);const o=s.createContext(i.globalCloseDelegate)},65718:(e,t,n)=>{"use strict";n.d(t,{Portal:()=>s.Portal,PortalContext:()=>s.PortalContext});var s=n(19250)},50655:(e,t,n)=>{"use strict";n.d(t,{Slot:()=>s.Slot,SlotContext:()=>s.SlotContext});var s=n(99663)}}]);