charts-core 1.1.21 → 1.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,39 @@
1
- var Es = Object.defineProperty;
2
- var Ns = (i, e, t) => e in i ? Es(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
1
+ var Ls = Object.defineProperty;
2
+ var Ns = (i, e, t) => e in i ? Ls(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
3
  var f = (i, e, t) => Ns(i, typeof e != "symbol" ? e + "" : e, t);
4
4
  import * as D from "d3";
5
5
  const Fs = (i) => {
6
6
  const { svg: e, config: t, y: s, width: n } = i, { margin: a, yAxis: r } = t, { customTicks: o, tickFormat: c, tickValues: h, ticks: u, isShow: g } = r;
7
7
  if (!g) return null;
8
- e.append("g").attr("transform", `translate(${n - a.right},0)`).call((_) => {
9
- let p = D.axisRight(s);
10
- o && c ? p = p.tickFormat(c) : p = p.tickFormat((v) => {
11
- const b = Number(v), w = (C) => C.toString().replace(/\.0+$/, "");
12
- return Math.abs(b) >= 1e12 ? w(b / 1e12) + "T" : Math.abs(b) >= 1e9 ? w(b / 1e9) + "B" : Math.abs(b) >= 1e6 ? w(b / 1e6) + "M" : Math.abs(b) >= 1e3 ? w(b / 1e3) + "K" : w(b);
13
- }), o && u && (p = Array.isArray(u) ? p.ticks(...u) : p.ticks(u)), o && h && (p = p.tickValues(h)), _.call(p);
14
- }).call((_) => {
15
- let p = [];
16
- _.selectAll(".tick").each((v) => p.push(v)), i.yTicks = p;
17
- }).call((_) => _.select(".domain").remove()).call((_) => _.selectAll(".tick line").remove()).call((_) => {
18
- const p = _.selectAll(".tick text");
19
- p.classed("sc-charts__y-axis-tick", !0).attr("text-anchor", "start");
20
- const v = p.nodes().map((w) => w.getBBox().width), b = Math.max(...v);
21
- _.selectAll(".tick").each(function(w, C) {
8
+ e.append("g").attr("transform", `translate(${n - a.right},0)`).call((p) => {
9
+ let _ = D.axisRight(s);
10
+ o && c ? _ = _.tickFormat(c) : _ = _.tickFormat((v) => {
11
+ const b = Number(v), x = (C) => C.toString().replace(/\.0+$/, "");
12
+ return Math.abs(b) >= 1e12 ? x(b / 1e12) + "T" : Math.abs(b) >= 1e9 ? x(b / 1e9) + "B" : Math.abs(b) >= 1e6 ? x(b / 1e6) + "M" : Math.abs(b) >= 1e3 ? x(b / 1e3) + "K" : x(b);
13
+ }), o && u && (_ = Array.isArray(u) ? _.ticks(...u) : _.ticks(u)), o && h && (_ = _.tickValues(h)), p.call(_);
14
+ }).call((p) => {
15
+ let _ = [];
16
+ p.selectAll(".tick").each((v) => _.push(v)), i.yTicks = _;
17
+ }).call((p) => p.select(".domain").remove()).call((p) => p.selectAll(".tick line").remove()).call((p) => {
18
+ const _ = p.selectAll(".tick text");
19
+ _.classed("sc-charts__y-axis-tick", !0).attr("text-anchor", "start");
20
+ const v = _.nodes().map((x) => x.getBBox().width), b = Math.max(...v);
21
+ p.selectAll(".tick").each(function(x, C) {
22
22
  var $;
23
- const y = D.select(this), x = y.select("text"), T = v[C], F = b - T, R = y.append("g").attr("transform", "translate(10, 0)");
24
- x.attr("x", F), x.remove(), ($ = R.node()) == null || $.appendChild(x.node());
23
+ const y = D.select(this), w = y.select("text"), S = v[C], L = b - S, R = y.append("g").attr("transform", "translate(10, 0)");
24
+ w.attr("x", L), w.remove(), ($ = R.node()) == null || $.appendChild(w.node());
25
25
  });
26
26
  }).attr("font-family", "inherit");
27
27
  }, Hs = (i) => {
28
28
  const { svg: e, config: t, x: s, height: n } = i, { margin: a, xAxis: r } = t, { isShow: o, tickValues: c, tickFormat: h, customTicks: u, ticks: g } = r;
29
29
  if (!o) return null;
30
- e.append("g").attr("transform", `translate(0,${n - a.bottom})`).call((_) => {
31
- let p = D.axisBottom(s);
32
- u ? (h && (p = p.tickFormat(h)), g && (p = Array.isArray(g) ? p.ticks(...g) : p.ticks(g)), c && (p = p.tickValues(c))) : p.ticks(5), _.call(p);
33
- }).call((_) => _.select(".domain").remove()).call((_) => {
34
- let p = [];
35
- _.selectAll(".tick").each((v) => p.push(v)), i.xTicks = p;
36
- }).call((_) => _.selectAll(".tick line").remove()).call((_) => _.selectAll(".tick text").classed("sc-charts__x-axis-tick", !0)).attr("font-family", "inherit");
30
+ e.append("g").attr("transform", `translate(0,${n - a.bottom})`).call((p) => {
31
+ let _ = D.axisBottom(s);
32
+ u ? (h && (_ = _.tickFormat(h)), g && (_ = Array.isArray(g) ? _.ticks(...g) : _.ticks(g)), c && (_ = _.tickValues(c))) : _.ticks(5), p.call(_);
33
+ }).call((p) => p.select(".domain").remove()).call((p) => {
34
+ let _ = [];
35
+ p.selectAll(".tick").each((v) => _.push(v)), i.xTicks = _;
36
+ }).call((p) => p.selectAll(".tick line").remove()).call((p) => p.selectAll(".tick text").classed("sc-charts__x-axis-tick", !0)).attr("font-family", "inherit");
37
37
  }, Bs = (i) => {
38
38
  const { svg: e, config: t, y: s, width: n } = i, {
39
39
  margin: a,
@@ -84,66 +84,66 @@ const Fs = (i) => {
84
84
  return r.append("circle").attr("cx", t).attr("cy", s).attr("r", n).classed("sc-charts__hovered-circles", !0), r.append("circle").attr("cx", t).attr("cy", s).attr("r", n + a).classed("sc-charts__hovered-circles_add", !0), r;
85
85
  }
86
86
  };
87
- function Ps(i, e, t, s) {
87
+ function Os(i, e, t, s) {
88
88
  if (!i) return null;
89
89
  const n = i.width / 2, a = e - n, r = e + n;
90
90
  return a < t ? t : r > s ? s - i.width : e - n;
91
91
  }
92
- const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e).attr("x2", t).attr("y1", s).attr("y2", n).attr("stroke", "var(--sc-color-axis-zero-line)").attr("stroke-width", 1), Os = (i) => {
92
+ const Ut = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e).attr("x2", t).attr("y1", s).attr("y2", n).attr("stroke", "var(--sc-color-axis-zero-line)").attr("stroke-width", 1), Ps = (i) => {
93
93
  const { svg: e, config: t, x: s, y: n, height: a, data: r, wrapperNode: o } = i, {
94
94
  margin: c,
95
- grid: { verticalStyle: h, tooltipNode: u, hoverCirclesRadius: g, hoverCirclesAdditionalArea: _ }
95
+ grid: { verticalStyle: h, tooltipNode: u, hoverCirclesRadius: g, hoverCirclesAdditionalArea: p }
96
96
  } = t;
97
97
  if (h !== "none" && (h.startsWith("every-line") && (i.xTicks || s.ticks()).forEach((v) => {
98
98
  const b = e.append("line").attr("x1", s(v)).attr("x2", s(v)).attr("y1", c.top).attr("y2", a - c.bottom).attr("stroke", "var(--sc-color-axis-zero-line)").attr("stroke-width", 1);
99
99
  h === "every-line-dashed" && b.attr("stroke-dasharray", "4 4");
100
100
  }), h === "hovered-circles")) {
101
- const p = n.range()[0], v = s(r[0].date), b = s(r[r.length - 1].date);
102
- Et(e, { x1: v, x2: b, y1: p, y2: p });
103
- const { tooltipContainer: w, tooltip: C, tooltipArrow: y } = Rs(o);
104
- r.forEach((x, T) => {
105
- const F = s(x.date), R = n(x.value), $ = r[T - 1], P = T > 0 && $ && x.value === $.value;
106
- P || Et(e, { x1: F, x2: F, y1: R, y2: p });
107
- const j = $s(e, P, {
108
- x: F,
109
- y: p,
101
+ const _ = n.range()[0], v = s(r[0].date), b = s(r[r.length - 1].date);
102
+ Ut(e, { x1: v, x2: b, y1: _, y2: _ });
103
+ const { tooltipContainer: x, tooltip: C, tooltipArrow: y } = Rs(o);
104
+ r.forEach((w, S) => {
105
+ const L = s(w.date), R = n(w.value), $ = r[S - 1], O = S > 0 && $ && w.value === $.value;
106
+ O || Ut(e, { x1: L, x2: L, y1: R, y2: _ });
107
+ const K = $s(e, O, {
108
+ x: L,
109
+ y: _,
110
110
  r: g,
111
- hr: _
111
+ hr: p
112
112
  });
113
- u && j.on("mouseover", function() {
114
- Is(C), w.style.display = "block", C.append(u({ date: x.date, value: P ? null : x.value }));
115
- const q = C.getBoundingClientRect(), He = Ps(
116
- q,
117
- s(x.date),
113
+ u && K.on("mouseover", function() {
114
+ Is(C), x.style.display = "block", C.append(u({ date: w.date, value: O ? null : w.value }));
115
+ const j = C.getBoundingClientRect(), P = Os(
116
+ j,
117
+ s(w.date),
118
118
  i.config.margin.left - i.config.grid.tooltipArrowSize,
119
119
  i.width - i.config.margin.right + i.config.grid.tooltipArrowSize
120
120
  );
121
- C.style.left = He + "px", y.style.left = s(x.date) + "px";
121
+ C.style.left = P + "px", y.style.left = s(w.date) + "px";
122
122
  }).on("mouseout", function() {
123
- w.style.display = "none";
123
+ x.style.display = "none";
124
124
  });
125
125
  });
126
126
  }
127
127
  }, zs = (i) => {
128
- Bs(i), Os(i);
128
+ Bs(i), Ps(i);
129
129
  }, Vs = (i) => {
130
130
  const { svg: e, config: t, width: s, height: n } = i, { margin: a, logo: r } = t;
131
131
  Hs(i), Fs(i), r && e.append("image").attr("xlink:href", t.theme === "dark" ? r.picDarkTheme : r.picLightTheme).attr("width", r.width).attr("height", r.height).attr("x", r.x ?? (s - a.left - a.right) / 2 - r.width / 2 + a.left).attr("y", r.y ?? (n - a.top - a.bottom) / 2 - r.height / 2 + a.top), zs(i);
132
- }, me = (i, e, t) => {
132
+ }, Le = (i, e, t) => {
133
133
  let s = i.select(`#${e}`);
134
134
  return s.empty() && (s = i.append("linearGradient").attr("gradientUnits", "userSpaceOnUse").attr("id", e)), s.attr("x1", t.x1).attr("y1", t.x2).attr("x2", t.y1).attr("y2", t.y2), t.stops.forEach(({ offset: n, stopColor: a }) => {
135
135
  s.append("stop").attr("offset", n).attr("stop-color", a);
136
136
  }), s;
137
- }, ae = (i) => {
137
+ }, pe = (i) => {
138
138
  const e = D.select(i).select("defs");
139
139
  return e.empty() ? D.select(i).append("defs") : e;
140
- }, Qt = (i) => {
140
+ }, gi = (i) => {
141
141
  const {
142
142
  y: e,
143
143
  config: { margin: t }
144
144
  } = i, s = e.range()[0] - e(0), n = e.range()[0] - s >= 0 ? e.range()[0] - s : 0, a = s + t.bottom >= 0 ? s + t.bottom : 0;
145
145
  return { x: 0, y: n, width: "100%", height: a };
146
- }, Nt = (i, e) => ({
146
+ }, Gt = (i, e) => ({
147
147
  ...i,
148
148
  ...e,
149
149
  margin: {
@@ -178,8 +178,8 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
178
178
  ...i.selection,
179
179
  ...e == null ? void 0 : e.selection
180
180
  }
181
- }), Ft = (i, e = {}) => {
182
- const t = i.node(), s = ae(t), n = (o, c) => me(s, o, {
181
+ }), Zt = (i, e = {}) => {
182
+ const t = i.node(), s = pe(t), n = (o, c) => Le(s, o, {
183
183
  x1: "0%",
184
184
  y1: "0%",
185
185
  x2: "0%",
@@ -204,7 +204,7 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
204
204
  r.remove();
205
205
  }
206
206
  };
207
- }, Ue = (i, e = {}) => {
207
+ }, gt = (i, e = {}) => {
208
208
  const t = i.append("circle").attr("r", e.radius || 4).style("display", e.hidden ? "none" : "block"), s = e.className || "";
209
209
  return s && t.classed(s, !0), {
210
210
  className(n, a) {
@@ -217,9 +217,9 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
217
217
  t.remove();
218
218
  }
219
219
  };
220
- }, js = (i, e = {}) => {
221
- const t = "sc-charts__hover-line", s = i.append("line").style("display", e.hidden ? "none" : "block").classed(t, !0), n = i.node(), a = ae(n);
222
- return ((o, c) => me(a, o, {
220
+ }, Ys = (i, e = {}) => {
221
+ const t = "sc-charts__hover-line", s = i.append("line").style("display", e.hidden ? "none" : "block").classed(t, !0), n = i.node(), a = pe(n);
222
+ return ((o, c) => Le(a, o, {
223
223
  x1: "0%",
224
224
  y1: "0%",
225
225
  x2: "0%",
@@ -241,19 +241,19 @@ const Et = (i, { x1: e, x2: t, y1: s, y2: n }) => i.append("line").attr("x1", e)
241
241
  s.remove();
242
242
  }
243
243
  };
244
- }, ie = "sc-charts__range-tooltip", Ht = D.timeFormat("%b %e, %I:%M %p"), Ys = (i) => {
244
+ }, ue = "sc-charts__range-tooltip", qt = D.timeFormat("%b %e, %I:%M %p"), Ws = (i) => {
245
245
  const e = D.format(",.2f");
246
246
  return `${i < 0 ? "-" : ""}$${e(Math.abs(i))}`;
247
247
  };
248
- function Ws(i) {
248
+ function js(i) {
249
249
  const e = "http://www.w3.org/2000/svg", t = document.createElement("div");
250
- t.className = ie, t.style.position = "absolute", t.style.top = "0", t.style.pointerEvents = "none", t.style.display = "none", i.append(t);
250
+ t.className = ue, t.style.position = "absolute", t.style.top = "0", t.style.pointerEvents = "none", t.style.display = "none", i.append(t);
251
251
  const s = document.createElement("div");
252
- s.className = `${ie}-container`, t.append(s);
252
+ s.className = `${ue}-container`, t.append(s);
253
253
  const n = document.createElement("div");
254
- n.className = `${ie}-sum`, s.append(n);
254
+ n.className = `${ue}-sum`, s.append(n);
255
255
  const a = document.createElement("div");
256
- a.className = `${ie}-sum-icon`;
256
+ a.className = `${ue}-sum-icon`;
257
257
  const r = document.createElementNS(e, "svg");
258
258
  r.setAttribute("width", "14"), r.setAttribute("height", "14"), r.setAttribute("viewBox", "0 0 14 14"), r.setAttribute("fill", "none"), r.setAttribute("xmlns", e);
259
259
  const o = document.createElementNS(e, "path");
@@ -264,29 +264,29 @@ function Ws(i) {
264
264
  const c = document.createElement("div");
265
265
  n.append(c);
266
266
  const h = document.createElement("div");
267
- return h.className = `${ie}-time`, s.append(h), { wrapper: t, sumNode: c, timeNode: h };
267
+ return h.className = `${ue}-time`, s.append(h), { wrapper: t, sumNode: c, timeNode: h };
268
268
  }
269
269
  const Xs = (i) => {
270
- const { wrapper: e, sumNode: t, timeNode: s } = Ws(i.wrapperNode);
270
+ const { wrapper: e, sumNode: t, timeNode: s } = js(i.wrapperNode);
271
271
  return {
272
272
  className(n, a) {
273
- n === "remove" ? e.classList.remove(`${ie}${a}`) : e.classList.add(`${ie}${a}`);
273
+ n === "remove" ? e.classList.remove(`${ue}${a}`) : e.classList.add(`${ue}${a}`);
274
274
  },
275
275
  update({ leftPoint: n, rightPoint: a, x: r, y: o, hidden: c, closest: h }) {
276
276
  if (n && a && h && r !== void 0) {
277
- const u = a.value - n.value, { sumFormatter: g, timeFormatter: _ } = i.config.selection, p = (i.x(a.date) + i.x(n.date)) / 2, v = i.x(h.date) < p ? "left" : "right";
278
- let b = "", w = "";
277
+ const u = a.value - n.value, { sumFormatter: g, timeFormatter: p } = i.config.selection, _ = (i.x(a.date) + i.x(n.date)) / 2, v = i.x(h.date) < _ ? "left" : "right";
278
+ let b = "", x = "";
279
279
  if (g)
280
280
  b = g({ left: n.value, right: a.value, direction: v });
281
281
  else {
282
282
  const C = (u / Math.abs(n.value) * 100).toFixed(2);
283
- b = `${Ys(u)} (${C}%)`;
283
+ b = `${Ws(u)} (${C}%)`;
284
284
  }
285
- _ ? w = _({ left: n.date, right: a.date, direction: v }) : w = `${Ht(n.date)} to ${Ht(a.date)}`, t.textContent = b, s.textContent = w, requestAnimationFrame(() => {
286
- const C = e.getBoundingClientRect(), y = i.wrapperNode.getBoundingClientRect(), x = i.x(n.date), T = i.x(a.date);
287
- let R = (x + T) / 2 - C.width / 2;
288
- const $ = 0, P = y.width - C.width;
289
- R < $ && (R = $), R > P && (R = P), e.style.left = `${R}px`, e.style.top = `${o}px`;
285
+ p ? x = p({ left: n.date, right: a.date, direction: v }) : x = `${qt(n.date)} to ${qt(a.date)}`, t.textContent = b, s.textContent = x, requestAnimationFrame(() => {
286
+ const C = e.getBoundingClientRect(), y = i.wrapperNode.getBoundingClientRect(), w = i.x(n.date), S = i.x(a.date);
287
+ let R = (w + S) / 2 - C.width / 2;
288
+ const $ = 0, O = y.width - C.width;
289
+ R < $ && (R = $), R > O && (R = O), e.style.left = `${R}px`, e.style.top = `${o}px`;
290
290
  });
291
291
  }
292
292
  c !== void 0 && (e.style.display = c ? "none" : "block");
@@ -295,26 +295,26 @@ const Xs = (i) => {
295
295
  e.remove();
296
296
  }
297
297
  };
298
- }, ge = "sc-charts__hover-tooltip", Ge = 16, Us = D.timeFormat("%a, %b %d, %-I:%M %p"), Gs = (i) => {
298
+ }, Ee = "sc-charts__hover-tooltip", mt = 16, Us = D.timeFormat("%a, %b %d, %-I:%M %p"), Gs = (i) => {
299
299
  const e = D.format(",.2f");
300
300
  return `${i < 0 ? "-" : ""}$${e(Math.abs(i))}`;
301
301
  };
302
302
  function Zs(i) {
303
303
  const e = document.createElement("div");
304
- e.className = `${ge}-container`, e.style.position = "absolute", e.style.top = "0", e.style.pointerEvents = "none", e.style.display = "none", i.appendChild(e);
304
+ e.className = `${Ee}-container`, e.style.position = "absolute", e.style.top = "0", e.style.pointerEvents = "none", e.style.display = "none", i.appendChild(e);
305
305
  const t = document.createElement("div");
306
- t.className = `${ge}-sum`, e.appendChild(t);
306
+ t.className = `${Ee}-sum`, e.appendChild(t);
307
307
  const s = document.createElement("div");
308
- return s.className = `${ge}-time`, e.appendChild(s), { wrapper: e, sumNode: t, timeNode: s };
308
+ return s.className = `${Ee}-time`, e.appendChild(s), { wrapper: e, sumNode: t, timeNode: s };
309
309
  }
310
310
  function qs(i, e, t) {
311
- return i ? e + Ge + i.width < t ? e + Ge : e - Ge - i.width : null;
311
+ return i ? e + mt + i.width < t ? e + mt : e - mt - i.width : null;
312
312
  }
313
313
  const Js = (i) => {
314
314
  const { wrapper: e, sumNode: t, timeNode: s } = Zs(i.wrapperNode);
315
315
  return {
316
316
  className(n, a) {
317
- n === "remove" ? e.classList.remove(`${ge}${a}`) : e.classList.add(`${ge}${a}`);
317
+ n === "remove" ? e.classList.remove(`${Ee}${a}`) : e.classList.add(`${Ee}${a}`);
318
318
  },
319
319
  update({ hidden: n, dataItem: a }) {
320
320
  if (a) {
@@ -385,9 +385,9 @@ const Js = (i) => {
385
385
  },
386
386
  enableBelowZeroLine: !1,
387
387
  curveTension: 1
388
- }, Ne = (i) => D.curveCardinal.tension(i.config.curveTension), Ks = (i) => {
389
- const { svg: e, data: t, x: s, y: n, config: a } = i, r = e.node(), o = ae(r);
390
- me(o, "main-line-area-gradient", {
388
+ }, Qe = (i) => D.curveCardinal.tension(i.config.curveTension), Ks = (i) => {
389
+ const { svg: e, data: t, x: s, y: n, config: a } = i, r = e.node(), o = pe(r);
390
+ Le(o, "main-line-area-gradient", {
391
391
  x1: "0%",
392
392
  y1: "0%",
393
393
  x2: "0%",
@@ -397,15 +397,15 @@ const Js = (i) => {
397
397
  { offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
398
398
  ]
399
399
  });
400
- const h = D.area().x((_) => s(_.date)).y0(n.range()[0]).y1((_) => n(_.value)).curve(Ne(i)), u = "sc-charts__main-line-area", g = e.append("path").datum(t).attr("d", h).attr("class", u).classed(`${u}_hidden`, !a.hasMainLineArea);
400
+ const h = D.area().x((p) => s(p.date)).y0(n.range()[0]).y1((p) => n(p.value)).curve(Qe(i)), u = "sc-charts__main-line-area", g = e.append("path").datum(t).attr("d", h).attr("class", u).classed(`${u}_hidden`, !a.hasMainLineArea);
401
401
  return {
402
- className(_, p) {
403
- _ === "remove" ? g.classed(`${u}${p}`, !1) : g.classed(`${u}${p}`, !0);
402
+ className(p, _) {
403
+ p === "remove" ? g.classed(`${u}${_}`, !1) : g.classed(`${u}${_}`, !0);
404
404
  },
405
- update({ data: _, hidden: p }) {
406
- if (_ !== void 0 && g.datum(_).attr("d", h), p !== void 0) {
405
+ update({ data: p, hidden: _ }) {
406
+ if (p !== void 0 && g.datum(p).attr("d", h), _ !== void 0) {
407
407
  if (!a.hasMainLineArea) return null;
408
- g.classed(`${u}_hidden`, p);
408
+ g.classed(`${u}_hidden`, _);
409
409
  }
410
410
  },
411
411
  destroy() {
@@ -413,8 +413,8 @@ const Js = (i) => {
413
413
  }
414
414
  };
415
415
  }, en = (i, e = {}) => {
416
- const t = "sc-charts__range-line-area", { svg: s, x: n, y: a, config: r, data: o, chartId: c } = i, { clip: h } = e, u = s.node(), g = ae(u), _ = "range-line-area-gradient";
417
- me(g, _ + "_up", {
416
+ const t = "sc-charts__range-line-area", { svg: s, x: n, y: a, config: r, data: o, chartId: c } = i, { clip: h } = e, u = s.node(), g = pe(u), p = "range-line-area-gradient";
417
+ Le(g, p + "_up", {
418
418
  x1: "0%",
419
419
  y1: "0%",
420
420
  x2: "0%",
@@ -423,7 +423,7 @@ const Js = (i) => {
423
423
  { offset: "0%", stopColor: "var(--sc-color-selection-up)" },
424
424
  { offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
425
425
  ]
426
- }), me(g, _ + "_down", {
426
+ }), Le(g, p + "_down", {
427
427
  x1: "0%",
428
428
  y1: "0%",
429
429
  x2: "0%",
@@ -433,39 +433,39 @@ const Js = (i) => {
433
433
  { offset: "100%", stopColor: "rgba(255, 255, 255, 0)" }
434
434
  ]
435
435
  });
436
- const p = D.area().x((y) => n(y.date)).y0(a.range()[0]).y1((y) => a(y.value)).curve(Ne(i)), v = `${c}-clip-${t}`, w = g.append("clipPath").attr("id", v).append("rect").attr("x", (h == null ? void 0 : h.x) || 0).attr("y", (h == null ? void 0 : h.y) || 0).attr("width", (h == null ? void 0 : h.width) || "100%").attr("height", (h == null ? void 0 : h.height) || "100%"), C = s.append("path").datum(o).attr("d", p).attr("class", t).classed(`${t}_hidden`, !r.hasMainLineArea).attr("clip-path", `url(#${v})`);
436
+ const _ = D.area().x((y) => n(y.date)).y0(a.range()[0]).y1((y) => a(y.value)).curve(Qe(i)), v = `${c}-clip-${t}`, x = g.append("clipPath").attr("id", v).append("rect").attr("x", (h == null ? void 0 : h.x) || 0).attr("y", (h == null ? void 0 : h.y) || 0).attr("width", (h == null ? void 0 : h.width) || "100%").attr("height", (h == null ? void 0 : h.height) || "100%"), C = s.append("path").datum(o).attr("d", _).attr("class", t).classed(`${t}_hidden`, !r.hasMainLineArea).attr("clip-path", `url(#${v})`);
437
437
  return {
438
- className(y, x) {
439
- y === "remove" ? C.classed(`${t}${x}`, !1) : C.classed(`${t}${x}`, !0);
438
+ className(y, w) {
439
+ y === "remove" ? C.classed(`${t}${w}`, !1) : C.classed(`${t}${w}`, !0);
440
440
  },
441
- update({ data: y, hidden: x, clip: T }) {
442
- y !== void 0 && C.datum(y).attr("d", p), x !== void 0 && C.classed(`${t}_hidden`, x), T !== void 0 && w.attr("x", T.x).attr("y", T.y).attr("width", T.width).attr("height", T.height);
441
+ update({ data: y, hidden: w, clip: S }) {
442
+ y !== void 0 && C.datum(y).attr("d", _), w !== void 0 && C.classed(`${t}_hidden`, w), S !== void 0 && x.attr("x", S.x).attr("y", S.y).attr("width", S.width).attr("height", S.height);
443
443
  },
444
444
  destroy() {
445
445
  C.remove();
446
446
  }
447
447
  };
448
- }, Ze = (i, e) => {
449
- const { svg: t, data: s, x: n, y: a, chartId: r } = i, { baseClassName: o, id: c, clip: h } = e, u = t.node(), g = ae(u), _ = D.line().x((C) => n(C.date)).y((C) => a(C.value)).curve(Ne(i)), p = `${r}-clip-${o}`, b = g.append("clipPath").attr("id", p).append("rect").attr("x", (h == null ? void 0 : h.x) || 0).attr("y", (h == null ? void 0 : h.y) || 0).attr("width", (h == null ? void 0 : h.width) || "100%").attr("height", (h == null ? void 0 : h.height) || "100%"), w = t.append("path").classed(o, !0).datum(s).attr("d", _).attr("id", c).attr("clip-path", `url(#${p})`);
448
+ }, _t = (i, e) => {
449
+ const { svg: t, data: s, x: n, y: a, chartId: r } = i, { baseClassName: o, id: c, clip: h } = e, u = t.node(), g = pe(u), p = D.line().x((C) => n(C.date)).y((C) => a(C.value)).curve(Qe(i)), _ = `${r}-clip-${o}`, b = g.append("clipPath").attr("id", _).append("rect").attr("x", (h == null ? void 0 : h.x) || 0).attr("y", (h == null ? void 0 : h.y) || 0).attr("width", (h == null ? void 0 : h.width) || "100%").attr("height", (h == null ? void 0 : h.height) || "100%"), x = t.append("path").classed(o, !0).datum(s).attr("d", p).attr("id", c).attr("clip-path", `url(#${_})`);
450
450
  return {
451
451
  className(C, y) {
452
- C === "remove" ? w.classed(`${o}${y}`, !1) : w.classed(`${o}${y}`, !0);
452
+ C === "remove" ? x.classed(`${o}${y}`, !1) : x.classed(`${o}${y}`, !0);
453
453
  },
454
- update({ data: C, clip: y, hidden: x }) {
455
- C !== void 0 && w.datum(C).attr("d", _), x !== void 0 && w.classed(`${o}_hidden`, x), y !== void 0 && b.attr("x", y.x).attr("y", y.y).attr("width", y.width).attr("height", y.height);
454
+ update({ data: C, clip: y, hidden: w }) {
455
+ C !== void 0 && x.datum(C).attr("d", p), w !== void 0 && x.classed(`${o}_hidden`, w), y !== void 0 && b.attr("x", y.x).attr("y", y.y).attr("width", y.width).attr("height", y.height);
456
456
  },
457
457
  destroy() {
458
- w.remove();
458
+ x.remove();
459
459
  }
460
460
  };
461
461
  }, tn = (i, e) => {
462
- const { svg: t, data: s, x: n, y: a, chartId: r, config: o } = i, { baseClassName: c, id: h, clip: u } = e, g = t.node(), _ = ae(g), p = D.line().x((y) => n(y.date)).y((y) => a(y.value)).curve(Ne(i)), v = `${r}-clip-${c}`, w = _.append("clipPath").attr("id", v).append("rect").attr("x", (u == null ? void 0 : u.x) || 0).attr("y", (u == null ? void 0 : u.y) || 0).attr("width", (u == null ? void 0 : u.width) || "100%").attr("height", (u == null ? void 0 : u.height) || "100%"), C = t.append("path").classed(c, !0).datum(s).attr("d", p).attr("id", h).attr("clip-path", `url(#${v})`);
462
+ const { svg: t, data: s, x: n, y: a, chartId: r, config: o } = i, { baseClassName: c, id: h, clip: u } = e, g = t.node(), p = pe(g), _ = D.line().x((y) => n(y.date)).y((y) => a(y.value)).curve(Qe(i)), v = `${r}-clip-${c}`, x = p.append("clipPath").attr("id", v).append("rect").attr("x", (u == null ? void 0 : u.x) || 0).attr("y", (u == null ? void 0 : u.y) || 0).attr("width", (u == null ? void 0 : u.width) || "100%").attr("height", (u == null ? void 0 : u.height) || "100%"), C = t.append("path").classed(c, !0).datum(s).attr("d", _).attr("id", h).attr("clip-path", `url(#${v})`);
463
463
  return {
464
- className(y, x) {
465
- y === "remove" ? C.classed(`${c}${x}`, !1) : C.classed(`${c}${x}`, !0);
464
+ className(y, w) {
465
+ y === "remove" ? C.classed(`${c}${w}`, !1) : C.classed(`${c}${w}`, !0);
466
466
  },
467
- update({ data: y, clip: x, hidden: T }) {
468
- y !== void 0 && C.datum(y).attr("d", p), T !== void 0 && C.classed(`${c}_hidden`, T), x !== void 0 && (o.hover.transitionName === "default" ? w.transition().duration(o.hover.transitionDuration).attr("x", x.x).attr("y", x.y).attr("width", x.width).attr("height", x.height).ease(D.easeLinear) : w.attr("x", x.x).attr("y", x.y).attr("width", x.width).attr("height", x.height));
467
+ update({ data: y, clip: w, hidden: S }) {
468
+ y !== void 0 && C.datum(y).attr("d", _), S !== void 0 && C.classed(`${c}_hidden`, S), w !== void 0 && (o.hover.transitionName === "default" ? x.transition().duration(o.hover.transitionDuration).attr("x", w.x).attr("y", w.y).attr("width", w.width).attr("height", w.height).ease(D.easeLinear) : x.attr("x", w.x).attr("y", w.y).attr("width", w.width).attr("height", w.height));
469
469
  },
470
470
  destroy() {
471
471
  C.remove();
@@ -479,13 +479,13 @@ const Js = (i) => {
479
479
  const { svg: t, data: s, x: n, y: a } = i, { baseClassName: r } = e, o = t.append("g").classed(r, !0), c = o.append("circle").attr("r", 5).classed(`${r}-circle`, !0), h = o.append("text").attr("text-anchor", "middle").attr("dy", "-9px").classed(`${r}-label`, !0);
480
480
  return ((g) => {
481
481
  if (!g || g.length === 0) return;
482
- const _ = g[g.length - 1], p = n(_.date), v = a(_.value);
483
- c.attr("cx", p).attr("cy", v);
482
+ const p = g[g.length - 1], _ = n(p.date), v = a(p.value);
483
+ c.attr("cx", _).attr("cy", v);
484
484
  const b = i.config.extremePointFormatter || sn;
485
- h.attr("x", p).attr("y", v).text(b(_.value));
485
+ h.attr("x", _).attr("y", v).text(b(p.value));
486
486
  })(s), {
487
- className(g, _) {
488
- g === "remove" ? o.classed(`${r}${_}`, !1) : o.classed(`${r}${_}`, !0);
487
+ className(g, p) {
488
+ g === "remove" ? o.classed(`${r}${p}`, !1) : o.classed(`${r}${p}`, !0);
489
489
  },
490
490
  update({ hidden: g }) {
491
491
  g !== void 0 && o.classed(`${r}_hidden`, g);
@@ -495,7 +495,7 @@ const Js = (i) => {
495
495
  }
496
496
  };
497
497
  }, an = (i) => {
498
- const e = Ze(i, {
498
+ const e = _t(i, {
499
499
  baseClassName: "sc-charts__main-line",
500
500
  id: `${i.chartId}-sc-charts__main-line`
501
501
  }), t = Ks(i);
@@ -503,31 +503,31 @@ const Js = (i) => {
503
503
  i.config.hasExtremePoint && (s = nn(i, {
504
504
  baseClassName: "sc-charts__extreme-point"
505
505
  }));
506
- const n = js(i.svg), a = tn(i, {
506
+ const n = Ys(i.svg), a = tn(i, {
507
507
  baseClassName: "sc-charts__highlight-line",
508
508
  id: `${i.chartId}-sc-charts__highlight-line`,
509
509
  clip: { x: 0, y: 0, width: "0", height: "0" }
510
510
  });
511
511
  let r = null;
512
- i.config.enableBelowZeroLine && (r = Ze(i, {
512
+ i.config.enableBelowZeroLine && (r = _t(i, {
513
513
  baseClassName: "sc-charts__below-zero-line",
514
514
  id: `${i.chartId}-sc-charts__below-zero-line`,
515
- clip: Qt(i)
515
+ clip: gi(i)
516
516
  }));
517
- const o = Ue(i.svg, {
517
+ const o = gt(i.svg, {
518
518
  className: "sc-charts__hover-circle",
519
519
  hidden: !0
520
- }), c = Ft(i.svg), h = Ft(i.svg), u = Ze(i, {
520
+ }), c = Zt(i.svg), h = Zt(i.svg), u = _t(i, {
521
521
  baseClassName: "sc-charts__range-line",
522
522
  id: `${i.chartId}-sc-charts__range-line`,
523
523
  clip: { x: 0, y: 0, width: "0", height: "0" }
524
- }), g = Ue(i.svg, {
524
+ }), g = gt(i.svg, {
525
525
  className: "sc-charts__range-circle-left",
526
526
  hidden: !0
527
- }), _ = Ue(i.svg, {
527
+ }), p = gt(i.svg, {
528
528
  className: "sc-charts__range-circle-right",
529
529
  hidden: !0
530
- }), p = Xs(i), v = Js(i), b = en(i);
530
+ }), _ = Xs(i), v = Js(i), b = en(i);
531
531
  return {
532
532
  hoverLine: n,
533
533
  hoverCircle: o,
@@ -536,9 +536,9 @@ const Js = (i) => {
536
536
  rangeLine: u,
537
537
  rangeLineArea: b,
538
538
  rangeCircleLeft: g,
539
- rangeCircleRight: _,
539
+ rangeCircleRight: p,
540
540
  mainLine: e,
541
- rangeTooltip: p,
541
+ rangeTooltip: _,
542
542
  highlightLine: a,
543
543
  hoverTooltip: v,
544
544
  mainLineArea: t,
@@ -583,11 +583,11 @@ const Js = (i) => {
583
583
  };
584
584
  }
585
585
  if (e >= h && e < u) {
586
- const g = t(h), _ = t(u);
586
+ const g = t(h), p = t(u);
587
587
  return {
588
588
  x: g,
589
589
  y: 0,
590
- width: _ - g,
590
+ width: p - g,
591
591
  height: "100%"
592
592
  };
593
593
  }
@@ -612,11 +612,11 @@ const Js = (i) => {
612
612
  u = new Date(c.getFullYear(), c.getMonth() - r, 1);
613
613
  break;
614
614
  }
615
- const g = t(u), _ = t(c);
615
+ const g = t(u), p = t(c);
616
616
  return {
617
617
  x: g,
618
618
  y: 0,
619
- width: _ - g,
619
+ width: p - g,
620
620
  height: "100%"
621
621
  };
622
622
  }
@@ -626,7 +626,7 @@ const Js = (i) => {
626
626
  width: "100%",
627
627
  height: "100%"
628
628
  };
629
- }, Bt = (i, e) => {
629
+ }, Jt = (i, e) => {
630
630
  var h;
631
631
  const {
632
632
  x: t,
@@ -662,11 +662,11 @@ const Js = (i) => {
662
662
  height: c
663
663
  }
664
664
  })), n.mainLine.className("add", "_muted");
665
- }, It = (i) => {
665
+ }, Qt = (i) => {
666
666
  var t;
667
667
  const { elements: e } = i;
668
668
  e.hoverLine.update({ hidden: !0 }), e.hoverCircle.update({ hidden: !0 }), e.highlightLine.update({ hidden: !0 }), e.mainLine.className("remove", "_muted"), e.hoverTooltip.update({ hidden: !0 }), i.action !== "selection" && ((t = e.belowZeroLine) == null || t.update({
669
- clip: Qt(i)
669
+ clip: gi(i)
670
670
  }));
671
671
  }, on = (i, e) => {
672
672
  [
@@ -688,7 +688,7 @@ const Js = (i) => {
688
688
  config: { margin: a },
689
689
  height: r,
690
690
  elements: o
691
- } = i, c = s(e.date) < s(t.date) ? e : t, h = s(e.date) >= s(t.date) ? e : t, u = h.value - c.value >= 0, g = s(c.date), _ = s(h.date), p = _ - g;
691
+ } = i, c = s(e.date) < s(t.date) ? e : t, h = s(e.date) >= s(t.date) ? e : t, u = h.value - c.value >= 0, g = s(c.date), p = s(h.date), _ = p - g;
692
692
  o.rangeBorderLeft.update({
693
693
  x1: g,
694
694
  x2: g,
@@ -696,8 +696,8 @@ const Js = (i) => {
696
696
  y2: r - a.bottom,
697
697
  hidden: !1
698
698
  }), o.rangeBorderRight.update({
699
- x1: _,
700
- x2: _,
699
+ x1: p,
700
+ x2: p,
701
701
  y1: a.top,
702
702
  y2: r - a.bottom,
703
703
  hidden: !1
@@ -706,14 +706,14 @@ const Js = (i) => {
706
706
  cy: n(c.value),
707
707
  hidden: !1
708
708
  }), o.rangeCircleRight.update({
709
- cx: _,
709
+ cx: p,
710
710
  cy: n(h.value),
711
711
  hidden: !1
712
712
  }), o.rangeLine.update({
713
713
  clip: {
714
714
  x: g,
715
715
  y: 0,
716
- width: p,
716
+ width: _,
717
717
  height: n.range()[0]
718
718
  },
719
719
  hidden: !1
@@ -721,7 +721,7 @@ const Js = (i) => {
721
721
  clip: {
722
722
  x: g,
723
723
  y: 0,
724
- width: p,
724
+ width: _,
725
725
  height: n.range()[0]
726
726
  },
727
727
  hidden: !1
@@ -729,36 +729,36 @@ const Js = (i) => {
729
729
  rightPoint: h,
730
730
  leftPoint: c,
731
731
  closest: t,
732
- x: g + p / 2,
732
+ x: g + _ / 2,
733
733
  y: 0,
734
734
  hidden: !1
735
735
  }), (v = o.belowZeroLine) == null || v.update({
736
736
  hidden: !0
737
737
  }), o.mainLineArea.update({ hidden: !0 }), on(o, u), o.mainLine.className("add", "_selected-muted");
738
- }, Rt = (i) => {
738
+ }, Kt = (i) => {
739
739
  var t;
740
740
  const { elements: e } = i;
741
741
  e.rangeLine.update({ hidden: !0 }), e.rangeLineArea.update({ hidden: !0 }), e.rangeBorderLeft.update({ hidden: !0 }), e.rangeBorderRight.update({ hidden: !0 }), e.rangeCircleLeft.update({ hidden: !0 }), e.rangeCircleRight.update({ hidden: !0 }), e.rangeTooltip.update({ hidden: !0 }), e.mainLine.className("remove", "_selected-muted"), e.mainLineArea.update({ hidden: !1 }), (t = e.belowZeroLine) == null || t.update({ hidden: !1 });
742
742
  }, cn = (i) => {
743
743
  const { svg: e, data: t, x: s, config: n, width: a, height: r } = i, { margin: o, hover: c, selection: h } = n;
744
744
  let u = null, g = !1;
745
- const _ = (v) => t.reduce(
746
- (b, w) => Math.abs(s(b.date) - v) < Math.abs(s(w.date) - v) ? b : w
745
+ const p = (v) => t.reduce(
746
+ (b, x) => Math.abs(s(b.date) - v) < Math.abs(s(x.date) - v) ? b : x
747
747
  );
748
748
  e.append("rect").attr("width", a - o.left - o.right).attr("height", r - o.top - o.bottom).attr("x", o.left).attr("y", o.top).attr("fill", "transparent").on("mousemove", function(v) {
749
- const [b] = D.pointer(v, this), w = _(b);
750
- !g && c.enable ? (i.action = "hover", Bt(i, w)) : (i.action = g ? "selection" : "none", It(i)), u && h.enable && (i.action = "selection", ln(i, u, w));
749
+ const [b] = D.pointer(v, this), x = p(b);
750
+ !g && c.enable ? (i.action = "hover", Jt(i, x)) : (i.action = g ? "selection" : "none", Qt(i)), u && h.enable && (i.action = "selection", ln(i, u, x));
751
751
  }).on("mouseleave", () => {
752
- i.action = "none", g = !1, u = null, It(i), Rt(i);
752
+ i.action = "none", g = !1, u = null, Qt(i), Kt(i);
753
753
  }).on("mousedown", function(v) {
754
754
  if (h.enable) {
755
755
  g = !0, i.action = "selection";
756
756
  const [b] = D.pointer(v, this);
757
- u = _(b);
757
+ u = p(b);
758
758
  }
759
759
  }).on("mouseup", function(v) {
760
- const [b] = D.pointer(v, this), w = _(b);
761
- g = !1, u = null, i.action = "hover", h.enable && Rt(i), c.enable && Bt(i, w);
760
+ const [b] = D.pointer(v, this), x = p(b);
761
+ g = !1, u = null, i.action = "hover", h.enable && Kt(i), c.enable && Jt(i, x);
762
762
  });
763
763
  }, hn = (i, e, t) => {
764
764
  const { margin: s } = e, n = D.scaleTime(), a = D.extent(i, (r) => new Date(r.date));
@@ -774,21 +774,21 @@ const Js = (i) => {
774
774
  return console.error(`chartId is required and must be a valid id
775
775
  (only letters, numbers or underscores. The first character must be a letter)`), null;
776
776
  const s = t.append("div"), n = s.append("svg"), a = t.node();
777
- let r = a.getBoundingClientRect(), o = r.width, c = r.height, h = Nt({ ...Qs }, e.config), u = e.data;
777
+ let r = a.getBoundingClientRect(), o = r.width, c = r.height, h = Gt({ ...Qs }, e.config), u = e.data;
778
778
  const g = () => {
779
- r = a.getBoundingClientRect(), o = r.width, c = r.height, _({ data: u, config: h });
779
+ r = a.getBoundingClientRect(), o = r.width, c = r.height, p({ data: u, config: h });
780
780
  };
781
781
  window.addEventListener("resize", g);
782
- const _ = (p, v = !1) => {
783
- v && p.config && (h = Nt(h, p.config)), v && p.data && (u = p.data);
784
- const b = u.map((T) => ({ date: new Date(T.date), value: T.value })).sort((T, F) => T.date.getTime() - F.date.getTime()), w = hn(b, h, o), C = dn(b, h, c);
782
+ const p = (_, v = !1) => {
783
+ v && _.config && (h = Gt(h, _.config)), v && _.data && (u = _.data);
784
+ const b = u.map((S) => ({ date: new Date(S.date), value: S.value })).sort((S, L) => S.date.getTime() - L.date.getTime()), x = hn(b, h, o), C = dn(b, h, c);
785
785
  s.attr("class", `sc-charts sc-charts__${h.theme}`), n.attr("preserveAspectRatio", "xMinYMin meet").attr("viewBox", `0 0 ${o} ${c}`).style("width", "100%").style("height", "100%").selectAll("*").remove();
786
786
  const y = {
787
787
  chartId: e.chartId,
788
788
  svg: n,
789
789
  wrapperNode: s.node(),
790
790
  data: b,
791
- x: w,
791
+ x,
792
792
  y: C,
793
793
  config: h,
794
794
  action: "none",
@@ -796,38 +796,38 @@ const Js = (i) => {
796
796
  height: c
797
797
  };
798
798
  Vs(y);
799
- const x = {
799
+ const w = {
800
800
  ...y,
801
801
  elements: an(y)
802
802
  };
803
- cn(x);
803
+ cn(w);
804
804
  };
805
- return _(e), {
806
- update: (p) => _(p, !0),
805
+ return p(e), {
806
+ update: (_) => p(_, !0),
807
807
  destroy: () => {
808
808
  window.removeEventListener("resize", g), n.remove();
809
809
  }
810
810
  };
811
811
  };
812
- var Te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
812
+ var Xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
813
813
  function un(i) {
814
814
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
815
815
  }
816
- var ue = { exports: {} };
817
- ue.exports;
818
- var $t;
816
+ var ke = { exports: {} };
817
+ ke.exports;
818
+ var ei;
819
819
  function fn() {
820
- return $t || ($t = 1, function(i, e) {
821
- var t = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", u = "[object Boolean]", g = "[object Date]", _ = "[object Error]", p = "[object Function]", v = "[object GeneratorFunction]", b = "[object Map]", w = "[object Number]", C = "[object Null]", y = "[object Object]", x = "[object Proxy]", T = "[object RegExp]", F = "[object Set]", R = "[object String]", $ = "[object Undefined]", P = "[object WeakMap]", j = "[object ArrayBuffer]", q = "[object DataView]", He = "[object Float32Array]", ri = "[object Float64Array]", oi = "[object Int8Array]", li = "[object Int16Array]", ci = "[object Int32Array]", hi = "[object Uint8Array]", di = "[object Uint8ClampedArray]", ui = "[object Uint16Array]", fi = "[object Uint32Array]", gi = /[\\^$.*+?()[\]{}|]/g, mi = /^\[object .+?Constructor\]$/, _i = /^(?:0|[1-9]\d*)$/, N = {};
822
- N[He] = N[ri] = N[oi] = N[li] = N[ci] = N[hi] = N[di] = N[ui] = N[fi] = !0, N[o] = N[c] = N[j] = N[u] = N[q] = N[g] = N[_] = N[p] = N[b] = N[w] = N[y] = N[T] = N[F] = N[R] = N[P] = !1;
823
- var lt = typeof Te == "object" && Te && Te.Object === Object && Te, pi = typeof self == "object" && self && self.Object === Object && self, re = lt || pi || Function("return this")(), ct = e && !e.nodeType && e, oe = ct && !0 && i && !i.nodeType && i, ht = oe && oe.exports === ct, Be = ht && lt.process, dt = function() {
820
+ return ei || (ei = 1, function(i, e) {
821
+ var t = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", u = "[object Boolean]", g = "[object Date]", p = "[object Error]", _ = "[object Function]", v = "[object GeneratorFunction]", b = "[object Map]", x = "[object Number]", C = "[object Null]", y = "[object Object]", w = "[object Proxy]", S = "[object RegExp]", L = "[object Set]", R = "[object String]", $ = "[object Undefined]", O = "[object WeakMap]", K = "[object ArrayBuffer]", j = "[object DataView]", P = "[object Float32Array]", X = "[object Float64Array]", U = "[object Int8Array]", He = "[object Int16Array]", et = "[object Int32Array]", re = "[object Uint8Array]", ve = "[object Uint8ClampedArray]", be = "[object Uint16Array]", Be = "[object Uint32Array]", Ie = /[\\^$.*+?()[\]{}|]/g, Re = /^\[object .+?Constructor\]$/, tt = /^(?:0|[1-9]\d*)$/, N = {};
822
+ N[P] = N[X] = N[U] = N[He] = N[et] = N[re] = N[ve] = N[be] = N[Be] = !0, N[o] = N[c] = N[K] = N[u] = N[j] = N[g] = N[p] = N[_] = N[b] = N[x] = N[y] = N[S] = N[L] = N[R] = N[O] = !1;
823
+ var z = typeof Xe == "object" && Xe && Xe.Object === Object && Xe, fe = typeof self == "object" && self && self.Object === Object && self, G = z || fe || Function("return this")(), Z = e && !e.nodeType && e, se = Z && !0 && i && !i.nodeType && i, ye = se && se.exports === Z, ge = ye && z.process, we = function() {
824
824
  try {
825
- var l = oe && oe.require && oe.require("util").types;
826
- return l || Be && Be.binding && Be.binding("util");
825
+ var l = se && se.require && se.require("util").types;
826
+ return l || ge && ge.binding && ge.binding("util");
827
827
  } catch {
828
828
  }
829
- }(), ut = dt && dt.isTypedArray;
830
- function vi(l, d, m) {
829
+ }(), xe = we && we.isTypedArray;
830
+ function oe(l, d, m) {
831
831
  switch (m.length) {
832
832
  case 0:
833
833
  return l.call(d);
@@ -840,17 +840,17 @@ function fn() {
840
840
  }
841
841
  return l.apply(d, m);
842
842
  }
843
- function bi(l, d) {
844
- for (var m = -1, M = Array(l); ++m < l; )
845
- M[m] = d(m);
846
- return M;
843
+ function le(l, d) {
844
+ for (var m = -1, A = Array(l); ++m < l; )
845
+ A[m] = d(m);
846
+ return A;
847
847
  }
848
- function yi(l) {
848
+ function it(l) {
849
849
  return function(d) {
850
850
  return l(d);
851
851
  };
852
852
  }
853
- function wi(l, d) {
853
+ function Ce(l, d) {
854
854
  return l == null ? void 0 : l[d];
855
855
  }
856
856
  function xi(l, d) {
@@ -858,41 +858,41 @@ function fn() {
858
858
  return l(d(m));
859
859
  };
860
860
  }
861
- var Ci = Array.prototype, Mi = Function.prototype, ve = Object.prototype, Ie = re["__core-js_shared__"], be = Mi.toString, J = ve.hasOwnProperty, ft = function() {
862
- var l = /[^.]+$/.exec(Ie && Ie.keys && Ie.keys.IE_PROTO || "");
861
+ var Ci = Array.prototype, Ai = Function.prototype, $e = Object.prototype, st = G["__core-js_shared__"], Oe = Ai.toString, ne = $e.hasOwnProperty, Dt = function() {
862
+ var l = /[^.]+$/.exec(st && st.keys && st.keys.IE_PROTO || "");
863
863
  return l ? "Symbol(src)_1." + l : "";
864
- }(), gt = ve.toString, Ai = be.call(Object), Ti = RegExp(
865
- "^" + be.call(J).replace(gi, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
866
- ), ye = ht ? re.Buffer : void 0, mt = re.Symbol, _t = re.Uint8Array;
867
- ye && ye.allocUnsafe;
868
- var pt = xi(Object.getPrototypeOf, Object), vt = Object.create, Si = ve.propertyIsEnumerable, ki = Ci.splice, K = mt ? mt.toStringTag : void 0, we = function() {
864
+ }(), Et = $e.toString, Mi = Oe.call(Object), Si = RegExp(
865
+ "^" + Oe.call(ne).replace(Ie, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
866
+ ), Pe = ye ? G.Buffer : void 0, Lt = G.Symbol, Nt = G.Uint8Array;
867
+ Pe && Pe.allocUnsafe;
868
+ var Ft = xi(Object.getPrototypeOf, Object), Ht = Object.create, Ti = $e.propertyIsEnumerable, ki = Ci.splice, ce = Lt ? Lt.toStringTag : void 0, ze = function() {
869
869
  try {
870
- var l = Pe(Object, "defineProperty");
870
+ var l = rt(Object, "defineProperty");
871
871
  return l({}, "", {}), l;
872
872
  } catch {
873
873
  }
874
- }(), Di = ye ? ye.isBuffer : void 0, bt = Math.max, Li = Date.now, yt = Pe(re, "Map"), le = Pe(Object, "create"), Ei = /* @__PURE__ */ function() {
874
+ }(), Di = Pe ? Pe.isBuffer : void 0, Bt = Math.max, Ei = Date.now, It = rt(G, "Map"), Ae = rt(Object, "create"), Li = /* @__PURE__ */ function() {
875
875
  function l() {
876
876
  }
877
877
  return function(d) {
878
- if (!te(d))
878
+ if (!de(d))
879
879
  return {};
880
- if (vt)
881
- return vt(d);
880
+ if (Ht)
881
+ return Ht(d);
882
882
  l.prototype = d;
883
883
  var m = new l();
884
884
  return l.prototype = void 0, m;
885
885
  };
886
886
  }();
887
- function ee(l) {
887
+ function he(l) {
888
888
  var d = -1, m = l == null ? 0 : l.length;
889
889
  for (this.clear(); ++d < m; ) {
890
- var M = l[d];
891
- this.set(M[0], M[1]);
890
+ var A = l[d];
891
+ this.set(A[0], A[1]);
892
892
  }
893
893
  }
894
894
  function Ni() {
895
- this.__data__ = le ? le(null) : {}, this.size = 0;
895
+ this.__data__ = Ae ? Ae(null) : {}, this.size = 0;
896
896
  }
897
897
  function Fi(l) {
898
898
  var d = this.has(l) && delete this.__data__[l];
@@ -900,85 +900,85 @@ function fn() {
900
900
  }
901
901
  function Hi(l) {
902
902
  var d = this.__data__;
903
- if (le) {
903
+ if (Ae) {
904
904
  var m = d[l];
905
905
  return m === s ? void 0 : m;
906
906
  }
907
- return J.call(d, l) ? d[l] : void 0;
907
+ return ne.call(d, l) ? d[l] : void 0;
908
908
  }
909
909
  function Bi(l) {
910
910
  var d = this.__data__;
911
- return le ? d[l] !== void 0 : J.call(d, l);
911
+ return Ae ? d[l] !== void 0 : ne.call(d, l);
912
912
  }
913
913
  function Ii(l, d) {
914
914
  var m = this.__data__;
915
- return this.size += this.has(l) ? 0 : 1, m[l] = le && d === void 0 ? s : d, this;
915
+ return this.size += this.has(l) ? 0 : 1, m[l] = Ae && d === void 0 ? s : d, this;
916
916
  }
917
- ee.prototype.clear = Ni, ee.prototype.delete = Fi, ee.prototype.get = Hi, ee.prototype.has = Bi, ee.prototype.set = Ii;
918
- function U(l) {
917
+ he.prototype.clear = Ni, he.prototype.delete = Fi, he.prototype.get = Hi, he.prototype.has = Bi, he.prototype.set = Ii;
918
+ function ee(l) {
919
919
  var d = -1, m = l == null ? 0 : l.length;
920
920
  for (this.clear(); ++d < m; ) {
921
- var M = l[d];
922
- this.set(M[0], M[1]);
921
+ var A = l[d];
922
+ this.set(A[0], A[1]);
923
923
  }
924
924
  }
925
925
  function Ri() {
926
926
  this.__data__ = [], this.size = 0;
927
927
  }
928
928
  function $i(l) {
929
- var d = this.__data__, m = xe(d, l);
929
+ var d = this.__data__, m = Ve(d, l);
930
930
  if (m < 0)
931
931
  return !1;
932
- var M = d.length - 1;
933
- return m == M ? d.pop() : ki.call(d, m, 1), --this.size, !0;
932
+ var A = d.length - 1;
933
+ return m == A ? d.pop() : ki.call(d, m, 1), --this.size, !0;
934
934
  }
935
- function Pi(l) {
936
- var d = this.__data__, m = xe(d, l);
935
+ function Oi(l) {
936
+ var d = this.__data__, m = Ve(d, l);
937
937
  return m < 0 ? void 0 : d[m][1];
938
938
  }
939
- function Oi(l) {
940
- return xe(this.__data__, l) > -1;
939
+ function Pi(l) {
940
+ return Ve(this.__data__, l) > -1;
941
941
  }
942
942
  function zi(l, d) {
943
- var m = this.__data__, M = xe(m, l);
944
- return M < 0 ? (++this.size, m.push([l, d])) : m[M][1] = d, this;
943
+ var m = this.__data__, A = Ve(m, l);
944
+ return A < 0 ? (++this.size, m.push([l, d])) : m[A][1] = d, this;
945
945
  }
946
- U.prototype.clear = Ri, U.prototype.delete = $i, U.prototype.get = Pi, U.prototype.has = Oi, U.prototype.set = zi;
947
- function se(l) {
946
+ ee.prototype.clear = Ri, ee.prototype.delete = $i, ee.prototype.get = Oi, ee.prototype.has = Pi, ee.prototype.set = zi;
947
+ function me(l) {
948
948
  var d = -1, m = l == null ? 0 : l.length;
949
949
  for (this.clear(); ++d < m; ) {
950
- var M = l[d];
951
- this.set(M[0], M[1]);
950
+ var A = l[d];
951
+ this.set(A[0], A[1]);
952
952
  }
953
953
  }
954
954
  function Vi() {
955
955
  this.size = 0, this.__data__ = {
956
- hash: new ee(),
957
- map: new (yt || U)(),
958
- string: new ee()
956
+ hash: new he(),
957
+ map: new (It || ee)(),
958
+ string: new he()
959
959
  };
960
960
  }
961
- function ji(l) {
962
- var d = Me(this, l).delete(l);
963
- return this.size -= d ? 1 : 0, d;
964
- }
965
961
  function Yi(l) {
966
- return Me(this, l).get(l);
962
+ var d = We(this, l).delete(l);
963
+ return this.size -= d ? 1 : 0, d;
967
964
  }
968
965
  function Wi(l) {
969
- return Me(this, l).has(l);
966
+ return We(this, l).get(l);
967
+ }
968
+ function ji(l) {
969
+ return We(this, l).has(l);
970
970
  }
971
971
  function Xi(l, d) {
972
- var m = Me(this, l), M = m.size;
973
- return m.set(l, d), this.size += m.size == M ? 0 : 1, this;
972
+ var m = We(this, l), A = m.size;
973
+ return m.set(l, d), this.size += m.size == A ? 0 : 1, this;
974
974
  }
975
- se.prototype.clear = Vi, se.prototype.delete = ji, se.prototype.get = Yi, se.prototype.has = Wi, se.prototype.set = Xi;
976
- function ne(l) {
977
- var d = this.__data__ = new U(l);
975
+ me.prototype.clear = Vi, me.prototype.delete = Yi, me.prototype.get = Wi, me.prototype.has = ji, me.prototype.set = Xi;
976
+ function _e(l) {
977
+ var d = this.__data__ = new ee(l);
978
978
  this.size = d.size;
979
979
  }
980
980
  function Ui() {
981
- this.__data__ = new U(), this.size = 0;
981
+ this.__data__ = new ee(), this.size = 0;
982
982
  }
983
983
  function Gi(l) {
984
984
  var d = this.__data__, m = d.delete(l);
@@ -992,40 +992,40 @@ function fn() {
992
992
  }
993
993
  function Ji(l, d) {
994
994
  var m = this.__data__;
995
- if (m instanceof U) {
996
- var M = m.__data__;
997
- if (!yt || M.length < t - 1)
998
- return M.push([l, d]), this.size = ++m.size, this;
999
- m = this.__data__ = new se(M);
995
+ if (m instanceof ee) {
996
+ var A = m.__data__;
997
+ if (!It || A.length < t - 1)
998
+ return A.push([l, d]), this.size = ++m.size, this;
999
+ m = this.__data__ = new me(A);
1000
1000
  }
1001
1001
  return m.set(l, d), this.size = m.size, this;
1002
1002
  }
1003
- ne.prototype.clear = Ui, ne.prototype.delete = Gi, ne.prototype.get = Zi, ne.prototype.has = qi, ne.prototype.set = Ji;
1003
+ _e.prototype.clear = Ui, _e.prototype.delete = Gi, _e.prototype.get = Zi, _e.prototype.has = qi, _e.prototype.set = Ji;
1004
1004
  function Qi(l, d) {
1005
- var m = Ve(l), M = !m && ze(l), S = !m && !M && At(l), E = !m && !M && !S && St(l), H = m || M || S || E, L = H ? bi(l.length, String) : [], B = L.length;
1006
- for (var Y in l)
1005
+ var m = ct(l), A = !m && lt(l), T = !m && !A && zt(l), F = !m && !A && !T && Yt(l), H = m || A || T || F, E = H ? le(l.length, String) : [], B = E.length;
1006
+ for (var q in l)
1007
1007
  H && // Safari 9 has enumerable `arguments.length` in strict mode.
1008
- (Y == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
1009
- S && (Y == "offset" || Y == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
1010
- E && (Y == "buffer" || Y == "byteLength" || Y == "byteOffset") || // Skip index properties.
1011
- Ct(Y, B)) || L.push(Y);
1012
- return L;
1008
+ (q == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
1009
+ T && (q == "offset" || q == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
1010
+ F && (q == "buffer" || q == "byteLength" || q == "byteOffset") || // Skip index properties.
1011
+ Ot(q, B)) || E.push(q);
1012
+ return E;
1013
1013
  }
1014
- function Re(l, d, m) {
1015
- (m !== void 0 && !Ae(l[d], m) || m === void 0 && !(d in l)) && $e(l, d, m);
1014
+ function nt(l, d, m) {
1015
+ (m !== void 0 && !je(l[d], m) || m === void 0 && !(d in l)) && at(l, d, m);
1016
1016
  }
1017
1017
  function Ki(l, d, m) {
1018
- var M = l[d];
1019
- (!(J.call(l, d) && Ae(M, m)) || m === void 0 && !(d in l)) && $e(l, d, m);
1018
+ var A = l[d];
1019
+ (!(ne.call(l, d) && je(A, m)) || m === void 0 && !(d in l)) && at(l, d, m);
1020
1020
  }
1021
- function xe(l, d) {
1021
+ function Ve(l, d) {
1022
1022
  for (var m = l.length; m--; )
1023
- if (Ae(l[m][0], d))
1023
+ if (je(l[m][0], d))
1024
1024
  return m;
1025
1025
  return -1;
1026
1026
  }
1027
- function $e(l, d, m) {
1028
- d == "__proto__" && we ? we(l, d, {
1027
+ function at(l, d, m) {
1028
+ d == "__proto__" && ze ? ze(l, d, {
1029
1029
  configurable: !0,
1030
1030
  enumerable: !0,
1031
1031
  value: m,
@@ -1033,149 +1033,149 @@ function fn() {
1033
1033
  }) : l[d] = m;
1034
1034
  }
1035
1035
  var es = fs();
1036
- function Ce(l) {
1037
- return l == null ? l === void 0 ? $ : C : K && K in Object(l) ? gs(l) : ys(l);
1036
+ function Ye(l) {
1037
+ return l == null ? l === void 0 ? $ : C : ce && ce in Object(l) ? gs(l) : ys(l);
1038
1038
  }
1039
- function wt(l) {
1040
- return ce(l) && Ce(l) == o;
1039
+ function Rt(l) {
1040
+ return Me(l) && Ye(l) == o;
1041
1041
  }
1042
1042
  function ts(l) {
1043
- if (!te(l) || vs(l))
1043
+ if (!de(l) || vs(l))
1044
1044
  return !1;
1045
- var d = Ye(l) ? Ti : mi;
1046
- return d.test(Ms(l));
1045
+ var d = dt(l) ? Si : Re;
1046
+ return d.test(As(l));
1047
1047
  }
1048
1048
  function is(l) {
1049
- return ce(l) && Tt(l.length) && !!N[Ce(l)];
1049
+ return Me(l) && Vt(l.length) && !!N[Ye(l)];
1050
1050
  }
1051
1051
  function ss(l) {
1052
- if (!te(l))
1052
+ if (!de(l))
1053
1053
  return bs(l);
1054
- var d = Mt(l), m = [];
1055
- for (var M in l)
1056
- M == "constructor" && (d || !J.call(l, M)) || m.push(M);
1054
+ var d = Pt(l), m = [];
1055
+ for (var A in l)
1056
+ A == "constructor" && (d || !ne.call(l, A)) || m.push(A);
1057
1057
  return m;
1058
1058
  }
1059
- function xt(l, d, m, M, S) {
1060
- l !== d && es(d, function(E, H) {
1061
- if (S || (S = new ne()), te(E))
1062
- ns(l, d, H, m, xt, M, S);
1059
+ function $t(l, d, m, A, T) {
1060
+ l !== d && es(d, function(F, H) {
1061
+ if (T || (T = new _e()), de(F))
1062
+ ns(l, d, H, m, $t, A, T);
1063
1063
  else {
1064
- var L = M ? M(Oe(l, H), E, H + "", l, d, S) : void 0;
1065
- L === void 0 && (L = E), Re(l, H, L);
1064
+ var E = A ? A(ot(l, H), F, H + "", l, d, T) : void 0;
1065
+ E === void 0 && (E = F), nt(l, H, E);
1066
1066
  }
1067
- }, kt);
1067
+ }, Wt);
1068
1068
  }
1069
- function ns(l, d, m, M, S, E, H) {
1070
- var L = Oe(l, m), B = Oe(d, m), Y = H.get(B);
1071
- if (Y) {
1072
- Re(l, m, Y);
1069
+ function ns(l, d, m, A, T, F, H) {
1070
+ var E = ot(l, m), B = ot(d, m), q = H.get(B);
1071
+ if (q) {
1072
+ nt(l, m, q);
1073
1073
  return;
1074
1074
  }
1075
- var O = E ? E(L, B, m + "", l, d, H) : void 0, he = O === void 0;
1076
- if (he) {
1077
- var We = Ve(B), Xe = !We && At(B), Lt = !We && !Xe && St(B);
1078
- O = B, We || Xe || Lt ? Ve(L) ? O = L : As(L) ? O = hs(L) : Xe ? (he = !1, O = os(B)) : Lt ? (he = !1, O = cs(B)) : O = [] : Ts(B) || ze(B) ? (O = L, ze(L) ? O = Ss(L) : (!te(L) || Ye(L)) && (O = ms(B))) : he = !1;
1075
+ var V = F ? F(E, B, m + "", l, d, H) : void 0, Se = V === void 0;
1076
+ if (Se) {
1077
+ var ut = ct(B), ft = !ut && zt(B), Xt = !ut && !ft && Yt(B);
1078
+ V = B, ut || ft || Xt ? ct(E) ? V = E : Ms(E) ? V = hs(E) : ft ? (Se = !1, V = os(B)) : Xt ? (Se = !1, V = cs(B)) : V = [] : Ss(B) || lt(B) ? (V = E, lt(E) ? V = Ts(E) : (!de(E) || dt(E)) && (V = ms(B))) : Se = !1;
1079
1079
  }
1080
- he && (H.set(B, O), S(O, B, M, E, H), H.delete(B)), Re(l, m, O);
1080
+ Se && (H.set(B, V), T(V, B, A, F, H), H.delete(B)), nt(l, m, V);
1081
1081
  }
1082
1082
  function as(l, d) {
1083
- return xs(ws(l, d, Dt), l + "");
1083
+ return xs(ws(l, d, jt), l + "");
1084
1084
  }
1085
- var rs = we ? function(l, d) {
1086
- return we(l, "toString", {
1085
+ var rs = ze ? function(l, d) {
1086
+ return ze(l, "toString", {
1087
1087
  configurable: !0,
1088
1088
  enumerable: !1,
1089
1089
  value: Ds(d),
1090
1090
  writable: !0
1091
1091
  });
1092
- } : Dt;
1092
+ } : jt;
1093
1093
  function os(l, d) {
1094
1094
  return l.slice();
1095
1095
  }
1096
1096
  function ls(l) {
1097
1097
  var d = new l.constructor(l.byteLength);
1098
- return new _t(d).set(new _t(l)), d;
1098
+ return new Nt(d).set(new Nt(l)), d;
1099
1099
  }
1100
1100
  function cs(l, d) {
1101
1101
  var m = ls(l.buffer);
1102
1102
  return new l.constructor(m, l.byteOffset, l.length);
1103
1103
  }
1104
1104
  function hs(l, d) {
1105
- var m = -1, M = l.length;
1106
- for (d || (d = Array(M)); ++m < M; )
1105
+ var m = -1, A = l.length;
1106
+ for (d || (d = Array(A)); ++m < A; )
1107
1107
  d[m] = l[m];
1108
1108
  return d;
1109
1109
  }
1110
- function ds(l, d, m, M) {
1111
- var S = !m;
1110
+ function ds(l, d, m, A) {
1111
+ var T = !m;
1112
1112
  m || (m = {});
1113
- for (var E = -1, H = d.length; ++E < H; ) {
1114
- var L = d[E], B = void 0;
1115
- B === void 0 && (B = l[L]), S ? $e(m, L, B) : Ki(m, L, B);
1113
+ for (var F = -1, H = d.length; ++F < H; ) {
1114
+ var E = d[F], B = void 0;
1115
+ B === void 0 && (B = l[E]), T ? at(m, E, B) : Ki(m, E, B);
1116
1116
  }
1117
1117
  return m;
1118
1118
  }
1119
1119
  function us(l) {
1120
1120
  return as(function(d, m) {
1121
- var M = -1, S = m.length, E = S > 1 ? m[S - 1] : void 0, H = S > 2 ? m[2] : void 0;
1122
- for (E = l.length > 3 && typeof E == "function" ? (S--, E) : void 0, H && _s(m[0], m[1], H) && (E = S < 3 ? void 0 : E, S = 1), d = Object(d); ++M < S; ) {
1123
- var L = m[M];
1124
- L && l(d, L, M, E);
1121
+ var A = -1, T = m.length, F = T > 1 ? m[T - 1] : void 0, H = T > 2 ? m[2] : void 0;
1122
+ for (F = l.length > 3 && typeof F == "function" ? (T--, F) : void 0, H && _s(m[0], m[1], H) && (F = T < 3 ? void 0 : F, T = 1), d = Object(d); ++A < T; ) {
1123
+ var E = m[A];
1124
+ E && l(d, E, A, F);
1125
1125
  }
1126
1126
  return d;
1127
1127
  });
1128
1128
  }
1129
1129
  function fs(l) {
1130
- return function(d, m, M) {
1131
- for (var S = -1, E = Object(d), H = M(d), L = H.length; L--; ) {
1132
- var B = H[++S];
1133
- if (m(E[B], B, E) === !1)
1130
+ return function(d, m, A) {
1131
+ for (var T = -1, F = Object(d), H = A(d), E = H.length; E--; ) {
1132
+ var B = H[++T];
1133
+ if (m(F[B], B, F) === !1)
1134
1134
  break;
1135
1135
  }
1136
1136
  return d;
1137
1137
  };
1138
1138
  }
1139
- function Me(l, d) {
1139
+ function We(l, d) {
1140
1140
  var m = l.__data__;
1141
1141
  return ps(d) ? m[typeof d == "string" ? "string" : "hash"] : m.map;
1142
1142
  }
1143
- function Pe(l, d) {
1144
- var m = wi(l, d);
1143
+ function rt(l, d) {
1144
+ var m = Ce(l, d);
1145
1145
  return ts(m) ? m : void 0;
1146
1146
  }
1147
1147
  function gs(l) {
1148
- var d = J.call(l, K), m = l[K];
1148
+ var d = ne.call(l, ce), m = l[ce];
1149
1149
  try {
1150
- l[K] = void 0;
1151
- var M = !0;
1150
+ l[ce] = void 0;
1151
+ var A = !0;
1152
1152
  } catch {
1153
1153
  }
1154
- var S = gt.call(l);
1155
- return M && (d ? l[K] = m : delete l[K]), S;
1154
+ var T = Et.call(l);
1155
+ return A && (d ? l[ce] = m : delete l[ce]), T;
1156
1156
  }
1157
1157
  function ms(l) {
1158
- return typeof l.constructor == "function" && !Mt(l) ? Ei(pt(l)) : {};
1158
+ return typeof l.constructor == "function" && !Pt(l) ? Li(Ft(l)) : {};
1159
1159
  }
1160
- function Ct(l, d) {
1160
+ function Ot(l, d) {
1161
1161
  var m = typeof l;
1162
- return d = d ?? r, !!d && (m == "number" || m != "symbol" && _i.test(l)) && l > -1 && l % 1 == 0 && l < d;
1162
+ return d = d ?? r, !!d && (m == "number" || m != "symbol" && tt.test(l)) && l > -1 && l % 1 == 0 && l < d;
1163
1163
  }
1164
1164
  function _s(l, d, m) {
1165
- if (!te(m))
1165
+ if (!de(m))
1166
1166
  return !1;
1167
- var M = typeof d;
1168
- return (M == "number" ? je(m) && Ct(d, m.length) : M == "string" && d in m) ? Ae(m[d], l) : !1;
1167
+ var A = typeof d;
1168
+ return (A == "number" ? ht(m) && Ot(d, m.length) : A == "string" && d in m) ? je(m[d], l) : !1;
1169
1169
  }
1170
1170
  function ps(l) {
1171
1171
  var d = typeof l;
1172
1172
  return d == "string" || d == "number" || d == "symbol" || d == "boolean" ? l !== "__proto__" : l === null;
1173
1173
  }
1174
1174
  function vs(l) {
1175
- return !!ft && ft in l;
1175
+ return !!Dt && Dt in l;
1176
1176
  }
1177
- function Mt(l) {
1178
- var d = l && l.constructor, m = typeof d == "function" && d.prototype || ve;
1177
+ function Pt(l) {
1178
+ var d = l && l.constructor, m = typeof d == "function" && d.prototype || $e;
1179
1179
  return l === m;
1180
1180
  }
1181
1181
  function bs(l) {
@@ -1186,19 +1186,19 @@ function fn() {
1186
1186
  return d;
1187
1187
  }
1188
1188
  function ys(l) {
1189
- return gt.call(l);
1189
+ return Et.call(l);
1190
1190
  }
1191
1191
  function ws(l, d, m) {
1192
- return d = bt(d === void 0 ? l.length - 1 : d, 0), function() {
1193
- for (var M = arguments, S = -1, E = bt(M.length - d, 0), H = Array(E); ++S < E; )
1194
- H[S] = M[d + S];
1195
- S = -1;
1196
- for (var L = Array(d + 1); ++S < d; )
1197
- L[S] = M[S];
1198
- return L[d] = m(H), vi(l, this, L);
1192
+ return d = Bt(d === void 0 ? l.length - 1 : d, 0), function() {
1193
+ for (var A = arguments, T = -1, F = Bt(A.length - d, 0), H = Array(F); ++T < F; )
1194
+ H[T] = A[d + T];
1195
+ T = -1;
1196
+ for (var E = Array(d + 1); ++T < d; )
1197
+ E[T] = A[T];
1198
+ return E[d] = m(H), oe(l, this, E);
1199
1199
  };
1200
1200
  }
1201
- function Oe(l, d) {
1201
+ function ot(l, d) {
1202
1202
  if (!(d === "constructor" && typeof l[d] == "function") && d != "__proto__")
1203
1203
  return l[d];
1204
1204
  }
@@ -1206,8 +1206,8 @@ function fn() {
1206
1206
  function Cs(l) {
1207
1207
  var d = 0, m = 0;
1208
1208
  return function() {
1209
- var M = Li(), S = a - (M - m);
1210
- if (m = M, S > 0) {
1209
+ var A = Ei(), T = a - (A - m);
1210
+ if (m = A, T > 0) {
1211
1211
  if (++d >= n)
1212
1212
  return arguments[0];
1213
1213
  } else
@@ -1215,10 +1215,10 @@ function fn() {
1215
1215
  return l.apply(void 0, arguments);
1216
1216
  };
1217
1217
  }
1218
- function Ms(l) {
1218
+ function As(l) {
1219
1219
  if (l != null) {
1220
1220
  try {
1221
- return be.call(l);
1221
+ return Oe.call(l);
1222
1222
  } catch {
1223
1223
  }
1224
1224
  try {
@@ -1228,78 +1228,78 @@ function fn() {
1228
1228
  }
1229
1229
  return "";
1230
1230
  }
1231
- function Ae(l, d) {
1231
+ function je(l, d) {
1232
1232
  return l === d || l !== l && d !== d;
1233
1233
  }
1234
- var ze = wt(/* @__PURE__ */ function() {
1234
+ var lt = Rt(/* @__PURE__ */ function() {
1235
1235
  return arguments;
1236
- }()) ? wt : function(l) {
1237
- return ce(l) && J.call(l, "callee") && !Si.call(l, "callee");
1238
- }, Ve = Array.isArray;
1239
- function je(l) {
1240
- return l != null && Tt(l.length) && !Ye(l);
1236
+ }()) ? Rt : function(l) {
1237
+ return Me(l) && ne.call(l, "callee") && !Ti.call(l, "callee");
1238
+ }, ct = Array.isArray;
1239
+ function ht(l) {
1240
+ return l != null && Vt(l.length) && !dt(l);
1241
1241
  }
1242
- function As(l) {
1243
- return ce(l) && je(l);
1242
+ function Ms(l) {
1243
+ return Me(l) && ht(l);
1244
1244
  }
1245
- var At = Di || Ls;
1246
- function Ye(l) {
1247
- if (!te(l))
1245
+ var zt = Di || Es;
1246
+ function dt(l) {
1247
+ if (!de(l))
1248
1248
  return !1;
1249
- var d = Ce(l);
1250
- return d == p || d == v || d == h || d == x;
1249
+ var d = Ye(l);
1250
+ return d == _ || d == v || d == h || d == w;
1251
1251
  }
1252
- function Tt(l) {
1252
+ function Vt(l) {
1253
1253
  return typeof l == "number" && l > -1 && l % 1 == 0 && l <= r;
1254
1254
  }
1255
- function te(l) {
1255
+ function de(l) {
1256
1256
  var d = typeof l;
1257
1257
  return l != null && (d == "object" || d == "function");
1258
1258
  }
1259
- function ce(l) {
1259
+ function Me(l) {
1260
1260
  return l != null && typeof l == "object";
1261
1261
  }
1262
- function Ts(l) {
1263
- if (!ce(l) || Ce(l) != y)
1262
+ function Ss(l) {
1263
+ if (!Me(l) || Ye(l) != y)
1264
1264
  return !1;
1265
- var d = pt(l);
1265
+ var d = Ft(l);
1266
1266
  if (d === null)
1267
1267
  return !0;
1268
- var m = J.call(d, "constructor") && d.constructor;
1269
- return typeof m == "function" && m instanceof m && be.call(m) == Ai;
1268
+ var m = ne.call(d, "constructor") && d.constructor;
1269
+ return typeof m == "function" && m instanceof m && Oe.call(m) == Mi;
1270
1270
  }
1271
- var St = ut ? yi(ut) : is;
1272
- function Ss(l) {
1273
- return ds(l, kt(l));
1271
+ var Yt = xe ? it(xe) : is;
1272
+ function Ts(l) {
1273
+ return ds(l, Wt(l));
1274
1274
  }
1275
- function kt(l) {
1276
- return je(l) ? Qi(l) : ss(l);
1275
+ function Wt(l) {
1276
+ return ht(l) ? Qi(l) : ss(l);
1277
1277
  }
1278
1278
  var ks = us(function(l, d, m) {
1279
- xt(l, d, m);
1279
+ $t(l, d, m);
1280
1280
  });
1281
1281
  function Ds(l) {
1282
1282
  return function() {
1283
1283
  return l;
1284
1284
  };
1285
1285
  }
1286
- function Dt(l) {
1286
+ function jt(l) {
1287
1287
  return l;
1288
1288
  }
1289
- function Ls() {
1289
+ function Es() {
1290
1290
  return !1;
1291
1291
  }
1292
1292
  i.exports = ks;
1293
- }(ue, ue.exports)), ue.exports;
1293
+ }(ke, ke.exports)), ke.exports;
1294
1294
  }
1295
1295
  var gn = fn();
1296
- const De = /* @__PURE__ */ un(gn), Pt = 12, mn = {
1296
+ const Ze = /* @__PURE__ */ un(gn), ti = 12, mn = {
1297
1297
  candles: {
1298
1298
  direction: "right",
1299
- offset: `${Math.round(Pt / 2)}px`,
1299
+ offset: `${Math.round(ti / 2)}px`,
1300
1300
  style: "filled",
1301
1301
  strokeWidth: 1,
1302
- baseWidth: Pt,
1302
+ baseWidth: ti,
1303
1303
  bodyRatio: 0.7,
1304
1304
  zoomOnWheel: "both",
1305
1305
  scaleSensitivity: 2e-3,
@@ -1347,11 +1347,11 @@ class _n {
1347
1347
  f(this, "_yAxis");
1348
1348
  f(this, "_guides");
1349
1349
  f(this, "_trade");
1350
- const t = De({}, mn, e);
1350
+ const t = Ze({}, mn, e);
1351
1351
  this._candles = t.candles, this._xAxis = t.xAxis, this._yAxis = t.yAxis, this._guides = t.guides, this._trade = t.trade;
1352
1352
  }
1353
1353
  update(e) {
1354
- const t = De(
1354
+ const t = Ze(
1355
1355
  {},
1356
1356
  {
1357
1357
  candles: this._candles,
@@ -1380,7 +1380,7 @@ class _n {
1380
1380
  return this._trade;
1381
1381
  }
1382
1382
  }
1383
- class V {
1383
+ class W {
1384
1384
  constructor(e) {
1385
1385
  f(this, "x");
1386
1386
  f(this, "y");
@@ -1423,32 +1423,32 @@ class V {
1423
1423
  }
1424
1424
  class pn {
1425
1425
  constructor(e, t) {
1426
- f(this, "_chart", new V());
1427
- f(this, "_area", new V());
1428
- f(this, "_xAxis", new V());
1429
- f(this, "_yAxis", new V());
1430
- f(this, "_axisIntersection", new V());
1426
+ f(this, "_chart", new W());
1427
+ f(this, "_area", new W());
1428
+ f(this, "_xAxis", new W());
1429
+ f(this, "_yAxis", new W());
1430
+ f(this, "_axisIntersection", new W());
1431
1431
  const { xAxis: s, yAxis: n } = t;
1432
- this._chart = new V(e), this._calc(s, n);
1432
+ this._chart = new W(e), this._calc(s, n);
1433
1433
  }
1434
1434
  _calc(e, t) {
1435
1435
  const s = e.isShow ? e.height : 0, n = t.isShow ? t.width : 0, a = this._chart.height - s, r = this._chart.width - n;
1436
- this._area = new V({
1436
+ this._area = new W({
1437
1437
  x: t.position === "left" ? n : 0,
1438
1438
  y: e.position === "top" ? s : 0,
1439
1439
  width: r,
1440
1440
  height: a
1441
- }), this._xAxis = new V({
1441
+ }), this._xAxis = new W({
1442
1442
  y: e.position === "top" ? 0 : a,
1443
1443
  x: t.position === "left" ? n : 0,
1444
1444
  height: s,
1445
1445
  width: r
1446
- }), this._yAxis = new V({
1446
+ }), this._yAxis = new W({
1447
1447
  y: e.position === "top" ? s : 0,
1448
1448
  x: t.position === "left" ? 0 : r,
1449
1449
  width: n,
1450
1450
  height: a
1451
- }), this._axisIntersection = new V({
1451
+ }), this._axisIntersection = new W({
1452
1452
  y: e.position === "top" ? 0 : a,
1453
1453
  x: t.position === "left" ? 0 : r,
1454
1454
  width: n,
@@ -1461,7 +1461,7 @@ class pn {
1461
1461
  }
1462
1462
  update(e) {
1463
1463
  const { xAxis: t, yAxis: s } = e.config;
1464
- this._chart = new V(e.container), this._calc(t, s);
1464
+ this._chart = new W(e.container), this._calc(t, s);
1465
1465
  }
1466
1466
  get area() {
1467
1467
  return this._area;
@@ -1494,7 +1494,7 @@ function bn(i, e) {
1494
1494
  }
1495
1495
  return t;
1496
1496
  }
1497
- function Ot(i, e) {
1497
+ function ii(i, e) {
1498
1498
  const t = vn(i[0]), s = bn(i, t), n = [];
1499
1499
  return s.forEach((a) => {
1500
1500
  if (a.length === 0) return;
@@ -1505,19 +1505,19 @@ function Ot(i, e) {
1505
1505
  throw new Error("[CS_Data] error while creating missing data");
1506
1506
  const c = r.close, h = o.open;
1507
1507
  let u = c;
1508
- a.forEach((g, _) => {
1509
- const p = (h - u) / a.length;
1510
- let v = u + p * _, b = v + p;
1511
- const w = Math.abs(v - b);
1512
- let C = Math.max(v, b) + w / 2, y = Math.min(v, b) - w / 2;
1508
+ a.forEach((g, p) => {
1509
+ const _ = (h - u) / a.length;
1510
+ let v = u + _ * p, b = v + _;
1511
+ const x = Math.abs(v - b);
1512
+ let C = Math.max(v, b) + x / 2, y = Math.min(v, b) - x / 2;
1513
1513
  if (e.trade) {
1514
- const T = [...e.trade.entries, ...e.trade.exits].find((F) => {
1515
- const R = F.time.getTime();
1514
+ const S = [...e.trade.entries, ...e.trade.exits].find((L) => {
1515
+ const R = L.time.getTime();
1516
1516
  return R >= g && R < g + t;
1517
1517
  });
1518
- T && (T.type === "buy" ? (y = T.price, b = Math.max(y, b), v = b + w, C = Math.max(v, b) + w / 2, u = v) : T.type === "sell" && (C = T.price, b = Math.min(C, b), v = b - w, y = Math.min(v, b) - w / 2, u = v));
1518
+ S && (S.type === "buy" ? (y = S.price, b = Math.max(y, b), v = b + x, C = Math.max(v, b) + x / 2, u = v) : S.type === "sell" && (C = S.price, b = Math.min(C, b), v = b - x, y = Math.min(v, b) - x / 2, u = v));
1519
1519
  }
1520
- const x = {
1520
+ const w = {
1521
1521
  open_time: new Date(g),
1522
1522
  close_time: new Date(g + t),
1523
1523
  open: v,
@@ -1525,11 +1525,11 @@ function Ot(i, e) {
1525
1525
  high: C,
1526
1526
  low: y
1527
1527
  };
1528
- n.push(x);
1528
+ n.push(w);
1529
1529
  });
1530
1530
  }), n;
1531
1531
  }
1532
- class nt {
1532
+ class Mt {
1533
1533
  constructor(e, t) {
1534
1534
  f(this, "_initialData", []);
1535
1535
  f(this, "_preparedData", []);
@@ -1543,10 +1543,10 @@ class nt {
1543
1543
  return e.map((t) => ({ ...t, open_time: new Date(t.open_time), close_time: new Date(t.close_time) })).sort((t, s) => t.open_time.getTime() - s.open_time.getTime());
1544
1544
  }
1545
1545
  update(e) {
1546
- this._initialData = e, this._preparedData = this._prepare(e), this._missingData = Ot(this._preparedData, this._model), this._count = this._preparedData.length + this._missingData.length, this._interval = new Date(e[0].close_time).getTime() - new Date(e[0].open_time).getTime();
1546
+ this._initialData = e, this._preparedData = this._prepare(e), this._missingData = ii(this._preparedData, this._model), this._count = this._preparedData.length + this._missingData.length, this._interval = new Date(e[0].close_time).getTime() - new Date(e[0].open_time).getTime();
1547
1547
  }
1548
1548
  updateMissingCandles() {
1549
- this._missingData = Ot(this._preparedData, this._model);
1549
+ this._missingData = ii(this._preparedData, this._model);
1550
1550
  }
1551
1551
  get initialData() {
1552
1552
  return this._initialData;
@@ -1589,7 +1589,7 @@ class yn {
1589
1589
  });
1590
1590
  }
1591
1591
  }
1592
- class Kt {
1592
+ class mi {
1593
1593
  constructor() {
1594
1594
  f(this, "_scale");
1595
1595
  }
@@ -1625,17 +1625,17 @@ class Kt {
1625
1625
  return this._scale(e);
1626
1626
  }
1627
1627
  }
1628
- class ei extends Kt {
1628
+ class _i extends mi {
1629
1629
  constructor() {
1630
1630
  super(), this._scale = D.scaleTime();
1631
1631
  }
1632
1632
  }
1633
- class wn extends Kt {
1633
+ class wn extends mi {
1634
1634
  constructor() {
1635
1635
  super(), this._scale = D.scaleLinear();
1636
1636
  }
1637
1637
  }
1638
- const zt = { x: 0.2, y: 0.2 }, Vt = 1e-3, xn = {
1638
+ const si = { x: 0.2, y: 0.2 }, ni = 1e-3, xn = {
1639
1639
  s: 1e3,
1640
1640
  M: 1e3 * 60,
1641
1641
  h: 1e3 * 60 * 60,
@@ -1645,7 +1645,7 @@ const zt = { x: 0.2, y: 0.2 }, Vt = 1e-3, xn = {
1645
1645
  const e = i.match(/^(\d+)([a-zA-Z]+)$/);
1646
1646
  if (!e) throw new Error(`Invalid offset format: "${i}"`);
1647
1647
  return [parseInt(e[1]), e[2]];
1648
- }, Mn = (i, e) => {
1648
+ }, An = (i, e) => {
1649
1649
  const [t, s] = e.domain().map((o) => o.getTime()), n = i.filter((o) => {
1650
1650
  const c = o.open_time.getTime();
1651
1651
  return c >= t && c <= s;
@@ -1653,7 +1653,7 @@ const zt = { x: 0.2, y: 0.2 }, Vt = 1e-3, xn = {
1653
1653
  if (a == null || r == null) throw new Error("Invalid Y data");
1654
1654
  return [a, r];
1655
1655
  };
1656
- class An {
1656
+ class Mn {
1657
1657
  constructor(e) {
1658
1658
  this.model = e;
1659
1659
  }
@@ -1663,14 +1663,14 @@ class An {
1663
1663
  e.setDomain(s), this.setRange(e, this.model.layout.xAxis), this.setDefaultXDomain(e), this.applyOffset(e);
1664
1664
  }
1665
1665
  initY(e, t) {
1666
- const s = Mn(this.model.candles.preparedData, t);
1666
+ const s = An(this.model.candles.preparedData, t);
1667
1667
  e.setDomain(s), this.setRange(e, this.model.layout.yAxis);
1668
1668
  }
1669
1669
  init(e) {
1670
1670
  this.initX(e.x), this.initY(e.y, e.x);
1671
1671
  }
1672
1672
  setRange(e, { x: t, y: s, width: n, height: a }) {
1673
- e instanceof ei ? e.setRange([t, t + n]) : e.setRange([s + a, s]);
1673
+ e instanceof _i ? e.setRange([t, t + n]) : e.setRange([s + a, s]);
1674
1674
  }
1675
1675
  setDefaultXDomain(e) {
1676
1676
  const {
@@ -1679,8 +1679,8 @@ class An {
1679
1679
  config: {
1680
1680
  candles: { baseWidth: n, bodyRatio: a, direction: r }
1681
1681
  }
1682
- } = this.model, [o, c] = e.domain().map((p) => p.getTime()), h = c - o, u = n / a * t, g = h * (s.width / u), _ = r === "left" ? [new Date(o), new Date(o + g)] : [new Date(c - g), new Date(c)];
1683
- e.setDomain(_);
1682
+ } = this.model, [o, c] = e.domain().map((_) => _.getTime()), h = c - o, u = n / a * t, g = h * (s.width / u), p = r === "left" ? [new Date(o), new Date(o + g)] : [new Date(c - g), new Date(c)];
1683
+ e.setDomain(p);
1684
1684
  }
1685
1685
  applyOffset(e) {
1686
1686
  const {
@@ -1692,7 +1692,7 @@ class An {
1692
1692
  e.setDomain([new Date(h.getTime() + c), new Date(u.getTime() + c)]);
1693
1693
  }
1694
1694
  }
1695
- class Tn {
1695
+ class Sn {
1696
1696
  constructor(e) {
1697
1697
  f(this, "_model");
1698
1698
  f(this, "_scaleX");
@@ -1704,7 +1704,7 @@ class Tn {
1704
1704
  });
1705
1705
  f(this, "scaleFactor", { x: 1, y: 1 });
1706
1706
  f(this, "panOffset", { x: 0, y: 0 });
1707
- this._model = e, this._scaleX = new ei(), this._scaleY = new wn(), this._initializer = new An(e), this._initializer.init({ x: this._scaleX, y: this._scaleY }), this._baseDomain = {
1707
+ this._model = e, this._scaleX = new _i(), this._scaleY = new wn(), this._initializer = new Mn(e), this._initializer.init({ x: this._scaleX, y: this._scaleY }), this._baseDomain = {
1708
1708
  x: this._scaleX.domain(),
1709
1709
  y: this._scaleY.domain()
1710
1710
  };
@@ -1745,12 +1745,12 @@ class Tn {
1745
1745
  }
1746
1746
  scale(e, t, s = "delta") {
1747
1747
  if (s === "absolute") {
1748
- const n = Math.max(zt[e], t);
1749
- if (Math.abs(n - this.scaleFactor[e]) < Vt) return;
1748
+ const n = Math.max(si[e], t);
1749
+ if (Math.abs(n - this.scaleFactor[e]) < ni) return;
1750
1750
  this.scaleFactor[e] = n;
1751
1751
  } else {
1752
1752
  const n = this.scaleFactor[e], a = n + t * this._model.config.candles.scaleSensitivity;
1753
- if (a < zt[e] || Math.abs(a - n) < Vt) return;
1753
+ if (a < si[e] || Math.abs(a - n) < ni) return;
1754
1754
  this.scaleFactor[e] = a;
1755
1755
  }
1756
1756
  this._updateDomain(e);
@@ -1776,7 +1776,7 @@ class Tn {
1776
1776
  this._model.eventBus.emit("scale_event");
1777
1777
  }
1778
1778
  }
1779
- class Sn {
1779
+ class Tn {
1780
1780
  constructor(e, { entry: t = [], exit: s = [] }) {
1781
1781
  f(this, "_model");
1782
1782
  f(this, "_rawEntry");
@@ -1976,10 +1976,10 @@ const Dn = {
1976
1976
  }
1977
1977
  }
1978
1978
  };
1979
- class Ln {
1979
+ class En {
1980
1980
  constructor(e) {
1981
1981
  f(this, "_scheme");
1982
- this._scheme = De({}, Dn, e), Object.keys(this._scheme).forEach((t) => {
1982
+ this._scheme = Ze({}, Dn, e), Object.keys(this._scheme).forEach((t) => {
1983
1983
  Object.defineProperty(this, t, {
1984
1984
  get: () => this._scheme[t],
1985
1985
  enumerable: !0
@@ -1987,10 +1987,10 @@ class Ln {
1987
1987
  });
1988
1988
  }
1989
1989
  update(e) {
1990
- this._scheme = De({}, this._scheme, e);
1990
+ this._scheme = Ze({}, this._scheme, e);
1991
1991
  }
1992
1992
  }
1993
- class En {
1993
+ class Ln {
1994
1994
  constructor(e, t) {
1995
1995
  f(this, "_data");
1996
1996
  f(this, "_callbacks", {
@@ -2008,7 +2008,7 @@ class En {
2008
2008
  _updateGroups() {
2009
2009
  this._grouped = {};
2010
2010
  for (const e of this._data) {
2011
- const t = nt.findByDate(new Date(e.date), this._model.candles.allData);
2011
+ const t = Mt.findByDate(new Date(e.date), this._model.candles.allData);
2012
2012
  if (!t) continue;
2013
2013
  const s = t.open_time.getTime();
2014
2014
  this._grouped[s] || (this._grouped[s] = []), this._grouped[s].push({ ...e, candle: t });
@@ -2055,7 +2055,7 @@ class Nn {
2055
2055
  f(this, "trade");
2056
2056
  f(this, "userMarkers");
2057
2057
  f(this, "comments");
2058
- this.chartId = e, this.container = t, this.candles = new nt(s, this), this.config = new _n(n), this.colorScheme = new Ln(o), this.layout = new pn(t, this.config), this.scales = new Tn(this), this.trade = new Sn(this, a), this.candles.updateMissingCandles(), this.trade.recalculate(), this.userMarkers = new kn(this, r), this.comments = new En(c, this);
2058
+ this.chartId = e, this.container = t, this.candles = new Mt(s, this), this.config = new _n(n), this.colorScheme = new En(o), this.layout = new pn(t, this.config), this.scales = new Sn(this), this.trade = new Tn(this, a), this.candles.updateMissingCandles(), this.trade.recalculate(), this.userMarkers = new kn(this, r), this.comments = new Ln(c, this);
2059
2059
  }
2060
2060
  init() {
2061
2061
  this.eventBus.emit("init_model");
@@ -2085,7 +2085,7 @@ class Nn {
2085
2085
  this.eventBus.emit("update_comments", e);
2086
2086
  }
2087
2087
  }
2088
- const Se = window.devicePixelRatio || 2;
2088
+ const Ue = window.devicePixelRatio || 2;
2089
2089
  class k {
2090
2090
  constructor({ tag: e, className: t, id: s, textContent: n }) {
2091
2091
  f(this, "_tag");
@@ -2124,7 +2124,7 @@ class k {
2124
2124
  this.node.style.opacity = e ? "1" : "0", this.node.style.visibility = e ? "visible" : "hidden";
2125
2125
  }
2126
2126
  }
2127
- class _e extends k {
2127
+ class Ne extends k {
2128
2128
  constructor({ className: t, id: s, width: n, height: a, isMain: r }) {
2129
2129
  super({
2130
2130
  tag: "canvas",
@@ -2138,10 +2138,10 @@ class _e extends k {
2138
2138
  this._width = n, this._height = a, this.updateSize({ width: n, height: a });
2139
2139
  const o = this._node.getContext("2d");
2140
2140
  if (!o) throw new Error("Failed to get 2D context");
2141
- o.scale(Se, Se), this._ctx = o;
2141
+ o.scale(Ue, Ue), this._ctx = o;
2142
2142
  }
2143
2143
  updateSize({ width: t, height: s }) {
2144
- t && (this._node.width = t * Se, this._node.style.width = `${t}px`, this._width = t), s && (this._node.height = s * Se, this._node.style.height = `${s}px`, this._height = s);
2144
+ t && (this._node.width = t * Ue, this._node.style.width = `${t}px`, this._width = t), s && (this._node.height = s * Ue, this._node.style.height = `${s}px`, this._height = s);
2145
2145
  }
2146
2146
  clear() {
2147
2147
  this.background ? (this._ctx.save(), this._ctx.fillStyle = this.background, this._ctx.fillRect(0, 0, this._width, this._height), this._ctx.restore()) : this._ctx.clearRect(0, 0, this._width, this._height);
@@ -2165,8 +2165,8 @@ function Hn(i, e) {
2165
2165
  scales: a
2166
2166
  } = e, r = a.x.ticks(Fn), o = (u) => u.getHours() === 0 && u.getMinutes() === 0, c = D.timeFormat("%d %b"), h = D.timeFormat("%H:%M");
2167
2167
  i.save(), i.fillStyle = s.bg, i.fillRect(t.x, t.y, t.width, t.height), i.restore(), i.fillStyle = s.text, i.font = `${n.text.fontSize} ${n.text.font}`, i.textAlign = "center", i.textBaseline = "middle", r.forEach((u) => {
2168
- const g = a.x.convert(u), _ = o(u) ? c(u) : h(u);
2169
- i.fillText(_, g, t.y + t.height / 2);
2168
+ const g = a.x.convert(u), p = o(u) ? c(u) : h(u);
2169
+ i.fillText(p, g, t.y + t.height / 2);
2170
2170
  });
2171
2171
  }
2172
2172
  function Bn(i, e) {
@@ -2193,7 +2193,7 @@ const In = (i, e) => {
2193
2193
  t.height
2194
2194
  ), i.restore();
2195
2195
  };
2196
- class qe {
2196
+ class pt {
2197
2197
  static xAxis(e, t) {
2198
2198
  Hn(e, t);
2199
2199
  }
@@ -2231,38 +2231,38 @@ class Rn {
2231
2231
  this._target.addEventListener("contextmenu", e);
2232
2232
  }
2233
2233
  }
2234
- function Le(i) {
2234
+ function qe(i) {
2235
2235
  return i * 0.1875;
2236
2236
  }
2237
2237
  const $n = (i, { mainColor: e, textColor: t, symbol: s, x: n, y: a, size: r, fontSize: o }) => {
2238
- const g = r / 16, _ = 16 * g, p = n - _ / 2, v = a;
2239
- i.save(), i.translate(p, v), i.scale(g, g), i.beginPath(), i.moveTo(7.85696, 0.288512), i.lineTo(4.53377, 3.11938), i.bezierCurveTo(4.17982, 3.42089, 4.39305, 4, 4.85801, 4), i.lineTo(11.2275, 4), i.bezierCurveTo(11.6818, 4, 11.9006, 3.44302, 11.5678, 3.13374), i.lineTo(8.52156, 0.302869), i.bezierCurveTo(8.33575, 0.130189, 8.05007, 0.124018, 7.85696, 0.288512), i.closePath(), i.fillStyle = e, i.fill(), i.beginPath(), i.moveTo(0, 7), i.bezierCurveTo(0, 4.79086, 1.79086, 3, 4, 3), i.lineTo(12, 3), i.bezierCurveTo(14.2091, 3, 16, 4.79086, 16, 7), i.lineTo(16, 15), i.bezierCurveTo(16, 17.2091, 14.2091, 19, 12, 19), i.lineTo(4, 19), i.bezierCurveTo(1.79086, 19, 0, 17.2091, 0, 15), i.lineTo(0, 7), i.closePath(), i.fillStyle = e, i.fill(), i.restore(), i.save(), i.font = `bold ${o}px sans-serif`, i.textAlign = "center", i.textBaseline = "top", i.textAlign = "center", i.textBaseline = "middle";
2240
- const b = a + g * 3 + 0.5, w = g * 16, C = b + w / 2;
2238
+ const g = r / 16, p = 16 * g, _ = n - p / 2, v = a;
2239
+ i.save(), i.translate(_, v), i.scale(g, g), i.beginPath(), i.moveTo(7.85696, 0.288512), i.lineTo(4.53377, 3.11938), i.bezierCurveTo(4.17982, 3.42089, 4.39305, 4, 4.85801, 4), i.lineTo(11.2275, 4), i.bezierCurveTo(11.6818, 4, 11.9006, 3.44302, 11.5678, 3.13374), i.lineTo(8.52156, 0.302869), i.bezierCurveTo(8.33575, 0.130189, 8.05007, 0.124018, 7.85696, 0.288512), i.closePath(), i.fillStyle = e, i.fill(), i.beginPath(), i.moveTo(0, 7), i.bezierCurveTo(0, 4.79086, 1.79086, 3, 4, 3), i.lineTo(12, 3), i.bezierCurveTo(14.2091, 3, 16, 4.79086, 16, 7), i.lineTo(16, 15), i.bezierCurveTo(16, 17.2091, 14.2091, 19, 12, 19), i.lineTo(4, 19), i.bezierCurveTo(1.79086, 19, 0, 17.2091, 0, 15), i.lineTo(0, 7), i.closePath(), i.fillStyle = e, i.fill(), i.restore(), i.save(), i.font = `bold ${o}px sans-serif`, i.textAlign = "center", i.textBaseline = "top", i.textAlign = "center", i.textBaseline = "middle";
2240
+ const b = a + g * 3 + 0.5, x = g * 16, C = b + x / 2;
2241
2241
  i.fillStyle = t, i.fillText(s, n, C), i.restore();
2242
- }, Pn = (i, { mainColor: e, textColor: t, symbol: s, x: n, y: a, size: r, fontSize: o }) => {
2243
- const g = r / 16, _ = 16 * g, p = n - _ / 2, v = a;
2244
- i.save(), i.translate(p, v), i.scale(g, -g), i.beginPath(), i.moveTo(7.85696, 0.288512), i.lineTo(4.53377, 3.11938), i.bezierCurveTo(4.17982, 3.42089, 4.39305, 4, 4.85801, 4), i.lineTo(11.2275, 4), i.bezierCurveTo(11.6818, 4, 11.9006, 3.44302, 11.5678, 3.13374), i.lineTo(8.52156, 0.302869), i.bezierCurveTo(8.33575, 0.130189, 8.05007, 0.124018, 7.85696, 0.288512), i.closePath(), i.fillStyle = e, i.fill(), i.beginPath(), i.moveTo(0, 7), i.bezierCurveTo(0, 4.79086, 1.79086, 3, 4, 3), i.lineTo(12, 3), i.bezierCurveTo(14.2091, 3, 16, 4.79086, 16, 7), i.lineTo(16, 15), i.bezierCurveTo(16, 17.2091, 14.2091, 19, 12, 19), i.lineTo(4, 19), i.bezierCurveTo(1.79086, 19, 0, 17.2091, 0, 15), i.lineTo(0, 7), i.closePath(), i.fillStyle = e, i.fill(), i.restore(), i.save(), i.font = `bold ${o}px sans-serif`, i.textAlign = "center", i.textBaseline = "middle";
2245
- const b = g * 16, w = a - g * 19 + b / 2;
2246
- i.fillStyle = t, i.fillText(s, n, w), i.restore();
2242
+ }, On = (i, { mainColor: e, textColor: t, symbol: s, x: n, y: a, size: r, fontSize: o }) => {
2243
+ const g = r / 16, p = 16 * g, _ = n - p / 2, v = a;
2244
+ i.save(), i.translate(_, v), i.scale(g, -g), i.beginPath(), i.moveTo(7.85696, 0.288512), i.lineTo(4.53377, 3.11938), i.bezierCurveTo(4.17982, 3.42089, 4.39305, 4, 4.85801, 4), i.lineTo(11.2275, 4), i.bezierCurveTo(11.6818, 4, 11.9006, 3.44302, 11.5678, 3.13374), i.lineTo(8.52156, 0.302869), i.bezierCurveTo(8.33575, 0.130189, 8.05007, 0.124018, 7.85696, 0.288512), i.closePath(), i.fillStyle = e, i.fill(), i.beginPath(), i.moveTo(0, 7), i.bezierCurveTo(0, 4.79086, 1.79086, 3, 4, 3), i.lineTo(12, 3), i.bezierCurveTo(14.2091, 3, 16, 4.79086, 16, 7), i.lineTo(16, 15), i.bezierCurveTo(16, 17.2091, 14.2091, 19, 12, 19), i.lineTo(4, 19), i.bezierCurveTo(1.79086, 19, 0, 17.2091, 0, 15), i.lineTo(0, 7), i.closePath(), i.fillStyle = e, i.fill(), i.restore(), i.save(), i.font = `bold ${o}px sans-serif`, i.textAlign = "center", i.textBaseline = "middle";
2245
+ const b = g * 16, x = a - g * 19 + b / 2;
2246
+ i.fillStyle = t, i.fillText(s, n, x), i.restore();
2247
2247
  };
2248
- function Ee(i) {
2248
+ function Je(i) {
2249
2249
  "@babel/helpers - typeof";
2250
- return Ee = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2250
+ return Je = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2251
2251
  return typeof e;
2252
2252
  } : function(e) {
2253
2253
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2254
- }, Ee(i);
2254
+ }, Je(i);
2255
2255
  }
2256
- var On = /^\s+/, zn = /\s+$/;
2257
- function A(i, e) {
2258
- if (i = i || "", e = e || {}, i instanceof A)
2256
+ var Pn = /^\s+/, zn = /\s+$/;
2257
+ function M(i, e) {
2258
+ if (i = i || "", e = e || {}, i instanceof M)
2259
2259
  return i;
2260
- if (!(this instanceof A))
2261
- return new A(i, e);
2260
+ if (!(this instanceof M))
2261
+ return new M(i, e);
2262
2262
  var t = Vn(i);
2263
2263
  this._originalInput = i, this._r = t.r, this._g = t.g, this._b = t.b, this._a = t.a, this._roundA = Math.round(100 * this._a) / 100, this._format = e.format || t.format, this._gradientType = e.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = t.ok;
2264
2264
  }
2265
- A.prototype = {
2265
+ M.prototype = {
2266
2266
  isDark: function() {
2267
2267
  return this.getBrightness() < 128;
2268
2268
  },
@@ -2290,10 +2290,10 @@ A.prototype = {
2290
2290
  return t = e.r / 255, s = e.g / 255, n = e.b / 255, t <= 0.03928 ? a = t / 12.92 : a = Math.pow((t + 0.055) / 1.055, 2.4), s <= 0.03928 ? r = s / 12.92 : r = Math.pow((s + 0.055) / 1.055, 2.4), n <= 0.03928 ? o = n / 12.92 : o = Math.pow((n + 0.055) / 1.055, 2.4), 0.2126 * a + 0.7152 * r + 0.0722 * o;
2291
2291
  },
2292
2292
  setAlpha: function(e) {
2293
- return this._a = ti(e), this._roundA = Math.round(100 * this._a) / 100, this;
2293
+ return this._a = pi(e), this._roundA = Math.round(100 * this._a) / 100, this;
2294
2294
  },
2295
2295
  toHsv: function() {
2296
- var e = Yt(this._r, this._g, this._b);
2296
+ var e = ri(this._r, this._g, this._b);
2297
2297
  return {
2298
2298
  h: e.h * 360,
2299
2299
  s: e.s,
@@ -2302,11 +2302,11 @@ A.prototype = {
2302
2302
  };
2303
2303
  },
2304
2304
  toHsvString: function() {
2305
- var e = Yt(this._r, this._g, this._b), t = Math.round(e.h * 360), s = Math.round(e.s * 100), n = Math.round(e.v * 100);
2305
+ var e = ri(this._r, this._g, this._b), t = Math.round(e.h * 360), s = Math.round(e.s * 100), n = Math.round(e.v * 100);
2306
2306
  return this._a == 1 ? "hsv(" + t + ", " + s + "%, " + n + "%)" : "hsva(" + t + ", " + s + "%, " + n + "%, " + this._roundA + ")";
2307
2307
  },
2308
2308
  toHsl: function() {
2309
- var e = jt(this._r, this._g, this._b);
2309
+ var e = ai(this._r, this._g, this._b);
2310
2310
  return {
2311
2311
  h: e.h * 360,
2312
2312
  s: e.s,
@@ -2315,11 +2315,11 @@ A.prototype = {
2315
2315
  };
2316
2316
  },
2317
2317
  toHslString: function() {
2318
- var e = jt(this._r, this._g, this._b), t = Math.round(e.h * 360), s = Math.round(e.s * 100), n = Math.round(e.l * 100);
2318
+ var e = ai(this._r, this._g, this._b), t = Math.round(e.h * 360), s = Math.round(e.s * 100), n = Math.round(e.l * 100);
2319
2319
  return this._a == 1 ? "hsl(" + t + ", " + s + "%, " + n + "%)" : "hsla(" + t + ", " + s + "%, " + n + "%, " + this._roundA + ")";
2320
2320
  },
2321
2321
  toHex: function(e) {
2322
- return Wt(this._r, this._g, this._b, e);
2322
+ return oi(this._r, this._g, this._b, e);
2323
2323
  },
2324
2324
  toHexString: function(e) {
2325
2325
  return "#" + this.toHex(e);
@@ -2353,13 +2353,13 @@ A.prototype = {
2353
2353
  return this._a == 1 ? "rgb(" + Math.round(I(this._r, 255) * 100) + "%, " + Math.round(I(this._g, 255) * 100) + "%, " + Math.round(I(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(I(this._r, 255) * 100) + "%, " + Math.round(I(this._g, 255) * 100) + "%, " + Math.round(I(this._b, 255) * 100) + "%, " + this._roundA + ")";
2354
2354
  },
2355
2355
  toName: function() {
2356
- return this._a === 0 ? "transparent" : this._a < 1 ? !1 : na[Wt(this._r, this._g, this._b, !0)] || !1;
2356
+ return this._a === 0 ? "transparent" : this._a < 1 ? !1 : na[oi(this._r, this._g, this._b, !0)] || !1;
2357
2357
  },
2358
2358
  toFilter: function(e) {
2359
- var t = "#" + Xt(this._r, this._g, this._b, this._a), s = t, n = this._gradientType ? "GradientType = 1, " : "";
2359
+ var t = "#" + li(this._r, this._g, this._b, this._a), s = t, n = this._gradientType ? "GradientType = 1, " : "";
2360
2360
  if (e) {
2361
- var a = A(e);
2362
- s = "#" + Xt(a._r, a._g, a._b, a._a);
2361
+ var a = M(e);
2362
+ s = "#" + li(a._r, a._g, a._b, a._a);
2363
2363
  }
2364
2364
  return "progid:DXImageTransform.Microsoft.gradient(" + n + "startColorstr=" + t + ",endColorstr=" + s + ")";
2365
2365
  },
@@ -2370,7 +2370,7 @@ A.prototype = {
2370
2370
  return a ? e === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (s = this.toRgbString()), e === "prgb" && (s = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (s = this.toHexString()), e === "hex3" && (s = this.toHexString(!0)), e === "hex4" && (s = this.toHex8String(!0)), e === "hex8" && (s = this.toHex8String()), e === "name" && (s = this.toName()), e === "hsl" && (s = this.toHslString()), e === "hsv" && (s = this.toHsvString()), s || this.toHexString());
2371
2371
  },
2372
2372
  clone: function() {
2373
- return A(this.toString());
2373
+ return M(this.toString());
2374
2374
  },
2375
2375
  _applyModification: function(e, t) {
2376
2376
  var s = e.apply(null, [this].concat([].slice.call(t)));
@@ -2417,20 +2417,20 @@ A.prototype = {
2417
2417
  // return this._applyCombination(polyad, [number]);
2418
2418
  // },
2419
2419
  triad: function() {
2420
- return this._applyCombination(Ut, [3]);
2420
+ return this._applyCombination(ci, [3]);
2421
2421
  },
2422
2422
  tetrad: function() {
2423
- return this._applyCombination(Ut, [4]);
2423
+ return this._applyCombination(ci, [4]);
2424
2424
  }
2425
2425
  };
2426
- A.fromRatio = function(i, e) {
2427
- if (Ee(i) == "object") {
2426
+ M.fromRatio = function(i, e) {
2427
+ if (Je(i) == "object") {
2428
2428
  var t = {};
2429
2429
  for (var s in i)
2430
- i.hasOwnProperty(s) && (s === "a" ? t[s] = i[s] : t[s] = fe(i[s]));
2430
+ i.hasOwnProperty(s) && (s === "a" ? t[s] = i[s] : t[s] = De(i[s]));
2431
2431
  i = t;
2432
2432
  }
2433
- return A(i, e);
2433
+ return M(i, e);
2434
2434
  };
2435
2435
  function Vn(i) {
2436
2436
  var e = {
@@ -2438,7 +2438,7 @@ function Vn(i) {
2438
2438
  g: 0,
2439
2439
  b: 0
2440
2440
  }, t = 1, s = null, n = null, a = null, r = !1, o = !1;
2441
- return typeof i == "string" && (i = la(i)), Ee(i) == "object" && (G(i.r) && G(i.g) && G(i.b) ? (e = jn(i.r, i.g, i.b), r = !0, o = String(i.r).substr(-1) === "%" ? "prgb" : "rgb") : G(i.h) && G(i.s) && G(i.v) ? (s = fe(i.s), n = fe(i.v), e = Wn(i.h, s, n), r = !0, o = "hsv") : G(i.h) && G(i.s) && G(i.l) && (s = fe(i.s), a = fe(i.l), e = Yn(i.h, s, a), r = !0, o = "hsl"), i.hasOwnProperty("a") && (t = i.a)), t = ti(t), {
2441
+ return typeof i == "string" && (i = la(i)), Je(i) == "object" && (te(i.r) && te(i.g) && te(i.b) ? (e = Yn(i.r, i.g, i.b), r = !0, o = String(i.r).substr(-1) === "%" ? "prgb" : "rgb") : te(i.h) && te(i.s) && te(i.v) ? (s = De(i.s), n = De(i.v), e = jn(i.h, s, n), r = !0, o = "hsv") : te(i.h) && te(i.s) && te(i.l) && (s = De(i.s), a = De(i.l), e = Wn(i.h, s, a), r = !0, o = "hsl"), i.hasOwnProperty("a") && (t = i.a)), t = pi(t), {
2442
2442
  ok: r,
2443
2443
  format: i.format || o,
2444
2444
  r: Math.min(255, Math.max(e.r, 0)),
@@ -2447,14 +2447,14 @@ function Vn(i) {
2447
2447
  a: t
2448
2448
  };
2449
2449
  }
2450
- function jn(i, e, t) {
2450
+ function Yn(i, e, t) {
2451
2451
  return {
2452
2452
  r: I(i, 255) * 255,
2453
2453
  g: I(e, 255) * 255,
2454
2454
  b: I(t, 255) * 255
2455
2455
  };
2456
2456
  }
2457
- function jt(i, e, t) {
2457
+ function ai(i, e, t) {
2458
2458
  i = I(i, 255), e = I(e, 255), t = I(t, 255);
2459
2459
  var s = Math.max(i, e, t), n = Math.min(i, e, t), a, r, o = (s + n) / 2;
2460
2460
  if (s == n)
@@ -2480,7 +2480,7 @@ function jt(i, e, t) {
2480
2480
  l: o
2481
2481
  };
2482
2482
  }
2483
- function Yn(i, e, t) {
2483
+ function Wn(i, e, t) {
2484
2484
  var s, n, a;
2485
2485
  i = I(i, 360), e = I(e, 100), t = I(t, 100);
2486
2486
  function r(h, u, g) {
@@ -2498,7 +2498,7 @@ function Yn(i, e, t) {
2498
2498
  b: a * 255
2499
2499
  };
2500
2500
  }
2501
- function Yt(i, e, t) {
2501
+ function ri(i, e, t) {
2502
2502
  i = I(i, 255), e = I(e, 255), t = I(t, 255);
2503
2503
  var s = Math.max(i, e, t), n = Math.min(i, e, t), a, r, o = s, c = s - n;
2504
2504
  if (r = s === 0 ? 0 : c / s, s == n)
@@ -2523,7 +2523,7 @@ function Yt(i, e, t) {
2523
2523
  v: o
2524
2524
  };
2525
2525
  }
2526
- function Wn(i, e, t) {
2526
+ function jn(i, e, t) {
2527
2527
  i = I(i, 360) * 6, e = I(e, 100), t = I(t, 100);
2528
2528
  var s = Math.floor(i), n = i - s, a = t * (1 - e), r = t * (1 - n * e), o = t * (1 - (1 - n) * e), c = s % 6, h = [t, r, a, a, o, t][c], u = [o, t, t, r, a, a][c], g = [a, a, o, t, t, r][c];
2529
2529
  return {
@@ -2532,23 +2532,23 @@ function Wn(i, e, t) {
2532
2532
  b: g * 255
2533
2533
  };
2534
2534
  }
2535
- function Wt(i, e, t, s) {
2536
- var n = [X(Math.round(i).toString(16)), X(Math.round(e).toString(16)), X(Math.round(t).toString(16))];
2535
+ function oi(i, e, t, s) {
2536
+ var n = [Q(Math.round(i).toString(16)), Q(Math.round(e).toString(16)), Q(Math.round(t).toString(16))];
2537
2537
  return s && n[0].charAt(0) == n[0].charAt(1) && n[1].charAt(0) == n[1].charAt(1) && n[2].charAt(0) == n[2].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
2538
2538
  }
2539
2539
  function Xn(i, e, t, s, n) {
2540
- var a = [X(Math.round(i).toString(16)), X(Math.round(e).toString(16)), X(Math.round(t).toString(16)), X(ii(s))];
2540
+ var a = [Q(Math.round(i).toString(16)), Q(Math.round(e).toString(16)), Q(Math.round(t).toString(16)), Q(vi(s))];
2541
2541
  return n && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
2542
2542
  }
2543
- function Xt(i, e, t, s) {
2544
- var n = [X(ii(s)), X(Math.round(i).toString(16)), X(Math.round(e).toString(16)), X(Math.round(t).toString(16))];
2543
+ function li(i, e, t, s) {
2544
+ var n = [Q(vi(s)), Q(Math.round(i).toString(16)), Q(Math.round(e).toString(16)), Q(Math.round(t).toString(16))];
2545
2545
  return n.join("");
2546
2546
  }
2547
- A.equals = function(i, e) {
2548
- return !i || !e ? !1 : A(i).toRgbString() == A(e).toRgbString();
2547
+ M.equals = function(i, e) {
2548
+ return !i || !e ? !1 : M(i).toRgbString() == M(e).toRgbString();
2549
2549
  };
2550
- A.random = function() {
2551
- return A.fromRatio({
2550
+ M.random = function() {
2551
+ return M.fromRatio({
2552
2552
  r: Math.random(),
2553
2553
  g: Math.random(),
2554
2554
  b: Math.random()
@@ -2556,45 +2556,45 @@ A.random = function() {
2556
2556
  };
2557
2557
  function Un(i, e) {
2558
2558
  e = e === 0 ? 0 : e || 10;
2559
- var t = A(i).toHsl();
2560
- return t.s -= e / 100, t.s = Fe(t.s), A(t);
2559
+ var t = M(i).toHsl();
2560
+ return t.s -= e / 100, t.s = Ke(t.s), M(t);
2561
2561
  }
2562
2562
  function Gn(i, e) {
2563
2563
  e = e === 0 ? 0 : e || 10;
2564
- var t = A(i).toHsl();
2565
- return t.s += e / 100, t.s = Fe(t.s), A(t);
2564
+ var t = M(i).toHsl();
2565
+ return t.s += e / 100, t.s = Ke(t.s), M(t);
2566
2566
  }
2567
2567
  function Zn(i) {
2568
- return A(i).desaturate(100);
2568
+ return M(i).desaturate(100);
2569
2569
  }
2570
2570
  function qn(i, e) {
2571
2571
  e = e === 0 ? 0 : e || 10;
2572
- var t = A(i).toHsl();
2573
- return t.l += e / 100, t.l = Fe(t.l), A(t);
2572
+ var t = M(i).toHsl();
2573
+ return t.l += e / 100, t.l = Ke(t.l), M(t);
2574
2574
  }
2575
2575
  function Jn(i, e) {
2576
2576
  e = e === 0 ? 0 : e || 10;
2577
- var t = A(i).toRgb();
2578
- return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), A(t);
2577
+ var t = M(i).toRgb();
2578
+ return t.r = Math.max(0, Math.min(255, t.r - Math.round(255 * -(e / 100)))), t.g = Math.max(0, Math.min(255, t.g - Math.round(255 * -(e / 100)))), t.b = Math.max(0, Math.min(255, t.b - Math.round(255 * -(e / 100)))), M(t);
2579
2579
  }
2580
2580
  function Qn(i, e) {
2581
2581
  e = e === 0 ? 0 : e || 10;
2582
- var t = A(i).toHsl();
2583
- return t.l -= e / 100, t.l = Fe(t.l), A(t);
2582
+ var t = M(i).toHsl();
2583
+ return t.l -= e / 100, t.l = Ke(t.l), M(t);
2584
2584
  }
2585
2585
  function Kn(i, e) {
2586
- var t = A(i).toHsl(), s = (t.h + e) % 360;
2587
- return t.h = s < 0 ? 360 + s : s, A(t);
2586
+ var t = M(i).toHsl(), s = (t.h + e) % 360;
2587
+ return t.h = s < 0 ? 360 + s : s, M(t);
2588
2588
  }
2589
2589
  function ea(i) {
2590
- var e = A(i).toHsl();
2591
- return e.h = (e.h + 180) % 360, A(e);
2590
+ var e = M(i).toHsl();
2591
+ return e.h = (e.h + 180) % 360, M(e);
2592
2592
  }
2593
- function Ut(i, e) {
2593
+ function ci(i, e) {
2594
2594
  if (isNaN(e) || e <= 0)
2595
2595
  throw new Error("Argument to polyad must be a positive number");
2596
- for (var t = A(i).toHsl(), s = [A(i)], n = 360 / e, a = 1; a < e; a++)
2597
- s.push(A({
2596
+ for (var t = M(i).toHsl(), s = [M(i)], n = 360 / e, a = 1; a < e; a++)
2597
+ s.push(M({
2598
2598
  h: (t.h + a * n) % 360,
2599
2599
  s: t.s,
2600
2600
  l: t.l
@@ -2602,12 +2602,12 @@ function Ut(i, e) {
2602
2602
  return s;
2603
2603
  }
2604
2604
  function ta(i) {
2605
- var e = A(i).toHsl(), t = e.h;
2606
- return [A(i), A({
2605
+ var e = M(i).toHsl(), t = e.h;
2606
+ return [M(i), M({
2607
2607
  h: (t + 72) % 360,
2608
2608
  s: e.s,
2609
2609
  l: e.l
2610
- }), A({
2610
+ }), M({
2611
2611
  h: (t + 216) % 360,
2612
2612
  s: e.s,
2613
2613
  l: e.l
@@ -2615,37 +2615,37 @@ function ta(i) {
2615
2615
  }
2616
2616
  function ia(i, e, t) {
2617
2617
  e = e || 6, t = t || 30;
2618
- var s = A(i).toHsl(), n = 360 / t, a = [A(i)];
2618
+ var s = M(i).toHsl(), n = 360 / t, a = [M(i)];
2619
2619
  for (s.h = (s.h - (n * e >> 1) + 720) % 360; --e; )
2620
- s.h = (s.h + n) % 360, a.push(A(s));
2620
+ s.h = (s.h + n) % 360, a.push(M(s));
2621
2621
  return a;
2622
2622
  }
2623
2623
  function sa(i, e) {
2624
2624
  e = e || 6;
2625
- for (var t = A(i).toHsv(), s = t.h, n = t.s, a = t.v, r = [], o = 1 / e; e--; )
2626
- r.push(A({
2625
+ for (var t = M(i).toHsv(), s = t.h, n = t.s, a = t.v, r = [], o = 1 / e; e--; )
2626
+ r.push(M({
2627
2627
  h: s,
2628
2628
  s: n,
2629
2629
  v: a
2630
2630
  })), a = (a + o) % 1;
2631
2631
  return r;
2632
2632
  }
2633
- A.mix = function(i, e, t) {
2633
+ M.mix = function(i, e, t) {
2634
2634
  t = t === 0 ? 0 : t || 50;
2635
- var s = A(i).toRgb(), n = A(e).toRgb(), a = t / 100, r = {
2635
+ var s = M(i).toRgb(), n = M(e).toRgb(), a = t / 100, r = {
2636
2636
  r: (n.r - s.r) * a + s.r,
2637
2637
  g: (n.g - s.g) * a + s.g,
2638
2638
  b: (n.b - s.b) * a + s.b,
2639
2639
  a: (n.a - s.a) * a + s.a
2640
2640
  };
2641
- return A(r);
2641
+ return M(r);
2642
2642
  };
2643
- A.readability = function(i, e) {
2644
- var t = A(i), s = A(e);
2643
+ M.readability = function(i, e) {
2644
+ var t = M(i), s = M(e);
2645
2645
  return (Math.max(t.getLuminance(), s.getLuminance()) + 0.05) / (Math.min(t.getLuminance(), s.getLuminance()) + 0.05);
2646
2646
  };
2647
- A.isReadable = function(i, e, t) {
2648
- var s = A.readability(i, e), n, a;
2647
+ M.isReadable = function(i, e, t) {
2648
+ var s = M.readability(i, e), n, a;
2649
2649
  switch (a = !1, n = ca(t), n.level + n.size) {
2650
2650
  case "AAsmall":
2651
2651
  case "AAAlarge":
@@ -2660,17 +2660,17 @@ A.isReadable = function(i, e, t) {
2660
2660
  }
2661
2661
  return a;
2662
2662
  };
2663
- A.mostReadable = function(i, e, t) {
2663
+ M.mostReadable = function(i, e, t) {
2664
2664
  var s = null, n = 0, a, r, o, c;
2665
2665
  t = t || {}, r = t.includeFallbackColors, o = t.level, c = t.size;
2666
2666
  for (var h = 0; h < e.length; h++)
2667
- a = A.readability(i, e[h]), a > n && (n = a, s = A(e[h]));
2668
- return A.isReadable(i, s, {
2667
+ a = M.readability(i, e[h]), a > n && (n = a, s = M(e[h]));
2668
+ return M.isReadable(i, s, {
2669
2669
  level: o,
2670
2670
  size: c
2671
- }) || !r ? s : (t.includeFallbackColors = !1, A.mostReadable(i, ["#fff", "#000"], t));
2671
+ }) || !r ? s : (t.includeFallbackColors = !1, M.mostReadable(i, ["#fff", "#000"], t));
2672
2672
  };
2673
- var tt = A.names = {
2673
+ var xt = M.names = {
2674
2674
  aliceblue: "f0f8ff",
2675
2675
  antiquewhite: "faebd7",
2676
2676
  aqua: "0ff",
@@ -2820,14 +2820,14 @@ var tt = A.names = {
2820
2820
  whitesmoke: "f5f5f5",
2821
2821
  yellow: "ff0",
2822
2822
  yellowgreen: "9acd32"
2823
- }, na = A.hexNames = aa(tt);
2823
+ }, na = M.hexNames = aa(xt);
2824
2824
  function aa(i) {
2825
2825
  var e = {};
2826
2826
  for (var t in i)
2827
2827
  i.hasOwnProperty(t) && (e[i[t]] = t);
2828
2828
  return e;
2829
2829
  }
2830
- function ti(i) {
2830
+ function pi(i) {
2831
2831
  return i = parseFloat(i), (isNaN(i) || i < 0 || i > 1) && (i = 1), i;
2832
2832
  }
2833
2833
  function I(i, e) {
@@ -2835,10 +2835,10 @@ function I(i, e) {
2835
2835
  var t = oa(i);
2836
2836
  return i = Math.min(e, Math.max(0, parseFloat(i))), t && (i = parseInt(i * e, 10) / 100), Math.abs(i - e) < 1e-6 ? 1 : i % e / parseFloat(e);
2837
2837
  }
2838
- function Fe(i) {
2838
+ function Ke(i) {
2839
2839
  return Math.min(1, Math.max(0, i));
2840
2840
  }
2841
- function z(i) {
2841
+ function Y(i) {
2842
2842
  return parseInt(i, 16);
2843
2843
  }
2844
2844
  function ra(i) {
@@ -2847,19 +2847,19 @@ function ra(i) {
2847
2847
  function oa(i) {
2848
2848
  return typeof i == "string" && i.indexOf("%") != -1;
2849
2849
  }
2850
- function X(i) {
2850
+ function Q(i) {
2851
2851
  return i.length == 1 ? "0" + i : "" + i;
2852
2852
  }
2853
- function fe(i) {
2853
+ function De(i) {
2854
2854
  return i <= 1 && (i = i * 100 + "%"), i;
2855
2855
  }
2856
- function ii(i) {
2856
+ function vi(i) {
2857
2857
  return Math.round(parseFloat(i) * 255).toString(16);
2858
2858
  }
2859
- function Gt(i) {
2860
- return z(i) / 255;
2859
+ function hi(i) {
2860
+ return Y(i) / 255;
2861
2861
  }
2862
- var W = function() {
2862
+ var J = function() {
2863
2863
  var i = "[-\\+]?\\d+%?", e = "[-\\+]?\\d*\\.\\d+%?", t = "(?:" + e + ")|(?:" + i + ")", s = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?", n = "[\\s|\\(]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")[,|\\s]+(" + t + ")\\s*\\)?";
2864
2864
  return {
2865
2865
  CSS_UNIT: new RegExp(t),
@@ -2875,14 +2875,14 @@ var W = function() {
2875
2875
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
2876
2876
  };
2877
2877
  }();
2878
- function G(i) {
2879
- return !!W.CSS_UNIT.exec(i);
2878
+ function te(i) {
2879
+ return !!J.CSS_UNIT.exec(i);
2880
2880
  }
2881
2881
  function la(i) {
2882
- i = i.replace(On, "").replace(zn, "").toLowerCase();
2882
+ i = i.replace(Pn, "").replace(zn, "").toLowerCase();
2883
2883
  var e = !1;
2884
- if (tt[i])
2885
- i = tt[i], e = !0;
2884
+ if (xt[i])
2885
+ i = xt[i], e = !0;
2886
2886
  else if (i == "transparent")
2887
2887
  return {
2888
2888
  r: 0,
@@ -2892,54 +2892,54 @@ function la(i) {
2892
2892
  format: "name"
2893
2893
  };
2894
2894
  var t;
2895
- return (t = W.rgb.exec(i)) ? {
2895
+ return (t = J.rgb.exec(i)) ? {
2896
2896
  r: t[1],
2897
2897
  g: t[2],
2898
2898
  b: t[3]
2899
- } : (t = W.rgba.exec(i)) ? {
2899
+ } : (t = J.rgba.exec(i)) ? {
2900
2900
  r: t[1],
2901
2901
  g: t[2],
2902
2902
  b: t[3],
2903
2903
  a: t[4]
2904
- } : (t = W.hsl.exec(i)) ? {
2904
+ } : (t = J.hsl.exec(i)) ? {
2905
2905
  h: t[1],
2906
2906
  s: t[2],
2907
2907
  l: t[3]
2908
- } : (t = W.hsla.exec(i)) ? {
2908
+ } : (t = J.hsla.exec(i)) ? {
2909
2909
  h: t[1],
2910
2910
  s: t[2],
2911
2911
  l: t[3],
2912
2912
  a: t[4]
2913
- } : (t = W.hsv.exec(i)) ? {
2913
+ } : (t = J.hsv.exec(i)) ? {
2914
2914
  h: t[1],
2915
2915
  s: t[2],
2916
2916
  v: t[3]
2917
- } : (t = W.hsva.exec(i)) ? {
2917
+ } : (t = J.hsva.exec(i)) ? {
2918
2918
  h: t[1],
2919
2919
  s: t[2],
2920
2920
  v: t[3],
2921
2921
  a: t[4]
2922
- } : (t = W.hex8.exec(i)) ? {
2923
- r: z(t[1]),
2924
- g: z(t[2]),
2925
- b: z(t[3]),
2926
- a: Gt(t[4]),
2922
+ } : (t = J.hex8.exec(i)) ? {
2923
+ r: Y(t[1]),
2924
+ g: Y(t[2]),
2925
+ b: Y(t[3]),
2926
+ a: hi(t[4]),
2927
2927
  format: e ? "name" : "hex8"
2928
- } : (t = W.hex6.exec(i)) ? {
2929
- r: z(t[1]),
2930
- g: z(t[2]),
2931
- b: z(t[3]),
2928
+ } : (t = J.hex6.exec(i)) ? {
2929
+ r: Y(t[1]),
2930
+ g: Y(t[2]),
2931
+ b: Y(t[3]),
2932
2932
  format: e ? "name" : "hex"
2933
- } : (t = W.hex4.exec(i)) ? {
2934
- r: z(t[1] + "" + t[1]),
2935
- g: z(t[2] + "" + t[2]),
2936
- b: z(t[3] + "" + t[3]),
2937
- a: Gt(t[4] + "" + t[4]),
2933
+ } : (t = J.hex4.exec(i)) ? {
2934
+ r: Y(t[1] + "" + t[1]),
2935
+ g: Y(t[2] + "" + t[2]),
2936
+ b: Y(t[3] + "" + t[3]),
2937
+ a: hi(t[4] + "" + t[4]),
2938
2938
  format: e ? "name" : "hex8"
2939
- } : (t = W.hex3.exec(i)) ? {
2940
- r: z(t[1] + "" + t[1]),
2941
- g: z(t[2] + "" + t[2]),
2942
- b: z(t[3] + "" + t[3]),
2939
+ } : (t = J.hex3.exec(i)) ? {
2940
+ r: Y(t[1] + "" + t[1]),
2941
+ g: Y(t[2] + "" + t[2]),
2942
+ b: Y(t[3] + "" + t[3]),
2943
2943
  format: e ? "name" : "hex"
2944
2944
  } : !1;
2945
2945
  }
@@ -2964,17 +2964,17 @@ function ha(i, e) {
2964
2964
  } = e;
2965
2965
  if (!r) return;
2966
2966
  const { trade: o } = a, c = 4;
2967
- t.forEach(({ isHovered: h, isActive: u, candle: g, trades: _ }) => {
2968
- const p = s.convert(g.open_time);
2969
- _.forEach((v) => {
2970
- const b = v.type === "buy", w = b ? o.buyLabel.text : o.sellLabel.text, C = b ? "B" : "S", y = b ? n.convert(g.low) + c : n.convert(g.high) - c, x = b ? $n : Pn;
2971
- let T = b ? o.buyLabel.main : o.sellLabel.main;
2972
- h && h[1] && h[0] === v.type && (T = A.mix(T, a.bg, 20).toString()), u && u[1] && u[0] === v.type && (T = o.activeLabel), x(i, {
2973
- x: p,
2967
+ t.forEach(({ isHovered: h, isActive: u, candle: g, trades: p }) => {
2968
+ const _ = s.convert(g.open_time);
2969
+ p.forEach((v) => {
2970
+ const b = v.type === "buy", x = b ? o.buyLabel.text : o.sellLabel.text, C = b ? "B" : "S", y = b ? n.convert(g.low) + c : n.convert(g.high) - c, w = b ? $n : On;
2971
+ let S = b ? o.buyLabel.main : o.sellLabel.main;
2972
+ h && h[1] && h[0] === v.type && (S = M.mix(S, a.bg, 20).toString()), u && u[1] && u[0] === v.type && (S = o.activeLabel), w(i, {
2973
+ x: _,
2974
2974
  y,
2975
2975
  symbol: C,
2976
- mainColor: T,
2977
- textColor: w,
2976
+ mainColor: S,
2977
+ textColor: x,
2978
2978
  size: 16,
2979
2979
  fontSize: 12
2980
2980
  });
@@ -2990,14 +2990,14 @@ function da(i, e) {
2990
2990
  colorScheme: { trade: h }
2991
2991
  } = e;
2992
2992
  if (a.length === 0) return;
2993
- const u = a.map((_) => _.candle).sort((_, p) => _.open_time.getTime() - p.open_time.getTime()), g = c.baseWidth / 2 * s + c.strokeWidth / 2;
2993
+ const u = a.map((p) => p.candle).sort((p, _) => p.open_time.getTime() - _.open_time.getTime()), g = c.baseWidth / 2 * s + c.strokeWidth / 2;
2994
2994
  if (i.save(), i.lineWidth = 1, i.strokeStyle = h.tradeBorders, o.length) {
2995
- const _ = t.convert(u[0].open_time) - g;
2996
- i.beginPath(), i.moveTo(_, n.y), i.lineTo(_, n.y + n.height), i.stroke();
2995
+ const p = t.convert(u[0].open_time) - g;
2996
+ i.beginPath(), i.moveTo(p, n.y), i.lineTo(p, n.y + n.height), i.stroke();
2997
2997
  }
2998
2998
  if (r.length) {
2999
- const _ = t.convert(u[u.length - 1].open_time) + g;
3000
- i.beginPath(), i.moveTo(_, n.y), i.lineTo(_, n.y + n.height), i.stroke();
2999
+ const p = t.convert(u[u.length - 1].open_time) + g;
3000
+ i.beginPath(), i.moveTo(p, n.y), i.lineTo(p, n.y + n.height), i.stroke();
3001
3001
  }
3002
3002
  i.restore();
3003
3003
  }
@@ -3012,16 +3012,16 @@ const ua = (i, e) => {
3012
3012
  } = e;
3013
3013
  if (i.save(), !c) return;
3014
3014
  const h = (g) => {
3015
- var _;
3016
- return (_ = n.find(
3017
- (p) => g.getTime() >= p.candle.open_time.getTime() && g.getTime() < p.candle.close_time.getTime()
3018
- )) == null ? void 0 : _.candle;
3019
- }, u = (g, _) => {
3020
- const p = h(g.time), v = h(_.time);
3021
- if (!p || !v) return;
3022
- const b = t.convert(p.open_time), w = t.convert(v.open_time);
3015
+ var p;
3016
+ return (p = n.find(
3017
+ (_) => g.getTime() >= _.candle.open_time.getTime() && g.getTime() < _.candle.close_time.getTime()
3018
+ )) == null ? void 0 : p.candle;
3019
+ }, u = (g, p) => {
3020
+ const _ = h(g.time), v = h(p.time);
3021
+ if (!_ || !v) return;
3022
+ const b = t.convert(_.open_time), x = t.convert(v.open_time);
3023
3023
  let C, y;
3024
- g.type === "buy" ? (C = s.convert(p.low), y = s.convert(v.high)) : (C = s.convert(p.high), y = s.convert(v.low)), i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.connectionLine, i.moveTo(b, C), i.lineTo(w, y), i.stroke(), i.setLineDash([]);
3024
+ g.type === "buy" ? (C = s.convert(_.low), y = s.convert(v.high)) : (C = s.convert(_.high), y = s.convert(v.low)), i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.connectionLine, i.moveTo(b, C), i.lineTo(x, y), i.stroke(), i.setLineDash([]);
3025
3025
  };
3026
3026
  if (a.length === 1 && r.length > 1)
3027
3027
  r.forEach((g) => u(a[0], g));
@@ -3030,11 +3030,11 @@ const ua = (i, e) => {
3030
3030
  else if (a.length === 1 && r.length === 1)
3031
3031
  u(a[0], r[0]);
3032
3032
  else if (a.length > 0 && r.length > 0) {
3033
- const g = a.reduce((p, v) => p.time < v.time ? p : v), _ = r.reduce((p, v) => p.time > v.time ? p : v);
3034
- u(g, _);
3033
+ const g = a.reduce((_, v) => _.time < v.time ? _ : v), p = r.reduce((_, v) => _.time > v.time ? _ : v);
3034
+ u(g, p);
3035
3035
  }
3036
3036
  i.restore();
3037
- }, si = (i, e) => {
3037
+ }, bi = (i, e) => {
3038
3038
  const {
3039
3039
  radius: t,
3040
3040
  coords: { x: s, y: n },
@@ -3071,7 +3071,7 @@ function ga(i) {
3071
3071
  return s.length ? s.join(" ") : "0s";
3072
3072
  }
3073
3073
  const ma = 10, _a = 6, pa = 4, va = 12, ba = (i, e) => {
3074
- var j;
3074
+ var K;
3075
3075
  const {
3076
3076
  scales: { x: t, y: s },
3077
3077
  trade: { entries: n, exits: a, holdTime: r },
@@ -3083,29 +3083,29 @@ const ma = 10, _a = 6, pa = 4, va = 12, ba = (i, e) => {
3083
3083
  }
3084
3084
  } = e;
3085
3085
  if (!c) return;
3086
- const _ = n.at(0), p = a.at(-1);
3087
- if (!_ || !p) return;
3088
- const v = (q) => q ? q instanceof Date ? q : new Date(q) : null, b = t.convert(v(u == null ? void 0 : u[0]) || _.candle.open_time), w = t.convert(v(u == null ? void 0 : u[1]) || p.candle.open_time), C = s.convert(g || (((j = n.at(0)) == null ? void 0 : j.price) ?? 0));
3089
- i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.main, i.moveTo(b, C), i.lineTo(w, C), i.stroke(), i.setLineDash([]);
3090
- const y = (b + w) / 2, x = h || `Hold: ${ga(r)}`, F = getComputedStyle(
3086
+ const p = n.at(0), _ = a.at(-1);
3087
+ if (!p || !_) return;
3088
+ const v = (j) => j ? j instanceof Date ? j : new Date(j) : null, b = t.convert(v(u == null ? void 0 : u[0]) || p.candle.open_time), x = t.convert(v(u == null ? void 0 : u[1]) || _.candle.open_time), C = s.convert(g || (((K = n.at(0)) == null ? void 0 : K.price) ?? 0));
3089
+ i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.main, i.moveTo(b, C), i.lineTo(x, C), i.stroke(), i.setLineDash([]);
3090
+ const y = (b + x) / 2, w = h || `Hold: ${ga(r)}`, L = getComputedStyle(
3091
3091
  document.querySelector(".sc-charts-cs") || document.body
3092
3092
  ).font.replace(/^\s*\S+/, "").trim();
3093
- i.font = `600 ${ma}px ${F}`;
3094
- const $ = i.measureText(x).width + _a * 2, P = va + pa * 2;
3095
- si(i, {
3093
+ i.font = `600 ${ma}px ${L}`;
3094
+ const $ = i.measureText(w).width + _a * 2, O = va + pa * 2;
3095
+ bi(i, {
3096
3096
  radius: 4,
3097
3097
  coords: {
3098
3098
  x: y - $ / 2,
3099
- y: C - P / 2
3099
+ y: C - O / 2
3100
3100
  },
3101
3101
  width: $,
3102
- height: P,
3102
+ height: O,
3103
3103
  fillColor: o.main
3104
- }), i.fillStyle = o.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(x, y, C), i.restore();
3104
+ }), i.fillStyle = o.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(w, y, C), i.restore();
3105
3105
  };
3106
- class pe {
3106
+ class Fe {
3107
3107
  constructor(e, t, {
3108
- CanvasClass: s = _e,
3108
+ CanvasClass: s = Ne,
3109
3109
  noCanvas: n = !1,
3110
3110
  noDOM: a = !1
3111
3111
  } = {}) {
@@ -3127,7 +3127,7 @@ const ya = {
3127
3127
  "left-top": { dx: -1, dy: -1 },
3128
3128
  "right-top": { dx: 1, dy: -1 },
3129
3129
  "left-bottom": { dx: -1, dy: 1 }
3130
- }, at = ({
3130
+ }, St = ({
3131
3131
  size: i,
3132
3132
  parent: e,
3133
3133
  coords: t,
@@ -3135,35 +3135,35 @@ const ya = {
3135
3135
  offset: n = 8
3136
3136
  }) => {
3137
3137
  const { width: a, height: r } = i, o = e.right - e.left, c = e.bottom - e.top, h = (y) => {
3138
- const { dx: x, dy: T } = ya[y], F = t.x + (x === 1 ? n : -a - n), R = t.y + (T === 1 ? n : -r - n);
3139
- return { x: F, y: R, side: y };
3140
- }, u = ({ x: y, y: x }) => y >= 0 && x >= 0 && y + a <= o && x + r <= c, g = () => {
3141
- const y = t.y < 0, x = t.y + r > c, T = t.x < 0, F = t.x + a > o;
3142
- return T && y ? "right-bottom" : T && x ? "right-top" : F && y ? "left-bottom" : F && x ? "left-top" : T ? "right-bottom" : F ? "left-bottom" : y ? "right-bottom" : x ? "right-top" : s;
3143
- }, p = [
3138
+ const { dx: w, dy: S } = ya[y], L = t.x + (w === 1 ? n : -a - n), R = t.y + (S === 1 ? n : -r - n);
3139
+ return { x: L, y: R, side: y };
3140
+ }, u = ({ x: y, y: w }) => y >= 0 && w >= 0 && y + a <= o && w + r <= c, g = () => {
3141
+ const y = t.y < 0, w = t.y + r > c, S = t.x < 0, L = t.x + a > o;
3142
+ return S && y ? "right-bottom" : S && w ? "right-top" : L && y ? "left-bottom" : L && w ? "left-top" : S ? "right-bottom" : L ? "left-bottom" : y ? "right-bottom" : w ? "right-top" : s;
3143
+ }, _ = [
3144
3144
  s,
3145
3145
  "right-bottom",
3146
3146
  "right-top",
3147
3147
  "left-bottom",
3148
3148
  "left-top"
3149
- ].filter((y, x, T) => T.indexOf(y) === x), v = g();
3149
+ ].filter((y, w, S) => S.indexOf(y) === w), v = g();
3150
3150
  let b = null;
3151
- for (const y of [v, ...p]) {
3152
- const x = h(y);
3153
- if (u(x)) {
3154
- b = x;
3151
+ for (const y of [v, ..._]) {
3152
+ const w = h(y);
3153
+ if (u(w)) {
3154
+ b = w;
3155
3155
  break;
3156
3156
  }
3157
3157
  }
3158
3158
  b || (b = h(v));
3159
- const w = Math.min(Math.max(b.x, n), o - a - n), C = Math.min(Math.max(b.y, n), c - r - n);
3159
+ const x = Math.min(Math.max(b.x, n), o - a - n), C = Math.min(Math.max(b.y, n), c - r - n);
3160
3160
  return {
3161
- x: w,
3161
+ x,
3162
3162
  y: C,
3163
3163
  side: b.side
3164
3164
  };
3165
3165
  };
3166
- class Z extends k {
3166
+ class ie extends k {
3167
3167
  constructor(t) {
3168
3168
  super(t);
3169
3169
  f(this, "_state", {});
@@ -3198,7 +3198,7 @@ class Z extends k {
3198
3198
  this._scheduleUpdate();
3199
3199
  }
3200
3200
  }
3201
- class wa extends Z {
3201
+ class wa extends ie {
3202
3202
  constructor(t) {
3203
3203
  const s = "label-tooltip";
3204
3204
  super({ className: t.cx(s) });
@@ -3215,7 +3215,7 @@ class wa extends Z {
3215
3215
  }), this.oneBox = new k({
3216
3216
  tag: "div",
3217
3217
  className: this.clsx("box_one")
3218
- }), t.dom.append(this.title.node, this.oneBox.node, this.manyBox.node), this.state = { isShow: !1, x: 0, y: 0, parent: V.empty() };
3218
+ }), t.dom.append(this.title.node, this.oneBox.node, this.manyBox.node), this.state = { isShow: !1, x: 0, y: 0, parent: W.empty() };
3219
3219
  }
3220
3220
  _createLineNodes(t, s) {
3221
3221
  const n = [];
@@ -3270,7 +3270,7 @@ class wa extends Z {
3270
3270
  render() {
3271
3271
  const { isShow: t, x: s, y: n, parent: a } = this.state;
3272
3272
  this.setVisible(t), t && this.updateAbsolutePosition();
3273
- const r = at({
3273
+ const r = St({
3274
3274
  size: this.absolutePosition,
3275
3275
  parent: a,
3276
3276
  coords: { x: s, y: n }
@@ -3278,7 +3278,7 @@ class wa extends Z {
3278
3278
  this.position(r.x, r.y);
3279
3279
  }
3280
3280
  }
3281
- class xa extends pe {
3281
+ class xa extends Fe {
3282
3282
  constructor(t) {
3283
3283
  super("trade", t);
3284
3284
  f(this, "labelTooltip");
@@ -3293,7 +3293,7 @@ class xa extends pe {
3293
3293
  function Ca(i, { color: e = "#000000", lineWidth: t = 1, dashed: s, coords: n }) {
3294
3294
  i.strokeStyle = e, i.lineWidth = t, s && i.setLineDash(s), i.beginPath(), i.moveTo(n.x1, n.y1), i.lineTo(n.x2, n.y2), i.stroke();
3295
3295
  }
3296
- const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, e) => {
3296
+ const Aa = { text: "#FFFFFF", bg: "#000000" }, Ma = (i, e) => {
3297
3297
  const {
3298
3298
  coords: t,
3299
3299
  text: s,
@@ -3304,27 +3304,27 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, e) => {
3304
3304
  borderRadius: c = 0,
3305
3305
  colors: h,
3306
3306
  align: u = { x: "left", y: "top" }
3307
- } = e, g = { ...Ma, ...h }, p = getComputedStyle(
3307
+ } = e, g = { ...Aa, ...h }, _ = getComputedStyle(
3308
3308
  document.querySelector(".sc-charts-cs") || document.body
3309
3309
  ).font.replace(/^\s*\S+/, "").trim();
3310
- i.font = `${a} ${n}px ${p}`;
3311
- const b = i.measureText(s).width + o.x * 2, w = r + o.y * 2;
3310
+ i.font = `${a} ${n}px ${_}`;
3311
+ const b = i.measureText(s).width + o.x * 2, x = r + o.y * 2;
3312
3312
  let C = t.x, y = t.y;
3313
- u.x === "middle" ? C -= b / 2 : u.x === "right" && (C -= b), u.y === "middle" ? y -= w / 2 : u.y === "bottom" && (y -= w), si(i, {
3313
+ u.x === "middle" ? C -= b / 2 : u.x === "right" && (C -= b), u.y === "middle" ? y -= x / 2 : u.y === "bottom" && (y -= x), bi(i, {
3314
3314
  radius: c,
3315
3315
  coords: { x: C, y },
3316
3316
  width: b,
3317
- height: w,
3317
+ height: x,
3318
3318
  fillColor: g.bg
3319
- }), i.fillStyle = g.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(s, C + b / 2, y + w / 2);
3320
- }, Zt = {
3319
+ }), i.fillStyle = g.text, i.textBaseline = "middle", i.textAlign = "center", i.fillText(s, C + b / 2, y + x / 2);
3320
+ }, di = {
3321
3321
  line: "#000000",
3322
3322
  text: "#ffffff",
3323
3323
  main: "#000000"
3324
- }, ni = (i, { text: e, startLineCoords: t, side: s, colors: n = Zt, dir: a = "h", endMarkerCoords: r }) => {
3324
+ }, yi = (i, { text: e, startLineCoords: t, side: s, colors: n = di, dir: a = "h", endMarkerCoords: r }) => {
3325
3325
  if (a === "h" && (s === "bottom" || s === "top"))
3326
3326
  throw new Error("[drawMarker util]: Incorrect side or dir for this marker");
3327
- const o = { ...Zt, ...n };
3327
+ const o = { ...di, ...n };
3328
3328
  i.save(), Ca(i, {
3329
3329
  color: o.line,
3330
3330
  lineWidth: 1,
@@ -3335,7 +3335,7 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, e) => {
3335
3335
  x2: r.x,
3336
3336
  y2: r.y
3337
3337
  }
3338
- }), Aa(i, {
3338
+ }), Ma(i, {
3339
3339
  text: e,
3340
3340
  coords: r,
3341
3341
  padding: { x: 6, y: 4 },
@@ -3352,17 +3352,17 @@ const Ma = { text: "#FFFFFF", bg: "#000000" }, Aa = (i, e) => {
3352
3352
  }
3353
3353
  }), i.restore();
3354
3354
  };
3355
- class Ta extends _e {
3355
+ class Sa extends Ne {
3356
3356
  constructor(e) {
3357
3357
  super(e);
3358
3358
  }
3359
3359
  drawMarker(e) {
3360
- ni(this.ctx, e);
3360
+ yi(this.ctx, e);
3361
3361
  }
3362
3362
  }
3363
- class Sa extends pe {
3363
+ class Ta extends Fe {
3364
3364
  constructor(e) {
3365
- if (super("user-markers", e, { CanvasClass: Ta, noDOM: !0 }), !this.canvas) throw new Error("[CS_V_UserMarkers] this.canvas must be defined");
3365
+ if (super("user-markers", e, { CanvasClass: Sa, noDOM: !0 }), !this.canvas) throw new Error("[CS_V_UserMarkers] this.canvas must be defined");
3366
3366
  }
3367
3367
  render(e) {
3368
3368
  this.canvas.clear();
@@ -3391,7 +3391,7 @@ class Sa extends pe {
3391
3391
  }
3392
3392
  }
3393
3393
  const ka = "sc-charts-cs";
3394
- class Q {
3394
+ class ae {
3395
3395
  constructor(e) {
3396
3396
  f(this, "block");
3397
3397
  this.block = e;
@@ -3400,13 +3400,13 @@ class Q {
3400
3400
  return `${ka}__${this.block}${e ? "-" + e : ""}`;
3401
3401
  }
3402
3402
  }
3403
- const Je = new Q("comment-actions");
3403
+ const vt = new ae("comment-actions");
3404
3404
  class Da extends k {
3405
3405
  constructor({ onDelete: e, onUpdate: t }) {
3406
- super({ className: Je.gen() });
3407
- const s = new k({ tag: "button", className: Je.gen("edit"), textContent: "Edit" }), n = new k({
3406
+ super({ className: vt.gen() });
3407
+ const s = new k({ tag: "button", className: vt.gen("edit"), textContent: "Edit" }), n = new k({
3408
3408
  tag: "button",
3409
- className: Je.gen("delete"),
3409
+ className: vt.gen("delete"),
3410
3410
  textContent: "Delete"
3411
3411
  });
3412
3412
  n.node.addEventListener("click", (a) => {
@@ -3416,7 +3416,7 @@ class Da extends k {
3416
3416
  }), this.append(s.node, n.node);
3417
3417
  }
3418
3418
  }
3419
- function rt(i, e) {
3419
+ function Tt(i, e) {
3420
3420
  var n;
3421
3421
  const t = (a) => {
3422
3422
  if (!document.contains(i.node)) return;
@@ -3433,7 +3433,7 @@ function rt(i, e) {
3433
3433
  document.removeEventListener("mousedown", t), s == null || s();
3434
3434
  }, i;
3435
3435
  }
3436
- class La {
3436
+ class Ea {
3437
3437
  constructor() {
3438
3438
  f(this, "node");
3439
3439
  const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
@@ -3471,31 +3471,31 @@ class La {
3471
3471
  this.node = t;
3472
3472
  }
3473
3473
  }
3474
- const de = new Q("comment-list");
3475
- class Ea extends k {
3474
+ const Te = new ae("comment-list");
3475
+ class La extends k {
3476
3476
  constructor({ onDelete: t, onOpenEditor: s, comment: n, layout: a }) {
3477
- super({ className: de.gen("item") });
3477
+ super({ className: Te.gen("item") });
3478
3478
  f(this, "actionTooltip");
3479
3479
  f(this, "actionsTrigger");
3480
- const r = new k({ className: de.gen("text"), textContent: n.text }), o = new k({
3481
- className: de.gen("created-at"),
3480
+ const r = new k({ className: Te.gen("text"), textContent: n.text }), o = new k({
3481
+ className: Te.gen("created-at"),
3482
3482
  textContent: fa(new Date(n.createdAt))
3483
3483
  });
3484
3484
  this.actionsTrigger = new k({
3485
3485
  tag: "button",
3486
- className: de.gen("action-trigger")
3486
+ className: Te.gen("action-trigger")
3487
3487
  });
3488
3488
  const c = new Da({
3489
3489
  onDelete: t,
3490
3490
  onUpdate: s
3491
3491
  });
3492
- this.actionTooltip = rt(c, () => {
3492
+ this.actionTooltip = Tt(c, () => {
3493
3493
  this.actionTooltip.setVisible(!1);
3494
3494
  }), this.actionsTrigger.node.addEventListener("click", () => {
3495
3495
  this.actionsTrigger.updateAbsolutePosition(), this.actionTooltip.updateAbsolutePosition(), this.actionTooltip.node.style.top = this.actionsTrigger.absolutePosition.top - a.chart.top + 20 + "px", this.actionTooltip.node.style.left = this.actionsTrigger.absolutePosition.left - a.chart.left - this.actionTooltip.absolutePosition.width + 10 + "px", this.actionTooltip.setVisible(!0);
3496
3496
  });
3497
- const h = new k({ className: de.gen("text-wrap") });
3498
- this.actionTooltip.node.setAttribute("id", `ac-${n.id}`), h.append(r.node, this.actionsTrigger.node), this.actionsTrigger.append(new La().node), this.append(h.node, o.node);
3497
+ const h = new k({ className: Te.gen("text-wrap") });
3498
+ this.actionTooltip.node.setAttribute("id", `ac-${n.id}`), h.append(r.node, this.actionsTrigger.node), this.actionsTrigger.append(new Ea().node), this.append(h.node, o.node);
3499
3499
  }
3500
3500
  }
3501
3501
  class Na {
@@ -3522,7 +3522,7 @@ class Fa {
3522
3522
  ), s.setAttribute("fill", "currentColor"), t.appendChild(s), this.node = t;
3523
3523
  }
3524
3524
  }
3525
- class Ha extends Z {
3525
+ class Ha extends ie {
3526
3526
  constructor(t) {
3527
3527
  super({ className: "sc-charts-cs__comments-edit" });
3528
3528
  f(this, "input");
@@ -3552,8 +3552,8 @@ class Ha extends Z {
3552
3552
  this.input.node.value = this.state.inputValue, this.saveBtn.node.disabled = !this.state.inputValue.trim(), this.state.hasInitFocused || (requestAnimationFrame(() => this.input.node.focus()), this.setState({ hasInitFocused: !0 }));
3553
3553
  }
3554
3554
  }
3555
- const Ba = new Q("comment-list");
3556
- class Ia extends Z {
3555
+ const Ba = new ae("comment-list");
3556
+ class Ia extends ie {
3557
3557
  constructor(t, s, n, a = {}) {
3558
3558
  super({ tag: "ul", className: Ba.gen(), ...a });
3559
3559
  f(this, "_elements", {});
@@ -3580,7 +3580,7 @@ class Ia extends Z {
3580
3580
  },
3581
3581
  initialValue: t.text
3582
3582
  });
3583
- const s = new Ea({
3583
+ const s = new La({
3584
3584
  onDelete: () => {
3585
3585
  this._model.comments.remove(t.id), s.actionTooltip.setVisible(!1);
3586
3586
  },
@@ -3608,20 +3608,20 @@ class Ra {
3608
3608
  ), s.setAttribute("stroke", "currentColor"), s.setAttribute("stroke-linecap", "round"), s.setAttribute("stroke-linejoin", "round"), t.appendChild(s), this.node = t;
3609
3609
  }
3610
3610
  }
3611
- const ke = new Q(""), Qe = new Q("add-field");
3612
- class ai extends Z {
3611
+ const Ge = new ae(""), bt = new ae("add-field");
3612
+ class wi extends ie {
3613
3613
  constructor({ onAdd: t, blockName: s }) {
3614
- ke.block = s;
3615
- super({ className: ke.gen() + " " + Qe.gen() });
3614
+ Ge.block = s;
3615
+ super({ className: Ge.gen() + " " + bt.gen() });
3616
3616
  f(this, "btn");
3617
3617
  f(this, "input");
3618
3618
  f(this, "_onAdd");
3619
3619
  this._onAdd = t, this.state = { inputValue: "" }, this.input = new k({
3620
3620
  tag: "input",
3621
- className: ke.gen("input") + " " + Qe.gen("input")
3621
+ className: Ge.gen("input") + " " + bt.gen("input")
3622
3622
  }), this.input.node.setAttribute("placeholder", "Add comment..."), this.btn = new k({
3623
3623
  tag: "button",
3624
- className: ke.gen("btn") + " " + Qe.gen("btn")
3624
+ className: Ge.gen("btn") + " " + bt.gen("btn")
3625
3625
  }), this.btn.append(new Ra().node), this.append(this.input.node, this.btn.node), this._setupListeners(), this.render();
3626
3626
  }
3627
3627
  _addComment() {
@@ -3641,8 +3641,8 @@ class ai extends Z {
3641
3641
  this.btn.node.disabled = !this.state.inputValue.trim();
3642
3642
  }
3643
3643
  }
3644
- const $a = new Q("list-tooltip"), Ke = 8;
3645
- class Pa extends Z {
3644
+ const $a = new ae("list-tooltip"), yt = 8;
3645
+ class Oa extends ie {
3646
3646
  constructor(t, s, n) {
3647
3647
  super({ className: $a.gen() });
3648
3648
  f(this, "_list");
@@ -3650,7 +3650,7 @@ class Pa extends Z {
3650
3650
  f(this, "_size", null);
3651
3651
  f(this, "_model");
3652
3652
  f(this, "_prevIsShow", !1);
3653
- this._model = s, this.state = { isShow: !1, comments: t }, this._list = new Ia(t, s, n), this._addField = new ai({
3653
+ this._model = s, this.state = { isShow: !1, comments: t }, this._list = new Ia(t, s, n), this._addField = new wi({
3654
3654
  blockName: "list-tooltip-add",
3655
3655
  onAdd: (a) => {
3656
3656
  const r = t[0].date, o = t[0].price, c = {
@@ -3666,7 +3666,7 @@ class Pa extends Z {
3666
3666
  }
3667
3667
  render() {
3668
3668
  const { isShow: t, comments: s } = this.state, { width: n, height: a } = this._model.layout.area;
3669
- this._prevIsShow !== t && (this._list.forceUpdate(), this._prevIsShow = t), this.node.style.maxHeight = a / 2 - Ke + "px", this.setVisible(t), t && !this._size && (this.updateAbsolutePosition(), this._size = this.absolutePosition, this.position(n / 2 - this._size.width - Ke, a / 2 + Ke)), this._list.setState({ items: s }), requestAnimationFrame(() => {
3669
+ this._prevIsShow !== t && (this._list.forceUpdate(), this._prevIsShow = t), this.node.style.maxHeight = a / 2 - yt + "px", this.setVisible(t), t && !this._size && (this.updateAbsolutePosition(), this._size = this.absolutePosition, this.position(n / 2 - this._size.width - yt, a / 2 + yt)), this._list.setState({ items: s }), requestAnimationFrame(() => {
3670
3670
  this._list.node.scrollTop = this._list.node.scrollHeight;
3671
3671
  });
3672
3672
  }
@@ -3674,7 +3674,7 @@ class Pa extends Z {
3674
3674
  return this._list;
3675
3675
  }
3676
3676
  }
3677
- class Oa {
3677
+ class Pa {
3678
3678
  constructor() {
3679
3679
  f(this, "node");
3680
3680
  const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
@@ -3686,7 +3686,7 @@ class Oa {
3686
3686
  ), s.setAttribute("fill", "currentColor"), t.appendChild(s), this.node = t;
3687
3687
  }
3688
3688
  }
3689
- class za extends Z {
3689
+ class za extends ie {
3690
3690
  constructor({ x: t, ...s }, n) {
3691
3691
  super(s);
3692
3692
  f(this, "_colors");
@@ -3694,7 +3694,7 @@ class za extends Z {
3694
3694
  x: t,
3695
3695
  y: n.layout.xAxis.top,
3696
3696
  isActive: !1
3697
- }, this.node.append(new Oa().node), this.render();
3697
+ }, this.node.append(new Pa().node), this.render();
3698
3698
  }
3699
3699
  render() {
3700
3700
  const { x: t, y: s, isActive: n } = this.state;
@@ -3703,10 +3703,10 @@ class za extends Z {
3703
3703
  this.node.style.backgroundColor = this._colors[`bg${a}`], this.node.style.color = this._colors[`icon${a}`];
3704
3704
  }
3705
3705
  }
3706
- const qt = new Q("comment-box");
3707
- class Va extends Z {
3706
+ const ui = new ae("comment-box");
3707
+ class Va extends ie {
3708
3708
  constructor({ boxId: t, model: s, view: n, comments: a, coords: r, onBoxActivate: o, onBoxDeactivate: c }) {
3709
- super({ className: qt.gen() });
3709
+ super({ className: ui.gen() });
3710
3710
  f(this, "pointer", new k({ className: "sc-charts-cs__comments-pointer" }));
3711
3711
  f(this, "tooltip");
3712
3712
  f(this, "anchor");
@@ -3717,10 +3717,10 @@ class Va extends Z {
3717
3717
  isActive: !1,
3718
3718
  comments: a,
3719
3719
  coords: r
3720
- }, this.pointer.position(r), this.anchor = new za({ x: r.x, className: qt.gen("anchor") }, s), this.anchor.node.addEventListener("click", () => {
3720
+ }, this.pointer.position(r), this.anchor = new za({ x: r.x, className: ui.gen("anchor") }, s), this.anchor.node.addEventListener("click", () => {
3721
3721
  const h = !this.state.isActive;
3722
3722
  h ? this._onBoxActivate(this._boxId) : this._onBoxDeactivate(this._boxId), this.setState({ isActive: h });
3723
- }), this.tooltip = rt(new Pa(a, s, n), (h) => {
3723
+ }), this.tooltip = Tt(new Oa(a, s, n), (h) => {
3724
3724
  this.state.isActive && (this.anchor.node.contains(h.target) || (this._onBoxDeactivate(this._boxId), this.setState({ isActive: !1 })));
3725
3725
  }), this.append(this.pointer.node, this.anchor.node, this.tooltip.node), this.render();
3726
3726
  }
@@ -3729,11 +3729,11 @@ class Va extends Z {
3729
3729
  this.pointer.position(n), this.pointer.setVisible(t), this.anchor.setState({ x: n.x, isActive: t }), this.tooltip.setState({ comments: s, isShow: t });
3730
3730
  }
3731
3731
  }
3732
- class ja {
3732
+ class Ya {
3733
3733
  static animateTo(e, t, s, n) {
3734
- const a = e.scales.panOffsetX + (e.layout.area.width / 2 - t), r = e.scales.panOffsetY + (e.layout.area.height / 2 - s), o = 300, c = performance.now(), h = e.scales.panOffsetX, u = e.scales.panOffsetY, g = (_) => {
3735
- const p = _ - c, v = Math.min(p / o, 1), b = v * v * (3 - 2 * v), w = h + (a - h) * b, C = u + (r - u) * b;
3736
- e.scales.pan("x", w, "absolute"), e.scales.pan("y", C, "absolute"), v < 1 ? requestAnimationFrame(g) : n == null || n();
3734
+ const a = e.scales.panOffsetX + (e.layout.area.width / 2 - t), r = e.scales.panOffsetY + (e.layout.area.height / 2 - s), o = 300, c = performance.now(), h = e.scales.panOffsetX, u = e.scales.panOffsetY, g = (p) => {
3735
+ const _ = p - c, v = Math.min(_ / o, 1), b = v * v * (3 - 2 * v), x = h + (a - h) * b, C = u + (r - u) * b;
3736
+ e.scales.pan("x", x, "absolute"), e.scales.pan("y", C, "absolute"), v < 1 ? requestAnimationFrame(g) : n == null || n();
3737
3737
  };
3738
3738
  requestAnimationFrame(g);
3739
3739
  }
@@ -3742,19 +3742,19 @@ class ja {
3742
3742
  this.animateTo(e, a, r, n);
3743
3743
  }
3744
3744
  }
3745
- const et = new Q("comments-context");
3746
- class Ya extends Z {
3745
+ const wt = new ae("comments-context");
3746
+ class Wa extends ie {
3747
3747
  constructor() {
3748
- super({ className: et.gen() });
3748
+ super({ className: wt.gen() });
3749
3749
  f(this, "pointer");
3750
3750
  f(this, "addField");
3751
3751
  f(this, "menu");
3752
3752
  f(this, "_size", null);
3753
3753
  f(this, "_model", null);
3754
3754
  f(this, "_candle", null);
3755
- this.state = { candle: null, isShow: !1, model: null }, this.pointer = new k({ className: et.gen("pointer") }), this.menu = new k({ className: et.gen("menu") }), rt(this.menu, () => {
3755
+ this.state = { candle: null, isShow: !1, model: null }, this.pointer = new k({ className: wt.gen("pointer") }), this.menu = new k({ className: wt.gen("menu") }), Tt(this.menu, () => {
3756
3756
  this.setState({ isShow: !1 });
3757
- }), this.addField = new ai({
3757
+ }), this.addField = new wi({
3758
3758
  blockName: "context-add",
3759
3759
  onAdd: (t) => {
3760
3760
  !this._model || !this._candle || (this._model.comments.add({
@@ -3779,7 +3779,7 @@ class Ya extends Z {
3779
3779
  y: n == null ? void 0 : n.scales.y.convert((t.open + t.close) / 2)
3780
3780
  };
3781
3781
  this.pointer.position(a), this._size || (this.menu.position(a), this.menu.updateAbsolutePosition());
3782
- const r = at({
3782
+ const r = St({
3783
3783
  size: this.menu.absolutePosition,
3784
3784
  parent: n.layout.area,
3785
3785
  offset: 9,
@@ -3788,14 +3788,14 @@ class Ya extends Z {
3788
3788
  this._changeInputCorner(r.side), this.menu.position(r.x, r.y);
3789
3789
  }
3790
3790
  }
3791
- class Wa extends pe {
3791
+ class ja extends Fe {
3792
3792
  constructor(t) {
3793
3793
  super("comments", t, { noCanvas: !0 });
3794
3794
  f(this, "boxes", {});
3795
3795
  f(this, "contextMenu");
3796
3796
  f(this, "_view");
3797
3797
  if (!this.dom) throw new Error("[CS_V_Comments] this.dom must be defined");
3798
- this.contextMenu = new Ya(), this._view = t, t.domElements.append(this.contextMenu.node);
3798
+ this.contextMenu = new Wa(), this._view = t, t.domElements.append(this.contextMenu.node);
3799
3799
  }
3800
3800
  _getCandleCoords(t, s) {
3801
3801
  return {
@@ -3812,7 +3812,7 @@ class Wa extends pe {
3812
3812
  view: this._view,
3813
3813
  onBoxActivate: (o) => {
3814
3814
  const c = a[0].candle;
3815
- ja.animateToDataCoords(n, c.open_time, (c.open + c.close) / 2), this.boxes[o].setState({ isActive: !0 });
3815
+ Ya.animateToDataCoords(n, c.open_time, (c.open + c.close) / 2), this.boxes[o].setState({ isActive: !0 });
3816
3816
  },
3817
3817
  onBoxDeactivate: (o) => this.boxes[o].setState({ isActive: !1 })
3818
3818
  });
@@ -3829,12 +3829,12 @@ class Wa extends pe {
3829
3829
  });
3830
3830
  }
3831
3831
  }
3832
- class Xa extends _e {
3832
+ class Xa extends Ne {
3833
3833
  constructor(e) {
3834
3834
  super(e);
3835
3835
  }
3836
3836
  drawMarker({ text: e, startLineCoords: t, endMarkerCoords: s, colors: n, type: a, side: r }) {
3837
- ni(this.ctx, {
3837
+ yi(this.ctx, {
3838
3838
  text: e,
3839
3839
  colors: n,
3840
3840
  startLineCoords: t,
@@ -3844,7 +3844,7 @@ class Xa extends _e {
3844
3844
  });
3845
3845
  }
3846
3846
  }
3847
- class Ua extends pe {
3847
+ class Ua extends Fe {
3848
3848
  constructor(e) {
3849
3849
  if (super("guides", e, { CanvasClass: Xa, noDOM: !0 }), !this.canvas) throw new Error("[CS_V_Guides] Canvas must be defined");
3850
3850
  }
@@ -3873,17 +3873,17 @@ class Ua extends pe {
3873
3873
  }
3874
3874
  }
3875
3875
  }
3876
- class Ga extends Z {
3876
+ class Ga extends ie {
3877
3877
  constructor(t) {
3878
3878
  super({ className: t });
3879
3879
  f(this, "_isFirstShow", !1);
3880
3880
  const s = new k({ tag: "p" });
3881
- s.node.textContent = "No data from broker", this.append(s.node), this.state = { isShow: !1, x: 0, y: 0, parent: V.empty() }, this.render();
3881
+ s.node.textContent = "No data from broker", this.append(s.node), this.state = { isShow: !1, x: 0, y: 0, parent: W.empty() }, this.render();
3882
3882
  }
3883
3883
  render() {
3884
3884
  const { isShow: t, x: s, y: n, parent: a } = this.state;
3885
3885
  t && !this._isFirstShow && (this.updateAbsolutePosition(), this._isFirstShow = !0), this.setVisible(t);
3886
- const r = at({
3886
+ const r = St({
3887
3887
  size: this.absolutePosition,
3888
3888
  parent: a,
3889
3889
  coords: { x: s, y: n }
@@ -3891,7 +3891,7 @@ class Ga extends Z {
3891
3891
  this.position(r.x, r.y);
3892
3892
  }
3893
3893
  }
3894
- class Za extends _e {
3894
+ class Za extends Ne {
3895
3895
  constructor(t) {
3896
3896
  super(t);
3897
3897
  f(this, "domain", null);
@@ -3916,22 +3916,22 @@ class Za extends _e {
3916
3916
  }
3917
3917
  } = t, h = t.config.candles.style === "filled";
3918
3918
  this.domain = t.scales.x.domain(), c || this._getVisible(r).forEach((u, g) => {
3919
- const _ = s.noDataFill[g % s.noDataFill.length], p = h ? _ : s.noDataStroke;
3919
+ const p = s.noDataFill[g % s.noDataFill.length], _ = h ? p : s.noDataStroke;
3920
3920
  this.drawSingleCandle({
3921
3921
  ...this._getBasicCandleProps(t, u),
3922
- colors: { fill: _, stroke: p, bg: n }
3922
+ colors: { fill: p, stroke: _, bg: n }
3923
3923
  });
3924
3924
  }), this._getVisible(o).forEach((u) => {
3925
- const g = u.close >= u.open ? "rising" : "falling", _ = s[`${g}Fill`], p = s[`${g}${h ? "Fill" : "Stroke"}`];
3925
+ const g = u.close >= u.open ? "rising" : "falling", p = s[`${g}Fill`], _ = s[`${g}${h ? "Fill" : "Stroke"}`];
3926
3926
  this.drawSingleCandle({
3927
3927
  ...this._getBasicCandleProps(t, u),
3928
- colors: { fill: _, stroke: p, bg: n },
3928
+ colors: { fill: p, stroke: _, bg: n },
3929
3929
  isDim: !!(a.length && !a.includes(u.open_time.getTime()))
3930
3930
  });
3931
3931
  });
3932
3932
  }
3933
3933
  _mix(t, s, n) {
3934
- return n ? A.mix(t, s).toString() : t;
3934
+ return n ? M.mix(t, s).toString() : t;
3935
3935
  }
3936
3936
  _getBasicCandleProps(t, s) {
3937
3937
  return {
@@ -3947,7 +3947,7 @@ class Za extends _e {
3947
3947
  };
3948
3948
  }
3949
3949
  }
3950
- class qa extends pe {
3950
+ class qa extends Fe {
3951
3951
  constructor(t) {
3952
3952
  super("candles", t, { CanvasClass: Za });
3953
3953
  f(this, "_noDataTooltip", null);
@@ -3989,15 +3989,15 @@ class Ja {
3989
3989
  f(this, "candles");
3990
3990
  this.container = e, this.wrapper = new k({ tag: "div", className: "sc-charts-cs" }), e.append(this.wrapper.node);
3991
3991
  const { width: t, height: s } = e.getBoundingClientRect();
3992
- this.width = t, this.height = s, this.mainCanvas = new _e({
3992
+ this.width = t, this.height = s, this.mainCanvas = new Ne({
3993
3993
  className: "sc-charts-cs__canvas-main",
3994
3994
  width: t,
3995
3995
  height: s,
3996
3996
  isMain: !0
3997
- }), this.domElements = new k({ tag: "div", className: "sc-charts-cs__dom-elements" }), this.canvasesContainer = new k({ tag: "div", className: "sc-charts-cs__canvases" }), this.canvasesContainer.append(this.mainCanvas.node), this.wrapper.append(this.canvasesContainer.node, this.domElements.node), this.mainCanvas.updateAbsolutePosition(), this.binding = new Rn(this.mainCanvas.node), this.comments = new Wa(this), this.candles = new qa(this), this.trade = new xa(this), this.guideMarkers = new Ua(this), this.userMarkers = new Sa(this);
3997
+ }), this.domElements = new k({ tag: "div", className: "sc-charts-cs__dom-elements" }), this.canvasesContainer = new k({ tag: "div", className: "sc-charts-cs__canvases" }), this.canvasesContainer.append(this.mainCanvas.node), this.wrapper.append(this.canvasesContainer.node, this.domElements.node), this.mainCanvas.updateAbsolutePosition(), this.binding = new Rn(this.mainCanvas.node), this.comments = new ja(this), this.candles = new qa(this), this.trade = new xa(this), this.guideMarkers = new Ua(this), this.userMarkers = new Ta(this);
3998
3998
  }
3999
3999
  renderAll(e) {
4000
- this.mainCanvas.clear(), this.candles.render(e), qe.xAxis(this.mainCanvas.ctx, e), qe.yAxis(this.mainCanvas.ctx, e), qe.intersection(this.mainCanvas.ctx, e), this.trade.renderAll(e), this.userMarkers.render(e), this.comments.render(e);
4000
+ this.mainCanvas.clear(), this.candles.render(e), pt.xAxis(this.mainCanvas.ctx, e), pt.yAxis(this.mainCanvas.ctx, e), pt.intersection(this.mainCanvas.ctx, e), this.trade.renderAll(e), this.userMarkers.render(e), this.comments.render(e);
4001
4001
  }
4002
4002
  }
4003
4003
  class Qa {
@@ -4085,7 +4085,7 @@ class Ka {
4085
4085
  });
4086
4086
  }
4087
4087
  }
4088
- class Jt {
4088
+ class fi {
4089
4089
  constructor() {
4090
4090
  f(this, "_map", /* @__PURE__ */ new Map());
4091
4091
  }
@@ -4119,7 +4119,7 @@ class Jt {
4119
4119
  class er {
4120
4120
  constructor() {
4121
4121
  f(this, "_elements", []);
4122
- f(this, "_listeners", new Jt());
4122
+ f(this, "_listeners", new fi());
4123
4123
  f(this, "_lastHovered", /* @__PURE__ */ new Set());
4124
4124
  f(this, "_dragContext", null);
4125
4125
  }
@@ -4133,7 +4133,7 @@ class er {
4133
4133
  this._elements = this._elements.filter((t) => t !== e), this._listeners.removeAll(e), this._lastHovered.delete(e);
4134
4134
  }
4135
4135
  clear() {
4136
- this._elements = [], this._listeners = new Jt(), this._lastHovered.clear();
4136
+ this._elements = [], this._listeners = new fi(), this._lastHovered.clear();
4137
4137
  }
4138
4138
  on(e, t, s) {
4139
4139
  this._listeners.add(e, t, s);
@@ -4275,8 +4275,8 @@ class tr {
4275
4275
  }
4276
4276
  } = this.model;
4277
4277
  for (const o of s) {
4278
- const c = n.convert(o.open_time), h = a.convert(o.high), u = a.convert(o.low), g = c - r / 2, _ = c + r / 2, p = Math.min(h, u), v = Math.max(h, u);
4279
- if (e >= g && e <= _ && t >= p && t <= v)
4278
+ const c = n.convert(o.open_time), h = a.convert(o.high), u = a.convert(o.low), g = c - r / 2, p = c + r / 2, _ = Math.min(h, u), v = Math.max(h, u);
4279
+ if (e >= g && e <= p && t >= _ && t <= v)
4280
4280
  return {
4281
4281
  target: this,
4282
4282
  x: e,
@@ -4313,11 +4313,11 @@ class sr {
4313
4313
  hitTest(e, t) {
4314
4314
  const { tradedCandles: s } = this.model.trade, { x: n, y: a } = this.model.scales, r = 16, o = 4;
4315
4315
  for (const { candle: c, trades: h } of s) {
4316
- const g = n.convert(c.open_time) + this.model.config.candles.baseWidth / 2, _ = r, p = r;
4316
+ const g = n.convert(c.open_time) + this.model.config.candles.baseWidth / 2, p = r, _ = r;
4317
4317
  for (const v of ["buy", "sell"]) {
4318
- const b = h.filter((x) => x.type === v);
4318
+ const b = h.filter((w) => w.type === v);
4319
4319
  if (!b.length) continue;
4320
- const w = v === "buy" ? a.convert(c.low) + o + Le(r) : a.convert(c.high) - o - r - Le(r), C = e >= g - _ / 2 && e <= g + _ / 2, y = t >= w && t <= w + p;
4320
+ const x = v === "buy" ? a.convert(c.low) + o + qe(r) : a.convert(c.high) - o - r - qe(r), C = e >= g - p / 2 && e <= g + p / 2, y = t >= x && t <= x + _;
4321
4321
  if (C && y)
4322
4322
  return {
4323
4323
  target: this,
@@ -4346,7 +4346,7 @@ class nr {
4346
4346
  if (!t) return;
4347
4347
  const s = this._model.scales.x.convert(t.candle.open_time), n = this._model.scales.y.convert(
4348
4348
  t.trades[0].type === "buy" ? t.candle.low : t.candle.high
4349
- ), a = t.trades[0].type === "buy" ? n + 4 + Le(16) + 8 : n - 4 - 16 - Le(16) + 8;
4349
+ ), a = t.trades[0].type === "buy" ? n + 4 + qe(16) + 8 : n - 4 - 16 - qe(16) + 8;
4350
4350
  this._model.eventBus.emit("open_trade_label_tooltip", {
4351
4351
  trade: { candle: t.candle, trades: t.trades, tradeType: t.tradeType },
4352
4352
  x: s,
@@ -4423,14 +4423,14 @@ function cr(i, e) {
4423
4423
  }));
4424
4424
  };
4425
4425
  }
4426
- function it(i, e) {
4426
+ function Ct(i, e) {
4427
4427
  const { width: t } = e.candles.limiter.absolutePosition, s = i.config.candles.baseWidth, n = i.config.candles.limiterOffset.left + i.config.candles.limiterOffset.right, r = i.scales.x.convert(i.candles.allData[0].open_time) - t - s / 2 - n;
4428
4428
  r > 0 && i.scales.pan("x", -r);
4429
4429
  }
4430
- function st(i) {
4430
+ function At(i) {
4431
4431
  return i.candles.limiter.absolutePosition.width > 0;
4432
4432
  }
4433
- class ot {
4433
+ class kt {
4434
4434
  constructor(e, t, s) {
4435
4435
  f(this, "_model");
4436
4436
  f(this, "_hitManager");
@@ -4438,7 +4438,7 @@ class ot {
4438
4438
  this._model = e, this._hitManager = t, this._hit = s, t.register(s);
4439
4439
  }
4440
4440
  }
4441
- class hr extends ot {
4441
+ class hr extends kt {
4442
4442
  constructor(t, s, n) {
4443
4443
  super(t, s, new ar(t));
4444
4444
  f(this, "_view");
@@ -4447,13 +4447,13 @@ class hr extends ot {
4447
4447
  register() {
4448
4448
  this._hitManager.on(this._hit, "drag", (t) => {
4449
4449
  const s = t.x - (t.prevX ?? t.x);
4450
- this._model.scales.scale("x", -s), this._view && st(this._view) && it(this._model, this._view);
4450
+ this._model.scales.scale("x", -s), this._view && At(this._view) && Ct(this._model, this._view);
4451
4451
  }), this._hitManager.on(this._hit, "dblclick", () => {
4452
4452
  this._model.scales.scale("x", 1, "absolute"), this._model.scales.pan("x", 0, "absolute");
4453
4453
  });
4454
4454
  }
4455
4455
  }
4456
- class dr extends ot {
4456
+ class dr extends kt {
4457
4457
  constructor(e, t) {
4458
4458
  super(e, t, new or(e));
4459
4459
  }
@@ -4466,7 +4466,7 @@ class dr extends ot {
4466
4466
  });
4467
4467
  }
4468
4468
  }
4469
- class ur extends ot {
4469
+ class ur extends kt {
4470
4470
  constructor(t, s, n) {
4471
4471
  super(t, n, new rr(t));
4472
4472
  f(this, "_view");
@@ -4485,16 +4485,16 @@ class ur extends ot {
4485
4485
  this._hit,
4486
4486
  "drag",
4487
4487
  cr(1, (t) => {
4488
- this._model.scales.pan("x", t.x - (t.prevX ?? t.x)), st(this._view) && it(this._model, this._view), this._model.scales.pan("y", t.y - (t.prevY ?? t.y)), this._view.guideMarkers.render(this._model, { x: t.x, y: t.y });
4488
+ this._model.scales.pan("x", t.x - (t.prevX ?? t.x)), At(this._view) && Ct(this._model, this._view), this._model.scales.pan("y", t.y - (t.prevY ?? t.y)), this._view.guideMarkers.render(this._model, { x: t.x, y: t.y });
4489
4489
  })
4490
4490
  ), this._hitManager.on(this._hit, "contextmenu", ({ x: t }) => {
4491
- const s = this._model.scales.x.invert(t), n = nt.findByDate(s, this._model.candles.allData);
4491
+ const s = this._model.scales.x.invert(t), n = Mt.findByDate(s, this._model.candles.allData);
4492
4492
  n && (this._view.comments.contextMenu.setState({ isShow: !0, candle: n }), this._view.comments.render(this._model));
4493
4493
  }), this._hitManager.on(this._hit, "wheel", (t) => {
4494
4494
  var a, r;
4495
4495
  if (!t.deltaY) return;
4496
4496
  const s = -t.deltaY, n = (r = (a = this._model.config) == null ? void 0 : a.candles) == null ? void 0 : r.zoomOnWheel;
4497
- ["x", "both"].includes(n) && (this._model.scales.scale("x", s), st(this._view) && it(this._model, this._view)), ["y", "both"].includes(n) && this._model.scales.scale("y", s);
4497
+ ["x", "both"].includes(n) && (this._model.scales.scale("x", s), At(this._view) && Ct(this._model, this._view)), ["y", "both"].includes(n) && this._model.scales.scale("y", s);
4498
4498
  });
4499
4499
  }
4500
4500
  }
@@ -4628,32 +4628,32 @@ class pr {
4628
4628
  updateComments(e) {
4629
4629
  this._model.updateComments(e);
4630
4630
  }
4631
- async _drawHeader(e, t, s) {
4632
- const n = 48 * s, a = 12 * s, r = 20 * s, o = 103 * s;
4633
- e.fillStyle = "#FFFFFF", e.fillRect(0, 0, t, n), e.strokeStyle = "#EDEDED", e.lineWidth = 1 * s, e.beginPath(), e.moveTo(0, n), e.lineTo(t, n), e.stroke();
4634
- const c = `<svg width="103" height="20" viewBox="0 0 103 20" fill="none" xmlns="http://www.w3.org/2000/svg">
4635
- <path d="M92.6267 1.50666H93.0475C93.3792 1.50666 93.6025 1.31028 93.6025 1.02537C93.6025 0.740457 93.4034 0.561783 93.0426 0.561783C92.706 0.561783 92.4827 0.759773 92.4633 1.06239H91.795C91.8209 0.423351 92.3225 0.00805664 93.075 0.00805664C93.8274 0.00805664 94.2886 0.376671 94.2886 0.928788C94.2886 1.35213 93.9973 1.65797 93.5717 1.73523V1.74972C94.0895 1.79318 94.4229 2.10385 94.4229 2.58192C94.4229 3.20164 93.8581 3.61372 93.0572 3.61372C92.2562 3.61372 91.761 3.18555 91.7271 2.54973H92.4212C92.4423 2.84108 92.6834 3.03263 93.0652 3.03263C93.4471 3.03263 93.6834 2.82981 93.6834 2.53685C93.6834 2.22135 93.4455 2.0298 93.0539 2.0298H92.6251V1.50827L92.6267 1.50666Z" fill="#1C2026"/>
4636
- <path d="M95.1182 2.97623C94.9256 2.68488 94.8269 2.29373 94.8269 1.83498C94.8269 0.692113 95.3852 0.00317383 96.2816 0.00317383C96.9434 0.00317383 97.4596 0.392714 97.5567 0.957708H96.8431C96.7735 0.727525 96.5502 0.574607 96.2784 0.574607C95.7945 0.574607 95.5017 1.03658 95.5178 1.81566H95.5324C95.6716 1.47763 96.013 1.25389 96.4564 1.25389C97.1149 1.25389 97.6036 1.73679 97.6036 2.39192C97.6036 3.10179 97.0486 3.61205 96.2719 3.61205C95.7735 3.61205 95.3625 3.3867 95.1198 2.97623H95.1182ZM96.8949 2.41446C96.8949 2.05872 96.6279 1.79796 96.2654 1.79796C95.903 1.79796 95.6311 2.05872 95.6311 2.40802C95.6311 2.75732 95.9078 3.0374 96.2638 3.0374C96.6198 3.0374 96.8965 2.76215 96.8965 2.41607L96.8949 2.41446Z" fill="#1C2026"/>
4637
- <path d="M97.998 1.79961C97.998 0.68411 98.5336 0 99.4026 0C100.272 0 100.804 0.6825 100.804 1.79639C100.804 2.91028 100.275 3.60727 99.4026 3.60727C98.5304 3.60727 97.998 2.91672 97.998 1.798V1.79961ZM100.066 1.79961C100.066 1.01892 99.8136 0.579481 99.4026 0.579481C98.9916 0.579481 98.7359 1.02214 98.7359 1.79961C98.7359 2.57708 98.9883 3.0294 99.4026 3.0294C99.8168 3.0294 100.066 2.58674 100.066 1.79961Z" fill="#1C2026"/>
4638
- <path d="M101.137 0.809958C101.137 0.381786 101.469 0.048584 101.901 0.048584C102.333 0.048584 102.666 0.381786 102.666 0.809958C102.666 1.23813 102.331 1.57294 101.901 1.57294C101.47 1.57294 101.137 1.23974 101.137 0.809958ZM102.249 0.809958C102.249 0.616798 102.097 0.46066 101.902 0.46066C101.708 0.46066 101.556 0.616798 101.556 0.809958C101.556 1.00312 101.715 1.16087 101.902 1.16087C102.1 1.16087 102.249 0.998289 102.249 0.809958Z" fill="#1C2026"/>
4639
- <path d="M42.5486 0.0388184C37.204 0.0388184 33.5098 3.06983 33.5098 7.50447C33.5098 11.9391 37.204 15.02 42.5486 15.02C47.8933 15.02 51.5018 11.9375 51.5018 7.49803C51.5018 3.05856 47.8642 0.0388184 42.5486 0.0388184ZM42.5486 12.2836C39.0227 12.2836 36.5519 10.3327 36.5519 7.4771C36.5519 4.62155 39.0179 2.78331 42.5486 2.78331C46.0794 2.78331 48.4613 4.67789 48.4613 7.4771C48.4613 10.2763 45.9872 12.2787 42.5486 12.2787V12.2852V12.2836Z" fill="#1C2026"/>
4640
- <path d="M10.4321 6.17332H5.62948C2.78642 6.17332 2.01943 2.78013 7.93208 2.78013C10.4337 2.78013 12.3949 3.85539 13.2476 4.41878L14.7833 2.10085C13.3318 0.827603 10.7751 0.0356445 7.90457 0.0356445C-1.589 0.0356445 -1.70389 8.85825 5.65861 8.85825H10.4903C13.6166 8.85825 14.1279 12.2804 7.93208 12.2804C4.83336 12.2804 2.38836 10.6402 1.53561 10.0172L0 12.3367C1.45146 13.6084 4.51944 15.0217 7.95797 15.0217C17.9062 15.0152 18.0211 6.17171 10.4321 6.17171V6.17332Z" fill="#1C2026"/>
4641
- <path d="M26.0314 12.2771C22.3939 12.2771 20.0346 10.3262 20.0346 7.527C20.0346 4.72779 22.3648 2.7817 26.0023 2.7817C28.0784 2.7817 30.0104 3.85696 31.1755 4.93061L32.9166 2.52737C31.2677 1.22836 28.737 0.0388184 26.0088 0.0388184C20.5508 0.0388184 16.999 3.09397 16.999 7.53344C16.999 11.9729 20.6042 15.02 26.0654 15.02C28.8502 15.02 31.381 13.7757 33.0282 12.4751L31.2386 10.1266C30.0687 11.2067 28.135 12.2771 26.0314 12.2771Z" fill="#1C2026"/>
4642
- <path d="M80.9771 0.0372542C75.8605 0.0372542 72.3071 3.09241 72.3071 7.53188C72.3071 11.9714 76.3719 15.0185 81.9156 15.0185C84.8428 15.0185 87.2829 14.0575 88.8218 12.7569L87.0289 10.4148C85.9771 11.5464 84.2732 12.3657 81.8849 12.3657C78.558 12.3657 76.1874 10.9814 75.5013 8.85986H89.592V7.5013C89.5872 3.06182 86.092 0.0356445 80.9755 0.0356445L80.9771 0.0372542ZM80.948 2.69482C83.8768 2.69482 85.88 4.06787 86.4075 6.25702H75.4447C75.9884 4.08718 77.9722 2.69482 80.948 2.69482Z" fill="#1C2026"/>
4643
- <path d="M62.7358 0.0372542C60.1921 0.0372542 58.1743 0.925792 56.7875 2.29562C56.4283 1.16563 55.4364 0.462207 54.0917 0.462207H52.2471V3.14875H53.951V20.0004H56.9364V12.8792C58.3151 14.1782 60.273 15.0233 62.739 15.0233C67.485 15.0233 70.7536 11.9408 70.7536 7.5013C70.7536 3.06182 67.4802 0.0356445 62.7342 0.0356445L62.7358 0.0372542ZM62.3652 12.2756C59.1241 12.2756 56.9364 10.3247 56.9364 7.4691C56.9364 4.61355 59.1241 2.7753 62.3652 2.7753C65.6064 2.7753 67.7099 4.66989 67.7099 7.4691C67.7067 10.3311 65.464 12.2756 62.3652 12.2756Z" fill="#1C2026"/>
4631
+ async _drawHeader(e, t, s, n = !1) {
4632
+ const a = 48 * s, r = 12 * s, o = 20 * s, c = 103 * s;
4633
+ e.fillStyle = n ? "#101011" : "#FFFFFF", e.fillRect(0, 0, t, a), e.strokeStyle = n ? "#3E3E3E" : "#EDEDED", e.lineWidth = 1 * s, e.beginPath(), e.moveTo(0, a), e.lineTo(t, a), e.stroke();
4634
+ const h = n ? "#FFFFFF" : "#1C2026", u = `<svg width="103" height="20" viewBox="0 0 103 20" fill="none" xmlns="http://www.w3.org/2000/svg">
4635
+ <path d="M92.6267 1.50666H93.0475C93.3792 1.50666 93.6025 1.31028 93.6025 1.02537C93.6025 0.740457 93.4034 0.561783 93.0426 0.561783C92.706 0.561783 92.4827 0.759773 92.4633 1.06239H91.795C91.8209 0.423351 92.3225 0.00805664 93.075 0.00805664C93.8274 0.00805664 94.2886 0.376671 94.2886 0.928788C94.2886 1.35213 93.9973 1.65797 93.5717 1.73523V1.74972C94.0895 1.79318 94.4229 2.10385 94.4229 2.58192C94.4229 3.20164 93.8581 3.61372 93.0572 3.61372C92.2562 3.61372 91.761 3.18555 91.7271 2.54973H92.4212C92.4423 2.84108 92.6834 3.03263 93.0652 3.03263C93.4471 3.03263 93.6834 2.82981 93.6834 2.53685C93.6834 2.22135 93.4455 2.0298 93.0539 2.0298H92.6251V1.50827L92.6267 1.50666Z" fill="${h}"/>
4636
+ <path d="M95.1182 2.97623C94.9256 2.68488 94.8269 2.29373 94.8269 1.83498C94.8269 0.692113 95.3852 0.00317383 96.2816 0.00317383C96.9434 0.00317383 97.4596 0.392714 97.5567 0.957708H96.8431C96.7735 0.727525 96.5502 0.574607 96.2784 0.574607C95.7945 0.574607 95.5017 1.03658 95.5178 1.81566H95.5324C95.6716 1.47763 96.013 1.25389 96.4564 1.25389C97.1149 1.25389 97.6036 1.73679 97.6036 2.39192C97.6036 3.10179 97.0486 3.61205 96.2719 3.61205C95.7735 3.61205 95.3625 3.3867 95.1198 2.97623H95.1182ZM96.8949 2.41446C96.8949 2.05872 96.6279 1.79796 96.2654 1.79796C95.903 1.79796 95.6311 2.05872 95.6311 2.40802C95.6311 2.75732 95.9078 3.0374 96.2638 3.0374C96.6198 3.0374 96.8965 2.76215 96.8965 2.41607L96.8949 2.41446Z" fill="${h}"/>
4637
+ <path d="M97.998 1.79961C97.998 0.68411 98.5336 0 99.4026 0C100.272 0 100.804 0.6825 100.804 1.79639C100.804 2.91028 100.275 3.60727 99.4026 3.60727C98.5304 3.60727 97.998 2.91672 97.998 1.798V1.79961ZM100.066 1.79961C100.066 1.01892 99.8136 0.579481 99.4026 0.579481C98.9916 0.579481 98.7359 1.02214 98.7359 1.79961C98.7359 2.57708 98.9883 3.0294 99.4026 3.0294C99.8168 3.0294 100.066 2.58674 100.066 1.79961Z" fill="${h}"/>
4638
+ <path d="M101.137 0.809958C101.137 0.381786 101.469 0.048584 101.901 0.048584C102.333 0.048584 102.666 0.381786 102.666 0.809958C102.666 1.23813 102.331 1.57294 101.901 1.57294C101.47 1.57294 101.137 1.23974 101.137 0.809958ZM102.249 0.809958C102.249 0.616798 102.097 0.46066 101.902 0.46066C101.708 0.46066 101.556 0.616798 101.556 0.809958C101.556 1.00312 101.715 1.16087 101.902 1.16087C102.1 1.16087 102.249 0.998289 102.249 0.809958Z" fill="${h}"/>
4639
+ <path d="M42.5486 0.0388184C37.204 0.0388184 33.5098 3.06983 33.5098 7.50447C33.5098 11.9391 37.204 15.02 42.5486 15.02C47.8933 15.02 51.5018 11.9375 51.5018 7.49803C51.5018 3.05856 47.8642 0.0388184 42.5486 0.0388184ZM42.5486 12.2836C39.0227 12.2836 36.5519 10.3327 36.5519 7.4771C36.5519 4.62155 39.0179 2.78331 42.5486 2.78331C46.0794 2.78331 48.4613 4.67789 48.4613 7.4771C48.4613 10.2763 45.9872 12.2787 42.5486 12.2787V12.2852V12.2836Z" fill="${h}"/>
4640
+ <path d="M10.4321 6.17332H5.62948C2.78642 6.17332 2.01943 2.78013 7.93208 2.78013C10.4337 2.78013 12.3949 3.85539 13.2476 4.41878L14.7833 2.10085C13.3318 0.827603 10.7751 0.0356445 7.90457 0.0356445C-1.589 0.0356445 -1.70389 8.85825 5.65861 8.85825H10.4903C13.6166 8.85825 14.1279 12.2804 7.93208 12.2804C4.83336 12.2804 2.38836 10.6402 1.53561 10.0172L0 12.3367C1.45146 13.6084 4.51944 15.0217 7.95797 15.0217C17.9062 15.0152 18.0211 6.17171 10.4321 6.17171V6.17332Z" fill="${h}"/>
4641
+ <path d="M26.0314 12.2771C22.3939 12.2771 20.0346 10.3262 20.0346 7.527C20.0346 4.72779 22.3648 2.7817 26.0023 2.7817C28.0784 2.7817 30.0104 3.85696 31.1755 4.93061L32.9166 2.52737C31.2677 1.22836 28.737 0.0388184 26.0088 0.0388184C20.5508 0.0388184 16.999 3.09397 16.999 7.53344C16.999 11.9729 20.6042 15.02 26.0654 15.02C28.8502 15.02 31.381 13.7757 33.0282 12.4751L31.2386 10.1266C30.0687 11.2067 28.135 12.2771 26.0314 12.2771Z" fill="${h}"/>
4642
+ <path d="M80.9771 0.0372542C75.8605 0.0372542 72.3071 3.09241 72.3071 7.53188C72.3071 11.9714 76.3719 15.0185 81.9156 15.0185C84.8428 15.0185 87.2829 14.0575 88.8218 12.7569L87.0289 10.4148C85.9771 11.5464 84.2732 12.3657 81.8849 12.3657C78.558 12.3657 76.1874 10.9814 75.5013 8.85986H89.592V7.5013C89.5872 3.06182 86.092 0.0356445 80.9755 0.0356445L80.9771 0.0372542ZM80.948 2.69482C83.8768 2.69482 85.88 4.06787 86.4075 6.25702H75.4447C75.9884 4.08718 77.9722 2.69482 80.948 2.69482Z" fill="${h}"/>
4643
+ <path d="M62.7358 0.0372542C60.1921 0.0372542 58.1743 0.925792 56.7875 2.29562C56.4283 1.16563 55.4364 0.462207 54.0917 0.462207H52.2471V3.14875H53.951V20.0004H56.9364V12.8792C58.3151 14.1782 60.273 15.0233 62.739 15.0233C67.485 15.0233 70.7536 11.9408 70.7536 7.5013C70.7536 3.06182 67.4802 0.0356445 62.7342 0.0356445L62.7358 0.0372542ZM62.3652 12.2756C59.1241 12.2756 56.9364 10.3247 56.9364 7.4691C56.9364 4.61355 59.1241 2.7753 62.3652 2.7753C65.6064 2.7753 67.7099 4.66989 67.7099 7.4691C67.7067 10.3311 65.464 12.2756 62.3652 12.2756Z" fill="${h}"/>
4644
4644
  </svg>`;
4645
4645
  try {
4646
- const h = await this._loadSvgAsImage(c);
4647
- h && e.drawImage(h, a, (n - r) / 2, o, r);
4648
- } catch (h) {
4649
- console.warn("Failed to load logo SVG:", h);
4646
+ const g = await this._loadSvgAsImage(u);
4647
+ g && e.drawImage(g, r, (a - o) / 2, c, o);
4648
+ } catch (g) {
4649
+ console.warn("Failed to load logo SVG:", g);
4650
4650
  }
4651
4651
  }
4652
- _drawHeaderSecondLine(e, t, s, n, a, r) {
4653
- const o = 20 * r, c = 12 * r, h = 8 * r;
4654
- e.fillStyle = "#FFFFFF", e.fillRect(0, a, n, o), e.strokeStyle = "#EDEDED", e.lineWidth = 1 * r, e.beginPath(), e.moveTo(0, a + o), e.lineTo(n, a + o), e.stroke(), e.fillStyle = "#1C2026", e.font = `500 ${h}px Geist, Arial, sans-serif`, e.textBaseline = "middle", e.textAlign = "left";
4655
- const u = t ? `${t} created with Scope360, ${s}` : `Scope360, ${s}`;
4656
- e.fillText(u, c, a + o / 2);
4652
+ _drawHeaderSecondLine(e, t, s, n, a, r, o = !1) {
4653
+ const c = 20 * r, h = 12 * r, u = 8 * r;
4654
+ e.fillStyle = o ? "#292929" : "#FFFFFF", e.fillRect(0, a, n, c), e.strokeStyle = o ? "#3E3E3E" : "#EDEDED", e.lineWidth = 1 * r, e.beginPath(), e.moveTo(0, a + c), e.lineTo(n, a + c), e.stroke(), e.fillStyle = o ? "#C3C3C5" : "#1C2026", e.font = `500 ${u}px Geist, Arial, sans-serif`, e.textBaseline = "middle", e.textAlign = "left";
4655
+ const g = t ? `${t} created with Scope360, ${s}` : `Scope360, ${s}`;
4656
+ e.fillText(g, h, a + c / 2);
4657
4657
  }
4658
4658
  _loadSvgAsImage(e) {
4659
4659
  return new Promise((t, s) => {
@@ -4665,24 +4665,25 @@ class pr {
4665
4665
  }, n.src = r;
4666
4666
  });
4667
4667
  }
4668
- _drawFooter(e, t, s, n, a, r) {
4669
- const o = 32 * r, c = 12 * r, h = 12 * r, u = 4 * r, g = n + a;
4670
- e.fillStyle = "#FFFFFF", e.fillRect(0, g, s, o), e.strokeStyle = "#EDEDED", e.lineWidth = 1 * r, e.beginPath(), e.moveTo(0, g), e.lineTo(s, g), e.stroke(), e.textBaseline = "middle", e.textAlign = "left";
4668
+ _drawFooter(e, t, s, n, a, r, o = !1) {
4669
+ const c = 32 * r, h = 12 * r, u = 12 * r, g = 4 * r, p = n + a;
4670
+ e.fillStyle = o ? "#292929" : "#FFFFFF", e.fillRect(0, p, s, c), e.strokeStyle = o ? "#3E3E3E" : "#EDEDED", e.lineWidth = 1 * r, e.beginPath(), e.moveTo(0, p), e.lineTo(s, p), e.stroke(), e.textBaseline = "middle", e.textAlign = "left";
4671
4671
  const _ = [];
4672
4672
  if (t.pair && _.push({ label: "", value: t.pair }), t.net_pnl !== void 0) {
4673
4673
  const w = t.net_pnl.startsWith("+");
4674
4674
  _.push({ label: "Net P&L", value: t.net_pnl, valueColor: w ? "#56B683" : "#F18169" });
4675
4675
  }
4676
4676
  t.type && _.push({ label: "Type", value: t.type }), t.entry_price && _.push({ label: "Entry", value: t.entry_price }), t.exit_price && _.push({ label: "Exit", value: t.exit_price }), t.open_date && _.push({ label: "Open date", value: t.open_date }), t.close_date && _.push({ label: "Close date", value: t.close_date }), t.holdtime && _.push({ label: "Holdtime", value: t.holdtime }), t.rr && _.push({ label: "RR", value: t.rr }), t.volume && _.push({ label: "Volume", value: t.volume });
4677
- const p = g + o / 2, v = 24 * r;
4677
+ const v = p + c / 2, b = 24 * r;
4678
4678
  if (_.length === 0) return;
4679
- e.font = `500 ${h}px Geist, Arial, sans-serif`;
4680
- let b = c;
4679
+ e.font = `500 ${u}px Geist, Arial, sans-serif`;
4680
+ const x = o ? "#878788" : "#8E8E93", C = o ? "#FAFAFA" : "#1C2026";
4681
+ let y = h;
4681
4682
  _.forEach((w) => {
4682
- const C = e.measureText(w.label).width, y = e.measureText(w.value).width, x = C + u + y;
4683
- e.fillStyle = "#8E8E93", e.font = `500 ${h}px Geist, Arial, sans-serif`, e.fillText(w.label, b, p);
4684
- const T = b + C + u;
4685
- e.fillStyle = w.valueColor || "#1C2026", e.font = `500 ${h}px Geist, Arial, sans-serif`, e.fillText(w.value, T, p), b += x + v;
4683
+ const S = e.measureText(w.label).width, L = e.measureText(w.value).width, R = S + g + L;
4684
+ e.fillStyle = x, e.font = `500 ${u}px Geist, Arial, sans-serif`, e.fillText(w.label, y, v);
4685
+ const $ = y + S + g;
4686
+ e.fillStyle = w.valueColor || C, e.font = `500 ${u}px Geist, Arial, sans-serif`, e.fillText(w.value, $, v), y += R + b;
4686
4687
  });
4687
4688
  }
4688
4689
  async captureScreenshot(e = {}) {
@@ -4693,44 +4694,68 @@ class pr {
4693
4694
  hour: "2-digit",
4694
4695
  minute: "2-digit",
4695
4696
  timeZoneName: "short"
4696
- }), a = typeof e == "object" ? e : {}, r = a.createdBy, o = a.createdAt || n, c = a.trade, { width: h, height: u, canvasesContainer: g } = this._view, _ = Array.from(
4697
- g.node.querySelectorAll("canvas")
4697
+ }), a = typeof e == "object" ? e : {}, r = a.createdBy, o = a.createdAt || n, c = a.trade, h = a.isDark || !1, { canvasesContainer: u, width: g, height: p } = this._view, _ = Array.from(
4698
+ u.node.querySelectorAll("canvas")
4698
4699
  );
4699
4700
  if (_.length === 0) {
4700
4701
  console.warn("No canvas elements found for screenshot");
4701
4702
  return;
4702
4703
  }
4703
- const p = window.devicePixelRatio || 1, v = 48 * p, b = 20 * p, w = c ? 32 * p : 0, C = u * p, y = C + v + b + w, x = document.createElement("canvas");
4704
- x.width = h * p, x.height = y;
4705
- const T = x.getContext("2d");
4706
- if (!T) {
4704
+ const v = 1440, b = 900, x = 48, C = 20, y = c ? 32 : 0, w = b - x - C - y, S = v, L = g / p, R = S / w;
4705
+ let $, O, K = 0, j = 0;
4706
+ L > R ? (O = w, $ = O * L, K = 0, j = 0) : ($ = S, O = $ / L, j = (w - O) / 2);
4707
+ const P = window.devicePixelRatio || 1, X = document.createElement("canvas");
4708
+ X.width = v * P, X.height = b * P;
4709
+ const U = X.getContext("2d");
4710
+ if (!U) {
4707
4711
  console.error("Failed to get 2D context for merged canvas");
4708
4712
  return;
4709
4713
  }
4710
- T.fillStyle = "#ffffff", T.fillRect(0, 0, x.width, x.height);
4711
- let F = v + b;
4712
- await this._drawHeader(T, x.width, p), this._drawHeaderSecondLine(T, r, o, x.width, v, p);
4713
- const R = this._view.mainCanvas;
4714
- R.background && (T.fillStyle = R.background, T.fillRect(0, F, x.width, C)), _.forEach(($) => {
4715
- T.drawImage(
4716
- $,
4717
- 0,
4718
- 0,
4719
- $.width,
4720
- $.height,
4721
- 0,
4722
- F,
4723
- x.width,
4724
- C
4714
+ U.fillStyle = h ? "#101011" : "#ffffff", U.fillRect(0, 0, X.width, X.height);
4715
+ const He = x * P, et = C * P, re = w * P, ve = S * P, be = He + et;
4716
+ await this._drawHeader(U, X.width, P, h), this._drawHeaderSecondLine(U, r, o, X.width, He, P, h);
4717
+ const Be = this._view.mainCanvas;
4718
+ Be.background && (U.fillStyle = Be.background, U.fillRect(0, be, X.width, re));
4719
+ const Ie = $ * P, Re = O * P, tt = K * P, N = j * P;
4720
+ _.forEach((z) => {
4721
+ let fe = 0, G = 0, Z = z.width, se = z.height, ye = Ie, ge = Re, we = tt, xe = N;
4722
+ if (L > R) {
4723
+ const oe = Re / z.height, le = z.width * oe;
4724
+ le > ve && (fe = (le - ve) / oe, Z = z.width - fe, ye = ve, we = 0);
4725
+ } else {
4726
+ const oe = Ie / z.width, le = z.height * oe;
4727
+ if (le > re) {
4728
+ const Ce = (le - re) / oe;
4729
+ G = Ce / 2, se = z.height - Ce, ge = re, xe = 0;
4730
+ }
4731
+ }
4732
+ U.drawImage(
4733
+ z,
4734
+ fe,
4735
+ G,
4736
+ Z,
4737
+ se,
4738
+ we,
4739
+ be + xe,
4740
+ ye,
4741
+ ge
4725
4742
  );
4726
- }), c && this._drawFooter(T, c, x.width, F, C, p), x.toBlob(
4727
- ($) => {
4728
- if (!$) {
4743
+ }), c && this._drawFooter(U, c, X.width, be, re, P, h), X.toBlob(
4744
+ async (z) => {
4745
+ if (!z) {
4729
4746
  console.error("Failed to create blob from canvas");
4730
4747
  return;
4731
4748
  }
4732
- const P = URL.createObjectURL($), j = document.createElement("a");
4733
- j.href = P, j.download = t, document.body.appendChild(j), j.click(), document.body.removeChild(j), URL.revokeObjectURL(P);
4749
+ try {
4750
+ await navigator.clipboard.write([
4751
+ new ClipboardItem({
4752
+ "image/png": z
4753
+ })
4754
+ ]);
4755
+ } catch {
4756
+ const G = URL.createObjectURL(z), Z = document.createElement("a");
4757
+ Z.href = G, Z.download = t, document.body.appendChild(Z), Z.click(), document.body.removeChild(Z), URL.revokeObjectURL(G);
4758
+ }
4734
4759
  },
4735
4760
  "image/png",
4736
4761
  1