"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[3229],{167314:(t,e,s)=>{s(566953);var i=s(650151),o=s(290484),a=(s(885660),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(790188)),p=s(724377),u=s(745269),C=s(17966),_=s(607546),y=s(599612),v=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(871591),D=s(375397),N=s(563360),W=s(62802),B=s(338619),E=s(883427),q=s(431057),U=s(39654),x=(s(807801),s(384961),s(486393)),A=s(213398);const H=(0,B.getLogger)("WidgetWatchlist"),O=["symbolActiveColor","symbolShortNameColor","symbolDescriptionColor","symbolSeparatorColor","tabActiveColor","tabInactiveColor","tabSliderColor","changeUpColor","changeDownColor","changeNeutralColor","lastColor","lastGrowingFlashColor","lastFallingFlashColor"],R=["plotLineColor","plotLineColorGrowing","plotLineColorFalling","gridLineColor","scaleFontColor","belowLineFillColorGrowing","belowLineFillColorFalling","belowLineFillColorGrowingBottom","belowLineFillColorFallingBottom","lastPriceLineColor","lastPriceLineColorGrowing","lastPriceLineColorFalling"];class I{constructor(t,e){if(this._symbols=[],this._chart=null,this._symbol=null,this._started=!1,this._hasDataPromise=null,this._destroyFloatingTooltip=null,t&&t.length||(H.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()}destroy(){this._destroyFloatingTooltip?.()}transferSettings(t){const e=t.utmInfo?x.param(t.utmInfo):void 0;let s;if(t.largeChartUrl){s=t.largeChartUrl;s.match(/^https?:\/\//)||(s="http://"+s)}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:s,noLinks:t.noLinks,onlyDescription:t.onlyDescription,paintLastWithChangeColors:Boolean(t.paintLastWithChangeColors),showDataMode:t.showDataMode,showMarketStatus:t.showMarketStatus,showTitles:t.showTitles,tradingviewBaseUrl:t.tradingviewBaseUrl, utmStringified:e,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:t.utmInfo?.utm_campaign,utm_medium:t.utmInfo?.utm_medium,utm_source:t.utmInfo?.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)=>x(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=x(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*u.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)=>x(s).data("symbol")===t)).addClass(e)}else this.$symbols.filter(((e,s)=>x(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=x(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=x(t.currentTarget).data("symbol")}))}_unbindSymbolClick(){this.$el.off("click",".js-quote-ticker")}_getSymbolDataToRender(t){let e,s;const i=(0,S.tokenize)(t.s);if((0,S.isSpread)(i)){e=(0,S.shortNameFromTokens)(i) ;const t=i.find((t=>"symbol"===t.type))?.value;s=t?.split(":")[0]||""}else[s,e]=t.s.split(":");const o=t.t||e,a=this.settings.largeChartUrl&&(0,k.makeTemplateSymbolUrl)(this.settings.largeChartUrl,{shortName:e,exchange:s})||"",l=(0,k.makeSymbolPageUrl)({shortName:e,exchange:s},this.settings.utmInfo),n=t.d;return{s:t.s,description:n,exchange:s,shortName:o,symbolUrl:l,showChart:this.hasChart,onlyDescription:this.settings.onlyDescription,isEmbedWidget:this.settings.isEmbedWidget,utmStringified:this.settings.utmStringified,largeChartUrl:a,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 A.render(this.pageTemplates.symbol,this._getSymbolDataToRender(t))}_renderPage(){const t=[];return this._symbols.forEach((e=>t.push(this._getSymbolDataToRender(e)))),A.render(this.pageTemplates.page,{symbols:t,showTitles:this.settings.showTitles,showDataMode:this.showDataMode,showMarketStatus:this.showMarketStatus,valueTitleMarked:this.settings.valueTitleMarked},this.pageTemplates)}_renderTitle(){return A.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:q.LineStyle.Solid,width:1,color:t},mode:q.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),{timeframe:{visible:!0,container:this.$el.find(".js-timeframes").get(0),value:this.settings.dateRange,options:i,size:"xsmall"},chartOptions:{minWidth:this.$chart.width(),minHeight:this.$chart.height(),chart:{grid:{horzLines:{visible:!0,color:this.chartColorMap.gridLineColor,style:q.LineStyle.Dotted}},crosshair:s,layout:{textColor:this.chartColorMap.scaleFontColor,fontSize:12},localization:{locale:(0,U.getIsoLanguageCodeFromLanguage)(this.settings.locale)},rightPriceScale:{visible:!1}},series:e,loading:{spinner:{visible:!0}}}}),t&&(this._destroyFloatingTooltip=(0,$.createFloatingTooltip)({lightweightMiniChart:this._chart,coloredBorderVisible:!1})??null)}_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(x(e))}))}_startSymbolRow(t){const e=t.data("watchlist-widget__symbol-row");e?e.start():t.data("watchlist-widget__symbol-row",new G(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(x(e))}))}_stopSymbolRow(t){const e=t.data("watchlist-widget__symbol-row");e&&e.stop()}}class G{constructor(t,e){this._hasData=new D.WatchedValue,this._setSymbolLinkCompleted=!1,t&&t.length||(H.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=>H.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(){const t=this.$el.get(0);if(t.getElementsByClassName("js-exclamationed-symbol").length)return;const e=document.createElement("span");e.classList.add("tv-widget-watch-list__symbol-exclamation-mark","js-exclamationed-symbol","apply-common-tooltip"),e.setAttribute("title",(0,v.getWarningTextForFreeUsers)());const s=t.getElementsByClassName("js-symbol-link").item(0);s&&(s.appendChild(e),window.loginStateChange?.subscribe(null,(()=>{if(window.is_authenticated){const e=t.getElementsByClassName("js-exclamationed-symbol");for(;e.length>0;)(0,i.ensureNotNull)(e[0].parentNode).removeChild(e[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,y.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 z=s(135732);const V=Object.assign({},window.initData.widget_defaults);V.whitelabel=Boolean(window.initData.widgetDefaults.whitelabel),V.noLinks=Boolean(window.initData.widgetDefaults.noLinks);const Q=(0,a.parseUrlHashParams)(),J=Object.assign({},V);"showChart"in Q&&(J.show_chart=Q.showChart),J.customer=window.TradingView.widgetCustomer, "showSymbolLogo"in Q&&(J.showSymbolLogo=Boolean(Q.showSymbolLogo)),"showFloatingTooltip"in Q&&(J.showFloatingTooltip=Boolean(Q.showFloatingTooltip)),J.dateRange=(0,c.getActualTimeFrame)(Q.dateRange||window.initData.widgetDefaults.dateRange),Q.dateRangeOptions&&(J.dateRangeOptions=Q.dateRangeOptions.map(c.getActualTimeFrame));const K=window.locale||V.locale||"en";J.locale=K;try{(0,z.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}(J.tabs)),customer:J.customer})}catch{}const Z=window.locale_domains[K]?window.locale_domains[K]:window.locale_domains.en;J.tradingviewBaseUrl=Z?document.location.protocol+"//"+Z:"",J.largeChartUrl=Q.largeChartUrl;const X=Q.isTransparent;Q.tabs&&(J.tabs=Q.tabs),J.show_chart&&(Object.assign(J,(0,r.pickFields)(Q,R)),void 0===J.belowLineFillColorFallingBottom&&J.belowLineFillColorFalling&&(J.belowLineFillColorFallingBottom=J.belowLineFillColorFalling),void 0===J.belowLineFillColorGrowingBottom&&J.belowLineFillColorGrowing&&(J.belowLineFillColorGrowingBottom=J.belowLineFillColorGrowing)),J.colorTheme=Q.colorTheme,Object.assign(J,(0,r.pickFields)(Q,O)),Q.tickerColorGrowing&&Q.tickerColorFalling&&(J.paintLastWithChangeColors=!0,J.disableLastGrowingFlash=!0,J.disableLastFallingFlash=!0,J.changeUpColor=Q.tickerColorGrowing,J.changeDownColor=Q.tickerColorFalling),J.indexNameBold=st("indexNameBold",Q,J),J.valueBold=st("valueBold",Q,J),J.valueTitleMarked=st("valueTitleMarked",Q,J),J.paintLastWithChangeColors=st("paintLastWithChangeColors",Q,J),J.onlyDescription=st("onlyDescription",Q,J),J.hideAbsoluteChange=st("hideAbsoluteChange",Q,J);const Y=(0,n.filterUtmInfo)(Q),tt=(0,i.ensureNotNull)(document.querySelector("#widget-market-overview-container"));X&&(tt.style.backgroundColor="transparent"),(0,l.createEmbedWidgetWrapper)(tt,"market-overview",Y,{isWhiteLabel:J.whitelabel,locale:K,customer:J.customer}),tt.classList.add("tv-site-widget"),tt.classList.add("tv-site-widget--bg_none"),tt.innerHTML='
\n\t\t
\n\t
\n\t
\n\t\t
\n\t
',Object.assign(J,{utmInfo:Y}),J.onActivePageLoaded=t=>{t||(0,h.dispatchEventToParent)(d.IFrameEvents.Names.NoData,g.frameElementId,void 0)};const et=new class{constructor(t,e={}){this._stopPageTimeouts={},this._activePageLoadedPromise=null,this._destroyTabLabels=null,t||(H.logError("`el` is required"),(0,i.assert)(Boolean(t),"`el` is required")),this.$el=x(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,O);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,p.tryParseRgb)(n))continue;const r=o[a];l.push(r?r(t,n):i(t,n))}return a.textContent=l.join(" "),a}(O,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=x(A.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,W.getJSON)(this.settingsKey);s||(s={}),s[e]=t,(0,W.setJSON)(this.settingsKey,s)}destroy(){this.$pagesContainer&&(this.$pagesContainer.children().each(((t,e)=>{this._stopPage(x(e))})),this._destroyTabLabels?.(),this.$pagesContainer.children().each(((t,e)=>{const s=x(e);this._getCachedWidgetPage(s)?.destroy()})))}resetCaches(){this.$pagesContainer&&this.$pagesContainer.children().each(((t,e)=>{const s=x(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(x(e));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,E.createTabLabels)("watchlist-widget-tab-labels",this.tabsLabels,t.get(0),s,this._onActivePageChanged.bind(this)).then((t=>this._destroyTabLabels=t)),this._startPage(x((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(x(e)),this.settings.isEmbedWidget){const t=this._getCachedWidgetPage(x(e));t?.adjustToAvailableSizes()}}else this._stopPage(x(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()])}}(tt,J);if(J.isEmbedWidget&&!J.fixedChartHeight&&!J.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&&et.adjustToAvailableSizes()}),200)).observe(t)}function st(t,e,s){return t in e?"false"!==e[t]:s[t]}}},t=>{t.O(0,[56316,55698,44178,58985,40142,88488,41563,92115,67661,77476,83425,59683,61434,29998,79774,4126,69267,47793,41050,7936,28241,62077,92394,47,3636,98031,12336,93659,66010,25227,62401],(()=>{return e=167314,t(t.s=e);var e}));t.O()}]);