(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[76250],{787703:(t,e,s)=>{"use strict";s.r(e),s.d(e,{isThemeExist:()=>d,loadTheme:()=>n,loadThemes:()=>r,removeTheme:()=>h,saveTheme:()=>l});var o=s(120780);const i=(0,s(201089).getLogger)("Themes.Provider");let a=null;function n(t){return(0,o.fetch)("/theme/?themeName="+encodeURIComponent(t),{credentials:"include",method:"GET"}).then((t=>t.json())).then((t=>{const e={};return t.content&&(e.content=JSON.parse(t.content)),e}))}function r(){return a||(0,o.fetch)("/themes/",{credentials:"include",method:"GET"}).then((t=>(a=t.json(),a)))}function l(t,e){const s=new FormData;return s.append("content",JSON.stringify(e)),s.append("name",t),a=null,(0,o.fetch)("/save-theme/",{credentials:"include",method:"POST",body:s}).then((t=>t.json()),(t=>i.logError(t)))}function h(t){const e=new FormData;return e.append("name",t),a=null,(0,o.fetch)("/remove-theme/",{credentials:"include",method:"POST",body:e}).then((t=>t.json()),(t=>i.logError(t)))}function d(t){return n(t).then((t=>Boolean(t.content)))}},278855:(t,e,s)=>{"use strict";function o(){return/(?:^|;)\s*theme=(dark|light)(?:;|$)|$/.exec(document.cookie)[1]}function i(t){const e=function(){const t=location.hostname.split(".").filter(Boolean);return t.every(isFinite)?location.host:t.slice(-2).join(".")}(),s=void 0===t?-1:3e8;document.cookie=`theme=${t};path=/;domain=${e};max-age=${s}`}s.d(e,{getThemeFromCookie:()=>o,setThemeToCookie:()=>i})},245302:(t,e,s)=>{"use strict";s.d(e,{parseTzOffset:()=>i});var o=s(988124);function i(t,e=Date.now()){const s=(0,o.get_timezone)(t).offset_utc(e);let i="";const a=s/1e3/60/60;a%1&&(i=":"+Math.round(Math.abs(a%1*60)).toString().padStart(2,"0"));let n="";return n=a>0?"+"+(a-a%1)+i:0===a?"":String(a-a%1+i),{offset:s,string:"UTC"+n}}},228018:(t,e,s)=>{"use strict";s.d(e,{clientSnapshot:()=>M,widgetClientSnapshot:()=>D});var o,i,a=s(743068),n=s(650151),r=s(86441),l=s(724377),h=s(86746),d=s(674981),c=s(199471),u=s(422333),m=s(511131),_=s(429874),g=s(934976),f=(s(244842),s(776351));const p=Boolean(null===(i=null===(o=window.initData)||void 0===o?void 0:o.logo)||void 0===i?void 0:i.no_powered_by);function b(t,e=null,s=null){let o={};if("number"==typeof t)return{relativePositions:{[t]:{l:e,t:s}},nextElementLeft:t,nextElementTop:t};const[i,...a]=t;if("v"===i){let t=null;for(const i of a){const a=b(i,e,s);o={...o,...a.relativePositions},s=a.nextElementTop,t=a.nextElementLeft}e=t}if("h"===i){let t=null;for(const i of a){const a=b(i,e,s);o={...o,...a.relativePositions},e=a.nextElementLeft,t=a.nextElementTop}s=t}return{relativePositions:o,nextElementTop:s,nextElementLeft:e}}const S=function(t){const e={};for(const s of Object.keys(t)){const o=b(t[s]).relativePositions;e[s]=o}return e}(g);function y(t,e,s,o){let i=Math.round(10*o),a=Math.round(10*o);const n=s[t];if(null!==n.l){const t=y(n.l,e,s,o);i=t.x+t.width+Math.round(5*o)}if(null!==n.t){const t=y(n.t,e,s,o);a=t.y+t.height+Math.round(5*o)}const r=e[t];return{x:i,y:a,width:r.width,height:r.height}}function v(t,e,s){var o ;const i=(new DOMParser).parseFromString(f,"image/svg+xml");null===(o=null==i?void 0:i.firstElementChild)||void 0===o||o.setAttribute("color",s);const a=URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(i)],{type:"image/svg+xml"}));return new Promise((s=>{const o=new Image;o.width=t,o.height=e,o.onload=()=>{s({image:o,width:t,height:e})},o.src=a}))}function x(t,e,s,o,i){t.save(),t.drawImage(o.image,e,s,o.width,o.height),t.textBaseline="bottom";const a=(e+o.width)/i+3,n=(s+o.height)/i;(0,c.drawScaled)(t,i,i,(()=>{t.fillText("TradingView",a,n)})),t.restore()}function w(t,e,s,o){return(0,c.drawScaled)(t,o,o,(()=>{t.fillText(s,e.x/o,e.y/o)})),t.measureText(s).width*o}function I(t,e,s,o,i,a){const n=i.map((t=>t.text)).join("");let l=s.x;const h=function(t,e,s,o){if(t.measureText(e).width*o<=s)return{text:e,elided:!1};const i=t.measureText("...").width*o,a=[];for(let t=0;tt.measureText(e.slice(0,n+1)).width*o+i>s));return{text:(e=e.slice(0,n)).trim(),elided:!0}}(t,n,o-l,e);if(h.elided&&!a)return null;const c=[];let u=0;for(const t of i){if(u+t.text.length>h.text.length)break;c.push(t.text),u+=t.text.length}const m=c.join("").trim().length;u=0;for(const o of i){if(u+o.text.length>m)break;o.color&&(t.save(),t.fillStyle=o.color),l+=w(t,new r.Point(l,s.y),o.text,e),o.color&&t.restore(),u+=o.text.length}return h.elided&&(l+=w(t,new r.Point(l,s.y),"...",e)),l}function T(t){return t.map((t=>({...t,title:""})))}function C(t,e){const s=[{text:t.trim()}];for(const t of e)t.visible&&(""!==s[s.length-1].text&&s.push({text:" "}),t.title&&s.push({text:t.title}),s.push({text:t.value,color:t.color}));return s}class F{constructor(t,e){this._logoTextColor=null,this._snapshotData=t,e=e||{},this._options={backgroundColor:_.themes[t.theme].getThemedColor("color-bg-primary"),borderColor:_.themes[t.theme].getThemedColor("color-border"),font:u.CHART_FONT_FAMILY,fontSize:12,legendMode:"vertical",hideResolution:!1,hideStudiesFromLegend:!1,showHeaderPublishedBy:!1,showHeaderMainSymbol:!1,...e};const s=S[t.layout],o=t.charts.map((t=>function(t){const e=t.panes[0],s=e.canvas.width+e.leftAxis.canvas.width+e.rightAxis.canvas.width;let o=0;for(const e of t.panes)o+=e.canvas.height;return void 0!==t.timeAxis&&0!==t.timeAxis.contentHeight&&(o+=t.timeAxis.canvas.height),(0,a.size)({width:s,height:o})}(t)));if(this._pixelRatio=t.hidpiRatio,this._chartsGeometry=t.charts.map(((t,e)=>y(e,o,s,this._pixelRatio))),!p){let s=t.theme;void 0!==e.backgroundColor&&(s="black"===(0,l.rgbToBlackWhiteString)((0,l.parseRgb)(e.backgroundColor),150)?h.StdTheme.Dark:h.StdTheme.Light),this._logoTextColor=_.themes[s].getThemedColor("color-text-primary")}this._headerDefaultTextColor=_.themes[t.theme].getThemedColor("color-text-primary")}async getImage(){const t=this._pixelRatio;let e=0,s=0,o=0;const i=this._headerItems();if(i.length>0){o=Math.ceil(1.4*this._options.fontSize*t)*i.length}s+=o;let n=0,l=0;for(const t of this._chartsGeometry)n=Math.max(n,t.x+t.width),l=Math.max(l,t.y+t.height);const h=s ;e+=n,s+=l,e+=Math.round(10*t);const d=p?Math.round(10*t):Math.round(35*t),_=s;s+=d;const g=(0,c.createDisconnectedCanvas)(document,(0,a.size)({width:e,height:s}),1),f=(0,c.getContext2D)(g);f.font=(0,m.makeFont)(this._options.fontSize,this._options.font),f.textBaseline="top",f.fillStyle=this._options.backgroundColor,f.fillRect(0,0,e,s),i.length>0&&this._drawHeader(f,i,e,new r.Point(Math.round(10*t),Math.round(10*t)));for(let t=0;t0&&e.leftAxis.contentHeight>0&&(s.drawImage(e.leftAxis.canvas,o,i),o+=e.leftAxis.canvas.width),s.drawImage(e.canvas,o,i),o+=e.canvas.width,e.rightAxis.contentWidth>0&&e.rightAxis.contentHeight>0&&s.drawImage(e.rightAxis.canvas,o,i),"pane"===e.type&&(s.fillStyle=t.colors.text,this._drawLegend(e,s,new r.Point(a,l),n)),i+=e.canvas.height}if(void 0!==t.timeAxis&&0!==t.timeAxis.contentHeight){let e=0;t.timeAxis.lhsStub.contentWidth>0&&t.timeAxis.lhsStub.contentHeight>0&&(s.drawImage(t.timeAxis.lhsStub.canvas,e,i),e+=t.timeAxis.lhsStub.canvas.width),s.drawImage(t.timeAxis.canvas,e,i),e+=t.timeAxis.canvas.width,t.timeAxis.rhsStub.contentWidth>0&&t.timeAxis.rhsStub.contentHeight>0&&s.drawImage(t.timeAxis.rhsStub.canvas,e,i)}s.strokeStyle=this._options.borderColor,s.strokeRect(0,0,e.width,e.height),s.restore()}_headerItems(){var t,e,s,o;const i=[];if(this._options.showHeaderPublishedBy&&this._snapshotData.publishedBy)for(const t of this._snapshotData.publishedBy)i.push([{text:t}]);if(this._options.showHeaderMainSymbol){const a=this._snapshotData.charts[0],n=`${null===(t=a.meta)||void 0===t?void 0:t.symbol}, ${null===(e=a.meta)||void 0===e?void 0:e.resolution}`;i.push(C(n,null!==(o=null===(s=a.meta)||void 0===s?void 0:s.values)&&void 0!==o?o:[]))}return i}_drawHeader(t,e,s,o){t.save(),t.fillStyle=this._headerDefaultTextColor;const i=Math.ceil(1.4*this._options.fontSize*this._pixelRatio);e.forEach(((e,a)=>{I(t,this._pixelRatio,new r.Point(o.x,o.y+i*a),s,e,!0)})),t.restore()}_drawLegend(t,e,s,o){let i=!0;const a=Math.ceil(1.4*this._options.fontSize*this._pixelRatio);let l=s.x,h=s.y;if(t.mainSeriesText&&h+a0){i=Math.ceil(1.4*this._options.fontSize*t)*n.length}o+=i;const l=o,h=this._widgetSnapshot.canvas.width,d=this._widgetSnapshot.canvas.height;s+=h+2*e,o+=d+e;const _=Math.round(35*t),g=o;o+=_;const f=(0,c.createDisconnectedCanvas)(document,(0,a.size)({width:s,height:o}),1),p=(0,c.getContext2D)(f);if(p.font=(0,m.makeFont)(this._options.fontSize,this._options.font),p.textBaseline="top",p.fillStyle=this._options.backgroundColor,p.fillRect(0,0,s,o),n.length>0&&this._drawHeader(p,n,s,new r.Point(e,e)),p.drawImage(this._widgetSnapshot.canvas,e,e+l),p.strokeStyle=this._options.borderColor,p.strokeRect(e,e+l,h,d),null!==this._logoTextColor){const s=await v(Math.round(20*t),Math.round(15*t),this._logoTextColor);p.fillStyle=this._logoTextColor,p.font=(0,m.makeFont)(13,u.CHART_FONT_FAMILY);x(p,e,g+Math.round(_/2-s.height/2),s,t)}return f}_headerItems(){const t=[];if(this._options.showHeaderPublishedBy&&this._widgetSnapshot.publishedBy)for(const e of this._widgetSnapshot.publishedBy)t.push([{text:e}]);return t}_drawHeader(t,e,s,o){t.save(),t.fillStyle=this._headerDefaultTextColor;const i=Math.ceil(1.4*this._options.fontSize*this._pixelRatio);e.forEach(((e,a)=>{I(t,this._pixelRatio,new r.Point(o.x,o.y+i*a),s,e,!0)})),t.restore()}}async function D(t,e){return new k(t,e).getImage()}},714688:(t,e,s)=>{"use strict";s.d(e,{DateTimeFormatter:()=>n});var o=s(716714),i=s(157954);const a={dateFormat:"yyyy-MM-dd",withWeekday:!1,timeFormat:o.hourMinuteSecondFormat,dateTimeSeparator:" "};class n{constructor(t={}){const e=Object.assign({},a,t);this._dateFormatter=new i.DateFormatter(e.dateFormat,e.withWeekday),this._timeFormatter=new o.TimeFormatter(e.timeFormat),this._separator=e.dateTimeSeparator}format(t){return`${this._dateFormatter.format(t)}${this._separator}${this._timeFormatter.format(t)}`}formatLocal(t){return`${this._dateFormatter.formatLocal(t)}${this._separator}${this._timeFormatter.formatLocal(t)}`}}},743354:(t,e,s)=>{"use strict";s.d(e,{DateTimeWithTzFormatter:()=>h}) ;var o=s(245302),i=s(988124),a=s(716714),n=s(714688),r=s(157954);const l={dateFormat:"MMM dd",timeFormat:a.hourMinuteFormat};class h{constructor(t={}){const{dateFormat:e,timeFormat:s,timezone:o}={...l,...t};e&&s?this._dateFormatter=new n.DateTimeFormatter({dateFormat:e,timeFormat:s}):e?this._dateFormatter=new r.DateFormatter(e):s&&(this._dateFormatter=new a.TimeFormatter(s)),this._timezone=(0,i.get_timezone)(null!=o?o:"Etc/UTC")}format(t){const e=1e3*t,s=(0,o.parseTzOffset)(this._timezone.name(),e).string;return void 0===this._dateFormatter?s:`${this._dateFormatter.format((0,i.utc_to_cal)(this._timezone,e))} ${s}`}setTimezone(t){this._timezone=(0,i.get_timezone)(t)}}},175878:(t,e,s)=>{"use strict";s.d(e,{SeriesDataSource:()=>v,initialRequestOptionsToNumBars:()=>b,parseJapaneseProjectionBars:()=>x});var o=s(650151),i=s(389137),a=s(919892),n=s(223699),r=s(544421),l=s(917180),h=s(826989),d=s(442410),c=s(201089),u=s(444331),m=s(25e4);const _=(0,c.getLogger)("Chart.SeriesDataSource");var g;!function(t){t[t.Idle=0]="Idle",t[t.AwaitingConnection=1]="AwaitingConnection",t[t.AwaitingFirstDataUpdate=2]="AwaitingFirstDataUpdate",t[t.Active=3]="Active"}(g||(g={}));let f=1;let p=1;function b(t){return t.startDate?t.endDate||t.count?t.endDate?["from_to",t.startDate,t.endDate]:["bar_count",t.startDate,(0,o.ensure)(t.count)]:["from_to",t.startDate]:t.count||300}function S(t){return(0,i.isString)(t.symbol)?t.symbol:t.symbol.symbol}function y(t,e){(0,i.isString)(t.symbol)?t.symbol=e:t.symbol.symbol=e}class v{constructor(t,e,s,o){this._extSymbol=null,this._lastResolvedSymbol="",this._createSeriesOverriddenParams=0,this._instanceId=null,this._symbolInstanceId=null,this._resolution=null,this._timeFrame=null,this._data=new r.SeriesData,this._dataEvents=new d.SeriesDataEvents,this._status=g.Idle,this._turnaroundCounter=1,this._boundOnGatewayIsConnectedChanged=this._onGatewayIsConnectedChanged.bind(this),this._ongoingDataUpdate=Promise.resolve(),this._gateway=t,this._turnaroundPrefix=e,this._createSeriesParams=b(null!=s?s:{count:300}),this._timeFrame=o||null,this._gateway.isConnected().subscribe(this._boundOnGatewayIsConnectedChanged)}destroy(){this.stop(),this._gateway.isConnected().unsubscribe(this._boundOnGatewayIsConnectedChanged)}modifySeries(t,e,s=null,a=!1,r=null){a&&(_.logNormal("Due to force flag clearing symbol & resolution to force re-requesting data."),this._extSymbol=null,this._resolution=null);const l=S(t),h=!this.symbolSameAsResolved(l);if(h&&(this._lastResolvedSymbol=""),this._extSymbol&&!h){y(t,S(this._extSymbol))}const d=this._extSymbol,c=this._resolution;if(this._extSymbol=t,this._resolution=e,null===this._instanceId)return void(this._timeFrame=s);const u=!(0,i.deepEquals)(d,t)[0];u&&y(this._extSymbol,l);const m=null===c||!n.Interval.isEqual(c,e);(u||m||null!==s)&&(this._timeFrame=null,(u||m)&&this._turnaroundCounter++,u&&this._resolveSymbol(),this._gateway.modifySeries(this._instanceId,this.turnaround(),(0,o.ensureNotNull)(this._symbolInstanceId),this._resolution,r,s,this._onMessage.bind(this)), this._dataEvents.fireModified())}requestMoreData(t){null!==this._instanceId&&this._gateway.requestMoreData(this._instanceId,t,this._onMessage.bind(this))}requestMoreTickmarks(t){null!==this._instanceId&&this._gateway.requestMoreTickmarks(this._instanceId,t,this._onMessage.bind(this))}isStarted(){return this._status!==g.Idle}isActive(){return this._status===g.Active}resolution(){return this._resolution}start(){this.isStarted()?_.logNormal("start: data source is already started, nothing to do"):((0,o.assert)(null!==this._extSymbol,"symbol must be set before start"),(0,o.assert)(null!==this._resolution,"resolution must be set before start"),this._gateway.isConnected().value()?this._createSeries():this._changeStatusTo(g.AwaitingConnection))}stop(){this.isStarted()?(null!==this._instanceId&&(this._gateway.removeSeries(this._instanceId),this._instanceId=null),this._symbolInstanceId=null,this._changeStatusTo(g.Idle)):_.logNormal("stop: data source is already stopped, nothing to do")}instanceId(){return this._instanceId}data(){return this._data}setData(t){this._data=t}clearData(){this.isStarted()?this._enqueueUpdate((()=>this._clearDataImpl())):this._clearDataImpl()}dataEvents(){return this._dataEvents}turnaround(){return`${this._turnaroundPrefix}${this._turnaroundCounter}`}symbolInstanceId(){return this._symbolInstanceId}symbol(){return this._extSymbol}moveData(t){this._enqueueUpdate((()=>this._data.moveData(t)))}setInitialRequestOptions(t){this._createSeriesOverriddenParams=b(t)}symbolSameAsResolved(t){return null!==this._extSymbol&&(0,m.symbolSameAsResolved)(t,S(this._extSymbol),this._lastResolvedSymbol)}resolvedSymbol(){return null===this._extSymbol?null:S(this._extSymbol)}_resolveSymbol(){null!==this._extSymbol&&(this._symbolInstanceId=this._gateway.resolveSymbol("sds_sym_"+f++,(0,a.encodeExtendedSymbolOrGetSimpleSymbolString)(this._extSymbol),this._onMessage.bind(this)))}_clearDataImpl(){this._data.clear()}_changeStatusTo(t){(0,o.assert)(this._status!==t,"Source and destination status should be distinct"),_.logNormal(`Status changed from ${g[this._status]} to ${g[t]}`),this._status=t}_createSeries(){(0,o.assert)(this._status!==g.Active,'Status should not be "Active" when creating a study'),this._instanceId="sds_"+p++,this._resolveSymbol();const t=this._createSeriesOverriddenParams||this._createSeriesParams;this._createSeriesOverriddenParams&&(this._createSeriesOverriddenParams=0),this._gateway.createSeries(this._instanceId,this.turnaround(),(0,o.ensureNotNull)(this._symbolInstanceId),(0,o.ensureNotNull)(this._resolution),t,this._timeFrame,this._onMessage.bind(this)),this._timeFrame=null,this._changeStatusTo(g.AwaitingFirstDataUpdate),this._dataEvents.fireCreated(this._instanceId)}_onGatewayIsConnectedChanged(t){t?this._onGatewayConnected():this._onGatewayDisconnected()}_onGatewayConnected(){this._status===g.AwaitingConnection&&this._createSeries()}_onGatewayDisconnected(){this._status!==g.Idle&&this._status!==g.AwaitingConnection&&(this._instanceId=null,this._changeStatusTo(g.AwaitingConnection)), this._turnaroundCounter=1}_onMessage(t){this._enqueueUpdate((()=>this._onMessageImpl(t)))}async _onMessageImpl(t){switch(t.method){case"symbol_resolved":{const[e,s]=t.params;if(e!==this._symbolInstanceId){null!==this._symbolInstanceId&&_.logNormal(`Resolve for old symbol, expected: ${this._symbolInstanceId}, actual ${t.params[0]}`);break}this._onSymbolResolved(s);break}case"symbol_error":if(t.params[0]!==this._symbolInstanceId){null!==this._symbolInstanceId&&_.logNormal(`Symbol error for old symbol, expected: ${this._symbolInstanceId}, actual ${t.params[0]}`);break}this._onSymbolError(t);break;case"series_timeframe":{const[e,s,o,i,a,n,r]=t.params;if(!this._checkTurnaround(e,s)){_.logNormal(`Time frame for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${e} (${s})`);break}this._onSeriesTimeFrame(o,i,a,n,r);break}case"series_error":{const[e,s]=t.params;if(!this._checkTurnaround(e,s)){_.logNormal(`Series error for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${e} (${s})`);break}this._onSeriesError(t.params[2]);break}case"series_loading":{const[e,s]=t.params;if(!this._checkTurnaround(e,s))break;this._onSeriesLoading(t.time);break}case"series_completed":{const[e,s,o,i]=t.params;if(!this._checkTurnaround(e,o)){_.logNormal(`Series completed for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${e} (${o})`);break}this._onSeriesCompleted(s,t.time,i);break}case"data_update":if(!this._checkTurnaround(t.params.customId,t.params.turnaround)){_.logNormal(`Data update for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t.params.customId} (${t.params.turnaround})`);break}await this._onDataUpdate(t.params.plots,t.params.nonseries,t.params.lastBar);break;case"clear_data":if(t.params.turnaround!==this.turnaround()){_.logNormal(`Clear data for old data, expected: ${this.turnaround()}, actual ${t.params.turnaround}`);break}this._clearDataImpl(),this._dataEvents.fireDataUpdated(void 0,!1,null,!1)}}_onSeriesError(t){let e,s;if("string"==typeof t)s={error:t},e=t;else if(s=t,t.ctx){const s={};Object.entries(t.ctx).forEach((([t,e])=>{s[t]=e.toString()})),e=t.error.format(s)}else e=t.error;if(e.startsWith("study_not_auth:")){const t=e.split(":",2)[1].split("@",2)[0];if(["BarSetRenko","BarSetPriceBreak","BarSetKagi","BarSetPnF"].includes(t))this._dataEvents.fireChartTypeNotPermitted(t);else if("BarSetSpread"===t)this._dataEvents.fireIntradaySpreadNotPermitted();else if("BarSetRange"===t){const t=`${(0,o.ensureNotNull)(this._extSymbol).inputs.range}R`;this._dataEvents.fireCustomIntervalNotPermitted(t)}}else{if(e.startsWith("unsupported"))return void this._dataEvents.fireUnsupportedResolutionRequested();"resolution_not_entitled"===e?this._dataEvents.fireIntradayExchangeNotPermitted():"custom_resolution"===e?this._dataEvents.fireCustomIntervalNotPermitted((0, o.ensureNotNull)(this._resolution)):"seconds_not_entitled"===e?this._dataEvents.fireSecondsIntervalNotPermitted():"ticks_not_entitled"===e&&this._dataEvents.fireTicksIntervalNotPermitted()}this._dataEvents.fireSeriesError(s)}_onSeriesTimeFrame(t,e,s,o,i){this._dataEvents.fireSeriesTimeFrame(t,e,s,null==o||o,i)}_onSymbolError(t){if(t.params[1]===h.permissionDenied)switch(t.params[2]){case h.SymbolErrorPermissionDeniedReason.Symbol:this._dataEvents.fireSymbolNotPermitted(t.params[3]);break;case h.SymbolErrorPermissionDeniedReason.GroupPermission:this._dataEvents.fireSymbolGroupNotPermitted(t.params[3]);break;default:this._dataEvents.fireSymbolNotPermitted(t.params[2])}else t.params[1]===h.invalidSymbol&&this._dataEvents.fireSymbolInvalid();this._dataEvents.fireSymbolError(t.params[1])}_onSymbolResolved(t){this._lastResolvedSymbol=(0,o.ensureNotNull)((0,u.extractSymbolNameFromSymbolInfo)(t,"")),this._dataEvents.fireSymbolResolved(t)}async _onDataUpdate(t,e,s){this._onDataUnpacked(t,s,await x(e))}_enqueueUpdate(t){return this._ongoingDataUpdate=this._ongoingDataUpdate.then(t,t),this._ongoingDataUpdate}_onDataUnpacked(t,e,s){if(this._status===g.Idle)return;this._status===g.AwaitingFirstDataUpdate&&(this._changeStatusTo(g.Active),this._clearDataImpl());const o=this._data.bars().size(),i=this._data.bars().firstIndex(),a=this._data.mergeRegularBars(t);null!==s&&(this._data.nsBars().clear(),this._data.nsBars().merge(s.projectionPlots),this._data.lastProjectionPrice=s.lastPrice,null!==s.boxSize&&(this._data.boxSize=s.boxSize),this._data.reversalAmount=s.reversalAmount);const n=null===i,r=n||null!==a&&a.index{let e;return"factor"in t?e=t.factor:"additionalPrice"in t&&(e=t.additionalPrice),{index:s[t.time],value:[0,t.open,t.high,t.low,t.close,t.volume,e]}})),reversalAmount:n,boxSize:a}}},464539:(t,e,s)=>{"use strict";s.d(e,{getHourMinuteFormat:()=>i,getHourMinuteSecondFormat:()=>a,getTimeFormatForInterval:()=>n});var o=s(716714);function i(t){return"12-hours"===t?o.twelveHourMinuteFormat:o.hourMinuteFormat}function a(t){return"12-hours"===t?o.twelveHourMinuteSecondFormat:o.hourMinuteSecondFormat}function n(t,e){if(t.isRange())return function(t){return"12-hours"===t?o.twelveHourMinuteNonZeroSecondFormat:o.hourMinuteNonZeroSecondFormat}(e);if(t.isTicks())return o.hourMinuteSecondMillisecFormat;return t.isSeconds()||t.isTicks()?a(e):i(e)}},776351:t=>{ t.exports=''}}]);