"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[3229],{167314:(t,e,s)=>{s(566953);var i=s(650151),o=s(290484),a=(s(668159),s(522977)),l=s(901107),n=s(248213),r=s(125388),h=s(410899),d=s(596080),g=s(185162),c=s(471771),m=(s(281786),s(24261),s(711196),s(497754)),w=s.n(m),b=(s(486393),s(213398),s(960095)),u=s(724377),p=s(745269),C=s(17966),_=s(607546),v=s(599612),y=s(630440),f=s(432059),k=s(197439),L=s(81951),S=s(889267),T=s(79342),F=s(254688),M=s(817099),j=s(600303),P=s(719240),$=s(375397),D=s(563360),N=s(62802),W=s(338619),B=s(883427),E=s(431057),q=s(39654),U=(s(807801),s(384961),s(486393)),x=s(213398);const A=(0,W.getLogger)("WidgetWatchlist"),H=["symbolActiveColor","symbolShortNameColor","symbolDescriptionColor","symbolSeparatorColor","tabActiveColor","tabInactiveColor","tabSliderColor","changeUpColor","changeDownColor","changeNeutralColor","lastColor","lastGrowingFlashColor","lastFallingFlashColor"],O=["plotLineColor","plotLineColorGrowing","plotLineColorFalling","gridLineColor","scaleFontColor","belowLineFillColorGrowing","belowLineFillColorFalling","belowLineFillColorGrowingBottom","belowLineFillColorFallingBottom","lastPriceLineColor","lastPriceLineColorGrowing","lastPriceLineColorFalling"];class R{constructor(t,e){if(this._symbols=[],this._chart=null,this._symbol=null,this._started=!1,this._hasDataPromise=null,t&&t.length||(A.logError("`$el` is required"),(0,i.assert)(Boolean(t&&t.length),"`$el` is required")),this.$el=t,this.$chart=t.find(".js-chart").eq(0),this.$symbolsWrapper=t.find(".js-symbols-wrapper").eq(0),this.hasChart=!!this.$chart.length,this.settings=this.transferSettings(e),this.showDataMode=!(!1===this.settings.showDataMode),this.showMarketStatus=!(!1===this.settings.showMarketStatus),this.chartColorMap=this.settings.chartColorMap,this.widgetColorClassMap=this.settings.widgetColorClassMap,"hotlists"===this.settings.widgetName||this.settings.isEmbedWidget){this._symbols=this.$el.data("symbols");this.$el.find(".js-symbols-wrapper").find(".js-symbols-body").append(this._renderPage())}this.settings.isEmbedWidget&&this.adjustToAvailableSizes(),this.start()}transferSettings(t){var e,s,i;const o=t.utmInfo?U.param(t.utmInfo):void 0;let a;if(t.largeChartUrl){a=t.largeChartUrl;a.match(/^https?:\/\//)||(a="http://"+a)}return{chartColorMap:Object.assign({},this.defaultChartColors,t.chartColorMap),customer:t.customer,dateRange:t.dateRange,dateRangeOptions:t.dateRangeOptions,disableLastFallingFlash:Boolean(t.disableLastFallingFlash),disableLastGrowingFlash:Boolean(t.disableLastGrowingFlash),hideAbsoluteChange:Boolean(t.hideAbsoluteChange),indexNameBold:t.indexNameBold,indexNonClickable:t.indexNonClickable,isEmbedWidget:t.isEmbedWidget,largeChartUrl:a,noLinks:t.noLinks,onlyDescription:t.onlyDescription,paintLastWithChangeColors:Boolean(t.paintLastWithChangeColors),showDataMode:t.showDataMode,showMarketStatus:t.showMarketStatus,showTitles:t.showTitles,tradingviewBaseUrl:t.tradingviewBaseUrl,utmStringified:o,valueBold:t.valueBold,valueTitleMarked:t.valueTitleMarked, widgetColorClassMap:Object.assign({},t.widgetColorClassMap),widgetName:t.widgetName,showSymbolLogo:t.showSymbolLogo,locale:t.locale,showFloatingTooltip:t.showFloatingTooltip,colorTheme:t.colorTheme,utmInfo:{utm_campaign:null===(e=t.utmInfo)||void 0===e?void 0:e.utm_campaign,utm_medium:null===(s=t.utmInfo)||void 0===s?void 0:s.utm_medium,utm_source:null===(i=t.utmInfo)||void 0===i?void 0:i.utm_source}}}get $symbols(){return this.$el.find(".js-quote-ticker")}set symbols(t){let e,s;const i=this._symbols.map((t=>t.s)),o=t.map((t=>t.s)),a=(t,s)=>U(s).data("symbol")===e;if(i&&i.toString()!==o.toString()){const l={},n=[],r=[];for(let t=0;t{t in l?h.append(l[t]):(n.push(t),r.push(t),this._renderSymbol({s:t})),s&&s===t&&(this.symbol=s)})),this._symbols=t,this.$symbols.each(((t,e)=>{const s=U(e),i=s.data("symbol");-1!==n.indexOf(i)&&(s.addClass("tv-site-table__row--updated"),setTimeout((()=>s.removeClass("tv-site-table__row--updated")),2*p.dur)),-1!==r.indexOf(i)&&this._startSymbolRow(s)}))}}get defaultChartColors(){return{gridLineColor:(0,f.generateColor)(b.colorsPalette["color-widget-border"],100),scaleFontColor:(0,f.generateColor)(b.colorsPalette["color-text-secondary"]),plotLineColor:(0,f.generateColor)(b.colorsPalette["color-brand"]),plotLineColorGrowing:void 0,plotLineColorFalling:void 0,belowLineFillColorGrowing:(0,f.generateColor)(b.colorsPalette["color-tv-blue-500"],82),belowLineFillColorFalling:(0,f.generateColor)(b.colorsPalette["color-tv-blue-500"],82),belowLineFillColorGrowingBottom:(0,f.generateColor)(b.colorsPalette["color-tv-blue-500"],100),belowLineFillColorFallingBottom:(0,f.generateColor)(b.colorsPalette["color-tv-blue-500"],100),lastPriceLineColor:(0,f.generateColor)(b.colorsPalette["color-brand"],50),lastPriceLineColorGrowing:void 0,lastPriceLineColorFalling:void 0}}get pageTemplates(){return{page:"\n\t\t\t\t{{#showTitles}}\n\t\t\t\t\t{{>title}}\n\t\t\t\t{{/showTitles}}\n\t\t\t\t{{#symbols}}\n\t\t\t\t\t{{>symbol}}\n\t\t\t\t{{/symbols}}",symbol:`\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{{^noLinks}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{{^onlyDescription}}{{ shortName }}{{/onlyDescription}}\n\t\t\t\t\t\t\t\t\t\t{{#onlyDescription}}\n\t\t\t\t\t\t\t\t\t\t\t{{#description}}{{ description }}{{/description}}\n\t\t\t\t\t\t\t\t\t\t{{/onlyDescription}}\n\t\t\t\t\t\t\t\t{{^noLinks}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{/noLinks}}\n\t\t\t\t\t\t\t\t{{#noLinks}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{/noLinks}}\n\t\t\t\t\t\t\t\t{{#showDataMode}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{/showDataMode}}\n\t\t\t\t\t\t\t\t{{#showMarketStatus}}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{/showMarketStatus}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{{^onlyDescription}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{{#description}}{{ description }}{{/description}}{{^description}} {{/description}}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{{/onlyDescription}}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{{#last}}{{ last }}{{/last}}{{^last}} {{/last}}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{#change_pt}}{{ change_pt }}{{/change_pt}}{{^change_pt}} {{/change_pt}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{^hideAbsoluteChange}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{{#change}}{{ change }}{{/change}}{{^change}} {{/change}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{/hideAbsoluteChange}}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
`, title:'\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tIndex\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tValue{{#valueTitleMarked}}*{{/valueTitleMarked}}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tChange\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
'}}set symbol(t){if(this._symbol=t,this._chart&&this._chart.changeSymbol(t,this._getSeriesOptions()),this.hasChart){const e=w()("tv-site-table__row--highlighted tv-widget-watch-list__row--highlighted",this.widgetColorClassMap.symbolActiveColor);this.$symbols.removeClass(e).filter(((e,s)=>U(s).data("symbol")===t)).addClass(e)}else this.$symbols.filter(((e,s)=>U(s).data("symbol")===t))}get symbol(){return this._symbol||""}start(){this._started||(this.symbol||(this.symbol=this.$symbols.eq(0).data("symbol")),this.hasChart&&(this._bindSymbolClick(),this._startChart()),this._startSymbolRows(),this._started=!0)}stop(){this._started&&(this._unbindSymbolClick(),this._stopChart(),this._stopSymbolRows(),this._started=!1)}hasData(){if(null===this._hasDataPromise){const t=[];this.$symbols.each(((e,s)=>{const i=U(s).data("watchlist-widget__symbol-row");t.push(i.hasData())})),this._hasDataPromise=Promise.all(t).then((t=>t.some((t=>t))))}return this._hasDataPromise}adjustToAvailableSizes(){const t=(0,i.ensureNotNull)(document.querySelector(".js-watchlist-widget")),e=(0,i.ensureNotNull)(document.querySelector(".js-quote-ticker"));let s=(0,i.ensureNotNull)(t.parentElement).offsetHeight-t.offsetHeight,o=this.hasChart?this.$chart[0].offsetHeight:0,a=this.$symbolsWrapper[0].offsetHeight,l=this.$symbolsWrapper[0].scrollHeight-a;if(0===s&&0===l)return;const n=e.offsetHeight;let r=0;s>0&&l>0?r=Math.min(l,s/2):s<0&&(r=this.hasChart?Math.max(Math.floor(s/2),n-a):s),a+=r,l-=r,s-=r,this.hasChart&&(o+=s,s=0),this.hasChart&&l>0&&l{this.symbol=U(t.currentTarget).data("symbol")}))}_unbindSymbolClick(){this.$el.off("click",".js-quote-ticker")}_getSymbolDataToRender(t){var e;let s,i;const o=(0,S.tokenize)(t.s);if((0,S.isSpread)(o)){s=(0,S.shortNameFromTokens)(o) ;const t=null===(e=o.find((t=>"symbol"===t.type)))||void 0===e?void 0:e.value;i=(null==t?void 0:t.split(":")[0])||""}else[i,s]=t.s.split(":");const a=t.t||s,l=this.settings.largeChartUrl&&(0,k.makeTemplateSymbolUrl)(this.settings.largeChartUrl,{shortName:s,exchange:i})||"",n=(0,k.makeSymbolPageUrl)({shortName:s,exchange:i},this.settings.utmInfo),r=t.d;return{s:t.s,description:r,exchange:i,shortName:a,symbolUrl:n,showChart:this.hasChart,onlyDescription:this.settings.onlyDescription,isEmbedWidget:this.settings.isEmbedWidget,utmStringified:this.settings.utmStringified,largeChartUrl:l,tradingviewBaseUrl:this.settings.tradingviewBaseUrl,showDataMode:this.showDataMode,showMarketStatus:this.showMarketStatus,indexNameBold:this.settings.indexNameBold,valueBold:this.settings.valueBold,shortNameClass:this.widgetColorClassMap.symbolShortNameColor,descriptionClass:this.widgetColorClassMap.symbolDescriptionColor,symbolColumnClass:this.widgetColorClassMap.symbolSeparatorColor,lastClass:this.widgetColorClassMap.lastColor,lastDirection:this.settings.paintLastWithChangeColors,hideAbsoluteChange:this.settings.hideAbsoluteChange,noLinks:this.settings.noLinks}}_renderSymbol(t){return x.render(this.pageTemplates.symbol,this._getSymbolDataToRender(t))}_renderPage(){const t=[];return this._symbols.forEach((e=>t.push(this._getSymbolDataToRender(e)))),x.render(this.pageTemplates.page,{symbols:t,showTitles:this.settings.showTitles,showDataMode:this.showDataMode,showMarketStatus:this.showMarketStatus,valueTitleMarked:this.settings.valueTitleMarked},this.pageTemplates)}_renderTitle(){return x.render(this.pageTemplates.title,{valueTitleMarked:this.settings.valueTitleMarked})}_startChart(){if(this._chart)return void this._chart.enable();if(!this.symbol)return;const t=this.settings.showFloatingTooltip,e=this._getSeriesOptions();let s;if(t){const t="dark"===this.settings.colorTheme?b.colorsPalette["color-cold-gray-700"]:b.colorsPalette["color-cold-gray-200"];s={vertLine:{visible:!0,style:E.LineStyle.Solid,width:1,color:t},mode:E.CrosshairMode.Magnet}}const i=(0,L.getMiniTimeFrameOptions)().filter((t=>!this.settings.dateRangeOptions||this.settings.dateRangeOptions.includes(t.value.value)));this._chart=new F.LightweightMiniChart({symbol:this.symbol},this.$chart.get(0),null,{timeframe:{visible:!0,container:this.$el.find(".js-timeframes").get(0),value:this.settings.dateRange,options:i,size:"xsmall"},valuesTracking:t?"1":"0",chartOptions:{minWidth:this.$chart.width(),minHeight:this.$chart.height(),chart:{grid:{horzLines:{visible:!0,color:this.chartColorMap.gridLineColor,style:E.LineStyle.Dotted}},crosshair:s,layout:{textColor:this.chartColorMap.scaleFontColor,fontSize:12},localization:{locale:(0,q.getIsoLanguageCodeFromLanguage)(this.settings.locale)},rightPriceScale:{visible:!1}},series:e,loading:{spinner:{visible:!0}}}})}_stopChart(){this._chart&&this._chart.disable()}_getSeriesOptions(){return{chartType:"area",lineColor:this.chartColorMap.plotLineColor,growingLineColor:this.chartColorMap.plotLineColorGrowing, fallingLineColor:this.chartColorMap.plotLineColorFalling,lineWidth:2,growingTopColor:this.chartColorMap.belowLineFillColorGrowing,fallingTopColor:this.chartColorMap.belowLineFillColorFalling,growingBottomColor:this.chartColorMap.belowLineFillColorGrowingBottom,fallingBottomColor:this.chartColorMap.belowLineFillColorFallingBottom,crosshairMarkerVisible:this.settings.showFloatingTooltip,crosshairMarkerRadius:3.5,crosshairMarkerBorderColor:"dark"===this.settings.colorTheme?b.colorsPalette["color-cold-gray-850"]:b.colorsPalette["color-white"],scaleMargins:{top:.01,bottom:.05}}}_startSymbolRows(){this.$symbols.each(((t,e)=>{this._startSymbolRow(U(e))}))}_startSymbolRow(t){const e=t.data("watchlist-widget__symbol-row");e?e.start():t.data("watchlist-widget__symbol-row",new I(t,{tradingviewBaseUrl:this.settings.tradingviewBaseUrl,largeChartUrl:this.settings.largeChartUrl,isEmbedWidget:this.settings.isEmbedWidget,directionUpClass:this.widgetColorClassMap.changeUpColor,directionDownClass:this.widgetColorClassMap.changeDownColor,directionNeutralClass:this.widgetColorClassMap.changeNeutralColor,lastGrowingClass:this.settings.disableLastGrowingFlash?null:this.widgetColorClassMap.lastGrowingFlashColor,lastFallingClass:this.settings.disableLastFallingFlash?null:this.widgetColorClassMap.lastFallingFlashColor,noLinks:this.settings.noLinks,showSymbolLogo:this.settings.showSymbolLogo,utmInfo:this.settings.utmInfo}))}_stopSymbolRows(){this.$symbols.each(((t,e)=>{this._stopSymbolRow(U(e))}))}_stopSymbolRow(t){const e=t.data("watchlist-widget__symbol-row");e&&e.stop()}}class I{constructor(t,e){this._hasData=new $.WatchedValue,this._setSymbolLinkCompleted=!1,t&&t.length||(A.logError("`$el` is required"),(0,i.assert)(Boolean(t&&t.length),"`$el` is required")),this.$el=t,this.symbol=t.data("symbol"),this.description=t.data("description"),this.start(),this._largeChartUrl=e.largeChartUrl||"",this._utmInfo=e.utmInfo||{},this._isEmbedWidget=!!e.isEmbedWidget,this._noLinks=e.noLinks,this._showSymbolLogo=e.showSymbolLogo;const s=(0,r.pickFields)(e,["directionUpClass","directionDownClass","directionNeutralClass","lastGrowingClass","lastFallingClass"]);this._directionUpClass=s.directionUpClass,this._directionDownClass=s.directionDownClass,this._directionNeutralClass=s.directionNeutralClass,this._lastGrowingClass=s.lastGrowingClass,this._lastFallingClass=s.lastFallingClass,this._setSymbolLogo=(0,_.getLogoUrlsHook)((t=>{const e=this.symbol.split(":")[1],s=(this.description||e||"")[0];(0,i.ensureNotNull)(this.$el[0].querySelector(".js-symbol-logo")).innerHTML=(0,C.getCircleLogoAnyHtml)({logoUrls:t,size:"medium",placeholderLetter:s})}))}start(){this._startQuoteTicker().then((()=>{this._startMarketStatus()})).catch((t=>A.logError(`${t.exchange} ${t.reason}`)))}stop(){this._stopQuoteTicker(),this._stopMarketStatus()}hasData(){return void 0===this._hasData.value()?new Promise((t=>{this._hasData.subscribe(t,{once:!0})})):Promise.resolve(this._hasData.value())}_startMarketStatus(){if(this.$el.find(".js-market-status")[0]){ const t=new j.MarketStatusIndicator({classSuffix:"--for-watch-list",el:this.$el.find(".js-market-status")[0],short:!0,symbol:this.symbol,onValueChange:e=>{"delisted"===e?t.setSessionStatusIcon(!0):t.setSessionStatusIcon(!1)}});t.start(),this.$el.data("market-status",t)}const t=this.$el.find(".js-data-mode")[0];if(t){const e=new P.DataModeIndicator({classSuffix:"--for-watch-list",el:t,short:!0,symbol:this.symbol});e.start(),this.$el.data("data-mode",e)}}_stopMarketStatus(){const t=this.$el.data("market-status"),e=this.$el.data("data-mode");t&&t.stop(),e&&e.stop()}_showSFWarning(){var t;const e=this.$el.get(0);if(e.getElementsByClassName("js-exclamationed-symbol").length)return;const s=document.createElement("span");s.classList.add("tv-widget-watch-list__symbol-exclamation-mark","js-exclamationed-symbol","apply-common-tooltip"),s.setAttribute("title",(0,y.getWarningTextForFreeUsers)());const o=e.getElementsByClassName("js-symbol-link").item(0);o&&(o.appendChild(s),null===(t=window.loginStateChange)||void 0===t||t.subscribe(null,(()=>{if(window.is_authenticated){const t=e.getElementsByClassName("js-exclamationed-symbol");for(;t.length>0;)(0,i.ensureNotNull)(t[0].parentNode).removeChild(t[0])}})))}_startQuoteTicker(){let t=this.$el.data("quote-ticker");if(t)return t.enable(),Promise.resolve(t);const e=this._showSFWarning.bind(this),s=(t,e,s)=>{this._setSymbolLinkCompleted||this._noLinks||this._setSymbolLink(t),this._showSymbolLogo&&this._setSymbolLogo(t,e,s)};return new Promise(((i,o)=>{(0,v.check)(this.symbol,!1).then((o=>{const a={dontDyePrice:!0,addDescriptionTitle:!1,signPositive:!0,changePercentInBrackets:!1,setStateHook:s,changeDirectionUpClass:this._directionUpClass||void 0,changeDirectionDownClass:this._directionDownClass||void 0,changeDirectionNeutralClass:this._directionNeutralClass||void 0,lastGrowingClass:this._lastGrowingClass||void 0,lastFallingClass:this._lastFallingClass||void 0,initedHook:()=>{this._hasData.setValue(!0)},noSuchSymbolHook:()=>{this._hasData.setValue(!1)},permissionDeniedHook:()=>{this._hasData.setValue(!1),e()}};t=new M.QuoteTicker(o,this.$el.get(0),a),this.$el.data("quote-ticker",t),i(t)})).catch((t=>{this._hasData.setValue(!1),e(),o(t)}))}))}_setSymbolLink(t){const e=t.short_name,s=t.exchange,i=t.pro_name,o=t.type;if(!(e&&s&&i&&o))return;const a=this.$el[0].getElementsByClassName("js-symbol-link")[0],l=this._largeChartUrl&&this._isEmbedWidget,n={shortName:e,exchange:s,proName:i,type:o};a.href=l?(0,k.makeTemplateSymbolUrl)(this._largeChartUrl,n):(0,k.makeSymbolPageUrl)(n,this._utmInfo),this._setSymbolLinkCompleted=!0}_stopQuoteTicker(){const t=this.$el.data("quote-ticker");t&&t.disable()}}var G=s(135732);const z=Object.assign({},window.initData.widget_defaults);z.whitelabel=Boolean(window.initData.widgetDefaults.whitelabel),z.noLinks=Boolean(window.initData.widgetDefaults.noLinks);const V=(0,a.parseUrlHashParams)(),Q=Object.assign({},z);"showChart"in V&&(Q.show_chart=V.showChart),Q.customer=window.TradingView.widgetCustomer, "showSymbolLogo"in V&&(Q.showSymbolLogo=Boolean(V.showSymbolLogo)),"showFloatingTooltip"in V&&(Q.showFloatingTooltip=Boolean(V.showFloatingTooltip)),Q.dateRange=(0,c.getActualTimeFrame)(V.dateRange||window.initData.widgetDefaults.dateRange),V.dateRangeOptions&&(Q.dateRangeOptions=V.dateRangeOptions.map(c.getActualTimeFrame));const J=window.locale||z.locale||"en";Q.locale=J;try{(0,G.trackWidgetLoadMetaInfo)({widget_id:"market-overview",symbols:JSON.stringify(function(t){const e=[];for(const s of t)for(const t of s.symbols)t.s&&e.push(t.s);return e}(Q.tabs)),customer:Q.customer})}catch(t){}const K=window.locale_domains[J]?window.locale_domains[J]:window.locale_domains.en;Q.tradingviewBaseUrl=K?document.location.protocol+"//"+K:"",Q.largeChartUrl=V.largeChartUrl;const Z=V.isTransparent;V.tabs&&(Q.tabs=V.tabs),Q.show_chart&&(Object.assign(Q,(0,r.pickFields)(V,O)),void 0===Q.belowLineFillColorFallingBottom&&Q.belowLineFillColorFalling&&(Q.belowLineFillColorFallingBottom=Q.belowLineFillColorFalling),void 0===Q.belowLineFillColorGrowingBottom&&Q.belowLineFillColorGrowing&&(Q.belowLineFillColorGrowingBottom=Q.belowLineFillColorGrowing)),Q.colorTheme=V.colorTheme,Object.assign(Q,(0,r.pickFields)(V,H)),V.tickerColorGrowing&&V.tickerColorFalling&&(Q.paintLastWithChangeColors=!0,Q.disableLastGrowingFlash=!0,Q.disableLastFallingFlash=!0,Q.changeUpColor=V.tickerColorGrowing,Q.changeDownColor=V.tickerColorFalling),Q.indexNameBold=et("indexNameBold",V,Q),Q.valueBold=et("valueBold",V,Q),Q.valueTitleMarked=et("valueTitleMarked",V,Q),Q.paintLastWithChangeColors=et("paintLastWithChangeColors",V,Q),Q.onlyDescription=et("onlyDescription",V,Q),Q.hideAbsoluteChange=et("hideAbsoluteChange",V,Q);const X=(0,n.filterUtmInfo)(V),Y=(0,i.ensureNotNull)(document.querySelector("#widget-market-overview-container"));Z&&(Y.style.backgroundColor="transparent"),(0,l.createEmbedWidgetWrapper)(Y,"market-overview",X,{isWhiteLabel:Q.whitelabel,locale:J,customer:Q.customer}),Y.classList.add("tv-site-widget"),Y.classList.add("tv-site-widget--bg_none"),Y.innerHTML='
\n\t\t
\n\t
\n\t
\n\t\t
\n\t
',Object.assign(Q,{utmInfo:X}),Q.onActivePageLoaded=t=>{t||(0,h.dispatchEventToParent)(d.IFrameEvents.Names.NoData,g.frameElementId,void 0)};const tt=new class{constructor(t,e={}){this._stopPageTimeouts={},this._activePageLoadedPromise=null,this._destroyTabLabels=null,t||(A.logError("`el` is required"),(0,i.assert)(Boolean(t),"`el` is required")),this.$el=U(t),this.settings=this._prepareSettings(e),this._activePageLoadedPromise=null,this.tabsLabels=this.settings.tabs.map((t=>t.title||t.title_raw));const s=(0,r.pickFields)(this.settings,H);this.widgetColorClassMap=function(t){const e=(0,T.randomHashN)(4);return t.reduce(((t,s)=>{const i=s.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`));return t[s]=`${i}--${e}`,t}),{}) }(Object.keys(s)),t.appendChild(function(t,e,s){const i=(t,e)=>`.${t}, .${t}:hover, .${t}:active { color: ${e} }`,o={symbolActiveColor:(t,e)=>`.${t} { background: ${e} }`,symbolSeparatorColor:(t,e)=>`.${t}:after { background: ${e} }`,tabSliderColor:(t,e)=>`.${t} { background: ${e} }`},a=document.createElement("style"),l=[];for(const a of t){const t=s[a],n=e[a];if(!t||!n||null===(0,u.tryParseRgb)(n))continue;const r=o[a];l.push(r?r(t,n):i(t,n))}return a.textContent=l.join(" "),a}(H,s,this.widgetColorClassMap)),this.settings.isEmbedWidget||"hotlists"===this.widgetName?(1===this.settings.tabs.length&&this.$el.find(".js-widget-head").addClass("i-hidden"),this.renderContent().then((()=>{this._initPages(),this.setAutoUpdate()}),(t=>{console.log("WidgetWatchlist constructor error",t)}))):this._initPages()}setAutoUpdate(){}get widgetName(){return"marketoverview"}get settingsKey(){return"watchlist__summary.properties"}get userSettings(){return{}}get templates(){return{tab:'\n\t\t\t\t
{{ title }}\n\t\t\t\t
',tabContent:`\n\t\t\t\t
\n\t\t\t\t\t{{#showChart}}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t{{/showChart}}\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{{^isEmbedWidget}}\n\t\t\t\t\t\t{{#quickLink}}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t{{/quickLink}}\n\t\t\t\t\t{{/isEmbedWidget}}\n\t\t\t\t
`,tabContentSkin:'\n\t\t\t\t
\n\t\t\t\t
'}}renderContent(){const t=this.settings.tabs.map((t=>{const e=U(x.render(this.templates.tabContent,{showChart:this.settings.show_chart,isEmbedWidget:this.settings.isEmbedWidget,group:t.group,firstTab:t===this.settings.tabs[0],forceEndBorder:this.settings.force_end_border},this.templates)) ;return e.data("symbols",t.symbols.map((t=>Object({s:t.s,d:t.d,t:t.t})))),this.$el.find(".js-pages").append(e),!0}));return new Promise((e=>{Promise.all(t).then(e)}))}saveToTVSettings(t){const e=window.locale;let s=(0,N.getJSON)(this.settingsKey);s||(s={}),s[e]=t,(0,N.setJSON)(this.settingsKey,s)}destroy(){this.$pagesContainer&&(this.$pagesContainer.children().each(((t,e)=>{this._stopPage(U(e))})),this._destroyTabLabels&&this._destroyTabLabels())}resetCaches(){this.$pagesContainer&&this.$pagesContainer.children().each(((t,e)=>{const s=U(e);this._getCachedWidgetPage(s)&&this._cacheWidgetPage(s,this._createWidgetWatchlistPage(s))}))}adjustToAvailableSizes(){this.$pagesContainer.children().each(((t,e)=>{if(!e.classList.contains("i-hidden")){const t=this._getCachedWidgetPage(U(e));null==t||t.adjustToAvailableSizes()}}))}_startPage(t){let e=this._getCachedWidgetPage(t);if(e?(this._deleteStopTimeout(t),e.start()):(e=this._createWidgetWatchlistPage(t),this._cacheWidgetPage(t,e)),"function"==typeof this.settings.onActivePageLoaded){const t=this._activePageLoadedPromise=e.hasData().then((e=>{t===this._activePageLoadedPromise&&this.settings.onActivePageLoaded&&this.settings.onActivePageLoaded(e)}))}}_getCachedWidgetPage(t){return t.data("watchlist-widget-page")}_initPages(){const t=this.$el.find(".js-tabs").eq(0),e=this.$el.find(".js-pages").eq(0),s=1===e.children().length;this.settings.fixedChartHeight&&(this._normalizeSymbolListHeight(),setTimeout((()=>this._adjustSymbolsListHeight()),0)),s?this._startPage(e.children().eq(0)):(this._initTabs(t,e),!this.settings.fixedChartHeight&&this.settings.adjust_widget_height&&e.find(".js-chart").length&&this._adjustChartHeight(e,this.settings.adjust_widget_height)),this.$pagesContainer=e}_getPagesArray(t){return t?Array.prototype.slice.call(t.children):[]}_prepareSettings(t){let e;const s=this.$el.data("widget-data");if(s)if(s.is_embed_widget)e=Object.assign({},s,t);else{const i=this.userSettings;(!1===s.hotlists_select_enabled||s.override_user_exchange)&&delete i.exchange,e=Object.assign({},s,t,i)}else this.$el.data("widget-data",t),e=t;return void 0!==e.is_embed_widget&&(e.isEmbedWidget=e.is_embed_widget),e.is_embed_widget=void 0,e}_initTabs(t,e){const s=this._getPagesArray(e.get(0));(0,B.createTabLabels)("watchlist-widget-tab-labels",this.tabsLabels,t.get(0),s,this._onActivePageChanged.bind(this)).then((t=>this._destroyTabLabels=t)),this._startPage(U((0,i.ensureNotNull)(this._getActivePage(s))))}_adjustChartHeight(t,e){const s=t.children(),o=document.querySelector(".js-quote-ticker"),a=document.querySelector(".js-chart");if(o&&a){const t=o.offsetHeight,l=a.offsetHeight;for(let o=0;o{if(t===s){if(this._startPage(U(e)),this.settings.isEmbedWidget){const t=this._getCachedWidgetPage(U(e));null==t||t.adjustToAvailableSizes()}}else this._stopPage(U(e))}))}_getActivePage(t){for(const e of t)if(!e.classList.contains("i-hidden"))return e;return null}_cacheWidgetPage(t,e){t.data("watchlist-widget-page",e)}_setStopTimeout(t){this._stopPageTimeouts[t.index()]=setTimeout(this._stopPage.bind(this,t))}_deleteStopTimeout(t){const e=this._stopPageTimeouts[t.index()];e&&(clearTimeout(e),delete this._stopPageTimeouts[t.index()])}}(Y,Q) ;if(Q.isEmbedWidget&&!Q.fixedChartHeight&&!Q.adjust_widget_height){const t=(0,i.ensureNotNull)(document.querySelector(".js-embed-widget-body"));new ResizeObserver((0,o.default)((function(t){const e=t[0].contentRect;e.width>0&&e.height>0&&tt.adjustToAvailableSizes()}),200)).observe(t)}function et(t,e,s){return t in e?"false"!==e[t]:s[t]}}},t=>{t.O(0,[56316,48009,2520,58985,88488,40142,92115,41563,67661,77476,83425,59683,61434,29998,79774,4126,69267,47793,41050,7936,93984,65255,68159,93539,4378,19508,70517,33425,87525,83687,48855],(()=>{return e=167314,t(t.s=e);var e}));t.O()}]);