@tradecanvas/chart 1.47.0 → 1.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, t as o, w as s } from "../LayoutSession-Ccv3vSuZ.js";
1
+ import { T as e, a as t, c as n, i as r, n as i, o as a, r as o, t as s } from "../LayoutSession-DSoR1CO8.js";
2
2
  import { a as c, c as l, i as u, n as d, o as f, r as p, s as m, t as h } from "../i18n-DjzoHpMJ.js";
3
3
  import { CHART_STYLE_KEYS as g, CHART_TYPE_ICONS as _, DARK_THEME as v, DEFAULT_SIGNAL_STYLE as y, DEFAULT_TRADE_ZONE_STYLE as b, DEFAULT_TRADING_CONFIG as x, DRAWING_TOOL_ICONS as ee, LIGHT_THEME as te, PHI as ne, PRICE_SOURCES as re, UI_ICONS as ie, barTimeUnit as ae, formatPrice as oe, iconSvg as se, indicatorSource as ce, isTimeFrame as le, isValidTimeZone as ue, marketStatus as de, offsetAt as fe, parseIndicatorSource as pe, phiStep as me, readChartStyleOverrides as he, readChartTypeOptions as ge, readIndicatorPlotStyles as _e, readNews as ve, readQuote as ye, sanitizeDrawingOptions as be, sanitizeDrawingStyle as xe, stepDecimals as Se, symbolTimeZone as Ce, tickBarCount as we, timeParts as Te, timeframeBucketStart as Ee, timeframeToMs as S, tzLabel as De, wallToUtc as Oe, zoneOffsetMinutes as ke } from "@tradecanvas/commons";
4
4
  import { ChartStateManager as Ae, INDICATOR_CATEGORIES as je, INTERVAL_LIMITS as Me, INTERVAL_UNITS as Ne, MAX_ALERT_BARS as Pe, MIN_ALERT_BARS as Fe, RANGE_PRESETS as Ie, SYMBOL_INDICATOR_IDS as Le, indicatorCategory as Re, indicatorValuePrecision as ze, isSeriesPalette as Be, plotColor as Ve, plotShown as He, rangePresetStart as Ue, servesTimeframe as We, sourceParam as Ge, withResampling as Ke } from "@tradecanvas/core";
@@ -8503,10 +8503,10 @@ var Ms = 0, Ns = class {
8503
8503
  this.close(), this.backdrop.remove();
8504
8504
  }
8505
8505
  check() {
8506
- this.submit.disabled = this.busy || a(this.input.value) === null;
8506
+ this.submit.disabled = this.busy || o(this.input.value) === null;
8507
8507
  }
8508
8508
  async done() {
8509
- let e = this.request, t = a(this.input.value);
8509
+ let e = this.request, t = o(this.input.value);
8510
8510
  if (!(!e || t === null || this.busy)) {
8511
8511
  this.busy = !0, this.check();
8512
8512
  try {
@@ -10442,9 +10442,9 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10442
10442
  hostMenus = /* @__PURE__ */ new Set();
10443
10443
  hostLayer = null;
10444
10444
  priceAxisAddDefault = !1;
10445
- constructor(e, n = {}) {
10446
- this.options = n, this.symbols = n.symbols ?? St;
10447
- let r = n.chartOptions;
10445
+ constructor(e, t = {}) {
10446
+ this.options = t, this.symbols = t.symbols ?? St;
10447
+ let r = t.chartOptions;
10448
10448
  if (this.settingsState = {
10449
10449
  ...Ct,
10450
10450
  ...r?.numberLocale ? { numberLocale: r.numberLocale } : {},
@@ -10453,23 +10453,23 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10453
10453
  ...r?.highLowLines === void 0 ? {} : { highLowLines: r.highLowLines },
10454
10454
  ...r?.extendedHours === void 0 ? {} : { extendedHours: r.extendedHours },
10455
10455
  ...r?.chartTypeOptions ? { chartTypeOptions: ge(r.chartTypeOptions) } : {}
10456
- }, this.t = d(f(n.locale, n.messages)), this.featureState = qt(n), n.persistLayouts) {
10457
- let e = n.persistLayouts === !0 ? {} : n.persistLayouts;
10456
+ }, this.t = d(f(t.locale, t.messages)), this.featureState = qt(t), t.persistLayouts) {
10457
+ let e = t.persistLayouts === !0 ? {} : t.persistLayouts;
10458
10458
  this.layoutKeyPrefix = e.keyPrefix ?? "tcw:layout:", this.layoutDebounceMs = e.debounceMs ?? 1500;
10459
10459
  }
10460
- let a = this.resolveIsDark(n.theme), o = this.resolveTheme(n.theme);
10460
+ let i = this.resolveIsDark(t.theme), o = this.resolveTheme(t.theme);
10461
10461
  this.themeOf = {
10462
10462
  ...this.themeOf,
10463
- [a ? "dark" : "light"]: o
10463
+ [i ? "dark" : "light"]: o
10464
10464
  };
10465
10465
  let s = {
10466
10466
  drawings: !0,
10467
10467
  drawingMagnet: !0,
10468
10468
  drawingUndoRedo: !0,
10469
10469
  indicators: !0,
10470
- trading: n.trading !== !1,
10470
+ trading: t.trading !== !1,
10471
10471
  tradingContextMenu: !1,
10472
- priceAxisAddButton: this.featureState.alerts || n.trading !== !1 || this.featureState.sidebar,
10472
+ priceAxisAddButton: this.featureState.alerts || t.trading !== !1 || this.featureState.sidebar,
10473
10473
  volume: !0,
10474
10474
  legend: !0,
10475
10475
  crosshair: !0,
@@ -10480,7 +10480,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10480
10480
  barCountdown: !0,
10481
10481
  logScale: !0,
10482
10482
  watermark: !0,
10483
- ...n.chartOptions?.features
10483
+ ...t.chartOptions?.features
10484
10484
  };
10485
10485
  this.priceAxisAddDefault = s.priceAxisAddButton === !0;
10486
10486
  let c = {
@@ -10492,16 +10492,16 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10492
10492
  legendVisible: s.legend !== !1,
10493
10493
  barCountdown: s.barCountdown !== !1,
10494
10494
  indicatorValueLabels: s.indicatorValueLabels === !0
10495
- }, this.settingsState = { ...this.settingsDefaults }, this.timeframes = Ln(jn(n.timeframes, s.timeframes), this.customTimeframes.list(), s.timeframes), !this.timeframes.some((e) => this.timeframeFavorites.has(e))) {
10496
- let e = Mn(this.timeframes, s.defaultTimeframeFavorites, !!n.timeframes?.length);
10495
+ }, this.settingsState = { ...this.settingsDefaults }, this.timeframes = Ln(jn(t.timeframes, s.timeframes), this.customTimeframes.list(), s.timeframes), !this.timeframes.some((e) => this.timeframeFavorites.has(e))) {
10496
+ let e = Mn(this.timeframes, s.defaultTimeframeFavorites, !!t.timeframes?.length);
10497
10497
  for (let t of e) this.timeframeFavorites.add(t);
10498
10498
  }
10499
- let l = n.timeframe ?? "5m", u = !s.timeframes?.length || s.timeframes.includes(l) ? l : this.timeframes[0] ?? l;
10499
+ let l = t.timeframe ?? "5m", u = !s.timeframes?.length || s.timeframes.includes(l) ? l : this.timeframes[0] ?? l;
10500
10500
  this.state = {
10501
- symbol: n.symbol ?? this.symbols[0] ?? "BTCUSDT",
10501
+ symbol: t.symbol ?? this.symbols[0] ?? "BTCUSDT",
10502
10502
  timeframe: u,
10503
- chartType: n.chartOptions?.chartType ?? "candlestick",
10504
- isDark: a,
10503
+ chartType: t.chartOptions?.chartType ?? "candlestick",
10504
+ isDark: i,
10505
10505
  activeIndicators: /* @__PURE__ */ new Map(),
10506
10506
  activeTool: null,
10507
10507
  magnetEnabled: s.drawingMagnet !== !1,
@@ -10509,14 +10509,14 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10509
10509
  eraser: !1,
10510
10510
  zoomArea: !1,
10511
10511
  stayInDrawing: !1,
10512
- connectionState: n.adapter ? "connecting" : "disconnected",
10513
- connectionMessage: n.adapter ? this.t("status.connecting") : ""
10514
- }, an(), this.root = document.createElement("div"), this.root.className = "tcw-root", this.root.dataset.tcwTheme = a ? "dark" : "light";
10515
- let m = n.dir === "ltr" || n.dir === "rtl" ? n.dir : ql(n.locale) ? "rtl" : "ltr";
10512
+ connectionState: t.adapter ? "connecting" : "disconnected",
10513
+ connectionMessage: t.adapter ? this.t("status.connecting") : ""
10514
+ }, an(), this.root = document.createElement("div"), this.root.className = "tcw-root", this.root.dataset.tcwTheme = i ? "dark" : "light";
10515
+ let m = t.dir === "ltr" || t.dir === "rtl" ? t.dir : ql(t.locale) ? "rtl" : "ltr";
10516
10516
  this.root.dir = m, this.portal.dir = m, e.appendChild(this.root), this.tooltip = new yc(this.root), this.portal.className = "tcw-root tcw-portal", this.portal.dataset.tcwTheme = this.root.dataset.tcwTheme, this.stopKeyboardInset = $s([this.root, this.portal]), this.stopNarrow = ec(this.root, (e) => {
10517
10517
  this.toolbar?.fit(), e || this.sidebar?.closeOverlay(), this.syncRail();
10518
- }), this.ui = G(n.ui);
10519
- let h = n.ui !== void 0;
10518
+ }), this.ui = G(t.ui);
10519
+ let h = t.ui !== void 0;
10520
10520
  K(this.root, this.ui, { variables: h }), K(this.portal, this.ui, { variables: h }), this.markSwitchedOff(), this.stopFormControls = yt([this.root, this.portal], {
10521
10521
  layer: this.overlayHost,
10522
10522
  labels: () => ({
@@ -10529,7 +10529,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10529
10529
  symbols: this.symbols,
10530
10530
  timeframes: this.timeframeMenu(),
10531
10531
  timeframeFavorites: this.pinnedTimeframes(),
10532
- chartTypes: n.chartTypes ? bt.filter((e) => n.chartTypes.includes(e.value)) : bt
10532
+ chartTypes: t.chartTypes ? bt.filter((e) => t.chartTypes.includes(e.value)) : bt
10533
10533
  }, {
10534
10534
  onSymbolClick: () => this.handleSymbolClick(),
10535
10535
  onSymbolInfo: () => this.toggleSymbolInfo(),
@@ -10545,18 +10545,18 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10545
10545
  onToggleReplay: () => this.toggleReplay(),
10546
10546
  onToggleAlerts: () => this.toggleAlerts(),
10547
10547
  onToggleObjects: () => this.toggleObjects(),
10548
- onToggleAccount: n.trading === !1 ? void 0 : () => this.toggleAccountPanel(),
10549
- onLayouts: n.layouts === !1 ? void 0 : (e) => void this.layoutsUI?.openMenu(e),
10550
- onBracket: n.trading === !1 ? void 0 : (e) => this.startBracket(e),
10551
- onToggleLadder: n.trading !== !1 && n.depthLadder ? () => this.toggleLadder() : void 0,
10552
- onOrderTicket: n.trading === !1 ? void 0 : () => this.openOrderTicket(),
10553
- onCompare: n.adapter && s.compareSymbols !== !1 ? () => this.handleAddCompare() : void 0,
10548
+ onToggleAccount: t.trading === !1 ? void 0 : () => this.toggleAccountPanel(),
10549
+ onLayouts: t.layouts === !1 ? void 0 : (e) => void this.layoutsUI?.openMenu(e),
10550
+ onBracket: t.trading === !1 ? void 0 : (e) => this.startBracket(e),
10551
+ onToggleLadder: t.trading !== !1 && t.depthLadder ? () => this.toggleLadder() : void 0,
10552
+ onOrderTicket: t.trading === !1 ? void 0 : () => this.openOrderTicket(),
10553
+ onCompare: t.adapter && s.compareSymbols !== !1 ? () => this.handleAddCompare() : void 0,
10554
10554
  onUndo: () => this.chart.undo(),
10555
10555
  onRedo: () => this.chart.redo(),
10556
10556
  onToggleFullscreen: typeof document < "u" && document.fullscreenEnabled ? () => this.toggleFullscreen() : void 0
10557
10557
  }, this.t, this.overlayHost);
10558
10558
  let g = document.createElement("div");
10559
- g.className = "tcw-body", n.drawingFavorites && this.favoritesStore.seedDefaults(n.drawingFavorites), this.sidebar = new ar(g, {
10559
+ g.className = "tcw-body", t.drawingFavorites && this.favoritesStore.seedDefaults(t.drawingFavorites), this.sidebar = new ar(g, {
10560
10560
  drawingToolGroups: wn(xt, this.t),
10561
10561
  favorites: this.favoritesStore.list(),
10562
10562
  shortcuts: ki()
@@ -10594,9 +10594,9 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10594
10594
  railShown: () => this.railShown(),
10595
10595
  focusAfterClose: (e) => this.panelFocusTarget(e),
10596
10596
  room: () => g.clientWidth
10597
- }), n.watchlist && this.createWatchlist(g, n.watchlist === !0 ? {} : n.watchlist), this.root.appendChild(g);
10597
+ }), t.watchlist && this.createWatchlist(g, t.watchlist === !0 ? {} : t.watchlist), this.root.appendChild(g);
10598
10598
  let _ = document.createElement("div");
10599
- _.className = "tcw-account-dock", k(_, "accountPanel"), this.root.appendChild(_), this.chart = new t(this.chartContainer, {
10599
+ _.className = "tcw-account-dock", k(_, "accountPanel"), this.root.appendChild(_), this.chart = new n(this.chartContainer, {
10600
10600
  chartType: this.state.chartType,
10601
10601
  theme: o,
10602
10602
  autoScale: !0,
@@ -10613,9 +10613,9 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10613
10613
  return n === t ? e : n;
10614
10614
  }
10615
10615
  } },
10616
- ...n.chartOptions,
10616
+ ...t.chartOptions,
10617
10617
  features: c
10618
- }), n.chartOptions?.shapes || this.applyChartShapes(), this.applyLegendFont();
10618
+ }), t.chartOptions?.shapes || this.applyChartShapes(), this.applyLegendFont();
10619
10619
  for (let [e, t] of this.indicatorDefaults.all()) this.chart.setIndicatorDefaults(e, t.style);
10620
10620
  this.chart.on("visibleRangeChange", (e) => {
10621
10621
  let { from: t, to: n } = e.payload;
@@ -10636,7 +10636,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10636
10636
  }
10637
10637
  }), this.marketTimer = setInterval(() => this.refreshMarket(), 3e4), this.onPageShown = () => {
10638
10638
  Pl() || this.refreshMarket();
10639
- }, document.addEventListener("visibilitychange", this.onPageShown), this.dragDrop = new i(this.chartContainer, {
10639
+ }, document.addEventListener("visibilitychange", this.onPageShown), this.dragDrop = new a(this.chartContainer, {
10640
10640
  onData: (e, t, n) => {
10641
10641
  this.setData(e);
10642
10642
  let r = p(this.t("toast.fileLoaded"), {
@@ -10902,7 +10902,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10902
10902
  title: this.t("interval.title"),
10903
10903
  hint: this.t("interval.hint"),
10904
10904
  invalid: this.t("interval.invalid")
10905
- }, (e) => this.selectTypedTimeframe(e)), n.layouts !== !1 && this.setupLayouts(n.layouts === !0 || n.layouts === void 0 ? {} : n.layouts), n.trading !== !1) {
10905
+ }, (e) => this.selectTypedTimeframe(e)), t.layouts !== !1 && this.setupLayouts(t.layouts === !0 || t.layouts === void 0 ? {} : t.layouts), t.trading !== !1) {
10906
10906
  this.orderTicket = new Os(this.root, {
10907
10907
  onSubmit: (e) => {
10908
10908
  this.chart.placeOrderIntent(e), this.say(p(this.t("ticket.sent"), {
@@ -10938,7 +10938,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10938
10938
  "indicatorUpdate"
10939
10939
  ]) this.chart.on(e, () => this.refreshAccountSoon());
10940
10940
  }
10941
- if (n.trading !== !1) {
10941
+ if (t.trading !== !1) {
10942
10942
  if (this.bracketBar = new Nc(this.chartContainer, {
10943
10943
  onConfirm: () => this.chart.confirmBracket(),
10944
10944
  onCancel: () => {
@@ -10947,7 +10947,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10947
10947
  }, this.t), this.chart.on("bracketPlace", (e) => {
10948
10948
  let t = e.payload;
10949
10949
  this.bracketBar?.hide(), this.say(p(this.t(t.side === "buy" ? "bracket.longPlaced" : "bracket.shortPlaced"), { rr: t.riskReward.toFixed(2) }));
10950
- }), n.depthLadder) {
10950
+ }), t.depthLadder) {
10951
10951
  this.depthLadder = new Lc(this.root, {
10952
10952
  onTrade: (e, t) => {
10953
10953
  this.chart.placeOrderIntent({
@@ -10988,7 +10988,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
10988
10988
  }, this.t), this.chart.on("alertAdd", () => this.refreshAlerts()), this.chart.on("alertRemove", () => this.refreshAlerts()), this.chart.on("alertUpdate", () => this.refreshAlerts()), this.chart.on("alertExpired", (e) => {
10989
10989
  let t = e.payload;
10990
10990
  this.refreshAlerts(), this.featureState.alerts && this.say(p(this.t("alerts.expiredToast"), { text: t.message ?? this.alertText(t) }));
10991
- }), n.alertNotifications && (this.alertNotifier = new Pc(n.alertNotifications)), this.chart.on("alertTriggered", (e) => {
10991
+ }), t.alertNotifications && (this.alertNotifier = new Pc(t.alertNotifications)), this.chart.on("alertTriggered", (e) => {
10992
10992
  let t = e.payload;
10993
10993
  if (this.refreshAlerts(), !this.featureState.alerts) return;
10994
10994
  let n = `${this.alertText(t)}${t.message ? ` — ${t.message}` : ""}`;
@@ -11107,11 +11107,11 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
11107
11107
  if (X() || !t || !n("hotkeys.help") || !this.featureState.hotkeySheet) return;
11108
11108
  e.preventDefault(), this.openHotkeySheet();
11109
11109
  }
11110
- }, document.addEventListener("keydown", this.boundGlobalKeydown), document.addEventListener("fullscreenchange", this.onFullscreenChange), this.unregisterKeys = Ws(this.root, [this.portal]), n.adapter ? (this.adapter = n.adapter, this.connectStream()) : this.chart.setDataTimeframe(this.state.timeframe), this.watchlist && (this.watchlistInterval = setInterval(() => this.tickWatchlist(), 1e3)), this.markSwitchedOff(), requestAnimationFrame(() => {
11110
+ }, document.addEventListener("keydown", this.boundGlobalKeydown), document.addEventListener("fullscreenchange", this.onFullscreenChange), this.unregisterKeys = Ws(this.root, [this.portal]), t.adapter ? (this.adapter = t.adapter, this.connectStream()) : this.chart.setDataTimeframe(this.state.timeframe), this.watchlist && (this.watchlistInterval = setInterval(() => this.tickWatchlist(), 1e3)), this.markSwitchedOff(), requestAnimationFrame(() => {
11111
11111
  this.destroyed || (this.toolbar?.tidy(), this.sidebar?.tidy());
11112
11112
  }), this.refreshMarket(), this.updateUI(), queueMicrotask(() => {
11113
11113
  if (!this.destroyed) try {
11114
- n.onReady?.(this.chart, this);
11114
+ t.onReady?.(this.chart, this);
11115
11115
  } finally {
11116
11116
  this.destroyed || this.restoreSharedView();
11117
11117
  }
@@ -12923,7 +12923,7 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
12923
12923
  return t ? (await this.restoreLayout(t), !0) : !1;
12924
12924
  }
12925
12925
  setupLayouts(e) {
12926
- let t = new o(e.storage ?? n(), {
12926
+ let t = new s(e.storage ?? r(), {
12927
12927
  capture: () => ({
12928
12928
  content: this.getLayoutContent(),
12929
12929
  symbol: this.state.symbol,
@@ -12980,14 +12980,14 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
12980
12980
  }
12981
12981
  }
12982
12982
  syncIndicatorsFromChart() {
12983
- let e = /* @__PURE__ */ new Map();
12984
- for (let t of this.chart.getActiveIndicators()) e.set(t.instanceId, {
12985
- id: t.id,
12986
- label: s(t.id, t.params, t.descriptor.defaultConfig, t.descriptor.shortName)
12983
+ let t = /* @__PURE__ */ new Map();
12984
+ for (let n of this.chart.getActiveIndicators()) t.set(n.instanceId, {
12985
+ id: n.id,
12986
+ label: e(n.id, n.params, n.descriptor.defaultConfig, n.descriptor.shortName)
12987
12987
  });
12988
12988
  this.state = {
12989
12989
  ...this.state,
12990
- activeIndicators: e
12990
+ activeIndicators: t
12991
12991
  }, this.updateUI(), this.indicatorPicker?.setCounts(this.indicatorCounts());
12992
12992
  }
12993
12993
  toggleIndicatorPicker() {
@@ -13287,29 +13287,29 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
13287
13287
  }
13288
13288
  renderLegend() {
13289
13289
  if (!this.indicatorLegend || this.destroyed) return;
13290
- let e = this.chart.getData().length - 1, t = this.chart.isTimeAligned() ? this.legendHoverIndex : null, n = t === null ? e : Math.min(Math.max(t, 0), e), r = /* @__PURE__ */ new Map();
13291
- for (let e of this.chart.getIndicatorPanes()) (e.instanceIds ?? [e.instanceId]).forEach((t, n) => r.set(t, {
13290
+ let t = this.chart.getData().length - 1, n = this.chart.isTimeAligned() ? this.legendHoverIndex : null, r = n === null ? t : Math.min(Math.max(n, 0), t), i = /* @__PURE__ */ new Map();
13291
+ for (let e of this.chart.getIndicatorPanes()) (e.instanceIds ?? [e.instanceId]).forEach((t, n) => i.set(t, {
13292
13292
  ...e.rect,
13293
13293
  row: n
13294
13294
  }));
13295
- let i = this.settingsState.numberLocale || "en-US", a = this.chart.getActiveIndicators().map((e) => {
13296
- let t = r.get(e.instanceId) ?? null, a = n >= 0 ? this.chart.getIndicatorOutput(e.instanceId)?.series?.[n] : null, o = this.chart.getIndicatorStyle(e.instanceId), c = e.visible && e.shown === !1, l = c ? [] : kc(e.descriptor, a, o?.colors ?? [], o?.plots);
13295
+ let a = this.settingsState.numberLocale || "en-US", o = this.chart.getActiveIndicators().map((t) => {
13296
+ let n = i.get(t.instanceId) ?? null, o = r >= 0 ? this.chart.getIndicatorOutput(t.instanceId)?.series?.[r] : null, s = this.chart.getIndicatorStyle(t.instanceId), c = t.visible && t.shown === !1, l = c ? [] : kc(t.descriptor, o, s?.colors ?? [], s?.plots);
13297
13297
  return {
13298
- instanceId: e.instanceId,
13299
- label: s(e.id, e.params, e.descriptor.defaultConfig, e.descriptor.shortName),
13300
- visible: e.visible,
13298
+ instanceId: t.instanceId,
13299
+ label: e(t.id, t.params, t.descriptor.defaultConfig, t.descriptor.shortName),
13300
+ visible: t.visible,
13301
13301
  offInterval: c,
13302
13302
  values: l.map((e) => ({
13303
- text: t ? Mc(e.value, i) : this.chart.formatPrice(e.value),
13303
+ text: n ? Mc(e.value, a) : this.chart.formatPrice(e.value),
13304
13304
  color: e.color
13305
13305
  })),
13306
- pane: t ? {
13307
- x: t.x + wl,
13308
- y: t.y + Math.min(Tl + t.row * El, Math.max(Tl, t.height - El)),
13309
- width: t.width - 2 * wl
13306
+ pane: n ? {
13307
+ x: n.x + wl,
13308
+ y: n.y + Math.min(Tl + n.row * El, Math.max(Tl, n.height - El)),
13309
+ width: n.width - 2 * wl
13310
13310
  } : null
13311
13311
  };
13312
- }), o = this.chart.getPlotRect(), c = this.chart.getMaximizedPane(), l = (e) => a.find((t) => t.instanceId === e)?.label ?? "", u = this.chart.getIndicatorPanes().map((e) => ({
13312
+ }), s = this.chart.getPlotRect(), c = this.chart.getMaximizedPane(), l = (e) => o.find((t) => t.instanceId === e)?.label ?? "", u = this.chart.getIndicatorPanes().map((e) => ({
13313
13313
  instanceId: e.instanceId,
13314
13314
  x: e.rect.x + e.rect.width - wl,
13315
13315
  y: e.rect.y + Dl,
@@ -13319,8 +13319,8 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
13319
13319
  canMoveUp: this.chart.canMovePane(e.instanceId, -1),
13320
13320
  canMoveDown: this.chart.canMovePane(e.instanceId, 1)
13321
13321
  }));
13322
- this.indicatorLegend.update(a, {
13323
- left: o.x + wl,
13322
+ this.indicatorLegend.update(o, {
13323
+ left: s.x + wl,
13324
13324
  top: this.chart.getLegendBottom() + 1
13325
13325
  }, u);
13326
13326
  }
@@ -13395,28 +13395,28 @@ var wl = 4, Tl = 7, El = 17, Dl = 3, Ol = [
13395
13395
  return !0;
13396
13396
  }
13397
13397
  };
13398
- function Ll(e, t) {
13399
- let n = (e) => {
13398
+ function Ll(t, n) {
13399
+ let r = (e) => {
13400
13400
  let t = Ge(e.descriptor);
13401
13401
  return t && pe(e.params[t])?.instanceId || null;
13402
- }, r = new Set([e]);
13402
+ }, i = new Set([t]);
13403
13403
  for (let e = !0; e;) {
13404
13404
  e = !1;
13405
- for (let i of t) {
13406
- let t = n(i);
13407
- t && r.has(t) && !r.has(i.instanceId) && (r.add(i.instanceId), e = !0);
13405
+ for (let t of n) {
13406
+ let n = r(t);
13407
+ n && i.has(n) && !i.has(t.instanceId) && (i.add(t.instanceId), e = !0);
13408
13408
  }
13409
13409
  }
13410
- let i = [];
13411
- for (let e of t) {
13412
- if (r.has(e.instanceId)) continue;
13413
- let t = s(e.id, e.params, e.descriptor.defaultConfig, e.descriptor.shortName);
13414
- for (let n of e.descriptor.plots ?? []) i.push({
13415
- value: ce(e.instanceId, n.key),
13416
- label: `${t}: ${n.title}`
13410
+ let a = [];
13411
+ for (let t of n) {
13412
+ if (i.has(t.instanceId)) continue;
13413
+ let n = e(t.id, t.params, t.descriptor.defaultConfig, t.descriptor.shortName);
13414
+ for (let e of t.descriptor.plots ?? []) a.push({
13415
+ value: ce(t.instanceId, e.key),
13416
+ label: `${n}: ${e.title}`
13417
13417
  });
13418
13418
  }
13419
- return i;
13419
+ return a;
13420
13420
  }
13421
13421
  var Rl = "tcw:recentCommands", zl = 10;
13422
13422
  function Bl() {
@@ -13913,7 +13913,7 @@ var tu = class {
13913
13913
  e.innerHTML = `${A("save", 14)}<span class="tcw-layouts-label">${j(t)}</span>` + (n ? "<span class=\"tcw-layouts-dirty\" aria-hidden=\"true\"></span>" : "") + A("chevronDown", 12), e.title = r, e.setAttribute("aria-label", r);
13914
13914
  }
13915
13915
  setupLayouts(e) {
13916
- let t = new o(e.storage ?? n("tcw:grid-layouts:"), {
13916
+ let t = new s(e.storage ?? r("tcw:grid-layouts:"), {
13917
13917
  capture: () => {
13918
13918
  let e = this.cells[this.active].widget;
13919
13919
  return {
@@ -13952,6 +13952,6 @@ function nu(e, t) {
13952
13952
  return n;
13953
13953
  }
13954
13954
  //#endregion
13955
- export { _ as CHART_TYPE_ICONS, Il as ChartWidget, tu as ChartWidgetGrid, Jl as DEFAULT_GRID_SYNC, ee as DRAWING_TOOL_ICONS, l as EN_MESSAGES, Xl as GRID_SHAPES, o as LayoutSession, r as MAX_LAYOUT_NAME, ie as UI_ICONS, m as VI_MESSAGES, Bt as WIDGET_FEATURES, $i as WIDGET_UI_PRESETS, K as applyWidgetUI, a as cleanLayoutName, ln as createChartTypeIcon, A as createIcon, cn as createToolIcon, u as findWidgetLocale, se as iconSvg, n as localStorageLayouts, e as memoryLayouts, eu as readGridLayout, hi as readWatchlists, Ys as readWidgetLayout, c as registerWidgetLocale, G as resolveWidgetUI, sa as widgetUIVariables };
13955
+ export { _ as CHART_TYPE_ICONS, Il as ChartWidget, tu as ChartWidgetGrid, Jl as DEFAULT_GRID_SYNC, ee as DRAWING_TOOL_ICONS, l as EN_MESSAGES, Xl as GRID_SHAPES, s as LayoutSession, i as MAX_LAYOUT_NAME, ie as UI_ICONS, m as VI_MESSAGES, Bt as WIDGET_FEATURES, $i as WIDGET_UI_PRESETS, K as applyWidgetUI, o as cleanLayoutName, ln as createChartTypeIcon, A as createIcon, cn as createToolIcon, u as findWidgetLocale, se as iconSvg, r as localStorageLayouts, t as memoryLayouts, eu as readGridLayout, hi as readWatchlists, Ys as readWidgetLayout, c as registerWidgetLocale, G as resolveWidgetUI, sa as widgetUIVariables };
13956
13956
 
13957
13957
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradecanvas/chart",
3
- "version": "1.47.0",
3
+ "version": "1.48.0",
4
4
  "type": "module",
5
5
  "description": "High-performance canvas trading chart with built-in indicators, drawing tools, and real-time streaming. Zero external dependencies.",
6
6
  "license": "MIT",
@@ -58,8 +58,8 @@
58
58
  "README.md"
59
59
  ],
60
60
  "dependencies": {
61
- "@tradecanvas/commons": "1.47.0",
62
- "@tradecanvas/core": "1.47.0"
61
+ "@tradecanvas/commons": "1.48.0",
62
+ "@tradecanvas/core": "1.48.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "jsdom": "^25.0.1",