Files
ai/charting_library/bundles/3245.428fb1c689b8d7beb80e.js
2023-02-02 13:31:14 +00:00

9 lines
27 KiB
JavaScript

(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[3245],{67179:e=>{e.exports={dialog:"dialog-HExheUfY",wrapper:"wrapper-HExheUfY",separator:"separator-HExheUfY"}},89185:e=>{e.exports={itemRow:"itemRow-9Sl1Rwzy",favoriteButton:"favoriteButton-9Sl1Rwzy",active:"active-9Sl1Rwzy",selected:"selected-9Sl1Rwzy",mobile:"mobile-9Sl1Rwzy",itemInfo:"itemInfo-9Sl1Rwzy",title:"title-9Sl1Rwzy",details:"details-9Sl1Rwzy",itemInfoWithPadding:"itemInfoWithPadding-9Sl1Rwzy",favorite:"favorite-9Sl1Rwzy",removeButton:"removeButton-9Sl1Rwzy"}},91441:e=>{e.exports={"small-height-breakpoint":"screen and (max-height: 360px)",container:"container-tuOy5zvD",unsetAlign:"unsetAlign-tuOy5zvD",title:"title-tuOy5zvD",subtitle:"subtitle-tuOy5zvD",ellipsis:"ellipsis-tuOy5zvD",close:"close-tuOy5zvD"}},97623:e=>{e.exports={scrollWrap:"scrollWrap-9M00JHkT"}},62230:e=>{e.exports={wrap:"wrap-Shy8LdqT","wrap--horizontal":"wrap--horizontal-Shy8LdqT",bar:"bar-Shy8LdqT",barInner:"barInner-Shy8LdqT","barInner--horizontal":"barInner--horizontal-Shy8LdqT","bar--horizontal":"bar--horizontal-Shy8LdqT"}},16059:e=>{e.exports={menuWrap:"menuWrap-8MKeZifP",isMeasuring:"isMeasuring-8MKeZifP",scrollWrap:"scrollWrap-8MKeZifP",momentumBased:"momentumBased-8MKeZifP",menuBox:"menuBox-8MKeZifP",isHidden:"isHidden-8MKeZifP"}},91626:e=>{e.exports={separator:"separator-jtAq6E4V"}},9745:(e,t,n)=>{"use strict";n.d(t,{Icon:()=>o});var r=n(59496);const o=r.forwardRef((e,t)=>{const{icon:n="",...o}=e;return r.createElement("span",{...o,ref:t,dangerouslySetInnerHTML:{__html:n}})})},39640:(e,t,n)=>{"use strict";function r(e,t,n,r,o){function s(o){if(e>o.timeStamp)return;const s=o.target;void 0!==n&&null!==t&&null!==s&&s.ownerDocument===r&&(t.contains(s)||n(o))}return o.click&&r.addEventListener("click",s,!1),o.mouseDown&&r.addEventListener("mousedown",s,!1),o.touchEnd&&r.addEventListener("touchend",s,!1),o.touchStart&&r.addEventListener("touchstart",s,!1),()=>{r.removeEventListener("click",s,!1),r.removeEventListener("mousedown",s,!1),r.removeEventListener("touchend",s,!1),r.removeEventListener("touchstart",s,!1)}}n.d(t,{addOutsideEventListener:()=>r})},68722:(e,t,n)=>{"use strict";n.d(t,{getScrollbarWidth:()=>r,matchMediaMinMax:()=>o,setStyle:()=>s,getCSSProperty:()=>i,getCSSPropertyNumericValue:()=>l});const r=(()=>{let e;return()=>{var t;if(void 0===e){const n=document.createElement("div"),r=n.style;r.visibility="hidden",r.width="100px",r.msOverflowStyle="scrollbar",document.body.appendChild(n);const o=n.offsetWidth;n.style.overflow="scroll";const s=document.createElement("div");s.style.width="100%",n.appendChild(s);const i=s.offsetWidth;null===(t=n.parentNode)||void 0===t||t.removeChild(n),e=o-i}return e}})();function o(e,t){return t===1/0?window.matchMedia(`(min-width: ${e}px)`):window.matchMedia(`(min-width: ${e}px) and (max-width: ${t}px)`)}function s(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 r=n(68722);let o=0,s=!1;function i(e){const{body:t}=document,n=t.querySelector(".widgetbar-wrap");if(e&&1==++o){const e=(0,r.getCSSProperty)(t,"overflow"),o=(0,r.getCSSPropertyNumericValue)(t,"padding-right");"hidden"!==e.toLowerCase()&&t.scrollHeight>t.offsetHeight&&((0,r.setStyle)(n,"right",(0,r.getScrollbarWidth)()+"px"),t.style.paddingRight=o+(0,r.getScrollbarWidth)()+"px",s=!0),t.classList.add("i-no-scroll")}else if(!e&&o>0&&0==--o&&(t.classList.remove("i-no-scroll"),s)){(0,r.setStyle)(n,"right","0px");let e=0;0,t.scrollHeight<=t.clientHeight&&(e-=(0,r.getScrollbarWidth)()),t.style.paddingRight=(e<0?0:e)+"px",s=!1}}},85457:(e,t,n)=>{"use strict";n.d(t,{AdaptivePopupDialog:()=>b});var r=n(59496),o=n(88537);var s=n(97754),i=n.n(s),l=n(68335),a=n(35749),c=n(81e3),u=n(1109),d=n(24437),h=n(90692),p=n(95711),m=n(52092),f=n(76422),v=n(9745);const g=r.createContext({setHideClose:()=>{}});var _=n(37257),C=n(91441);function E(e){const{title:t,subtitle:n,showCloseIcon:o=!0,onClose:s,renderBefore:l,renderAfter:a,draggable:c,className:u,unsetAlign:d}=e,[h,p]=(0,r.useState)(!1);return r.createElement(g.Provider,{value:{setHideClose:p}},r.createElement("div",{className:i()(C.container,u,(n||d)&&C.unsetAlign)},l,r.createElement("div",{"data-dragg-area":c,className:C.title},r.createElement("div",{className:C.ellipsis},t),n&&r.createElement("div",{className:i()(C.ellipsis,C.subtitle)},n)),a,o&&!h&&r.createElement(v.Icon,{className:C.close,icon:_,onClick:s,"data-name":"close","data-role":"button"})))}var w=n(67179);const y={vertical:20},S={vertical:0};class b extends r.PureComponent{constructor(){super(...arguments),this._controller=null,this._reference=null,this._orientationMediaQuery=null,this._renderChildren=(e,t)=>(this._controller=e,this.props.render({requestResize:this._requestResize,centerAndFit:this._centerAndFit,isSmallWidth:t})),this._handleReference=e=>this._reference=e,this._handleClose=()=>{this.props.onClose()},this._handleOpen=()=>{void 0!==this.props.onOpen&&this.props.isOpened&&this.props.onOpen(this.props.fullScreen||window.matchMedia(d.DialogBreakpoints.TabletSmall).matches)},this._handleKeyDown=e=>{var t;if(!e.defaultPrevented)switch(this.props.onKeyDown&&this.props.onKeyDown(e),(0,l.hashFromEvent)(e)){case 27:if(e.defaultPrevented)return;if(this.props.forceCloseOnEsc&&this.props.forceCloseOnEsc())return void this._handleClose();const{activeElement:n}=document,r=(0,o.ensureNotNull)(this._reference);if(null!==n){if(e.preventDefault(),"true"===(t=n).getAttribute("data-haspopup")&&"true"!==t.getAttribute("data-expanded"))return void this._handleClose();if((0,a.isTextEditingField)(n))return void r.focus();if(r.contains(n))return void this._handleClose()}}},this._requestResize=()=>{null!==this._controller&&this._controller.recalculateBounds()},this._centerAndFit=()=>{null!==this._controller&&this._controller.centerAndFit()}}componentDidMount(){var e,t;f.subscribe(m.CLOSE_POPUPS_AND_DIALOGS_COMMAND,this._handleClose,null),this._handleOpen(),
void 0!==this.props.onOpen&&(this._orientationMediaQuery=window.matchMedia("(orientation: portrait)"),e=this._orientationMediaQuery,t=this._handleOpen,(null==e?void 0:e.addEventListener)?e.addEventListener("change",t):e.addListener(t))}componentWillUnmount(){var e,t;f.unsubscribe(m.CLOSE_POPUPS_AND_DIALOGS_COMMAND,this._handleClose,null),null!==this._orientationMediaQuery&&(e=this._orientationMediaQuery,t=this._handleOpen,(null==e?void 0:e.removeEventListener)?e.removeEventListener("change",t):e.removeListener(t))}focus(){(0,o.ensureNotNull)(this._reference).focus()}getElement(){return this._reference}contains(e){var t,n;return null!==(n=null===(t=this._reference)||void 0===t?void 0:t.contains(e))&&void 0!==n&&n}render(){const{className:e,wrapperClassName:t,headerClassName:n,isOpened:o,title:s,dataName:l,onClickOutside:a,additionalElementPos:m,additionalHeaderElement:f,backdrop:v,shouldForceFocus:g=!0,showSeparator:_,subtitle:C,draggable:b=!0,fullScreen:x=!1,showCloseIcon:M=!0,rounded:N=!0,isAnimationEnabled:O,growPoint:P,dialogTooltip:D,unsetHeaderAlign:R,onDragStart:W,dataDialogName:z}=this.props,L="after"!==m?f:void 0,T="after"===m?f:void 0,k="string"==typeof s?s:z||"";return r.createElement(h.MatchMedia,{rule:d.DialogBreakpoints.SmallHeight},m=>r.createElement(h.MatchMedia,{rule:d.DialogBreakpoints.TabletSmall},d=>r.createElement(c.PopupDialog,{rounded:!(d||x)&&N,className:i()(w.dialog,e),isOpened:o,reference:this._handleReference,onKeyDown:this._handleKeyDown,onClickOutside:a,onClickBackdrop:a,fullscreen:d||x,guard:m?S:y,boundByScreen:d||x,shouldForceFocus:g,backdrop:v,draggable:b,isAnimationEnabled:O,growPoint:P,name:this.props.dataName,dialogTooltip:D,onDragStart:W},r.createElement("div",{className:i()(w.wrapper,t),"data-name":l,"data-dialog-name":k},void 0!==s&&r.createElement(E,{draggable:b&&!(d||x),onClose:this._handleClose,renderAfter:T,renderBefore:L,subtitle:C,title:s,showCloseIcon:M,className:n,unsetAlign:R}),_&&r.createElement(u.Separator,{className:w.separator}),r.createElement(p.PopupContext.Consumer,null,e=>this._renderChildren(e,d||x))))))}}},64530:(e,t,n)=>{"use strict";n.d(t,{DialogContentItem:()=>d});var r=n(59496),o=n(97754),s=n.n(o),i=n(49483),l=n(36189),a=n(96040);function c(e){const{url:t,...n}=e;return t?r.createElement("a",{...n,href:t}):r.createElement("div",{...n})}var u=n(89185);function d(e){const{title:t,subtitle:n,removeBtnLabel:o,onClick:d,onClickFavorite:p,onClickRemove:m,isActive:f,isSelected:v,isFavorite:g,isMobile:_=!1,showFavorite:C=!0,...E}=e;return r.createElement(c,{...E,className:s()(u.itemRow,f&&!v&&u.active,_&&u.mobile,v&&u.selected),onClick:h.bind(null,d),"data-role":"list-item","data-active":f},C&&p&&r.createElement(l.FavoriteButton,{className:s()(u.favoriteButton,g&&u.favorite,i.CheckMobile.any()&&u.mobile),isActive:f&&!v,isFilled:g,onClick:h.bind(null,p),"data-name":"list-item-favorite-button","data-favorite":g}),r.createElement("div",{className:s()(u.itemInfo,!C&&u.itemInfoWithPadding)},r.createElement("div",{className:s()(u.title,f&&!v&&u.active,_&&u.mobile),
"data-name":"list-item-title"},t),r.createElement("div",{className:s()(u.details,f&&!v&&u.active,_&&u.mobile)},n)),r.createElement(a.RemoveButton,{className:u.removeButton,isActive:f&&!v,onClick:h.bind(null,m),"data-name":"list-item-remove-button",title:o}))}function h(e,t){t.defaultPrevented||(t.preventDefault(),e(t))}},3085:(e,t,n)=>{"use strict";n.d(t,{OverlayScrollContainer:()=>p});var r=n(59496),o=n(97754),s=n.n(o),i=n(88537),l=n(64514),a=n(62820);const c=n(62230);function u(e){const{size:t,scrollSize:n,clientSize:o,scrollProgress:u,onScrollProgressChange:d,horizontal:h,theme:p=c,onDragStart:m,onDragEnd:f,minBarSize:v=40}=e,g=(0,r.useRef)(null),_=(0,r.useRef)(null),[C,E]=(0,r.useState)(!1),w=(0,r.useRef)(0);(0,r.useEffect)(()=>{const e=(0,i.ensureNotNull)(g.current).ownerDocument;return C?(m&&m(),e&&(e.addEventListener("mousemove",N),e.addEventListener("mouseup",O))):f&&f(),()=>{e&&(e.removeEventListener("mousemove",N),e.removeEventListener("mouseup",O))}},[C]);const y=t/n||0,S=o*y||0,b=Math.max(S,v),x=(t-b)/(t-S),M=function(e){if((0,a.isRtl)()&&h)return e-n+o;return e}((0,l.clamp)(u,0,n-t));return r.createElement("div",{ref:g,className:s()(p.wrap,h&&p["wrap--horizontal"]),style:{[h?"width":"height"]:t},onMouseDown:function(e){if(e.isDefaultPrevented())return;e.preventDefault();const r=(0,i.ensureNotNull)(_.current).getBoundingClientRect();w.current=(h?r.width:r.height)/2;const o=n-t;let s=P(e.nativeEvent,(0,i.ensureNotNull)(g.current))-w.current;s<0?(s=0,w.current=P(e.nativeEvent,(0,i.ensureNotNull)(g.current))):s>o*y*x&&(s=o*y*x,w.current=P(e.nativeEvent,(0,i.ensureNotNull)(g.current))-s);d(s/y/x),E(!0)}},r.createElement("div",{ref:_,className:s()(p.bar,h&&p["bar--horizontal"]),style:{[h?"minWidth":"minHeight"]:v,[h?"width":"height"]:b,transform:`translate${h?"X":"Y"}(${M*y*x||0}px)`},onMouseDown:function(e){e.preventDefault(),w.current=P(e.nativeEvent,(0,i.ensureNotNull)(_.current)),E(!0)}},r.createElement("div",{className:s()(p.barInner,h&&p["barInner--horizontal"])})));function N(e){const t=P(e,(0,i.ensureNotNull)(g.current))-w.current;d(t/y/x)}function O(e){E(!1)}function P(e,t){const n=t.getBoundingClientRect();return h?e.clientX-n.left:e.clientY-n.top}}var d=n(70412),h=n(97623);function p(e){const{reference:t,className:n,containerHeight:s=0,containerWidth:i=0,contentHeight:l=0,contentWidth:a=0,scrollPosTop:c=0,scrollPosLeft:p=0,onVerticalChange:m,onHorizontalChange:f,visible:v}=e,[g,_]=(0,d.useHover)(),[C,E]=(0,r.useState)(!1),w=s<l,y=i<a,S=w&&y?8:0;return r.createElement("div",{..._,ref:t,className:o(n,h.scrollWrap),style:{visibility:v||g||C?"visible":"hidden"}},w&&r.createElement(u,{size:s-S,scrollSize:l-S,clientSize:s-S,scrollProgress:c,onScrollProgressChange:function(e){m&&m(e)},onDragStart:b,onDragEnd:x}),y&&r.createElement(u,{size:i-S,scrollSize:a-S,clientSize:i-S,scrollProgress:p,onScrollProgressChange:function(e){f&&f(e)},onDragStart:b,onDragEnd:x,horizontal:!0}));function b(){E(!0)}function x(){E(!1)}}},898:(e,t,n)=>{"use strict";n.d(t,{useDimensions:()=>o});var r=n(59496);function o(){
const[e,t]=(0,r.useState)(null);return[(0,r.useCallback)(n=>{n.width===(null==e?void 0:e.width)&&n.height===e.height||t(n)},[e]),e]}},70412:(e,t,n)=>{"use strict";n.d(t,{hoverMouseEventFilter:()=>s,useAccurateHover:()=>i,useHover:()=>o});var r=n(59496);function o(){const[e,t]=(0,r.useState)(!1);return[e,{onMouseOver:function(e){s(e)&&t(!0)},onMouseOut:function(e){s(e)&&t(!1)}}]}function s(e){return!e.currentTarget.contains(e.relatedTarget)}function i(e){const[t,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{const t=t=>{if(null===e.current)return;const r=e.current.contains(t.target);n(r)};return document.addEventListener("mouseover",t),()=>document.removeEventListener("mouseover",t)},[]),t}},58095:(e,t,n)=>{"use strict";n.d(t,{useOutsideEvent:()=>s});var r=n(59496),o=n(39640);function s(e){const{click:t,mouseDown:n,touchEnd:s,touchStart:i,handler:l,reference:a,ownerDocument:c=document}=e,u=(0,r.useRef)(null),d=(0,r.useRef)(new CustomEvent("timestamp").timeStamp);return(0,r.useLayoutEffect)(()=>{const e={click:t,mouseDown:n,touchEnd:s,touchStart:i},r=a?a.current:u.current;return(0,o.addOutsideEventListener)(d.current,r,l,c,e)},[t,n,s,i,l]),a||u}},33127:(e,t,n)=>{"use strict";n.d(t,{useOverlayScroll:()=>a});var r=n(59496),o=n(88537),s=n(70412),i=n(49483);const l={onMouseOver:()=>{},onMouseOut:()=>{}};function a(e,t=i.CheckMobile.any()){const n=(0,r.useRef)(null),a=e||(0,r.useRef)(null),[c,u]=(0,s.useHover)(),[d,h]=(0,r.useState)({reference:n,containerHeight:0,containerWidth:0,contentHeight:0,contentWidth:0,scrollPosTop:0,scrollPosLeft:0,onVerticalChange:function(e){h(t=>({...t,scrollPosTop:e})),(0,o.ensureNotNull)(a.current).scrollTop=e},onHorizontalChange:function(e){h(t=>({...t,scrollPosLeft:e})),(0,o.ensureNotNull)(a.current).scrollLeft=e},visible:c}),p=(0,r.useCallback)(()=>{if(!a.current)return;const{clientHeight:e,scrollHeight:t,scrollTop:r,clientWidth:o,scrollWidth:s,scrollLeft:i}=a.current,l=n.current?n.current.offsetTop:0;h(n=>({...n,containerHeight:e-l,contentHeight:t-l,scrollPosTop:r,containerWidth:o,contentWidth:s,scrollPosLeft:i}))},[]);function m(){h(e=>({...e,scrollPosTop:(0,o.ensureNotNull)(a.current).scrollTop,scrollPosLeft:(0,o.ensureNotNull)(a.current).scrollLeft}))}return(0,r.useEffect)(()=>{c&&p(),h(e=>({...e,visible:c}))},[c]),(0,r.useEffect)(()=>{const e=a.current;return e&&e.addEventListener("scroll",m),()=>{e&&e.removeEventListener("scroll",m)}},[a]),[d,t?l:u,a,p]}},90692:(e,t,n)=>{"use strict";n.d(t,{MatchMedia:()=>o});var r=n(59496);class o extends r.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:()=>r});const r=n(59496).createContext(null)},27317:(e,t,n)=>{"use strict";n.d(t,{DEFAULT_MENU_THEME:()=>v,Menu:()=>g});var r=n(59496),o=n(97754),s=n.n(o),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 v=f;class g extends r.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,r,o,s;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:v,height:g}=u,_="function"==typeof a?a(v,g,d):a,C=h-(null!==(r=_.overrideWidth)&&void 0!==r?r:v)-0,E=(0,l.clamp)(_.x,0,Math.max(0,C)),w=0+p,y=d-(null!==(o=_.overrideHeight)&&void 0!==o?o:g)-0;let S=(0,l.clamp)(_.y,w,Math.max(w,y));if(_.forbidCorrectYCoord&&S<_.y&&(m-=_.y-S,S=_.y),t&&void 0!==this.props.closeOnScrollOutsideOffset&&_.y<=this.props.closeOnScrollOutsideOffset)return void this._handleGlobalClose(!0);const b=null!==(s=_.overrideHeight)&&void 0!==s?s:f?m:void 0;this.setState({appearingMenuHeight:t?this.state.appearingMenuHeight:b,appearingMenuWidth:t?this.state.appearingMenuWidth:_.overrideWidth,appearingPosition:{x:E,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":o,children:i,minWidth:l,theme:u=f,className:d,maxHeight:h,onMouseOver:v,onMouseOut:g,onKeyDown:C,onFocus:E,onBlur:w}=this.props,{appearingMenuHeight:y,appearingMenuWidth:S,appearingPosition:b,isMeasureValid:x}=this.state;return r.createElement(m.MenuContext.Provider,{value:this},r.createElement(p.SubmenuHandler,null,r.createElement(c.SlotContext.Provider,{value:this._manager},r.createElement("div",{id:e,role:t,"aria-labelledby":n,"aria-activedescendant":o,className:s()(d,u.menuWrap,!x&&u.isMeasuring),style:{height:y,left:b&&b.x,minWidth:l,position:"fixed",top:b&&b.y,width:S},"data-name":this.props["data-name"],ref:this._handleContainerRef,onScrollCapture:this.props.onScroll,onContextMenu:a.preventDefaultForContextMenu,tabIndex:this.props.tabIndex,onMouseOver:v,onMouseOut:g,onKeyDown:C,onFocus:E,onBlur:w},r.createElement("div",{className:s()(u.scrollWrap,!this.props.noMomentumBasedScroll&&u.momentumBased),style:{overflowY:void 0!==y?"scroll":"auto",maxHeight:h},onScrollCapture:this._handleScroll,ref:this._handleScrollWrapRef},r.createElement(_,{className:u.menuBox},i)))),r.createElement(c.Slot,{reference:this._handleSlot})))}update(e){e?this._resizeForced():this._resize()}}function _(e){const t=(0,i.ensureNotNull)((0,r.useContext)(p.SubmenuContext)),n=r.useRef(null);return r.createElement("div",{ref:n,className:e.className,onMouseOver:function(e){if(!(null!==t.current&&e.target instanceof Node&&(r=e.target,
null===(o=n.current)||void 0===o?void 0:o.contains(r))))return;var r,o;t.isSubmenuNode(e.target)||t.setCurrent(null)},"data-name":"menu-inner"},e.children)}g.contextType=p.SubmenuContext},1109:(e,t,n)=>{"use strict";n.d(t,{Separator:()=>i});var r=n(59496),o=n(97754),s=n(91626);function i(e){return r.createElement("div",{className:o(s.separator,e.className)})}},76594:(e,t,n)=>{"use strict";n.d(t,{OutsideEvent:()=>o});var r=n(58095);function o(e){const{children:t,...n}=e;return t((0,r.useOutsideEvent)(n))}},88216:(e,t,n)=>{"use strict";n.d(t,{OverlapManager:()=>s,getRootOverlapManager:()=>l});var r=n(88537);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 s{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 r=this._document.createElement("div");if(r.style.position=t.position,r.style.zIndex=this._index.toString(),r.dataset.id=e,void 0!==t.index){const e=this._container.childNodes.length;if(t.index>=e)this._container.appendChild(r);else if(t.index<=0)this._container.insertBefore(r,this._container.firstChild);else{const e=this._container.childNodes[t.index];this._container.insertBefore(r,e)}}else"reverse"===t.direction?this._container.insertBefore(r,this._container.firstChild):this._container.appendChild(r);return this._windows.set(e,r),++this._index,r}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,r.ensureDefined)(i.get(t));{const t=new s(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}}},86431:(e,t,n)=>{"use strict";n.d(t,{makeOverlapable:()=>s});var r=n(59496),o=n(65718);function s(e){return class extends r.PureComponent{render(){const{isOpened:t,root:n}=this.props;if(!t)return null;const s=r.createElement(e,{...this.props,zIndex:150});return"parent"===n?s:r.createElement(o.Portal,null,s)}}}},29197:(e,t,n)=>{"use strict"
;n.d(t,{CloseDelegateContext:()=>s});var r=n(59496),o=n(59064);const s=r.createContext(o.globalCloseDelegate)},50628:(e,t,n)=>{"use strict";n.d(t,{PopupMenu:()=>c});var r=n(59496),o=n(87995),s=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,r.useContext)(l.CloseDelegateContext),v=(0,a.useOutsideEvent)({handler:function(e){h&&h(e);if(!u)return;if(d&&e.target instanceof Node){const t=o.findDOMNode(d);if(t instanceof Node&&t.contains(e.target))return}p()},mouseDown:!0,touchStart:!0});return c?r.createElement(s.Portal,{top:"0",left:"0",right:"0",bottom:"0",pointerEvents:"none"},r.createElement("span",{ref:v,style:{pointerEvents:"auto"}},r.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 r=n(59496),o=n(87995),s=n(9423),i=n(88216),l=n(50655);class a extends r.PureComponent{constructor(){super(...arguments),this._uuid=(0,s.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||"",o.createPortal(r.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=r.createContext(null)},50655:(e,t,n)=>{"use strict";n.d(t,{Slot:()=>o,SlotContext:()=>s});var r=n(59496);class o extends r.Component{shouldComponentUpdate(){return!1}render(){return r.createElement("div",{style:{position:"fixed",zIndex:150,left:0,top:0},ref:this.props.reference})}}const s=r.createContext(null)},14758:(e,t,n)=>{"use strict";n.d(t,{SubmenuContext:()=>o,SubmenuHandler:()=>s});var r=n(59496);const o=r.createContext(null);function s(e){const[t,n]=(0,r.useState)(null),s=(0,r.useRef)(null),i=(0,r.useRef)(new Map);return(0,r.useEffect)(()=>()=>{null!==s.current&&clearTimeout(s.current)},[]),r.createElement(o.Provider,{value:{current:t,setCurrent:function(e){null!==s.current&&(clearTimeout(s.current),s.current=null);null===t?n(e):s.current=setTimeout(()=>{s.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)}},37257:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17" fill="currentColor"><path d="m.58 1.42.82-.82 15 15-.82.82z"/><path d="m.58 15.58 15-15 .82.82-15 15z"/></svg>'}}]);