"use strict";
(self.webpackChunktradingview = self.webpackChunktradingview || []).push([
    [32895], {
        293659: (e, t, s) => {
            s.d(t, {
                MiniChartPlotBase: () => V,
                isTimePointIndex: () => T
            });
            var i = s(259332),
                r = s(431057),
                o = s(998034),
                n = s(283873),
                a = s(650151),
                l = s(724377),
                h = s(444372),
                d = s(120984),
                c = s(432059),
                u = s(643322),
                _ = s(124829),
                m = s(375397),
                p = s(942634),
                g = s(957365),
                S = s(501571),
                C = s(338619),
                f = s(882782),
                v = s(975179),
                y = s(566238);
            const b = (0, C.getLogger)("Chart.MiniChart"),
                I = new g.VolumeFormatter;

            function w(e, t, s) {
                return {
                    time: e,
                    color: s,
                    value: t[4]
                }
            }

            function D(e, t) {
                return {
                    time: e,
                    open: t[1],
                    high: t[2],
                    low: t[3],
                    close: t[4]
                }
            }

            function M(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 T(e) {
                return (0, _.isInteger)(e)
            }
            const A = (0, i.default)(c.resetTransparency);
            const L = {
                leftLogical: -.5,
                rightLogical: -.5,
                leftPx: 0,
                rightPx: 4
            };
            class V {
                constructor(e, t, s, i) {
                    this._symbolChanged = new p.Delegate, this._seriesChanged = new p.Delegate, this._whitespaces = null, this._symbolResolved = new p.Delegate, this._originalScaleMode = null, this._customPriceFormatter = null, this._isDestroyed = new m.WatchedValue(!1), this._status = new m.WatchedValue(0), this._noData = new m.WatchedValue(null), this._directionBasedColor = new m.WatchedValue(null), this._dataLengthInfo = null, this._sessionId = new m.WatchedValue, this._barBuilderLoader = null, this._symbolInfo = null, this._symbol = {
                        symbol: ""
                    }, this._timeFrameInvalidated = new p.Delegate, this._firstValueCache = null, this._historyUpdateReceived = !1, this._miniChart = e, this._originalSeriesOptions = t, this._currentSeriesOptions = (0, o.default)({}, t), this._options = i, this._horzMargins = (0, o.default)({}, L, t.horzMargins), 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 y.WatchedObject({
                        timeframe: this._timeFrame.value(),
                        symbol: this.symbol()
                    }), this._isLastSessionInterval = (0, u.combine)((e => "LASTSESSION" === e.value), this._miniChart.timeframe().weakReference()), this._isLastSessionInterval.subscribe(this._updateSessionId.bind(this)), this._miniChart.timeScaleSizeChanged().subscribe(null, this._timeScaleSizeChanged.bind(this))
                }
                destroy() {
                    var e;
                    this._status.unsubscribe(), this._timeFrame.destroy(), this._isDestroyed.setValue(!0), this._isLastSessionInterval.destroy(), null === (e = this._barBuilderLoader) || void 0 === e || e.destroy()
                }
                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) {
                    (0, n.default)(e) && (e = { ...this._symbol,
                        symbol: e
                    }), void 0 !== t && this._updateSeriesOptions(t), (0, f.compareSymbols)(this._symbol, e) || (this._symbol = e, this._updateSessionId(), this._symbolChanged.fire())
                }
                extendedSymbol() {
                    return { ...this._symbol,
                        session: this._sessionId.value()
                    }
                }
                updateSeriesOptions(e) {
                    const t = void 0 !== e.chartType && this._originalSeriesOptions.chartType !== e.chartType;
                    this._updateSeriesOptions(e), t ? this._onChartStyleChanged() : this._series.applyOptions(e)
                }
                applyOptions(e) {
                    (0, o.default)(this._options, e)
                }
                updateHorzMargins(e) {
                    this._horzMargins = (0, o.default)(this._horzMargins, e), this.fitContent()
                }
                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) {
                    var i;
                    e && this.clearSourceData();
                    const r = this._originalSeriesOptions,
                        o = this._buildViewData(s),
                        n = o.series.length;
                    if (this._historyUpdateReceived = this._historyUpdateReceived || void 0 === s, 0 === n) return void(void 0 === s && (this._dataLengthInfo = null, this._firstValueCache = null));
                    void 0 !== s || "area" !== r.chartType && "line" !== r.chartType || (this._firstValueCache = o.series[0].value);
                    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 = o.lastBarSession;
                        let s = !1;
                        for (const t of o.series) this._series.update(t), e.lastBarTime < t.time && (e.lastBarTime = t.time, e.realtime += 1, e.lastBarIndex += 1, s = !0);
                        if (o.additionalSeries && this._updateAdditionalSeriesData(o.additionalSeries), o.volume)
                            for (const e of o.volume) this._volume.update(e);
                        if (void 0 !== this._whitespacesData && s) {
                            const t = this._whitespacesData.findIndex((t => t.time > e.lastBarTime)); - 1 === t ? (e.whitespaces = 0, this._updateWhitespaces([])) : 0 !== t && (e.whitespaces -= t, this._updateWhitespaces(this._whitespacesData.slice(t)))
                        }
                        return s && (void 0 !== e.fixLeftEdgeUntil ? (this._isMainPlot() && e.fixLeftEdgeUntil >= e.lastBarTime && this.fitContent(), e.lastBarTime > 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(o.series[o.series.length - 1]), void this._dataUpdated(o, e, t)
                    }
                    const l = o.whitespaces,
                        h = null !== (i = null == l ? void 0 : l.length) && void 0 !== i ? i : 0;
                    this._dataLengthInfo = {
                            history: n,
                            realtime: 0,
                            lastBarIndex: n - 1,
                            lastBarTime: o.series[o.series.length - 1].time,
                            whitespaces: h,
                            fixLeftEdgeUntil: o.fixLeftEdgeUntil,
                            timeFrameInvalidated: !1,
                            lastBarSession: o.lastBarSession
                        }, this._updateSeriesColor(o.series[o.series.length - 1]), this._series.applyOptions(this._currentSeriesOptions), this._applyPriceScaleFormatter(), t || this._beforeDataReady(),
                        this._series.setData(o.series), o.additionalSeries && this._setAdditionalSeriesData(o.additionalSeries), o.volume && this._volume.setData(o.volume), this._updateWhitespaces(o.whitespaces), this._dataUpdated(o, this._dataLengthInfo)
                }
                fitContent() {
                    if (null === this._dataLengthInfo || 0 === this._dataLengthInfo.history) return;
                    const {
                        history: e,
                        realtime: t,
                        whitespaces: s,
                        lastBarTime: i,
                        fixLeftEdgeUntil: r = 0
                    } = this._dataLengthInfo, o = this._miniChart.widget(), n = o.paneSize().width;
                    if (0 === n) return;
                    const {
                        leftLogical: a,
                        rightLogical: l,
                        leftPx: h,
                        rightPx: d
                    } = this._horzMargins;
                    let c = -a - (r >= i ? 0 : t),
                        u = e + l + s + t;
                    if (0 !== h) {
                        c -= h / ((n - h) / (u - c + 1))
                    }
                    if (0 !== d) {
                        u += d / ((n - d) / (u - c + 1))
                    }
                    u = Math.max(c, u), o.timeScale().setVisibleLogicalRange({
                        from: c,
                        to: u
                    }), o.timeScale().applyOptions({
                        lockVisibleTimeRangeOnResize: !0
                    })
                }
                titles() {
                    return this._currentSeriesOptions.title ? [this._currentSeriesOptions.title] : []
                }
                deleteView() {
                    var e;
                    this._series.setData([]), null === (e = this._whitespaces) || void 0 === e || e.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()
                }
                forcePercentageMode() {
                    return !1
                }
                lastBarTime() {
                    var e;
                    return null === (e = this._dataLengthInfo) || void 0 === e ? void 0 : e.lastBarTime
                }
                getViewData(e) {
                    return this._buildViewData(e)
                }
                getLegendData(e, t) {
                    var i, r, o, n;
                    const {
                        point: l,
                        time: d,
                        seriesData: u
                    } = e, _ = this.series(), m = this.volume();
                    if (void 0 === l || void 0 === d) return [];
                    const p = u.get(_);
                    if (void 0 === p) return [];
                    const g = [],
                        S = _.priceFormatter(),
                        C = this.currentSeriesOptions();
                    if (!1 === C.visible) return [];
                    if ("Area" === _.seriesType() || "Line" === _.seriesType()) {
                        const {
                            value: e,
                            color: t
                        } = p;
                        let s;
                        "line" === C.chartType ? s = t || C.color : "area" === C.chartType && (s = void 0), g.push({
                            title: C.tooltipTitle || (null === (i = this.symbolInfo()) || void 0 === i ? void 0 : i.name) || "",
                            value: S.format(e),
                            color: s,
                            unit: C.showUnit ? null === (r = this.symbolInfo()) || void 0 === r ? void 0 : r.currency_code : void 0
                        })
                    } else {
                        const {
                            open: e,
                            high: i,
                            low: r,
                            close: o
                        } = p, n = function(e, t) {
                            const s = e ? t.up : t.down;
                            return A(s)
                        }(o >= e, (0, a.ensureDefined)(t[_.seriesType()]));
                        [
                            [h.t(null, {
                                context: "in_legend"
                            }, s(746728)), S.format(e)],
                            [h.t(null, {
                                context: "in_legend"
                            }, s(943253)), S.format(i)],
                            [h.t(null, {
                                context: "in_legend"
                            }, s(389923)), S.format(r)],
                            [h.t(null, {
                                context: "in_legend"
                            }, s(102696)), S.format(o)]
                        ].forEach((([e, t]) => {
                            g.push({
                                value: t,
                                title: e,
                                color: n
                            })
                        }))
                    }
                    const f = m && u.get(m),
                        v = this.volumeOptions();
                    if (f) {
                        const {
                            value: e,
                            color: t
                        } = f;
                        g.push({
                            title: null !== (o = v.tooltipTitle) && void 0 !== o ? o : h.t(null, {
                                context: "in_legend"
                            }, s(971060)),
                            value: I.format(e),
                            color: v.ignoreColor ? void 0 : t && (0, c.resetTransparency)(t),
                            unit: v.showUnit ? null === (n = this.symbolInfo()) || void 0 === n ? void 0 : n.currency_code : void 0
                        })
                    }
                    return g
                }
                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) {
                    var t;
                    null === (t = this._barBuilderLoader) || void 0 === t || t.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 o = this._bars();
                    if (o.isEmpty()) return i;
                    const n = this.minBarIndex(),
                        a = this.maxBarIndex();
                    if (null === n || null === a) return i;
                    const l = null != t ? t : T(n) ? n : o.firstIndex(),
                        h = o.lastIndex();
                    if (null === l || null === h) return i;
                    let d;
                    const {
                        premarketLineColor: c,
                        postmarketLineColor: u,
                        premarketTopColor: _,
                        premarketBottomColor: m,
                        postmarketTopColor: p,
                        postmarketBottomColor: g
                    } = this._getPrePostMarketColors(), C = e => {
                        switch (e) {
                            case 0:
                                return [c, _, m];
                            case 1:
                                return [u, p, g];
                            default:
                                return []
                        }
                    };
                    for (const t of o.rangeIterator(l, h)) {
                        const {
                            value: o,
                            index: n
                        } = t;
                        if (n <= S.UNPLOTTABLE_TIME_POINT_INDEX) continue;
                        const a = this._miniChart.indexToTime(n);
                        if (null === a) {
                            b.logWarn(`Couldn't find time for index ${n}`);
                            continue
                        }
                        const l = O(1e3 * a);
                        if (l <= r) continue;
                        r = l, d = l;
                        const h = this._barIndexSession(n);
                        i.lastBarSession = h, i.series.push(e(l, o, ...C(h)));
                        const c = o[4] >= o[1] ? this._originalVolumeOptions.upColor : this._originalVolumeOptions.downColor;
                        s.push({
                            time: l,
                            value: o[5],
                            color: c
                        })
                    }
                    if (this._isMainPlot() && void 0 === t && void 0 !== d) switch (this._timeFrame.value().value) {
                        case "1D":
                            i.fixLeftEdgeUntil = d + 86400 - 1;
                            break;
                        case "LASTSESSION":
                            {
                                let e = [],
                                    t = d + 87840 - 1;
                                const s = this._generateBarsToSessionEnd();
                                (null == s ? void 0 : s.length) && null !== a && a > h && (e = s, t = s[s.length - 1].time),
                                i.fixLeftEdgeUntil = t,
                                i.whitespaces = e
                            }
                    }
                    return i
                }
                _buildViewData(e) {
                    switch (this._originalSeriesOptions.chartType) {
                        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(w, e);
                        case "area":
                            return this._getViewData(M, e);
                        case "bars":
                        case "candlesticks":
                            return this._getViewData(D, e)
                    }
                }
                _setAdditionalSeriesData(e) {}
                _updateAdditionalSeriesData(e) {}
                _barIndexSession(e) {}
                _onSymbolError(e) {
                    b.logWarn((0, f.encodeExtendedSymbolOrGetSimpleSymbolString)(this._symbol) + " symbol resolving error: " + e), this.updateData(!0), this._status.setValue(1)
                }
                _onSymbolNotPermitted() {
                    this._noData.setValue(1)
                }
                _onSymbolGroupNotPermitted() {
                    this._noData.setValue(1)
                }
                _onSymbolInvalid() {
                    this._noData.setValue(0)
                }
                _onResolutionOrExchangeNotPermittedError() {
                    b.logError((0, f.encodeExtendedSymbolOrGetSimpleSymbolString)(this._symbol) + " resolution or exchange permission error"), this.updateData(!0), this._isMainPlot() && this._miniChart.showMessage(h.t(null, void 0, s(284259))), 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._miniChart.showMessage(h.t(null, void 0, s(212938)))
                }
                async _onData(e, t) {
                    null !== this.minBarIndex() && null !== this.maxBarIndex() && this.updateData(!1, void 0, e)
                }
                _updateSeriesOptions(e) {
                    this._originalSeriesOptions = (0, o.default)(this._originalSeriesOptions, e), this._currentSeriesOptions = (0, o.default)(this._currentSeriesOptions, this._originalSeriesOptions), this._updateSeriesColor(), e.horzMargins && this.updateHorzMargins(e.horzMargins)
                }
                _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(97525), s.e(65414), s.e(89507), s.e(96003)]).then(s.bind(s, 397796)).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 = this._series.dataByIndex(this._dataLengthInfo.lastBarIndex);
                    return null !== s || t ? (t = null != 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, o] = i;
                    if ("line" === s || "area" === s) {
                        const e = "line" === s ? o >= r : o > 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, o = this._currentSeriesOptions;
                            o.color = e ? i : r, o.color || (o.color = this._series.options().color), this._series.applyOptions({
                                color: o.color
                            }), this._directionBasedColor.setValue(o.color)
                        }
                    }
                }
                _createSeries() {
                    const e = this._miniChart.widget();
                    let t;
                    switch (this._currentSeriesOptions.chartType) {
                        case "line":
                            t = e.addLineSeries(this._currentSeriesOptions);
                            break;
                        case "histogram":
                            t = e.addHistogramSeries(this._currentSeriesOptions);
                            break;
                        case "area":
                            t = e.addAreaSeries(this._currentSeriesOptions);
                            break;
                        case "bars":
                            t = e.addBarSeries(this._currentSeriesOptions);
                            break;
                        case "candlesticks":
                            t = e.addCandlestickSeries(this._currentSeriesOptions)
                    }
                    return null === this._originalScaleMode && (this._originalScaleMode = t.priceScale().options().mode), t.priceScale().applyOptions({
                        scaleMargins: this._currentSeriesOptions.scaleMargins
                    }), t
                }
                _createVolume() {
                    const e = this._miniChart.widget().addHistogramSeries(this._originalVolumeOptions);
                    return e.priceScale().applyOptions({
                        scaleMargins: this._originalVolumeOptions.scaleMargins
                    }), e
                }
                _applyPriceScaleFormatter() {
                    var e;
                    if ("priceFormat" in this._originalSeriesOptions) return;
                    const t = (0, a.ensureNotNull)(null !== (e = this._symbolInfo) && void 0 !== e ? e : this._miniChart.mainPlot().symbolInfo());
                    this._currentSeriesOptions.priceFormat = {
                        type: "custom",
                        minMove: t.minmov / t.pricescale,
                        formatter: e => (0, v.createSeriesFormatter)(t, "default").format(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().addLineSeries()), this._whitespacesData = null === this._whitespaces ? void 0 : e, this._whitespaces.setData(e))
                }
                _generateBarsToSessionEnd() {
                    var e;
                    const t = this.symbolInfo(),
                        s = this._bars().lastIndex(),
                        i = this.maxBarIndex();
                    if (t && s && i && this._isLastSessionInterval.value()) {
                        let t = this._miniChart.indexToTime(s);
                        if (null === t) return;
                        const r = [];
                        for (let o = s + 1; o <= i; o += 1) {
                            const s = null !== (e = this._miniChart.indexToTime(o)) && void 0 !== e ? e : t + 60;
                            r.push({
                                time: O(1e3 * s)
                            }), t = s
                        }
                        return r
                    }
                }
                _getPrePostMarketColors() {
                    if (!this._isMainPlot()) return {};
                    let e, t, s, i;
                    const r = this._originalSeriesOptions.premarketLineColor,
                        o = this._originalSeriesOptions.postmarketLineColor;
                    if ("area" === this._originalSeriesOptions.chartType && r && o) {
                        const n = this._currentSeriesOptions,
                            a = n.growingTopColor || n.fallingTopColor || n.topColor;
                        if (void 0 !== a) {
                            const t = (0, l.tryParseRgba)(a);
                            if (null !== t) {
                                const i = t[3];
                                e = (0, c.applyAlpha)(r, i), s = (0, c.applyAlpha)(o, i)
                            }
                        }
                        const h = n.growingBottomColor || n.fallingBottomColor || n.bottomColor;
                        if (void 0 !== h) {
                            const e = (0, l.tryParseRgba)(h);
                            if (null !== e) {
                                const s = e[3];
                                t = (0, c.applyAlpha)(r, s), i = (0, c.applyAlpha)(o, s)
                            }
                        }
                    }
                    return {
                        premarketLineColor: r,
                        postmarketLineColor: o,
                        premarketTopColor: e,
                        postmarketTopColor: s,
                        premarketBottomColor: t,
                        postmarketBottomColor: i
                    }
                }
                _timeScaleSizeChanged() {
                    this._isMainPlot() && Promise.resolve().then((() => this.fitContent()))
                }
            }
        },
        242238: (e, t, s) => {
            s.d(t, {
                ChartSession: () => o
            });
            var i = s(942634),
                r = s(607016);
            class o extends r.Session {
                constructor(e, t = !1) {
                    super(e, "cs", !1), this._sessionDisabled = !1, this._handler = null, this._criticalError = new i.Delegate, this._symbolResolveMap = new Map, this._lastSymbolResolveInfoMap = new Map, this._disableStatistics = t
                }
                destroy() {
                    this._criticalError.destroy(), this._handler = null, this._symbolResolveMap.clear(), super.destroy()
                }
                switchTimezone(e) {
                    return this._getChartApi().switchTimezone(this.sessionId(), e)
                }
                defaultResolutions() {
                    return this._getChartApi().defaultResolutions()
                }
                availableCurrencies() {
                    return this._getChartApi().availableCurrencies()
                }
                availableUnits() {
                    return this._getChartApi().availableUnits()
                }
                availablePriceSources(e) {
                    return this._getChartApi().availablePriceSources(e)
                }
                resolveSymbol(e, t, s) {
                    if (this._symbolResolveMap.has(t)) {
                        const [e, i] = this._symbolResolveMap.get(t);
                        return Array.isArray(i) ? i.push(s) : i.then(s), e
                    } {
                        const i = [s];
                        return this._getChartApi().resolveSymbol(this.sessionId(), e, t, (s => {
                            if ("symbol_error" === s.method) this._symbolResolveMap.delete(t);
                            else {
                                this._symbolResolveMap.set(t, [e, Promise.resolve(s)]);
                                const [, i] = s.params, r = {
                                    pro_name: i.pro_name,
                                    ticker: i.ticker
                                };
                                this._lastSymbolResolveInfoMap.set(t, r), r.pro_name && this._lastSymbolResolveInfoMap.set(r.pro_name, r), i.full_name && this._lastSymbolResolveInfoMap.set(i.full_name, r), r.ticker && this._lastSymbolResolveInfoMap.set(r.ticker, r)
                            }
                            i.forEach((e => e(s)))
                        })), this._symbolResolveMap.set(t, [e, i]), e
                    }
                }
                requestFirstBarTime(e, t, s) {
                    return this._getChartApi().requestFirstBarTime(this.sessionId(), e, t, s)
                }
                lastSymbolResolveInfo(e) {
                    var t;
                    return null !== (t = this._lastSymbolResolveInfoMap.get(e)) && void 0 !== t ? t : null
                }
                createSeries(e, t, s, i, r, o, n) {
                    return this._getChartApi().createSeries(this.sessionId(), e, t, s, i, r, o, n)
                }
                modifySeries(e, t, s, i, r, o, n) {
                    return this._getChartApi().modifySeries(this.sessionId(), e, t, s, i, r, o, n)
                }
                removeSeries(e) {
                    return !!this.isConnected().value() && this._getChartApi().removeSeries(this.sessionId(), e)
                }
                requestMoreData(e, t, s) {
                    return "number" == typeof e ? this._getChartApi().requestMoreData(this.sessionId(), e) : this._getChartApi().requestMoreData(this.sessionId(), e, t, s)
                }
                requestMoreTickmarks(e, t, s) {
                    return this._getChartApi().requestMoreTickmarks(this.sessionId(), e, t, s)
                }
                setFutureTickmarksMode(e) {
                    return this._getChartApi().setFutureTickmarksMode(this.sessionId(), e)
                }
                canCreateStudy(e, t) {
                    return this._getChartApi().canCreateStudy(this.sessionId(), e, t)
                }
                getStudyCounter() {
                    return this._getChartApi().getStudyCounter(this.sessionId())
                }
                getFundamentalCounter() {
                    return this._getChartApi().getFundamentalCounter(this.sessionId())
                }
                createStudy(e, t, s, i, r, o, n) {
                    return this._getChartApi().createStudy(this.sessionId(), e, t, s, i, r, o, n)
                }
                modifyStudy(e, t, s, i, r) {
                    return this._getChartApi().modifyStudy(this.sessionId(), e, t, s, i, r)
                }
                notifyStudy(e, t, s) {
                    return this._getChartApi().notifyStudy(this.sessionId(), e, t, s)
                }
                removeStudy(e) {
                    return this._getChartApi().removeStudy(this.sessionId(), e)
                }
                createPointset(e, t, s, i, r, o) {
                    return this._getChartApi().createPointset(this.sessionId(), e, t, s, i, r, o)
                }
                modifyPointset(e, t, s, i) {
                    return this._getChartApi().modifyPointset(this.sessionId(), e, t, s, i)
                }
                removePointset(e) {
                    return this._getChartApi().removePointset(this.sessionId(), e)
                }
                setVisibleTimeRange(e, t, s, i, r, o) {
                    0
                }
                criticalError() {
                    return this._criticalError
                }
                connect(e = null) {
                    null !== e && (this._handler = e), this._symbolResolveMap.clear(), super.connect()
                }
                setHandler(e) {
                    this._handler = e
                }
                connected() {
                    return this.isConnected().value() && !this._sessionDisabled
                }
                disable() {
                    this._sessionDisabled = !0
                }
                chartApi() {
                    return this._getChartApi()
                }
                _sendCreateSession() {
                    Object.keys(this).forEach((e => {
                        /^(s|st|symbol_)\d+$/.test(e) && delete this[e]
                    })), this._getChartApi().chartCreateSession(this.sessionId(), this._disableStatistics)
                }
                _sendRemoveSession() {
                    this._getChartApi().chartDeleteSession(this.sessionId())
                }
                _onMessage(e) {
                    this._handler && this._handler(e)
                }
                _onCriticalError(e, t) {
                    this._criticalError.fire(e, t), super._onCriticalError(e, t)
                }
            }
        },
        566238: (e, t, s) => {
            s.d(t, {
                WatchedObject: () => n
            });
            var i = s(375397),
                r = s(124829);

            function o(e, t) {
                return (0, r.deepEquals)(e, t)[0]
            }
            class n extends i.WatchedValue {
                constructor(e, t = o) {
                    super(e), this._comparator = t
                }
                setValue(e, t) {
                    (t || !1 === this._comparator(this.value(), e)) && super.setValue(e, t)
                }
            }
        },
        411559: (e, t, s) => {
            s.d(t, {
                hourMinuteFormat: () => n,
                hourMinuteNonZeroSecondFormat: () => r,
                hourMinuteSecondFormat: () => i,
                hourMinuteSecondMillisecFormat: () => o,
                twelveHourMinuteFormat: () => h,
                twelveHourMinuteNonZeroSecondFormat: () => l,
                twelveHourMinuteSecondFormat: () => a
            });
            const i = "%h:%m:%s",
                r = "%h:%m:%s+",
                o = "%h:%m:%s.%ss+",
                n = "%h:%m",
                a = "%h:%m:%s %ampm",
                l = "%h:%m:%s+ %ampm",
                h = "%h:%m %ampm"
        },
        607016: (e, t, s) => {
            s.d(t, {
                Session: () => l
            });
            var i = s(650151),
                r = s(375397),
                o = s(942634),
                n = s(79342);
            const a = (0, s(338619).getLogger)("ChartApi.AbstractSession");
            class l {
                constructor(e, t, s) {
                    this._isConnected = new r.WatchedValue(!1), this._state = 0, this._isConnectForbidden = !1, this._sessionId = "", this._sessionIdChanged = new o.Delegate, this._chartApi = e, this._sessionPrefix = t, this._shouldReconnectAfterCriticalError = s
                }
                destroy() {
                    this._logNormal("Destroying session"), this._isConnected.unsubscribe(), this.disconnect(), this._sessionIdChanged.destroy(), delete this._chartApi, this._logNormal("Session has been destroyed")
                }
                isConnected() {
                    return this._isConnected
                }
                sessionId() {
                    return this._sessionId
                }
                onSessionIdChanged() {
                    return this._sessionIdChanged
                }
                connect() {
                    0 === this._state && ((0, i.assert)(!this._isConnectForbidden, "Cannot call connect because it is forbidden at this moment"), this._setSessionId(`${this._sessionPrefix}_${(0,n.randomHash)()}`), this._logNormal("Connecting session - wait until transport stay connected"), this._state = 1, this._chartApi.createSession(this._sessionId, this))
                }
                disconnect() {
                    0 !== this._state && ((0, i.assert)("" !== this._sessionId, "sessionId must not be invalid"), this._logNormal("Disconnecting session..."), this._forbidConnectWhile((() => {
                        this._chartApi.connected() && this._sendRemoveSession(), this._processDestroyingOnServer()
                    })))
                }
                onMessage(e) {
                    switch (e.method) {
                        case "connected":
                            return void this._onChartApiConnected();
                        case "disconnected":
                            return void this._onChartApiDisconnected();
                        case "critical_error":
                            const t = String(e.params[0]),
                                s = String(e.params[1]);
                            return void this._onCriticalError(t, s)
                    }
                    this._onMessage(e)
                }
                serverTime() {
                    return this._chartApi.serverTime()
                }
                _getChartApi() {
                    return this._chartApi
                }
                _generateLogMessage(e) {
                    return `[${this._sessionId}] ${e}`
                }
                _onCriticalError(e, t) {
                    this._logError(`Critical error. Reason=${e}, info=${t}.`), this._forbidConnectWhile((() => {
                        this._processDestroyingOnServer()
                    })), this._shouldReconnectAfterCriticalError ? (this._logNormal("Reconnecting after critical error..."), this.connect()) : this._logNormal("Reconnecting after critical error skipped")
                }
                _onChartApiConnected() {
                    (0, i.assert)(1 === this._state, "Session is not registered"), this._logNormal("Transport is connected. Creating session on the server"), this._sendCreateSession(), this._state = 2, this._isConnected.setValue(!0)
                }
                _onChartApiDisconnected() {
                    this._logNormal("Transport is disconnected. Reconnecting..."), this._forbidConnectWhile((() => {
                        this._processDestroyingOnServer()
                    })), this.connect()
                }
                _setSessionId(e) {
                    const t = this._sessionId;
                    this._logNormal(`Changing sessionId: old=${t}, new=${e}`), this._sessionId = e, this._sessionIdChanged.fire(e, t)
                }
                _logNormal(e) {
                    a.logNormal(this._generateLogMessage(e))
                }
                _logError(e) {
                    a.logError(this._generateLogMessage(e))
                }
                _processDestroyingOnServer() {
                    this._state = 0, this._isConnected.setValue(!1), this._chartApi.removeSession(this._sessionId), this._setSessionId("")
                }
                _forbidConnectWhile(e) {
                    this._isConnectForbidden = !0, e(), this._isConnectForbidden = !1
                }
            }
        },
        61625: (e, t, s) => {
            function i(e, t, s) {
                return e === t || e === s
            }
            s.d(t, {
                symbolSameAsResolved: () => i
            })
        },
        120984: (e, t, s) => {
            s.d(t, {
                AsyncResourceWrapper: () => i
            });
            class i {
                constructor(e, t) {
                    this._destroyed = !1, this._callbacks = [], this._resource = {
                        pendingResource: e
                    }, e.then((e => {
                        var t;
                        if (this._destroyed) null === (t = this._destroyFn) || void 0 === t || t.call(this, e);
                        else {
                            for (const t of this._callbacks) t(e);
                            this._resource.resource = e
                        }
                    })).finally((() => {
                        this._callbacks = []
                    }))
                }
                destroy() {
                    var e;
                    this._resource.resource && (null === (e = this._destroyFn) || void 0 === e || e.call(this, this._resource.resource)), this._resource = {
                        pendingResource: Promise.reject("Resource is destroyed").catch((() => {}))
                    }, this._callbacks = [], this._destroyed = !0
                }
                callFunction(e) {
                    this._destroyed || (this._resource.resource ? e(this._resource.resource) : this._callbacks.push(e))
                }
                get() {
                    return this._destroyed || !this._resource.resource ? null : this._resource.resource
                }
                promise() {
                    return this._resource.pendingResource
                }
            }
        }
    }
]);