"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[10532,81882],{259611:(e,t,s)=>{s.d(t,{lowerbound:()=>i,upperbound:()=>r});s(185842);function i(e,t,s,i=0,r=e.length){return function(e,t,s,i,r){let n=r-i;for(;0>1,a=i+r;s(e(a),t)?(i=a+1,n-=r+1):n=r}return i}((t=>e[t]),t,s,i,r)}function r(e,t,s,i=0,r=e.length){let n=r-i;for(;0>1,a=i+r;s(t,e[a])?n=r:(i=a+1,n-=r+1)}return i}},654233:(e,t,s)=>{s.d(t,{WatchedObject:()=>r.WatchedObject,WatchedValue:()=>i.WatchedValue});var i=s(336315),r=s(812579)},385955:(e,t,s)=>{s.d(t,{clone:()=>r,deepEquals:()=>o,isArray:()=>l,isInteger:()=>u,isNumber:()=>i,isObject:()=>n,isString:()=>h});new Set(["__proto__","prototype","constructor"]);function i(e){return"number"==typeof e&&isFinite(e)}function r(e){if(!e||"object"!=typeof e)return e;let t;t=Array.isArray(e)?[]:{};for(const s in e)if(e.hasOwnProperty(s)){const i=e[s];t[s]=i&&"object"==typeof i?r(i):i}return t}function n(e){return"object"==typeof e&&null!==e}function a(e){return null!=e&&(e.constructor===Function||"[object Function]"===Object.prototype.toString.call(e))}function o(e,t,s=""){if(e===t)return[!0,s];if(a(e)&&(e=void 0),a(t)&&(t=void 0),null==e||null==t)return[e===t,s];if("object"!=typeof e&&"object"!=typeof t)return[e===t,s];if(Array.isArray(e)&&Array.isArray(t)){const i=e.length;if(i!==t.length)return[!1,s];for(let r=0;r{s.d(t,{colorsPalette:()=>i.colorsPalette,getHexColorByName:()=>i.getHexColorByName});var i=s(666957)},627889:(e,t,s)=>{s.d(t,{color:()=>n,dur:()=>i,easingFunc:()=>r});const i=350,r={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1+--e*e*e*e*e,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e};const n={black70:"#4A4A4A",black80:"#535353"}},781882:(e,t,s)=>{s.d(t,{MiniChartPlotBase:()=>B,isTimePointIndex:()=>N,seriesHorzMarginsDefaults:()=>V});var i=s(904003),r=s(319585),n=s(209539),a=s(750586),o=s(185842),l=s(955482),u=s(77357),h=s(385955),c=s(729193),d=s(172137),m=s(275925),_=s(584104),p=s(606703),g=s(18107),f=s(168509),y=s(875500),v=s(760823),b=s(395079),S=s(874651),w=s(70346),C=s(690522),I=s(476989),M=s(938881);const x=(0,u.getLogger)("Chart.MiniChart"),T=new v.VolumeFormatter;function E(e,t,s){return{time:e,color:s,value:t[4]}} function k(e,t){return{time:e,open:t[1],high:t[2],low:t[3],close:t[4]}}function D(e,t,s,i,r){return{time:e,topColor:i,bottomColor:r,lineColor:s,value:t[4]}}function O(e){const t=new Date(e);return Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds())/1e3}function N(e){return(0,h.isInteger)(e)}const L=(0,i.default)(m.resetTransparency);const V={leftLogical:0,rightLogical:0,leftPx:0,rightPx:4};function R(e){if(0===e.series.length)return null;const t=e.series[0],s=t.value??t.close,i=e.series[e.series.length-1],r=i.value??i.close;return{first:{value:s,time:t.time},last:{value:r,time:i.time}}}class B{constructor(e,t,s,i){this._symbolChanged=new y.Delegate,this._seriesChanged=new y.Delegate,this._whitespaces=null,this._symbolResolved=new y.Delegate,this._originalScaleMode=null,this._customPriceFormatter=null,this._isDestroyed=new f.WatchedValue(!1),this._status=new f.WatchedValue(0),this._noData=new f.WatchedValue(null),this._directionBasedColor=new f.WatchedValue(null),this._dataLengthInfo=null,this._sessionId=new f.WatchedValue,this._barBuilderLoader=null,this._symbolInfo=null,this._symbol={symbol:""},this._minBarIndex=null,this._maxBarIndex=null,this._lastValue=new f.WatchedValue(null),this._isVisible=new f.WatchedValue(!1),this._id=(0,_.randomHash)(),this._timeFrameInvalidated=new y.Delegate,this._firstValueCache=null,this._firstBarTime=new f.WatchedValue(null),this._historyUpdateReceived=!1,this._miniChart=e,this._originalSeriesOptions=t,this._currentSeriesOptions=(0,n.default)({},t),this._options=i,this._series=this._createSeries(),this._originalVolumeOptions=s,this._volume=this._createVolume(),this._timeFrame=e.timeframe().spawn(),this._timeFrame.subscribe(this._updateSessionId.bind(this)),this._currentlyShownDataDescription=new C.WatchedObject({timeframe:this._timeFrame.value(),symbol:this.symbol()}),this._isLastSessionInterval=(0,g.combine)((e=>"LASTSESSION"===(0,I.convertTimeFrameToStr)(e)),this._miniChart.timeframe().weakReference()),this._isLastSessionInterval.subscribe(this._updateSessionId.bind(this)),this._miniChart.timeScaleSizeChanged().subscribe(null,this._timeScaleSizeChanged.bind(this)),this._status.subscribe((e=>{3!==e&&this._lastValue.setValue(null)}))}destroy(){this._status.unsubscribe(),this._timeFrame.destroy(),this._isDestroyed.setValue(!0),this._isLastSessionInterval.destroy(),this._barBuilderLoader?.destroy()}id(){return this._id}status(){return this._status.readonly()}noData(){return this._noData.readonly()}symbolInfo(){return this._symbolInfo}symbol(){return this._symbol.symbol}subSession(){return this._sessionId.value()}setSymbol(e,t){return(0,a.default)(e)&&(e=(0,S.isEncodedExtendedSymbol)(e)?(0,S.decodeExtendedSymbol)(e):{...this._symbol,symbol:e}),void 0!==t&&this._updateSeriesOptions(t),!(0,S.compareSymbols)(this._symbol,e)&&(this._symbol=e,this._updateSessionId(),this._symbolChanged.fire(),!0)}extendedSymbol(){return{...this._symbol,session:this._sessionId.value()}}quotesSymbol(){return{...this.extendedSymbol(),metric:void 0}} updateSeriesOptions(e){let t=!1;void 0!==e.chartType&&this._originalSeriesOptions.chartType!==e.chartType?t=!0:"line"!==this._originalSeriesOptions.chartType&&"area"!==this._originalSeriesOptions.chartType||(t="postmarketLineColor"in e&&this._originalSeriesOptions.postmarketLineColor!==e.postmarketLineColor||"premarketLineColor"in e&&this._originalSeriesOptions.premarketLineColor!==e.premarketLineColor),this._updateSeriesOptions(e),t?this._onChartStyleChanged():this._series.applyOptions(e)}applyOptions(e){(0,n.default)(this._options,e)}symbolResolved(){return this._symbolResolved}symbolChanged(){return this._symbolChanged}seriesChanged(){return this._seriesChanged}timeFrameInvalidated(){return this._timeFrameInvalidated}restoreOriginalScaleMode(){null!==this._originalScaleMode&&this._series.priceScale().applyOptions({mode:this._originalScaleMode})}switchToPercentageScaleMode(){null===this._originalScaleMode&&(this._originalScaleMode=this._series.priceScale().options().mode),this._series.priceScale().applyOptions({mode:r.PriceScaleMode.Percentage})}chartSession(){return this._miniChart.chartSession()}currentSeriesOptions(){return this._currentSeriesOptions}volumeOptions(){return this._originalVolumeOptions}series(){return this._series}volume(){return this._originalVolumeOptions.visible?this._volume:null}updateData(e,t,s){e&&this.clearSourceData();const i=this._originalSeriesOptions,r=this._buildViewData(s),n=r.series.length;this._historyUpdateReceived=this._historyUpdateReceived||void 0===s,void 0!==s||"area"!==i.chartType&&"line"!==i.chartType||(this._firstValueCache=r.series[0]?.value??null);const a=this._historyUpdateReceived&&null===this._dataLengthInfo;if(void 0!==s&&!a){const e=this._dataLengthInfo;if(null===e)return;const t={...e};e.lastBarSession=r.lastBarSession;let s=null;for(const t of r.series)this._series.update(t),(null===e.lastBarTime||e.lastBarTimee.time>s));-1===t?(e.whitespaces=0,this._updateWhitespaces([])):0!==t&&(e.whitespaces-=t,this._updateWhitespaces(this._whitespacesData.slice(t)))}null!==s&&(void 0!==e.fixLeftEdgeUntil?(this._isMainPlot()&&e.fixLeftEdgeUntil>=s&&this._miniChart.fitContent(),s>e.fixLeftEdgeUntil&&(e.history+=e.realtime-1,e.realtime=0,e.fixLeftEdgeUntil=void 0,e.timeFrameInvalidated=!0,this._timeFrameInvalidated.fire())):e.timeFrameInvalidated||(e.timeFrameInvalidated=!0,this._timeFrameInvalidated.fire())),this._updateSeriesColor(r.series[r.series.length-1]),this._dataUpdated(r,e,t);const i=R(r);return void(null!==i&&this._lastValue.setValue(i.last.value))}const o=r.whitespaces,l=o?.length??0;this._dataLengthInfo={history:n,realtime:0,lastBarIndex:0===n?null:n-1,lastBarTime:0===n?null:r.series[n-1].time,whitespaces:l,fixLeftEdgeUntil:r.fixLeftEdgeUntil, timeFrameInvalidated:!1,lastBarSession:r.lastBarSession},this._updateSeriesColor(0===n?void 0:r.series[n-1]),this._series.applyOptions(this._currentSeriesOptions),this._applyPriceScaleFormatter(),t||this._beforeDataReady(),this._series.setData(r.series),r.additionalSeries&&this._setAdditionalSeriesData(r.additionalSeries),r.volume&&this._volume.setData(r.volume),this._updateWhitespaces(r.whitespaces),this._dataUpdated(r,this._dataLengthInfo);const u=R(r);if(null!==u){const{first:e,last:t}=u;this._lastValue.setValue(t.value),this._firstBarTime.setValue(e.time)}}titles(){return this._currentSeriesOptions.title?[this._currentSeriesOptions.title]:[]}deleteView(){this._series.setData([]),this._whitespaces?.setData([]),this._volume.setData([])}clearData(){this._symbolInfo=null,this._historyUpdateReceived=!1,this._dataLengthInfo=null,this._firstValueCache=null,this._customPriceFormatter=null,this._status.setValue(0),this._noData.setValue(null),this._directionBasedColor.setValue(null)}resolution(){return this._miniChart.resolution()}minBarIndex(){return this._minBarIndex}maxBarIndex(){return this._maxBarIndex}forcePercentageMode(){return!1}lastBarTime(){return this._dataLengthInfo?.lastBarTime??void 0}getViewData(e){return this._buildViewData(e)}getLegendData(e){const{point:t,time:i,seriesData:r}=e,n=this.series(),a=this.volume();if(void 0===t||void 0===i)return[];const l=r.get(n);if(void 0===l)return[];const u=[],h=n.priceFormatter(),d=this.currentSeriesOptions();if(!1===d.visible)return[];if("Area"===n.seriesType()||"Line"===n.seriesType()||"Baseline"===n.seriesType()||"legend"===d.tooltipType||"line"===d.tooltipType){const{value:e}=l;let t;t="area"===d.chartType?l.lineColor:l.color;const s=this.symbolInfo(),i=d.color||d.lineColor;u.push({title:d.tooltipTitle||s?.name||"",value:h.format(e),color:t||i,unit:d.showUnit?(0,p.prepareCurrencyValue)({currency_code:s?.currency_code,unit_id:s?.unit_id,value_unit_id:s?.value_unit_id,measure:s?.measure}):void 0})}else{const{open:e,high:t,low:i,close:r}=l,a=function(e,t){const s=e?t.up:t.down;return L(s)}(r>=e,(0,o.ensureDefined)(this._miniChart.upDownColors()[n.seriesType()]));[[c.t(null,{context:"in_legend"},s(960513)),h.format(e)],[c.t(null,{context:"in_legend"},s(954614)),h.format(t)],[c.t(null,{context:"in_legend"},s(839463)),h.format(i)],[c.t(null,{context:"in_legend"},s(229994)),h.format(r)]].forEach((([e,t])=>{u.push({value:t,title:e,color:a})}))}const _=a&&r.get(a),g=this.volumeOptions();if(_){const{value:e,color:t}=_;u.push({title:g.tooltipTitle??c.t(null,{context:"in_legend"},s(565321)),value:T.format(e),color:g.ignoreColor?void 0:t&&(0,m.resetTransparency)(t),unit:g.showUnit?this.symbolInfo()?.currency_code:void 0})}return u}lastValue(){return this._lastValue.readonly()}firstBarTime(){return this._firstBarTime.readonly()}isVisible(){return this._isVisible.readonly()}symbolName(){return this._symbol.symbol}lineColor(){const e=this.currentSeriesOptions();return"line"===e.chartType?e.color??"":"area"===e.chartType?e.lineColor??"":void(0, o.assert)(!1,`Unexpected chart type: ${e.chartType}`)}isDestroyed(){return this._isDestroyed.readonly()}_isMainPlot(){return!1}_onChartStyleChanged(){this._recreateSeries(),3===this._status.value()&&this.updateData(!1,!0)}_beforeDataReady(){this._currentlyShownDataDescription.setValue({timeframe:this._timeFrame.value(),symbol:this.symbol()})}_dataUpdated(e,t,s){}_onSymbolResolved(e){this._barBuilderLoader?.destroy(),this._barBuilderLoader=null,this._symbolInfo=e,this._symbolResolved.fire(this._symbolInfo)}_getViewData(e,t){const s=[],i={series:[],volume:s};let r=-1/0;const n=this._bars();if(n.isEmpty())return i;const a=this.minBarIndex(),o=this.maxBarIndex();if(null===a||null===o)return i;const l=t??(N(a)?a:n.firstIndex()),u=n.lastIndex();if(null===l||null===u)return i;let h;const{premarketLineColor:c,postmarketLineColor:d,premarketTopColor:m,premarketBottomColor:_,postmarketTopColor:p,postmarketBottomColor:g}=this._getPrePostMarketColors(),f=e=>{switch(e){case 0:return[c,m,_];case 1:return[d,p,g];default:return[]}};for(const t of n.rangeIterator(l,u)){const{value:n,index:a}=t;if(a<=b.UNPLOTTABLE_TIME_POINT_INDEX)continue;const o=this._miniChart.indexToTime(a);if(null===o){x.logWarn(`Couldn't find time for index ${a}`);continue}const l=O(1e3*o);if(l<=r)continue;r=l,h=l;const u=this._barIndexSession(a);i.lastBarSession=u,i.series.push(e(l,n,...f(u)));const c=n[4]>=n[1]?this._originalVolumeOptions.upColor:this._originalVolumeOptions.downColor;s.push({time:l,value:n[5],color:c})}if(this._isMainPlot()&&void 0===t&&void 0!==h)switch((0,I.convertTimeFrameToStr)(this._timeFrame.value())){case"1D":i.fixLeftEdgeUntil=h+86400-1;break;case"LASTSESSION":{let e=[],t=h+87840-1;const s=this._generateBarsToSessionEnd();s?.length&&null!==o&&o>u&&(e=s,t=s[s.length-1].time),i.fixLeftEdgeUntil=t,i.whitespaces=e}}return i}_buildViewData(e){switch(this._originalSeriesOptions.chartType){case"pretty-histogram":case"histogram":{const e=this._currentSeriesOptions;return this._getViewData(((t,s)=>function(e,t,s,i){const r=t[4];return{time:e,color:r>0?s:i,value:r}}(t,s,e.upColor,e.downColor)))}case"line":return this._getViewData(E,e);case"area":case"baseline":return this._getViewData(D,e);case"bars":case"candlesticks":return this._getViewData(k,e)}}_setAdditionalSeriesData(e){}_updateAdditionalSeriesData(e){}_barIndexSession(e){}_onSymbolError(e){x.logWarn((0,S.encodeExtendedSymbolOrGetSimpleSymbolString)(this._symbol)+" symbol resolving error: "+e),this.updateData(!0),this._status.setValue(1)}_onSymbolNotPermitted(){this._noData.setValue(1)}_onIntradaySpreadNotPermitted(){this._status.setValue(2),this._noData.setValue(4),this._isMainPlot()&&this._miniChart.showMessage(c.t(null,{context:"mini chart error message"},s(829273)))}_onSymbolGroupNotPermitted(){this._noData.setValue(1)}_onSymbolInvalid(){this._noData.setValue(0)}_onResolutionOrExchangeNotPermittedError(){x.logError((0,S.encodeExtendedSymbolOrGetSimpleSymbolString)(this._symbol)+" resolution or exchange permission error"),this.updateData(!0), this._isMainPlot()&&this._miniChart.showMessage(c.t(null,{context:"mini chart error message"},s(285893))),setTimeout((()=>this._miniChart.updateAvailableTimeframes()),1e3)}_onDataError(){1!==this._status.value()&&this._status.setValue(2),this._noData.setValue(3)}_onDataCompleted(){this._status.setValue(3),this._noData.setValue(0===this._bars().size()?2:null),2===this._noData.value()&&this._isMainPlot()&&this._showNoDataMessage()}_showNoDataMessage(){this._miniChart.showMessage(c.t(null,{context:"mini chart error message"},s(299153)))}async _onData(e,t){null!==this.minBarIndex()&&null!==this.maxBarIndex()&&(this.updateData(!1,void 0,e),3===this._status.value()&&this._noData.setValue(0===this._bars().size()?2:null))}_updateSeriesOptions(e){this._originalSeriesOptions=(0,n.default)(this._originalSeriesOptions,e),this._currentSeriesOptions=(0,n.default)(this._currentSeriesOptions,this._originalSeriesOptions),this._updateSeriesColor(),void 0!==this._currentSeriesOptions.visible&&this._isVisible.setValue(this._currentSeriesOptions.visible)}_recreateSeries(){const e=this._miniChart.widget();e.removeSeries(this._series),e.removeSeries(this._volume),this._whitespaces&&(e.removeSeries(this._whitespaces),this._whitespaces=null),this._series=this._createSeries(),this._volume=this._createVolume(),this._seriesChanged.fire()}_initBarBuilder(e){return null===this._barBuilderLoader&&(this._barBuilderLoader=new d.AsyncResourceWrapper(Promise.all([s.e(40482),s.e(12014),s.e(92384),s.e(62778)]).then(s.bind(s,563021)).then((t=>new t.LightweightMiniChartBarBuilder(e))))),this._barBuilderLoader.promise()}_firstAndLastValuesForSeriesColor(e,t){if(null===this._firstValueCache||!this._dataLengthInfo)return null;if("line"!==e&&"area"!==e)return null;const s=null===this._dataLengthInfo.lastBarIndex?null:this._series.dataByIndex(this._dataLengthInfo.lastBarIndex);return null!==s||t?(t=t??s,[this._firstValueCache,t.value]):null}_updateSeriesColor(e){const t=this._originalSeriesOptions,s=t.chartType,i=this._firstAndLastValuesForSeriesColor(s,e);if(null===i)return;const[r,n]=i;if("line"===s||"area"===s){const e="line"===s?n>=r:n>r;if("area"===s){const s=this._currentSeriesOptions;e?(s.lineColor=t.growingLineColor||t.lineColor,s.topColor=t.growingTopColor||t.topColor,s.bottomColor=t.growingBottomColor||t.bottomColor):(s.lineColor=t.fallingLineColor||t.lineColor,s.topColor=t.fallingTopColor||t.topColor,s.bottomColor=t.fallingBottomColor||t.bottomColor),s.lineColor||(s.lineColor=this._series.options().lineColor),this._series.applyOptions({topColor:s.topColor,bottomColor:s.bottomColor,lineColor:s.lineColor}),this._directionBasedColor.setValue(s.lineColor)}else if("line"===s){const{color:s,growingColor:i=s,fallingColor:r=s}=t,n=this._currentSeriesOptions;n.color=e?i:r,n.color||(n.color=this._series.options().color),this._series.applyOptions({color:n.color}),this._directionBasedColor.setValue(n.color)}}}_priceFormat(){const e=this._symbolInfo??this._miniChart.mainPlot().symbolInfo();return null===e?null:function(e){const t=(0, w.createSeriesFormatter)(e,"default");return{type:"custom",minMove:e.minmov/e.pricescale,base:e.pricescale/e.minmov,formatter:e=>t.format(e)}}(e)}_createSeries(){const e=this._miniChart.widget();let t;switch(this._currentSeriesOptions.chartType){case"line":t=e.addSeries(r.LineSeries,this._currentSeriesOptions);break;case"histogram":t=e.addSeries(r.HistogramSeries,this._currentSeriesOptions);break;case"area":t=e.addSeries(r.AreaSeries,this._currentSeriesOptions);break;case"bars":t=e.addSeries(r.BarSeries,this._currentSeriesOptions);break;case"candlesticks":t=e.addSeries(r.CandlestickSeries,this._currentSeriesOptions);break;case"baseline":t=e.addSeries(r.BaselineSeries,this._currentSeriesOptions);break;case"pretty-histogram":{const s=new M.PrettyHistogramSeries;t=e.addCustomSeries(s,this._currentSeriesOptions)}}return null===this._originalScaleMode&&(this._originalScaleMode=t.priceScale().options().mode),this._isVisible.setValue(t.options().visible),t.priceScale().applyOptions({scaleMargins:this._currentSeriesOptions.scaleMargins}),t}_createVolume(){const e=this._miniChart.widget().addSeries(r.HistogramSeries,this._originalVolumeOptions);return e.priceScale().applyOptions({scaleMargins:this._originalVolumeOptions.scaleMargins}),e}_applyPriceScaleFormatter(){if("priceFormat"in this._originalSeriesOptions)return;const e=this._priceFormat();e&&(this._currentSeriesOptions.priceFormat=e,this._series.applyOptions(this._currentSeriesOptions))}_updateSessionId(){this._sessionId.setValue(this._isLastSessionInterval.value()?"extended":this._symbol.session)}_updateWhitespaces(e){void 0===e||0===e.length?null!==this._whitespaces&&(this._miniChart.widget().removeSeries(this._whitespaces),this._whitespaces=null):(null===this._whitespaces&&(this._whitespaces=this._miniChart.widget().addSeries(r.LineSeries)),this._whitespacesData=null===this._whitespaces?void 0:e,this._whitespaces.setData(e))}_generateBarsToSessionEnd(){const e=this.symbolInfo(),t=this._bars().lastIndex(),s=this.maxBarIndex();if(e&&t&&s&&this._isLastSessionInterval.value()){let e=this._miniChart.indexToTime(t);if(null===e)return;const i=[];for(let r=t+1;r<=s;r+=1){const t=this._miniChart.indexToTime(r)??e+60;i.push({time:O(1e3*t)}),e=t}return i}}_getPrePostMarketColors(){if(!this._isMainPlot())return{};let e,t,s,i;const r=this._originalSeriesOptions.premarketLineColor,n=this._originalSeriesOptions.postmarketLineColor;if("area"===this._originalSeriesOptions.chartType&&r&&n){const a=this._currentSeriesOptions,o=a.growingTopColor||a.fallingTopColor||a.topColor;if(void 0!==o){const t=(0,l.tryParseRgba)(o);if(null!==t){const i=t[3];e=(0,m.applyAlpha)(r,i),s=(0,m.applyAlpha)(n,i)}}const u=a.growingBottomColor||a.fallingBottomColor||a.bottomColor;if(void 0!==u){const e=(0,l.tryParseRgba)(u);if(null!==e){const s=e[3];t=(0,m.applyAlpha)(r,s),i=(0,m.applyAlpha)(n,s)}}}return{premarketLineColor:r,postmarketLineColor:n,premarketTopColor:e,postmarketTopColor:s,premarketBottomColor:t,postmarketBottomColor:i}}_timeScaleSizeChanged(){ this._isMainPlot()&&Promise.resolve().then((()=>this._miniChart.fitContent()))}}},231476:(e,t,s)=>{s.d(t,{flushDelegate:()=>i});const i=new(s(875500).Delegate)},950808:(e,t,s)=>{s.d(t,{getJSON:()=>N,getValue:()=>O,keys:()=>B,remove:()=>L,setJSON:()=>R,setValue:()=>V});var i=s(266150),r=s(77357),n=s(788312),a=s(231476),o=(s(376596),s(131890)),l=s(938429),u=s(813169),h=s(724226),c=s(875500);window.TradingView=window.TradingView||{};const d=["s.tradingview.com","betacdn.tradingview.com"],m=((0,i.isFeaturesetEnabled)("use_localstorage_for_settings"),"local"===window.environment?5e3:12e4),_=10,p=window.TradingView.onWidget?.()?"tradingview-widget":"tradingview",g=p+".";let f,y,v,b=!1,S=null,w={},C=[];const I=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^chart\.favoriteLibraryIndicators$/,/^loadChartDialog.favorites$/,/^ChartFavoriteDrawingToolbarWidget\.visible/,/^trading\.chart\.proterty$/,/^trading_floating_toolbar\.position$/,/^trading\.orderWidgetMode\./,/^symbolWatermark$/,/^pinereference\.size$/,/^pinereference\.position$/,/^hint\.+/,/^ChartDrawingToolbarWidget\.visible/];const M=()=>!(S||window.is_authenticated),x=e=>g+e,T=(0,r.getLogger)("Lib.TVSettings"),E=e=>{if(b||v)return;if((0,n.isFeatureEnabled)("disable_save_settings"))return void T?.logWarn("Settings flashing has been skipped because of disable_save_settings featuretoggle");if((0,i.isFeaturesetEnabled)("widget"))return;if(M())return;if(0===C.length)return;const t=C;C=[];const s={};for(let e=t.length;e--;){const i=t[e];s[i]=w[i]??null}const r=new FormData;r.append("delta",JSON.stringify(s)),e&&navigator.sendBeacon?navigator.sendBeacon("/savesettings/",r):(0,o.fetch)("/savesettings/",{method:"POST",credentials:"include",body:r}).then((s=>{if(s.ok||(C=C.concat(t)),[429,503].includes(s.status)){const t=1e3*+(s.headers.get("retry-after")||0)||3e5;v=setTimeout((()=>{v=void 0,E(e)}),t)}})).catch((()=>{C=C.concat(t)}))},k=()=>{f=void 0,C.length&&E()},D=(e,t={})=>{if(S)null==w[e]?S.removeValue(e):S.setValue(e,w[e]);else if(M())try{null==w[e]?h.TVLocalStorage.removeItem(x(e)):h.TVLocalStorage.setItem(x(e),w[e])}catch(e){}else C.push(e),f||(f=setTimeout(k,m));t.skipCrossWindowEvent||u.TVXWindowEvents.emit("settings",JSON.stringify({key:e,value:w[e]}))};function O(e,t){const s=w[e];return s??t}function N(e,t){const s=O(e);if(null==s)return t;try{return JSON.parse(s)}catch(s){return L(e),t}}function L(e,t={}){return null!=w[e]&&(delete w[e],D(e)),t.forceFlush&&E(),W}function V(e,t,s={}){const i=""+t;return w[e]!==i&&(w[e]=i,D(e,s)),s.forceFlush&&!y&&(y=setTimeout((()=>{y=void 0,E()}),_)),W}function R(e,t,s){return V(e,JSON.stringify(t),s),W}function B(){return Object.keys(w)}u.TVXWindowEvents.on("settings",(e=>{const t=JSON.parse(e);null==t.value?delete w[t.key]:w[t.key]=t.value}));const F=e=>{for(let t=0;te.substring(0,g.length)===g,$=e=>{w={} ;const t=0===Object.keys(e).length;t||(e=>{Object.keys(e).forEach((t=>{w[t]=e[t]+""}))})(e),(e=>{for(let t=h.TVLocalStorage.length;t--;){const s=h.TVLocalStorage.key(t);s&&P(s)&&(e&&V(s.substring(g.length),h.TVLocalStorage.getItem(s)),h.TVLocalStorage.removeItem(s))}})(t)},A=new c.Delegate;const W={loaded:!1,loadedModel:!1,getValue:O,getJSON:N,getBool:function(e,t){const s=O(e);return null==s?t:!(!s||"false"===s||0==+s)},getFloat:function(e,t){const s=O(e);if(null==s)return t;const i=parseFloat(s);if(!isFinite(i))throw new TypeError('"'+s+'" is not float (key: "'+e+'")');return i},getInt:function(e,t){const s=O(e);if(null==s)return t;const i=parseInt(s,10);if(!isFinite(i))throw new TypeError('"'+s+'" is not int (key: "'+e+'")');return i},setValue:V,setJSON:R,remove:L,keys:B,keysMask:function(e){const t=B(),s=[],i=new RegExp("^"+(0,l.regExpEscape)(e).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi");for(let e=t.length-1;e>=0;e--)i.test(t[e])&&s.push(t[e]),i.lastIndex=0;return s},sync:function(e){null!==e?(S?$(S.initialSettings||{}):M()?((()=>{if(!window.TradingView.onWidget?.()||!d.includes(window.location.host))return;const e="tradingview.";for(let t=h.TVLocalStorage.length;t--;){const s=h.TVLocalStorage.key(t);if(0===s.indexOf(e)){const t=s.replace(e,p+".");h.TVLocalStorage.setItem(t,h.TVLocalStorage.getItem(s)),h.TVLocalStorage.removeItem(s)}}})(),(()=>{w={};const e=!(0,i.isFeaturesetEnabled)("save_chart_properties_to_local_storage");for(let t=h.TVLocalStorage.length;t--;){const s=h.TVLocalStorage.key(t);if(!s||!P(s))continue;const i=s.substring(g.length);e&&!F(i)||(w[i]=h.TVLocalStorage.getItem(s))}})()):$(e||{}),A.fire()):b=!0},onSync:A,setSettingsAdapter:function(e){S=e}};window.TVSettings=W,document.addEventListener("visibilitychange",(()=>{"hidden"!==document.visibilityState&&!0!==document.hidden||E()})),window.addEventListener("pagehide",(()=>{E(!0)})),window.addEventListener("beforeunload",(()=>{E(!0)})),a.flushDelegate.subscribe(null,(()=>{E()})),setTimeout((async()=>{const{clearOldSettings:e}=await s.e(35980).then(s.bind(s,447436));e()}),3e4)},813169:(e,t,s)=>{s.d(t,{TVXWindowEvents:()=>a});s(686923);var i=s(77357),r=s(724226);const n=(0,i.getLogger)("XWindowEvents");var a;!function(e){const t="tvxwevents.",s={};let i;window.BroadcastChannel?(i=new BroadcastChannel("tvxwevents"),i.addEventListener("message",(function(e){const{data:{event:t,value:i}}=e;s[t]&&s[t].forEach((e=>{e(i)}))})),function(){const e=[],s=performance.now();for(let s=0;s{t(e.newValue)}));r.TVLocalStorage.removeItem(n)})),e.on=function(e,t){s[e]||(s[e]=[]),s[e].push(t)},e.off=function(e,t){if(!s[e])return;const i=s[e].indexOf(t);-1!==i&&(1===s[e].length?delete s[e]:s[e].splice(i,1))},e.emit=function(e,s=Date.now()){try{i?i.postMessage({event:e,value:s}):r.TVLocalStorage.setItem(t+e,s.toString())}catch(e){n.logError(e.message)}}}(a||(a={}))},188485:(e,t,s)=>{s.d(t,{lowerbound:()=>i.lowerbound,upperbound:()=>i.upperbound});var i=s(259611)},18107:(e,t,s)=>{s.d(t,{combine:()=>n});var i=s(654233);function r(e,t,...s){let r=null;const n=(...t)=>e(...t.map((e=>e.value())),r?.value()),a=r=new i.WatchedValue(n(...s)),o=()=>{const e=s.map(((e,t)=>e.value()));t(...e)&&a.setValue(n(...s))},l=s.map((e=>e.spawn()));for(const e of l)e.subscribe(o);return a.readonly().spawn((()=>{l.forEach((e=>e.destroy())),s.forEach((e=>e.release()))}))}function n(e,...t){return r(e,(()=>!0),...t)}},168509:(e,t,s)=>{s.d(t,{WatchedValue:()=>i.WatchedValue});var i=s(654233)},310834:(e,t,s)=>{s.d(t,{customFormatters:()=>i});const i={dateFormatter:null,timeFormatter:null,tickMarkFormatter:null,priceFormatterFactory:null,studyFormatterFactory:null}},855303:(e,t,s)=>{s.d(t,{dateFormatFunctions:()=>y,getDateFormatWithWeekday:()=>v});var i=s(729193),r=s(493892),n=s(513433);const a={1:()=>i.t(null,void 0,s(657374)),2:()=>i.t(null,void 0,s(617341)),3:()=>i.t(null,void 0,s(103305)),4:()=>i.t(null,void 0,s(526785)),5:()=>i.t(null,{context:"short"},s(734750)),6:()=>i.t(null,void 0,s(87745)),7:()=>i.t(null,void 0,s(183959)),8:()=>i.t(null,void 0,s(93762)),9:()=>i.t(null,void 0,s(178469)),10:()=>i.t(null,void 0,s(728337)),11:()=>i.t(null,void 0,s(646545)),12:()=>i.t(null,void 0,s(769036))},o={1:()=>i.t(null,void 0,s(89767)),2:()=>i.t(null,void 0,s(948923)),3:()=>i.t(null,void 0,s(367935)),4:()=>i.t(null,void 0,s(175507))},l=(e,t)=>(t?e.getMonth():e.getUTCMonth())+1,u=(e,t)=>t?e.getDate():e.getUTCDate(),h=(e,t)=>t?e.getFullYear():e.getUTCFullYear(),c=(e,t)=>e.toLocaleDateString(window.language?(0,r.getIsoLanguageCodeFromLanguage)(window.language):void 0,{weekday:"short",timeZone:"local"===t?void 0:t}),d=(e,t)=>o[((e,t)=>Math.floor((l(e,t)-1)/3)+1)(e,t)](),m=(e,t)=>(0,n.numberToStringWithLeadingZero)(u(e,t),2),_=(e,t)=>a[l(e,t)](),p=(e,t)=>(0,n.numberToStringWithLeadingZero)(l(e,t),2),g=(e,t)=>(0,n.numberToStringWithLeadingZero)(h(e,t)%100,2),f=(e,t)=>(0,n.numberToStringWithLeadingZero)(h(e,t),4),y={"qq 'yy":(e,t)=>`${d(e,t)} '${g(e,t)}`,"qq yyyy":(e,t)=>`${d(e,t)} ${f(e,t)}`,"dd MMM 'yy":(e,t)=>`${m(e,t)} ${_(e,t)} '${g(e,t)}`,"MMM 'yy":(e,t)=>`${_(e,t)} '${g(e,t)}`,"MMM dd, yyyy":(e,t)=>`${_(e,t)} ${m(e,t)}, ${f(e,t)}`,"MMM d, yyyy":(e,t)=>`${_(e,t)} ${((e,t)=>(0,n.numberToStringWithLeadingZero)(u(e,t),0))(e,t)}, ${f(e,t)}`,"MMM yyyy":(e,t)=>`${_(e,t)} ${f(e,t)}`,"MMM dd":(e,t)=>`${_(e,t)} ${m(e,t)}`,"dd MMM":(e,t)=>`${m(e,t)} ${_(e,t)}`,"yyyy-MM-dd":(e,t)=>`${f(e,t)}-${p(e,t)}-${m(e,t)}`,"yy-MM-dd":(e,t)=>`${g(e,t)}-${p(e,t)}-${m(e,t)}`, "yy/MM/dd":(e,t)=>`${g(e,t)}/${p(e,t)}/${m(e,t)}`,"yyyy/MM/dd":(e,t)=>`${f(e,t)}/${p(e,t)}/${m(e,t)}`,"dd-MM-yyyy":(e,t)=>`${m(e,t)}-${p(e,t)}-${f(e,t)}`,"dd-MM-yy":(e,t)=>`${m(e,t)}-${p(e,t)}-${g(e,t)}`,"dd/MM/yy":(e,t)=>`${m(e,t)}/${p(e,t)}/${g(e,t)}`,"dd/MM/yyyy":(e,t)=>`${m(e,t)}/${p(e,t)}/${f(e,t)}`,"MM/dd/yy":(e,t)=>`${p(e,t)}/${m(e,t)}/${g(e,t)}`,"MM/dd/yyyy":(e,t)=>`${p(e,t)}/${m(e,t)}/${f(e,t)}`};function v(e,t){return"ja"===window.language?(s,i)=>`${y[e](s,i)} (${c(s,t)})`:(s,i)=>`${c(s,t)} ${y[e](s,i)}`}Object.keys(y)},760823:(e,t,s)=>{s.d(t,{PLACE_HOLDER:()=>a,VolumeFormatter:()=>u});var i=s(729193),r=s(148544),n=s(385955);const a="---",o=[{value:3,letter:"K"},{value:6,letter:"M"},{value:9,letter:"B"},{value:12,letter:"T"}];function l(e,t){const s=e-t;return o.find((e=>e.value>=s))??o[o.length-1]}class u{constructor(e={}){this.type="volume";const{precision:t=0,minPrecision:s=0,dimensionPrecision:i=2,dimensionMinPrecision:n=0,significantDigits:a=3,ignoreLocaleNumberFormat:o,noExponentialForm:l,removeSpaceBeforeDimension:u}=e;this._precision=t,this._formatter=new r.NumericFormatter({ignoreLocaleNumberFormat:o,precision:this._precision,minPrecision:s,noExponentialForm:l}),this._dimensionPrecision=i,this._dimensionFormatter=new r.NumericFormatter({ignoreLocaleNumberFormat:o,precision:this._dimensionPrecision,minPrecision:n,noExponentialForm:l}),this._significantDigits=a,this._fractionalValues=void 0!==t&&t>0,this._spaceBeforeDimension=u?"":" ",this._options=e}state(){const{ignoreLocaleNumberFormat:e,...t}=this._options;return t}format(e,t){if(!(0,n.isNumber)(e))return a;if(Math.abs(e)>=1e100)return i.t(null,void 0,s(846741));let r="";Math.abs(e)<1&&(e=+e.toFixed(this._precision)),e<0?r="−":e>0&&t?.signPositive&&(r="+"),e=Math.abs(e);const o=!!(t?.ignoreLocaleNumberFormat??this._options.ignoreLocaleNumberFormat);let u,h,c=Math.floor(Math.log10(e))+1;if(c<=this._significantDigits&&(e=+e.toFixed(this._precision),c=Math.floor(Math.log10(e))+1),c<=this._significantDigits)u=this._formatNumber(e,o,this._formatter);else{let t=l(c,this._significantDigits);const s=Math.pow(10,t.value);e=+(e/s).toFixed(this._dimensionPrecision)*s,t=l(Math.floor(Math.log10(e))+1,this._significantDigits),u=this._formatNumber(e/Math.pow(10,t.value),o,this._dimensionFormatter),h=t.letter}return h?`${r}${u}${this._spaceBeforeDimension}${h}`:`${r}${u}`}parse(e,t){if("---"===e)return{error:"not a number",res:!1,value:NaN};const s={K:1e3,M:1e6,B:1e9,T:1e12},i=(e=e.replace("−","-")).slice(-1);if(s.hasOwnProperty(i)){const r=this._formatter.parse(e.slice(0,-1).trim(),t),a=r.res?r.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(e.trim(),t);let i=s.res?s.value:NaN;return-0===i&&(i=0),(0,n.isNumber)(i)?{res:!0,value:i}:{error:"not a number",res:!1,value:NaN}}}static serialize(e){return e.state()}static deserialize(e){return new u(e)}_formatNumber(e,t,s){if(this._fractionalValues&&0!==e){const t=14-Math.ceil(Math.log10(e)),s=Math.pow(10,t);e=Math.round(e*s)/s} return s.format(e,{ignoreLocaleNumberFormat:t})}}},357966:(e,t,s)=>{s.d(t,{Interval:()=>i.Interval});var i=s(487474)},115676:(e,t,s)=>{var i;s.d(t,{PlotRowSearchMode:()=>i}),function(e){e[e.NearestLeft=-1]="NearestLeft",e[e.Exact=0]="Exact",e[e.NearestRight=1]="NearestRight"}(i||(i={}))},757713:(e,t,s)=>{s.d(t,{PlotList:()=>d});var i=s(185842),r=s(77357),n=s(188485),a=s(395079),o=s(115676);const l=(0,r.getLogger)("Chart.PlotList"),u=30;function h(e){return e.index}function c(e){return e.value[0]}class d{constructor(e=null,t=null){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache=new Map,this._rowSearchCacheByIndex=new Map,this._rowSearchCacheByIndexWithoutEmptyValues=new Map,this._rowSearchCacheByTime=new Map,this._rowSearchCacheByTimeWithoutEmptyValues=new Map,this._plotFunctions=e||new Map,this._emptyValuePredicate=t}clear(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache.clear(),this._invalidateSearchCaches()}first(){return this.size()>0?this._items[this._start]:null}last(){return this.size()>0?this._items[this._end-1]:null}firstIndex(){return this.size()>0?this._indexAt(this._start):null}firstPlottableIndex(){if(this.isEmpty())return null;for(let e=this._start;ea.UNPLOTTABLE_TIME_POINT_INDEX)return t}return null}lastIndex(){return this.size()>0?this._indexAt(this._end-1):null}clone(){const e=this.firstIndex(),t=this.lastIndex();return null===e||null===t?new d:this.range(e,t)}size(){return this._end-this._start}isEmpty(){return 0===this.size()}contains(e){return null!==this.search(e,o.PlotRowSearchMode.Exact)}valueAt(e){const t=this.search(e);return null!==t?t.value:null}add(e,t){if(this._shareRead)return l.logDebug("add: readonly collection modification attempt"),!1;const s={index:e,value:t},i=this._nonCachedSearch(e,o.PlotRowSearchMode.Exact,h);return this._invalidateSearchCaches(),null===i?(this._items.splice(this._lowerbound(e,h),0,s),this._start=0,this._end=this._items.length,!0):(this._items[i]=s,!1)}search(e,t=o.PlotRowSearchMode.Exact,s){return this._searchImpl(e,t,this._rowSearchCacheByIndex,this._rowSearchCacheByIndexWithoutEmptyValues,h,s)}searchByTime(e,t=o.PlotRowSearchMode.Exact,s){return this._searchImpl(e,t,this._rowSearchCacheByTime,this._rowSearchCacheByTimeWithoutEmptyValues,c,s)}fold(e,t){let s=t;for(let t=this._start;t=s;--t){const s=this._indexAt(t),i=this._valueAt(t);if(e(s,i))return{index:s,value:i}}return null}each(e){for(let t=this._start;tthis._start&&(t._start-=1),t}rangeCountback(e,t){if(null===this.firstIndex())return new d;const s=new d(this._plotFunctions,this._emptyValuePredicate);return s._items=this._items,s._end=this._upperbound(e),s._start=Math.max(this._start,s._end-t),s._shareRead=!0,s}rangeIterator(e,t){const s=this._lowerbound(e,h),i=this._upperbound(t);return this._rangeIteratorImpl(s,i)}fullRangeIterator(){return this._rangeIteratorImpl(this._start,this._end)}minMaxOnRangeCached(e,t,s){if(this.isEmpty())return null;let i=null;for(const r of s){i=m(i,this._minMaxOnRangeCachedImpl(e-r.offset,t-r.offset,r.name))}return i}minMaxOnRange(e,t,s){if(this.isEmpty())return null;let i=null;for(const r of s){i=m(i,this._minMaxOnRange(e-r.offset,t-r.offset,r.name))}return i}merge(e){return this._shareRead?(l.logDebug("merge: readonly collection modification attempt"),null):0===e.length?null:this.isEmpty()||e[e.length-1].indexthis._items[this._items.length-1].index?this._append(e):1===e.length&&e[0].index===this._items[this._items.length-1].index?(this._updateLast(e[0]),e[0]):this._merge(e)}addTail(e,t=!1){if(0===e.length)return;let s=0;t&&this._end-this._start>0&&(s=1,this._items[this._end-this._start-1].value=e[0].value);for(let t=s;tvoid 0!==e)).sort(((e,t)=>e.index-t.index)),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._start=0,this._end=this._items.length}remove(e){if(this._shareRead)return l.logDebug("remove: readonly collection modification attempt"),null;const t=this._nonCachedSearch(e,o.PlotRowSearchMode.NearestRight,h);if(null===t)return null;const s=this._items.splice(t);return this._end=this._items.length,this._minMaxCache.clear(),this._invalidateSearchCaches(),s.length>0?s[0]:null}state(){const e=this._items.slice(this._start,this._end);return{start:0,end:e.length,data:e}}restoreState(e){e?(this._start=e.start,this._end=e.end,this._shareRead=!1,this._items=e.data,this._minMaxCache.clear(),this._invalidateSearchCaches()):this.clear()}_indexAt(e){return this._items[e].index}_valueAt(e){ return this._items[e].value}_length(){return this._items.length}_searchImpl(e,t,s,i,r,n){const a=void 0!==n?s:i,o=void 0!==n?1e4*(t+1)+n:t;let l=a.get(e);if(void 0!==l){const e=l.get(o);if(void 0!==e)return e}const u=this._nonCachedSearch(e,t,r,n);if(null===u)return null;const h={index:this._indexAt(u),value:this._valueAt(u)};return void 0===l&&(l=new Map,a.set(e,l)),l.set(o,h),h}_nonCachedSearch(e,t,s,i){const r=this._lowerbound(e,s),n=r===this._end||e!==s(this._items[r]);if(n&&t!==o.PlotRowSearchMode.Exact)switch(t){case o.PlotRowSearchMode.NearestLeft:return this._searchNearestLeft(r,i);case o.PlotRowSearchMode.NearestRight:return this._searchNearestRight(r,i);default:throw new TypeError("Unknown search mode")}if(void 0===i||n||t===o.PlotRowSearchMode.Exact)return n?null:r;switch(t){case o.PlotRowSearchMode.NearestLeft:return this._nonEmptyNearestLeft(r,i);case o.PlotRowSearchMode.NearestRight:return this._nonEmptyNearestRight(r,i);default:throw new TypeError("Unknown search mode")}}_nonEmptyNearestRight(e,t){const s=(0,i.ensure)(this._emptyValuePredicate),r=(0,i.ensure)(t);for(;e=this._start&&s(this._valueAt(e),r);)e-=1;return et(e)t.index>e),this._start,this._end)}_plotMinMax(e,t,s){let i=null;const r=this._plotFunctions.get(s);if(void 0===r)throw new Error(`Plot "${s}" is not registered`);for(let s=e;si.max&&(i.max=e)))}return i}_invalidateCacheForRow(e){const t=Math.floor(e.index/u);this._minMaxCache.forEach((e=>e.delete(t)))}_prepend(e){return(0,i.assert)(!this._shareRead,"collection should not be readonly"),(0,i.assert)(0!==e.length,"plotRows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=e.concat(this._items),this._start=0,this._end=this._items.length,e[0]}_append(e){return(0,i.assert)(!this._shareRead,"collection should not be readonly"),(0,i.assert)(0!==e.length,"plotRows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=this._items.concat(e),this._start=0,this._end=this._items.length,e[0]}_updateLast(e){(0,i.assert)(!this.isEmpty(),"plot list should not be empty");const t=this._items[this._end-1];(0,i.assert)(t.index===e.index,"last row index should match new row index"),this._invalidateCacheForRow(e), this._invalidateSearchCaches(),this._items[this._end-1]=e}_merge(e){return(0,i.assert)(0!==e.length,"plot rows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=function(e,t){const s=function(e,t){const s=e.length,i=t.length;let r=s+i,n=0,a=0;for(;nt[a].index?a++:(n++,a++,r--);return r}(e,t),i=new Array(s);let r=0,n=0;const a=e.length,o=t.length;let l=0;for(;rt[n].index?(i[l]=t[n],n++):(i[l]=t[n],r++,n++),l++;for(;r(s+=1,s>=t?{done:!0,value:void 0}:{done:!1,value:this._items[s]})}}_invalidateSearchCaches(){this._rowSearchCacheByIndex.clear(),this._rowSearchCacheByIndexWithoutEmptyValues.clear(),this._rowSearchCacheByTime.clear(),this._rowSearchCacheByTimeWithoutEmptyValues.clear()}}function m(e,t){if(null===e)return t;if(null===t)return e;return{min:Math.min(e.min,t.min),max:Math.max(e.max,t.max)}}},8914:(e,t,s)=>{s(603550)},725408:(e,t,s)=>{s.d(t,{DataTypes:()=>i,createPropertySchema:()=>m,dataType:()=>u,isArraySchema:()=>d,validateSchema:()=>c});var i,r=s(393418),n=s(750586),a=s(415155),o=s(595526),l=s(185842);function u(e){return(0,r.default)(e)?i.NUMBER:(0,n.default)(e)?i.STRING:(0,a.default)(e)?i.BOOLEAN:(0,o.default)(e)?i.ARRAY:null===e?i.NULL:"object"==typeof e?i.OBJECT:i.UNKNOWN}!function(e){e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.NULL="null",e.UNKNOWN="unknown"}(i||(i={}));const h=[i.ARRAY,i.OBJECT];function c(e,t){try{const s=u(e);if((0,l.assert)(s===t.type||s===i.NULL&&t.nullable||t.type===i.UNKNOWN),h.includes(s))switch(t.type){case i.ARRAY:(0,l.assert)(e.every((e=>c(e,t.subschema))));break;case i.OBJECT:for(const[s,i]of Object.entries(t.subschema))(0,l.assert)(c(e[s],i))}return!0}catch{return!1}}function d(e){return e.type===i.ARRAY}function m(e,t){let s;const r=u(e);switch(r){case i.NUMBER:case i.STRING:case i.BOOLEAN:s={type:r,saveFlags:t};break;case i.ARRAY:s={type:i.ARRAY,saveFlags:t,subschema:m(e[0],t)};break;case i.OBJECT:{const r={};for(const[s,i]of Object.entries(e))r[s]=m(i,t);s={type:i.OBJECT,saveFlags:t,subschema:r};break}default:s={ type:i.UNKNOWN,saveFlags:t}}return s}},22667:(e,t,s)=>{s(8914)},743968:(e,t,s)=>{s(592893),s(391640),s(698589),s(199250),s(22667)},592893:(e,t,s)=>{s(168509)},391640:(e,t,s)=>{s(168509)},698589:(e,t,s)=>{s(592893)},603550:(e,t,s)=>{s(393418),s(750586),s(415155),s(741863),s(595526),s(185842);var i=s(77357),r=(s(641422),s(813006));s(725408);(0,i.getLogger)("Property");r.PropertyBase},599730:(e,t,s)=>{var i=s(631608),r=s(426681),n=s(740149);new Set([3,6,7,8,9,11]),new Set([1,2]);const a=[{type:r.studyTpoPreriodicId,basicStudyVersion:104},{type:r.studyTpoSessionsId,basicStudyVersion:104}];i.studyVolFootprintId,n.studyVbPSessionsId},253443:(e,t,s)=>{s.d(t,{SeriesData:()=>c});var i,r=s(185842),n=s(757713),a=s(508836);!function(e){e[e.FromLeft=-1]="FromLeft",e[e.FromRight=1]="FromRight"}(i||(i={}));const o=["open","high","low","close","hl2","hlc3","ohlc4"],l={open:e=>e[1],high:e=>e[2],low:e=>e[3],close:e=>e[4],hl2:e=>(e[2]+e[3])/2,hlc3:e=>(e[2]+e[3]+e[4])/3,ohlc4:e=>(e[1]+e[2]+e[3]+e[4])/4};function u(){const e=new Map;return o.forEach(((t,s)=>{e.set(t,function(e,t,s){const i=l[t??e],r=l[e],n=l[s??e];return(e,t)=>{switch(t){case 0:return i(e);case 2:return n(e);default:return r(e)}}}(t))})),e}function h(e,t){return null==e[t]}class c{constructor(){this.m_bars=new n.PlotList(u(),h),this.m_nsBars=new n.PlotList(u(),h),this._conflatedChunksBuilder=new a.ConflatedChunksBuilder(this.m_bars,(e=>l[e]))}bars(){return this.m_bars}nsBars(){return this.m_nsBars}conflatedChunks(e,t){return this._conflatedChunksBuilder.conflatedChunks(e,t)}mergeRegularBars(e){return this._conflatedChunksBuilder.mergeData(e)}size(){return this.m_bars.size()+this.m_nsBars.size()}each(e){this.m_bars.each(e),this.m_nsBars.each(e)}clear(){this.m_nsBars.clear(),this.lastProjectionPrice=void 0,this._conflatedChunksBuilder.clearData()}clone(){const e=new c;return e.lastProjectionPrice=this.lastProjectionPrice,e.boxSize=this.boxSize,e.reversalAmount=this.reversalAmount,e.m_bars=this.m_bars.clone(),e.m_nsBars=this.m_bars.clone(),e}isEmpty(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()}first(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()}last(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()}search(e,t,s){return this.nsBars().isEmpty()?this.bars().search(e,t,s):this.bars().isEmpty()||(0,r.ensureNotNull)(this.nsBars().firstIndex())<=e?this.nsBars().search(e,t,s):this.bars().search(e,t,s)}valueAt(e){const t=this.search(e);return null!==t?t.value:null}plotValueToTimePointIndex(e,t,s){if(s===i.FromRight){const s=(s,i)=>{const r=i[t];return null!=r&&e>=r},i=this.m_bars.findLast(s);if(null!==i)return i.index;const r=this.m_nsBars.findLast(s);return null!==r?r.index:this.m_bars.firstIndex()}if(s===i.FromLeft){const s=(s,i)=>{const r=i[t];return null!=r&&e<=r},i=this.m_bars.findFirst(s);if(null!==i)return i.index;const r=this.m_nsBars.findFirst(s);return null!==r?r.index:this.m_bars.lastIndex()}throw new Error("plotValueToTimePointIndex: unsupported search mode")}moveData(e){ this._conflatedChunksBuilder.moveData(e),this.m_nsBars.move(e)}}},70346:(e,t,s)=>{s.d(t,{createSeriesFormatter:()=>o});s(729193);var i=s(266150),r=(s(950808),s(376596),s(599730),s(357966),s(605434)),n=s(760823),a=s(594461);s(18107),s(743968),s(976078);(0,i.isFeaturesetEnabled)("uppercase_instrument_names"),(0,i.isFeaturesetEnabled)("hide_object_tree_and_price_scale_exchange_label");function o(e,t,s=!1){const{priceScale:i,minMove:o,fractional:l,minMove2:u,variableMinTick:h,noExponentialForm:c}=function(e,t="default",s=!1){let i,r,n,a,o=100,l=1;if("default"===t)null!=e&&(({pricescale:o,minmov:l,minmove2:r,fractional:i}=e),n=e.variable_tick_size||void 0);else{let e=t.split(",");3!==e.length&&(e=["100","1","false"]),o=parseInt(e[0]),l=parseInt(e[1]),i="true"===e[2],a=!0}return s&&(l=1),{priceScale:o,minMove:l,fractional:i,minMove2:r,variableMinTick:n,ignoreMinMove:s,noExponentialForm:a}}(e,t,s);if(null!=e){const r=e.format;if("default"===t&&"volume"===r)return new n.VolumeFormatter({precision:2});if("percent"===r)return new a.PercentageFormatter({priceScale:i,minMove:o,fractional:l,minMove2:u,variableMinTick:h,ignoreMinMove:s})}return new r.PriceFormatter({priceScale:i,minMove:o,fractional:l,minMove2:u,variableMinTick:h,ignoreMinMove:s,noExponentialForm:c})}},39215:(e,t,s)=>{s.d(t,{SeriesDataSource:()=>b});var i=s(185842),r=s(385955),n=s(874651),a=s(357966),o=s(253443),l=s(164253),u=s(276479),h=s(888211),c=s(77357),d=s(976078),m=s(314896);const _=(0,c.getLogger)("Chart.SeriesDataSource");var p;!function(e){e[e.Idle=0]="Idle",e[e.AwaitingConnection=1]="AwaitingConnection",e[e.AwaitingFirstDataUpdate=2]="AwaitingFirstDataUpdate",e[e.Active=3]="Active"}(p||(p={}));let g=1;let f=1;function y(e){return e.startDate?e.endDate||e.count?e.endDate?["from_to",e.startDate,e.endDate]:["bar_count",e.startDate,(0,i.ensure)(e.count)]:["from_to",e.startDate]:e.count||300}function v(e){return(0,n.extractExtendedSymbol)(e).symbol}class b{constructor(e,t,s,i){this._extSymbol=null,this._lastResolvedSymbol="",this._createSeriesOverriddenParams=0,this._instanceId=null,this._symbolInstanceId=null,this._resolution=null,this._timeFrame=null,this._data=new o.SeriesData,this._dataEvents=new h.SeriesDataEvents,this._status=p.Idle,this._turnaroundCounter=1,this._boundOnGatewayIsConnectedChanged=this._onGatewayIsConnectedChanged.bind(this),this._boundOnMessage=this._onMessage.bind(this),this._ongoingDataUpdate=Promise.resolve(),this._gateway=e,this._turnaroundPrefix=t,this._createSeriesParams=y(s??{count:300}),this._timeFrame=i||null,this._gateway.isConnected().subscribe(this._boundOnGatewayIsConnectedChanged)}destroy(){this.stop(),this._gateway.isConnected().unsubscribe(this._boundOnGatewayIsConnectedChanged),this._dataEvents.destroy()}canModifySeries(e,t){const s=!(0,r.deepEquals)(this._extSymbol,e)[0],i=null===this._resolution||!a.Interval.isEqual(this._resolution,t);return s||i}modifySeries(e,t,s=null,o=!1,l=null){o&&(_.logNormal("Due to force flag clearing symbol & resolution to force re-requesting data."),this._extSymbol=null, this._resolution=null);const u=v(e),h=!this.symbolSameAsResolved(u);if(h&&(this._lastResolvedSymbol=""),this._extSymbol&&!h){const t=v(this._extSymbol);(0,n.replaceExtendedSymbol)(e,t)}const c=this._extSymbol,d=this._resolution;if(this._extSymbol=e,this._resolution=t,null===this._instanceId)return void(this._timeFrame=s);const m=!(0,r.deepEquals)(c,e)[0];m&&(0,n.replaceExtendedSymbol)(this._extSymbol,u);const p=null===d||!a.Interval.isEqual(d,t);(m||p||null!==s)&&(this._timeFrame=null,(m||p)&&this._turnaroundCounter++,m&&this._resolveSymbol(),this._gateway.modifySeries(this._instanceId,this.turnaround(),(0,i.ensureNotNull)(this._symbolInstanceId),this._resolution,l,s,this._boundOnMessage),this._dataEvents.fireModified())}requestMoreData(e){null!==this._instanceId&&this._gateway.requestMoreData(this._instanceId,e,this._boundOnMessage)}requestMoreTickmarks(e){null!==this._instanceId&&this._gateway.requestMoreTickmarks(this._instanceId,e,this._boundOnMessage)}setFutureTickmarksMode(e){null!==this._instanceId&&this._gateway.setFutureTickmarksMode(e)}isStarted(){return this._status!==p.Idle}isActive(){return this._status===p.Active}resolution(){return this._resolution}start(){this.isStarted()?_.logNormal("start: data source is already started, nothing to do"):((0,i.assert)(null!==this._extSymbol,"symbol must be set before start"),(0,i.assert)(null!==this._resolution,"resolution must be set before start"),this._gateway.isConnected().value()?this._createSeries():this._changeStatusTo(p.AwaitingConnection))}stop(){this.isStarted()?(null!==this._instanceId&&(this._gateway.removeSeries(this._instanceId),this._instanceId=null),this._symbolInstanceId=null,this._changeStatusTo(p.Idle)):_.logNormal("stop: data source is already stopped, nothing to do")}instanceId(){return this._instanceId}data(){return this._data}setData(e){this._data=e}setTimeframe(e){this._timeFrame=e}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}updateExtSymbol(e){this._extSymbol=e}moveData(e){return this._enqueueUpdate((()=>this._data.moveData(e)))}setInitialRequestOptions(e){this._createSeriesOverriddenParams=y(e)}symbolSameAsResolved(e){return null!==this._extSymbol&&(0,m.symbolSameAsResolved)(e,v(this._extSymbol),this._lastResolvedSymbol)}resolvedSymbol(){return null===this._extSymbol?null:v(this._extSymbol)}_resolveSymbol(){null!==this._extSymbol&&(this._symbolInstanceId=this._gateway.resolveSymbol("sds_sym_"+g++,(0,n.encodeExtendedSymbolOrGetSimpleSymbolString)(this._extSymbol),this._boundOnMessage))}_clearDataImpl(){this._data.clear(),this._dataEvents.fireCleared()}_changeStatusTo(e){(0,i.assert)(this._status!==e,"Source and destination status should be distinct"),_.logNormal(`Status changed from ${p[this._status]} to ${p[e]}`),this._status=e}_createSeries(){(0, i.assert)(this._status!==p.Active,'Status should not be "Active" when creating a study'),this._instanceId="sds_"+f++,this._resolveSymbol();const e=this._createSeriesOverriddenParams||this._createSeriesParams;this._createSeriesOverriddenParams&&(this._createSeriesOverriddenParams=0),this._gateway.createSeries(this._instanceId,this.turnaround(),(0,i.ensureNotNull)(this._symbolInstanceId),(0,i.ensureNotNull)(this._resolution),e,this._timeFrame,this._boundOnMessage),this._timeFrame=null,this._changeStatusTo(p.AwaitingFirstDataUpdate),this._dataEvents.fireCreated(this._instanceId)}_onGatewayIsConnectedChanged(e){e?this._onGatewayConnected():this._onGatewayDisconnected()}_onGatewayConnected(){this._status===p.AwaitingConnection&&this._createSeries()}_onGatewayDisconnected(){this._status!==p.Idle&&this._status!==p.AwaitingConnection&&(this._instanceId=null,this._changeStatusTo(p.AwaitingConnection)),this._turnaroundCounter=1}_onMessage(e){this._enqueueUpdate((()=>this._onMessageImpl(e)))}async _onMessageImpl(e){switch(e.method){case"symbol_resolved":{const[t,s]=e.params;if(t!==this._symbolInstanceId){null!==this._symbolInstanceId&&_.logNormal(`Resolve for old symbol, expected: ${this._symbolInstanceId}, actual ${e.params[0]}`);break}this._onSymbolResolved(s);break}case"symbol_error":if(e.params[0]!==this._symbolInstanceId){null!==this._symbolInstanceId&&_.logNormal(`Symbol error for old symbol, expected: ${this._symbolInstanceId}, actual ${e.params[0]}`);break}this._onSymbolError(e);break;case"series_timeframe":{const[t,s,i,r,n,a,o]=e.params;if(!this._checkTurnaround(t,s)){_.logNormal(`Time frame for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t} (${s})`);break}this._onSeriesTimeFrame(i,r,n,a,o);break}case"series_error":{const[t,s]=e.params;if(!this._checkTurnaround(t,s)){_.logNormal(`Series error for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t} (${s})`);break}this._onSeriesError(e.params[2]);break}case"series_loading":{const[t,s]=e.params;if(!this._checkTurnaround(t,s))break;this._onSeriesLoading(e.time);break}case"series_completed":{const[t,s,i,r]=e.params;if(!this._checkTurnaround(t,i)){_.logNormal(`Series completed for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t} (${i})`);break}this._onSeriesCompleted(s,e.time,r);break}case"data_update":if(!this._checkTurnaround(e.params.customId,e.params.turnaround)){_.logNormal(`Data update for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${e.params.customId} (${e.params.turnaround})`);break}await this._onDataUpdate(e.params.plots,e.params.nonseries,e.params.lastBar);break;case"clear_data":{if(e.params.turnaround!==this.turnaround()){_.logNormal(`Clear data for old data, expected: ${this.turnaround()}, actual ${e.params.turnaround}`);break}const t=this._data.first();this._clearDataImpl(),this._dataEvents.fireDataUpdated(void 0,!1,null,!1,t);break}}}_onSeriesError(e){let t,s;if("string"==typeof e)s={error:e},t=e;else if(s=e,e.ctx){const s={} ;Object.entries(e.ctx).forEach((([e,t])=>{s[e]=t.toString()})),t=e.error.format(s)}else t=e.error;if(t.startsWith("study_not_auth:")){const e=t.split(":",2)[1].split("@",2)[0];if(["BarSetRenko","BarSetPriceBreak","BarSetKagi","BarSetPnF"].includes(e))this._dataEvents.fireChartTypeNotPermitted(e);else{if("BarSetSpread"===e)return void this._dataEvents.fireIntradaySpreadNotPermitted();if("BarSetRange"===e){const e=`${(0,i.ensureNotNull)(this._extSymbol).inputs.range}R`;this._dataEvents.fireCustomIntervalNotPermitted(e)}}}else{if(t.startsWith("unsupported"))return void this._dataEvents.fireUnsupportedResolutionRequested();"resolution_not_entitled"===t?this._dataEvents.fireIntradayExchangeNotPermitted():"custom_resolution"===t?this._dataEvents.fireCustomIntervalNotPermitted((0,i.ensureNotNull)(this._resolution)):"seconds_not_entitled"===t?this._dataEvents.fireSecondsIntervalNotPermitted():"ticks_not_entitled"===t&&this._dataEvents.fireTicksIntervalNotPermitted()}this._dataEvents.fireSeriesError(s)}_onSeriesTimeFrame(e,t,s,i,r){this._dataEvents.fireSeriesTimeFrame(e,t,s,i??!0,r)}_onSymbolError(e){if(e.params[1]===u.permissionDenied)switch(e.params[2]){case u.SymbolErrorPermissionDeniedReason.Symbol:this._dataEvents.fireSymbolNotPermitted(e.params[3]);break;case u.SymbolErrorPermissionDeniedReason.GroupPermission:this._dataEvents.fireSymbolGroupNotPermitted(e.params[3]);break;default:this._dataEvents.fireSymbolNotPermitted(e.params[2])}else e.params[1]===u.invalidSymbol&&this._dataEvents.fireSymbolInvalid();this._dataEvents.fireSymbolError(e.params[1])}_onSymbolResolved(e){this._lastResolvedSymbol=(0,i.ensureNotNull)((0,d.extractSymbolNameFromSymbolInfo)(e,"")),this._dataEvents.fireSymbolResolved(e)}async _onDataUpdate(e,t,s){this._onDataUnpacked(e,s,await async function(e){if(void 0===e)return{projectionPlots:[],boxSize:null};if(""===e.d||"nochange"===e.indexes)return null;const t=await(0,l.unpackNonSeriesData)(e.d);if(null===t||t.indexes_replace)return null;const s=e.indexes,{bars:i,price:r,boxSize:n,reversalAmount:a}=t.data,o=(i||[]).map((e=>{let t;return"factor"in e?t=e.factor:"additionalPrice"in e&&(t=e.additionalPrice),{index:s[e.time],value:[0,e.open,e.high,e.low,e.close,e.volume,t]}}));return{lastPrice:r,projectionPlots:o,reversalAmount:a,boxSize:n}}(t))}_enqueueUpdate(e){return this._ongoingDataUpdate=this._ongoingDataUpdate.then(e,e),this._ongoingDataUpdate}_onDataUnpacked(e,t,s){if(this._status===p.Idle)return;this._status===p.AwaitingFirstDataUpdate&&(this._changeStatusTo(p.Active),this._clearDataImpl());const i=this._data.bars().size(),r=this._data.first(),n=this._data.bars().firstIndex(),a=this._data.mergeRegularBars(e);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 o=null===n,l=o||null!==a&&a.index{s.d(t,{getTimeFormatForInterval:()=>r});var i=s(273497);function r(e,t){if(e.isRange())return function(e){return"12-hours"===e?i.twelveHourMinuteNonZeroSecondFormat:i.hourMinuteNonZeroSecondFormat}(t);if(e.isTicks())return i.hourMinuteSecondMillisecFormat;return e.isSeconds()||e.isTicks()?function(e){return"12-hours"===e?i.twelveHourMinuteSecondFormat:i.hourMinuteSecondFormat}(t):function(e){return"12-hours"===e?i.twelveHourMinuteFormat:i.hourMinuteFormat}(t)}},971267:(e,t,s)=>{s.d(t,{frameElementId:()=>r});const i=window.initData.hashSettings||{},r="string"==typeof i.frameElementId?i.frameElementId:null},275925:(e,t,s)=>{s.d(t,{applyAlpha:()=>n,applyTransparency:()=>o,generateColor:()=>r,resetTransparency:()=>l});var i=s(955482);function r(e,t,s){if(t=t||0,!u(e))return s?(0,i.rgbaToString)((0,i.rgba)((0,i.parseRgb)(e),(0,i.normalizeAlphaComponent)(a(t)))):e;const[r,n,o]=(0,i.parseRgb)(e),l=(0,i.normalizeAlphaComponent)(a(t));return(0,i.rgbaToString)([r,n,o,l])}function n(e,t,s){const r=(0,i.tryParseRgba)(e);if(null===r)throw new Error(`Invalid color: ${e}`);const[n,a,o,l]=r,u=(0,i.normalizeAlphaComponent)(t*(s?l:1));return(0,i.rgbaToString)((0,i.rgba)([n,a,o],u))}function a(e){if(e<0||e>100)throw new Error("invalid transparency");return 1-e/100}function o(e,t){if("transparent"===e)return e;const s=(0,i.parseRgba)(e),r=s[3];return(0,i.rgbaToString)((0,i.rgba)(s[0],s[1],s[2],a(t)*r))}function l(e){return"transparent"===e?e:u(e)?e.slice(0,7):(0,i.rgbaToString)((0,i.rgba)((0,i.parseRgb)(e),(0,i.normalizeAlphaComponent)(1)))}function u(e){return 0===e.indexOf("#")}},131890:(e,t,s)=>{s.d(t,{fetch:()=>n});var i=s(77357);s(574908);const r=(0,i.getLogger)("Fetch");function n(e,t,s={}){{const{logOnErrorStatus:i=!0,logBodyOnError:n=!1}=s;t=t||{},function(e){return new URL(e,document.baseURI).origin===location.origin}(e)&&(t.headers?t.headers instanceof Headers||(t.headers=new Headers(t.headers)):t.headers=new Headers,window.locale&&t.headers.set("X-Language",window.locale),t.headers.set("X-Requested-With","XMLHttpRequest")),void 0===t.credentials&&(t.credentials="same-origin");const a=window.fetch(e,t);return a.then((s=>{if(!s.ok&&i){let i="";t.method&&(i+=`${t.method.toUpperCase()} `),i+=e,i+=`. Status ${s.status}`,s.statusText&&(i+=`. ${s.statusText}`),s.headers.via&&(i+=`. Via: ${s.headers.via}`),n&&"string"==typeof t.body&&(i+=`. Body: ${t.body.slice(0,1024)}`),r.logError(i)}return s}),(s=>{if(s&&"AbortError"===s.name)return;let i="";t.method&&(i+=`${t.method.toUpperCase()} `),i+=e,navigator.onLine?i+=`. ${String(s)}`:i+=". User is offline.",r.logError(i)})),a}}},938429:(e,t,s)=>{function i(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}s.d(t,{regExpEscape:()=>i})},947110:(e,t,s)=>{s.d(t,{color:()=>i.color});var i=s(627889)},60554:(e,t,s)=>{s.d(t,{ getMiniTimeFrameOptions:()=>o});var i=s(501004);const r=Date.now();function n(e){const t=new Date(r);return t.setMonth(t.getMonth()-e),Math.trunc(t.valueOf()/1e3)}function a(e){const t=new Date(r);return t.setFullYear(t.getFullYear()-e),Math.trunc(t.valueOf()/1e3)}function o(e){const t=(0,i.getTimeFrames)();return[{...t[e?"lastsession":"1d"]},{...t["1m"],targetResolution:"1D",from:n(1)},{...t["3m"],targetResolution:"1D",from:n(3)},{...t["12m"],from:a(1)},{...t["60m"],targetResolution:"1M",from:a(5)},{...t.all}]}},870754:(e,t,s)=>{s.d(t,{daysStringLiteral:()=>r,monthsStringLiteral:()=>a,stringAsResolution:()=>l,weeksStringLiteral:()=>n,yearsStringLiteral:()=>o});var i=s(729193);const r=e=>i.t(null,{plural:"{str} days",count:e,replace:{str:`${e}`}},s(103030)),n=e=>i.t(null,{plural:"{str} weeks",count:e,replace:{str:`${e}`}},s(644625)),a=e=>i.t(null,{plural:"{str} months",count:e,replace:{str:`${e}`}},s(694617)),o=e=>i.t(null,{plural:"{str} years",count:e,replace:{str:`${e}`}},s(216402)),l=e=>e},487474:(e,t,s)=>{s.d(t,{Interval:()=>h,ResolutionKind:()=>n});const i=/^(\d*)([TSHDWMR])$/,r=/^(\d+)$/;var n,a;!function(e){e.Ticks="ticks",e.Seconds="seconds",e.Minutes="minutes",e.Days="days",e.Weeks="weeks",e.Months="months",e.Range="range",e.Invalid="invalid"}(n||(n={})),function(e){e.Hours="hours"}(a||(a={}));const o={};o[n.Ticks]=1e3,o[n.Seconds]=1e3,o[n.Minutes]=60*o[n.Seconds],o[n.Days]=1440*o[n.Minutes],o[n.Weeks]=7*o[n.Days];const l={T:n.Ticks,S:n.Seconds,D:n.Days,W:n.Weeks,M:n.Months,R:n.Range},u=new Set([n.Ticks,n.Seconds,n.Minutes]);class h{constructor(e,t){this._kind=n.Invalid,this._multiplier=0,e!==n.Invalid&&t>0&&(this._kind=e,this._multiplier=t)}kind(){return this._kind}guiKind(){return this.isMinuteHours()?a.Hours:this._kind}multiplier(){return this._multiplier}isValid(){return this.kind()!==n.Invalid&&this.multiplier()>0}isDWM(){return this.isValid()&&!this.isRange()&&!this.isIntraday()&&!this.isTicks()}isIntraday(){const e=u.has(this.kind());return this.isValid()&&e}isSeconds(){return this.kind()===n.Seconds}isMinutes(){return this.kind()===n.Minutes}isMinuteHours(){return this.kind()===n.Minutes&&((e=this.multiplier())>=60&&!(e%60));var e}isDays(){return this.kind()===n.Days}isWeeks(){return this.kind()===n.Weeks}isMonths(){return this.kind()===n.Months}isRange(){return this.kind()===n.Range}isTicks(){return this.kind()===n.Ticks}is1Tick(){return this.isTicks()&&1===this.multiplier()}isTimeBased(){return!this.isRange()}letter(){return this.isValid()&&this.kind()!==n.Minutes?this.kind()[0].toUpperCase():""}value(){return this.isValid()?this.kind()===n.Minutes?this.multiplier()+"":this.multiplier()+this.letter():""}isEqualTo(e){if(!(e instanceof h))throw new Error("Argument is not an Interval");return!(!this.isValid()||!e.isValid())&&(this.kind()===e.kind()&&this.multiplier()===e.multiplier())}inMilliseconds(e=Date.now()){if(!this.isValid()||this.isRange())return NaN;if(this.isMonths()){const t=new Date(e);t.setUTCMonth(t.getUTCMonth()+(this.multiplier()||1));return+t-e}const t=this.multiplier() ;return o[this.kind()]*t}static isEqual(e,t){return e===t||h.parse(e).isEqualTo(h.parse(t))}static parseExt(e){e=(e+"").toUpperCase().split(",")[0];let t=i.exec(e);return null!==t?"H"===t[2]?{interval:new h(n.Minutes,60*c(t[1])),guiResolutionKind:a.Hours}:{interval:new h(l[t[2]],c(t[1])),guiResolutionKind:l[t[2]]}:(t=r.exec(e),null!==t?{interval:new h(n.Minutes,c(t[1])),guiResolutionKind:n.Minutes}:{interval:new h(n.Invalid,0),guiResolutionKind:n.Invalid})}static parse(e){return h.parseExt(e).interval}static kind(e){return h.parse(e).kind()}static isValid(e){return h.parse(e).isValid()}static isDWM(e){return h.parse(e).isDWM()}static isIntraday(e){return h.parse(e).isIntraday()}static isSeconds(e){return h.parse(e).isSeconds()}static isMinutes(e){return h.parse(e).isMinutes()}static isMinuteHours(e){return h.parse(e).isMinuteHours()}static isDays(e){return h.parse(e).isDays()}static isWeeks(e){return h.parse(e).isWeeks()}static isMonths(e){return h.parse(e).isMonths()}static isRange(e){return h.parse(e).isRange()}static isTicks(e){return h.parse(e).isTicks()}static isTimeBased(e){return h.parse(e).isTimeBased()}static normalize(e){const t=h.parse(e);return t.isValid()?t.value():null}}function c(e){return 0===e.length?1:parseInt(e,10)}}}]);