@tradecanvas/chart 1.81.0 → 1.83.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.
Files changed (129) hide show
  1. package/dist/Chart.d.ts +14 -1
  2. package/dist/Chart.d.ts.map +1 -1
  3. package/dist/LayoutSession-B4qMfaP7.cjs +2 -0
  4. package/dist/LayoutSession-B4qMfaP7.cjs.map +1 -0
  5. package/dist/{LayoutSession-C4Lp1X6t.js → LayoutSession-BoiToS9y.js} +625 -369
  6. package/dist/LayoutSession-BoiToS9y.js.map +1 -0
  7. package/dist/{WidgetCommandPalette-Bvr6Od3p.js → WidgetCommandPalette-DHGvEl9n.js} +2 -2
  8. package/dist/{WidgetCommandPalette-Bvr6Od3p.js.map → WidgetCommandPalette-DHGvEl9n.js.map} +1 -1
  9. package/dist/{WidgetCommandPalette-B1jaXJ-I.cjs → WidgetCommandPalette-Ol8Z923q.cjs} +2 -2
  10. package/dist/{WidgetCommandPalette-B1jaXJ-I.cjs.map → WidgetCommandPalette-Ol8Z923q.cjs.map} +1 -1
  11. package/dist/{WidgetDrawingSettings-CsR3GuFG.js → WidgetDrawingSettings-CSB88SvC.js} +2 -2
  12. package/dist/{WidgetDrawingSettings-CsR3GuFG.js.map → WidgetDrawingSettings-CSB88SvC.js.map} +1 -1
  13. package/dist/{WidgetDrawingSettings-B8JKpke1.cjs → WidgetDrawingSettings-XL1Z9-ly.cjs} +2 -2
  14. package/dist/{WidgetDrawingSettings-B8JKpke1.cjs.map → WidgetDrawingSettings-XL1Z9-ly.cjs.map} +1 -1
  15. package/dist/{WidgetIndicatorPicker-B72LdJy1.cjs → WidgetIndicatorPicker-K01RJSLs.cjs} +2 -2
  16. package/dist/{WidgetIndicatorPicker-B72LdJy1.cjs.map → WidgetIndicatorPicker-K01RJSLs.cjs.map} +1 -1
  17. package/dist/{WidgetIndicatorPicker-Cb2m62oH.js → WidgetIndicatorPicker-a4rpptDc.js} +2 -2
  18. package/dist/{WidgetIndicatorPicker-Cb2m62oH.js.map → WidgetIndicatorPicker-a4rpptDc.js.map} +1 -1
  19. package/dist/{WidgetIndicatorSettings-BiX1ZOhS.js → WidgetIndicatorSettings-BmIFp19I.js} +3 -3
  20. package/dist/{WidgetIndicatorSettings-BiX1ZOhS.js.map → WidgetIndicatorSettings-BmIFp19I.js.map} +1 -1
  21. package/dist/{WidgetIndicatorSettings-DhFQasHT.cjs → WidgetIndicatorSettings-CJWR-x9q.cjs} +2 -2
  22. package/dist/{WidgetIndicatorSettings-DhFQasHT.cjs.map → WidgetIndicatorSettings-CJWR-x9q.cjs.map} +1 -1
  23. package/dist/{WidgetSettings-CkvK-3d9.js → WidgetSettings-9clgY3_1.js} +17 -4
  24. package/dist/WidgetSettings-9clgY3_1.js.map +1 -0
  25. package/dist/{WidgetSettings-bO72SYQ6.cjs → WidgetSettings-D6COgRaB.cjs} +2 -2
  26. package/dist/WidgetSettings-D6COgRaB.cjs.map +1 -0
  27. package/dist/{WidgetSymbolSearch-DeBxGj4a.cjs → WidgetSymbolSearch-6EB31v-O.cjs} +2 -2
  28. package/dist/{WidgetSymbolSearch-DeBxGj4a.cjs.map → WidgetSymbolSearch-6EB31v-O.cjs.map} +1 -1
  29. package/dist/{WidgetSymbolSearch-WOskcBJN.js → WidgetSymbolSearch-DToOqJoG.js} +2 -2
  30. package/dist/{WidgetSymbolSearch-WOskcBJN.js.map → WidgetSymbolSearch-DToOqJoG.js.map} +1 -1
  31. package/dist/grid/ChartGrid.d.ts +9 -1
  32. package/dist/grid/ChartGrid.d.ts.map +1 -1
  33. package/dist/grid/gridShapes.d.ts +43 -0
  34. package/dist/grid/gridShapes.d.ts.map +1 -0
  35. package/dist/i18n-D0SPfH2s.cjs +2 -0
  36. package/dist/i18n-D0SPfH2s.cjs.map +1 -0
  37. package/dist/{i18n-Ci4pfuXw.js → i18n-nWmX3G55.js} +21 -1
  38. package/dist/i18n-nWmX3G55.js.map +1 -0
  39. package/dist/index.cjs +1 -1
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +155 -179
  44. package/dist/index.js.map +1 -1
  45. package/dist/{indicatorInputWords-DpkxBon4.js → indicatorInputWords-D0SGBaUD.js} +2 -2
  46. package/dist/{indicatorInputWords-DpkxBon4.js.map → indicatorInputWords-D0SGBaUD.js.map} +1 -1
  47. package/dist/{indicatorInputWords-BfWHWL0K.cjs → indicatorInputWords-HqTGFokF.cjs} +2 -2
  48. package/dist/{indicatorInputWords-BfWHWL0K.cjs.map → indicatorInputWords-HqTGFokF.cjs.map} +1 -1
  49. package/dist/widget/ChartWidget.d.ts +11 -1
  50. package/dist/widget/ChartWidget.d.ts.map +1 -1
  51. package/dist/widget/ChartWidgetGrid.d.ts +7 -10
  52. package/dist/widget/ChartWidgetGrid.d.ts.map +1 -1
  53. package/dist/widget/GridLayoutPicker.d.ts +55 -0
  54. package/dist/widget/GridLayoutPicker.d.ts.map +1 -0
  55. package/dist/widget/WatchlistStore.d.ts +11 -0
  56. package/dist/widget/WatchlistStore.d.ts.map +1 -1
  57. package/dist/widget/WidgetChartSettings.d.ts +2 -0
  58. package/dist/widget/WidgetChartSettings.d.ts.map +1 -1
  59. package/dist/widget/WidgetDockArea.d.ts +1 -0
  60. package/dist/widget/WidgetDockArea.d.ts.map +1 -1
  61. package/dist/widget/WidgetDrawingSidebar.d.ts +27 -0
  62. package/dist/widget/WidgetDrawingSidebar.d.ts.map +1 -1
  63. package/dist/widget/WidgetSettings.d.ts.map +1 -1
  64. package/dist/widget/WidgetToolbar.d.ts.map +1 -1
  65. package/dist/widget/WidgetWatchlist.d.ts +3 -0
  66. package/dist/widget/WidgetWatchlist.d.ts.map +1 -1
  67. package/dist/widget/WidgetWatchlists.d.ts +1 -0
  68. package/dist/widget/WidgetWatchlists.d.ts.map +1 -1
  69. package/dist/widget/chartSettingsStore.d.ts.map +1 -1
  70. package/dist/widget/index.cjs +58 -4
  71. package/dist/widget/index.cjs.map +1 -1
  72. package/dist/widget/index.d.ts +1 -0
  73. package/dist/widget/index.d.ts.map +1 -1
  74. package/dist/widget/index.js +1781 -1528
  75. package/dist/widget/index.js.map +1 -1
  76. package/dist/widget/locales/ar.d.ts.map +1 -1
  77. package/dist/widget/locales/cs.d.ts.map +1 -1
  78. package/dist/widget/locales/da.d.ts.map +1 -1
  79. package/dist/widget/locales/de.d.ts.map +1 -1
  80. package/dist/widget/locales/el.d.ts.map +1 -1
  81. package/dist/widget/locales/en.d.ts +10 -0
  82. package/dist/widget/locales/en.d.ts.map +1 -1
  83. package/dist/widget/locales/es.d.ts.map +1 -1
  84. package/dist/widget/locales/et.d.ts.map +1 -1
  85. package/dist/widget/locales/fa.d.ts.map +1 -1
  86. package/dist/widget/locales/fr.d.ts.map +1 -1
  87. package/dist/widget/locales/he.d.ts.map +1 -1
  88. package/dist/widget/locales/hu.d.ts.map +1 -1
  89. package/dist/widget/locales/id.d.ts.map +1 -1
  90. package/dist/widget/locales/index.cjs +1 -1
  91. package/dist/widget/locales/index.cjs.map +1 -1
  92. package/dist/widget/locales/index.js +281 -1
  93. package/dist/widget/locales/index.js.map +1 -1
  94. package/dist/widget/locales/it.d.ts.map +1 -1
  95. package/dist/widget/locales/ja.d.ts.map +1 -1
  96. package/dist/widget/locales/ko.d.ts.map +1 -1
  97. package/dist/widget/locales/ms.d.ts.map +1 -1
  98. package/dist/widget/locales/nb.d.ts.map +1 -1
  99. package/dist/widget/locales/nl.d.ts.map +1 -1
  100. package/dist/widget/locales/pl.d.ts.map +1 -1
  101. package/dist/widget/locales/pt.d.ts.map +1 -1
  102. package/dist/widget/locales/ro.d.ts.map +1 -1
  103. package/dist/widget/locales/ru.d.ts.map +1 -1
  104. package/dist/widget/locales/sk.d.ts.map +1 -1
  105. package/dist/widget/locales/sv.d.ts.map +1 -1
  106. package/dist/widget/locales/th.d.ts.map +1 -1
  107. package/dist/widget/locales/tr.d.ts.map +1 -1
  108. package/dist/widget/locales/vi.d.ts.map +1 -1
  109. package/dist/widget/locales/zh.d.ts.map +1 -1
  110. package/dist/widget/locales/zhHant.d.ts.map +1 -1
  111. package/dist/widget/types.d.ts +11 -1
  112. package/dist/widget/types.d.ts.map +1 -1
  113. package/dist/widget/widgetConfig.d.ts.map +1 -1
  114. package/dist/{widgetLocales-D-QYU_9U.js → widgetLocales-BX7VRdl5.js} +2 -1
  115. package/dist/widgetLocales-BX7VRdl5.js.map +1 -0
  116. package/dist/widgetLocales-C_XTkni5.cjs +2 -0
  117. package/dist/widgetLocales-C_XTkni5.cjs.map +1 -0
  118. package/package.json +3 -3
  119. package/dist/LayoutSession-C4Lp1X6t.js.map +0 -1
  120. package/dist/LayoutSession-CeayqT91.cjs +0 -2
  121. package/dist/LayoutSession-CeayqT91.cjs.map +0 -1
  122. package/dist/WidgetSettings-CkvK-3d9.js.map +0 -1
  123. package/dist/WidgetSettings-bO72SYQ6.cjs.map +0 -1
  124. package/dist/i18n-Ci4pfuXw.js.map +0 -1
  125. package/dist/i18n-hMXCt55K.cjs +0 -2
  126. package/dist/i18n-hMXCt55K.cjs.map +0 -1
  127. package/dist/widgetLocales-D-QYU_9U.js.map +0 -1
  128. package/dist/widgetLocales-fhdzLs5l.cjs +0 -2
  129. package/dist/widgetLocales-fhdzLs5l.cjs.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { t as e } from "./indicatorLabel-BsidWCv1.js";
2
- import { DARK_THEME as t, DEFAULT_PANEL_HEIGHT as n, LIGHT_THEME as r, LayerType as i, MIN_PANEL_HEIGHT as a, PHI as o, PRICE_AXIS_WIDTH as s, TIME_AXIS_HEIGHT as c, autoPricePrecision as l, barDateZone as u, barTimeUnit as d, barsAreDaily as f, chartStyleValue as p, computePriceLimits as m, computePriceRange as h, createMarketTheme as g, formatPrice as _, fractionTick as v, indicatorSource as y, isValidTimeZone as b, mergeBar as ee, niceNumber as te, normalizeBarTime as x, parseIndicatorSource as S, priceFormatterFor as ne, priceStepAt as re, readChartStyleOverrides as ie, readChartTypeOptions as ae, readIndicatorPlotStyles as oe, readPaneStyle as se, resolveChartTheme as ce, sessionMinute as C, setLocale as le, stepDecimals as ue, symbolTimeZone as w, tickBarCount as de, timeframeToMs as T, zonedDateFormatter as fe } from "@tradecanvas/commons";
3
- import { AlertDragHandler as pe, AlertManager as me, Animator as he, AreaRenderer as ge, AxisDragHandler as _e, BarCountdown as ve, BarRenderer as ye, BaselineRenderer as be, CandlestickRenderer as xe, ChartLegend as Se, ChartStateManager as E, CompareRenderer as Ce, CompareSymbolIndicator as we, CompareSymbolPaneIndicator as Te, CorrelationCoefficientIndicator as Ee, CorrelationLogIndicator as De, CrosshairHandler as Oe, CrosshairTooltip as ke, CurrentPriceLine as Ae, DEFAULT_SESSION_HOURS as je, DataExporter as D, DepthHeatmapRenderer as Me, DrawingManager as Ne, DrawingRenderer as Pe, EquivolumeRenderer as Fe, EventBus as Ie, GridRenderer as Le, HLCAreaRenderer as Re, HiLoRenderer as ze, HollowCandleRenderer as Be, IndicatorEngine as Ve, InteractionManager as He, KagiRenderer as Ue, KeyboardHandler as We, LineRenderer as Ge, LineWithMarkersRenderer as Ke, MarketProfileRenderer as qe, MeasureOverlay as Je, PRICE_AXIS_ADD_STRIP as Ye, PRICE_SCALE_MARGIN as O, PanHandler as Xe, PaneResizeHandler as Ze, PeriodLevelsRenderer as Qe, PinnedTooltip as $e, PivotMarkersRenderer as et, PointAndFigureRenderer as tt, PriceAxis as nt, PriceAxisAddButton as rt, PriceLines as it, RenderEngine as at, RenkoRenderer as ot, ReplayManager as st, ResamplingAdapter as ct, ReshapeMemo as lt, SYMBOL_INDICATOR_IDS as ut, SYMBOL_ZONE_WAIT_MS as dt, Screenshot as k, SelectionBoxOverlay as ft, SessionBreaks as pt, SessionShading as mt, SignalMarkerManager as ht, SpreadIndicator as gt, StepLineRenderer as _t, StreamManager as vt, SymbolSeriesStore as yt, TimeAxis as bt, TradeZoneManager as xt, TradingManager as St, TradingRenderer as Ct, UndoRedoManager as wt, Viewport as Tt, VolumeCandleRenderer as Et, VolumeProfileRenderer as Dt, VolumeRenderer as Ot, Watermark as kt, ZoomHandler as At, axisTimes as A, barTimeStepMs as jt, findDominantSwing as Mt, gpuContextsLeft as Nt, isPriceLevelAlert as Pt, isRegularSession as Ft, loadWebGL as It, mergeSessionHours as Lt, pointAndFigureColumns as Rt, rangePresetStart as zt, readAlertOptions as Bt, registerBuiltInDrawingTools as Vt, registerBuiltInIndicators as Ht, servesTimeframe as j, sourceParam as M, streamAdapterOf as Ut, timestampToBarIndex as N, toHeikinAshi as Wt, toKagi as Gt, toLineBreak as Kt, toRangeBars as qt, toRenko as Jt, whenGpuContextFree as Yt, withResampling as P, xToBarIndex as Xt, xToTime as F, yToPrice as Zt } from "@tradecanvas/core";
2
+ import { DARK_THEME as t, DEFAULT_PANEL_HEIGHT as n, LIGHT_THEME as r, LayerType as i, MIN_PANEL_HEIGHT as a, PHI as o, PRICE_AXIS_WIDTH as s, TIME_AXIS_HEIGHT as c, autoPricePrecision as l, barDateZone as u, barTimeUnit as d, barsAreDaily as f, chartStyleValue as p, computePriceLimits as m, computePriceRange as h, createMarketTheme as g, formatPrice as _, fractionTick as v, indicatorSource as y, isValidTimeZone as b, mergeBar as ee, niceNumber as te, normalizeBarTime as x, parseIndicatorSource as S, priceFormatterFor as ne, priceStepAt as re, readChartStyleOverrides as ie, readChartTypeOptions as C, readIndicatorPlotStyles as ae, readPaneStyle as oe, resolveChartTheme as se, sessionMinute as w, setLocale as ce, stepDecimals as le, symbolTimeZone as T, tickBarCount as ue, timeframeToMs as E, zonedDateFormatter as de } from "@tradecanvas/commons";
3
+ import { AlertDragHandler as fe, AlertManager as pe, Animator as me, AreaRenderer as he, AxisDragHandler as ge, BarCountdown as _e, BarRenderer as ve, BaselineRenderer as ye, CandlestickRenderer as be, ChartLegend as xe, ChartStateManager as D, CompareRenderer as Se, CompareSymbolIndicator as Ce, CompareSymbolPaneIndicator as we, CorrelationCoefficientIndicator as Te, CorrelationLogIndicator as Ee, CrosshairHandler as De, CrosshairTooltip as Oe, CurrentPriceLine as ke, DEFAULT_SESSION_HOURS as Ae, DataExporter as O, DepthHeatmapRenderer as je, DrawingManager as Me, DrawingRenderer as Ne, EquivolumeRenderer as Pe, EventBus as Fe, GridRenderer as Ie, HLCAreaRenderer as Le, HiLoRenderer as Re, HollowCandleRenderer as ze, IndicatorEngine as Be, InteractionManager as Ve, KagiRenderer as He, KeyboardHandler as Ue, LineRenderer as We, LineWithMarkersRenderer as Ge, MarketProfileRenderer as Ke, MeasureOverlay as qe, PRICE_AXIS_ADD_STRIP as Je, PRICE_SCALE_MARGIN as k, PanHandler as Ye, PaneResizeHandler as Xe, PeriodLevelsRenderer as Ze, PinnedTooltip as Qe, PivotMarkersRenderer as $e, PointAndFigureRenderer as et, PriceAxis as tt, PriceAxisAddButton as nt, PriceLines as rt, RenderEngine as it, RenkoRenderer as at, ReplayManager as ot, ResamplingAdapter as st, ReshapeMemo as ct, SYMBOL_INDICATOR_IDS as lt, SYMBOL_ZONE_WAIT_MS as ut, Screenshot as A, SelectionBoxOverlay as dt, SessionBreaks as ft, SessionShading as pt, SignalMarkerManager as mt, SpreadIndicator as ht, StepLineRenderer as gt, StreamManager as _t, SymbolSeriesStore as vt, TimeAxis as yt, TradeZoneManager as bt, TradingManager as xt, TradingRenderer as St, UndoRedoManager as Ct, Viewport as wt, VolumeCandleRenderer as Tt, VolumeProfileRenderer as Et, VolumeRenderer as Dt, Watermark as Ot, ZoomHandler as kt, axisTimes as At, barTimeStepMs as jt, findDominantSwing as Mt, gpuContextsLeft as Nt, idleCssCursor as Pt, isCrosshairCursor as Ft, isPriceLevelAlert as It, isRegularSession as Lt, loadWebGL as Rt, mergeSessionHours as zt, pointAndFigureColumns as Bt, rangePresetStart as Vt, readAlertOptions as Ht, registerBuiltInDrawingTools as Ut, registerBuiltInIndicators as Wt, servesTimeframe as j, sourceParam as M, streamAdapterOf as Gt, timestampToBarIndex as N, toHeikinAshi as Kt, toKagi as qt, toLineBreak as Jt, toRangeBars as Yt, toRenko as Xt, whenGpuContextFree as Zt, withResampling as P, xToBarIndex as Qt, xToTime as F, yToPrice as $t } from "@tradecanvas/core";
4
4
  //#region src/regularHours.ts
5
- var Qt = 864e5, $t = 10;
6
- function en(e, t) {
7
- let n = w(e);
5
+ var en = 864e5, tn = 10;
6
+ function nn(e, t) {
7
+ let n = T(e);
8
8
  if (!n || !b(n) || t.length < 2) return null;
9
9
  let r = (e?.sessions ?? []).flatMap((e) => {
10
- let t = C(e.start), n = C(e.end);
10
+ let t = w(e.start), n = w(e.end);
11
11
  return t === null || n === null ? [] : [{
12
12
  startMinute: t,
13
13
  endMinute: n
@@ -15,34 +15,34 @@ function en(e, t) {
15
15
  });
16
16
  if (r.length === 0) return null;
17
17
  let i = d(t), a = Infinity;
18
- for (let e = Math.max(1, t.length - $t); e < t.length; e++) {
18
+ for (let e = Math.max(1, t.length - tn); e < t.length; e++) {
19
19
  let n = (t[e].time - t[e - 1].time) * i;
20
20
  n > 0 && n < a && (a = n);
21
21
  }
22
- if (!(a < Qt)) return null;
22
+ if (!(a < en)) return null;
23
23
  let o = {
24
24
  timeZone: n,
25
25
  windows: r,
26
26
  startMinute: r[0].startMinute,
27
27
  endMinute: r[r.length - 1].endMinute
28
28
  };
29
- return (e) => Ft(e * i, o);
29
+ return (e) => Lt(e * i, o);
30
30
  }
31
31
  //#endregion
32
32
  //#region src/chartA11y.ts
33
- var tn = {
33
+ var rn = {
34
34
  role: "chart",
35
35
  summary: "{what}. Last price {close}.",
36
36
  empty: "Chart, no data.",
37
37
  view: "Showing {count} bars, {from} to {to}. High {high}, low {low}.",
38
38
  bar: "{time}: open {open}, high {high}, low {low}, close {close}, volume {volume}.",
39
39
  keys: "Arrow keys scroll and zoom, Home and End go to the start and the end. Comma and period read the bars one at a time."
40
- }, I = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), nn = [
40
+ }, I = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), an = [
41
41
  "role",
42
42
  "aria-roledescription",
43
43
  "aria-label",
44
44
  "aria-describedby"
45
- ], rn = 400, an = 1e3, on = class {
45
+ ], on = 400, sn = 1e3, cn = class {
46
46
  live;
47
47
  help;
48
48
  labels;
@@ -56,20 +56,20 @@ var tn = {
56
56
  };
57
57
  constructor(e, t, n = {}) {
58
58
  this.container = e, this.source = t, this.labels = {
59
- ...tn,
59
+ ...rn,
60
60
  ...n
61
61
  };
62
- for (let t of nn) this.before.set(t, e.getAttribute(t));
63
- e.setAttribute("role", "application"), this.help = sn("div", "tc-sr-only"), this.help.id = `tc-chart-keys-${Math.random().toString(36).slice(2, 10)}`, e.setAttribute("aria-describedby", this.help.id), this.live = sn("div", "tc-sr-only tc-sr-live"), this.live.setAttribute("aria-live", "polite"), this.live.setAttribute("aria-atomic", "true"), e.append(this.help, this.live), e.addEventListener("blur", this.onBlur), this.applyLabels();
62
+ for (let t of an) this.before.set(t, e.getAttribute(t));
63
+ e.setAttribute("role", "application"), this.help = ln("div", "tc-sr-only"), this.help.id = `tc-chart-keys-${Math.random().toString(36).slice(2, 10)}`, e.setAttribute("aria-describedby", this.help.id), this.live = ln("div", "tc-sr-only tc-sr-live"), this.live.setAttribute("aria-live", "polite"), this.live.setAttribute("aria-atomic", "true"), e.append(this.help, this.live), e.addEventListener("blur", this.onBlur), this.applyLabels();
64
64
  }
65
65
  setLabels(e) {
66
66
  this.labels = {
67
- ...tn,
67
+ ...rn,
68
68
  ...e
69
69
  }, this.applyLabels();
70
70
  }
71
71
  refresh(e = !1) {
72
- let t = an - (Date.now() - this.summaryAt);
72
+ let t = sn - (Date.now() - this.summaryAt);
73
73
  if (e || t <= 0 || this.container.getAttribute("aria-label") === this.labels.empty) {
74
74
  this.summaryTimer && clearTimeout(this.summaryTimer), this.summaryTimer = null, this.summaryAt = Date.now(), this.container.setAttribute("aria-label", this.summary());
75
75
  return;
@@ -81,7 +81,7 @@ var tn = {
81
81
  viewMoved() {
82
82
  this.cursor = null, this.viewTimer && clearTimeout(this.viewTimer), this.viewTimer = setTimeout(() => {
83
83
  this.viewTimer = null, this.say(this.viewText());
84
- }, rn);
84
+ }, on);
85
85
  }
86
86
  readBar(e) {
87
87
  let t = this.source.bars();
@@ -100,7 +100,7 @@ var tn = {
100
100
  high: a(i.high),
101
101
  low: a(i.low),
102
102
  close: a(i.close),
103
- volume: cn(i.volume ?? 0)
103
+ volume: un(i.volume ?? 0)
104
104
  }));
105
105
  }
106
106
  destroy() {
@@ -141,7 +141,7 @@ var tn = {
141
141
  this.live.textContent = e;
142
142
  }
143
143
  };
144
- function sn(e, t) {
144
+ function ln(e, t) {
145
145
  let n = document.createElement(e);
146
146
  return n.className = t, Object.assign(n.style, {
147
147
  position: "absolute",
@@ -155,57 +155,57 @@ function sn(e, t) {
155
155
  border: "0"
156
156
  }), n;
157
157
  }
158
- function cn(e) {
158
+ function un(e) {
159
159
  return Number.isInteger(e) ? String(e) : e.toFixed(2);
160
160
  }
161
161
  //#endregion
162
162
  //#region src/charts/ChartTypeStrategy.ts
163
- function ln(e) {
163
+ function dn(e) {
164
164
  switch (e) {
165
165
  case "candlestick":
166
166
  case "heikinAshi":
167
167
  case "lineBreak":
168
- case "rangeBars": return new xe();
169
- case "line": return new Ge();
170
- case "area": return new ge();
171
- case "bar": return new ye();
172
- case "hollowCandle": return new Be();
173
- case "baseline": return new be();
174
- case "renko": return new ot();
175
- case "kagi": return new Ue();
176
- case "pointAndFigure": return new tt();
177
- case "volumeCandles": return new Et();
178
- case "equivolume": return new Fe();
179
- case "hlcArea": return new Re();
180
- case "stepLine": return new _t();
181
- case "lineWithMarkers": return new Ke();
182
- case "hiLo": return new ze();
183
- default: return new xe();
168
+ case "rangeBars": return new be();
169
+ case "line": return new We();
170
+ case "area": return new he();
171
+ case "bar": return new ve();
172
+ case "hollowCandle": return new ze();
173
+ case "baseline": return new ye();
174
+ case "renko": return new at();
175
+ case "kagi": return new He();
176
+ case "pointAndFigure": return new et();
177
+ case "volumeCandles": return new Tt();
178
+ case "equivolume": return new Pe();
179
+ case "hlcArea": return new Le();
180
+ case "stepLine": return new gt();
181
+ case "lineWithMarkers": return new Ge();
182
+ case "hiLo": return new Re();
183
+ default: return new be();
184
184
  }
185
185
  }
186
- function un(e, t, n = {}, r, i) {
186
+ function fn(e, t, n = {}, r, i) {
187
187
  if (t.length === 0) return t;
188
188
  switch (e) {
189
- case "heikinAshi": return Wt(t);
189
+ case "heikinAshi": return Kt(t);
190
190
  case "renko": {
191
191
  let e = n.renko?.boxSize;
192
- return typeof e == "number" ? Jt(t, { brickSize: e }, i) : Jt(t, {
192
+ return typeof e == "number" ? Xt(t, { brickSize: e }, i) : Xt(t, {
193
193
  brickSize: 0,
194
194
  useATR: !0,
195
195
  atrPeriod: n.renko?.atrPeriod ?? 14
196
196
  }, i);
197
197
  }
198
- case "lineBreak": return Kt(t, n.lineBreak?.lines ?? 3);
199
- case "kagi": return Gt(t, n.kagi?.reversal ?? 4, n.kagi?.reversalType ?? "percent", i);
200
- case "pointAndFigure": return fn(t, n, i).columns;
201
- case "rangeBars": return qt(t, {
202
- rangeSize: xn(t, n, r),
198
+ case "lineBreak": return Jt(t, n.lineBreak?.lines ?? 3);
199
+ case "kagi": return qt(t, n.kagi?.reversal ?? 4, n.kagi?.reversalType ?? "percent", i);
200
+ case "pointAndFigure": return mn(t, n, i).columns;
201
+ case "rangeBars": return Yt(t, {
202
+ rangeSize: Cn(t, n, r),
203
203
  includeForming: !0
204
204
  }, i);
205
205
  default: return t;
206
206
  }
207
207
  }
208
- function dn(e) {
208
+ function pn(e) {
209
209
  switch (e) {
210
210
  case "heikinAshi":
211
211
  case "renko":
@@ -217,71 +217,71 @@ function dn(e) {
217
217
  }
218
218
  }
219
219
  function L(e) {
220
- return e !== "heikinAshi" && dn(e);
220
+ return e !== "heikinAshi" && pn(e);
221
221
  }
222
- function fn(e, t = {}, n) {
223
- return Rt(e, hn(e, t), t.pointAndFigure?.reversal ?? 3, n);
222
+ function mn(e, t = {}, n) {
223
+ return Bt(e, _n(e, t), t.pointAndFigure?.reversal ?? 3, n);
224
224
  }
225
- var pn = 50, mn = .01;
226
- function hn(e, t = {}) {
225
+ var hn = 50, gn = .01;
226
+ function _n(e, t = {}) {
227
227
  let n = t.pointAndFigure?.boxSize;
228
228
  if (typeof n == "number") return n;
229
- let r = gn(e, e.length > 1 ? e.length - 1 : e.length);
230
- return r > 0 ? R(te(r / pn, !0)) : Math.abs(e[e.length - 1]?.close ?? 0) * mn || 1;
229
+ let r = vn(e, e.length > 1 ? e.length - 1 : e.length);
230
+ return r > 0 ? R(te(r / hn, !0)) : Math.abs(e[e.length - 1]?.close ?? 0) * gn || 1;
231
231
  }
232
- function gn(e, t) {
232
+ function vn(e, t) {
233
233
  let n = -Infinity, r = Infinity;
234
234
  for (let i = 0; i < t; i++) e[i].high > n && (n = e[i].high), e[i].low < r && (r = e[i].low);
235
235
  let i = n - r;
236
236
  return Number.isFinite(i) ? i : 0;
237
237
  }
238
- var _n = 100, vn = 3, yn = .01, bn = 15, R = (e) => Number(e.toPrecision(bn));
239
- function xn(e, t = {}, n) {
238
+ var yn = 100, bn = 3, xn = .01, Sn = 15, R = (e) => Number(e.toPrecision(Sn));
239
+ function Cn(e, t = {}, n) {
240
240
  let r = t.rangeBars?.range;
241
241
  if (typeof r == "number") return r;
242
- let i = e.length >= vn ? Cn(e) : 0, a = Math.abs(e[e.length - 1]?.close ?? 0);
243
- return En(R(te(i > 0 ? i : a * yn || 1, !0)), n);
242
+ let i = e.length >= bn ? Tn(e) : 0, a = Math.abs(e[e.length - 1]?.close ?? 0);
243
+ return On(R(te(i > 0 ? i : a * xn || 1, !0)), n);
244
244
  }
245
- function Sn(e) {
245
+ function wn(e) {
246
246
  let t = e.length - 1;
247
247
  return {
248
- from: Math.max(0, t - _n),
248
+ from: Math.max(0, t - yn),
249
249
  end: t
250
250
  };
251
251
  }
252
- function Cn(e) {
253
- let { from: t, end: n } = Sn(e), r = 0;
252
+ function Tn(e) {
253
+ let { from: t, end: n } = wn(e), r = 0;
254
254
  for (let i = t; i < n; i++) {
255
255
  let { high: t, low: n } = e[i], a = i > 0 ? e[i - 1].close : n;
256
256
  r += Math.max(t - n, Math.abs(t - a), Math.abs(n - a));
257
257
  }
258
258
  return n > t ? r / (n - t) : 0;
259
259
  }
260
- function wn(e, t) {
261
- let { from: n, end: r } = Sn(e);
260
+ function En(e, t) {
261
+ let { from: n, end: r } = wn(e);
262
262
  if (r <= n) return t(e[e.length - 1]?.close ?? 0);
263
263
  let i = -Infinity, a = Infinity;
264
264
  for (let t = n; t < r; t++) i = Math.max(i, e[t].high), a = Math.min(a, e[t].low);
265
- return Tn(t(i), t(a));
265
+ return Dn(t(i), t(a));
266
266
  }
267
- function Tn(e, t) {
267
+ function Dn(e, t) {
268
268
  return e === void 0 ? t : t === void 0 ? e : Math.max(e, t);
269
269
  }
270
- function En(e, t) {
270
+ function On(e, t) {
271
271
  return t === void 0 || !(t > 0) ? e : R(Math.max(1, Math.round(e / t)) * t);
272
272
  }
273
- function Dn(e, t) {
273
+ function kn(e, t) {
274
274
  let n = t?.(e);
275
- return n ? n.createRenderer() : ln(e);
275
+ return n ? n.createRenderer() : dn(e);
276
276
  }
277
- function On(e, t, n, r, i, a) {
277
+ function An(e, t, n, r, i, a) {
278
278
  if (t.length === 0) return t;
279
279
  let o = n?.(e);
280
- return o?.transform ? o.transform(t) : un(e, t, r, i, a);
280
+ return o?.transform ? o.transform(t) : fn(e, t, r, i, a);
281
281
  }
282
282
  //#endregion
283
283
  //#region src/state/AutoSaveScheduler.ts
284
- var kn = class {
284
+ var jn = class {
285
285
  timer = null;
286
286
  delayMs = 0;
287
287
  key = null;
@@ -316,7 +316,7 @@ function z(e) {
316
316
  let { open: t, high: n, low: r, close: i } = e;
317
317
  return !(!isFinite(t) || !isFinite(n) || !isFinite(r) || !isFinite(i) || t < 0 || n < 0 || r < 0 || i < 0 || n < r || e.volume !== void 0 && (!isFinite(e.volume) || e.volume < 0));
318
318
  }
319
- function An(e) {
319
+ function Mn(e) {
320
320
  return e.volume !== void 0 && e.high >= e.open && e.high >= e.close && e.low <= e.open && e.low <= e.close;
321
321
  }
322
322
  function B(e) {
@@ -327,37 +327,37 @@ function B(e) {
327
327
  volume: e.volume === void 0 ? 0 : Math.max(0, e.volume)
328
328
  };
329
329
  }
330
- function jn(e, t) {
330
+ function V(e, t) {
331
331
  return e === t || e.time === t.time && e.open === t.open && e.high === t.high && e.low === t.low && e.close === t.close && e.volume === t.volume;
332
332
  }
333
- function Mn(e, t) {
333
+ function Nn(e, t) {
334
334
  for (let n = e.length - 1; n >= 0; n--) {
335
335
  if (e[n].time === t) return n;
336
336
  if (e[n].time < t) return -1;
337
337
  }
338
338
  return -1;
339
339
  }
340
- var Nn = {
340
+ var Pn = {
341
341
  index: -1,
342
342
  changed: !1
343
343
  };
344
- function Pn(e, t) {
344
+ function Fn(e, t) {
345
345
  if (e.length === 0) return t;
346
346
  let n = x(t);
347
347
  return d(e) === 1 ? n : n / 1e3;
348
348
  }
349
- function Fn(e, t) {
350
- let n = Pn(e, t.time);
349
+ function In(e, t) {
350
+ let n = Fn(e, t.time);
351
351
  return n === t.time ? t : {
352
352
  ...t,
353
353
  time: n
354
354
  };
355
355
  }
356
- var In = class {
356
+ var H = class {
357
357
  data = [];
358
358
  changes = 0;
359
359
  withSeriesTime(e) {
360
- return Fn(this.data, e);
360
+ return In(this.data, e);
361
361
  }
362
362
  getData() {
363
363
  return this.data;
@@ -369,7 +369,7 @@ var In = class {
369
369
  let t = [];
370
370
  for (let n = 0; n < e.length; n++) {
371
371
  let r = e[n];
372
- z(r) && t.push(An(r) ? r : B(r));
372
+ z(r) && t.push(Mn(r) ? r : B(r));
373
373
  }
374
374
  this.data = t, this.changes++;
375
375
  }
@@ -378,7 +378,7 @@ var In = class {
378
378
  for (let r = 0; r < e.length; r++) {
379
379
  if (!z(e[r])) continue;
380
380
  let i = this.withSeriesTime(e[r]);
381
- i.time >= t || n.push(An(i) ? i : B(i));
381
+ i.time >= t || n.push(Mn(i) ? i : B(i));
382
382
  }
383
383
  if (n.length === 0) return 0;
384
384
  n.sort((e, t) => e.time - t.time);
@@ -399,11 +399,11 @@ var In = class {
399
399
  this.data[this.data.length - 1] = t;
400
400
  }
401
401
  replaceBar(e) {
402
- if (!z(e)) return Nn;
403
- let t = this.withSeriesTime(e), n = Mn(this.data, t.time);
404
- if (n < 0) return Nn;
402
+ if (!z(e)) return Pn;
403
+ let t = this.withSeriesTime(e), n = Nn(this.data, t.time);
404
+ if (n < 0) return Pn;
405
405
  let r = B(t);
406
- return jn(this.data[n], r) ? {
406
+ return V(this.data[n], r) ? {
407
407
  index: n,
408
408
  changed: !1
409
409
  } : (this.data[n] = r, this.changes++, {
@@ -420,12 +420,12 @@ var In = class {
420
420
  clear() {
421
421
  this.data = [], this.changes++;
422
422
  }
423
- }, V = {
423
+ }, U = {
424
424
  to: "none",
425
425
  index: -1,
426
426
  changed: !1
427
427
  };
428
- function H(e, t) {
428
+ function W(e, t) {
429
429
  let n = e[e.length - 1];
430
430
  if (!n) return "append";
431
431
  let r = x(t.time), i = x(n.time);
@@ -441,7 +441,7 @@ function Ln(e) {
441
441
  ].every(Number.isFinite);
442
442
  }
443
443
  var Rn = class {
444
- shown = new In();
444
+ shown = new H();
445
445
  whole = null;
446
446
  aside = null;
447
447
  shownRevision = 0;
@@ -553,7 +553,7 @@ var Rn = class {
553
553
  mergeTick(e) {
554
554
  if (this.aside) return this.aside.updateLastBarFromTick(e), this.wrote("aside", !1);
555
555
  let t = this.whole ? this.hoursFilter(this.whole) : null;
556
- if (t && this.whole && !t(Pn(this.whole, e.time))) return this.wrote("hidden", !1);
556
+ if (t && this.whole && !t(Fn(this.whole, e.time))) return this.wrote("hidden", !1);
557
557
  let n = this.shown.getLength();
558
558
  this.shown.updateLastBarFromTick(e);
559
559
  let r = this.whole, i = this.shown.getData()[this.shown.getLength() - 1];
@@ -565,14 +565,14 @@ var Rn = class {
565
565
  }
566
566
  placeStreamBar(e) {
567
567
  if (this.aside) {
568
- let t = H(this.aside.getData(), e);
568
+ let t = W(this.aside.getData(), e);
569
569
  return t === "append" ? this.aside.appendBar(e) : t === "update" && this.aside.updateLastBar(e), this.wrote(t === "stale" ? "none" : "aside", !1);
570
570
  }
571
- let t = this.inSeriesUnit(e), n = H(this.whole ?? this.shown.getData(), t);
571
+ let t = this.inSeriesUnit(e), n = W(this.whole ?? this.shown.getData(), t);
572
572
  if (n === "stale") return this.wrote("none", !1);
573
573
  let r = this.startWholeSeries(t, n);
574
574
  if (!this.take(t, n)) return this.wrote("hidden", r);
575
- let i = this.shown.getLength(), a = H(this.shown.getData(), t);
575
+ let i = this.shown.getLength(), a = W(this.shown.getData(), t);
576
576
  return a === "stale" ? {
577
577
  to: "none",
578
578
  before: i,
@@ -586,7 +586,7 @@ var Rn = class {
586
586
  replace(e) {
587
587
  if (this.aside) {
588
588
  let { index: t, changed: n } = this.aside.replaceBar(e);
589
- return t < 0 ? V : (n && this.onLiveChange({
589
+ return t < 0 ? U : (n && this.onLiveChange({
590
590
  kind: "bar",
591
591
  time: this.aside.getData()[t].time
592
592
  }), {
@@ -595,22 +595,22 @@ var Rn = class {
595
595
  changed: n
596
596
  });
597
597
  }
598
- if (!z(e)) return V;
599
- let t = this.inSeriesUnit(e), n = this.whole, r = n ? Mn(n, t.time) : -1;
598
+ if (!z(e)) return U;
599
+ let t = this.inSeriesUnit(e), n = this.whole, r = n ? Nn(n, t.time) : -1;
600
600
  if (n) {
601
- if (r < 0 || !z(n[r])) return V;
601
+ if (r < 0 || !z(n[r])) return U;
602
602
  let e = this.hoursFilter(n);
603
603
  if (e && !e(t.time)) return this.replaceHidden(n, r, t);
604
604
  }
605
605
  let { index: i, changed: a } = this.shown.replaceBar(t);
606
- return i < 0 ? V : (a && (n && (n[r] = this.shown.getData()[i]), this.shownRevision++), {
606
+ return i < 0 ? U : (a && (n && (n[r] = this.shown.getData()[i]), this.shownRevision++), {
607
607
  to: "shown",
608
608
  index: i,
609
609
  changed: a
610
610
  });
611
611
  }
612
612
  beginReplay() {
613
- this.aside || (this.aside = new In(), this.aside.setData(this.whole ?? this.shown.getData()));
613
+ this.aside || (this.aside = new H(), this.aside.setData(this.whole ?? this.shown.getData()));
614
614
  }
615
615
  endReplay() {
616
616
  let e = this.aside;
@@ -630,10 +630,10 @@ var Rn = class {
630
630
  this.shown.updateLastBar(e);
631
631
  }
632
632
  inSeriesUnit(e) {
633
- return Fn(this.whole ?? this.shown.getData(), e);
633
+ return In(this.whole ?? this.shown.getData(), e);
634
634
  }
635
635
  replaceHidden(e, t, n) {
636
- let r = B(n), i = !jn(e[t], r);
636
+ let r = B(n), i = !V(e[t], r);
637
637
  return i && (e[t] = r), {
638
638
  to: "hidden",
639
639
  index: -1,
@@ -707,12 +707,12 @@ var Bn = o ** -7, Vn = class {
707
707
  }
708
708
  fit(e, t, n, r) {
709
709
  if (t.length === 0) return;
710
- let i = Math.max(0, n.visibleRange.from), a = Math.min(n.visibleRange.to, t.length - 1), o = Un(Un(h(t, i, a, 0), r.overlayRange(i, a)), r.compareRange(t, n)), s = r.volumeRatio(t, i, a), c = s === null ? O : s + Bn;
710
+ let i = Math.max(0, n.visibleRange.from), a = Math.min(n.visibleRange.to, t.length - 1), o = Un(Un(h(t, i, a, 0), r.overlayRange(i, a)), r.compareRange(t, n)), s = r.volumeRatio(t, i, a), c = s === null ? k : s + Bn;
711
711
  e.setScaleMargins(e.isInvertScale() ? {
712
712
  top: c,
713
- bottom: O
713
+ bottom: k
714
714
  } : {
715
- top: O,
715
+ top: k,
716
716
  bottom: c
717
717
  }), e.fitToPrices(o.min, o.max);
718
718
  }
@@ -733,14 +733,14 @@ var Wn = class {
733
733
  series = null;
734
734
  madeAt = null;
735
735
  epoch = 0;
736
- memo = new lt();
736
+ memo = new ct();
737
737
  constructor(e) {
738
738
  this.sources = e;
739
739
  }
740
740
  get() {
741
741
  let e = this.sources.bars();
742
742
  if (e.length === 0) return e;
743
- let t = this.sources.chartType(), n = this.sources.chartTypeOptions(), r = t === "rangeBars" ? wn(e, (e) => this.sources.stepAt(e)) : void 0, i = this.sources.version(), a = this.madeAt;
743
+ let t = this.sources.chartType(), n = this.sources.chartTypeOptions(), r = t === "rangeBars" ? En(e, (e) => this.sources.stepAt(e)) : void 0, i = this.sources.version(), a = this.madeAt;
744
744
  return this.series && a && a.version === i && a.type === t && a.options === n && a.step === r && a.epoch === this.epoch ? this.series : (this.series = this.make(t, e, n, r), this.madeAt = {
745
745
  version: i,
746
746
  type: t,
@@ -757,8 +757,8 @@ var Wn = class {
757
757
  }
758
758
  make(e, t, n, r) {
759
759
  let { lookup: i } = this.sources;
760
- if (e !== "pointAndFigure" || i(e)) return On(e, t, i, n, r, this.memo);
761
- let { columns: a, boxSize: o } = fn(t, n, this.memo);
760
+ if (e !== "pointAndFigure" || i(e)) return An(e, t, i, n, r, this.memo);
761
+ let { columns: a, boxSize: o } = mn(t, n, this.memo);
762
762
  return this.sources.onBoxSize(o), a;
763
763
  }
764
764
  }, Gn = {
@@ -855,7 +855,7 @@ function qn(e) {
855
855
  function Jn(e) {
856
856
  return e.length > 0 ? { renames: e } : {};
857
857
  }
858
- var U = (e, t) => JSON.stringify(e) === JSON.stringify(t), Yn = class {
858
+ var G = (e, t) => JSON.stringify(e) === JSON.stringify(t), Yn = class {
859
859
  steps;
860
860
  snapshot;
861
861
  enabled;
@@ -877,15 +877,15 @@ var U = (e, t) => JSON.stringify(e) === JSON.stringify(t), Yn = class {
877
877
  this.renames = i;
878
878
  }
879
879
  let o = this.snapshot();
880
- return U(n, o) || this.push(e, n, o, r), a;
880
+ return G(n, o) || this.push(e, n, o, r), a;
881
881
  }
882
882
  push(e, t, n, r) {
883
- let i = this.now(), a = this.steps.last(), o = a?.type === "indicators" ? a.indicators : void 0, s = e !== void 0 && o?.subject === e && i - (o.at ?? 0) < 800 && U(o.after, t), c = {
883
+ let i = this.now(), a = this.steps.last(), o = a?.type === "indicators" ? a.indicators : void 0, s = e !== void 0 && o?.subject === e && i - (o.at ?? 0) < 800 && G(o.after, t), c = {
884
884
  type: "indicators",
885
885
  before: null,
886
886
  after: null
887
887
  };
888
- s && o ? U(o.before, n) ? this.steps.dropLast() : this.steps.replaceLast({
888
+ s && o ? G(o.before, n) ? this.steps.dropLast() : this.steps.replaceLast({
889
889
  ...c,
890
890
  indicators: {
891
891
  ...o,
@@ -926,7 +926,7 @@ var U = (e, t) => JSON.stringify(e) === JSON.stringify(t), Yn = class {
926
926
  if (!e) return;
927
927
  this.edit = null, this.depth--;
928
928
  let t = this.snapshot();
929
- U(t, e.before) || this.steps.push({
929
+ G(t, e.before) || this.steps.push({
930
930
  type: "indicators",
931
931
  before: null,
932
932
  after: null,
@@ -1098,7 +1098,7 @@ function rr(e, t) {
1098
1098
  //#region src/model/SymbolRequests.ts
1099
1099
  function ir(e, t) {
1100
1100
  let n = t.symbol;
1101
- return ut.has(e) && typeof n == "string" ? n.trim() : "";
1101
+ return lt.has(e) && typeof n == "string" ? n.trim() : "";
1102
1102
  }
1103
1103
  var ar = class {
1104
1104
  asked = /* @__PURE__ */ new Set();
@@ -1115,7 +1115,7 @@ var ar = class {
1115
1115
  }
1116
1116
  readersOf(e) {
1117
1117
  let t = e.trim();
1118
- return this.readers.getActiveIndicators().filter((e) => ut.has(e.id) && String(e.params.symbol ?? "").trim() === t).map((e) => e.instanceId);
1118
+ return this.readers.getActiveIndicators().filter((e) => lt.has(e.id) && String(e.params.symbol ?? "").trim() === t).map((e) => e.instanceId);
1119
1119
  }
1120
1120
  given(e) {
1121
1121
  this.asked.delete(e.trim());
@@ -1262,7 +1262,7 @@ var hr = class e {
1262
1262
  return i;
1263
1263
  }
1264
1264
  getTheme() {
1265
- return this.effective ??= ce(this.base, this.chartType, this.merged()), this.effective;
1265
+ return this.effective ??= se(this.base, this.chartType, this.merged()), this.effective;
1266
1266
  }
1267
1267
  getBaseTheme() {
1268
1268
  return this.base;
@@ -1373,7 +1373,7 @@ function _r(e) {
1373
1373
  }
1374
1374
  //#endregion
1375
1375
  //#region src/layout/LayoutManager.ts
1376
- var vr = 200, yr = 80, W = (e) => e.position === "top" || e.position === "bottom", br = class {
1376
+ var vr = 200, yr = 80, K = (e) => e.position === "top" || e.position === "bottom", br = class {
1377
1377
  panels = [];
1378
1378
  containerWidth = 0;
1379
1379
  containerHeight = 0;
@@ -1410,14 +1410,14 @@ var vr = 200, yr = 80, W = (e) => e.position === "top" || e.position === "bottom
1410
1410
  }
1411
1411
  setPanelCollapsed(e, t) {
1412
1412
  let n = this.panels.find((t) => t.id === e);
1413
- return !n || !W(n) || this.maximized === null && !!n.collapsed === t ? !1 : (this.maximized = null, n.collapsed = t || void 0, !0);
1413
+ return !n || !K(n) || this.maximized === null && !!n.collapsed === t ? !1 : (this.maximized = null, n.collapsed = t || void 0, !0);
1414
1414
  }
1415
1415
  isPanelCollapsed(e) {
1416
1416
  return !!this.panels.find((t) => t.id === e)?.collapsed;
1417
1417
  }
1418
1418
  isPanelShownCollapsed(e) {
1419
1419
  let t = this.panels.find((t) => t.id === e);
1420
- return !t || !W(t) ? !1 : this.maximized === null ? !!t.collapsed : this.maximized !== e;
1420
+ return !t || !K(t) ? !1 : this.maximized === null ? !!t.collapsed : this.maximized !== e;
1421
1421
  }
1422
1422
  setPanelScale(e, t) {
1423
1423
  let n = this.panels.find((t) => t.id === e);
@@ -1433,7 +1433,7 @@ var vr = 200, yr = 80, W = (e) => e.position === "top" || e.position === "bottom
1433
1433
  }
1434
1434
  setMaximizedPanel(e) {
1435
1435
  let t = e === null ? null : this.panels.find((t) => t.id === e);
1436
- return e !== null && (!t || !W(t)) || this.maximized === e ? !1 : (this.maximized = e, t && (t.collapsed = void 0), !0);
1436
+ return e !== null && (!t || !K(t)) || this.maximized === e ? !1 : (this.maximized = e, t && (t.collapsed = void 0), !0);
1437
1437
  }
1438
1438
  getMaximizedPanel() {
1439
1439
  return this.maximized;
@@ -1454,7 +1454,7 @@ var vr = 200, yr = 80, W = (e) => e.position === "top" || e.position === "bottom
1454
1454
  this.panels = [...this.panels].sort((e, n) => t(e) - t(n));
1455
1455
  }
1456
1456
  shownSize(e, t) {
1457
- return W(e) ? this.maximized ? e.id === this.maximized ? t : 20 : e.collapsed ? 20 : e.size : e.size;
1457
+ return K(e) ? this.maximized ? e.id === this.maximized ? t : 20 : e.collapsed ? 20 : e.size : e.size;
1458
1458
  }
1459
1459
  setPanelPosition(e, t) {
1460
1460
  let r = this.panels.find((t) => t.id === e);
@@ -1466,7 +1466,7 @@ var vr = 200, yr = 80, W = (e) => e.position === "top" || e.position === "bottom
1466
1466
  setPanelSize(e, t) {
1467
1467
  let n = this.panels.find((t) => t.id === e);
1468
1468
  if (n) {
1469
- let e = W(n) ? this.containerHeight - c - 48 : this.containerWidth / 2, r = e > n.minSize ? Math.min(t, e) : t;
1469
+ let e = K(n) ? this.containerHeight - c - 48 : this.containerWidth / 2, r = e > n.minSize ? Math.min(t, e) : t;
1470
1470
  n.size = Math.max(n.minSize, r), n.collapsed = void 0, this.maximized = null;
1471
1471
  }
1472
1472
  }
@@ -1635,7 +1635,7 @@ var Dr = 512, Or = class {
1635
1635
  function jr(e, t) {
1636
1636
  return e.filter((e) => e.enabled !== !1 && (e.descriptor.layer ?? "overlay") === t);
1637
1637
  }
1638
- function G(e) {
1638
+ function q(e) {
1639
1639
  switch (e.kind) {
1640
1640
  case "indicator": return `indicator:${e.plugin.descriptor.id}`;
1641
1641
  case "drawing": return `drawing:${e.plugin.descriptor.type}`;
@@ -1645,18 +1645,18 @@ function G(e) {
1645
1645
  }
1646
1646
  //#endregion
1647
1647
  //#region src/plugins/registry.ts
1648
- var K = /* @__PURE__ */ new Map();
1648
+ var J = /* @__PURE__ */ new Map();
1649
1649
  function Mr(e) {
1650
- K.set(G(e), e);
1650
+ J.set(q(e), e);
1651
1651
  }
1652
1652
  function Nr(e) {
1653
- return K.delete(e);
1653
+ return J.delete(e);
1654
1654
  }
1655
1655
  function Pr() {
1656
- return [...K.values()];
1656
+ return [...J.values()];
1657
1657
  }
1658
1658
  function Fr() {
1659
- K.clear();
1659
+ J.clear();
1660
1660
  }
1661
1661
  //#endregion
1662
1662
  //#region src/plugins/PluginManager.ts
@@ -1691,7 +1691,7 @@ var Ir = class {
1691
1691
  return e;
1692
1692
  }
1693
1693
  add(e) {
1694
- this.plugins.set(G(e), e), e.kind === "indicator" && this.indicatorEngine.register(e.plugin);
1694
+ this.plugins.set(q(e), e), e.kind === "indicator" && this.indicatorEngine.register(e.plugin);
1695
1695
  }
1696
1696
  }, Lr = {
1697
1697
  orderPlace: (e, t) => e.placeOrder(t),
@@ -1933,7 +1933,7 @@ function ei(e, t) {
1933
1933
  }
1934
1934
  return r;
1935
1935
  }
1936
- function q(e, t, n) {
1936
+ function Y(e, t, n) {
1937
1937
  let r = [], i = e.bar.time;
1938
1938
  for (let a of e.points) {
1939
1939
  if (a.at > n) break;
@@ -1956,17 +1956,17 @@ var ti = [
1956
1956
  "1d"
1957
1957
  ];
1958
1958
  function ni(e, t) {
1959
- let n = T(e);
1959
+ let n = E(e);
1960
1960
  return n > 0 ? ti.filter((e) => {
1961
- let r = T(e);
1961
+ let r = E(e);
1962
1962
  return r < n && n % r === 0 && t(e);
1963
1963
  }) : [];
1964
1964
  }
1965
1965
  function ri(e, t, n) {
1966
1966
  let r = ni(t, n);
1967
1967
  if (e !== "auto") return r.includes(e) ? e : null;
1968
- let i = T(t);
1969
- return r.find((e) => i / T(e) <= 60) ?? null;
1968
+ let i = E(t);
1969
+ return r.find((e) => i / E(e) <= 60) ?? null;
1970
1970
  }
1971
1971
  //#endregion
1972
1972
  //#region src/model/AlertWatch.ts
@@ -2025,7 +2025,7 @@ function li(e, t, n, r, i) {
2025
2025
  continue;
2026
2026
  }
2027
2027
  let t = {
2028
- ...Bt(a),
2028
+ ...Ht(a),
2029
2029
  ...a.target ? { target: si(a.target, n) } : {}
2030
2030
  };
2031
2031
  try {
@@ -2052,7 +2052,7 @@ var ui = class {
2052
2052
  return this.kept.clear(), this.alerts.pruneDrawingAlerts(e);
2053
2053
  }
2054
2054
  };
2055
- function J(e, t) {
2055
+ function di(e, t) {
2056
2056
  let n = 0, r = e.length;
2057
2057
  for (; n < r;) {
2058
2058
  let i = n + r >> 1;
@@ -2060,7 +2060,7 @@ function J(e, t) {
2060
2060
  }
2061
2061
  return n;
2062
2062
  }
2063
- function Y(e, t) {
2063
+ function fi(e, t) {
2064
2064
  let n = 0, r = e.length;
2065
2065
  for (; n < r;) {
2066
2066
  let i = n + r >> 1;
@@ -2068,18 +2068,18 @@ function Y(e, t) {
2068
2068
  }
2069
2069
  return n;
2070
2070
  }
2071
- function di(e) {
2071
+ function pi(e) {
2072
2072
  let t = 0, n = 0;
2073
2073
  for (let r = 1; r < e.length; r++) e[r].low < e[t].low && (t = r), e[r].high > e[n].high && (n = r);
2074
2074
  let r = [e[t].low, e[t].time], i = [e[n].high, e[n].time], a = t === n ? e[t].close >= e[t].open : t < n, o = e[e.length - 1];
2075
2075
  return [...a ? [r, i] : [i, r], [o.close, o.time]];
2076
2076
  }
2077
- function fi(e) {
2077
+ function mi(e) {
2078
2078
  let t = [], n = Math.ceil(e.length / 500);
2079
- for (let r = 0; r < e.length; r += n) t.push(...di(e.slice(r, r + n)));
2079
+ for (let r = 0; r < e.length; r += n) t.push(...pi(e.slice(r, r + n)));
2080
2080
  return t;
2081
2081
  }
2082
- function pi(e, t, n) {
2082
+ function hi(e, t, n) {
2083
2083
  let r = e[t];
2084
2084
  return r ? n.time === null ? {
2085
2085
  marks: [[r.close, r.time]],
@@ -2088,14 +2088,14 @@ function pi(e, t, n) {
2088
2088
  fraction: n.fraction
2089
2089
  }
2090
2090
  } : r.time <= n.time ? null : {
2091
- marks: fi(e.slice(Y(e, n.time), t + 1)),
2091
+ marks: mi(e.slice(fi(e, n.time), t + 1)),
2092
2092
  fed: {
2093
2093
  time: r.time,
2094
2094
  fraction: n.fraction
2095
2095
  }
2096
2096
  } : null;
2097
2097
  }
2098
- function mi(e, t, n, r, i, a) {
2098
+ function gi(e, t, n, r, i, a) {
2099
2099
  let o = e[t];
2100
2100
  if (!o) return null;
2101
2101
  let s = {
@@ -2108,37 +2108,37 @@ function mi(e, t, n, r, i, a) {
2108
2108
  };
2109
2109
  if (o.time < i.time || o.time === i.time && r <= i.fraction) return null;
2110
2110
  if (o.time === i.time) return {
2111
- marks: q(n, i.fraction, r),
2111
+ marks: Y(n, i.fraction, r),
2112
2112
  fed: s
2113
2113
  };
2114
- let c = [], l = J(e, i.time);
2115
- return e[l]?.time === i.time && i.fraction < 1 && c.push(...q(a(e, l), i.fraction, 1)), c.push(...fi(e.slice(Y(e, i.time), t))), c.push(...q(n, -1, r)), {
2114
+ let c = [], l = di(e, i.time);
2115
+ return e[l]?.time === i.time && i.fraction < 1 && c.push(...Y(a(e, l), i.fraction, 1)), c.push(...mi(e.slice(fi(e, i.time), t))), c.push(...Y(n, -1, r)), {
2116
2116
  marks: c,
2117
2117
  fed: s
2118
2118
  };
2119
2119
  }
2120
2120
  //#endregion
2121
2121
  //#region src/Chart.ts
2122
- var hi = "exchange", gi = hi;
2123
- function _i(e) {
2122
+ var _i = "exchange", vi = _i;
2123
+ function yi(e) {
2124
2124
  if (typeof e == "string" && e !== "exchange" && !b(e)) throw RangeError(`Unknown time zone: ${e}`);
2125
2125
  if (typeof e == "number" && !Number.isFinite(e)) throw RangeError(`Invalid UTC offset: ${e}`);
2126
2126
  }
2127
- function vi(e, t) {
2128
- let { timeZone: n, timezone: r } = e, i = n !== void 0 && r !== void 0 && n !== r && n === t ? r : w(e);
2127
+ function bi(e, t) {
2128
+ let { timeZone: n, timezone: r } = e, i = n !== void 0 && r !== void 0 && n !== r && n === t ? r : T(e);
2129
2129
  return i === void 0 ? e : {
2130
2130
  ...e,
2131
2131
  timeZone: i,
2132
2132
  timezone: i
2133
2133
  };
2134
2134
  }
2135
- var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2135
+ var xi = .08, Si = 20, Ci = 8, wi = 10, Ti = {
2136
2136
  ArrowLeft: [-1, 0],
2137
2137
  ArrowRight: [1, 0],
2138
2138
  ArrowUp: [0, -1],
2139
2139
  ArrowDown: [0, 1]
2140
- }, wi = new Set(["horizontalLine", "crossLine"]), Ti = new Set(["verticalLine", "crossLine"]), Ei = class {
2141
- static version = "1.81.0";
2140
+ }, Ei = new Set(["horizontalLine", "crossLine"]), Di = new Set(["verticalLine", "crossLine"]), Oi = class {
2141
+ static version = "1.83.0";
2142
2142
  engine;
2143
2143
  viewport;
2144
2144
  series = new Rn((e) => this.sessionKeep(e), (e) => this.followLiveChange(e));
@@ -2179,7 +2179,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2179
2179
  unrestoredIndicators = [];
2180
2180
  drawingAlerts = null;
2181
2181
  zoomAreaMode = !1;
2182
- priceAxisAddButton = new rt();
2182
+ priceAxisAddButton = new nt();
2183
2183
  displayTz = null;
2184
2184
  timeZoneSetting = null;
2185
2185
  symbolInfo = null;
@@ -2190,7 +2190,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2190
2190
  studyZoneReleaseQueued = !1;
2191
2191
  sessionBreaks;
2192
2192
  sessionShading;
2193
- hostSessionHours = { ...je };
2193
+ hostSessionHours = { ...Ae };
2194
2194
  compareRenderer;
2195
2195
  countdownInterval = null;
2196
2196
  pausedFor = {
@@ -2209,7 +2209,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2209
2209
  signalMarkerManager;
2210
2210
  tradeZoneManager;
2211
2211
  measureOverlay;
2212
- selectionBoxOverlay = new ft();
2212
+ selectionBoxOverlay = new dt();
2213
2213
  replayManager;
2214
2214
  replayBarUnsub = null;
2215
2215
  replaySeeking = !1;
@@ -2224,7 +2224,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2224
2224
  replayForming = null;
2225
2225
  replayPhaseUnsub = null;
2226
2226
  undoRedoManager;
2227
- autoSaveScheduler = new kn((e) => this.saveState(e));
2227
+ autoSaveScheduler = new jn((e) => this.saveState(e));
2228
2228
  animator;
2229
2229
  crosshairTooltip;
2230
2230
  pinnedTooltip;
@@ -2236,14 +2236,14 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2236
2236
  disposed = !1;
2237
2237
  chartTypeOptions = {};
2238
2238
  mainSeriesVisible = !0;
2239
- priceLines = new it();
2240
- symbolSeries = new yt();
2239
+ priceLines = new rt();
2240
+ symbolSeries = new vt();
2241
2241
  extendedHours = !0;
2242
2242
  replayRestarting = !1;
2243
2243
  symbolRequests;
2244
2244
  gridRenderer;
2245
2245
  priceAxis;
2246
- leftPriceAxis = new nt();
2246
+ leftPriceAxis = new tt();
2247
2247
  leftScaleRequested = !1;
2248
2248
  leftAxisWidth = s;
2249
2249
  leftViewport = null;
@@ -2274,7 +2274,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2274
2274
  snapshotKey = null;
2275
2275
  historyCheckQueued = !1;
2276
2276
  constructor(e, t) {
2277
- t.timeZone != null && _i(t.timeZone), this.container = e, this.options = {
2277
+ t.timeZone != null && yi(t.timeZone), this.container = e, this.options = {
2278
2278
  ...t,
2279
2279
  chartType: t.chartType ?? "candlestick"
2280
2280
  }, this.numberLocale = t.numberLocale ?? "en-US", this.priceFit = new Vn(t.autoScale !== !1), this.display = new Wn({
@@ -2285,7 +2285,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2285
2285
  lookup: (e) => this.pluginManager.getChartType(e),
2286
2286
  stepAt: (e) => this.stepAt(e),
2287
2287
  onBoxSize: (e) => {
2288
- this.chartRenderer instanceof tt && this.chartRenderer.setBoxSize(e);
2288
+ this.chartRenderer instanceof et && this.chartRenderer.setBoxSize(e);
2289
2289
  }
2290
2290
  });
2291
2291
  let n = t.features ?? {};
@@ -2310,6 +2310,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2310
2310
  legend: n.legend ?? !0,
2311
2311
  indicatorValueLabels: n.indicatorValueLabels ?? !1,
2312
2312
  alignAxisLabels: n.alignAxisLabels ?? !0,
2313
+ drawingAxisSpans: n.drawingAxisSpans ?? !0,
2313
2314
  volume: n.volume ?? !0,
2314
2315
  watermark: n.watermark ?? !0,
2315
2316
  saveLoad: n.saveLoad ?? !0,
@@ -2327,15 +2328,15 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2327
2328
  oldestTime: () => (this.replaySession ? this.series.liveBars() : this.series.bars())[0]?.time ?? null,
2328
2329
  prepend: (e) => this.prependBars(e),
2329
2330
  emit: (e) => this.eventBus.emit("historyLoad", e)
2330
- }), this.themeManager = new hr(t.theme), this.themeManager.setChartType(this.options.chartType ?? "candlestick"), this.applyStyle(_r(t), "host", !1), this.container.style.backgroundColor || (this.container.style.backgroundColor = this.themeManager.getTheme().background, this.lastBackground = this.themeManager.getTheme().background), this.layoutManager = new br(), this.indicatorEngine = new Ve(), this.panes = new Kn(this.layoutManager, this.indicatorEngine, (e) => this.crosshairHandler.setReportBounds(e)), this.indicatorPanes = new Xn(this.indicatorEngine, this.layoutManager, {
2331
+ }), this.themeManager = new hr(t.theme), this.themeManager.setChartType(this.options.chartType ?? "candlestick"), this.applyStyle(_r(t), "host", !1), this.container.style.backgroundColor || (this.container.style.backgroundColor = this.themeManager.getTheme().background, this.lastBackground = this.themeManager.getTheme().background), this.layoutManager = new br(), this.indicatorEngine = new Be(), this.panes = new Kn(this.layoutManager, this.indicatorEngine, (e) => this.crosshairHandler.setReportBounds(e)), this.indicatorPanes = new Xn(this.indicatorEngine, this.layoutManager, {
2331
2332
  passStyle: (e, t) => this.panes.passStyle(e, t),
2332
2333
  renamePane: (e, t) => this.renamePane(e, t),
2333
2334
  invalidateScales: () => this.panes.invalidateScales()
2334
- }), this.symbolRequests = new ar(this.indicatorEngine, this.symbolSeries), this.pluginManager = new Ir(this.indicatorEngine, { plugins: t.plugins }), this.eventBus = new Ie(), Ht(this.indicatorEngine), this.indicatorEngine.register(new we(this.symbolSeries)), this.indicatorEngine.register(new Te(this.symbolSeries)), this.indicatorEngine.register(new gt(this.symbolSeries)), this.indicatorEngine.register(new Ee(this.symbolSeries)), this.indicatorEngine.register(new De(this.symbolSeries)), this.drawingManager = new Ne(), Vt(this.drawingManager), this.drawingRenderer = new Pe(this.drawingManager), this.drawingRenderer.setKeepOut(() => this.legendKeepOut()), this.drawingRenderer.setTimeFormat((e) => this.crosshairHandler.formatTime(e, this.getDisplayData())), this.drawingManager.setRequestRender(() => {
2335
+ }), this.symbolRequests = new ar(this.indicatorEngine, this.symbolSeries), this.pluginManager = new Ir(this.indicatorEngine, { plugins: t.plugins }), this.eventBus = new Fe(), Wt(this.indicatorEngine), this.indicatorEngine.register(new Ce(this.symbolSeries)), this.indicatorEngine.register(new we(this.symbolSeries)), this.indicatorEngine.register(new ht(this.symbolSeries)), this.indicatorEngine.register(new Te(this.symbolSeries)), this.indicatorEngine.register(new Ee(this.symbolSeries)), this.drawingManager = new Me(), Ut(this.drawingManager), this.drawingRenderer = new Ne(this.drawingManager), this.drawingRenderer.setKeepOut(() => this.legendKeepOut()), this.drawingRenderer.setTimeFormat((e) => this.crosshairHandler.formatTime(e, this.getDisplayData())), this.drawingManager.setRequestRender(() => {
2335
2336
  this.syncRenderContext(), this.engine.requestRender(i.Overlay), this.scheduleAutoSave();
2336
2337
  }), this.drawingManager.setEventCallback((e, t) => {
2337
2338
  this.followDrawingAlerts(e, t?.id), this.eventBus.emit(e, t), (e === "drawingCreate" || e === "drawingUpdate" || e === "drawingRemove") && this.announceStateChange();
2338
- }), this.drawingManager.setToolFilter((e) => this.features.drawings && (this.features.drawingTools.length === 0 || this.features.drawingTools.includes(e))), this.undoRedoManager = new wt(), this.indicatorHistory = new Yn({
2339
+ }), this.drawingManager.setToolFilter((e) => this.features.drawings && (this.features.drawingTools.length === 0 || this.features.drawingTools.includes(e))), this.undoRedoManager = new Ct(), this.indicatorHistory = new Yn({
2339
2340
  steps: this.undoRedoManager,
2340
2341
  snapshot: () => this.getIndicatorSetup(),
2341
2342
  enabled: () => this.features.drawingUndoRedo
@@ -2352,23 +2353,23 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2352
2353
  primary: e[0] ?? null
2353
2354
  })), this.drawingManager.setForeignHistory((e, t) => {
2354
2355
  e.type === "custom" ? e.custom?.[t]() : this.applyIndicatorStep(e, t);
2355
- }), this.drawingManager.setDataGetter(() => this.series.bars(), () => this.series.revision()), this.drawingManager.setDisplayDataGetter(() => this.getDisplayData()), t.crosshair?.mode === "magnet" && this.features.drawingMagnet && this.drawingManager.setMagnetMode("magnet"), this.tradingManager = new St({
2356
+ }), this.drawingManager.setDataGetter(() => this.series.bars(), () => this.series.revision()), this.drawingManager.setDisplayDataGetter(() => this.getDisplayData()), t.crosshair?.mode === "magnet" && this.features.drawingMagnet && this.drawingManager.setMagnetMode("magnet"), this.tradingManager = new xt({
2356
2357
  enabled: this.features.trading,
2357
2358
  contextMenu: { enabled: this.features.tradingContextMenu }
2358
- }), this.tradingRenderer = new Ct(this.tradingManager), this.tradingManager.setContainer(e), this.tradingManager.setRequestRender(() => this.engine.requestRender(i.Overlay)), this.tradingManager.setEventCallback((e, t) => {
2359
+ }), this.tradingRenderer = new St(this.tradingManager), this.tradingManager.setContainer(e), this.tradingManager.setRequestRender(() => this.engine.requestRender(i.Overlay)), this.tradingManager.setEventCallback((e, t) => {
2359
2360
  this.eventBus.emit(e, t);
2360
- }), this.engine = new at(e, t.maxPixelRatio);
2361
+ }), this.engine = new it(e, t.maxPixelRatio);
2361
2362
  let a = this.engine.dprManager.getContainerSize();
2362
- if (this.viewport = new Tt(a.width, a.height, t.minBarSpacing ?? 2, t.maxBarSpacing ?? 30, t.rightMargin ?? 5), t.barLayout && this.viewport.setBarLayout(t.barLayout), this.viewport.setPanLimits({
2363
+ if (this.viewport = new wt(a.width, a.height, t.minBarSpacing ?? 2, t.maxBarSpacing ?? 30, t.rightMargin ?? 5), t.barLayout && this.viewport.setBarLayout(t.barLayout), this.viewport.setPanLimits({
2363
2364
  freePan: t.freePan ?? !0,
2364
2365
  minVisibleBars: t.panLimits?.minVisibleBars ?? 3
2365
2366
  }), t.minBarUnit !== void 0 && this.viewport.setMinBarUnit(t.minBarUnit), this.layoutManager.resize(a.width, a.height), this.engine.onContainerResize = (e) => {
2366
2367
  if (e.width <= 0 || e.height <= 0) return;
2367
2368
  let t = this.viewport.isAtEnd();
2368
2369
  this.viewport.resize(e.width, e.height), this.layoutManager.resize(e.width, e.height), this.updateViewportAndRender(t), this.eventBus.emit("resize", e);
2369
- }, this.chartRenderer = this.createChartRenderer(this.options.chartType), this.gridRenderer = new Le(), t.grid?.visible === !1 && this.gridRenderer.setVisible(!1), this.priceAxis = new nt(), this.priceAxis.setLocale(this.numberLocale), this.leftPriceAxis.setLocale(this.numberLocale), this.viewport.setNumberLocale(this.numberLocale), this.timeAxis = new bt(), this.timeAxis.setLocale(this.numberLocale), this.crosshairHandler = new Oe(), this.crosshairHandler.setLocale(this.numberLocale), this.applyTimeSpacing(), t.crosshair?.mode && this.crosshairHandler.setMode(t.crosshair.mode), this.crosshairHandler.setDataSource(() => this.crosshairSeries()), this.crosshairHandler.setCallback((e, t) => {
2370
+ }, this.chartRenderer = this.createChartRenderer(this.options.chartType), this.gridRenderer = new Ie(), t.grid?.visible === !1 && this.gridRenderer.setVisible(!1), this.priceAxis = new tt(), this.priceAxis.setLocale(this.numberLocale), this.leftPriceAxis.setLocale(this.numberLocale), this.viewport.setNumberLocale(this.numberLocale), this.timeAxis = new yt(), this.timeAxis.setLocale(this.numberLocale), this.crosshairHandler = new De(), this.crosshairHandler.setLocale(this.numberLocale), this.applyTimeSpacing(), t.crosshair?.mode && this.crosshairHandler.setMode(t.crosshair.mode), Ft(t.crosshair?.cursor) && this.crosshairHandler.setCursor(t.crosshair.cursor), this.crosshairHandler.setDataSource(() => this.crosshairSeries()), this.crosshairHandler.setCallback((e, t) => {
2370
2371
  if (e !== null && t) {
2371
- let n = this.crosshairSeries(), r = e >= 0 && e < n.length ? n[e] : void 0, a = e > 0 ? n[e - 1]?.close : void 0, o = A(n), s = r ? o[e]?.time ?? r.time : void 0;
2372
+ let n = this.crosshairSeries(), r = e >= 0 && e < n.length ? n[e] : void 0, a = e > 0 ? n[e - 1]?.close : void 0, o = At(n), s = r ? o[e]?.time ?? r.time : void 0;
2372
2373
  this.chartLegend.setHoverBar(r ?? null, e > 0 ? n[e - 1] ?? null : null), this.features.legend && this.engine.requestRender(i.Hover);
2373
2374
  let c = this.viewport.getState(), l = t.y >= c.chartRect.y && t.y <= c.chartRect.y + c.chartRect.height;
2374
2375
  if (r && l && this.features.crosshairTooltip) {
@@ -2396,14 +2397,14 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2396
2397
  let e = this.crosshairHandler.getSyncedSlot();
2397
2398
  e !== null && this.showSyncedBar(e);
2398
2399
  }
2399
- }), this.chartLegend = new Se(), this.chartLegend.setChartType(this.options.chartType), this.chartLegend.setLocale(this.numberLocale), this.chartLegend.setResizeListener(() => {
2400
+ }), this.chartLegend = new xe(), this.chartLegend.setChartType(this.options.chartType), this.chartLegend.setLocale(this.numberLocale), this.chartLegend.setResizeListener(() => {
2400
2401
  this.eventBus.emit("legendResize", { bottom: this.getLegendBottom() }), this.engine.requestRender();
2401
- }), this.watermark = new kt(), t.watermark && this.watermark.setConfig(t.watermark), this.volumeRenderer = new Ot(), this.volumeProfile = new Dt(), this.marketProfile = new qe(), this.depthHeatmap = new Me(), this.periodLevels = new Qe(), this.pivotMarkers = new et(), this.barCountdown = new ve(), this.barCountdown.setVisible(this.features.barCountdown), this.sessionBreaks = new pt(), this.sessionShading = new mt(), this.compareRenderer = new Ce(), t.sessionBreaks ? this.sessionBreaks.setConfig({
2402
+ }), this.watermark = new Ot(), t.watermark && this.watermark.setConfig(t.watermark), this.volumeRenderer = new Dt(), this.volumeProfile = new Et(), this.marketProfile = new Ke(), this.depthHeatmap = new je(), this.periodLevels = new Ze(), this.pivotMarkers = new $e(), this.barCountdown = new _e(), this.barCountdown.setVisible(this.features.barCountdown), this.sessionBreaks = new ft(), this.sessionShading = new pt(), this.compareRenderer = new Se(), t.sessionBreaks ? this.sessionBreaks.setConfig({
2402
2403
  visible: t.sessionBreaks.visible ?? !0,
2403
2404
  color: t.sessionBreaks.color,
2404
2405
  lineStyle: t.sessionBreaks.lineStyle,
2405
2406
  lineWidth: t.sessionBreaks.lineWidth
2406
- }) : t.features?.sessionBreaks !== !1 && this.sessionBreaks.setVisible(!0), t.logScale && this.features.logScale && this.viewport.setLogScale(!0), this.animator = new he(), this.crosshairTooltip = new ke(), this.crosshairTooltip.create(e), this.crosshairTooltip.setLocale(this.numberLocale), this.pinnedTooltip = new $e(), this.pinnedTooltip.create(e), this.pinnedTooltip.setLocale(this.numberLocale), t.priceFormat && this.applyPriceFormat(t.priceFormat), t.chartTypeOptions && (this.chartTypeOptions = ae(t.chartTypeOptions)), t.highLowLines && this.priceLines.setHighLow(!0), t.shapes && this.themeManager.setShape(Ai(t.shapes)), t.font && this.themeManager.setFont(ki(t.font)), this.priceLines.setPriceText((e) => this.formatPrice(e)), t.extendedHours === !1 && (this.extendedHours = !1), t.timeFormatter && this.applyTimeFormatter(t.timeFormatter), this.keyboardHandler = new We({
2407
+ }) : t.features?.sessionBreaks !== !1 && this.sessionBreaks.setVisible(!0), t.logScale && this.features.logScale && this.viewport.setLogScale(!0), this.animator = new me(), this.crosshairTooltip = new Oe(), this.crosshairTooltip.create(e), this.crosshairTooltip.setLocale(this.numberLocale), this.pinnedTooltip = new Qe(), this.pinnedTooltip.create(e), this.pinnedTooltip.setLocale(this.numberLocale), t.priceFormat && this.applyPriceFormat(t.priceFormat), t.chartTypeOptions && (this.chartTypeOptions = C(t.chartTypeOptions)), t.highLowLines && this.priceLines.setHighLow(!0), t.shapes && this.themeManager.setShape(Mi(t.shapes)), t.font && this.themeManager.setFont(ji(t.font)), this.priceLines.setPriceText((e) => this.formatPrice(e)), t.extendedHours === !1 && (this.extendedHours = !1), t.timeFormatter && this.applyTimeFormatter(t.timeFormatter), this.keyboardHandler = new Ue({
2407
2408
  scrollBars: (e) => {
2408
2409
  let t = this.viewport.getState().barWidth + this.viewport.getState().barSpacing;
2409
2410
  this.viewport.scrollBy(e * t), this.updateViewportAndRender();
@@ -2420,7 +2421,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2420
2421
  },
2421
2422
  fitContent: () => this.fitContent()
2422
2423
  }), this.keyboardHandler.setEnabled(this.features.keyboard), t.a11y !== !1) {
2423
- this.a11y = new on(e, {
2424
+ this.a11y = new cn(e, {
2424
2425
  symbol: () => this.currentSymbol || this.symbolInfo?.symbol || "",
2425
2426
  timeframe: () => this.streamTimeframe ?? "",
2426
2427
  chartType: () => this.options.chartType ?? "candlestick",
@@ -2451,7 +2452,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2451
2452
  }
2452
2453
  this.keyboardHandler.handleKey(e) && (e.preventDefault(), this.a11y?.viewMoved());
2453
2454
  }
2454
- }, window.addEventListener("keydown", this.onWindowKeyDown), this.currentPriceLine = new Ae(), this.currentPriceLine.setLocale(this.numberLocale), this.priceAxis.setReservedPriceProvider(() => this.currentPriceLine.isVisible() ? this.currentPriceLine.getPrice() : null), this.alertManager = new me(), this.alertManager.setDrawingLevels((e) => this.drawingLevelsNow(e)), this.alertManager.setRequestRender(() => this.engine.requestRender(i.Overlay)), this.drawingAlerts = new ui(this.alertManager), this.compareRenderer.setReservedLevels(() => this.alertManager.getAlerts().filter(Pt).map((e) => e.price)), this.alertManager.on("triggered", (e) => {
2455
+ }, window.addEventListener("keydown", this.onWindowKeyDown), this.currentPriceLine = new ke(), this.currentPriceLine.setLocale(this.numberLocale), this.priceAxis.setReservedPriceProvider(() => this.currentPriceLine.isVisible() ? this.currentPriceLine.getPrice() : null), this.alertManager = new pe(), this.alertManager.setDrawingLevels((e) => this.drawingLevelsNow(e)), this.alertManager.setRequestRender(() => this.engine.requestRender(i.Overlay)), this.drawingAlerts = new ui(this.alertManager), this.compareRenderer.setReservedLevels(() => this.alertManager.getAlerts().filter(It).map((e) => e.price)), this.alertManager.on("triggered", (e) => {
2455
2456
  this.eventBus.emit("alertTriggered", X(e)), this.eventBus.emit("dataUpdate", {
2456
2457
  kind: "alert",
2457
2458
  alert: "triggered",
@@ -2467,7 +2468,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2467
2468
  this.eventBus.emit("alertExpired", X(e));
2468
2469
  }), this.alertManager.on("updated", (e) => {
2469
2470
  this.eventBus.emit("alertUpdate", X(e));
2470
- }), this.signalMarkerManager = new ht(), this.signalMarkerManager.setRequestRender(() => this.engine.requestRender(i.Overlay)), this.signalMarkerManager.setDataGetter(() => this.series.bars()), this.signalMarkerManager.on("added", (e) => {
2471
+ }), this.signalMarkerManager = new mt(), this.signalMarkerManager.setRequestRender(() => this.engine.requestRender(i.Overlay)), this.signalMarkerManager.setDataGetter(() => this.series.bars()), this.signalMarkerManager.on("added", (e) => {
2471
2472
  this.eventBus.emit("signalMarkerAdd", {
2472
2473
  id: e.id,
2473
2474
  source: e.source,
@@ -2475,14 +2476,14 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2475
2476
  });
2476
2477
  }), this.signalMarkerManager.on("removed", (e) => {
2477
2478
  this.eventBus.emit("signalMarkerRemove", { id: e });
2478
- }), this.tradeZoneManager = new xt(), this.tradeZoneManager.setRequestRender(() => this.engine.requestRender(i.Overlay)), this.tradeZoneManager.setDataGetter(() => this.series.bars()), this.tradeZoneManager.on("added", (e) => {
2479
+ }), this.tradeZoneManager = new bt(), this.tradeZoneManager.setRequestRender(() => this.engine.requestRender(i.Overlay)), this.tradeZoneManager.setDataGetter(() => this.series.bars()), this.tradeZoneManager.on("added", (e) => {
2479
2480
  this.eventBus.emit("tradeZoneAdd", {
2480
2481
  id: e.id,
2481
2482
  direction: e.direction
2482
2483
  });
2483
2484
  }), this.tradeZoneManager.on("removed", (e) => {
2484
2485
  this.eventBus.emit("tradeZoneRemove", { id: e });
2485
- }), this.replayManager = new st(), this.replayManager.on("complete", () => {
2486
+ }), this.replayManager = new ot(), this.replayManager.on("complete", () => {
2486
2487
  let e = this.getReplayBarIndex(), t = this.replayCoarse?.[e];
2487
2488
  t && this.eventBus.emit("replayComplete", {
2488
2489
  barIndex: e,
@@ -2490,9 +2491,9 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2490
2491
  });
2491
2492
  }), this.replayManager.on("stateChange", (e) => {
2492
2493
  this.replayRestarting || this.eventBus.emit("replayState", { state: e });
2493
- }), this.measureOverlay = new Je(), this.interactionManager = new He(e), this.features.panning) {
2494
+ }), this.measureOverlay = new qe(), this.interactionManager = new Ve(e), this.features.panning) {
2494
2495
  let e = new kr();
2495
- this.interactionManager.setPanHandler(new Xe((t, n) => {
2496
+ this.interactionManager.setPanHandler(new Ye((t, n) => {
2496
2497
  t && this.viewport.scrollBy(t), e.step(t, n, this.priceFit.isAuto()) && n && (this.holdPriceScale(), this.viewport.panPriceRange(n)), this.updateViewportAndRender();
2497
2498
  }, () => e.reset()));
2498
2499
  }
@@ -2504,10 +2505,10 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2504
2505
  scales: !this.indicatorEngine.hasLeftScaleOverlays()
2505
2506
  }
2506
2507
  })), this.features.zooming) {
2507
- this.interactionManager.setZoomHandler(new At((e, t) => {
2508
+ this.interactionManager.setZoomHandler(new kt((e, t) => {
2508
2509
  this.viewport.zoom(e, t - this.viewport.getState().chartRect.x), this.updateViewportAndRender();
2509
2510
  }));
2510
- let e = new _e((e) => {
2511
+ let e = new ge((e) => {
2511
2512
  this.holdPriceScale(), this.viewport.scalePriceRange(e), this.syncRenderContext(), this.engine.requestRender(), this.emitViewportEvents();
2512
2513
  }, (e) => {
2513
2514
  let t = this.viewport.getState().chartRect.width;
@@ -2517,7 +2518,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2517
2518
  e === "price" ? (this.priceFit.resume(), this.updateViewportAndRender()) : this.fitContent();
2518
2519
  });
2519
2520
  }
2520
- if (this.features.crosshair && this.interactionManager.setCrosshairHandler(this.crosshairHandler), this.features.drawings && (this.interactionManager.setDrawingManager(this.drawingManager, () => ({
2521
+ if (this.features.crosshair && (this.interactionManager.setCrosshairHandler(this.crosshairHandler), this.applyIdleCursor()), this.features.drawings && (this.interactionManager.setDrawingManager(this.drawingManager, () => ({
2521
2522
  ...this.viewport.getState(),
2522
2523
  data: this.getDisplayData()
2523
2524
  })), this.drawingManager.setPanes({
@@ -2532,7 +2533,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2532
2533
  y: t.y
2533
2534
  });
2534
2535
  })), this.interactionManager.setChartContextMenu((e, t) => this.eventBus.hasListeners("chartContextMenu") ? (this.eventBus.emit("chartContextMenu", this.contextAt(e, t)), !0) : !1), this.applyPriceAxisAdd(), this.interactionManager.setPriceAxisAddButton(this.priceAxisAddButton, (e) => {
2535
- let t = Zt(e.y, this.viewport.getState());
2536
+ let t = $t(e.y, this.viewport.getState());
2536
2537
  Number.isFinite(t) && this.eventBus.emit("priceAxisAdd", {
2537
2538
  price: t,
2538
2539
  x: e.x,
@@ -2542,10 +2543,10 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2542
2543
  ...this.viewport.getState(),
2543
2544
  data: this.getDisplayData()
2544
2545
  })), this.features.alerts) {
2545
- let e = new pe(this.alertManager, () => this.viewport.getState());
2546
+ let e = new fe(this.alertManager, () => this.viewport.getState());
2546
2547
  this.interactionManager.setAlertDragHandler(e);
2547
2548
  }
2548
- let o = new Ze();
2549
+ let o = new Xe();
2549
2550
  o.configure(() => this.getResolvedLayout(), (e, t) => this.setPanelSize(e, t)), this.interactionManager.setPaneResizeHandler(o), this.interactionManager.setAltClickHandler((e) => {
2550
2551
  let t = this.getDisplayData();
2551
2552
  if (t.length === 0) return;
@@ -2569,7 +2570,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2569
2570
  x: e.x,
2570
2571
  y: e.y
2571
2572
  }), t.length === 0) return;
2572
- let r = Xt(e.x, this.viewport.getState());
2573
+ let r = Qt(e.x, this.viewport.getState());
2573
2574
  r < 0 || r >= t.length || this.eventBus.emit("barClick", {
2574
2575
  bar: t[r],
2575
2576
  barIndex: r,
@@ -2614,7 +2615,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2614
2615
  end: () => {
2615
2616
  let e = this.selectionBoxOverlay.end();
2616
2617
  if (e && this.zoomAreaMode) {
2617
- if (e.x1 - e.x0 < xi) return;
2618
+ if (e.x1 - e.x0 < Ci) return;
2618
2619
  this.zoomToBox(e), this.setZoomAreaMode(!1);
2619
2620
  return;
2620
2621
  }
@@ -2696,13 +2697,13 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2696
2697
  let { visibleRange: e, chartRect: t } = this.viewport.getState();
2697
2698
  if (t.width <= 0) return;
2698
2699
  let { from: n, to: r } = e;
2699
- this.history.maybeLoad(Math.max(0, Math.floor(n)), Math.max(bi, r - n));
2700
+ this.history.maybeLoad(Math.max(0, Math.floor(n)), Math.max(Si, r - n));
2700
2701
  }));
2701
2702
  }
2702
2703
  useStreamHistory(e, t, n = !0) {
2703
2704
  if (this.hostHistoryLoader) return;
2704
2705
  let r = P(e), i = r.fetchHistoryBefore, a = this.streamTimeframe;
2705
- if (!i || a === null || de(a) !== null) {
2706
+ if (!i || a === null || ue(a) !== null) {
2706
2707
  this.historyFromStream && this.history.setLoader(null), this.historyFromStream = !1;
2707
2708
  return;
2708
2709
  }
@@ -2797,11 +2798,11 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2797
2798
  setChartTypeOptions(e) {
2798
2799
  this.chartTypeOptions = {
2799
2800
  ...this.chartTypeOptions,
2800
- ...ae(e)
2801
+ ...C(e)
2801
2802
  }, this.updateViewportAndRender(!0), this.fitFewColumns(), this.a11y?.refresh(!0), this.markStateChanged();
2802
2803
  }
2803
2804
  getChartTypeOptions() {
2804
- return ae(this.chartTypeOptions);
2805
+ return C(this.chartTypeOptions);
2805
2806
  }
2806
2807
  setExtendedHours(e) {
2807
2808
  e !== this.extendedHours && (this.extendedHours = e, this.reapplyExtendedHours(), this.markStateChanged());
@@ -2810,7 +2811,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2810
2811
  return this.extendedHours;
2811
2812
  }
2812
2813
  sessionKeep(e) {
2813
- return this.extendedHours ? null : en(this.symbolInfo, e);
2814
+ return this.extendedHours ? null : nn(this.symbolInfo, e);
2814
2815
  }
2815
2816
  reapplyExtendedHours() {
2816
2817
  if (!this.series.refilter()) return;
@@ -2821,7 +2822,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2821
2822
  return this.priceLines.setQuoteShown(this.replaySession === null), this.priceLines;
2822
2823
  }
2823
2824
  setShapes(e) {
2824
- let t = Ai(e);
2825
+ let t = Mi(e);
2825
2826
  t.tagRadius !== void 0 && (this.themeManager.setShape({
2826
2827
  ...this.themeManager.getTheme().shape,
2827
2828
  ...t
@@ -2833,7 +2834,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2833
2834
  setFont(e) {
2834
2835
  if (e === null) this.themeManager.setFont(null);
2835
2836
  else {
2836
- let t = ki(e);
2837
+ let t = ji(e);
2837
2838
  if (Object.keys(t).length === 0) return;
2838
2839
  this.themeManager.setFont(t);
2839
2840
  }
@@ -2949,8 +2950,8 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2949
2950
  return {
2950
2951
  ...e,
2951
2952
  priceRange: {
2952
- min: t.min - n * yi,
2953
- max: t.max + n * yi
2953
+ min: t.min - n * xi,
2954
+ max: t.max + n * xi
2954
2955
  },
2955
2956
  logScale: !1,
2956
2957
  scaleMode: "regular",
@@ -2997,7 +2998,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
2997
2998
  this.indicatorEngine.setStyleDefaults(e, null);
2998
2999
  return;
2999
3000
  }
3000
- let { plots: n, ...r } = t, i = n === void 0 ? void 0 : oe(n);
3001
+ let { plots: n, ...r } = t, i = n === void 0 ? void 0 : ae(n);
3001
3002
  this.indicatorEngine.setStyleDefaults(e, {
3002
3003
  ...r,
3003
3004
  ...i ? { plots: i } : {}
@@ -3005,7 +3006,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3005
3006
  }
3006
3007
  setPaneStyle(e, t) {
3007
3008
  let n = this.indicatorPanes.paneOf(e);
3008
- this.layoutManager.getPanels().some((e) => e.id === n) && this.indicatorHistory.record(n, () => this.setPaneStyleNow(n, t ? se(t) : null));
3009
+ this.layoutManager.getPanels().some((e) => e.id === n) && this.indicatorHistory.record(n, () => this.setPaneStyleNow(n, t ? oe(t) : null));
3009
3010
  }
3010
3011
  setPaneStyleNow(e, t) {
3011
3012
  this.panes.setStyle(e, t) && (this.syncRenderContext(), this.engine.requestRender(), this.markStateChanged());
@@ -3024,8 +3025,8 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3024
3025
  return this.pluginManager;
3025
3026
  }
3026
3027
  static indicators() {
3027
- let e = new Ve();
3028
- return Ht(e), e.getAvailableIndicators();
3028
+ let e = new Be();
3029
+ return Wt(e), e.getAvailableIndicators();
3029
3030
  }
3030
3031
  setPanelPosition(e, t) {
3031
3032
  this.layoutManager.setPanelPosition(e, t), this.updateViewportAndRender(), this.eventBus.emit("indicatorChange", {
@@ -3112,6 +3113,12 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3112
3113
  isAxisLabelsAligned() {
3113
3114
  return this.features.alignAxisLabels;
3114
3115
  }
3116
+ setDrawingAxisSpansVisible(e) {
3117
+ this.features.drawingAxisSpans = e, this.syncRenderContext(), this.engine.requestRender();
3118
+ }
3119
+ isDrawingAxisSpansVisible() {
3120
+ return this.features.drawingAxisSpans;
3121
+ }
3115
3122
  setPaneTitlesVisible(e) {
3116
3123
  this.paneTitles = e, this.engine.requestRender();
3117
3124
  }
@@ -3145,7 +3152,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3145
3152
  roundPrice(e) {
3146
3153
  if (!Number.isFinite(e)) return e;
3147
3154
  let t = this.stepAt(e);
3148
- if (t !== void 0) return Number((Math.round(e / t) * t).toFixed(ue(t)));
3155
+ if (t !== void 0) return Number((Math.round(e / t) * t).toFixed(le(t)));
3149
3156
  let { min: n, max: r } = this.viewport.getState().priceRange;
3150
3157
  return Number(e.toFixed(this.marketPricePrecision ?? l(n, r)));
3151
3158
  }
@@ -3242,9 +3249,9 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3242
3249
  return this.drawingManager.removeDrawings(e);
3243
3250
  }
3244
3251
  nudgeSelectedDrawings(e) {
3245
- let t = Ci[e.key];
3252
+ let t = Ti[e.key];
3246
3253
  if (!t || !this.features.drawings || e.ctrlKey || e.metaKey || e.altKey) return !1;
3247
- let n = e.shiftKey ? Si : 1, r = {
3254
+ let n = e.shiftKey ? wi : 1, r = {
3248
3255
  ...this.viewport.getState(),
3249
3256
  data: this.getDisplayData()
3250
3257
  };
@@ -3385,7 +3392,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3385
3392
  x: t.x,
3386
3393
  y: t.y
3387
3394
  };
3388
- if ((e === "plot" || e === "priceAxis") && (r.price = Zt(t.y, n)), (e === "plot" || e === "timeAxis") && n.data.length > 0 && (r.time = F(t.x, n)), e === "pane") {
3395
+ if ((e === "plot" || e === "priceAxis") && (r.price = $t(t.y, n)), (e === "plot" || e === "timeAxis") && n.data.length > 0 && (r.time = F(t.x, n)), e === "pane") {
3389
3396
  let e = this.getIndicatorPanes().find((e) => t.y >= e.rect.y && t.y <= e.rect.y + e.rect.height);
3390
3397
  e && (r.pane = e.instanceId);
3391
3398
  }
@@ -3393,7 +3400,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3393
3400
  }
3394
3401
  applyPriceAxisAdd() {
3395
3402
  let e = this.features.priceAxisAddButton && this.features.crosshair;
3396
- this.priceAxisAddButton.setEnabled(e), this.tradingManager.setTagInset(e ? Ye : 0);
3403
+ this.priceAxisAddButton.setEnabled(e), this.tradingManager.setTagInset(e ? Je : 0);
3397
3404
  }
3398
3405
  setPriceAxisAddButton(e) {
3399
3406
  this.features.priceAxisAddButton = e, this.applyPriceAxisAdd(), this.engine.requestRender(i.Overlay);
@@ -3484,11 +3491,11 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3484
3491
  }
3485
3492
  getExportText(e = "csv", t = {}) {
3486
3493
  let { bars: n, columns: r } = this.getExportData(t);
3487
- return e === "json" ? D.toJSON(n, r) : D.toCSV(n, r);
3494
+ return e === "json" ? O.toJSON(n, r) : O.toCSV(n, r);
3488
3495
  }
3489
3496
  download(e, t, n) {
3490
3497
  let r = this.getExportText(e, n);
3491
- e === "json" ? D.download(r, t ?? "chart-data.json", "application/json") : D.download(r, t ?? "chart-data.csv", "text/csv");
3498
+ e === "json" ? O.download(r, t ?? "chart-data.json", "application/json") : O.download(r, t ?? "chart-data.csv", "text/csv");
3492
3499
  }
3493
3500
  setAutoSave(e, t = 5e3) {
3494
3501
  this.autoSaveScheduler.enable(e, t);
@@ -3550,7 +3557,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3550
3557
  this.indicatorHistory.record(e, () => this.updateIndicatorStyleNow(e, t));
3551
3558
  }
3552
3559
  updateIndicatorStyleNow(e, t) {
3553
- let { plots: n, ...r } = t, i = n === void 0 ? void 0 : oe(n);
3560
+ let { plots: n, ...r } = t, i = n === void 0 ? void 0 : ae(n);
3554
3561
  this.indicatorEngine.updateIndicatorStyle(e, {
3555
3562
  ...r,
3556
3563
  ...i ? { plots: i } : {}
@@ -3663,11 +3670,11 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3663
3670
  async connect(e) {
3664
3671
  let t = {
3665
3672
  ...e,
3666
- adapter: Ut(e),
3673
+ adapter: Gt(e),
3667
3674
  feed: void 0
3668
3675
  };
3669
3676
  if (!j(t.adapter, t.timeframe)) throw RangeError(`${t.adapter.name} cannot serve the ${t.timeframe} timeframe`);
3670
- this.snapshotKey = null, this.holdReplayFor(t.symbol), this.disconnectStream(), this.streamManager = new vt(), this.streamManager.setTimeZone(this.studyZoneHeld ? this.studyZone : this.getExchangeTimeZone()), this.streamManager.on("snapshot", (e) => {
3677
+ this.snapshotKey = null, this.holdReplayFor(t.symbol), this.disconnectStream(), this.streamManager = new _t(), this.streamManager.setTimeZone(this.studyZoneHeld ? this.studyZone : this.getExchangeTimeZone()), this.streamManager.on("snapshot", (e) => {
3671
3678
  let n = this.streamSeriesKey(t.adapter);
3672
3679
  n === this.snapshotKey && this.replaySession ? this.series.mergeSnapshot(e) : n === this.snapshotKey && this.series.length() > 0 ? this.mergeSnapshot(e) : (this.replaySession && this.useStreamHistory(t.adapter, t.historyPageSize, !1), this.setData(e)), this.snapshotKey = n, this.useStreamHistory(t.adapter, t.historyPageSize);
3673
3680
  }), this.streamManager.on("barClose", (e) => {
@@ -3723,18 +3730,18 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3723
3730
  }), this.streamManager.on("symbolInfo", (e) => this.applyFeedSymbolInfo(e)), this.autoScrollOnNewBar = t.autoScroll !== !1, this.setStreamTarget(t.symbol, t.timeframe), this.streamAdapter = t.adapter;
3724
3731
  let n = this.streamManager;
3725
3732
  if (this.resolveStreamSymbol(t.adapter, t.symbol), await n.connect(t), this.streamManager !== n) return;
3726
- let r = T(t.timeframe);
3733
+ let r = E(t.timeframe);
3727
3734
  this.barCountdown.setTimeframeMs(r), this.countdownInterval && clearInterval(this.countdownInterval), this.countdownInterval = setInterval(() => {
3728
3735
  this.barCountdown.isVisible() && this.engine.requestRender(i.Hover);
3729
3736
  }, 1e3);
3730
3737
  }
3731
3738
  streamSeriesKey(e) {
3732
- let t = P(e), n = this.streamTimeframe, r = t instanceof ct && n !== null ? t.bucketFor(this.currentSymbol, n) : null;
3739
+ let t = P(e), n = this.streamTimeframe, r = t instanceof st && n !== null ? t.bucketFor(this.currentSymbol, n) : null;
3733
3740
  return `${this.currentSymbol}|${n}|${r?.timeZone ?? ""}`;
3734
3741
  }
3735
3742
  setStreamTarget(e, t) {
3736
3743
  let n = this.announcedSymbol;
3737
- this.currentSymbol = e, this.streamTimeframe = t, this.tickStream = de(t) !== null, this.applyTimeSpacing(), e !== n && this.chartLegend.setSymbol(e), e !== n && (this.announcedSymbol = e, this.eventBus.emit("symbolChange", {
3744
+ this.currentSymbol = e, this.streamTimeframe = t, this.tickStream = ue(t) !== null, this.applyTimeSpacing(), e !== n && this.chartLegend.setSymbol(e), e !== n && (this.announcedSymbol = e, this.eventBus.emit("symbolChange", {
3738
3745
  symbol: e,
3739
3746
  previous: n
3740
3747
  })), this.useTimeframe(t);
@@ -3753,7 +3760,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3753
3760
  if (!this.streamManager) return;
3754
3761
  let n = this.streamAdapter;
3755
3762
  if (n && !j(n, t)) throw RangeError(`${n.name} cannot serve the ${t} timeframe`);
3756
- this.holdReplayFor(e), this.setStreamTarget(e, t), this.historyFromStream && this.history.setLoader(null), this.barCountdown.setTimeframeMs(T(t)), n && this.resolveStreamSymbol(n, e), await this.streamManager.switchTo(e, t);
3763
+ this.holdReplayFor(e), this.setStreamTarget(e, t), this.historyFromStream && this.history.setLoader(null), this.barCountdown.setTimeframeMs(E(t)), n && this.resolveStreamSymbol(n, e), await this.streamManager.switchTo(e, t);
3757
3764
  }
3758
3765
  isIndicatorAllowed(e) {
3759
3766
  let t = this.features.indicatorIds;
@@ -3903,7 +3910,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
3903
3910
  setVisibleRangePreset(e) {
3904
3911
  let t = this.getDisplayData();
3905
3912
  if (t.length === 0) return;
3906
- let n = t.length - 1, r = d(t), i = zt(e, t[n].time * r, this.displayTz), a = i === null ? null : i / r;
3913
+ let n = t.length - 1, r = d(t), i = Vt(e, t[n].time * r, this.displayTz), a = i === null ? null : i / r;
3907
3914
  if (a === null || a < t[0].time) {
3908
3915
  this.fitContent();
3909
3916
  return;
@@ -4030,7 +4037,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4030
4037
  this.eventBus.disableTauriBridge();
4031
4038
  }
4032
4039
  setTheme(e) {
4033
- this.themeManager.setTheme(e), this.syncRenderContext(), this.container.style.backgroundColor = this.themeManager.getTheme().background, this.lastBackground = this.themeManager.getTheme().background, this.engine.requestRender(), this.eventBus.emit("themeChange", { theme: e }), this.markStateChanged();
4040
+ this.themeManager.setTheme(e), this.syncRenderContext(), this.applyIdleCursor(), this.container.style.backgroundColor = this.themeManager.getTheme().background, this.lastBackground = this.themeManager.getTheme().background, this.engine.requestRender(), this.eventBus.emit("themeChange", { theme: e }), this.markStateChanged();
4034
4041
  }
4035
4042
  getTheme() {
4036
4043
  return this.themeManager.getBaseTheme();
@@ -4062,7 +4069,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4062
4069
  i.length > 0 && console.warn(`Style overrides left out (unknown key or value): ${i.join(", ")}`), this.themeManager.applyOverrides(r, t) && n && this.styleChanged(t);
4063
4070
  }
4064
4071
  styleChanged(e) {
4065
- this.syncRenderContext();
4072
+ this.syncRenderContext(), this.applyIdleCursor();
4066
4073
  let t = this.themeManager.getTheme().background;
4067
4074
  t !== this.lastBackground && (this.container.style.backgroundColor = t, this.lastBackground = t), this.engine.requestRender(), this.eventBus.emit("styleChange", { layer: e }), e === "user" && this.markStateChanged();
4068
4075
  }
@@ -4087,6 +4094,16 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4087
4094
  getCrosshairMode() {
4088
4095
  return this.crosshairHandler.getMode();
4089
4096
  }
4097
+ setCrosshairCursor(e) {
4098
+ !Ft(e) || e === this.crosshairHandler.getCursor() || (this.crosshairHandler.setCursor(e), this.applyIdleCursor(), this.engine.requestRender(i.Hover), this.eventBus.emit("crosshairCursorChange", { cursor: e }));
4099
+ }
4100
+ getCrosshairCursor() {
4101
+ return this.crosshairHandler.getCursor();
4102
+ }
4103
+ applyIdleCursor() {
4104
+ let e = this.themeManager.getTheme(), t = e.style?.crosshair.vertical.color ?? e.crosshair;
4105
+ this.interactionManager.setIdleCursor(Pt(this.crosshairHandler.getCursor(), t, e.background));
4106
+ }
4090
4107
  setCrosshairPosition(e) {
4091
4108
  e ? this.crosshairHandler.onPointerMove(e) : this.crosshairHandler.onPointerLeave(), this.engine.requestRender(i.Hover);
4092
4109
  }
@@ -4101,7 +4118,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4101
4118
  }
4102
4119
  let t = this.crosshairSeries(), n = e >= 0 && e < t.length ? t[e] : void 0, r = n && e > 0 ? t[e - 1] : void 0;
4103
4120
  this.crosshairHandler.getPosition() || this.chartLegend.setHoverBar(n ?? null, r ?? null);
4104
- let i = n ? A(t)[e]?.time ?? n.time : void 0;
4121
+ let i = n ? At(t)[e]?.time ?? n.time : void 0;
4105
4122
  this.eventBus.emit("crosshairSync", {
4106
4123
  barIndex: e,
4107
4124
  ...n ? { bar: n } : {},
@@ -4180,7 +4197,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4180
4197
  return this.periodLevels.getPeriod();
4181
4198
  }
4182
4199
  setTimeZone(e) {
4183
- _i(e), this.timeZoneSetting = e, this.applyTimeZone();
4200
+ yi(e), this.timeZoneSetting = e, this.applyTimeZone();
4184
4201
  }
4185
4202
  getTimeZone() {
4186
4203
  return this.timeZoneSetting;
@@ -4189,7 +4206,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4189
4206
  return this.displayTz;
4190
4207
  }
4191
4208
  getExchangeTimeZone() {
4192
- return [w(this.symbolInfo), this.marketConfig?.timeZone].find((e) => e && b(e)) ?? null;
4209
+ return [T(this.symbolInfo), this.marketConfig?.timeZone].find((e) => e && b(e)) ?? null;
4193
4210
  }
4194
4211
  setTimezone(e) {
4195
4212
  this.setTimeZone(e);
@@ -4216,7 +4233,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4216
4233
  this.indicatorEngine.setExchangeTimeZone(e, t.length > 0 ? t : void 0) && t.length > 0 && this.announceIndicatorUpdate(0);
4217
4234
  }
4218
4235
  holdStudyZone() {
4219
- this.endStudyZoneWait(), this.studyZoneHeld = !0, this.studyZoneTimer = setTimeout(() => this.releaseStudyZone(), dt);
4236
+ this.endStudyZoneWait(), this.studyZoneHeld = !0, this.studyZoneTimer = setTimeout(() => this.releaseStudyZone(), ut);
4220
4237
  }
4221
4238
  endStudyZoneWait() {
4222
4239
  this.studyZoneReleaseQueued = !1, this.studyZoneTimer !== null && (clearTimeout(this.studyZoneTimer), this.studyZoneTimer = null);
@@ -4231,7 +4248,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4231
4248
  }
4232
4249
  spokenBarTime(e) {
4233
4250
  let t = this.getDisplayData(), n = e * d(t), r = this.numberLocale || "en-US";
4234
- return f(t) === !0 ? fe(r, { dateStyle: "medium" }, u(n, this.displayTz, this.getExchangeTimeZone()))(n) : fe(r, {
4251
+ return f(t) === !0 ? de(r, { dateStyle: "medium" }, u(n, this.displayTz, this.getExchangeTimeZone()))(n) : de(r, {
4235
4252
  dateStyle: "medium",
4236
4253
  timeStyle: "short"
4237
4254
  }, this.displayTz)(n);
@@ -4244,18 +4261,18 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4244
4261
  this.studyZoneHeld = !1, this.endStudyZoneWait(), this.useSymbolInfo(e);
4245
4262
  }
4246
4263
  useSymbolInfo(e) {
4247
- let t = e && this.symbolInfo?.symbol === e.symbol ? w(this.symbolInfo) : void 0;
4248
- this.symbolInfo = e ? vi({
4264
+ let t = e && this.symbolInfo?.symbol === e.symbol ? T(this.symbolInfo) : void 0;
4265
+ this.symbolInfo = e ? bi({
4249
4266
  ...e,
4250
4267
  sessions: e.sessions?.map((e) => ({ ...e }))
4251
4268
  }, t) : null, this.chartLegend.setExchange(this.symbolInfo?.exchange ?? ""), this.engine.requestRender(i.Hover), this.priceAxis.setPriceTick(this.symbolInfo?.minTick ?? null), this.marketConfig?.pricePrecision === void 0 && this.applyPricePrecision(this.symbolInfo?.pricePrecision ?? null);
4252
4269
  let n = (this.symbolInfo?.sessions ?? []).flatMap((e) => {
4253
- let t = C(e.start), n = C(e.end);
4270
+ let t = w(e.start), n = w(e.end);
4254
4271
  return t === null || n === null ? [] : [{
4255
4272
  startMinute: t,
4256
4273
  endMinute: n
4257
4274
  }];
4258
- }), r = w(this.symbolInfo);
4275
+ }), r = T(this.symbolInfo);
4259
4276
  this.sessionShading.replaceConfig(n.length > 0 && r && b(r) ? {
4260
4277
  timeZone: r,
4261
4278
  windows: n,
@@ -4270,11 +4287,11 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4270
4287
  if (!e || typeof e != "object") return;
4271
4288
  let t = this.currentSymbol, n = (e) => !e || e.toUpperCase() === t.toUpperCase();
4272
4289
  if (!n(e.symbol)) return;
4273
- let r = this.symbolInfo && n(this.symbolInfo.symbol) ? this.symbolInfo : null, i = vi({
4290
+ let r = this.symbolInfo && n(this.symbolInfo.symbol) ? this.symbolInfo : null, i = bi({
4274
4291
  ...r,
4275
4292
  ...e,
4276
4293
  symbol: e.symbol || r?.symbol || t
4277
- }, w(r));
4294
+ }, T(r));
4278
4295
  r && JSON.stringify(i) === JSON.stringify(r) || (this.symbolInfoSeq++, this.setSymbolInfo(i));
4279
4296
  }
4280
4297
  resolveStreamSymbol(e, t) {
@@ -4309,7 +4326,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4309
4326
  return this.sessionShading.isVisible();
4310
4327
  }
4311
4328
  setSessionShadingConfig(e) {
4312
- this.hostSessionHours = Lt(this.hostSessionHours, e), this.sessionShading.replaceConfig(this.hostSessionHours), this.engine.requestRender(i.Background);
4329
+ this.hostSessionHours = zt(this.hostSessionHours, e), this.sessionShading.replaceConfig(this.hostSessionHours), this.engine.requestRender(i.Background);
4313
4330
  }
4314
4331
  setTooltipVisible(e) {
4315
4332
  e || this.crosshairTooltip.hide();
@@ -4331,11 +4348,11 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4331
4348
  return this.waitForGpu(null), e === "canvas" ? (this.applyRenderer(null), "canvas") : this.engine.getGpu() ? "webgl" : this.takeGpu(e, t, !0);
4332
4349
  }
4333
4350
  async takeGpu(e, t, n) {
4334
- let { gpu: r, reason: i } = await It(e);
4351
+ let { gpu: r, reason: i } = await Rt(e);
4335
4352
  return t !== this.rendererToken || this.disposed ? (r?.destroy(), this.getRenderer()) : i === "limit" ? Nt() > 0 ? this.takeGpu(e, t, n) : (this.waitForGpu(() => void this.takeGpu(e, t, !1)), n && this.applyRenderer(null, "limit"), this.getRenderer()) : ((r || n) && this.applyRenderer(r, i), this.getRenderer());
4336
4353
  }
4337
4354
  waitForGpu(e) {
4338
- this.stopWaitingForGpu?.(), this.stopWaitingForGpu = e ? Yt(e) : null;
4355
+ this.stopWaitingForGpu?.(), this.stopWaitingForGpu = e ? Zt(e) : null;
4339
4356
  }
4340
4357
  getRenderer() {
4341
4358
  return this.engine.getGpu() ? "webgl" : "canvas";
@@ -4357,7 +4374,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4357
4374
  this.engine.getGpu() && this.engine.renderNow();
4358
4375
  }
4359
4376
  screenshot(e) {
4360
- this.features.screenshot && (this.freshFrame(), k.download(this.container, e, this.themeManager.getTheme().background));
4377
+ this.features.screenshot && (this.freshFrame(), A.download(this.container, e, this.themeManager.getTheme().background));
4361
4378
  }
4362
4379
  async copyScreenshot() {
4363
4380
  if (!this.features.screenshot) return !1;
@@ -4365,7 +4382,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4365
4382
  if (!t?.write || !e) return !1;
4366
4383
  try {
4367
4384
  this.freshFrame();
4368
- let n = k.toBlob(this.container, this.themeManager.getTheme().background).then((e) => {
4385
+ let n = A.toBlob(this.container, this.themeManager.getTheme().background).then((e) => {
4369
4386
  if (!e) throw Error("No chart image to copy");
4370
4387
  return e;
4371
4388
  });
@@ -4383,10 +4400,10 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4383
4400
  }
4384
4401
  }
4385
4402
  screenshotDataURL() {
4386
- return this.features.screenshot ? (this.freshFrame(), k.toDataURL(this.container, this.themeManager.getTheme().background)) : null;
4403
+ return this.features.screenshot ? (this.freshFrame(), A.toDataURL(this.container, this.themeManager.getTheme().background)) : null;
4387
4404
  }
4388
4405
  async screenshotBlob() {
4389
- return this.features.screenshot ? (this.freshFrame(), k.toBlob(this.container, this.themeManager.getTheme().background)) : null;
4406
+ return this.features.screenshot ? (this.freshFrame(), A.toBlob(this.container, this.themeManager.getTheme().background)) : null;
4390
4407
  }
4391
4408
  addAlert(e, t = "crossing", n, r = "price", i, a = {}) {
4392
4409
  if (!this.features.alerts) return null;
@@ -4505,24 +4522,24 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4505
4522
  let t = this.replaySession ? this.replayOffset : 0;
4506
4523
  if (!this.replaySession) {
4507
4524
  if (this.series.length() === 0) return;
4508
- this.series.beginReplay(), this.replaySession = Fi(this.currentSymbol);
4525
+ this.series.beginReplay(), this.replaySession = Li(this.currentSymbol);
4509
4526
  }
4510
4527
  let n = this.replaySession, { steps: r, startTime: i, hideHistory: a, revealMarks: o, step: s, ...c } = e ?? {};
4511
4528
  c.animate = c.animate === !0;
4512
4529
  let l = this.series.inHoursShown(this.series.liveBars()), u = t > 0 && i === void 0 && a !== !1, d = c.startIndex;
4513
- i !== void 0 && d === void 0 ? d = J(l, i) : u && d !== void 0 && (d += t);
4530
+ i !== void 0 && d === void 0 ? d = di(l, i) : u && d !== void 0 && (d += t);
4514
4531
  let f = u ? t : a && d !== void 0 && d > 0 ? Math.min(Math.floor(d), l.length - 1) : 0, p = f > 0 ? l.slice(f) : l;
4515
4532
  d !== void 0 && (c.startIndex = d - f), n.windowTime = f > 0 ? p[0]?.time ?? null : null, n.steps = r ?? null, n.stepsSymbol = this.currentSymbol, n.until = null, n.animate = c.animate, n.step = c.animate ? s ?? null : null, this.replayRevealMarks = o !== !1, this.useReplayLoader(n, !0);
4516
4533
  let m = r ? this.replayStepsOver(n, p, !0) : null;
4517
4534
  this.priceFit.resume(), this.buildReplay(p, m, f);
4518
4535
  let h = this.replayStepsSeries;
4519
- h && c.startIndex !== void 0 && (c.startIndex = Hi(h, p, c.startIndex));
4536
+ h && c.startIndex !== void 0 && (c.startIndex = Gi(h, p, c.startIndex));
4520
4537
  let g = h ?? p, _ = g[Math.max(0, Math.min(Math.floor(Number(c.startIndex ?? 0)) || 0, g.length - 1))];
4521
4538
  this.revealReplayMarks(this.replayRevealMarks ? _?.time ?? null : null), n.held && (n.held.state = c.paused ? "paused" : "playing", c.paused = !0), !c.paused && c.startIndex !== void 0 && c.startIndex >= 1 && this.replaySeek(c.startIndex - 1), this.replayManager.play(c);
4522
4539
  }
4523
4540
  buildReplay(e, t, n) {
4524
4541
  let r = this.replaySession?.animate === !0, i = r ? null : t;
4525
- this.replayPieces = r && t ? Gi(t, e) : null, this.replayForming = null, this.replayOffset = n, this.replayStepsSeries = i, this.replayCoarse = e;
4542
+ this.replayPieces = r && t ? Ji(t, e) : null, this.replayForming = null, this.replayOffset = n, this.replayStepsSeries = i, this.replayCoarse = e;
4526
4543
  let a = this.replayRestarting;
4527
4544
  this.replayRestarting = !0;
4528
4545
  try {
@@ -4536,7 +4553,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4536
4553
  let n = t, a = e[t];
4537
4554
  if (i) {
4538
4555
  let r = i[t];
4539
- n = Q(e, r.time), c = c !== null && s === t - 1 && n === o - 1 && c ? qi(c, r) : Ui(e[n], i, t), a = Wi(i, e, t, n) ? e[n] : c;
4556
+ n = Z(e, r.time), c = c !== null && s === t - 1 && n === o - 1 && c ? Xi(c, r) : Ki(e[n], i, t), a = qi(i, e, t, n) ? e[n] : c;
4540
4557
  }
4541
4558
  let u = this.replayForming;
4542
4559
  this.replayForming = null, s = t;
@@ -4560,7 +4577,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4560
4577
  });
4561
4578
  }), r && (this.replayPhaseUnsub = this.replayManager.on("phase", ({ index: t, fraction: n }) => {
4562
4579
  if (!e[t] || this.series.length() !== o || o !== t && o !== t + 1) return;
4563
- let r = this.replayForming?.index === t ? this.replayForming.path : this.replayPathOf(e, t), i = Ki() ? ei(r, n) : n, a = o === t, s = a && this.autoScrollOnNewBar && this.viewport.isAtEnd(), c = $r(r, i);
4580
+ let r = this.replayForming?.index === t ? this.replayForming.path : this.replayPathOf(e, t), i = Yi() ? ei(r, n) : n, a = o === t, s = a && this.autoScrollOnNewBar && this.viewport.isAtEnd(), c = $r(r, i);
4564
4581
  a ? this.series.appendReplayed(c) : this.series.updateReplayed(c), o = t + 1, this.replayForming = {
4565
4582
  index: t,
4566
4583
  path: r
@@ -4585,15 +4602,15 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4585
4602
  if (!n) return;
4586
4603
  n.evictBefore(e[t].time);
4587
4604
  let r = this.replayManager.getStepMs();
4588
- n.ensure(e, t, Number.isFinite(r) && r > 0 ? Math.ceil(ji / r) : 1);
4605
+ n.ensure(e, t, Number.isFinite(r) && r > 0 ? Math.ceil(Ni / r) : 1);
4589
4606
  }
4590
4607
  useReplayLoader(e, t) {
4591
4608
  let n = this.streamAdapter, r = this.streamTimeframe, i = e.step && n && r !== null ? ri(e.step, r, (e) => j(n, e)) : null, a = `${this.currentSymbol}|${r}|${i}`;
4592
4609
  if (!t && this.replayLoader?.key === a || (this.replayLoader?.loader.dispose(), this.replayLoader = null, !i || !n || r === null)) return;
4593
- let o = P(n), s = o.fetchHistoryBefore, c = this.currentSymbol, l = T(r), u = new Vr({
4610
+ let o = P(n), s = o.fetchHistoryBefore, c = this.currentSymbol, l = E(r), u = new Vr({
4594
4611
  source: s ? (e, t) => s.call(o, c, i, e, t) : null,
4595
4612
  step: i,
4596
- ratio: Math.max(1, Math.round(l / T(i))),
4613
+ ratio: Math.max(1, Math.round(l / E(i))),
4597
4614
  barMs: l,
4598
4615
  keep: (e) => this.series.inHoursShown(e),
4599
4616
  report: (e) => this.eventBus.emit("replayStepsLoad", e)
@@ -4606,7 +4623,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4606
4623
  feedReplayForming(e, t, n, r) {
4607
4624
  let i = this.replaySession;
4608
4625
  if (!i || !this.executionAdapter?.setMarkPrice) return;
4609
- let a = mi(e, t, n, r, {
4626
+ let a = gi(e, t, n, r, {
4610
4627
  time: i.fedTime,
4611
4628
  fraction: i.fedFraction
4612
4629
  }, (e, t) => this.replayPathOf(e, t));
@@ -4628,9 +4645,9 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4628
4645
  if (!t) return;
4629
4646
  let n = this.series.inHoursShown(this.series.liveBars());
4630
4647
  if (n.length === 0) return;
4631
- let r = t.windowTime === null ? 0 : Math.min(J(n, t.windowTime), n.length - 1), i = r > 0 ? n.slice(r) : n;
4648
+ let r = t.windowTime === null ? 0 : Math.min(di(n, t.windowTime), n.length - 1), i = r > 0 ? n.slice(r) : n;
4632
4649
  this.useReplayLoader(t, !1);
4633
- let a = this.replayStepsOver(t, i), o = t.animate ? null : a, s = t.until === null ? 0 : Ri(o ?? i, t.until);
4650
+ let a = this.replayStepsOver(t, i), o = t.animate ? null : a, s = t.until === null ? 0 : Bi(o ?? i, t.until);
4634
4651
  if (s < 0 && this.canPageBackForReplay(t)) {
4635
4652
  this.holdReplay(), t.held && t.held.pagesBack++, queueMicrotask(() => void this.pageBackForReplay(t));
4636
4653
  return;
@@ -4638,7 +4655,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4638
4655
  let c = this.getReplayState(), l = t.held !== null && (e === "hours" || e === "bar"), u = t.held?.state ?? c;
4639
4656
  l || (t.held = null), t.symbol = this.currentSymbol;
4640
4657
  let d = this.replayManager.remainingMs();
4641
- this.clearBarHolders(), t.animate && Li(t, this.replayCoarse, i);
4658
+ this.clearBarHolders(), t.animate && zi(t, this.replayCoarse, i);
4642
4659
  let f = this.replayRestarting;
4643
4660
  this.replayRestarting = !0, this.replayCause = e === "older" ? "older" : "series";
4644
4661
  try {
@@ -4661,14 +4678,14 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4661
4678
  }
4662
4679
  replayStepsOver(e, t, n = !1) {
4663
4680
  if (!e.steps || e.stepsSymbol !== this.currentSymbol) return null;
4664
- let r = Vi(this.series.inHoursShown(e.steps), t);
4665
- return r && (n || Bi(r, t)) ? r : null;
4681
+ let r = Wi(this.series.inHoursShown(e.steps), t);
4682
+ return r && (n || Hi(r, t)) ? r : null;
4666
4683
  }
4667
4684
  canPageBackForReplay(e) {
4668
- return this.history.hasLoader() && this.history.hasMore() && (e.held?.pagesBack ?? 0) < Mi;
4685
+ return this.history.hasLoader() && this.history.hasMore() && (e.held?.pagesBack ?? 0) < Pi;
4669
4686
  }
4670
4687
  async pageBackForReplay(e) {
4671
- this.replaySession !== e || !e.held || await this.history.loadMore() > 0 || this.replaySession !== e || !e.held || (e.held.pagesBack = Mi, this.rebaseReplay("older"));
4688
+ this.replaySession !== e || !e.held || await this.history.loadMore() > 0 || this.replaySession !== e || !e.held || (e.held.pagesBack = Pi, this.rebaseReplay("older"));
4672
4689
  }
4673
4690
  holdReplay() {
4674
4691
  let e = this.replaySession;
@@ -4701,7 +4718,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4701
4718
  this.signalMarkerManager.setRevealUntil(e, t), this.tradeZoneManager.setRevealUntil(e, t);
4702
4719
  }
4703
4720
  replaySeekToTime(e) {
4704
- !this.replaySession || !this.replayCoarse || this.replaySeek(Math.max(0, Ri(this.replayStepsSeries ?? this.replayCoarse, e)));
4721
+ !this.replaySession || !this.replayCoarse || this.replaySeek(Math.max(0, Bi(this.replayStepsSeries ?? this.replayCoarse, e)));
4705
4722
  }
4706
4723
  feedReplayPrice(e, t) {
4707
4724
  let n = this.executionAdapter;
@@ -4716,7 +4733,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4716
4733
  feedReplaySteps(e, t) {
4717
4734
  let n = this.replaySession;
4718
4735
  if (!n || !this.executionAdapter?.setMarkPrice) return;
4719
- let r = pi(e, t, {
4736
+ let r = hi(e, t, {
4720
4737
  time: n.fedTime,
4721
4738
  fraction: n.fedFraction
4722
4739
  });
@@ -4726,11 +4743,11 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4726
4743
  if (!this.replaySession) return -1;
4727
4744
  if (this.replayForming) return this.replayForming.index;
4728
4745
  let { current: e } = this.replayManager.getProgress(), t = this.replayStepsSeries;
4729
- return t && this.replayCoarse ? Q(this.replayCoarse, t[e]?.time ?? -Infinity) : e;
4746
+ return t && this.replayCoarse ? Z(this.replayCoarse, t[e]?.time ?? -Infinity) : e;
4730
4747
  }
4731
4748
  replaySeekToBar(e) {
4732
4749
  let t = this.replayStepsSeries;
4733
- this.replaySeek(t && this.replayCoarse ? Hi(t, this.replayCoarse, e) : e);
4750
+ this.replaySeek(t && this.replayCoarse ? Gi(t, this.replayCoarse, e) : e);
4734
4751
  }
4735
4752
  replayPause() {
4736
4753
  this.setHeldState("paused") || this.replayManager.pause();
@@ -4771,7 +4788,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4771
4788
  let { x: r, y: c } = this.drawingManager.anchorPoint(t.type, e, n);
4772
4789
  i = Math.min(i, r), a = Math.max(a, r), o = Math.min(o, c), s = Math.max(s, c);
4773
4790
  }
4774
- if (wi.has(t.type) ? [i, a] = [r.x, r.x + r.width] : t.type === "horizontalRay" && (a = r.x + r.width), Ti.has(t.type) && ([o, s] = [r.y, r.y + r.height]), a < r.x || i > r.x + r.width || s < r.y || o > r.y + r.height) return null;
4791
+ if (Ei.has(t.type) ? [i, a] = [r.x, r.x + r.width] : t.type === "horizontalRay" && (a = r.x + r.width), Di.has(t.type) && ([o, s] = [r.y, r.y + r.height]), a < r.x || i > r.x + r.width || s < r.y || o > r.y + r.height) return null;
4775
4792
  let c = this.drawingManager.drawnExtent(e);
4776
4793
  return c && (i = Math.min(i, c.x), a = Math.max(a, c.x + c.width), o = Math.min(o, c.y), s = Math.max(s, c.y + c.height)), i = Math.max(i, r.x), a = Math.min(a, r.x + r.width), o = Math.max(o, r.y), s = Math.min(s, r.y + r.height), i <= a && o <= s ? {
4777
4794
  x: i,
@@ -4809,7 +4826,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4809
4826
  };
4810
4827
  }
4811
4828
  captureSnapshot() {
4812
- return E.capture({
4829
+ return D.capture({
4813
4830
  getDrawings: () => [...this.getDrawings().filter((e) => e.paneId === void 0 || this.layoutManager.getPanels().some((t) => t.id === e.paneId)), ...this.keptPaneDrawings],
4814
4831
  getTheme: () => this.themeManager.getBaseTheme(),
4815
4832
  getAlerts: () => this.getAlerts(),
@@ -4888,7 +4905,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4888
4905
  let s = t.levels ?? null;
4889
4906
  JSON.stringify(s) !== JSON.stringify(o?.levels ?? null) && this.setIndicatorLevels(e, s);
4890
4907
  let c = t.intervals ?? null;
4891
- JSON.stringify(c) !== JSON.stringify(o?.intervals ?? null) && this.setIndicatorIntervalsNow(e, c), this.setPaneStyleNow(e, t.paneStyle ? se(t.paneStyle) : null);
4908
+ JSON.stringify(c) !== JSON.stringify(o?.intervals ?? null) && this.setIndicatorIntervalsNow(e, c), this.setPaneStyleNow(e, t.paneStyle ? oe(t.paneStyle) : null);
4892
4909
  }
4893
4910
  getIndicatorSetup() {
4894
4911
  return [...Zn(this.indicatorEngine, this.layoutManager, (e) => this.panes.style(e) ?? null), ...this.unrestoredIndicators];
@@ -4938,12 +4955,12 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4938
4955
  }
4939
4956
  saveState(e) {
4940
4957
  if (!this.features.saveLoad) return null;
4941
- let t = this.captureSnapshot(), n = E.serialize(t);
4942
- return e && E.saveToStorage(e, t), n;
4958
+ let t = this.captureSnapshot(), n = D.serialize(t);
4959
+ return e && D.saveToStorage(e, t), n;
4943
4960
  }
4944
4961
  loadState(e) {
4945
4962
  if (!this.features.saveLoad) return;
4946
- let t = E.deserialize(e);
4963
+ let t = D.deserialize(e);
4947
4964
  this.chartTypeOptions = t.chartTypeOptions ?? {}, this.display.reset(), t.chartType && this.setChartType(t.chartType), t.drawings && this.setDrawings(t.drawings), (t.theme === "dark" || t.theme === "light") && this.setTheme(t.theme), t.version >= 3 && this.themeManager.setUserOverrides(t.overrides ?? {}) && this.styleChanged("user");
4948
4965
  let n = t.version >= 2 && this.features.indicators ? this.indicatorHistory.quietly(() => this.restoreIndicators(t.indicators, !1)) : /* @__PURE__ */ new Map();
4949
4966
  this.drawingManager.renamePanes(n);
@@ -4954,19 +4971,19 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
4954
4971
  }
4955
4972
  loadStateFromStorage(e) {
4956
4973
  if (!this.features.saveLoad) return !1;
4957
- let t = E.loadFromStorage(e);
4958
- return t ? (this.loadState(E.serialize(t)), !0) : !1;
4974
+ let t = D.loadFromStorage(e);
4975
+ return t ? (this.loadState(D.serialize(t)), !0) : !1;
4959
4976
  }
4960
4977
  downloadState(e) {
4961
- this.features.saveLoad && E.downloadFile(this.captureSnapshot(), e);
4978
+ this.features.saveLoad && D.downloadFile(this.captureSnapshot(), e);
4962
4979
  }
4963
4980
  async loadStateFromFile() {
4964
4981
  if (!this.features.saveLoad) return;
4965
- let e = await E.loadFromFile();
4966
- this.loadState(E.serialize(e));
4982
+ let e = await D.loadFromFile();
4983
+ this.loadState(D.serialize(e));
4967
4984
  }
4968
4985
  setLocale(e) {
4969
- le(e), this.engine.requestRender();
4986
+ ce(e), this.engine.requestRender();
4970
4987
  }
4971
4988
  setNumberLocale(e) {
4972
4989
  this.numberLocale = e, this.viewport.setNumberLocale(e), this.priceAxis.setLocale(e), this.leftPriceAxis.setLocale(e), this.crosshairHandler.setLocale(e), this.timeAxis.setLocale(e), this.chartLegend.setLocale(e), this.crosshairTooltip.setLocale(e), this.pinnedTooltip.setLocale(e), this.currentPriceLine.setLocale(e), this.updateViewportAndRender();
@@ -5016,8 +5033,8 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
5016
5033
  this.disposed = !0, this.stopWatchingVisibility?.(), this.stopWatchingVisibility = null, this.waitForGpu(null), this.countdownInterval && clearInterval(this.countdownInterval), this.history.setLoader(null), this.disableAutoSave(), this.disconnectStream(), this.disconnectExecution(), this.onWindowKeyDown &&= (window.removeEventListener("keydown", this.onWindowKeyDown), null), this.keyboardHandler = null, this.a11y?.destroy(), this.a11y = null, this.interactionManager.detach(), this.tradingManager.destroy(), this.animator.dispose(), this.crosshairTooltip.destroy(), this.pinnedTooltip.destroy(), this.replayRestarting = !0, this.replayManager.dispose(), this.alertManager.dispose(), this.undoRedoManager.clear(), this.engine.destroy(), this.eventBus.destroy(), this.labelWidths.destroy(), this.container.innerHTML = "";
5017
5034
  }
5018
5035
  createChartRenderer(e) {
5019
- let t = Dn(e, (e) => this.pluginManager.getChartType(e));
5020
- return t instanceof ze && t.setPriceText((e) => this.formatPrice(e)), t;
5036
+ let t = kn(e, (e) => this.pluginManager.getChartType(e));
5037
+ return t instanceof Re && t.setPriceText((e) => this.formatPrice(e)), t;
5021
5038
  }
5022
5039
  crosshairSeries() {
5023
5040
  return this.isTimeAligned() ? this.series.bars() : this.getDisplayData();
@@ -5035,7 +5052,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
5035
5052
  }
5036
5053
  exportBars() {
5037
5054
  if (this.isTimeAligned()) return this.series.bars();
5038
- let e = this.getDisplayData(), t = A(e);
5055
+ let e = this.getDisplayData(), t = At(e);
5039
5056
  return e.map((e, n) => ({
5040
5057
  ...e,
5041
5058
  time: t[n]?.time ?? e.time
@@ -5139,9 +5156,9 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
5139
5156
  }
5140
5157
  measureText(e, t) {
5141
5158
  let n = this.engine.layerManager.getLayer(i.Main)?.ctx;
5142
- if (n?.canvas.isConnected) return this.labelWidths.get(e, t, () => Di(n, e, t));
5159
+ if (n?.canvas.isConnected) return this.labelWidths.get(e, t, () => ki(n, e, t));
5143
5160
  let r = n ?? this.detachedMeasureContext();
5144
- return r ? Di(r, e, t) : e.length * 7;
5161
+ return r ? ki(r, e, t) : e.length * 7;
5145
5162
  }
5146
5163
  detachedMeasureContext() {
5147
5164
  return this.measureCtx === void 0 && (this.measureCtx = typeof document < "u" ? document.createElement("canvas").getContext("2d") : null), this.measureCtx;
@@ -5223,6 +5240,7 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
5223
5240
  paneTitles: this.paneTitles,
5224
5241
  indicatorValueLabels: this.features.indicatorValueLabels,
5225
5242
  alignAxisLabels: this.features.alignAxisLabels,
5243
+ drawingAxisSpans: this.features.drawingAxisSpans,
5226
5244
  formatPrice: (e) => this.formatPrice(e),
5227
5245
  renderOverlayPlugins: (e, t) => this.drawOverlayPlugins(e, t)
5228
5246
  });
@@ -5249,15 +5267,15 @@ var yi = .08, bi = 20, xi = 8, Si = 10, Ci = {
5249
5267
  };
5250
5268
  }
5251
5269
  };
5252
- function Di(e, t, n) {
5270
+ function ki(e, t, n) {
5253
5271
  let r = e.font;
5254
5272
  e.font = n;
5255
5273
  let i = e.measureText(t).width;
5256
5274
  return e.font = r, i;
5257
5275
  }
5258
- var Oi = 300;
5259
- function ki(e) {
5260
- let t = {}, n = (e) => typeof e == "string" && e.trim() !== "" && e.length <= Oi && !/[;{}<>\\]|\/\*/.test(e);
5276
+ var Ai = 300;
5277
+ function ji(e) {
5278
+ let t = {}, n = (e) => typeof e == "string" && e.trim() !== "" && e.length <= Ai && !/[;{}<>\\]|\/\*/.test(e);
5261
5279
  n(e.family) && (t.family = e.family), n(e.textFamily) && (t.textFamily = e.textFamily);
5262
5280
  for (let n of [
5263
5281
  "sizeSmall",
@@ -5269,7 +5287,7 @@ function ki(e) {
5269
5287
  }
5270
5288
  return t;
5271
5289
  }
5272
- function Ai(e) {
5290
+ function Mi(e) {
5273
5291
  let t = e.tagRadius;
5274
5292
  return typeof t == "number" && Number.isFinite(t) && t >= 0 ? { tagRadius: Math.min(t, 999) } : {};
5275
5293
  }
@@ -5288,8 +5306,8 @@ function X(e) {
5288
5306
  bars: e.bars
5289
5307
  };
5290
5308
  }
5291
- var ji = 8e3, Mi = 10, Ni = 50, Pi = .001;
5292
- function Fi(e) {
5309
+ var Ni = 8e3, Pi = 10, Fi = 50, Ii = .001;
5310
+ function Li(e) {
5293
5311
  return {
5294
5312
  price: null,
5295
5313
  fedTime: null,
@@ -5304,48 +5322,48 @@ function Fi(e) {
5304
5322
  held: null
5305
5323
  };
5306
5324
  }
5307
- function Ii(e, t) {
5325
+ function Ri(e, t) {
5308
5326
  let n = e[t + 1];
5309
- return n ? n.time - e[t].time : Z(e);
5327
+ return n ? n.time - e[t].time : Ui(e);
5310
5328
  }
5311
- function Li(e, t, n) {
5329
+ function zi(e, t, n) {
5312
5330
  let r = e.fedTime;
5313
5331
  if (r === null || !t || t.length === 0 || n.length === 0) return;
5314
- let i = Ii(t, Q(t, r)), a = r + (Number.isFinite(i) ? e.fedFraction * i : 0), o = Q(n, a), s = n[o].time;
5332
+ let i = Ri(t, Z(t, r)), a = r + (Number.isFinite(i) ? e.fedFraction * i : 0), o = Z(n, a), s = n[o].time;
5315
5333
  if (s > a) return;
5316
- let c = Ii(n, o);
5334
+ let c = Ri(n, o);
5317
5335
  if (a === s && o > 0) {
5318
5336
  e.fedTime = n[o - 1].time, e.fedFraction = 1;
5319
5337
  return;
5320
5338
  }
5321
5339
  e.fedTime = s, e.fedFraction = Number.isFinite(c) && c > 0 ? Math.min(1, (a - s) / c) : 0;
5322
5340
  }
5323
- function Ri(e, t) {
5324
- let n = Y(e, t), r = e.length - 1;
5325
- return n > r && r >= 0 && e[r].time + Z(e) <= t ? r : Math.max(-1, n - 2);
5341
+ function Bi(e, t) {
5342
+ let n = fi(e, t), r = e.length - 1;
5343
+ return n > r && r >= 0 && e[r].time + Ui(e) <= t ? r : Math.max(-1, n - 2);
5326
5344
  }
5327
- function zi(e) {
5345
+ function Vi(e) {
5328
5346
  let t = Infinity;
5329
5347
  for (let n = Math.max(1, e.length - 10); n < e.length; n++) t = Math.min(t, e[n].time - e[n - 1].time);
5330
5348
  return t;
5331
5349
  }
5332
- function Bi(e, t) {
5333
- if (!(zi(e) < zi(t))) return !1;
5334
- let n = Math.max(0, e.length - Ni);
5350
+ function Hi(e, t) {
5351
+ if (!(Vi(e) < Vi(t))) return !1;
5352
+ let n = Math.max(0, e.length - Fi);
5335
5353
  for (let r = n; r < e.length; r++) {
5336
- let n = t[Q(t, e[r].time)], i = (n.high - n.low) * Pi + 2 ** -52;
5354
+ let n = t[Z(t, e[r].time)], i = (n.high - n.low) * Ii + 2 ** -52;
5337
5355
  if (e[r].close > n.high + i || e[r].close < n.low - i) return !1;
5338
5356
  }
5339
5357
  return !0;
5340
5358
  }
5341
- function Z(e) {
5359
+ function Ui(e) {
5342
5360
  let t = 0;
5343
5361
  for (let n = Math.max(1, e.length - 10); n < e.length; n++) t = Math.max(t, e[n].time - e[n - 1].time);
5344
5362
  return t > 0 ? t : Infinity;
5345
5363
  }
5346
- function Vi(e, t) {
5364
+ function Wi(e, t) {
5347
5365
  if (t.length === 0) return null;
5348
- let n = t[t.length - 1].time + Z(t), r = e.filter((e) => Ln(e) && e.time >= t[0].time && e.time < n).sort((e, t) => e.time - t.time), i = [];
5366
+ let n = t[t.length - 1].time + Ui(t), r = e.filter((e) => Ln(e) && e.time >= t[0].time && e.time < n).sort((e, t) => e.time - t.time), i = [];
5349
5367
  for (let e of r) (i.length === 0 || i[i.length - 1].time !== e.time) && i.push(e);
5350
5368
  if (i.length === 0) return null;
5351
5369
  let a = t.findIndex((e) => e.time >= i[0].time);
@@ -5353,7 +5371,7 @@ function Vi(e, t) {
5353
5371
  let o = t.slice(0, a), s = i.filter((e) => e.time >= t[a].time);
5354
5372
  return [...o, ...s];
5355
5373
  }
5356
- function Q(e, t) {
5374
+ function Z(e, t) {
5357
5375
  let n = 0, r = e.length - 1;
5358
5376
  for (; n < r;) {
5359
5377
  let i = n + r + 1 >> 1;
@@ -5361,37 +5379,37 @@ function Q(e, t) {
5361
5379
  }
5362
5380
  return n;
5363
5381
  }
5364
- function Hi(e, t, n) {
5382
+ function Gi(e, t, n) {
5365
5383
  let r = Math.max(0, Math.min(Math.floor(Number.isFinite(n) ? n : 0), t.length - 1)), i = r + 1 < t.length ? t[r + 1].time : Infinity, a = -1;
5366
5384
  for (let t = 0; t < e.length && e[t].time < i; t++) a = t;
5367
5385
  return Math.max(0, a);
5368
5386
  }
5369
- function Ui(e, t, n) {
5387
+ function Ki(e, t, n) {
5370
5388
  let r = n;
5371
5389
  for (; r > 0 && t[r - 1].time >= e.time;) r--;
5372
5390
  let i = {
5373
5391
  ...t[r],
5374
5392
  time: e.time
5375
5393
  };
5376
- for (let e = r + 1; e <= n; e++) i = qi(i, t[e]);
5394
+ for (let e = r + 1; e <= n; e++) i = Xi(i, t[e]);
5377
5395
  return i;
5378
5396
  }
5379
- function Wi(e, t, n, r) {
5397
+ function qi(e, t, n, r) {
5380
5398
  let i = e[n + 1], a = t[r + 1];
5381
5399
  return i !== void 0 && a !== void 0 && i.time >= a.time;
5382
5400
  }
5383
- function Gi(e, t) {
5401
+ function Ji(e, t) {
5384
5402
  let n = /* @__PURE__ */ new Map();
5385
5403
  for (let r of e) {
5386
- let e = t[Q(t, r.time)].time, i = n.get(e);
5404
+ let e = t[Z(t, r.time)].time, i = n.get(e);
5387
5405
  i ? i.push(r) : n.set(e, [r]);
5388
5406
  }
5389
5407
  return n;
5390
5408
  }
5391
- function Ki() {
5409
+ function Yi() {
5392
5410
  return typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
5393
5411
  }
5394
- function qi(e, t) {
5412
+ function Xi(e, t) {
5395
5413
  return {
5396
5414
  time: e.time,
5397
5415
  open: e.open,
@@ -5403,26 +5421,26 @@ function qi(e, t) {
5403
5421
  }
5404
5422
  //#endregion
5405
5423
  //#region src/io/parseOHLCV.ts
5406
- var Ji = [
5424
+ var Zi = [
5407
5425
  "time",
5408
5426
  "timestamp",
5409
5427
  "date",
5410
5428
  "datetime",
5411
5429
  "t"
5412
- ], Yi = ["open", "o"], Xi = ["high", "h"], Zi = ["low", "l"], Qi = ["close", "c"], $i = [
5430
+ ], Qi = ["open", "o"], $i = ["high", "h"], ea = ["low", "l"], ta = ["close", "c"], na = [
5413
5431
  "volume",
5414
5432
  "vol",
5415
5433
  "v"
5416
5434
  ];
5417
- function ea(e) {
5435
+ function ra(e) {
5418
5436
  let t = e.trim();
5419
- return t ? t[0] === "[" || t[0] === "{" ? ta(t) : na(t) : {
5437
+ return t ? t[0] === "[" || t[0] === "{" ? ia(t) : aa(t) : {
5420
5438
  data: [],
5421
5439
  rowCount: 0,
5422
5440
  skipped: 0
5423
5441
  };
5424
5442
  }
5425
- function ta(e) {
5443
+ function ia(e) {
5426
5444
  let t;
5427
5445
  try {
5428
5446
  t = JSON.parse(e);
@@ -5432,19 +5450,19 @@ function ta(e) {
5432
5450
  if (!Array.isArray(t)) throw Error("Expected a JSON array of OHLCV rows");
5433
5451
  let n = [], r = 0;
5434
5452
  for (let e of t) {
5435
- let t = Array.isArray(e) ? sa(e) : oa(e);
5453
+ let t = Array.isArray(e) ? ua(e) : la(e);
5436
5454
  t ? n.push(t) : r++;
5437
5455
  }
5438
- return la(n, t.length, r);
5456
+ return fa(n, t.length, r);
5439
5457
  }
5440
- function na(e) {
5458
+ function aa(e) {
5441
5459
  let t = e.split(/\r?\n/).filter((e) => e.trim().length > 0);
5442
5460
  if (t.length === 0) return {
5443
5461
  data: [],
5444
5462
  rowCount: 0,
5445
5463
  skipped: 0
5446
5464
  };
5447
- let n = ra(t[0]), r = ia(t[0], n).map((e) => e.trim().toLowerCase()), i = r.some((e) => isNaN(Number(e)) && e.length > 0), a = i ? aa(r) : {
5465
+ let n = oa(t[0]), r = sa(t[0], n).map((e) => e.trim().toLowerCase()), i = r.some((e) => isNaN(Number(e)) && e.length > 0), a = i ? ca(r) : {
5448
5466
  time: 0,
5449
5467
  open: 1,
5450
5468
  high: 2,
@@ -5455,7 +5473,7 @@ function na(e) {
5455
5473
  if (a.time < 0 || a.open < 0 || a.high < 0 || a.low < 0 || a.close < 0) throw Error("CSV is missing required column(s): time, open, high, low, close");
5456
5474
  let o = [], s = 0;
5457
5475
  for (let e = +!!i; e < t.length; e++) {
5458
- let r = ia(t[e], n), i = ca(r[a.time]), c = $(r[a.open]), l = $(r[a.high]), u = $(r[a.low]), d = $(r[a.close]), f = a.volume >= 0 ? Number(r[a.volume]) : 0;
5476
+ let r = sa(t[e], n), i = da(r[a.time]), c = Q(r[a.open]), l = Q(r[a.high]), u = Q(r[a.low]), d = Q(r[a.close]), f = a.volume >= 0 ? Number(r[a.volume]) : 0;
5459
5477
  if (i === null || ![
5460
5478
  c,
5461
5479
  l,
@@ -5474,9 +5492,9 @@ function na(e) {
5474
5492
  volume: Number.isFinite(f) ? f : 0
5475
5493
  });
5476
5494
  }
5477
- return la(o, t.length - +!!i, s);
5495
+ return fa(o, t.length - +!!i, s);
5478
5496
  }
5479
- function ra(e) {
5497
+ function oa(e) {
5480
5498
  let t = {
5481
5499
  ",": 0,
5482
5500
  ";": 0,
@@ -5488,7 +5506,7 @@ function ra(e) {
5488
5506
  for (let [e, i] of Object.entries(t)) i > r && (n = e, r = i);
5489
5507
  return n;
5490
5508
  }
5491
- function ia(e, t) {
5509
+ function sa(e, t) {
5492
5510
  let n = [], r = "", i = !1;
5493
5511
  for (let a = 0; a < e.length; a++) {
5494
5512
  let o = e[a];
@@ -5496,25 +5514,25 @@ function ia(e, t) {
5496
5514
  }
5497
5515
  return n.push(r), n;
5498
5516
  }
5499
- function aa(e) {
5517
+ function ca(e) {
5500
5518
  let t = (t) => e.findIndex((e) => t.includes(e));
5501
5519
  return {
5502
- time: t(Ji),
5503
- open: t(Yi),
5504
- high: t(Xi),
5505
- low: t(Zi),
5506
- close: t(Qi),
5507
- volume: t($i)
5520
+ time: t(Zi),
5521
+ open: t(Qi),
5522
+ high: t($i),
5523
+ low: t(ea),
5524
+ close: t(ta),
5525
+ volume: t(na)
5508
5526
  };
5509
5527
  }
5510
- function oa(e) {
5528
+ function la(e) {
5511
5529
  let t = (t) => {
5512
5530
  for (let n of t) {
5513
5531
  if (e[n] !== void 0) return e[n];
5514
5532
  let t = n.toUpperCase();
5515
5533
  if (e[t] !== void 0) return e[t];
5516
5534
  }
5517
- }, n = ca(String(t(Ji) ?? "")), r = Number(t(Yi)), i = Number(t(Xi)), a = Number(t(Zi)), o = Number(t(Qi)), s = Number(t($i) ?? 0);
5535
+ }, n = da(String(t(Zi) ?? "")), r = Number(t(Qi)), i = Number(t($i)), a = Number(t(ea)), o = Number(t(ta)), s = Number(t(na) ?? 0);
5518
5536
  return n === null || ![
5519
5537
  r,
5520
5538
  i,
@@ -5529,9 +5547,9 @@ function oa(e) {
5529
5547
  volume: Number.isFinite(s) ? s : 0
5530
5548
  };
5531
5549
  }
5532
- function sa(e) {
5550
+ function ua(e) {
5533
5551
  if (e.length < 5) return null;
5534
- let t = ca(String(e[0])), n = Number(e[1]), r = Number(e[2]), i = Number(e[3]), a = Number(e[4]), o = e.length >= 6 ? Number(e[5]) : 0;
5552
+ let t = da(String(e[0])), n = Number(e[1]), r = Number(e[2]), i = Number(e[3]), a = Number(e[4]), o = e.length >= 6 ? Number(e[5]) : 0;
5535
5553
  return t === null || ![
5536
5554
  n,
5537
5555
  r,
@@ -5546,10 +5564,10 @@ function sa(e) {
5546
5564
  volume: Number.isFinite(o) ? o : 0
5547
5565
  };
5548
5566
  }
5549
- function $(e) {
5567
+ function Q(e) {
5550
5568
  return e === void 0 || e.trim() === "" ? NaN : Number(e);
5551
5569
  }
5552
- function ca(e) {
5570
+ function da(e) {
5553
5571
  let t = e.trim();
5554
5572
  if (!t) return null;
5555
5573
  let n = Number(t);
@@ -5557,7 +5575,7 @@ function ca(e) {
5557
5575
  let r = Date.parse(t);
5558
5576
  return Number.isFinite(r) ? r : null;
5559
5577
  }
5560
- function la(e, t, n) {
5578
+ function fa(e, t, n) {
5561
5579
  e.sort((e, t) => e.time - t.time);
5562
5580
  let r = [];
5563
5581
  for (let t of e) r.length > 0 && r[r.length - 1].time === t.time ? r[r.length - 1] = t : r.push(t);
@@ -5569,7 +5587,7 @@ function la(e, t, n) {
5569
5587
  }
5570
5588
  //#endregion
5571
5589
  //#region src/io/DragDropImporter.ts
5572
- var ua = class {
5590
+ var pa = class {
5573
5591
  host;
5574
5592
  overlay = null;
5575
5593
  callbacks;
@@ -5590,19 +5608,19 @@ var ua = class {
5590
5608
  this.host.removeEventListener("dragenter", this.bound.dragenter), this.host.removeEventListener("dragover", this.bound.dragover), this.host.removeEventListener("dragleave", this.bound.dragleave), this.host.removeEventListener("drop", this.bound.drop), this.hideOverlay();
5591
5609
  }
5592
5610
  onDragEnter(e) {
5593
- da(e) && (e.preventDefault(), this.depth++, this.showOverlay());
5611
+ ma(e) && (e.preventDefault(), this.depth++, this.showOverlay());
5594
5612
  }
5595
5613
  onDragOver(e) {
5596
- da(e) && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy"));
5614
+ ma(e) && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy"));
5597
5615
  }
5598
5616
  onDragLeave(e) {
5599
- da(e) && (this.depth = Math.max(0, this.depth - 1), this.depth === 0 && this.hideOverlay());
5617
+ ma(e) && (this.depth = Math.max(0, this.depth - 1), this.depth === 0 && this.hideOverlay());
5600
5618
  }
5601
5619
  async onDrop(e) {
5602
5620
  e.preventDefault(), this.depth = 0, this.hideOverlay();
5603
5621
  let t = e.dataTransfer?.files?.[0];
5604
5622
  if (t) try {
5605
- let e = ea(await t.text());
5623
+ let e = ra(await t.text());
5606
5624
  if (e.data.length === 0) throw Error(`No valid OHLCV rows found in "${t.name}"`);
5607
5625
  this.callbacks.onData(e.data, e, t);
5608
5626
  } catch (e) {
@@ -5633,12 +5651,250 @@ var ua = class {
5633
5651
  this.overlay?.remove(), this.overlay = null;
5634
5652
  }
5635
5653
  };
5636
- function da(e) {
5654
+ function ma(e) {
5637
5655
  return e.dataTransfer?.types?.includes("Files") ?? !1;
5638
5656
  }
5639
5657
  //#endregion
5658
+ //#region src/grid/gridShapes.ts
5659
+ var ha = {
5660
+ "1x1": {
5661
+ cols: 1,
5662
+ rows: 1
5663
+ },
5664
+ "1x2": {
5665
+ cols: 2,
5666
+ rows: 1
5667
+ },
5668
+ "2x1": {
5669
+ cols: 1,
5670
+ rows: 2
5671
+ },
5672
+ "1x3": {
5673
+ cols: 3,
5674
+ rows: 1
5675
+ },
5676
+ "3x1": {
5677
+ cols: 1,
5678
+ rows: 3
5679
+ },
5680
+ "1+2": {
5681
+ cols: 2,
5682
+ rows: 2,
5683
+ areas: [
5684
+ [
5685
+ 0,
5686
+ 0,
5687
+ 1,
5688
+ 2
5689
+ ],
5690
+ [
5691
+ 1,
5692
+ 0,
5693
+ 1,
5694
+ 1
5695
+ ],
5696
+ [
5697
+ 1,
5698
+ 1,
5699
+ 1,
5700
+ 1
5701
+ ]
5702
+ ]
5703
+ },
5704
+ "2+1": {
5705
+ cols: 2,
5706
+ rows: 2,
5707
+ areas: [
5708
+ [
5709
+ 0,
5710
+ 0,
5711
+ 1,
5712
+ 1
5713
+ ],
5714
+ [
5715
+ 0,
5716
+ 1,
5717
+ 1,
5718
+ 1
5719
+ ],
5720
+ [
5721
+ 1,
5722
+ 0,
5723
+ 1,
5724
+ 2
5725
+ ]
5726
+ ]
5727
+ },
5728
+ "1/2": {
5729
+ cols: 2,
5730
+ rows: 2,
5731
+ areas: [
5732
+ [
5733
+ 0,
5734
+ 0,
5735
+ 2,
5736
+ 1
5737
+ ],
5738
+ [
5739
+ 0,
5740
+ 1,
5741
+ 1,
5742
+ 1
5743
+ ],
5744
+ [
5745
+ 1,
5746
+ 1,
5747
+ 1,
5748
+ 1
5749
+ ]
5750
+ ]
5751
+ },
5752
+ "2/1": {
5753
+ cols: 2,
5754
+ rows: 2,
5755
+ areas: [
5756
+ [
5757
+ 0,
5758
+ 0,
5759
+ 1,
5760
+ 1
5761
+ ],
5762
+ [
5763
+ 1,
5764
+ 0,
5765
+ 1,
5766
+ 1
5767
+ ],
5768
+ [
5769
+ 0,
5770
+ 1,
5771
+ 2,
5772
+ 1
5773
+ ]
5774
+ ]
5775
+ },
5776
+ "2x2": {
5777
+ cols: 2,
5778
+ rows: 2
5779
+ },
5780
+ "1x4": {
5781
+ cols: 4,
5782
+ rows: 1
5783
+ },
5784
+ "4x1": {
5785
+ cols: 1,
5786
+ rows: 4
5787
+ },
5788
+ "1+3": {
5789
+ cols: 2,
5790
+ rows: 3,
5791
+ areas: [
5792
+ [
5793
+ 0,
5794
+ 0,
5795
+ 1,
5796
+ 3
5797
+ ],
5798
+ [
5799
+ 1,
5800
+ 0,
5801
+ 1,
5802
+ 1
5803
+ ],
5804
+ [
5805
+ 1,
5806
+ 1,
5807
+ 1,
5808
+ 1
5809
+ ],
5810
+ [
5811
+ 1,
5812
+ 2,
5813
+ 1,
5814
+ 1
5815
+ ]
5816
+ ]
5817
+ },
5818
+ "1/3": {
5819
+ cols: 3,
5820
+ rows: 2,
5821
+ areas: [
5822
+ [
5823
+ 0,
5824
+ 0,
5825
+ 3,
5826
+ 1
5827
+ ],
5828
+ [
5829
+ 0,
5830
+ 1,
5831
+ 1,
5832
+ 1
5833
+ ],
5834
+ [
5835
+ 1,
5836
+ 1,
5837
+ 1,
5838
+ 1
5839
+ ],
5840
+ [
5841
+ 2,
5842
+ 1,
5843
+ 1,
5844
+ 1
5845
+ ]
5846
+ ]
5847
+ },
5848
+ "2x3": {
5849
+ cols: 3,
5850
+ rows: 2
5851
+ },
5852
+ "3x2": {
5853
+ cols: 2,
5854
+ rows: 3
5855
+ },
5856
+ "2x4": {
5857
+ cols: 4,
5858
+ rows: 2
5859
+ },
5860
+ "3x3": {
5861
+ cols: 3,
5862
+ rows: 3
5863
+ }
5864
+ }, ga = Object.keys(ha);
5865
+ function _a(e) {
5866
+ return typeof e == "string" && Object.prototype.hasOwnProperty.call(ha, e);
5867
+ }
5868
+ function va(e) {
5869
+ if (e.areas) return e.areas;
5870
+ let t = [];
5871
+ for (let n = 0; n < e.rows; n++) for (let r = 0; r < e.cols; r++) t.push([
5872
+ r,
5873
+ n,
5874
+ 1,
5875
+ 1
5876
+ ]);
5877
+ return t;
5878
+ }
5879
+ function ya(e) {
5880
+ return e.areas?.length ?? e.cols * e.rows;
5881
+ }
5882
+ function ba([e, t, n, r]) {
5883
+ return `${t + 1} / ${e + 1} / span ${r} / span ${n}`;
5884
+ }
5885
+ function xa(e, t) {
5886
+ e.style.gridArea = t ? ba(t) : "";
5887
+ }
5888
+ function Sa(e) {
5889
+ if (!e.areas) return null;
5890
+ let t = e.areas.find(([, , e, t]) => e * t > 1);
5891
+ if (!t) return null;
5892
+ let [n, r, i, a] = t;
5893
+ return a === e.rows && i < e.cols ? n === 0 ? "left" : "right" : r === 0 ? "top" : "bottom";
5894
+ }
5895
+ //#endregion
5640
5896
  //#region src/state/layoutStorage.ts
5641
- function fa(e) {
5897
+ function Ca(e) {
5642
5898
  let t = {
5643
5899
  id: e.id,
5644
5900
  name: e.name,
@@ -5646,11 +5902,11 @@ function fa(e) {
5646
5902
  };
5647
5903
  return e.symbol !== void 0 && (t.symbol = e.symbol), e.timeframe !== void 0 && (t.timeframe = e.timeframe), e.kind !== void 0 && (t.kind = e.kind), t;
5648
5904
  }
5649
- var pa = (e, t) => t.updatedAt - e.updatedAt;
5650
- function ma(e) {
5905
+ var wa = (e, t) => t.updatedAt - e.updatedAt;
5906
+ function Ta(e) {
5651
5907
  if (typeof e != "object" || !e) return null;
5652
5908
  let t = e;
5653
- return typeof t.id != "string" || !t.id || typeof t.name != "string" || typeof t.updatedAt != "number" || !Number.isFinite(t.updatedAt) ? null : fa({
5909
+ return typeof t.id != "string" || !t.id || typeof t.name != "string" || typeof t.updatedAt != "number" || !Number.isFinite(t.updatedAt) ? null : Ca({
5654
5910
  id: t.id,
5655
5911
  name: t.name,
5656
5912
  updatedAt: t.updatedAt,
@@ -5659,17 +5915,17 @@ function ma(e) {
5659
5915
  kind: typeof t.kind == "string" ? t.kind : void 0
5660
5916
  });
5661
5917
  }
5662
- function ha(e) {
5663
- let t = ma(e), n = t ? e.content : void 0;
5918
+ function Ea(e) {
5919
+ let t = Ta(e), n = t ? e.content : void 0;
5664
5920
  return t && typeof n == "string" ? {
5665
5921
  ...t,
5666
5922
  content: n
5667
5923
  } : null;
5668
5924
  }
5669
- function ga(e = []) {
5925
+ function Da(e = []) {
5670
5926
  let t = new Map(e.map((e) => [e.id, { ...e }]));
5671
5927
  return {
5672
- list: () => [...t.values()].map(fa).sort(pa),
5928
+ list: () => [...t.values()].map(Ca).sort(wa),
5673
5929
  load: (e) => {
5674
5930
  let n = t.get(e);
5675
5931
  return n ? { ...n } : null;
@@ -5682,7 +5938,7 @@ function ga(e = []) {
5682
5938
  }
5683
5939
  };
5684
5940
  }
5685
- function _a(e = "tcw:layouts:") {
5941
+ function Oa(e = "tcw:layouts:") {
5686
5942
  let t = `${e}index`, n = (t) => `${e}item:${t}`, r = () => {
5687
5943
  let e;
5688
5944
  try {
@@ -5690,10 +5946,10 @@ function _a(e = "tcw:layouts:") {
5690
5946
  } catch {
5691
5947
  return [];
5692
5948
  }
5693
- return Array.isArray(e) ? e.map(ma).filter((e) => e !== null) : [];
5949
+ return Array.isArray(e) ? e.map(Ta).filter((e) => e !== null) : [];
5694
5950
  }, i = (e) => localStorage.setItem(t, JSON.stringify(e));
5695
5951
  return {
5696
- list: () => r().sort(pa),
5952
+ list: () => r().sort(wa),
5697
5953
  load: (e) => {
5698
5954
  let t = r().find((t) => t.id === e), i = t ? localStorage.getItem(n(e)) : null;
5699
5955
  return t && i !== null ? {
@@ -5702,7 +5958,7 @@ function _a(e = "tcw:layouts:") {
5702
5958
  } : null;
5703
5959
  },
5704
5960
  save: (e) => {
5705
- localStorage.setItem(n(e.id), e.content), i([...r().filter((t) => t.id !== e.id), fa(e)]);
5961
+ localStorage.setItem(n(e.id), e.content), i([...r().filter((t) => t.id !== e.id), Ca(e)]);
5706
5962
  },
5707
5963
  remove: (e) => {
5708
5964
  i(r().filter((t) => t.id !== e)), localStorage.removeItem(n(e));
@@ -5711,14 +5967,14 @@ function _a(e = "tcw:layouts:") {
5711
5967
  }
5712
5968
  //#endregion
5713
5969
  //#region src/state/LayoutSession.ts
5714
- var va = 80;
5715
- function ya(e) {
5970
+ var ka = 80;
5971
+ function $(e) {
5716
5972
  return e.replace(/\s+/g, " ").trim().slice(0, 80).trim() || null;
5717
5973
  }
5718
- function ba() {
5974
+ function Aa() {
5719
5975
  return globalThis.crypto?.randomUUID?.() ?? `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
5720
5976
  }
5721
- function xa(e) {
5977
+ function ja(e) {
5722
5978
  let { id: t, name: n, symbol: r, timeframe: i, updatedAt: a, kind: o } = e;
5723
5979
  return {
5724
5980
  id: t,
@@ -5729,7 +5985,7 @@ function xa(e) {
5729
5985
  ...o === void 0 ? {} : { kind: o }
5730
5986
  };
5731
5987
  }
5732
- var Sa = class {
5988
+ var Ma = class {
5733
5989
  currentLayout = null;
5734
5990
  savedContent = null;
5735
5991
  dirty = !1;
@@ -5745,7 +6001,7 @@ var Sa = class {
5745
6001
  now;
5746
6002
  newId;
5747
6003
  constructor(e, t, n = {}) {
5748
- this.storage = e, this.host = t, this.options = n, this.autoSave = n.autoSave ?? !0, this.debounceMs = n.debounceMs ?? 1500, this.kind = n.kind ?? "chart", this.now = n.now ?? Date.now, this.newId = n.newId ?? ba;
6004
+ this.storage = e, this.host = t, this.options = n, this.autoSave = n.autoSave ?? !0, this.debounceMs = n.debounceMs ?? 1500, this.kind = n.kind ?? "chart", this.now = n.now ?? Date.now, this.newId = n.newId ?? Aa;
5749
6005
  }
5750
6006
  current() {
5751
6007
  return this.currentLayout;
@@ -5761,7 +6017,7 @@ var Sa = class {
5761
6017
  }
5762
6018
  async list() {
5763
6019
  let e = await this.storage.list();
5764
- return Array.isArray(e) ? e.map(ma).filter((e) => e !== null && (e.kind ?? "chart") === this.kind).sort((e, t) => t.updatedAt - e.updatedAt) : [];
6020
+ return Array.isArray(e) ? e.map(Ta).filter((e) => e !== null && (e.kind ?? "chart") === this.kind).sort((e, t) => t.updatedAt - e.updatedAt) : [];
5765
6021
  }
5766
6022
  save() {
5767
6023
  return this.queue(() => {
@@ -5770,12 +6026,12 @@ var Sa = class {
5770
6026
  });
5771
6027
  }
5772
6028
  saveAs(e) {
5773
- let t = ya(e);
6029
+ let t = $(e);
5774
6030
  return t ? this.queue(() => this.write(this.newId(), t)) : Promise.reject(/* @__PURE__ */ Error("A layout needs a name"));
5775
6031
  }
5776
6032
  open(e) {
5777
6033
  return this.queue(async () => {
5778
- let t = ha(await this.storage.load(e));
6034
+ let t = Ea(await this.storage.load(e));
5779
6035
  if (!t || t.id !== e || (t.kind ?? "chart") !== this.kind || this.destroyed) return !1;
5780
6036
  this.cancelTimer(), this.applying++;
5781
6037
  try {
@@ -5785,13 +6041,13 @@ var Sa = class {
5785
6041
  } finally {
5786
6042
  this.applying--;
5787
6043
  }
5788
- return this.cancelTimer(), this.currentLayout = xa(t), this.savedContent = this.host.capture().content, this.dirty = !1, this.notify(), !0;
6044
+ return this.cancelTimer(), this.currentLayout = ja(t), this.savedContent = this.host.capture().content, this.dirty = !1, this.notify(), !0;
5789
6045
  });
5790
6046
  }
5791
6047
  rename(e, t) {
5792
- let n = ya(t);
6048
+ let n = $(t);
5793
6049
  return n ? this.queue(async () => {
5794
- let t = ha(await this.storage.load(e));
6050
+ let t = Ea(await this.storage.load(e));
5795
6051
  !t || t.id !== e || (await this.storage.save({
5796
6052
  ...t,
5797
6053
  name: n
@@ -5869,7 +6125,7 @@ var Sa = class {
5869
6125
  content: n.content
5870
6126
  };
5871
6127
  await this.storage.save(r);
5872
- let i = xa(r);
6128
+ let i = ja(r);
5873
6129
  return this.currentLayout = i, this.savedContent = n.content, this.dirty = !1, this.notify(), i;
5874
6130
  }
5875
6131
  forget() {
@@ -5890,6 +6146,6 @@ var Sa = class {
5890
6146
  }
5891
6147
  };
5892
6148
  //#endregion
5893
- export { fr as C, jn as D, z as E, hr as S, In as T, Nr as _, ga as a, G as b, Ei as c, ni as d, ri as f, Mr as g, Pr as h, _a as i, gi as l, Fr as m, va as n, ua as o, Ir as p, ya as r, ea as s, Sa as t, hi as u, Ar as v, ur as w, br as x, jr as y };
6149
+ export { fr as A, Mr as C, q as D, jr as E, H as M, z as N, br as O, V as P, Pr as S, Ar as T, _i as _, Da as a, Ir as b, va as c, _a as d, xa as f, vi as g, Oi as h, Oa as i, ur as j, hr as k, ya as l, ra as m, ka as n, ga as o, pa as p, $ as r, ha as s, Ma as t, Sa as u, ni as v, Nr as w, Fr as x, ri as y };
5894
6150
 
5895
- //# sourceMappingURL=LayoutSession-C4Lp1X6t.js.map
6151
+ //# sourceMappingURL=LayoutSession-BoiToS9y.js.map