"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[9498],{99992:(e,t,l)=>{l.r(t),l.d(t,{exportData:()=>m});var s=l(11542),i=l(50151),n=l(19466),o=l(72708),u=l(91988),d=l(8025),a=l(68805),r=l(94113),c=l(41991),f=l(9859),h=l(17730);const p={includeTime:!0,includeUserTime:!1,includeSeries:!0,includeDisplayedValues:!1,includedStudies:"all",includeOffsetStudyValues:!1};function m(e,t={}){const l=Object.assign({},p,t),s={schema:[],data:[],displayedData:[],indexes:[]},n=e.timeScale().points(),r=e.mainSeries(),m=r.style(),v=(0,a.isSingleValueBasedStyle)(m),N=(0,i.ensureNotNull)(r.symbolInfo()),P=(0,h.getChartWidgetApiTimeConverter)(r.interval(),N,e),I=(0,a.isCloseBasedSymbol)(N),b=function(e,t){const l=e.allStudies().filter((e=>e.showInObjectTree()&&e.isVisible()));if("all"===t)return l;return l.filter((e=>t.includes(e.id())))}(e,l.includedStudies),w=[];for(const e of b){const t=(0,o.isOverlayStudy)(e)?T(e):g(e);w.push(t)}const D=b.map((e=>e.data()));(l.includeSeries||0===D.length)&&D.push(r.bars());const O=function(e,t,l,s,n){const o=(0,i.ensureNotNull)(e.range().value(),"time scale points range"),a=function(e,t,l,s){var n,o;const a=s.from,r=s.to,c=e.range().value(),h=(0,i.ensureNotNull)(void 0!==a?e.indexOf(a,!0):(0,i.ensureNotNull)(c).firstIndex),p=(0,i.ensureNotNull)(void 0!==r?e.indexOf(r,!0):(0,i.ensureNotNull)(c).lastIndex);let m=p,y=h;for(let e=0;ey&&(y=r.index+u)}return(0,i.assert)(m<=y,"Range must contain at least 1 time point"),new u.BarsRange(m,y)}(e,t,l,n),r=a.firstBar(),c=a.lastBar(),h=[];for(let e=r;e<=c;e++){const t={index:e,time:(0,i.ensureNotNull)(s.convertTimePointIndexToInternalTime(e)),publicTime:(0,i.ensureNotNull)(s.convertTimePointIndexToPublicTime(e))};if(!(void 0!==n.from&&t.timen.to)break;if(!n.includeOffsetStudyValues&&e>o.lastIndex)break;h.push(t)}}return h.length>0?new y(h):null}(n,D,w,P,l);if(null===O)return s;const V=O.firstBar(),_=O.lastBar();l.includeTime&&s.schema.push({type:"time"});const B=s.schema.length;l.includeUserTime&&s.schema.push({type:"userTime"});const F=s.schema.length;if(l.includeSeries){const e=r.statusProvider({hideResolution:!0}).getSplitTitle(),t=Object.values(e).filter((e=>""!==e)).join(", ");s.schema.push(...function(e,t,l,s,n){const o=[];l?o.push(S("close",e)):s?o.push(S((0,i.ensureNotNull)(n),e)):12===t?o.push(S("high",e),S("low",e)):16===t?o.push(S("high",e),S("low",e),S("close",e)):o.push(S("open",e),S("high",e),S("low",e),S("close",e));return o}(t,m,I,v,r.priceSource()))}let k=s.schema.length;for(const e of w)s.schema.push(...e.fields);const C=s.schema.length;if(0===C)return s;for(let e=V;e<=_;++e){const t=new Float64Array(C);t.fill(NaN),s.data.push(t),s.indexes.push(e), l.includeDisplayedValues&&s.displayedData.push(new Array(C).fill(""))}if(l.includeTime||l.includeUserTime){const t=e.dateTimeFormatter();for(let e=V;e<=_;++e){const n=O.item(e),o=n.time,u=n.publicTime,d=new Date(1e3*(0,i.ensureNotNull)(u));if(l.includeTime&&(s.data[e-V][0]=(0,i.ensureNotNull)(o)),l.includeUserTime&&(s.data[e-V][B]=d.getTime()/1e3),l.includeDisplayedValues){const i=t.format(d);l.includeTime&&(s.displayedData[e-V][0]=i),l.includeUserTime&&(s.displayedData[e-V][B]=i)}}}if(l.includeSeries){const e=r.bars().range(V,_),t=(0,c.getPriceValueFormatterForSource)(r),i=e=>t(e,{ignoreLocaleNumberFormat:!0}),n=r.barFunction();e.each(((e,t)=>{const o=s.data[e-V],u=x(t[4]);if(I){if(o[F]=u,l.includeDisplayedValues){s.displayedData[e-V][F]=i(u)}}else if(v){const u=n(t);if(o[F]=u,l.includeDisplayedValues){s.displayedData[e-V][F]=i(u)}}else{const n=x(t[1]),d=x(t[2]),a=x(t[3]);if(12===m?(o[F]=d,o[F+1]=a):16===m?(o[F]=d,o[F+1]=a,o[F+2]=u):(o[F]=n,o[F+1]=d,o[F+2]=a,o[F+3]=u),l.includeDisplayedValues){const t=s.displayedData[e-V];12===m?(t[F]=i(d),t[F+1]=i(a)):16===m?(t[F]=i(d),t[F+1]=i(a),t[F+2]=i(u)):(t[F]=i(n),t[F+1]=i(d),t[F+2]=i(a),t[F+3]=i(u))}}return!1}))}for(let e=0;eo(e,{ignoreLocaleNumberFormat:!0}),f=n.fieldPlotOffsets[e],h=n.fieldToPlotIndex[e],p=V-f,m=_-f,y=k+e;t.data().range(p,m).each(((e,t)=>{const n=s.data[e-p];let o;return o=d?x(t[4]):r?(0,i.ensureDefined)(u)(t):x(t[h]),n[y]=o,l.includeDisplayedValues&&(s.displayedData[e-p][y]=a(o)),!1}))}k+=n.fields.length}return s}class y{constructor(e){this._items=e,this._firstIndex=this._items[0].index,this._lastIndex=this._items[this._items.length-1].index}firstBar(){return this._firstIndex}lastBar(){return this._lastIndex}item(e){return this._items[e-this._firstIndex]}}function g(e){const t=e.metaInfo(),o={fieldToPlotIndex:[],fieldPlotOffsets:[],fields:[]},u=e.id(),d=e.properties().childs(),a=e.title(n.TitleDisplayTarget.StatusLine,!1,void 0,!1);for(let n=0;n