(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[33425,66357],{489928:t=>{t.exports={}},972525:t=>{t.exports={}},604286:(t,e,s)=>{"use strict";s.d(e,{hotKeyDeserialize:()=>o});var i=s(433524);function o(t){return JSON.parse((0,i.decodeHTMLEntities)(t))}},572570:(t,e,s)=>{"use strict";function i(t){if(null!=t&&"boolean"!=typeof t&&!isNaN(Number(t)))return Number(t)}s.d(e,{toNumberOrUndefined:()=>i})},780792:(t,e,s)=>{"use strict";s.d(e,{AbstractIndicator:()=>r});var i=s(338619),o=s(79342),n=s(625545);s(673747);const a=(0,i.getLogger)("GUI.Blocks.AbstractIndicator");class r{constructor(t){this._classSuffix="",this._quoteSessionPrefix="abstract-indicator",this._shortMode=!1,this._showTooltip=!0,this._subscribed=!1,this._tooltipType="custom",this._lastTooltipText="",this._quoteSession=t.quoteSession}getValue(){return this._value}getTooltipText(){return this._labelMap[this._value]||""}getLabel(){return this._labelMap[this._value]||""}getElement(){return this._el}update(t,e){this._updateValue(t,e),this._render()}setTooltipEnabled(t=!1){this._showTooltip!==t&&(this._showTooltip=t,this._renderTooltip())}enableShortMode(){!0!==this._shortMode&&(this._shortMode=!0,this._render())}disableShortMode(){!1!==this._shortMode&&(this._shortMode=!1,this._render())}isShortModeEnabled(){return this._shortMode}start(){!this._subscribed&&this._symbolName&&(this._quoteSession||(this._quoteSession=(0,n.getQuoteSessionInstance)("simple")),this._quoteSession.subscribe(this._getQuoteSessionId(),this._symbolName,this.update.bind(this)),this._subscribed=!0)}stop(){this._subscribed&&this._quoteSession&&this._symbolName&&(this._quoteSession.unsubscribe(this._getQuoteSessionId(),this._symbolName),this._subscribed=!1)}setSessionStatusIcon(t){this._sessionStatusIcon!==t&&(this._sessionStatusIcon=t,this._render())}_init(t){this._el=t.el?t.el:document.createElement("span"),this._el.innerHTML="",this._classMap=t.classMap,this._iconClassMap=t.iconClassMap,this._labelMap=t.labelMap,this._showTooltip=t.showTooltip,this._classSuffix=t.classSuffix,this._symbolName=t.symbol,this._sessionStatusIcon=t.sessionStatusIcon,this._onValueChange=t.onValueChange,t.tooltipType&&(this._tooltipType=t.tooltipType),this._quoteSessionGUID=(0,o.guid)(),!0===t.short&&this.enableShortMode(),t.data&&this._updateValue(t.data)}_clearClasses(){Object.values(this._classMap).map((t=>{this._el.classList.remove(`${t}`),this._el.classList.remove(`${t}${this._classSuffix}`)}))}_render(){this._renderClasses(),this._renderTooltip(),this._renderLabel()}_renderLabel(){this._el.textContent=this.getLabel()}_updateValue(t,e){var s;const i=this._getValueFromData(t);(e||i!==this._value)&&(this._value=i,null===(s=this._onValueChange)||void 0===s||s.call(this,this._value))}_renderClasses(){const t=this._el.classList;t.add(this._componentClass,this._componentClass+this._classSuffix);const e=this._classMap[this._value];for(const s in this._classMap){const i=this._classMap[s];i&&(i===e?(t.add(i,i+this._classSuffix), this._sessionStatusIcon&&t.add(i+"__withIcon")):(t.remove(i,i+this._classSuffix),this._sessionStatusIcon&&t.remove(i+"__withIcon")))}!e&&this._value&&a.logWarn(`no className for status ${this._value}`)}_renderTooltip(){const t=this._showTooltip?this.getTooltipText():"";t!==this._lastTooltipText&&(this._lastTooltipText=t,this._el.setAttribute("title",t),"custom"===this._tooltipType&&this._el.classList.toggle("apply-common-tooltip",this._showTooltip))}_getQuoteSessionId(){return`${this._quoteSessionPrefix}.${this._quoteSessionGUID}`}}},719240:(t,e,s)=>{"use strict";s.d(e,{DataModeIndicator:()=>l});var i=s(444372),o=(s(466281),s(489928),s(780792));const n={connecting:"tv-data-mode--connecting",delayed:"tv-data-mode--delayed",delayed_streaming:"tv-data-mode--delayed",endofday:"tv-data-mode--endofday",forbidden:"tv-data-mode--forbidden",realtime:"tv-data-mode--realtime",snapshot:"tv-data-mode--snapshot",loading:"tv-data-mode--loading",replay:"tv-data-mode--replay"};function a(){return{connecting:i.t(null,{context:"data_mode_connecting_letter"},s(167040)),delayed:i.t(null,{context:"data_mode_delayed_letter"},s(800919)),delayed_streaming:i.t(null,{context:"data_mode_delayed_streaming_letter"},s(933088)),endofday:i.t(null,{context:"data_mode_end_of_day_letter"},s(918400)),forbidden:i.t(null,{context:"data_mode_forbidden_letter"},s(514149)),realtime:i.t(null,{context:"data_mode_realtime_letter"},s(650940)),snapshot:i.t(null,{context:"data_mode_snapshot_letter"},s(756757)),loading:"",replay:i.t(null,{context:"data_mode_replay_letter"},s(745540))}}const r={streaming:"realtime"};class l extends o.AbstractIndicator{constructor(t){super(t),this._quoteSessionPrefix="data-mode-indicator",this._componentClass="tv-data-mode",this._init(t)}getLabel(){return!0===this._shortMode?this._shortLabelMap[this._value]||"":super.getLabel()}setMode(t,e){this.update({values:{update_mode:t,update_mode_seconds:e}})}hide(){this._el.classList.add("i-hidden")}show(){this._el.classList.remove("i-hidden")}getTooltipText(){let t="";const e=this.getValue();if(""===e)return t;switch(e){case"delayed":t=i.t(null,void 0,s(369539));break;case"delayed_streaming":t=i.t(null,void 0,s(167476));break;default:t=this._labelMap[e]||t}return["delayed","delayed_streaming"].includes(e)&&(t=t.format({number:String(Math.round(this._modeInterval/60))})),t}_init(t={}){const e=Object.assign({},{classMap:n,classSuffix:"",data:{values:{update_mode:"connecting"}},labelMap:{connecting:i.t(null,void 0,s(366891)),delayed:i.t(null,void 0,s(739688)),delayed_streaming:i.t(null,void 0,s(739688)),endofday:i.t(null,void 0,s(328304)),forbidden:i.t(null,void 0,s(909161)),realtime:i.t(null,void 0,s(303058)),snapshot:i.t(null,void 0,s(988408)),loading:"",replay:i.t(null,void 0,s(38822))},modeInterval:600,short:!1,shortLabelMap:a(),showTooltip:!0,tooltipType:"custom"},t);this._modeInterval=e.modeInterval||600,this._shortLabelMap=e.shortLabelMap||a(),super._init(e),this._render()}_getValueFromData(t){let e ;return e=void 0!==t.values&&void 0!==t.values.update_mode?t.values.update_mode:this.getValue(),r[e]||e}_updateValue(t,e){void 0!==t.values&&void 0!==t.values.update_mode_seconds&&(this._modeInterval=t.values.update_mode_seconds),super._updateValue(t,e)}}},600303:(t,e,s)=>{"use strict";s.d(e,{MarketStatusIndicator:()=>r});var i=s(444372),o=(s(972525),s(780792));const n={invalid:"tv-market-status--invalid",market:"tv-market-status--market",out_of_session:"tv-market-status--out-of-session",post_market:"tv-market-status--post-market",pre_market:"tv-market-status--pre-market",loading:"tv-market-status--loading",holiday:"tv-market-status--holiday",replay:"tv-market-status--replay",delisted:"tv-market-status--delisted"},a={invalid:"tv-market-status__icon--invalid",market:"tv-market-status__icon--market",out_of_session:"tv-market-status__icon--out-of-session",post_market:"tv-market-status__icon--post-market",pre_market:"tv-market-status__icon--pre-market",loading:"tv-market-status__icon--loading",holiday:"tv-market-status__icon--holiday",replay:"tv-market-status__icon--replay",delisted:"tv-market-status__icon--delisted"};class r extends o.AbstractIndicator{constructor(t){super(t),this._quoteSessionPrefix="market-status-indicator",this._componentClass="tv-market-status",this._extraTitle="",this._init(t)}setStatus(t,e){const s={values:{current_session:"delisted"===this.getValue()?"delisted":t}};this.update(s,e)}getTooltipText(){let t=super.getTooltipText();return""===t||""!==this._extraTitle&&(t=`${t}, ${this._extraTitle}`),t}setExtraTitle(t){this._extraTitle=t}reset(){this._clearClasses(),this._labelEl.textContent="",this._extraTitle="",this._el.setAttribute("title",""),this._value=""}enableShortMode(t=!0){void 0!==this._labelEl&&this._labelEl.classList.add("i-hidden"),super.enableShortMode()}disableShortMode(){void 0!==this._labelEl&&this._labelEl.classList.remove("i-hidden"),super.disableShortMode()}_renderLabel(){this._labelEl.textContent=this.getLabel()}_getValueFromData(t){var e,s,i;return(null===(s=null===(e=t.values)||void 0===e?void 0:e.typespecs)||void 0===s?void 0:s.includes("discontinued"))?"delisted":void 0!==(null===(i=t.values)||void 0===i?void 0:i.current_session)?t.values.current_session:this.getValue()}_render(){this._renderLabelElement(),this._sessionStatusIcon?this._renderIconElement():this._renderDotElement(),super._render()}_init(t){const e=Object.assign({},function(){const t={invalid:i.t(null,void 0,s(652969)),market:i.t(null,void 0,s(241410)),out_of_session:i.t(null,void 0,s(762464)),post_market:i.t(null,void 0,s(673897)),pre_market:i.t(null,void 0,s(236018)),loading:i.t(null,void 0,s(786726)),holiday:i.t(null,void 0,s(987845)),delisted:i.t(null,void 0,s(254602)),replay:""};return{classMap:n,iconClassMap:a,classSuffix:"",data:{},extraTitle:"",labelMap:t,short:!1,showTooltip:!0,tooltipType:"custom"}}(),t);super._init(e),this.setExtraTitle(e.extraTitle),this._render()}_renderLabelElement(){void 0===this._labelEl&&(this._labelEl=document.createElement("span"), this._labelEl.classList.add(`${this._componentClass}__label`),this._labelEl.classList.add(`${this._componentClass}__label${this._classSuffix}`),this._el.appendChild(this._labelEl))}_renderDotElement(){this._el.contains(this._iconEl)&&this._el.removeChild(this._iconEl),void 0===this._dotEl&&(this._dotEl=document.createElement("span"),this._dotEl.classList.add(`${this._componentClass}__dot`),this._dotEl.classList.add(`${this._componentClass}__dot${this._classSuffix}`),this._el.appendChild(this._dotEl))}_renderIconElement(){this._el.contains(this._dotEl)&&this._el.removeChild(this._dotEl),void 0===this._iconEl&&this._value&&(this._iconEl=document.createElement("span"),this._iconEl.classList.add(`${this._componentClass}__icon`),this._iconEl.classList.add(`${this._componentClass}__icon${this._classSuffix}`),this._el.appendChild(this._iconEl))}}},40763:(t,e,s)=>{"use strict";function i(t){return t.endsWith("_dly")}function o(t){return!!t&&(!(void 0===t.symbolname||!i(t.symbolname))||Boolean("permission_denied"===t.status&&t.values&&void 0!==t.values.alternative&&i(t.values.alternative)))}s.d(e,{isSfQuoteData:()=>o})},849204:(t,e,s)=>{"use strict";s.r(e),s.d(e,{LogoSize:()=>i,LogoUrlResolver:()=>a,getLogoUrlResolver:()=>l});var i,o=s(650151),n=s(588948);!function(t){t[t.Medium=0]="Medium",t[t.Large=1]="Large"}(i||(i={}));class a{constructor(t){(0,o.assert)(""!==t,"S3 base url must be a non-empty string"),this._baseUrl=t}getSymbolLogoUrl(t,e){switch((0,o.assert)(""!==t,"logo id must be a non-empty string"),e){case i.Medium:return this._baseUrl+`${t}.svg`;case i.Large:return this._baseUrl+`${t}--big.svg`}}getCountryFlagUrl(t,e){return this.getSymbolLogoUrl("country/"+t,e)}getCryptoLogoUrl(t,e){return this.getSymbolLogoUrl("crypto/"+t,e)}getProviderLogoUrl(t,e){return this.getSymbolLogoUrl("provider/"+t,e)}getSourceLogoUrl(t,e){return this.getSymbolLogoUrl("source/"+t,e)}getBlockchainContractLogoUrl(t,e){return this.getSymbolLogoUrl("blockchain/"+t,e)}}let r;function l(){return function(){if(!r){const t=(0,n.getInitData)(),e=t.settings?t.settings.S3_LOGO_SERVICE_BASE_URL:"";r=new a(e)}return r}()}},416234:(t,e,s)=>{"use strict";s.d(e,{SymbolGroup:()=>i});var i;s(466281),s(444372);!function(t){t.NseFlag="nse_free",t.McxFlag="mcx_free"}(i||(i={}))},142567:(t,e,s)=>{"use strict";s.d(e,{PercentageFormatter:()=>n});var i=s(735211),o=s(881025);class n extends i.PriceFormatter{constructor(t={}){void 0!==t.decimalPlaces&&(t.priceScale=Math.pow(10,t.decimalPlaces)),super(t),this.type="percentage"}state(){return{...super.state(),percent:!0}}parse(t,e){return t=t.replace("%",""),super.parse(t,e)}format(t,e={}){const{useRtlFormat:s=!0}=e,i=super.format(t,{...e,useRtlFormat:!1})+"%";return s?(0,o.forceLTRStr)(i):i}static serialize(t){return t.state()}static deserialize(t){return new n(t)}}},359268:(t,e,s)=>{"use strict";s.d(e,{PriceColorer:()=>i});var i,o=s(930203),n=s(960095);!function(t){function e(t,e){ return 0===t?e&&void 0!==e.neutral?e.neutral:o.color.black70:t>0?e&&void 0!==e.up?e.up:n.colorsPalette["color-success"]:e&&void 0!==e.down?e.down:n.colorsPalette["color-danger"]}t.formatSign=e,t.formatDiff=function(t,s){return e(s-t)},t.domDifference=function(t,e,s=0,i="",o=""){function n(t){const e=document.createElement("span");return e.innerHTML=t,e}const a=document.createElement("div");if(!s)return a.appendChild(n(t)),a;const r=t+"",l=e+"";let h=null;if(r.length===l.length){for(let t=0;t{"use strict";s.d(e,{PLACE_HOLDER:()=>a,VolumeFormatter:()=>r});var i=s(444372),o=s(397566),n=s(124829);const a="---";class r{constructor(t={}){this.type="volume";const{precision:e,minPrecision:s,dimensionPrecision:i,dimensionMinPrecision:n,ignoreLocaleNumberFormat:a,removeSpaceBeforeDimension:r}=t;this._precision=null!=e?e:0,this._formatter=new o.NumericFormatter({ignoreLocaleNumberFormat:a,precision:this._precision,minPrecision:null!=s?s:0}),this._dimensionPrecision=null!=i?i:3,this._dimensionFormatter=new o.NumericFormatter({ignoreLocaleNumberFormat:a,precision:this._dimensionPrecision,minPrecision:null!=n?n:0}),this._fractionalValues=void 0!==e&&e>0,this._spaceBeforeDimension=r?"":" ",this._options=t}state(){const{ignoreLocaleNumberFormat:t,...e}=this._options;return e}format(t,e){if(!(0,n.isNumber)(t))return a;if(Math.abs(t)>=1e100)return i.t(null,void 0,s(696935));const o=Math.abs(t);let r="";(t=o<1e3?+t.toFixed(this._precision):o<1e6?1e3*+(t/1e3).toFixed(this._dimensionPrecision):o<1e9?1e6*+(t/1e6).toFixed(this._dimensionPrecision):o<1e12?1e9*+(t/1e9).toFixed(this._dimensionPrecision):1e12*+(t/1e12).toFixed(this._dimensionPrecision))<0?r="−":t>0&&(null==e?void 0:e.signPositive)&&(r="+"),t=Math.abs(t);const l=!!(null==e?void 0:e.ignoreLocaleNumberFormat);let h,d;return t<1e3?h=this._formatNumber(t,l,this._formatter):t<1e6?(h=this._formatNumber(t/1e3,l,this._dimensionFormatter),d="K"):t<1e9?(h=this._formatNumber(t/1e6,l,this._dimensionFormatter),d="M"):t<1e12?(h=this._formatNumber(t/1e9,l,this._dimensionFormatter),d="B"):(h=this._formatNumber(t/1e12,l,this._dimensionFormatter),d="T"),d?`${r}${h}${this._spaceBeforeDimension}${d}`:`${r}${h}`}parse(t,e){if("---"===t)return{error:"not a number",res:!1,value:NaN};const s={K:1e3,M:1e6,B:1e9,T:1e12},i=(t=t.replace("−","-")).slice(-1);if(s.hasOwnProperty(i)){const o=this._formatter.parse(t.slice(0,-1).trim(),e),a=o.res?o.value:NaN;return(0,n.isNumber)(a)?{res:!0,value:a*s[i]}:{error:"not a number",res:!1,value:NaN}}{const s=this._formatter.parse(t.trim(),e),i=s.res?s.value:NaN;return(0,n.isNumber)(i)?{res:!0,value:i}:{error:"not a number",res:!1,value:NaN}}}static serialize(t){return t.state()}static deserialize(t){return new r(t)}_formatNumber(t,e,s){if(this._fractionalValues&&0!==t){ const e=14-Math.ceil(Math.log10(t)),s=Math.pow(10,e);t=Math.round(t*s)/s}return s.format(t,{ignoreLocaleNumberFormat:e})}}},930203:(t,e,s)=>{"use strict";s.d(e,{color:()=>i.color});var i=s(745269)},817099:(t,e,s)=>{"use strict";s.d(e,{QuoteTicker:()=>T});var i=s(45003),o=s(338619),n=s(124829),a=s(142567),r=s(359268),l=s(735211),h=s(957365),d=s(600303),c=s(719240),_=s(257288),u=s(621239),m=s(625545);var p=s(572570);function g(t,e,s){const i=(0,p.toNumberOrUndefined)(t);if("economic"===(null==e?void 0:e.type)&&0===i||void 0===i)return;const o=(null==s?void 0:s.customPriceFormatter)||"volume"===e.format&&new h.VolumeFormatter({precision:2})||new l.PriceFormatter({priceScale:e.pricescale||100,minMove:e.minmov||1,fractional:e.fractional,minMove2:e.minmove2}),n=void 0!==(null==s?void 0:s.signPositiveChange)?s.signPositiveChange:null==s?void 0:s.signPositive;return((t,e=!0)=>e?`(${t})`:t)(o.format(i,{signPositive:n,signNegative:null==s?void 0:s.signNegative}),null==s?void 0:s.changeInBrackets)}var f=s(444372);function v(t){return"PCTPAR"===t?f.t(null,{context:"_max_len_9"},s(46374)):t}var b=s(416234);function y(t){return t===b.SymbolGroup.McxFlag}var x=s(40763);const N=(0,o.getLogger)("QuoteTicker"),S={addDescriptionTitle:!0,changeDirectionDownClass:"down",changeDirectionUpClass:"up",changeDirectionNeutralClass:"neutral",changeInBrackets:!1,changePercentInBrackets:!1,lastPriceTimeInBrackets:!0,lastReleaseDateTimeInBrackets:!0,rtcTimeInBrackets:!0,clientName:"quote-ticker",dontDyePrice:!1,fallingBg:null,growingBg:null,lastFallingClass:"falling",lastGrowingClass:"growing",quoteSession:null,signNegative:!0,signPositive:!1,customPriceFormatter:null,customTimeFormatter:null,sessionStatusClassSuffix:"--for-ticker",dataModeClassSuffix:"--for-ticker",showInvalidSymbolStatus:!1,indicatorsTooltipType:"custom",lastPriceLastCharSup:!1,lastPriceHighlightDiffOnly:!1,initedHook:void 0,setStateHook:void 0,permissionDeniedHook:void 0,noSuchSymbolHook:void 0},C=/[KMBT]/;function T(t,e,s={}){this.enabled=!0,this._symbol=t,this._symbolOriginal=null,this._options=(0,i.deepExtend)({},S,s),!1!==this._options.signNegative&&!0!==this._options.signNegative&&delete this._options.signNegative,s.customPriceFormatter&&(this._customPriceFormatter=s.customPriceFormatter),s.customTimeFormatter&&(void 0!==s.customTimeFormatter.lastPrice||void 0!==s.customTimeFormatter.rtc?this._timeFormatter=s.customTimeFormatter:this._timeFormatter={lastPrice:s.customPriceFormatter,rtc:s.customPriceFormatter}),this._percentFormatter=new a.PercentageFormatter,this._defaultPriceFormatter=new l.PriceFormatter({priceScale:100}),this._priceFormatter=this._customPriceFormatter||this._defaultPriceFormatter,this._volumeFormatter=new h.VolumeFormatter({precision:2}),this._cache={},this._lastPrice=null,this._lastPriceFormatted="",this._elements={},this._textNodes={},this._changeVolumeLetter=this._getChangeVolumeLetterCallback(),this._setElements(e),this._highlighters={},this._initHighlighters(),this._options.setStateHook&&this.setStateHook(this._options.setStateHook), this.quoteSession=this._options.quoteSession||(0,m.getQuoteSessionInstance)("simple"),this._quoteSessionEventHandler=this.onData.bind(this),this._connectTimeoutId=setTimeout(this.connect.bind(this),0)}function P(t){const e=t.search(C),s=e>=0?t.slice(e):"";return[e>0?t.substring(e,0):0===e?"":t,s]}function k(t,e,s,i,o){var n,a=null;function r(){if(n&&(clearTimeout(n),n=void 0),s||e)for(var a=0;at.classList.add("i-hidden"))),this._textNodes.change=this._getOrCreateTextNodes(this._elements.change),this._textNodes.changePercent=this._getOrCreateTextNodes(this._elements.changePercent),this._textNodes.extHrsChange=this._getOrCreateTextNodes(this._elements.extHrsChange),this._textNodes.extHrsChangePercent=this._getOrCreateTextNodes(this._elements.extHrsChangePercent),this._textNodes.extHrsClose=this._getOrCreateTextNodes(this._elements.extHrsClose),this._textNodes.last=this._getOrCreateTextNodes(this._elements.last),this._textNodes.open=this._findTextNodes(t,"js-symbol-open"),this._textNodes.eps=this._findTextNodes(t,"js-symbol-eps"),this._textNodes.marketCap=this._findTextNodes(t,"js-symbol-market-cap"),this._textNodes.prevClose=this._findTextNodes(t,"js-symbol-prev-close"), this._textNodes.dividends=this._findTextNodes(t,"js-symbol-dividends"),this._textNodes.priceEarnings=this._findTextNodes(t,"js-symbol-pe"),this._textNodes.volume=this._findTextNodes(t,"js-symbol-volume"),this._textNodes.high=this._findTextNodes(t,"js-symbol-high"),this._textNodes.low=this._findTextNodes(t,"js-symbol-low"),this._textNodes.currency=this._findTextNodes(t,"js-symbol-currency"),this._textNodes.lastPriceTime=this._findTextNodes(t,"js-symbol-lp-time"),this._textNodes.lastReleaseDate=this._findTextNodes(t,"js-symbol-last-release-date"),this._textNodes.rtcTime=this._findTextNodes(t,"js-symbol-rtc-time"),this._elements.lastHighlight=this._options.lastPriceHighlightDiffOnly?this._elements.last.map((t=>this._appendAndGetNewElement(t,"span"))):this._elements.last,this._textNodes.lastHighlight=this._getOrCreateTextNodes(this._elements.lastHighlight),this._elements.lastSup=this._options.lastPriceLastCharSup?this._elements.lastHighlight.map((t=>this._appendAndGetNewElement(t,"sup"))):[],this._textNodes.lastSup=this._getOrCreateTextNodes(this._elements.lastSup)},T.prototype._findElements=function(t,e){var s=(0,n.isArray)(e)?e:[e];return Array.prototype.concat.apply([],s.map((e=>Array.prototype.slice.call(t.getElementsByClassName(e)))))},T.prototype._findTextNodes=function(t,e){return this._getOrCreateTextNodes(this._findElements(t,e))},T.prototype._getOrCreateTextNodes=function(t){return t.map((t=>{var e=this._getFirstTextNode(t);return e||(e=t.ownerDocument.createTextNode(""),t.appendChild(e)),e}))},T.prototype._appendAndGetNewElement=function(t,e){const s=document.createElement(e);return t.appendChild(s),s},T.prototype._getFirstTextNode=function(t){for(var e=t.childNodes,s=e.length-1;s>=0;s--)if(3===e.item(s).nodeType)return e.item(s);return null},T.prototype.connect=function(t){this._subscribed||(this._subscribedSymbol=t||this._symbol,this.quoteSession.subscribe(this._options.clientName,this._subscribedSymbol,this._quoteSessionEventHandler),this._subscribed=!0)},T.prototype.disconnect=function(){clearTimeout(this._connectTimeoutId),this._subscribed&&(this.quoteSession.unsubscribe(this._options.clientName,this._subscribedSymbol,this._quoteSessionEventHandler),this._subscribed=!1)},T.prototype.onData=function(t,e){this.enabled&&("ok"===t.status?this.successData(t,e):"permission_denied"===t.status?this.onPermissionDenied(t):"error"===t.status&&this.errorData(t))},T.prototype.successData=function(t,e){t.values&&this.setState(t.values,t,e)},T.prototype.onPermissionDenied=function(t){(0,x.isSfQuoteData)(t)||function(t){var e;return!!t&&(y(t.symbolname)||"permission_denied"===t.status&&y(null===(e=t.values)||void 0===e?void 0:e.alternative))}(t)?this._options.permissionDeniedHook?this._options.permissionDeniedHook(t,this._symbolOriginal||this._symbol):this.errorData(t):this.downgradeData(t)},T.prototype.errorData=function(t){this._options.showInvalidSymbolStatus&&(this.setShortName(this._symbol),this._elements.sessionStatus.map((t=>new d.MarketStatusIndicator({classSuffix:this._options.sessionStatusClassSuffix,el:t, data:{values:{current_session:"invalid"}},tooltipType:this._options.indicatorsTooltipType})))),this._options.noSuchSymbolHook?(this._symbolOriginal&&this.setShortName(this._symbolOriginal),this._options.noSuchSymbolHook.call(this,t,this._symbolOriginal||this._symbol)):N.logWarn("No data for: "+this._symbol)},T.prototype.downgradeData=function(t){{const e=t&&t.values&&t.values.alternative,s=this._symbol===e;if(!(e&&-1!==e.indexOf(":"))||s)return void this.errorData(t);this._symbolOriginal=this._symbol,this._symbol=e,this._subscribed=!1,this.connect()}},T.prototype.setState=function(t,e,i){const o=i.values;this._isVolumeFormat="volume"===t.format,null==o.pricescale&&null==o.minmov&&null==o.fractional&&null==o.minmove2||(this._priceFormatter=this._customPriceFormatter||this._isVolumeFormat&&this._volumeFormatter||new l.PriceFormatter({priceScale:t.pricescale||100,minMove:t.minmov||1,fractional:t.fractional,minMove2:t.minmove2}));const n=this._options,a=this._percentFormatter,r=this._priceFormatter,m=this._defaultPriceFormatter,p=this._volumeFormatter,f=(t,e=!0)=>e?`(${t})`:t,b=void 0!==n.signPositiveChange?n.signPositiveChange:n.signPositive,y=t=>g(t,o,n),x=t=>{const e=a.format(t,{signPositive:b,signNegative:n.signNegative});return f(e,n.changePercentInBrackets)},S=r.format.bind(r),C=m.format.bind(m),T=p.format.bind(p),P=t=>null==t?h.PLACE_HOLDER:C(t);n.disableChange||(this._setNodesValue(this._textNodes.change,o.change,y),this._setNodesValue(this._textNodes.changePercent,o.change_percent,x),null!=o.change&&(n.dontDyePrice||this._setChangeFontColor([].concat(this._elements.change,this._elements.changePercent),o.change,n.changeUpFontColor,n.changeDownFontColor,n.changeNeutralFontColor),this._setChangeDirection(this._elements.changeDirection,o.change)),this._setNodesValue(this._textNodes.extHrsChange,o.rch,y),this._setNodesValue(this._textNodes.extHrsChangePercent,o.rchp,x),null!=o.rch&&(n.dontDyePrice||this._setChangeFontColor([].concat(this._elements.extHrsChange,this._elements.extHrsChangePercent),o.rch,n.changeUpFontColor,n.changeDownFontColor,n.changeNeutralFontColor),this._setChangeDirection(this._elements.extHrsChangeDirection,o.rch))),this._setNodesValue(this._textNodes.prevClose,o.prev_close_price,S),this._setNodesValue(this._textNodes.dividends,t.dividends_yield,(t=>null==t?h.PLACE_HOLDER:a.format(t,{signPositive:n.signPositive,signNegative:n.signNegative})),!0);let k=(0,_.getTranslatedSymbolDescription)(o);if(k&&(k=this._prepareSymbolDescription(k),this._setTextsContent(this._elements.description,k),this._options.addDescriptionTitle))for(var F=0;F{ this._setTextsContent(this._elements.lastPeriod,e.periodFormatter(t["reference-last-period"]))})),this._elements.lastPeriod.length&&void 0===t["reference-last-period"]&&this._setTextsContent(this._elements.lastPeriod,"—"),this._setLastValue(o.last_price,S),this._setNodesValue(this._textNodes.extHrsClose,o.rtc,S),o.rtc&&this._highlighters.extHrsClose.show(o.rtc),o.industry&&this._setTextsContent(this._elements.industry,t.industry,(t=>t)),o.sector&&this._setTextsContent(this._elements.sector,t.sector),this._elements.sessionStatus&&o.current_session&&(this._sessionStatusInstances?this._sessionStatusInstances.forEach((t=>t.setStatus(o.current_session))):this._sessionStatusInstances=this._elements.sessionStatus.map((e=>new d.MarketStatusIndicator({classSuffix:this._options.sessionStatusClassSuffix,el:e,short:!0,data:{values:o},quoteSession:this.quoteSession,symbol:t.original_name,manualUpdate:!0,tooltipType:this._options.indicatorsTooltipType,sessionStatusIcon:this._options.sessionStatusIcon})))),this._setNodesValue(this._textNodes.open,o.open_price,S),this._setNodesValue(this._textNodes.high,o.high_price,S),this._setNodesValue(this._textNodes.low,o.low_price,S),this._setNodesValue(this._textNodes.eps,t.earnings_per_share_basic_ttm,P,!0),this._setNodesValue(this._textNodes.priceEarnings,t.price_earnings_ttm,P,!0),this._setNodesValue(this._textNodes.marketCap,t.market_cap_basic,T,!0),this._setNodesValue(this._textNodes.volume,t.volume,T,!0);const L=(0,u.prepareCurrencyValue)(o);if(L&&this._setNodesValue(this._textNodes.currency,L,v,!0),(o.lp_time||t.lp_time)&&this._textNodes.lastPriceTime.length&&(this._timeFormatter&&this._timeFormatter.lastPrice?this._setNodesValue(this._textNodes.lastPriceTime,f(this._timeFormatter.lastPrice(t.lp_time,t.current_session),this._options.lastPriceTimeInBrackets)):N.logError("last price time field requested with no formatter provided")),(o.last_release_date||t.last_release_date)&&this._textNodes.lastReleaseDate.length&&(this._timeFormatter&&this._timeFormatter.lastReleaseDate?this._setNodesValue(this._textNodes.lastReleaseDate,f(this._timeFormatter.lastReleaseDate(t.last_release_date,t.current_session),this._options.lastReleaseDateTimeInBrackets)):N.logError("lastReleaseDate time field requested with no formatter provided")),(o.rtc_time||t.rtc_time)&&this._textNodes.rtcTime.length&&(this._timeFormatter&&this._timeFormatter.rtc?this._setNodesValue(this._textNodes.rtcTime,f(this._timeFormatter.rtc(t.rtc_time,t.current_session),this._options.rtcTimeInBrackets)):N.logError("rtc time field requested with no formatter provided")),null!=o.last_price)for(F=0;Fe.update({values:t}))):this._updateModeInstances=this._elements.updateMode.map((e=>new c.DataModeIndicator({classSuffix:this._options.dataModeClassSuffix,el:e,data:{values:t},modeInterval:t.update_mode_seconds,short:!0, tooltipType:this._options.indicatorsTooltipType})))),this._setStateHook&&this._setStateHook(e.values,i.values,e.complete,this.getOptions()),this._lastPrice?this._highlighters.last.show(t.last_price):null===this._lastPrice&&(this._container.classList.add("quote-ticker-inited"),"function"==typeof this._options.initedHook&&this._options.initedHook("last_price"in t)),this._lastPrice=t.last_price},T.prototype._setNodesValue=function(t,e,s,i){if(null!=e||i)for(var o="function"==typeof s?s(e):e,n=0;n{3!==e.childNodes.length?e.appendChild(document.createTextNode(t)):e.childNodes[2].nodeValue=t})))}},T.prototype._getLastValueStringDiff=function(t,e){if(t===e){const[t,s]=P(e);return[t,"",s]}let s=0;for(;t[s]===e[s];)s++;const[i,o]=P(e.slice(s));return[e.slice(0,s),i,o]},T.prototype._setChangeFontColor=function(t,e,s,i,o){for(var n=r.PriceColorer.formatSign(e,{up:s,down:i,neutral:o}),a=0;a0),i.toggle(this._options.changeDirectionDownClass,e<0),i.toggle(this._options.changeDirectionNeutralClass,0===e)}},T.prototype.setShortName=function(t=""){this._setTextsContent(this._elements.shortName,t)},T.prototype._prepareSymbolDescription=function(t){var e=this._getCache("symbol-description:"+t);return e||(e=t,this._setCache("symbol-description:"+t,e),e)},T.prototype._initHighlighters=function(){this._highlighters.last=new k(this._elements.lastHighlight,this._options.growingBg,this._options.fallingBg,this._options.lastGrowingClass,this._options.lastFallingClass),this._highlighters.extHrsClose=new k(this._elements.extHrsClose,this._options.growingBg,this._options.fallingBg,this._options.lastGrowingClass,this._options.lastFallingClass)},T.prototype.disable=function(){this.enabled=!1,this.disconnect()},T.prototype.enable=function(){this.enabled=!0,this.connect()},T.prototype.setStateHook=function(t){null===t&&this._setStateHook?delete this._setStateHook:"function"==typeof t&&(this._setStateHook=t)},T.prototype._setCache=function(t,e){ null==e?delete this._cache[t]:this._cache[t]=e},T.prototype._getCache=function(t){return this._cache&&this._cache[t]},T.prototype.getOptions=function(){return this._options}},621239:(t,e,s)=>{"use strict";function i(t){let e=[];const s=t.currency_code||t.value_unit_id;switch(t.measure){case"price":e=[s,t.unit_id];break;case"unit":e=["PCT"===s?"%":s,t.unit_id];break;default:e=["PCT"===s?"%":s]}return e.filter(Boolean).join(" / ")}s.d(e,{prepareCurrencyValue:()=>i})}}]);