Release v31.0.0 (from 028f81fbf6fef55e9694e5df4bd5106cc04c188a)

This commit is contained in:
jenkins
2026-03-05 21:03:46 +00:00
committed by Edward Dewhurst
parent 6fe5436603
commit c8eebb69a4
3622 changed files with 7663 additions and 6956 deletions

View File

@@ -0,0 +1,13 @@
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[5146],{14487:(e,t)=>{var r;!function(){"use strict";var s={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=n.apply(null,r);a&&e.push(a)}else if("object"===i)for(var o in r)s.call(r,o)&&r[o]&&e.push(o)}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(r=function(){return n}.apply(t,[]))||(e.exports=r)}()},43111:e=>{e.exports={wrap:"wrap-wXGVFOC9",wrapWithArrowsOuting:"wrapWithArrowsOuting-wXGVFOC9",wrapOverflow:"wrapOverflow-wXGVFOC9",scrollWrap:"scrollWrap-wXGVFOC9",noScrollBar:"noScrollBar-wXGVFOC9",icon:"icon-wXGVFOC9",scrollLeft:"scrollLeft-wXGVFOC9",scrollRight:"scrollRight-wXGVFOC9",isVisible:"isVisible-wXGVFOC9",iconWrap:"iconWrap-wXGVFOC9",fadeLeft:"fadeLeft-wXGVFOC9",fadeRight:"fadeRight-wXGVFOC9"}},73064:(e,t,r)=>{"use strict";r.d(t,{useFunctionalRefObject:()=>i});var s=r(79474),n=r(69947);function i(e){const t=(0,s.useMemo)((()=>function(e){const t=r=>{e(r),t.current=r};return t.current=null,t}((e=>{o.current(e)}))),[]),r=(0,s.useRef)(null),i=t=>{if(null===t)return a(r.current,t),void(r.current=null);r.current!==e&&(r.current=e,a(r.current,t))},o=(0,s.useRef)(i);return o.current=i,(0,n.useIsomorphicLayoutEffect)((()=>{if(null!==t.current)return o.current(t.current),()=>o.current(null)}),[e]),t}function a(e,t){null!==e&&("function"==typeof e?e(t):e.current=t)}},69947:(e,t,r)=>{"use strict";r.d(t,{useIsomorphicLayoutEffect:()=>n});var s=r(79474);function n(e,t){("undefined"==typeof window?s.useEffect:s.useLayoutEffect)(e,t)}},61366:(e,t,r)=>{"use strict";r.d(t,{useResizeObserver:()=>a});var s=r(79474),n=r(69947),i=r(73064);function a(e,t=[]){const{callback:r,ref:a=null}=function(e){return"function"==typeof e?{callback:e}:e}(e),o=(0,s.useRef)(null),l=(0,s.useRef)(r);l.current=r;const c=(0,i.useFunctionalRefObject)(a),u=(0,s.useCallback)((e=>{c(e),null!==o.current&&(o.current.disconnect(),null!==e&&o.current.observe(e))}),[c,o]);return(0,n.useIsomorphicLayoutEffect)((()=>(o.current=new ResizeObserver(((e,t)=>{l.current(e,t)})),c.current&&u(c.current),()=>{o.current?.disconnect()})),[c,...t]),u}},73457:(e,t,r)=>{"use strict";r.d(t,{Icon:()=>n});var s=r(79474);const n=s.forwardRef(((e,t)=>{const{icon:r="",title:n,ariaLabel:i,ariaLabelledby:a,ariaHidden:o,...l}=e,c=!!(n||i||a);return s.createElement("span",{role:"img",...l,ref:t,"aria-label":i,"aria-labelledby":a,"aria-hidden":o||!c,title:n,dangerouslySetInnerHTML:{__html:r}})}))},66334:(e,t,r)=>{"use strict";r.d(t,{Icon:()=>s.Icon});var s=r(73457)},69550:(e,t,r)=>{"use strict";function s(...e){return t=>{for(const r of e)void 0!==r&&r(t)}}r.d(t,{createSafeMulticastEventHandler:()=>s})},77766:(e,t,r)=>{"use strict";r.d(t,{FragmentMap:()=>n});var s=r(79474);function n(e){if(e.map){return s.Children.toArray(e.children).map(e.map)}return e.children}},4861:(e,t,r)=>{"use strict";r.d(t,{Measure:()=>n});var s=r(61366);function n(e){
const{children:t,onResize:r}=e;return t((0,s.useResizeObserver)(r||(()=>{}),[null===r]))}},53530:(e,t,r)=>{"use strict";r.d(t,{hoverMouseEventFilter:()=>a,useAccurateHover:()=>o,useHover:()=>n,useHoverDeprecated:()=>i});var s=r(79474);function n(){const[e,t]=(0,s.useState)(!1);return[e,{onMouseEnter:function(e){t(!0)},onMouseLeave:function(e){t(!1)}}]}function i(){const[e,t]=(0,s.useState)(!1);return[e,{onMouseOver:function(e){a(e)&&t(!0)},onMouseOut:function(e){a(e)&&t(!1)}}]}function a(e){return!e.currentTarget.contains(e.relatedTarget)}function o(e){const[t,r]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{const t=t=>{if(null===e.current)return;const s=e.current.contains(t.target);r(s)};return document.addEventListener("mouseover",t),()=>document.removeEventListener("mouseover",t)}),[]),t}},94178:(e,t,r)=>{"use strict";var s=r(67121);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,i,a){if(a!==s){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return r.PropTypes=r,r}},21896:(e,t,r)=>{e.exports=r(94178)()},67121:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},57012:e=>{e.exports={group:"group-MBOVGQRI",separator:"separator-MBOVGQRI",noLeftDecoration:"noLeftDecoration-MBOVGQRI",noRightDecoration:"noRightDecoration-MBOVGQRI",noMinimalWidth:"noMinimalWidth-MBOVGQRI",separatorWrap:"separatorWrap-MBOVGQRI"}},86270:e=>{e.exports={separator:"separator-xVhBjD5m"}},33510:e=>{e.exports={"css-value-header-toolbar-height":"38px",toolbar:"toolbar-qqNP9X6e",isHidden:"isHidden-qqNP9X6e",overflowWrap:"overflowWrap-qqNP9X6e",customButton:"customButton-qqNP9X6e",hover:"hover-qqNP9X6e",clicked:"clicked-qqNP9X6e"}},63658:e=>{e.exports={wrap:"wrap-_psvpUP2",icon:"icon-_psvpUP2"}},78104:e=>{e.exports={"css-value-header-toolbar-height":"38px",innerWrap:"innerWrap-OhqNVIYA",inner:"inner-OhqNVIYA",fake:"fake-OhqNVIYA",fill:"fill-OhqNVIYA",collapse:"collapse-OhqNVIYA",button:"button-OhqNVIYA",iconButton:"iconButton-OhqNVIYA",hidden:"hidden-OhqNVIYA",content:"content-OhqNVIYA",desktopTrade:"desktopTrade-OhqNVIYA",desktopPublish:"desktopPublish-OhqNVIYA",mobileTrade:"mobileTrade-OhqNVIYA",mobilePublish:"mobilePublish-OhqNVIYA"}},87918:(e,t,r)=>{"use strict";var s;function n(e){e.dispatchEvent(new CustomEvent("roving-tabindex:main-element"))}function i(e){e.dispatchEvent(new CustomEvent("roving-tabindex:secondary-element"))}r.d(t,{becomeMainElement:()=>n,becomeSecondaryElement:()=>i}),function(e){e.MainElement="roving-tabindex:main-element",e.SecondaryElement="roving-tabindex:secondary-element"}(s||(s={}))},28129:(e,t,r)=>{"use strict";r.d(t,{
INTERVALS:()=>n});var s=r(91599);const n=[{name:"",label:s.t(null,{context:"interval"},r(43757))},{name:"H",label:s.t(null,{context:"interval"},r(9))},{name:"D",label:s.t(null,{context:"interval"},r(31729))},{name:"W",label:s.t(null,{context:"interval"},r(48374))},{name:"M",label:s.t(null,{context:"interval"},r(54651))}]},2739:(e,t,r)=>{"use strict";r.d(t,{Toolbar:()=>d});var s=r(79474),n=r(85842),i=r(69550),a=r(47893),o=r(78122),l=r(87918),c=r(73064),u=r(24498);const d=(0,s.forwardRef)((function(e,t){const{onKeyDown:r,orientation:d,blurOnEscKeydown:h=!0,blurOnClick:m=!0,...p}=e,v=(0,c.useFunctionalRefObject)(t);return(0,s.useLayoutEffect)((()=>{const e=(0,n.ensureNotNull)(v.current),t=()=>{const t=(0,o.queryTabbableElements)(e).sort(o.navigationOrderComparator);if(0===t.length){const[t]=(0,o.queryFocusableElements)(e).sort(o.navigationOrderComparator);if(void 0===t)return;(0,l.becomeMainElement)(t)}if(t.length>1){const[,...e]=t;for(const t of e)(0,l.becomeSecondaryElement)(t)}};return window.addEventListener("keyboard-navigation-activation",t),()=>window.removeEventListener("keyboard-navigation-activation",t)}),[]),s.createElement("div",{...u.MouseClickAutoBlurHandler.attributes(m),...p,role:"toolbar","aria-orientation":d,ref:v,onKeyDown:(0,i.createSafeMulticastEventHandler)((function(e){if(e.defaultPrevented)return;if(!(document.activeElement instanceof HTMLElement))return;const t=(0,a.hashFromEvent)(e);if(h&&27===t)return e.preventDefault(),void document.activeElement.blur();if("vertical"!==d&&37!==t&&39!==t)return;if("vertical"===d&&38!==t&&40!==t)return;const r=e.currentTarget,s=(0,o.queryFocusableElements)(r).sort(o.navigationOrderComparator);if(0===s.length)return;const n=s.indexOf(document.activeElement);if(-1===n)return;e.preventDefault();const i=()=>{const e=(n+s.length-1)%s.length;(0,l.becomeSecondaryElement)(s[n]),(0,l.becomeMainElement)(s[e]),s[e].focus()},c=()=>{const e=(n+s.length+1)%s.length;(0,l.becomeSecondaryElement)(s[n]),(0,l.becomeMainElement)(s[e]),s[e].focus()};switch((0,o.mapKeyCodeToDirection)(t)){case"inlinePrev":"vertical"!==d&&i();break;case"inlineNext":"vertical"!==d&&c();break;case"blockPrev":"vertical"===d&&i();break;case"blockNext":"vertical"===d&&c()}}),r),"data-tooltip-show-on-focus":"true"})}))},94075:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HeaderToolbarRenderer:()=>Oe});var s=r(79474),n=r(29365),i=r(85842),a=r(14487),o=r.n(a),l=r(27323),c=r.n(l),u=r(89315),d=r(50586),h=r(75076),m=r(16905),p=r(96375),v=r(21896),f=r(72445),g=r(77766),S=r(86270);function b(e){return s.createElement("div",{className:o()(S.separator,e.className)})}var y=r(57012);function E(e){const{children:t,className:r,noLeftDecoration:n,noRightDecoration:i,noMinimalWidth:o,onClick:l,removeSeparator:c}=e;return s.createElement(s.Fragment,null,!c&&s.createElement("div",{className:y.separatorWrap},s.createElement(b,{className:y.separator})),s.createElement("div",{className:a(r,y.group,{[y.noMinimalWidth]:o,[y.noLeftDecoration]:n,[y.noRightDecoration]:i}),onClick:l},t))}
var C=r(4861),_=r(91599),w=r(66334),M=r(63658),k=r(1607);const R={text:_.t(null,void 0,r(40910))};function I(e){return s.createElement("div",{className:M.wrap},s.createElement(w.Icon,{className:M.icon,icon:k}),R.text)}var F=r(50181),V=r(36708),O=r(81458),T=r(1631),W=r(43111);const L={isVisibleScrollbar:!0,shouldMeasure:!0,hideButtonsFrom:1};function N(e){return s.createElement("div",{className:a(W.fadeLeft,e.className,{[W.isVisible]:e.isVisible})})}function A(e){return s.createElement("div",{className:a(W.fadeRight,e.className,{[W.isVisible]:e.isVisible})})}function D(e){return s.createElement(x,{...e,className:W.scrollLeft})}function B(e){return s.createElement(x,{...e,className:W.scrollRight})}function x(e){return s.createElement("div",{className:a(e.className,{[W.isVisible]:e.isVisible}),onClick:e.onClick},s.createElement("div",{className:W.iconWrap},s.createElement(w.Icon,{icon:T,className:W.icon})))}const P=function(e=D,t=B,r=N,n=A){var o;return(o=class extends s.PureComponent{constructor(e){super(e),this._scroll=s.createRef(),this._handleScrollLeft=()=>{if(this.props.onScrollButtonClick)return void this.props.onScrollButtonClick("left");const e=this.props.scrollStepSize||this.state.widthWrap-50;this.animateTo(Math.max(0,this.currentPosition()-e))},this._handleScrollRight=()=>{if(this.props.onScrollButtonClick)return void this.props.onScrollButtonClick("right");const e=this.props.scrollStepSize||this.state.widthWrap-50;this.animateTo(Math.min((this.state.widthContent||0)-(this.state.widthWrap||0),this.currentPosition()+e))},this._handleResizeWrap=([e])=>{const t=e.target.getBoundingClientRect();this.props.onMeasureWrap&&this.props.onMeasureWrap(t),this.setState({widthWrap:t.width}),this._checkButtonsVisibility()},this._handleResizeContent=([e])=>{const t=e.target.getBoundingClientRect();this.props.onMeasureContent&&this.props.onMeasureContent(t);const{shouldDecreaseWidthContent:r,buttonsWidthIfDecreasedWidthContent:s}=this.props;r&&s?this.setState({widthContent:t.width+2*s}):this.setState({widthContent:t.width})},this._handleScroll=()=>{const{onScroll:e}=this.props;e&&e(this.currentPosition(),this.isAtLeft(),this.isAtRight()),this._checkButtonsVisibility()},this._checkButtonsVisibility=()=>{const{isVisibleLeftButton:e,isVisibleRightButton:t}=this.state,r=this.isAtLeft(),s=this.isAtRight();r||e?r&&e&&this.setState({isVisibleLeftButton:!1}):this.setState({isVisibleLeftButton:!0}),s||t?s&&t&&this.setState({isVisibleRightButton:!1}):this.setState({isVisibleRightButton:!0})},this.state={widthContent:0,widthWrap:0,isVisibleRightButton:!1,isVisibleLeftButton:!1}}componentDidMount(){this._checkButtonsVisibility()}componentDidUpdate(e,t){t.widthWrap===this.state.widthWrap&&t.widthContent===this.state.widthContent||this._handleScroll()}currentPosition(){return this._scroll.current?(0,O.isRtl)()?(0,O.getLTRScrollLeft)(this._scroll.current):this._scroll.current.scrollLeft:0}isAtLeft(){return!this._isOverflowed()||this.currentPosition()<=(0,i.ensureDefined)(this.props.hideButtonsFrom)}isAtRight(){
return!this._isOverflowed()||this.currentPosition()+this.state.widthWrap>=this.state.widthContent-(0,i.ensureDefined)(this.props.hideButtonsFrom)}animateTo(e,t=V.dur){const r=this._scroll.current;r&&((0,O.isRtl)()&&(e=(0,O.getLTRScrollLeftOffset)(r,e)),t<=0?r.scrollLeft=Math.round(e):(0,F.doAnimate)({onStep(e,t){r.scrollLeft=Math.round(t)},from:r.scrollLeft,to:Math.round(e),easing:V.easingFunc.easeInOutCubic,duration:t}))}render(){const{children:i,isVisibleScrollbar:o,isVisibleFade:l,isVisibleButtons:c,shouldMeasure:u,shouldDecreaseWidthContent:d,buttonsWidthIfDecreasedWidthContent:h,onMouseOver:m,onMouseOut:p,scrollWrapClassName:v,fadeClassName:f}=this.props,{isVisibleRightButton:g,isVisibleLeftButton:S}=this.state,b=d&&h;return s.createElement(C.Measure,{onResize:u?this._handleResizeWrap:null},(d=>s.createElement("div",{className:W.wrapOverflow,onMouseOver:m,onMouseOut:p,ref:d},s.createElement("div",{className:a(W.wrap,b?W.wrapWithArrowsOuting:"")},s.createElement("div",{className:a(W.scrollWrap,v,{[W.noScrollBar]:!o}),onScroll:this._handleScroll,ref:this._scroll},s.createElement(C.Measure,{onResize:u?this._handleResizeContent:null},i)),l&&s.createElement(r,{isVisible:S,className:f}),l&&s.createElement(n,{isVisible:g,className:f}),c&&s.createElement(e,{onClick:this._handleScrollLeft,isVisible:S}),c&&s.createElement(t,{onClick:this._handleScrollRight,isVisible:g})))))}_isOverflowed(){const{widthContent:e,widthWrap:t}=this.state;return e>t}}).defaultProps=L,o}(D,B,N,A);var H,q=r(63484);!function(e){e.SymbolSearch="header-toolbar-symbol-search",e.Intervals="header-toolbar-intervals",e.ChartStyles="header-toolbar-chart-styles",e.Compare="header-toolbar-compare",e.Indicators="header-toolbar-indicators",e.StudyTemplates="header-toolbar-study-templates",e.Dropdown="header-toolbar-dropdown",e.Alerts="header-toolbar-alerts",e.Layouts="header-toolbar-layouts",e.SaveLoad="header-toolbar-save-load",e.UndoRedo="header-toolbar-undo-redo",e.Properties="header-toolbar-properties",e.QuickSearch="header-toolbar-quick-search",e.TradeDesktop="header-toolbar-trade-desktop",e.TradeMobile="header-toolbar-trade-mobile",e.PublishDesktop="header-toolbar-publish-desktop",e.PublishMobile="header-toolbar-publish-mobile",e.Fullscreen="header-toolbar-fullscreen",e.Screenshot="header-toolbar-screenshot",e.TelegramShare="header-toolbar-telegram-share",e.Replay="header-toolbar-replay",e.Financials="header-toolbar-financials"}(H||(H={}));var z=r(53530),G=r(77907),X=r(2739),U=r(78104);const Y=(0,G.registryContextType)(),Q=(0,m.isFeaturesetEnabled)("widget");class j extends s.PureComponent{constructor(e,t){super(e,t),this._handleMouseOver=e=>{(0,z.hoverMouseEventFilter)(e)&&this.setState({isHovered:!0})},this._handleMouseOut=e=>{(0,z.hoverMouseEventFilter)(e)&&this.setState({isHovered:!1})},this._handleInnerResize=([e])=>{const t=e.contentRect.width,{onWidthChange:r}=this.props;r&&r(t)},this._handleMeasureAvailableSpace=e=>{const{onAvailableSpaceChange:t}=this.props;t&&t(e.width)},this._processCustoms=(e,t=!1)=>{
const{isFake:r,displayMode:n}=this.props,{tools:i}=this.context;return e.map((e=>s.createElement(E,{key:e.id,removeSeparator:t},(e=>{switch(e.type){case"Button":return s.createElement(i.Custom,{...e.params,isFake:r});case"TradingViewStyledButton":return s.createElement(i.CustomTradingViewStyledButton,{...e.params,className:U.button,displayMode:n});case"Dropdown":return s.createElement(i.Dropdown,{displayMode:n,params:e.params});default:return null}})(e))))},this._fixLastGroup=(e,t,r)=>{if(t===r.length-1&&s.isValidElement(e)&&e.type===E){const t=void 0!==this.context.tools.Publish&&!this.props.readOnly;return s.cloneElement(e,{noRightDecoration:t})}return e},this._handleDialogToolsChange=e=>{this.setState({activeDialogToolsConfig:e})},(0,G.validateRegistry)(t,{tools:v.any.isRequired}),this.state={isHovered:!1,activeDialogToolsConfig:null}}componentDidMount(){0}componentWillUnmount(){0}render(){const{tools:e}=this.context,{readOnly:t,showScrollbarWhen:r,displayMode:n,isFake:i=!1}=this.props,{isHovered:o}=this.state,l=r.includes(n);return s.createElement(X.Toolbar,{className:a(U.inner,{[U.fake]:i}),onContextMenu:q.preventDefaultForContextMenu,"data-is-fake-main-panel":i,"aria-hidden":i},s.createElement(P,{isVisibleFade:f.mobiletouch&&l,isVisibleButtons:!f.mobiletouch&&l&&o,isVisibleScrollbar:!1,shouldMeasure:!i,onMouseOver:this._handleMouseOver,onMouseOut:this._handleMouseOut,onMeasureWrap:this._handleMeasureAvailableSpace},(e=>s.createElement("div",{className:U.content,ref:e,role:"none"},s.createElement(C.Measure,{onResize:i?this._handleInnerResize:null},(e=>s.createElement("div",{className:U.innerWrap,ref:e},this.state.activeDialogToolsConfig?this._renderDialogTools():s.createElement(g.FragmentMap,{map:this._fixLastGroup},this._renderLeftTools(),this._renderRightTools()))))))),!t&&!i&&!this.state.activeDialogToolsConfig&&s.createElement(s.Fragment,null,!1,e.Publish&&!(0,m.isFeaturesetEnabled)("hide_publish_button")&&s.createElement(e.Publish,{id:H.PublishDesktop,className:U.desktopPublish})))}_trackFullscreenButtonClick(){0}_renderLeftTools(){const{tools:e}=this.context,{features:t,displayMode:r,studyMarket:n,leftCustomElements:i,readOnly:a,isFake:o=!1}=this.props;if(a)return null;const l=this._processCustoms(i);return s.Children.toArray([(e.SymbolSearch||!Q&&e.Compare)&&s.createElement(E,{key:"symbol"},e.SymbolSearch&&s.createElement(e.SymbolSearch,{id:o?void 0:H.SymbolSearch,isFake:o,isActionsVisible:t.allowSymbolSearchSpread}),e.Compare&&s.createElement(e.Compare,{id:o?void 0:H.Compare,className:U.button,displayMode:r})),e.DateRange&&s.createElement(E,{key:"range"},s.createElement(e.DateRange,null)),e.Intervals&&s.createElement(E,{key:"intervals"},s.createElement(e.Intervals,{id:o?void 0:H.Intervals,isShownQuicks:t.allowFavoriting,isFavoritingAllowed:t.allowFavoriting,displayMode:r,isFake:o})),e.Bars&&s.createElement(E,{key:"styles"},s.createElement(e.Bars,{id:o?void 0:H.ChartStyles,isShownQuicks:t.allowFavoriting,isFavoritingAllowed:t.allowFavoriting,displayMode:r,isFake:o
})),Q&&e.Compare&&!e.SymbolSearch&&s.createElement(E,{key:"compare"},s.createElement(e.Compare,{id:o?void 0:H.Compare,className:U.button,displayMode:r})),e.Indicators&&s.createElement(E,{key:"indicators"},s.createElement(e.Indicators,{id:o?void 0:H.Indicators,className:U.button,studyMarket:n,displayMode:r}),e.Templates&&s.createElement(e.Templates,{id:o?void 0:H.StudyTemplates,isShownQuicks:t.allowFavoriting,isFavoritingAllowed:t.allowFavoriting,displayMode:r})),e.Alert&&s.createElement(E,{key:"alert"},s.createElement(e.Alert,{id:o?void 0:H.Alerts,className:U.button,displayMode:r}),e.Replay&&s.createElement(e.Replay,{id:o?void 0:H.Replay,className:U.button,displayMode:r})),e.AlertReferral&&!(0,m.isFeaturesetEnabled)("hide_alert_referral_tool")&&s.createElement(E,{key:"alert-referral"},s.createElement(e.AlertReferral,{className:U.button,displayMode:r})),e.ScalePercentage&&s.createElement(E,{key:"percentage"},s.createElement(e.ScalePercentage,null)),e.ScaleLogarithm&&s.createElement(E,{key:"logarithm"},s.createElement(e.ScaleLogarithm,null)),...l])}_renderRightTools(){const{tools:e}=this.context,{features:t,displayMode:r,chartSaver:n,readOnly:i,saveLoadSyncEmitter:o,rightCustomElements:l,isFake:c=!1}=this.props,u=this._processCustoms(l);return J(s.Children.toArray([i&&s.createElement(E,{key:"view-only-badge",removeSeparator:!0},s.createElement(I,null)),!i&&e.UndoRedo&&s.createElement(E,{key:"undo-redo"},s.createElement(e.UndoRedo,{id:c?void 0:H.UndoRedo})),s.createElement(E,{removeSeparator:!0,key:"gap-1",className:a(U.fill,c&&U.collapse)}),(e.Layout||e.SaveLoad)&&s.createElement(E,{key:"layout",removeSeparator:!0},!i&&e.Layout&&s.createElement(e.Layout,{id:c?void 0:H.Layouts}),e.SaveLoad&&s.createElement(e.SaveLoad,{id:c?void 0:H.SaveLoad,chartSaver:n,isReadOnly:i,displayMode:r,isFake:c,stateSyncEmitter:o})),e.SaveLoadReferral&&s.createElement(E,{key:"save-load-referral"},s.createElement(e.SaveLoadReferral,{isReadOnly:i,displayMode:r})),t.showLaunchInPopupButton&&e.OpenPopup&&!(0,m.isFeaturesetEnabled)("hide_open_popup_button")&&s.createElement(E,{key:"popup"},s.createElement(e.OpenPopup,null)),!i&&!Q&&(e.Properties||e.Fullscreen||e.Screenshot)&&s.createElement(E,{key:"properties"},!i&&e.QuickSearch&&s.createElement(e.QuickSearch,{id:c?void 0:H.QuickSearch,className:U.iconButton}),!i&&e.Properties&&s.createElement(e.Properties,{id:c?void 0:H.Properties,className:U.iconButton}),s.createElement(s.Fragment,null,!i&&e.Fullscreen&&s.createElement(E,{key:"fullscreen",onClick:this._trackFullscreenButtonClick,removeSeparator:!0},s.createElement(e.Fullscreen,{id:c?void 0:H.Fullscreen,clickArea:"top toolbar"})),!Q&&e.Screenshot&&s.createElement(e.Screenshot,{id:c?void 0:H.Screenshot,className:U.iconButton}))),Q&&!i&&e.Fullscreen&&s.createElement(E,{key:"fullscreen",onClick:this._trackFullscreenButtonClick,removeSeparator:!0},s.createElement(e.Fullscreen,{id:c?void 0:H.Fullscreen,clickArea:"top toolbar"})),Q&&e.Screenshot&&s.createElement(E,{key:"screenshot",removeSeparator:!0},s.createElement(e.Screenshot,{
id:c?void 0:H.Screenshot,className:U.iconButton})),Q&&!1,!i&&!1,!i&&e.Publish&&!(0,m.isFeaturesetEnabled)("hide_publish_button")&&s.createElement(E,{key:"publish",className:U.mobilePublish,removeSeparator:!0},s.createElement(e.Publish,{id:c?void 0:H.PublishMobile})),...u]))}_renderDialogTools(){const{tools:e}=this.context,{isFake:t,features:r}=this.props,{activeDialogToolsConfig:n}=this.state;if(!n)return null;const i=this._processCustoms(n.customElements,!0);return s.createElement(s.Fragment,null,s.createElement(g.FragmentMap,{map:this._fixLastGroup},s.Children.toArray([e.SymbolSearch&&s.createElement(E,{key:"symbol"},s.createElement(e.SymbolSearch,{id:t?void 0:H.SymbolSearch,isActionsVisible:r.allowSymbolSearchSpread})),...i]),J(s.Children.toArray([s.createElement(E,{removeSeparator:!0,key:"gap-1",className:a(U.fill,t&&U.collapse)})]))))}}var K;function J(e){return[e.findIndex((e=>s.isValidElement(e)&&!!e.key&&-1!==e.key.toString().indexOf("view-only-badge")))].filter((e=>e>=0)).forEach((t=>{e=s.Children.map(e,((e,r)=>{if(s.isValidElement(e)){switch([t-1,t,t+1].indexOf(r)){case 0:const t={noRightDecoration:!0};e=s.cloneElement(e,t);break;case 1:const r={noLeftDecoration:!0,noRightDecoration:!0};e=s.cloneElement(e,r);break;case 2:const n={noLeftDecoration:!0};e=s.cloneElement(e,n)}}return e}))})),e}j.contextType=Y,function(e){e[e.Left=0]="Left",e[e.Self=1]="Self",e[e.Right=2]="Right"}(K||(K={}));var $=r(89659),Z=r(85388);class ee extends Z.CommonJsonStoreService{constructor(e,t,r=[]){super(e,t,"FAVORITE_CHART_STYLES_CHANGED","StyleWidget.quicks",r)}}var te=r(77555),re=r(25693);class se extends Z.AbstractJsonStoreService{constructor(e,t,r){super(e,t,"FAVORITE_INTERVALS_CHANGED","IntervalWidget.quicks",r)}_serialize(e){return(0,re.uniq)(e.map(te.normalizeIntervalString))}_deserialize(e){return(0,re.uniq)((0,te.convertResolutionsFromSettings)(e).filter(te.isResolutionMultiplierValid).map(te.normalizeIntervalString))}}var ne=r(70761),ie=r(36870),ae=r(82287),oe=r(69735);class le extends Z.AbstractJsonStoreService{constructor(e,t,r=[]){super(e,t,"CUSTOM_INTERVALS_CHANGED","IntervalWidget.intervals",r)}set(e,t){const r=()=>{super.set(e,t)};e.length,this.get().length,r()}_serialize(e){return(0,re.uniq)(e.map(te.normalizeIntervalString))}_deserialize(e){return(0,re.uniq)([...(0,te.convertResolutionsFromSettings)(e).filter(te.isResolutionMultiplierValid).map(te.normalizeIntervalString)])}}const ce=new le(oe.TVXWindowEvents,ae);var ue=r(28129);class de{constructor(e){this._customIntervalsService=ce,this._supportedIntervalsMayChange=new ie.Delegate,this._fireSupportedIntervalsMayChange=()=>{this._supportedIntervalsMayChange.fire()},this._resolutionGetter=()=>[],this._resolutionGetter=e,ne.linking.supportedResolutions.subscribe(this._fireSupportedIntervalsMayChange),ne.linking.range.subscribe(this._fireSupportedIntervalsMayChange),ne.linking.seconds.subscribe(this._fireSupportedIntervalsMayChange),ne.linking.ticks.subscribe(this._fireSupportedIntervalsMayChange),
ne.linking.intraday.subscribe(this._fireSupportedIntervalsMayChange),ne.linking.dataFrequencyResolution.subscribe(this._fireSupportedIntervalsMayChange)}destroy(){ne.linking.supportedResolutions.unsubscribe(this._fireSupportedIntervalsMayChange),ne.linking.range.unsubscribe(this._fireSupportedIntervalsMayChange),ne.linking.seconds.unsubscribe(this._fireSupportedIntervalsMayChange),ne.linking.ticks.unsubscribe(this._fireSupportedIntervalsMayChange),ne.linking.intraday.unsubscribe(this._fireSupportedIntervalsMayChange),ne.linking.dataFrequencyResolution.unsubscribe(this._fireSupportedIntervalsMayChange)}getDefaultIntervals(){return this._resolutionGetter?this._resolutionGetter().map(te.normalizeIntervalString):[]}getCustomIntervals(){return this._customIntervalsService.get()}add(e,t,r){if(!this.isValidInterval(e,t))return null;const s=(0,te.normalizeIntervalString)(`${e}${t}`),n=this.getCustomIntervals();return this._isIntervalDefault(s)||n.includes(s)?null:(this._customIntervalsService.set((0,te.sortResolutions)([...n,s])),s)}remove(e){this._customIntervalsService.set(this.getCustomIntervals().filter((t=>t!==e)))}isValidInterval(e,t){return(0,te.isResolutionMultiplierValid)(`${e}${t}`)}isSupportedInterval(e){return(0,te.isAvailable)(e)}supportedIntervalsMayChange(){return this._supportedIntervalsMayChange}getOnChange(){return this._customIntervalsService.getOnChange()}getPossibleIntervals(){return ue.INTERVALS}getResolutionUtils(){return{getMaxResolutionValue:te.getMaxResolutionValue,getTranslatedResolutionModel:te.getTranslatedResolutionModel,mergeResolutions:te.mergeResolutions,sortResolutions:te.sortResolutions}}_isIntervalDefault(e){return this.getDefaultIntervals().includes(e)}}var he=r(93304);function me(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")}const pe={};let ve=null;class fe{constructor(e=ae){this._favorites=[],this._favoritesChanged=new ie.Delegate,this._settings=e,oe.TVXWindowEvents.on("StudyFavoritesChanged",(e=>{const t=JSON.parse(e);this._loadFromState(t.favorites||[])})),this._settings.onSync.subscribe(this,this._loadFavs),this._loadFavs()}isFav(e){const t=this.favId(e);return-1!==this._findFavIndex(t)}toggleFavorite(e){this.isFav(e)?this.removeFavorite(e):this.addFavorite(e)}addFavorite(e){const t=this.favId(e);this._favorites.push(Se(t)),this._favoritesChanged.fire(t),this._saveFavs()}removeFavorite(e){const t=this.favId(e),r=this._findFavIndex(t);-1!==r&&(this._favorites.splice(r,1),this._favoritesChanged.fire(t)),this._saveFavs()}favId(e){return me(e)}favorites(){return this._favorites}favoritePineIds(){return this._favorites.filter((e=>"pine"===e.type)).map((e=>e.pineId))}favoritesChanged(){return this._favoritesChanged}static getInstance(){return null===ve&&(ve=new fe),ve}static create(e){return new fe(e)}_loadFavs(){const e=this._settings.getJSON("studyMarket.favorites",[]);this._loadFromState(e)}_saveFavs(){const e=this._stateToSave();this._settings.setJSON("studyMarket.favorites",e,{forceFlush:!0}),oe.TVXWindowEvents.emit("StudyFavoritesChanged",JSON.stringify({favorites:e}))}
_stateToSave(){return this._favorites.map(ge)}_loadFromState(e){this._favorites=e.map((e=>Se(function(e){return e in pe?pe[e]:e}(e)))),this._favoritesChanged.fire()}_findFavIndex(e){return this._favorites.findIndex((t=>e===ge(t)))}}function ge(e){return"java"===e.type?e.studyId:e.pineId}function Se(e){return isPineIdString(e)?{type:"pine",pineId:e}:{type:"java",studyId:e}}var be=r(97792);const ye={[be.ResolutionKind.Ticks]:!1,[be.ResolutionKind.Seconds]:!1,[be.ResolutionKind.Minutes]:!1,[be.SpecialResolutionKind.Hours]:!1,[be.ResolutionKind.Days]:!1,[be.ResolutionKind.Range]:!1};class Ee extends Z.CommonJsonStoreService{constructor(e,t,r=ye){super(e,t,"INTERVALS_MENU_VIEW_STATE_CHANGED","IntervalWidget.menu.viewState",r)}isAllowed(e){return Object.keys(ye).includes(e)}}Z.CommonJsonStoreService;const Ce={Area:3,"HLC area":16,Bars:0,Candles:1,"Heiken Ashi":8,"Hollow Candles":9,Line:2,Renko:4,Kagi:5,"Point & figure":6,"Line Break":7,Baseline:10,LineWithMarkers:14,Stepline:15,Columns:13,"High-low":12},_e=["1","30","60"];function we(e=[]){let t=e.map((e=>Ce[e]))||[1,4,5,6];return(0,m.isFeaturesetEnabled)("widget")&&(t=[0,1,3]),t}function Me(e=[]){return(0,te.mergeResolutions)(e,(0,m.isFeaturesetEnabled)("star_some_intervals_by_default")?_e:[])}new se(oe.TVXWindowEvents,ae,Me()),new ee(oe.TVXWindowEvents,ae,we());const ke={tools:v.any.isRequired,isFundamental:v.any,chartApiInstance:v.any,availableTimeFrames:v.any,chartWidgetCollection:v.any,windowMessageService:v.any,favoriteChartStylesService:v.any,favoriteIntervalsService:v.any,intervalService:v.any,recentStudyTemplatesService:v.any,studyTemplates:v.any,chartChangesWatcher:v.any,saveChartService:v.any,sharingChartService:v.any,loadChartService:v.any,chartWidget:v.any,favoriteScriptsModel:v.any,intervalsMenuViewStateService:v.any,templatesMenuViewStateService:v.any,openGlobalSearch:v.any,snapshotUrl:v.any};var Re=r(87099),Ie=r(33510);const Fe=[];class Ve extends s.PureComponent{constructor(e){super(e),this._saveLoadSyncEmitter=new(c()),this._handleFullWidthChange=e=>{this._fullWidth=e,this.setState({measureValid:!1})},this._handleFavoritesWidthChange=e=>{this._favoritesWidth=e,this.setState({measureValid:!1})},this._handleCollapseWidthChange=e=>{this._collapseWidth=e,this.setState({measureValid:!1})},this._handleMeasure=e=>{this.setState({availableWidth:e,measureValid:!1})};const{tools:t,windowMessageService:r,chartWidgetCollection:s,chartApiInstance:n,availableTimeFrames:a,isFundamental:o,favoriteIntervalsService:l,favoriteChartStylesService:d,recentStudyTemplatesService:h,studyTemplates:p,saveChartService:v,sharingChartService:f,loadChartService:g,snapshotUrl:S,openGlobalSearch:b}=e;this._showScrollbarWhen=(0,i.ensureDefined)(e.allowedModes).slice(-1),this.resizerBridge=e.resizerBridge,this._panelWidthChangeHandlers={full:this._handleFullWidthChange,medium:this._handleFavoritesWidthChange,small:this._handleCollapseWidthChange};const{chartChangesWatcher:y}=e;this._chartChangesWatcher=y;const E=we(this.props.defaultFavoriteStyles)
;this._favoriteChartStylesService=d||new ee(oe.TVXWindowEvents,ae,E);const C=Me(this.props.defaultFavoriteIntervals);this._favoriteIntervalsService=l||new se(oe.TVXWindowEvents,ae,C),this._intervalsMenuViewStateService=new Ee(oe.TVXWindowEvents,ae),this._intervalService=new de(n.defaultResolutions),this._registry={tools:t,isFundamental:o,chartWidgetCollection:s,windowMessageService:r,chartApiInstance:n,availableTimeFrames:a,recentStudyTemplatesService:h,studyTemplates:p,saveChartService:v,sharingChartService:f,loadChartService:g,intervalsMenuViewStateService:this._intervalsMenuViewStateService,favoriteChartStylesService:this._favoriteChartStylesService,favoriteIntervalsService:this._favoriteIntervalsService,intervalService:this._intervalService,chartChangesWatcher:this._chartChangesWatcher,chartWidget:s.activeChartWidget.value(),favoriteScriptsModel:fe.getInstance(),templatesMenuViewStateService:this._templatesMenuVuewStateService,snapshotUrl:S,openGlobalSearch:b},this.state={isVisible:!0,availableWidth:0,displayMode:"full",measureValid:!1,leftCustomElements:[],rightCustomElements:[]},this._readOnly=s.readOnly(),this._features={allowFavoriting:(0,m.isFeaturesetEnabled)("items_favoriting"),showIdeasButton:Boolean(this.props.ideas),showLaunchInPopupButton:Boolean(this.props.popupButton),allowSymbolSearchSpread:(0,m.isFeaturesetEnabled)("header_symbol_search")&&(0,m.isFeaturesetEnabled)("show_spread_operators"),allowToolbarHiding:(0,m.isFeaturesetEnabled)("collapsible_header")},this._setDisplayMode=(0,u.default)(this._setDisplayMode,100),this._negotiateResizer()}componentDidUpdate(e,t){const{isVisible:r,measureValid:s}=this.state;r!==t.isVisible&&(p.emit("toggle_header",r),this._negotiateResizer()),s||this._setDisplayMode()}render(){const{resizerBridge:e,allowedModes:t,...r}=this.props,{displayMode:n,isVisible:o,leftCustomElements:l,rightCustomElements:c}=this.state,u={features:this._features,readOnly:this._readOnly,isFake:!1,saveLoadSyncEmitter:this._saveLoadSyncEmitter,leftCustomElements:l,rightCustomElements:c,...r},d={...u,isFake:!0,showScrollbarWhen:Fe},h=(0,i.ensureDefined)(t),m=this.props.tools.PublishButtonManager||s.Fragment;return s.createElement(G.RegistryProvider,{value:this._registry,validation:ke},s.createElement(m,null,s.createElement("div",{className:a(Ie.toolbar,{[Ie.isHidden]:!o}),onClick:this.props.onClick},s.createElement("div",{className:Ie.overflowWrap},h.map((e=>s.createElement(j,{key:e,displayMode:e,onWidthChange:this._panelWidthChangeHandlers[e],...d}))),s.createElement(j,{key:"live",showScrollbarWhen:this._showScrollbarWhen,displayMode:n,onAvailableSpaceChange:this._handleMeasure,...u})))))}addButton(e,t){if(!t.useTradingViewStyle)return this._addCustomHTMLButton(e,t.align);this._addCustomTradingViewStyledButton(e,t)}removeButton(e){const{leftCustomElements:t,rightCustomElements:r}=this.state;if((0,d.default)(e))this._removeCustomElementToState(e);else{const s=t=>"element"in t.params&&t.params.element===e,n=t.find(s)?.id??r.find(s)?.id;(0,h.default)(n)||this._removeCustomElementToState(n)}}
addDropdown(e,t){const{leftCustomElements:r,rightCustomElements:s}=this.state,n={type:"Dropdown",id:e,params:t};"left"===t.align?this.setState({leftCustomElements:[...r,n]}):this.setState({rightCustomElements:[...s,n]})}updateDropdown(e,t){const r=t=>"Dropdown"===t.type&&t.id===e,s=this.state.leftCustomElements.find(r)||this.state.rightCustomElements.find(r);void 0!==s&&(s.params={...s.params,...t},this.setState({leftCustomElements:this.state.leftCustomElements.slice(),rightCustomElements:this.state.rightCustomElements.slice()}))}removeDropdown(e){const t=t=>"Dropdown"===t.type&&t.id!==e,r=this.state.leftCustomElements.filter(t),s=this.state.rightCustomElements.filter(t);this.setState({leftCustomElements:r,rightCustomElements:s})}_negotiateResizer(){this.props.resizerBridge.negotiateHeight(this.state.isVisible?he.HEADER_TOOLBAR_HEIGHT_EXPANDED:he.HEADER_TOOLBAR_HEIGHT_COLLAPSED)}_setDisplayMode(){const{availableWidth:e}=this.state,{allowedModes:t}=this.props,r={full:this._fullWidth,medium:this._favoritesWidth,small:this._collapseWidth},s=(0,i.ensureDefined)(t);let n=s.map((e=>r[e])).findIndex((t=>e>=t));-1===n&&(n=s.length-1);const a=s[n];this.setState({measureValid:!0,displayMode:a})}_addCustomHTMLButton(e,t="left"){const r=new $.WatchedValue(0),s=(0,Re.parseHtmlElement)(`<div class="apply-common-tooltip ${Ie.customButton}">`),n={type:"Button",id:e,params:{key:Number(new Date),element:s,width:r}};return this._addCustomElementToState(t,n),s}_addCustomTradingViewStyledButton(e,t){const r={type:"TradingViewStyledButton",id:e,params:{key:Number(new Date),text:t.text,title:t.title,onClick:t.onClick}};this._addCustomElementToState(t.align,r)}_addCustomElementToState(e,t){const{leftCustomElements:r,rightCustomElements:s}=this.state;"left"===e?this.setState({leftCustomElements:[...r,t]}):this.setState({rightCustomElements:[...s,t]})}_removeCustomElementToState(e){this.setState({leftCustomElements:this.state.leftCustomElements.filter((t=>t.id!==e)),rightCustomElements:this.state.rightCustomElements.filter((t=>t.id!==e))})}}Ve.defaultProps={allowedModes:["full","medium"]};class Oe{constructor(e,t){this._component=null,this._handleRef=e=>{this._component=e},this._container=e,n.render(s.createElement(Ve,{...t,ref:this._handleRef}),this._container)}destroy(){n.unmountComponentAtNode(this._container)}getComponent(){return(0,i.ensureNotNull)(this._component)}}},77907:(e,t,r)=>{"use strict";r.d(t,{RegistryProvider:()=>l,registryContextType:()=>c,validateRegistry:()=>o});var s=r(79474),n=r(21896),i=r.n(n);const a=s.createContext({});function o(e,t){i().checkPropTypes(t,e,"context","RegistryContext")}function l(e){const{validation:t,value:r}=e;return o(r,t),s.createElement(a.Provider,{value:r},e.children)}function c(){return a}},1631:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 10" width="20" height="10"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M2 1l8 8 8-8"/></svg>'},1607:e=>{
e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><path fill="currentColor" fill-rule="evenodd" d="M4.56 14a10.05 10.05 0 00.52.91c.41.69 1.04 1.6 1.85 2.5C8.58 19.25 10.95 21 14 21c3.05 0 5.42-1.76 7.07-3.58A17.18 17.18 0 0023.44 14a9.47 9.47 0 00-.52-.91c-.41-.69-1.04-1.6-1.85-2.5C19.42 8.75 17.05 7 14 7c-3.05 0-5.42 1.76-7.07 3.58A17.18 17.18 0 004.56 14zM24 14l.45-.21-.01-.03a7.03 7.03 0 00-.16-.32c-.11-.2-.28-.51-.5-.87-.44-.72-1.1-1.69-1.97-2.65C20.08 7.99 17.45 6 14 6c-3.45 0-6.08 2-7.8 3.92a18.18 18.18 0 00-2.64 3.84v.02h-.01L4 14l-.45-.21-.1.21.1.21L4 14l-.45.21.01.03a5.85 5.85 0 00.16.32c.11.2.28.51.5.87.44.72 1.1 1.69 1.97 2.65C7.92 20.01 10.55 22 14 22c3.45 0 6.08-2 7.8-3.92a18.18 18.18 0 002.64-3.84v-.02h.01L24 14zm0 0l.45.21.1-.21-.1-.21L24 14zm-10-3a3 3 0 100 6 3 3 0 000-6zm-4 3a4 4 0 118 0 4 4 0 01-8 0z"/></svg>'}}]);