5 lines
15 KiB
JavaScript
5 lines
15 KiB
JavaScript
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[8994],{16059:e=>{e.exports={menuWrap:"menuWrap-8MKeZifP",isMeasuring:"isMeasuring-8MKeZifP",scrollWrap:"scrollWrap-8MKeZifP",momentumBased:"momentumBased-8MKeZifP",menuBox:"menuBox-8MKeZifP",isHidden:"isHidden-8MKeZifP"}},9745:(e,t,n)=>{"use strict";n.d(t,{Icon:()=>r});var s=n(59496);const r=s.forwardRef((e,t)=>{const{icon:n="",...r}=e;return s.createElement("span",{...r,ref:t,dangerouslySetInnerHTML:{__html:n}})})},39640:(e,t,n)=>{"use strict";function s(e,t,n,s,r){function o(r){if(e>r.timeStamp)return;const o=r.target;void 0!==n&&null!==t&&null!==o&&o.ownerDocument===s&&(t.contains(o)||n(r))}return r.click&&s.addEventListener("click",o,!1),r.mouseDown&&s.addEventListener("mousedown",o,!1),r.touchEnd&&s.addEventListener("touchend",o,!1),r.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})},68722:(e,t,n)=>{"use strict";n.d(t,{getScrollbarWidth:()=>s,matchMediaMinMax:()=>r,setStyle:()=>o,getCSSProperty:()=>i,getCSSPropertyNumericValue:()=>l});const s=(()=>{let e;return()=>{var t;if(void 0===e){const n=document.createElement("div"),s=n.style;s.visibility="hidden",s.width="100px",s.msOverflowStyle="scrollbar",document.body.appendChild(n);const r=n.offsetWidth;n.style.overflow="scroll";const o=document.createElement("div");o.style.width="100%",n.appendChild(o);const i=o.offsetWidth;null===(t=n.parentNode)||void 0===t||t.removeChild(n),e=r-i}return e}})();function r(e,t){return t===1/0?window.matchMedia(`(min-width: ${e}px)`):window.matchMedia(`(min-width: ${e}px) and (max-width: ${t}px)`)}function o(e,t,n){null!==e&&e.style.setProperty(t,n)}function i(e,t){return getComputedStyle(e,null).getPropertyValue(t)}function l(e,t){return parseInt(i(e,t))}},43989:(e,t,n)=>{"use strict";n.d(t,{setFixedBodyState:()=>i});var s=n(68722);let r=0,o=!1;function i(e){const{body:t}=document,n=t.querySelector(".widgetbar-wrap");if(e&&1==++r){const e=(0,s.getCSSProperty)(t,"overflow"),r=(0,s.getCSSPropertyNumericValue)(t,"padding-right");"hidden"!==e.toLowerCase()&&t.scrollHeight>t.offsetHeight&&((0,s.setStyle)(n,"right",(0,s.getScrollbarWidth)()+"px"),t.style.paddingRight=r+(0,s.getScrollbarWidth)()+"px",o=!0),t.classList.add("i-no-scroll")}else if(!e&&r>0&&0==--r&&(t.classList.remove("i-no-scroll"),o)){(0,s.setStyle)(n,"right","0px");let e=0;0,t.scrollHeight<=t.clientHeight&&(e-=(0,s.getScrollbarWidth)()),t.style.paddingRight=(e<0?0:e)+"px",o=!1}}},58095:(e,t,n)=>{"use strict";n.d(t,{useOutsideEvent:()=>o});var s=n(59496),r=n(39640);function o(e){const{click:t,mouseDown:n,touchEnd:o,touchStart:i,handler:l,reference:a,ownerDocument:c=document}=e,u=(0,s.useRef)(null),d=(0,s.useRef)(new CustomEvent("timestamp").timeStamp);return(0,s.useLayoutEffect)(()=>{const e={click:t,mouseDown:n,touchEnd:o,touchStart:i},s=a?a.current:u.current;return(0,
|
|
r.addOutsideEventListener)(d.current,s,l,c,e)},[t,n,o,i,l]),a||u}},90692:(e,t,n)=>{"use strict";n.d(t,{MatchMedia:()=>r});var s=n(59496);class r 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.addListener(this._handleChange)}_unsubscribe(e){e.removeListener(this._handleChange)}}},64706:(e,t,n)=>{"use strict";n.d(t,{MenuContext:()=>s});const s=n(59496).createContext(null)},27317:(e,t,n)=>{"use strict";n.d(t,{DEFAULT_MENU_THEME:()=>g,Menu:()=>_});var s=n(59496),r=n(97754),o=n.n(r),i=n(88537),l=n(64514),a=n(54475),c=n(50655),u=n(59064),d=n(88216),h=n(25760),p=n(14758),m=n(64706),f=n(16059);const g=f;class _ 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._handleMeasure=({callback:e,forceRecalcPosition:t}={})=>{var n,s,r,o;if(this.state.isMeasureValid&&!t)return;const{position:a}=this.props,c=(0,i.ensureNotNull)(this._containerRef);let u=c.getBoundingClientRect();const d=document.documentElement.clientHeight,h=document.documentElement.clientWidth,p=null!==(n=this.props.closeOnScrollOutsideOffset)&&void 0!==n?n:0;let m=d-0-p;const f=u.height>m;if(f){(0,i.ensureNotNull)(this._scrollWrapRef).style.overflowY="scroll",u=c.getBoundingClientRect()}const{width:g,height:_}=u,v="function"==typeof a?a(g,_,d):a,y=h-(null!==(s=v.overrideWidth)&&void 0!==s?s:g)-0,C=(0,l.clamp)(v.x,0,Math.max(0,y)),w=0+p,x=d-(null!==(r=v.overrideHeight)&&void 0!==r?r:_)-0;let S=(0,l.clamp)(v.y,w,Math.max(w,x));if(v.forbidCorrectYCoord&&S<v.y&&(m-=v.y-S,S=v.y),t&&void 0!==this.props.closeOnScrollOutsideOffset&&v.y<=this.props.closeOnScrollOutsideOffset)return void this._handleGlobalClose(!0);const M=null!==(o=v.overrideHeight)&&void 0!==o?o:f?m:void 0;this.setState({appearingMenuHeight:t?this.state.appearingMenuHeight:M,appearingMenuWidth:t?this.state.appearingMenuWidth:v.overrideWidth,appearingPosition:{x:C,y:S},isMeasureValid:!0},()=>{this._restoreScrollPosition(),e&&e()})},this._restoreScrollPosition=()=>{
|
|
const e=document.activeElement,t=(0,i.ensureNotNull)(this._containerRef);if(null!==e&&t.contains(e))try{e.scrollIntoView()}catch(e){}else(0,i.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,i.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=u.globalCloseDelegate}=this.props;e.subscribe(this,this._handleGlobalClose),window.addEventListener("resize",this._resize);const t=null!==this.context;this._hotkeys||t||(this._hotkeys=h.createGroup({desc:"Popup menu"}),this._hotkeys.add({desc:"Close",hotkey:27,handler:()=>this._handleGlobalClose()})),this.props.repositionOnScroll&&window.addEventListener("scroll",this._handleScrollOutside,{capture:!0})}componentDidUpdate(){this._handleMeasure()}componentWillUnmount(){const{customCloseDelegate:e=u.globalCloseDelegate}=this.props;e.unsubscribe(this,this._handleGlobalClose),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-labelledby":n,"aria-activedescendant":r,children:i,minWidth:l,theme:u=f,className:d,maxHeight:h,onMouseOver:g,onMouseOut:_,onKeyDown:y,onFocus:C,onBlur:w}=this.props,{appearingMenuHeight:x,appearingMenuWidth:S,appearingPosition:M,isMeasureValid:b}=this.state;return s.createElement(m.MenuContext.Provider,{value:this},s.createElement(p.SubmenuHandler,null,s.createElement(c.SlotContext.Provider,{value:this._manager},s.createElement("div",{id:e,role:t,"aria-labelledby":n,"aria-activedescendant":r,className:o()(d,u.menuWrap,!b&&u.isMeasuring),style:{height:x,left:M&&M.x,minWidth:l,position:"fixed",top:M&&M.y,width:S},"data-name":this.props["data-name"],ref:this._handleContainerRef,onScrollCapture:this.props.onScroll,onContextMenu:a.preventDefaultForContextMenu,tabIndex:this.props.tabIndex,onMouseOver:g,
|
|
onMouseOut:_,onKeyDown:y,onFocus:C,onBlur:w},s.createElement("div",{className:o()(u.scrollWrap,!this.props.noMomentumBasedScroll&&u.momentumBased),style:{overflowY:void 0!==x?"scroll":"auto",maxHeight:h},onScrollCapture:this._handleScroll,ref:this._handleScrollWrapRef},s.createElement(v,{className:u.menuBox},i)))),s.createElement(c.Slot,{reference:this._handleSlot})))}update(e){e?this._resizeForced():this._resize()}}function v(e){const t=(0,i.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,null===(r=n.current)||void 0===r?void 0:r.contains(s))))return;var s,r;t.isSubmenuNode(e.target)||t.setCurrent(null)},"data-name":"menu-inner"},e.children)}_.contextType=p.SubmenuContext},88216:(e,t,n)=>{"use strict";n.d(t,{OverlapManager:()=>o,getRootOverlapManager:()=>l});var s=n(88537);class r{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 o{constructor(e=document){this._storage=new r,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")}moveToTop(e){if(this.getZindex(e)!==this._index){this.ensureWindow(e).style.zIndex=(++this._index).toString()}}removeWindow(e){this.unregisterWindow(e)}}const i=new WeakMap;function l(e=document){const t=e.getElementById("overlap-manager-root");if(null!==t)return(0,s.ensureDefined)(i.get(t));{const t=new o(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}(e);return i.set(n,t),t.setContainer(n),e.body.appendChild(n),t}}},
|
|
29197:(e,t,n)=>{"use strict";n.d(t,{CloseDelegateContext:()=>o});var s=n(59496),r=n(59064);const o=s.createContext(r.globalCloseDelegate)},50628:(e,t,n)=>{"use strict";n.d(t,{PopupMenu:()=>c});var s=n(59496),r=n(87995),o=n(65718),i=n(27317),l=n(29197),a=n(58095);function c(e){const{controller:t,children:n,isOpened:c,closeOnClickOutside:u=!0,doNotCloseOn:d,onClickOutside:h,onClose:p,...m}=e,f=(0,s.useContext)(l.CloseDelegateContext),g=(0,a.useOutsideEvent)({handler:function(e){h&&h(e);if(!u)return;if(d&&e.target instanceof Node){const t=r.findDOMNode(d);if(t instanceof Node&&t.contains(e.target))return}p()},mouseDown:!0,touchStart:!0});return c?s.createElement(o.Portal,{top:"0",left:"0",right:"0",bottom:"0",pointerEvents:"none"},s.createElement("span",{ref:g,style:{pointerEvents:"auto"}},s.createElement(i.Menu,{...m,onClose:p,onScroll:function(t){const{onScroll:n}=e;n&&n(t)},customCloseDelegate:f,ref:t},n))):null}},65718:(e,t,n)=>{"use strict";n.d(t,{Portal:()=>a,PortalContext:()=>c});var s=n(59496),r=n(87995),o=n(9423),i=n(88216),l=n(50655);class a extends s.PureComponent{constructor(){super(...arguments),this._uuid=(0,o.guid)()}componentWillUnmount(){this._manager().removeWindow(this._uuid)}render(){const e=this._manager().ensureWindow(this._uuid,this.props.layerOptions);return 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||"",r.createPortal(s.createElement(c.Provider,{value:this},this.props.children),e)}moveToTop(){this._manager().moveToTop(this._uuid)}_manager(){return null===this.context?(0,i.getRootOverlapManager)():this.context}}a.contextType=l.SlotContext;const c=s.createContext(null)},50655:(e,t,n)=>{"use strict";n.d(t,{Slot:()=>r,SlotContext:()=>o});var s=n(59496);class r 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)},14758:(e,t,n)=>{"use strict";n.d(t,{SubmenuContext:()=>r,SubmenuHandler:()=>o});var s=n(59496);const r=s.createContext(null);function o(e){const[t,n]=(0,s.useState)(null),o=(0,s.useRef)(null),i=(0,s.useRef)(new Map);return(0,s.useEffect)(()=>()=>{null!==o.current&&clearTimeout(o.current)},[]),s.createElement(r.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 i.current.set(e,t),()=>{i.current.delete(e)}},isSubmenuNode:function(e){return Array.from(i.current.values()).some(t=>t(e))}}},e.children)}},40173:(e,t,n)=>{"use strict";function s(e,t,n={}){const s=Object.assign({},t);for(const r of Object.keys(t)){const o=n[r]||r;o in e&&(s[r]=[e[o],t[r]].join(" "))}return s}function r(e,t,n={}){return Object.assign({},e,s(e,t,n))}n.d(t,{weakComposeClasses:()=>s,mergeThemes:()=>r})}}]); |