candleview 2.8.0 → 2.8.1

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.
package/dist/index.mjs CHANGED
@@ -28,146 +28,146 @@ var zt = {};
28
28
  var Be;
29
29
  function lr() {
30
30
  return Be || (Be = 1, process.env.NODE_ENV !== "production" && (function() {
31
- function f(x) {
32
- if (x == null) return null;
33
- if (typeof x == "function")
34
- return x.$$typeof === N ? null : x.displayName || x.name || null;
35
- if (typeof x == "string") return x;
36
- switch (x) {
31
+ function f(v) {
32
+ if (v == null) return null;
33
+ if (typeof v == "function")
34
+ return v.$$typeof === N ? null : v.displayName || v.name || null;
35
+ if (typeof v == "string") return v;
36
+ switch (v) {
37
37
  case M:
38
38
  return "Fragment";
39
39
  case P:
40
40
  return "Profiler";
41
41
  case k:
42
42
  return "StrictMode";
43
- case v:
43
+ case x:
44
44
  return "Suspense";
45
45
  case A:
46
46
  return "SuspenseList";
47
47
  case I:
48
48
  return "Activity";
49
49
  }
50
- if (typeof x == "object")
51
- switch (typeof x.tag == "number" && console.error(
50
+ if (typeof v == "object")
51
+ switch (typeof v.tag == "number" && console.error(
52
52
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
53
- ), x.$$typeof) {
53
+ ), v.$$typeof) {
54
54
  case p:
55
55
  return "Portal";
56
56
  case _:
57
- return x.displayName || "Context";
57
+ return v.displayName || "Context";
58
58
  case S:
59
- return (x._context.displayName || "Context") + ".Consumer";
59
+ return (v._context.displayName || "Context") + ".Consumer";
60
60
  case C:
61
- var K = x.render;
62
- return x = x.displayName, x || (x = K.displayName || K.name || "", x = x !== "" ? "ForwardRef(" + x + ")" : "ForwardRef"), x;
61
+ var K = v.render;
62
+ return v = v.displayName, v || (v = K.displayName || K.name || "", v = v !== "" ? "ForwardRef(" + v + ")" : "ForwardRef"), v;
63
63
  case y:
64
- return K = x.displayName || null, K !== null ? K : f(x.type) || "Memo";
64
+ return K = v.displayName || null, K !== null ? K : f(v.type) || "Memo";
65
65
  case B:
66
- K = x._payload, x = x._init;
66
+ K = v._payload, v = v._init;
67
67
  try {
68
- return f(x(K));
68
+ return f(v(K));
69
69
  } catch {
70
70
  }
71
71
  }
72
72
  return null;
73
73
  }
74
- function t(x) {
75
- return "" + x;
74
+ function t(v) {
75
+ return "" + v;
76
76
  }
77
- function e(x) {
77
+ function e(v) {
78
78
  try {
79
- t(x);
79
+ t(v);
80
80
  var K = !1;
81
81
  } catch {
82
82
  K = !0;
83
83
  }
84
84
  if (K) {
85
85
  K = console;
86
- var at = K.error, ct = typeof Symbol == "function" && Symbol.toStringTag && x[Symbol.toStringTag] || x.constructor.name || "Object";
86
+ var at = K.error, ct = typeof Symbol == "function" && Symbol.toStringTag && v[Symbol.toStringTag] || v.constructor.name || "Object";
87
87
  return at.call(
88
88
  K,
89
89
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
90
90
  ct
91
- ), t(x);
91
+ ), t(v);
92
92
  }
93
93
  }
94
- function i(x) {
95
- if (x === M) return "<>";
96
- if (typeof x == "object" && x !== null && x.$$typeof === B)
94
+ function i(v) {
95
+ if (v === M) return "<>";
96
+ if (typeof v == "object" && v !== null && v.$$typeof === B)
97
97
  return "<...>";
98
98
  try {
99
- var K = f(x);
99
+ var K = f(v);
100
100
  return K ? "<" + K + ">" : "<...>";
101
101
  } catch {
102
102
  return "<...>";
103
103
  }
104
104
  }
105
105
  function r() {
106
- var x = L.A;
107
- return x === null ? null : x.getOwner();
106
+ var v = L.A;
107
+ return v === null ? null : v.getOwner();
108
108
  }
109
109
  function a() {
110
110
  return Error("react-stack-top-frame");
111
111
  }
112
- function s(x) {
113
- if (J.call(x, "key")) {
114
- var K = Object.getOwnPropertyDescriptor(x, "key").get;
112
+ function s(v) {
113
+ if (J.call(v, "key")) {
114
+ var K = Object.getOwnPropertyDescriptor(v, "key").get;
115
115
  if (K && K.isReactWarning) return !1;
116
116
  }
117
- return x.key !== void 0;
117
+ return v.key !== void 0;
118
118
  }
119
- function n(x, K) {
119
+ function n(v, K) {
120
120
  function at() {
121
121
  Z || (Z = !0, console.error(
122
122
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
123
123
  K
124
124
  ));
125
125
  }
126
- at.isReactWarning = !0, Object.defineProperty(x, "key", {
126
+ at.isReactWarning = !0, Object.defineProperty(v, "key", {
127
127
  get: at,
128
128
  configurable: !0
129
129
  });
130
130
  }
131
131
  function o() {
132
- var x = f(this.type);
133
- return O[x] || (O[x] = !0, console.error(
132
+ var v = f(this.type);
133
+ return O[v] || (O[v] = !0, console.error(
134
134
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
135
- )), x = this.props.ref, x !== void 0 ? x : null;
135
+ )), v = this.props.ref, v !== void 0 ? v : null;
136
136
  }
137
- function l(x, K, at, ct, tt, R) {
137
+ function l(v, K, at, ct, tt, R) {
138
138
  var V = at.ref;
139
- return x = {
139
+ return v = {
140
140
  $$typeof: u,
141
- type: x,
141
+ type: v,
142
142
  key: K,
143
143
  props: at,
144
144
  _owner: ct
145
- }, (V !== void 0 ? V : null) !== null ? Object.defineProperty(x, "ref", {
145
+ }, (V !== void 0 ? V : null) !== null ? Object.defineProperty(v, "ref", {
146
146
  enumerable: !1,
147
147
  get: o
148
- }) : Object.defineProperty(x, "ref", { enumerable: !1, value: null }), x._store = {}, Object.defineProperty(x._store, "validated", {
148
+ }) : Object.defineProperty(v, "ref", { enumerable: !1, value: null }), v._store = {}, Object.defineProperty(v._store, "validated", {
149
149
  configurable: !1,
150
150
  enumerable: !1,
151
151
  writable: !0,
152
152
  value: 0
153
- }), Object.defineProperty(x, "_debugInfo", {
153
+ }), Object.defineProperty(v, "_debugInfo", {
154
154
  configurable: !1,
155
155
  enumerable: !1,
156
156
  writable: !0,
157
157
  value: null
158
- }), Object.defineProperty(x, "_debugStack", {
158
+ }), Object.defineProperty(v, "_debugStack", {
159
159
  configurable: !1,
160
160
  enumerable: !1,
161
161
  writable: !0,
162
162
  value: tt
163
- }), Object.defineProperty(x, "_debugTask", {
163
+ }), Object.defineProperty(v, "_debugTask", {
164
164
  configurable: !1,
165
165
  enumerable: !1,
166
166
  writable: !0,
167
167
  value: R
168
- }), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
168
+ }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
169
169
  }
170
- function h(x, K, at, ct, tt, R) {
170
+ function h(v, K, at, ct, tt, R) {
171
171
  var V = K.children;
172
172
  if (V !== void 0)
173
173
  if (ct)
@@ -181,7 +181,7 @@ function lr() {
181
181
  );
182
182
  else d(V);
183
183
  if (J.call(K, "key")) {
184
- V = f(x);
184
+ V = f(v);
185
185
  var it = Object.keys(K).filter(function(ft) {
186
186
  return ft !== "key";
187
187
  });
@@ -205,9 +205,9 @@ React keys must be passed directly to JSX without using spread:
205
205
  } else at = K;
206
206
  return V && n(
207
207
  at,
208
- typeof x == "function" ? x.displayName || x.name || "Unknown" : x
208
+ typeof v == "function" ? v.displayName || v.name || "Unknown" : v
209
209
  ), l(
210
- x,
210
+ v,
211
211
  V,
212
212
  at,
213
213
  r(),
@@ -215,43 +215,43 @@ React keys must be passed directly to JSX without using spread:
215
215
  R
216
216
  );
217
217
  }
218
- function d(x) {
219
- g(x) ? x._store && (x._store.validated = 1) : typeof x == "object" && x !== null && x.$$typeof === B && (x._payload.status === "fulfilled" ? g(x._payload.value) && x._payload.value._store && (x._payload.value._store.validated = 1) : x._store && (x._store.validated = 1));
218
+ function d(v) {
219
+ g(v) ? v._store && (v._store.validated = 1) : typeof v == "object" && v !== null && v.$$typeof === B && (v._payload.status === "fulfilled" ? g(v._payload.value) && v._payload.value._store && (v._payload.value._store.validated = 1) : v._store && (v._store.validated = 1));
220
220
  }
221
- function g(x) {
222
- return typeof x == "object" && x !== null && x.$$typeof === u;
221
+ function g(v) {
222
+ return typeof v == "object" && v !== null && v.$$typeof === u;
223
223
  }
224
- var c = rt, u = /* @__PURE__ */ Symbol.for("react.transitional.element"), p = /* @__PURE__ */ Symbol.for("react.portal"), M = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), P = /* @__PURE__ */ Symbol.for("react.profiler"), S = /* @__PURE__ */ Symbol.for("react.consumer"), _ = /* @__PURE__ */ Symbol.for("react.context"), C = /* @__PURE__ */ Symbol.for("react.forward_ref"), v = /* @__PURE__ */ Symbol.for("react.suspense"), A = /* @__PURE__ */ Symbol.for("react.suspense_list"), y = /* @__PURE__ */ Symbol.for("react.memo"), B = /* @__PURE__ */ Symbol.for("react.lazy"), I = /* @__PURE__ */ Symbol.for("react.activity"), N = /* @__PURE__ */ Symbol.for("react.client.reference"), L = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, ot = Array.isArray, $ = console.createTask ? console.createTask : function() {
224
+ var c = rt, u = /* @__PURE__ */ Symbol.for("react.transitional.element"), p = /* @__PURE__ */ Symbol.for("react.portal"), M = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), P = /* @__PURE__ */ Symbol.for("react.profiler"), S = /* @__PURE__ */ Symbol.for("react.consumer"), _ = /* @__PURE__ */ Symbol.for("react.context"), C = /* @__PURE__ */ Symbol.for("react.forward_ref"), x = /* @__PURE__ */ Symbol.for("react.suspense"), A = /* @__PURE__ */ Symbol.for("react.suspense_list"), y = /* @__PURE__ */ Symbol.for("react.memo"), B = /* @__PURE__ */ Symbol.for("react.lazy"), I = /* @__PURE__ */ Symbol.for("react.activity"), N = /* @__PURE__ */ Symbol.for("react.client.reference"), L = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, ot = Array.isArray, $ = console.createTask ? console.createTask : function() {
225
225
  return null;
226
226
  };
227
227
  c = {
228
- react_stack_bottom_frame: function(x) {
229
- return x();
228
+ react_stack_bottom_frame: function(v) {
229
+ return v();
230
230
  }
231
231
  };
232
232
  var Z, O = {}, et = c.react_stack_bottom_frame.bind(
233
233
  c,
234
234
  a
235
235
  )(), ht = $(i(a)), pt = {};
236
- zt.Fragment = M, zt.jsx = function(x, K, at) {
236
+ zt.Fragment = M, zt.jsx = function(v, K, at) {
237
237
  var ct = 1e4 > L.recentlyCreatedOwnerStacks++;
238
238
  return h(
239
- x,
239
+ v,
240
240
  K,
241
241
  at,
242
242
  !1,
243
243
  ct ? Error("react-stack-top-frame") : et,
244
- ct ? $(i(x)) : ht
244
+ ct ? $(i(v)) : ht
245
245
  );
246
- }, zt.jsxs = function(x, K, at) {
246
+ }, zt.jsxs = function(v, K, at) {
247
247
  var ct = 1e4 > L.recentlyCreatedOwnerStacks++;
248
248
  return h(
249
- x,
249
+ v,
250
250
  K,
251
251
  at,
252
252
  !0,
253
253
  ct ? Error("react-stack-top-frame") : et,
254
- ct ? $(i(x)) : ht
254
+ ct ? $(i(v)) : ht
255
255
  );
256
256
  };
257
257
  })()), zt;
@@ -2643,9 +2643,9 @@ const Hr = ({
2643
2643
  onCancel: l,
2644
2644
  i18n: h
2645
2645
  }) => {
2646
- const [d, g] = st(i), [c, u] = st(r), [p, M] = st(a), [k, P] = st(s), [S, _] = st(n), [C, v] = st(t), [A, y] = st(!1), [B, I] = st({ x: 0, y: 0 }), N = Mt(null), L = Mt(null);
2646
+ const [d, g] = st(i), [c, u] = st(r), [p, M] = st(a), [k, P] = st(s), [S, _] = st(n), [C, x] = st(t), [A, y] = st(!1), [B, I] = st({ x: 0, y: 0 }), N = Mt(null), L = Mt(null);
2647
2647
  gt(() => {
2648
- g(i), u(r), M(a), P(s), _(n), v(t);
2648
+ g(i), u(r), M(a), P(s), _(n), x(t);
2649
2649
  }, [i, r, a, s, n, t]);
2650
2650
  const J = (O) => {
2651
2651
  if (O.target === L.current || L.current?.contains(O.target)) {
@@ -2660,10 +2660,10 @@ const Hr = ({
2660
2660
  gt(() => {
2661
2661
  const O = (ht) => {
2662
2662
  if (A) {
2663
- const pt = ht.clientX - B.x, x = ht.clientY - B.y, K = window.innerWidth - 320, at = window.innerHeight - 300;
2664
- v({
2663
+ const pt = ht.clientX - B.x, v = ht.clientY - B.y, K = window.innerWidth - 320, at = window.innerHeight - 300;
2664
+ x({
2665
2665
  x: Math.max(10, Math.min(pt, K)),
2666
- y: Math.max(10, Math.min(x, at))
2666
+ y: Math.max(10, Math.min(v, at))
2667
2667
  });
2668
2668
  }
2669
2669
  }, et = () => {
@@ -2984,7 +2984,7 @@ const Hr = ({
2984
2984
  }, [l, d]);
2985
2985
  const C = (tt) => {
2986
2986
  tt.target === tt.currentTarget && t();
2987
- }, v = (tt) => {
2987
+ }, x = (tt) => {
2988
2988
  tt.key === "Enter" && tt.ctrlKey ? P() : tt.key === "Escape" && t();
2989
2989
  }, A = {
2990
2990
  position: "absolute",
@@ -3067,7 +3067,7 @@ const Hr = ({
3067
3067
  fontSize: "12px",
3068
3068
  cursor: "pointer",
3069
3069
  minWidth: "60px"
3070
- }, x = {
3070
+ }, v = {
3071
3071
  background: i.toolbar.button.active,
3072
3072
  color: i.toolbar.button.activeTextColor,
3073
3073
  border: "none",
@@ -3114,7 +3114,7 @@ const Hr = ({
3114
3114
  style: A,
3115
3115
  onClick: (tt) => tt.stopPropagation(),
3116
3116
  onMouseDown: _,
3117
- onKeyDown: v,
3117
+ onKeyDown: x,
3118
3118
  children: [
3119
3119
  /* @__PURE__ */ m.jsx(
3120
3120
  "div",
@@ -3182,7 +3182,7 @@ const Hr = ({
3182
3182
  {
3183
3183
  onClick: P,
3184
3184
  disabled: !a,
3185
- style: a ? x : K,
3185
+ style: a ? v : K,
3186
3186
  type: "button",
3187
3187
  children: r.systemSettings?.confirm || "确定"
3188
3188
  }
@@ -3441,8 +3441,8 @@ class Or {
3441
3441
  let M;
3442
3442
  this.state.currentPoints.length === 0 ? M = [{ time: p, price: c }] : M = [
3443
3443
  ...this.state.currentPoints.map((P) => {
3444
- const S = P.x - (o.left - n.left), _ = P.y - (o.top - n.top), C = d.coordinateToTime(S), v = i.series.coordinateToPrice(_);
3445
- return { time: C || 0, price: v || 0 };
3444
+ const S = P.x - (o.left - n.left), _ = P.y - (o.top - n.top), C = d.coordinateToTime(S), x = i.series.coordinateToPrice(_);
3445
+ return { time: C || 0, price: x || 0 };
3446
3446
  }),
3447
3447
  { time: p, price: c }
3448
3448
  ];
@@ -3725,8 +3725,8 @@ class Le {
3725
3725
  e.beginPath(), e.moveTo(_.x, _.y), e.lineTo(_.x + k, _.y + P), e.stroke();
3726
3726
  }), e.strokeStyle = this._handleColor, e.setLineDash([]), e.beginPath(), e.moveTo(a, s), e.lineTo(n, o), e.stroke(), !this._isPreview)
3727
3727
  for (let _ = 0; _ < S.length - 1; _++) {
3728
- const C = S[_], v = S[_ + 1];
3729
- e.fillStyle = this.hexToRgba(this._lineColor, this._backgroundOpacity * 0.3), e.beginPath(), e.moveTo(C.x, C.y), e.lineTo(C.x + k, C.y + P), e.lineTo(v.x + k, v.y + P), e.lineTo(v.x, v.y), e.closePath(), e.fill();
3728
+ const C = S[_], x = S[_ + 1];
3729
+ e.fillStyle = this.hexToRgba(this._lineColor, this._backgroundOpacity * 0.3), e.beginPath(), e.moveTo(C.x, C.y), e.lineTo(C.x + k, C.y + P), e.lineTo(x.x + k, x.y + P), e.lineTo(x.x, x.y), e.closePath(), e.fill();
3730
3730
  }
3731
3731
  }
3732
3732
  const g = (this._showHandles || this._isDragging || this._hoverPoint) && !this._isPreview, c = this._isPreview;
@@ -4085,8 +4085,8 @@ class jr {
4085
4085
  { start: p, startY: M, endX: p + k, endY: M + P },
4086
4086
  { start: l, startY: h, endX: l + k, endY: h + P }
4087
4087
  ];
4088
- for (const v of S)
4089
- if (this.pointToLineDistance(t, e, v.start, v.startY, v.endX, v.endY) <= r) return !0;
4088
+ for (const x of S)
4089
+ if (this.pointToLineDistance(t, e, x.start, x.startY, x.endX, x.endY) <= r) return !0;
4090
4090
  return this.pointToLineDistance(t, e, p, M, a, s) <= r || this.pointToLineDistance(t, e, n, o, l, h) <= r;
4091
4091
  }
4092
4092
  pointToLineDistance(t, e, i, r, a, s) {
@@ -5406,7 +5406,7 @@ class Xr {
5406
5406
  else if (this.state.dragPoint === "mid") {
5407
5407
  const u = d.timeToCoordinate(this.state.dragTarget.getStartTime()), p = i.series.priceToCoordinate(this.state.dragTarget.getStartPrice()), M = d.timeToCoordinate(this.state.dragTarget.getEndTime()), k = i.series.priceToCoordinate(this.state.dragTarget.getEndPrice());
5408
5408
  if (u === null || p === null || M === null || k === null) return;
5409
- const P = (u + M) / 2, S = (p + k) / 2, _ = this.state.dragTarget.getMidPixelOffsetX() + P, C = this.state.dragTarget.getMidPixelOffsetY() + S, v = this.quadraticBezierPoint(u, _, M, 0.5), A = this.quadraticBezierPoint(p, C, k, 0.5), y = l - v, B = h - A, I = this.state.dragTarget.getMidPixelOffsetX(), N = this.state.dragTarget.getMidPixelOffsetY();
5409
+ const P = (u + M) / 2, S = (p + k) / 2, _ = this.state.dragTarget.getMidPixelOffsetX() + P, C = this.state.dragTarget.getMidPixelOffsetY() + S, x = this.quadraticBezierPoint(u, _, M, 0.5), A = this.quadraticBezierPoint(p, C, k, 0.5), y = l - x, B = h - A, I = this.state.dragTarget.getMidPixelOffsetX(), N = this.state.dragTarget.getMidPixelOffsetY();
5410
5410
  this.state.dragTarget.updateMidPoint(I + y, N + B), this.dragStartData = { time: g, price: c };
5411
5411
  }
5412
5412
  return;
@@ -5504,8 +5504,8 @@ class Xr {
5504
5504
  P !== 0 && (S = k / P);
5505
5505
  let _, C;
5506
5506
  S < 0 ? (_ = a, C = s) : S > 1 ? (_ = n, C = o) : (_ = a + S * p, C = s + S * M);
5507
- const v = t - _, A = e - C;
5508
- return Math.sqrt(v * v + A * A) <= r;
5507
+ const x = t - _, A = e - C;
5508
+ return Math.sqrt(x * x + A * A) <= r;
5509
5509
  }
5510
5510
  quadraticBezierPoint(t, e, i, r) {
5511
5511
  return (1 - r) * (1 - r) * t + 2 * (1 - r) * r * e + r * r * i;
@@ -5606,7 +5606,7 @@ class je {
5606
5606
  const h = Math.abs(this._series.priceToCoordinate(this._startPrice - this._channelHeight) - this._series.priceToCoordinate(this._startPrice)), d = s - r, g = n - a, c = Math.sqrt(d * d + g * g), u = this._angle * Math.PI / 180, p = Math.tan(u) * c * 0.5, M = (r + s) / 2, k = (a + n) / 2, P = M, S = k - h;
5607
5607
  if (Math.sqrt(Math.pow(t - P, 2) + Math.pow(e - S, 2)) <= i)
5608
5608
  return "channel";
5609
- const C = n - h - p, v = n + h + p, A = s, y = (C + v) / 2;
5609
+ const C = n - h - p, x = n + h + p, A = s, y = (C + x) / 2;
5610
5610
  return Math.sqrt(Math.pow(t - A, 2) + Math.pow(e - y, 2)) <= i ? "angle" : null;
5611
5611
  }
5612
5612
  updateAngleByPixels(t) {
@@ -5668,7 +5668,7 @@ class je {
5668
5668
  e.fillRect(L - O / 2 - 5, J - 25, O + 10, 18), e.fillStyle = "#333333", e.fillText(Z, L, J - 10), e.restore();
5669
5669
  };
5670
5670
  C(i, r, "start", this._dragPoint === "start" || this._hoverPoint === "start"), C(a, s, "end", this._dragPoint === "end" || this._hoverPoint === "end");
5671
- const v = (i + a) / 2, A = (r + s) / 2, y = v, B = A - h;
5671
+ const x = (i + a) / 2, A = (r + s) / 2, y = x, B = A - h;
5672
5672
  C(y, B, "channel", this._dragPoint === "channel" || this._hoverPoint === "channel");
5673
5673
  const I = a, N = (M + _) / 2;
5674
5674
  C(I, N, "angle", this._dragPoint === "angle" || this._hoverPoint === "angle");
@@ -6013,11 +6013,11 @@ class Yr {
6013
6013
  if (p === 0) return !1;
6014
6014
  const M = -u / p, k = c / p;
6015
6015
  for (let P = -1; P <= 1; P += 2) {
6016
- const S = M * 30 * P, _ = k * 30 * P, C = a + S, v = s + _, A = n + S, y = o + _, B = t - C, I = e - v, N = A - C, L = y - v, J = B * N + I * L, ot = N * N + L * L;
6016
+ const S = M * 30 * P, _ = k * 30 * P, C = a + S, x = s + _, A = n + S, y = o + _, B = t - C, I = e - x, N = A - C, L = y - x, J = B * N + I * L, ot = N * N + L * L;
6017
6017
  let $ = -1;
6018
6018
  ot !== 0 && ($ = J / ot);
6019
6019
  let Z, O;
6020
- $ < 0 ? (Z = C, O = v) : $ > 1 ? (Z = A, O = y) : (Z = C + $ * N, O = v + $ * L);
6020
+ $ < 0 ? (Z = C, O = x) : $ > 1 ? (Z = A, O = y) : (Z = C + $ * N, O = x + $ * L);
6021
6021
  const et = t - Z, ht = e - O;
6022
6022
  if (Math.sqrt(et * et + ht * ht) <= r)
6023
6023
  return !0;
@@ -6114,8 +6114,8 @@ class We {
6114
6114
  if (r == null || a == null || s == null || n == null) return !1;
6115
6115
  const o = r + (s - r) * 1 / 3, l = a + (n - a) * 1 / 3, h = r + (s - r) * 2 / 3, d = a + (n - a) * 2 / 3, g = o + this._mid1PixelOffsetX, c = l + this._mid1PixelOffsetY, u = h + this._mid2PixelOffsetX, p = d + this._mid2PixelOffsetY, M = 50;
6116
6116
  for (let k = 0; k < M; k++) {
6117
- const P = k / M, S = (k + 1) / M, _ = this.cubicBezierPoint(r, g, u, s, P), C = this.cubicBezierPoint(a, c, p, n, P), v = this.cubicBezierPoint(r, g, u, s, S), A = this.cubicBezierPoint(a, c, p, n, S);
6118
- if (this.isPointNearLineSegment(t, e, _, C, v, A, i))
6117
+ const P = k / M, S = (k + 1) / M, _ = this.cubicBezierPoint(r, g, u, s, P), C = this.cubicBezierPoint(a, c, p, n, P), x = this.cubicBezierPoint(r, g, u, s, S), A = this.cubicBezierPoint(a, c, p, n, S);
6118
+ if (this.isPointNearLineSegment(t, e, _, C, x, A, i))
6119
6119
  return !0;
6120
6120
  }
6121
6121
  return !1;
@@ -6189,8 +6189,8 @@ class We {
6189
6189
  break;
6190
6190
  }
6191
6191
  if (e.beginPath(), e.moveTo(i, r), e.bezierCurveTo(d, g, c, u, a, s), e.stroke(), (this._showHandles || this._isDragging) && !this._isPreview) {
6192
- const p = (_, C, v = !1) => {
6193
- e.save(), e.fillStyle = this._color, e.beginPath(), e.arc(_, C, 5, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(_, C, 3, 0, Math.PI * 2), e.fill(), v && (e.strokeStyle = this._color, e.lineWidth = 1, e.setLineDash([]), e.beginPath(), e.arc(_, C, 8, 0, Math.PI * 2), e.stroke()), e.restore();
6192
+ const p = (_, C, x = !1) => {
6193
+ e.save(), e.fillStyle = this._color, e.beginPath(), e.arc(_, C, 5, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(_, C, 3, 0, Math.PI * 2), e.fill(), x && (e.strokeStyle = this._color, e.lineWidth = 1, e.setLineDash([]), e.beginPath(), e.arc(_, C, 8, 0, Math.PI * 2), e.stroke()), e.restore();
6194
6194
  };
6195
6195
  p(i, r, this._dragPoint === "start"), p(a, s, this._dragPoint === "end");
6196
6196
  const M = this.cubicBezierPoint(i, d, c, a, 1 / 3), k = this.cubicBezierPoint(r, g, u, s, 1 / 3), P = this.cubicBezierPoint(i, d, c, a, 2 / 3), S = this.cubicBezierPoint(r, g, u, s, 2 / 3);
@@ -6374,10 +6374,10 @@ class Vr {
6374
6374
  else if (this.state.dragPoint === "mid1" || this.state.dragPoint === "mid2") {
6375
6375
  const u = d.timeToCoordinate(this.state.dragTarget.getStartTime()), p = i.series.priceToCoordinate(this.state.dragTarget.getStartPrice()), M = d.timeToCoordinate(this.state.dragTarget.getEndTime()), k = i.series.priceToCoordinate(this.state.dragTarget.getEndPrice());
6376
6376
  if (u === null || p === null || M === null || k === null) return;
6377
- const P = u + (M - u) * 1 / 3, S = p + (k - p) * 1 / 3, _ = u + (M - u) * 2 / 3, C = p + (k - p) * 2 / 3, v = this.state.dragTarget.getMid1PixelOffsetX(), A = this.state.dragTarget.getMid1PixelOffsetY(), y = this.state.dragTarget.getMid2PixelOffsetX(), B = this.state.dragTarget.getMid2PixelOffsetY(), I = P + v, N = S + A, L = _ + y, J = C + B;
6377
+ const P = u + (M - u) * 1 / 3, S = p + (k - p) * 1 / 3, _ = u + (M - u) * 2 / 3, C = p + (k - p) * 2 / 3, x = this.state.dragTarget.getMid1PixelOffsetX(), A = this.state.dragTarget.getMid1PixelOffsetY(), y = this.state.dragTarget.getMid2PixelOffsetX(), B = this.state.dragTarget.getMid2PixelOffsetY(), I = P + x, N = S + A, L = _ + y, J = C + B;
6378
6378
  let ot, $;
6379
6379
  this.state.dragPoint === "mid1" ? (ot = this.cubicBezierPoint(u, I, L, M, 1 / 3), $ = this.cubicBezierPoint(p, N, J, k, 1 / 3)) : (ot = this.cubicBezierPoint(u, I, L, M, 2 / 3), $ = this.cubicBezierPoint(p, N, J, k, 2 / 3));
6380
- const Z = l - ot, O = h - $, et = this.state.dragPoint === "mid1" ? v : y, ht = this.state.dragPoint === "mid1" ? A : B;
6380
+ const Z = l - ot, O = h - $, et = this.state.dragPoint === "mid1" ? x : y, ht = this.state.dragPoint === "mid1" ? A : B;
6381
6381
  this.state.dragPoint === "mid1" ? this.state.dragTarget.updateMid1Point(et + Z, ht + O) : this.state.dragTarget.updateMid2Point(et + Z, ht + O), this.dragStartData = { time: g, price: c };
6382
6382
  }
6383
6383
  return;
@@ -6479,8 +6479,8 @@ class Vr {
6479
6479
  P !== 0 && (S = k / P);
6480
6480
  let _, C;
6481
6481
  S < 0 ? (_ = a, C = s) : S > 1 ? (_ = n, C = o) : (_ = a + S * p, C = s + S * M);
6482
- const v = t - _, A = e - C;
6483
- return Math.sqrt(v * v + A * A) <= r;
6482
+ const x = t - _, A = e - C;
6483
+ return Math.sqrt(x * x + A * A) <= r;
6484
6484
  }
6485
6485
  cubicBezierPoint(t, e, i, r, a) {
6486
6486
  const s = 1 - a;
@@ -9087,12 +9087,12 @@ class Jr {
9087
9087
  if (M !== null && k !== null) {
9088
9088
  const P = Math.abs(l - M), S = Math.abs(h - k);
9089
9089
  if (P > 5 && S > 5) {
9090
- const _ = l - M, C = h - k, v = Math.atan2(C, _), A = new Ne(
9090
+ const _ = l - M, C = h - k, x = Math.atan2(C, _), A = new Ne(
9091
9091
  u,
9092
9092
  p,
9093
9093
  0,
9094
9094
  0,
9095
- v,
9095
+ x,
9096
9096
  "#2962FF",
9097
9097
  2,
9098
9098
  !1
@@ -9423,8 +9423,8 @@ class Xe {
9423
9423
  const l = (a + n) / 2, h = (s + o) / 2, d = a === n && s === o;
9424
9424
  if (e.strokeStyle = "#FF6B35", e.setLineDash([]), e.beginPath(), e.moveTo(l, h), e.lineTo(i, r), e.stroke(), !d) {
9425
9425
  const u = i - l, p = r - h, M = 3, k = -u * M, P = -p * M, S = [];
9426
- for (let v = 0; v < this._numberOfForks; v++) {
9427
- const A = v / (this._numberOfForks - 1), y = a + (n - a) * A, B = s + (o - s) * A;
9426
+ for (let x = 0; x < this._numberOfForks; x++) {
9427
+ const A = x / (this._numberOfForks - 1), y = a + (n - a) * A, B = s + (o - s) * A;
9428
9428
  S.push({ x: y, y: B });
9429
9429
  }
9430
9430
  const _ = [
@@ -9434,22 +9434,22 @@ class Xe {
9434
9434
  "#2196F3",
9435
9435
  "#9C27B0"
9436
9436
  ];
9437
- e.setLineDash(this._isPreview ? [5, 3] : []), S.forEach((v, A) => {
9438
- e.strokeStyle = _[A], e.lineWidth = A === 2 ? this._lineWidth + 1 : this._lineWidth, e.beginPath(), e.moveTo(v.x, v.y), e.lineTo(v.x + k, v.y + P), e.stroke();
9437
+ e.setLineDash(this._isPreview ? [5, 3] : []), S.forEach((x, A) => {
9438
+ e.strokeStyle = _[A], e.lineWidth = A === 2 ? this._lineWidth + 1 : this._lineWidth, e.beginPath(), e.moveTo(x.x, x.y), e.lineTo(x.x + k, x.y + P), e.stroke();
9439
9439
  }), e.lineWidth = this._lineWidth;
9440
9440
  const C = e.createLinearGradient(a, s, n, o);
9441
9441
  if (C.addColorStop(0, "#FF4444"), C.addColorStop(0.5, "#4CAF50"), C.addColorStop(1, "#9C27B0"), e.strokeStyle = C, e.setLineDash([]), e.beginPath(), e.moveTo(a, s), e.lineTo(n, o), e.stroke(), !this._isPreview)
9442
- for (let v = 0; v < S.length - 1; v++) {
9443
- const A = S[v], y = S[v + 1], B = e.createLinearGradient(
9442
+ for (let x = 0; x < S.length - 1; x++) {
9443
+ const A = S[x], y = S[x + 1], B = e.createLinearGradient(
9444
9444
  A.x,
9445
9445
  A.y,
9446
9446
  y.x + k,
9447
9447
  y.y + P
9448
9448
  );
9449
- v === 0 ? (B.addColorStop(0, "rgba(255, 68, 68, 0.2)"), B.addColorStop(1, "rgba(255, 170, 0, 0.3)")) : v === 1 ? (B.addColorStop(0, "rgba(255, 170, 0, 0.3)"), B.addColorStop(1, "rgba(76, 175, 80, 0.4)")) : v === 2 ? (B.addColorStop(0, "rgba(76, 175, 80, 0.4)"), B.addColorStop(1, "rgba(33, 150, 243, 0.3)")) : v === 3 && (B.addColorStop(0, "rgba(33, 150, 243, 0.3)"), B.addColorStop(1, "rgba(156, 39, 176, 0.2)")), e.fillStyle = B, e.beginPath(), e.moveTo(A.x, A.y), e.lineTo(A.x + k, A.y + P), e.lineTo(y.x + k, y.y + P), e.lineTo(y.x, y.y), e.closePath(), e.fill(), e.strokeStyle = _[v], e.lineWidth = 0.5, e.setLineDash([2, 2]), e.stroke(), e.setLineDash([]);
9449
+ x === 0 ? (B.addColorStop(0, "rgba(255, 68, 68, 0.2)"), B.addColorStop(1, "rgba(255, 170, 0, 0.3)")) : x === 1 ? (B.addColorStop(0, "rgba(255, 170, 0, 0.3)"), B.addColorStop(1, "rgba(76, 175, 80, 0.4)")) : x === 2 ? (B.addColorStop(0, "rgba(76, 175, 80, 0.4)"), B.addColorStop(1, "rgba(33, 150, 243, 0.3)")) : x === 3 && (B.addColorStop(0, "rgba(33, 150, 243, 0.3)"), B.addColorStop(1, "rgba(156, 39, 176, 0.2)")), e.fillStyle = B, e.beginPath(), e.moveTo(A.x, A.y), e.lineTo(A.x + k, A.y + P), e.lineTo(y.x + k, y.y + P), e.lineTo(y.x, y.y), e.closePath(), e.fill(), e.strokeStyle = _[x], e.lineWidth = 0.5, e.setLineDash([2, 2]), e.stroke(), e.setLineDash([]);
9450
9450
  }
9451
- this._isPreview || S.forEach((v, A) => {
9452
- const y = v.x + k, B = v.y + P;
9451
+ this._isPreview || S.forEach((x, A) => {
9452
+ const y = x.x + k, B = x.y + P;
9453
9453
  e.fillStyle = _[A], e.beginPath(), e.arc(y, B, 3, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(y, B, 1, 0, Math.PI * 2), e.fill();
9454
9454
  });
9455
9455
  }
@@ -9518,8 +9518,8 @@ class Xe {
9518
9518
  if (t == null || e == null || i == null || r == null || a == null || s == null) return null;
9519
9519
  const n = (i + a) / 2, o = (r + s) / 2, l = t - n, h = e - o, d = 3, g = -l * d, c = -h * d, u = [];
9520
9520
  for (let S = 0; S < this._numberOfForks; S++) {
9521
- const _ = S / (this._numberOfForks - 1), C = i + (a - i) * _, v = r + (s - r) * _;
9522
- u.push({ x: C, y: v });
9521
+ const _ = S / (this._numberOfForks - 1), C = i + (a - i) * _, x = r + (s - r) * _;
9522
+ u.push({ x: C, y: x });
9523
9523
  }
9524
9524
  const p = u.map((S) => ({
9525
9525
  x: S.x + g,
@@ -9971,10 +9971,10 @@ class Ye {
9971
9971
  e.beginPath(), e.moveTo(i + M, r + k), e.lineTo(a + M, s + k), e.stroke();
9972
9972
  }
9973
9973
  if ((this._showHandles || this._isDragging || this._hoverPoint) && !this._isPreview) {
9974
- const p = (_, C, v, A = !1) => {
9974
+ const p = (_, C, x, A = !1) => {
9975
9975
  e.save(), e.fillStyle = this._color, e.beginPath(), e.arc(_, C, 6, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(_, C, 4, 0, Math.PI * 2), e.fill(), A && (e.strokeStyle = this._color, e.lineWidth = 2, e.setLineDash([]), e.beginPath(), e.arc(_, C, 8, 0, Math.PI * 2), e.stroke()), e.fillStyle = this._color, e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "bottom";
9976
9976
  let y = "";
9977
- v === "start" ? y = `${this._startPrice.toFixed(2)}` : v === "end" ? y = `${this._endPrice.toFixed(2)}` : v === "channel" && (y = `${(this._channelHeight / this._startPrice * 100).toFixed(2)}%`), e.fillStyle = "rgba(255, 255, 255, 0.9)";
9977
+ x === "start" ? y = `${this._startPrice.toFixed(2)}` : x === "end" ? y = `${this._endPrice.toFixed(2)}` : x === "channel" && (y = `${(this._channelHeight / this._startPrice * 100).toFixed(2)}%`), e.fillStyle = "rgba(255, 255, 255, 0.9)";
9978
9978
  const B = e.measureText(y).width;
9979
9979
  e.fillRect(_ - B / 2 - 5, C - 25, B + 10, 18), e.fillStyle = "#333333", e.fillText(y, _, C - 10), e.restore();
9980
9980
  };
@@ -10313,11 +10313,11 @@ class ts {
10313
10313
  if (p === 0) return !1;
10314
10314
  const M = -u / p, k = c / p;
10315
10315
  for (let P = -1; P <= 1; P += 2) {
10316
- const S = M * 30 * P, _ = k * 30 * P, C = a + S, v = s + _, A = n + S, y = o + _, B = t - C, I = e - v, N = A - C, L = y - v, J = B * N + I * L, ot = N * N + L * L;
10316
+ const S = M * 30 * P, _ = k * 30 * P, C = a + S, x = s + _, A = n + S, y = o + _, B = t - C, I = e - x, N = A - C, L = y - x, J = B * N + I * L, ot = N * N + L * L;
10317
10317
  let $ = -1;
10318
10318
  ot !== 0 && ($ = J / ot);
10319
10319
  let Z, O;
10320
- $ < 0 ? (Z = C, O = v) : $ > 1 ? (Z = A, O = y) : (Z = C + $ * N, O = v + $ * L);
10320
+ $ < 0 ? (Z = C, O = x) : $ > 1 ? (Z = A, O = y) : (Z = C + $ * N, O = x + $ * L);
10321
10321
  const et = t - Z, ht = e - O;
10322
10322
  if (Math.sqrt(et * et + ht * ht) <= r)
10323
10323
  return !0;
@@ -10424,8 +10424,8 @@ class Ve {
10424
10424
  } else if (i === "end") {
10425
10425
  const a = this._series.priceToCoordinate(this._startPrice), s = r.timeToCoordinate(this._startTime), n = this._series.priceToCoordinate(this._endPrice), o = r.timeToCoordinate(this._endTime);
10426
10426
  if (a === null || s === null || n === null || o === null) return;
10427
- const l = Math.sqrt(Math.pow(o - s, 2) + Math.pow(n - a, 2)), h = this._fibonacciLevels[5], d = l * h, g = Math.atan2(n - a, o - s), c = s + d * Math.cos(g), u = a + d * Math.sin(g), p = c + e, M = u + t, k = Math.atan2(M - a, p - s), S = Math.sqrt(Math.pow(p - s, 2) + Math.pow(M - a, 2)) / h, _ = s + S * Math.cos(k), C = a + S * Math.sin(k), v = this._series.coordinateToPrice(C), A = r.coordinateToTime(_);
10428
- v !== null && A !== null && (this._endPrice = v, this._endTime = A, this._updateArcDirection(), this.requestUpdate());
10427
+ const l = Math.sqrt(Math.pow(o - s, 2) + Math.pow(n - a, 2)), h = this._fibonacciLevels[5], d = l * h, g = Math.atan2(n - a, o - s), c = s + d * Math.cos(g), u = a + d * Math.sin(g), p = c + e, M = u + t, k = Math.atan2(M - a, p - s), S = Math.sqrt(Math.pow(p - s, 2) + Math.pow(M - a, 2)) / h, _ = s + S * Math.cos(k), C = a + S * Math.sin(k), x = this._series.coordinateToPrice(C), A = r.coordinateToTime(_);
10428
+ x !== null && A !== null && (this._endPrice = x, this._endTime = A, this._updateArcDirection(), this.requestUpdate());
10429
10429
  }
10430
10430
  }
10431
10431
  isPointNearHandle(t, e, i = 15) {
@@ -11057,10 +11057,10 @@ class qe {
11057
11057
  t.save(), t.fillStyle = this._color, t.beginPath(), t.arc(S, _, 6, 0, Math.PI * 2), t.fill(), t.fillStyle = "#FFFFFF", t.beginPath(), t.arc(S, _, 4, 0, Math.PI * 2), t.fill(), k && (t.strokeStyle = this._color, t.lineWidth = 2, t.setLineDash([]), t.beginPath(), t.arc(S, _, 8, 0, Math.PI * 2), t.stroke()), t.fillStyle = this._color, t.font = "12px Arial", t.textAlign = "center", t.textBaseline = "bottom";
11058
11058
  let C = "";
11059
11059
  M === "start" ? C = `${this._startPrice.toFixed(2)}` : M === "end" ? C = `${this._endPrice.toFixed(2)}` : M === "channel" && (C = `${(this._channelHeight / Math.min(this._startPrice, this._endPrice) * 100).toFixed(2)}%`);
11060
- const v = S, A = Math.max(25, _ - 15);
11060
+ const x = S, A = Math.max(25, _ - 15);
11061
11061
  t.fillStyle = "rgba(255, 255, 255, 0.9)";
11062
11062
  const y = t.measureText(C).width;
11063
- t.fillRect(v - y / 2 - 5, A - 8, y + 4, 16), t.fillStyle = "#333333", t.fillText(C, v, A), t.restore();
11063
+ t.fillRect(x - y / 2 - 5, A - 8, y + 4, 16), t.fillStyle = "#333333", t.fillText(C, x, A), t.restore();
11064
11064
  };
11065
11065
  s(e, i, "start", this._dragPoint === "start" || this._hoverPoint === "start"), s(r, a, "end", this._dragPoint === "end" || this._hoverPoint === "end");
11066
11066
  const n = (e + r) / 2, o = (i + a) / 2, l = r - e, h = a - i, d = Math.sqrt(l * l + h * h);
@@ -11290,9 +11290,9 @@ class is {
11290
11290
  else if (this.state.adjustingMode === "channel") {
11291
11291
  const p = this.state.dragTarget.getStartPrice(), M = this.state.dragTarget.getEndPrice(), k = (p + M) / 2, P = i.series.priceToCoordinate(k);
11292
11292
  if (P === null) return;
11293
- const _ = h - P, C = Math.abs(M - p), v = i.series.priceToCoordinate(p), A = i.series.priceToCoordinate(M);
11294
- if (v === null || A === null) return;
11295
- const y = Math.abs(v - A), B = y > 0 ? C / y : 0.01, I = _ * B, N = Math.max(1e-3, Math.abs(this.state.adjustStartData.channelHeight + I));
11293
+ const _ = h - P, C = Math.abs(M - p), x = i.series.priceToCoordinate(p), A = i.series.priceToCoordinate(M);
11294
+ if (x === null || A === null) return;
11295
+ const y = Math.abs(x - A), B = y > 0 ? C / y : 0.01, I = _ * B, N = Math.max(1e-3, Math.abs(this.state.adjustStartData.channelHeight + I));
11296
11296
  this.state.dragTarget.updateChannelHeight(N);
11297
11297
  }
11298
11298
  }
@@ -11411,11 +11411,11 @@ class is {
11411
11411
  if (p === 0) return !1;
11412
11412
  const M = -u / p, k = c / p;
11413
11413
  for (let P = 0; P <= 10; P++) {
11414
- const S = P / 10, _ = M * 30 * S, C = k * 30 * S, v = a + _, A = s + C, y = n + _, B = o + C, I = t - v, N = e - A, L = y - v, J = B - A, ot = I * L + N * J, $ = L * L + J * J;
11414
+ const S = P / 10, _ = M * 30 * S, C = k * 30 * S, x = a + _, A = s + C, y = n + _, B = o + C, I = t - x, N = e - A, L = y - x, J = B - A, ot = I * L + N * J, $ = L * L + J * J;
11415
11415
  let Z = -1;
11416
11416
  $ !== 0 && (Z = ot / $);
11417
11417
  let O, et;
11418
- Z < 0 ? (O = v, et = A) : Z > 1 ? (O = y, et = B) : (O = v + Z * L, et = A + Z * J);
11418
+ Z < 0 ? (O = x, et = A) : Z > 1 ? (O = y, et = B) : (O = x + Z * L, et = A + Z * J);
11419
11419
  const ht = t - O, pt = e - et;
11420
11420
  if (Math.sqrt(ht * ht + pt * pt) <= r)
11421
11421
  return !0;
@@ -12037,8 +12037,8 @@ class Qe {
12037
12037
  if (isNaN(t) || isNaN(e) || !this._chart || !this._series) return;
12038
12038
  const i = t, r = e, a = this._chart.timeScale(), s = this._series.priceToCoordinate(this._startPrice), n = this._series.priceToCoordinate(this._endPrice), o = this._series.priceToCoordinate(this._extensionPrice), l = a.timeToCoordinate(this._startTime), h = a.timeToCoordinate(this._endTime), d = a.timeToCoordinate(this._extensionTime);
12039
12039
  if (s === null || n === null || o === null || l === null || h === null || d === null) return;
12040
- const g = s + i, c = n + i, u = o + i, p = l + r, M = h + r, k = d + r, P = this._series.coordinateToPrice(g), S = this._series.coordinateToPrice(c), _ = this._series.coordinateToPrice(u), C = a.coordinateToTime(p), v = a.coordinateToTime(M), A = a.coordinateToTime(k);
12041
- P !== null && S !== null && _ !== null && C !== null && v !== null && A !== null && (this._startPrice = P, this._endPrice = S, this._extensionPrice = _, this._startTime = C, this._endTime = v, this._extensionTime = A, this.requestUpdate());
12040
+ const g = s + i, c = n + i, u = o + i, p = l + r, M = h + r, k = d + r, P = this._series.coordinateToPrice(g), S = this._series.coordinateToPrice(c), _ = this._series.coordinateToPrice(u), C = a.coordinateToTime(p), x = a.coordinateToTime(M), A = a.coordinateToTime(k);
12041
+ P !== null && S !== null && _ !== null && C !== null && x !== null && A !== null && (this._startPrice = P, this._endPrice = S, this._extensionPrice = _, this._startTime = C, this._endTime = x, this._extensionTime = A, this.requestUpdate());
12042
12042
  }
12043
12043
  dragHandleByPixels(t, e = 0, i) {
12044
12044
  if (isNaN(t) || isNaN(e) || !this._chart || !this._series) return;
@@ -12604,8 +12604,8 @@ class Ge {
12604
12604
  if (isNaN(t) || isNaN(e) || !this._chart || !this._series) return;
12605
12605
  const i = t, r = e, a = this._chart.timeScale(), s = this._series.priceToCoordinate(this._startPrice), n = this._series.priceToCoordinate(this._endPrice), o = this._series.priceToCoordinate(this._extensionPrice), l = a.timeToCoordinate(this._startTime), h = a.timeToCoordinate(this._endTime), d = a.timeToCoordinate(this._extensionTime);
12606
12606
  if (s === null || n === null || o === null || l === null || h === null || d === null) return;
12607
- const g = l + i, c = h + i, u = d + i, p = s + r, M = n + r, k = o + r, P = a.coordinateToTime(g), S = a.coordinateToTime(c), _ = a.coordinateToTime(u), C = this._series.coordinateToPrice(p), v = this._series.coordinateToPrice(M), A = this._series.coordinateToPrice(k);
12608
- P !== null && S !== null && _ !== null && C !== null && v !== null && A !== null && (this._startTime = P, this._endTime = S, this._extensionTime = _, this._startPrice = C, this._endPrice = v, this._extensionPrice = A, this.requestUpdate());
12607
+ const g = l + i, c = h + i, u = d + i, p = s + r, M = n + r, k = o + r, P = a.coordinateToTime(g), S = a.coordinateToTime(c), _ = a.coordinateToTime(u), C = this._series.coordinateToPrice(p), x = this._series.coordinateToPrice(M), A = this._series.coordinateToPrice(k);
12608
+ P !== null && S !== null && _ !== null && C !== null && x !== null && A !== null && (this._startTime = P, this._endTime = S, this._extensionTime = _, this._startPrice = C, this._endPrice = x, this._extensionPrice = A, this.requestUpdate());
12609
12609
  }
12610
12610
  dragHandleByPixels(t, e = 0, i) {
12611
12611
  if (isNaN(t) || isNaN(e) || !this._chart || !this._series) return;
@@ -12613,8 +12613,8 @@ class Ge {
12613
12613
  if (i === "start") {
12614
12614
  const a = this._series.priceToCoordinate(this._startPrice), s = this._series.priceToCoordinate(this._endPrice), n = this._series.priceToCoordinate(this._extensionPrice), o = r.timeToCoordinate(this._startTime), l = r.timeToCoordinate(this._endTime), h = r.timeToCoordinate(this._extensionTime);
12615
12615
  if (a === null || s === null || n === null || o === null || l === null || h === null) return;
12616
- const d = o + t, g = l + t, c = h + t, u = a + e, p = s + e, M = n + e, k = r.coordinateToTime(d), P = r.coordinateToTime(g), S = r.coordinateToTime(c), _ = this._series.coordinateToPrice(u), C = this._series.coordinateToPrice(p), v = this._series.coordinateToPrice(M);
12617
- k !== null && P !== null && S !== null && _ !== null && C !== null && v !== null && (this._startTime = k, this._endTime = P, this._extensionTime = S, this._startPrice = _, this._endPrice = C, this._extensionPrice = v, this.requestUpdate());
12616
+ const d = o + t, g = l + t, c = h + t, u = a + e, p = s + e, M = n + e, k = r.coordinateToTime(d), P = r.coordinateToTime(g), S = r.coordinateToTime(c), _ = this._series.coordinateToPrice(u), C = this._series.coordinateToPrice(p), x = this._series.coordinateToPrice(M);
12617
+ k !== null && P !== null && S !== null && _ !== null && C !== null && x !== null && (this._startTime = k, this._endTime = P, this._extensionTime = S, this._startPrice = _, this._endPrice = C, this._extensionPrice = x, this.requestUpdate());
12618
12618
  } else if (i === "end") {
12619
12619
  const a = this._series.priceToCoordinate(this._endPrice), s = r.timeToCoordinate(this._endTime);
12620
12620
  if (a === null || s === null) return;
@@ -14549,7 +14549,7 @@ class ls {
14549
14549
  if (this.state.fibonacciSpiralCenterPoint && this.previewFibonacciSpiralMark) {
14550
14550
  const u = this.previewFibonacciSpiralMark.getCenterPrice(), p = this.previewFibonacciSpiralMark.getCenterTime(), M = i.series.priceToCoordinate(u), P = r.timeScale().timeToCoordinate(p);
14551
14551
  if (M !== null && P !== null) {
14552
- const S = l - P, _ = h - M, C = Math.sqrt(S * S + _ * _), v = M + C, A = i.series.coordinateToPrice(v), y = Math.abs(A - u);
14552
+ const S = l - P, _ = h - M, C = Math.sqrt(S * S + _ * _), x = M + C, A = i.series.coordinateToPrice(x), y = Math.abs(A - u);
14553
14553
  this.previewFibonacciSpiralMark.updateRadius && this.previewFibonacciSpiralMark.updateRadius(y);
14554
14554
  const B = Math.atan2(_, S), I = P + C * Math.cos(B), N = M + C * Math.sin(B);
14555
14555
  this.previewFibonacciSpiralMark.setRadiusPoint({ x: I, y: N });
@@ -15231,8 +15231,8 @@ class ei {
15231
15231
  if (i === "center") {
15232
15232
  const a = this._series.priceToCoordinate(this._centerPrice), s = r.timeToCoordinate(this._centerTime), n = this._series.priceToCoordinate(this._radiusPrice), o = r.timeToCoordinate(this._radiusTime), l = this._series.priceToCoordinate(this._anglePrice), h = r.timeToCoordinate(this._angleTime);
15233
15233
  if (a === null || s === null || n === null || o === null || l === null || h === null) return;
15234
- const d = a + t, g = s + e, c = n + t, u = o + e, p = l + t, M = h + e, k = this._series.coordinateToPrice(d), P = r.coordinateToTime(g), S = this._series.coordinateToPrice(c), _ = r.coordinateToTime(u), C = this._series.coordinateToPrice(p), v = r.coordinateToTime(M);
15235
- k !== null && P !== null && S !== null && _ !== null && C !== null && v !== null && (this._centerPrice = k, this._centerTime = P, this._radiusPrice = S, this._radiusTime = _, this._anglePrice = C, this._angleTime = v, this.requestUpdate());
15234
+ const d = a + t, g = s + e, c = n + t, u = o + e, p = l + t, M = h + e, k = this._series.coordinateToPrice(d), P = r.coordinateToTime(g), S = this._series.coordinateToPrice(c), _ = r.coordinateToTime(u), C = this._series.coordinateToPrice(p), x = r.coordinateToTime(M);
15235
+ k !== null && P !== null && S !== null && _ !== null && C !== null && x !== null && (this._centerPrice = k, this._centerTime = P, this._radiusPrice = S, this._radiusTime = _, this._anglePrice = C, this._angleTime = x, this.requestUpdate());
15236
15236
  } else if (i === "radius") {
15237
15237
  const a = this._series.priceToCoordinate(this._centerPrice), s = r.timeToCoordinate(this._centerTime), n = this._series.priceToCoordinate(this._radiusPrice), o = r.timeToCoordinate(this._radiusTime);
15238
15238
  if (a === null || s === null || n === null || o === null) return;
@@ -15307,16 +15307,16 @@ class ei {
15307
15307
  startAngle: u,
15308
15308
  endAngle: p
15309
15309
  }), this._fillOpacity > 0 && (e.save(), e.fillStyle = this._fibonacciColors[S % this._fibonacciColors.length], e.globalAlpha = this._fillOpacity, e.beginPath(), e.moveTo(n, r), e.arc(n, r, C, u, p), e.closePath(), e.fill(), e.restore()), e.save(), e.strokeStyle = this._fibonacciColors[S % this._fibonacciColors.length], e.globalAlpha = 1, e.beginPath(), e.arc(n, r, C, u, p), e.stroke(), e.restore(), e.save(), e.fillStyle = this._fibonacciColors[S % this._fibonacciColors.length], e.globalAlpha = 1, e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "middle";
15310
- const v = n + Math.cos(c) * C, A = r + Math.sin(c) * C;
15310
+ const x = n + Math.cos(c) * C, A = r + Math.sin(c) * C;
15311
15311
  e.fillText(
15312
15312
  `${(_ * 100).toFixed(1)}%`,
15313
- v + 15 * Math.cos(c),
15313
+ x + 15 * Math.cos(c),
15314
15314
  A + 15 * Math.sin(c)
15315
15315
  ), e.restore();
15316
15316
  }
15317
15317
  if (e.save(), e.strokeStyle = this._color, e.globalAlpha = 1, e.setLineDash([]), e.beginPath(), e.moveTo(n, r), e.lineTo(o, a), e.stroke(), e.strokeStyle = this._color, e.beginPath(), e.moveTo(n, r), e.lineTo(l, s), e.stroke(), e.restore(), (this._showHandles || this._isDragging) && !this._isPreview) {
15318
- const S = (_, C, v = !1) => {
15319
- e.save(), e.fillStyle = this._color, e.globalAlpha = 1, e.beginPath(), e.arc(_, C, 6, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(_, C, 4, 0, Math.PI * 2), e.fill(), v && (e.strokeStyle = this._color, e.lineWidth = 2, e.setLineDash([]), e.beginPath(), e.arc(_, C, 8, 0, Math.PI * 2), e.stroke()), e.restore();
15318
+ const S = (_, C, x = !1) => {
15319
+ e.save(), e.fillStyle = this._color, e.globalAlpha = 1, e.beginPath(), e.arc(_, C, 6, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(_, C, 4, 0, Math.PI * 2), e.fill(), x && (e.strokeStyle = this._color, e.lineWidth = 2, e.setLineDash([]), e.beginPath(), e.arc(_, C, 8, 0, Math.PI * 2), e.stroke()), e.restore();
15320
15320
  };
15321
15321
  S(n, r, this._dragPoint === "center"), S(o, a, this._dragPoint === "radius"), S(l, s, this._dragPoint === "angle");
15322
15322
  }
@@ -17018,8 +17018,8 @@ class si {
17018
17018
  const P = M[k], S = this._fanLineColors[k % this._fanLineColors.length];
17019
17019
  t.strokeStyle = S, t.lineWidth = this._fanLineWidth, t.beginPath(), t.moveTo(s, n);
17020
17020
  let _, C;
17021
- const v = n + (r - s) * Math.tan(P), A = s + (a - n) / Math.tan(P);
17022
- if (v >= a && v <= i ? (_ = r, C = v) : A >= e && A <= r ? (_ = A, C = a) : (_ = r, C = a), t.lineTo(_, C), t.stroke(), this._showLabels && !this._isPreview) {
17021
+ const x = n + (r - s) * Math.tan(P), A = s + (a - n) / Math.tan(P);
17022
+ if (x >= a && x <= i ? (_ = r, C = x) : A >= e && A <= r ? (_ = A, C = a) : (_ = r, C = a), t.lineTo(_, C), t.stroke(), this._showLabels && !this._isPreview) {
17023
17023
  const y = Math.round(P * 180 / Math.PI), B = Math.sqrt(Math.pow(_ - s, 2) + Math.pow(C - n, 2)) * 0.5, I = s + B * Math.cos(P), N = n + B * Math.sin(P);
17024
17024
  t.save(), t.fillStyle = this._labelColor, t.font = "10px Arial", t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${y}°`, I, N), t.restore();
17025
17025
  }
@@ -17761,8 +17761,8 @@ class ps {
17761
17761
  let p;
17762
17762
  this.state.currentPoints.length === 0 ? p = [{ time: g, price: c }] : p = [
17763
17763
  ...this.state.currentPoints.map((P) => {
17764
- const S = P.x - (o.left - n.left), _ = P.y - (o.top - n.top), C = d.coordinateToTime(S), v = i.series.coordinateToPrice(_);
17765
- return { time: C || 0, price: v || 0 };
17764
+ const S = P.x - (o.left - n.left), _ = P.y - (o.top - n.top), C = d.coordinateToTime(S), x = i.series.coordinateToPrice(_);
17765
+ return { time: C || 0, price: x || 0 };
17766
17766
  }),
17767
17767
  { time: g, price: c }
17768
17768
  ];
@@ -18036,8 +18036,8 @@ class ai {
18036
18036
  const C = this._dragPoint === "start" ? a : i;
18037
18037
  e.beginPath(), e.moveTo(C, -S), e.lineTo(C, S), e.stroke(), e.restore();
18038
18038
  }
18039
- const c = (S, _, C, v = !1) => {
18040
- e.save(), e.fillStyle = C === "start" ? "#2962FF" : "#FF5252", e.beginPath(), e.arc(S, _, 6, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(S, _, 4, 0, Math.PI * 2), e.fill(), v && (e.strokeStyle = C === "start" ? "#2962FF" : "#FF5252", e.lineWidth = 2, e.setLineDash([]), e.beginPath(), e.arc(S, _, 8, 0, Math.PI * 2), e.stroke()), e.restore();
18039
+ const c = (S, _, C, x = !1) => {
18040
+ e.save(), e.fillStyle = C === "start" ? "#2962FF" : "#FF5252", e.beginPath(), e.arc(S, _, 6, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(S, _, 4, 0, Math.PI * 2), e.fill(), x && (e.strokeStyle = C === "start" ? "#2962FF" : "#FF5252", e.lineWidth = 2, e.setLineDash([]), e.beginPath(), e.arc(S, _, 8, 0, Math.PI * 2), e.stroke()), e.restore();
18041
18041
  }, u = this.calculateLinearRegression(), p = u.slope * this._startTime + u.intercept, M = u.slope * this._endTime + u.intercept, k = this._series.priceToCoordinate(p), P = this._series.priceToCoordinate(M);
18042
18042
  c(i, k, "start", this._dragPoint === "start" || this._hoverPoint === "start"), c(a, P, "end", this._dragPoint === "end" || this._hoverPoint === "end");
18043
18043
  }
@@ -18485,10 +18485,10 @@ class ni {
18485
18485
  e.beginPath(), e.moveTo(i + M, r + k), e.lineTo(a + M, s + k), e.stroke();
18486
18486
  }
18487
18487
  if ((this._showHandles || this._isDragging || this._hoverPoint) && !this._isPreview) {
18488
- const p = (_, C, v, A = !1) => {
18488
+ const p = (_, C, x, A = !1) => {
18489
18489
  e.save(), e.fillStyle = this._color, e.beginPath(), e.arc(_, C, 6, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(_, C, 4, 0, Math.PI * 2), e.fill(), A && (e.strokeStyle = this._color, e.lineWidth = 2, e.setLineDash([]), e.beginPath(), e.arc(_, C, 8, 0, Math.PI * 2), e.stroke()), e.fillStyle = this._color, e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "bottom";
18490
18490
  let y = "";
18491
- v === "start" ? y = `${this._startPrice.toFixed(2)}` : v === "end" ? y = `${this._endPrice.toFixed(2)}` : v === "channel" && (y = `${(this._channelHeight / this._startPrice * 100).toFixed(2)}%`), e.fillStyle = "rgba(255, 255, 255, 0.9)";
18491
+ x === "start" ? y = `${this._startPrice.toFixed(2)}` : x === "end" ? y = `${this._endPrice.toFixed(2)}` : x === "channel" && (y = `${(this._channelHeight / this._startPrice * 100).toFixed(2)}%`), e.fillStyle = "rgba(255, 255, 255, 0.9)";
18492
18492
  const B = e.measureText(y).width;
18493
18493
  e.fillRect(_ - B / 2 - 5, C - 25, B + 10, 18), e.fillStyle = "#333333", e.fillText(y, _, C - 10), e.restore();
18494
18494
  };
@@ -18827,11 +18827,11 @@ class Ms {
18827
18827
  if (p === 0) return !1;
18828
18828
  const M = -u / p, k = c / p;
18829
18829
  for (let P = -1; P <= 1; P++) {
18830
- const S = M * 30 * P, _ = k * 30 * P, C = a + S, v = s + _, A = n + S, y = o + _, B = t - C, I = e - v, N = A - C, L = y - v, J = B * N + I * L, ot = N * N + L * L;
18830
+ const S = M * 30 * P, _ = k * 30 * P, C = a + S, x = s + _, A = n + S, y = o + _, B = t - C, I = e - x, N = A - C, L = y - x, J = B * N + I * L, ot = N * N + L * L;
18831
18831
  let $ = -1;
18832
18832
  ot !== 0 && ($ = J / ot);
18833
18833
  let Z, O;
18834
- $ < 0 ? (Z = C, O = v) : $ > 1 ? (Z = A, O = y) : (Z = C + $ * N, O = v + $ * L);
18834
+ $ < 0 ? (Z = C, O = x) : $ > 1 ? (Z = A, O = y) : (Z = C + $ * N, O = x + $ * L);
18835
18835
  const et = t - Z, ht = e - O;
18836
18836
  if (Math.sqrt(et * et + ht * ht) <= r)
18837
18837
  return !0;
@@ -21767,8 +21767,8 @@ class ci {
21767
21767
  if (i === "center") {
21768
21768
  const a = this._series.priceToCoordinate(this._centerPrice), s = r.timeToCoordinate(this._centerTime), n = this._series.priceToCoordinate(this._radiusPrice), o = r.timeToCoordinate(this._radiusTime), l = this._series.priceToCoordinate(this._anglePrice), h = r.timeToCoordinate(this._angleTime);
21769
21769
  if (a === null || s === null || n === null || o === null || l === null || h === null) return;
21770
- const d = a + t, g = s + e, c = n + t, u = o + e, p = l + t, M = h + e, k = this._series.coordinateToPrice(d), P = r.coordinateToTime(g), S = this._series.coordinateToPrice(c), _ = r.coordinateToTime(u), C = this._series.coordinateToPrice(p), v = r.coordinateToTime(M);
21771
- k !== null && P !== null && S !== null && _ !== null && C !== null && v !== null && (this._centerPrice = k, this._centerTime = P, this._radiusPrice = S, this._radiusTime = _, this._anglePrice = C, this._angleTime = v, this._updateSectorAngle(), this.requestUpdate());
21770
+ const d = a + t, g = s + e, c = n + t, u = o + e, p = l + t, M = h + e, k = this._series.coordinateToPrice(d), P = r.coordinateToTime(g), S = this._series.coordinateToPrice(c), _ = r.coordinateToTime(u), C = this._series.coordinateToPrice(p), x = r.coordinateToTime(M);
21771
+ k !== null && P !== null && S !== null && _ !== null && C !== null && x !== null && (this._centerPrice = k, this._centerTime = P, this._radiusPrice = S, this._radiusTime = _, this._anglePrice = C, this._angleTime = x, this._updateSectorAngle(), this.requestUpdate());
21772
21772
  } else if (i === "radius") {
21773
21773
  const a = this._series.priceToCoordinate(this._centerPrice), s = r.timeToCoordinate(this._centerTime), n = this._series.priceToCoordinate(this._radiusPrice), o = r.timeToCoordinate(this._radiusTime);
21774
21774
  if (a === null || s === null || n === null || o === null) return;
@@ -22618,8 +22618,8 @@ class Fs {
22618
22618
  P !== 0 && (S = k / P);
22619
22619
  let _, C;
22620
22620
  S < 0 ? (_ = a, C = s) : S > 1 ? (_ = n, C = o) : (_ = a + S * p, C = s + S * M);
22621
- const v = t - _, A = e - C;
22622
- return Math.sqrt(v * v + A * A) <= r;
22621
+ const x = t - _, A = e - C;
22622
+ return Math.sqrt(x * x + A * A) <= r;
22623
22623
  }
22624
22624
  getState() {
22625
22625
  return { ...this.state };
@@ -23781,8 +23781,8 @@ class Rs {
23781
23781
  let M;
23782
23782
  this.state.currentPoints.length === 0 ? M = [{ time: p, price: c }] : M = [
23783
23783
  ...this.state.currentPoints.map((P) => {
23784
- const S = P.x - (o.left - n.left), _ = P.y - (o.top - n.top), C = d.coordinateToTime(S), v = i.series.coordinateToPrice(_);
23785
- return { time: C || 0, price: v || 0 };
23784
+ const S = P.x - (o.left - n.left), _ = P.y - (o.top - n.top), C = d.coordinateToTime(S), x = i.series.coordinateToPrice(_);
23785
+ return { time: C || 0, price: x || 0 };
23786
23786
  }),
23787
23787
  { time: p, price: c }
23788
23788
  ];
@@ -26591,8 +26591,8 @@ class js {
26591
26591
  P !== 0 && (S = k / P);
26592
26592
  let _, C;
26593
26593
  S < 0 ? (_ = a, C = s) : S > 1 ? (_ = n, C = o) : (_ = a + S * p, C = s + S * M);
26594
- const v = t - _, A = e - C;
26595
- return Math.sqrt(v * v + A * A) <= r;
26594
+ const x = t - _, A = e - C;
26595
+ return Math.sqrt(x * x + A * A) <= r;
26596
26596
  }
26597
26597
  getState() {
26598
26598
  return { ...this.state };
@@ -28614,10 +28614,10 @@ class mi {
28614
28614
  }
28615
28615
  if (this._isEditing && this._cursorVisible) {
28616
28616
  e.strokeStyle = "#333", e.lineWidth = 1, e.setLineDash([]), e.beginPath();
28617
- const C = a, v = s;
28617
+ const C = a, x = s;
28618
28618
  e.font = n;
28619
28619
  const A = e.measureText(this._text);
28620
- e.moveTo(C + A.width / 2, v - this._fontSize / 2), e.lineTo(C + A.width / 2, v + this._fontSize / 2), e.stroke();
28620
+ e.moveTo(C + A.width / 2, x - this._fontSize / 2), e.lineTo(C + A.width / 2, x + this._fontSize / 2), e.stroke();
28621
28621
  }
28622
28622
  e.restore();
28623
28623
  }
@@ -29900,8 +29900,8 @@ class Gs {
29900
29900
  P !== 0 && (S = k / P);
29901
29901
  let _, C;
29902
29902
  S < 0 ? (_ = a, C = s) : S > 1 ? (_ = n, C = o) : (_ = a + S * p, C = s + S * M);
29903
- const v = t - _, A = e - C;
29904
- return Math.sqrt(v * v + A * A) <= r;
29903
+ const x = t - _, A = e - C;
29904
+ return Math.sqrt(x * x + A * A) <= r;
29905
29905
  }
29906
29906
  getState() {
29907
29907
  return { ...this.state };
@@ -30776,8 +30776,8 @@ class Js {
30776
30776
  P !== 0 && (S = k / P);
30777
30777
  let _, C;
30778
30778
  S < 0 ? (_ = a, C = s) : S > 1 ? (_ = n, C = o) : (_ = a + S * p, C = s + S * M);
30779
- const v = t - _, A = e - C;
30780
- return Math.sqrt(v * v + A * A) <= r;
30779
+ const x = t - _, A = e - C;
30780
+ return Math.sqrt(x * x + A * A) <= r;
30781
30781
  }
30782
30782
  getState() {
30783
30783
  return { ...this.state };
@@ -31199,8 +31199,8 @@ class Zs {
31199
31199
  P !== 0 && (S = k / P);
31200
31200
  let _, C;
31201
31201
  S < 0 ? (_ = a, C = s) : S > 1 ? (_ = n, C = o) : (_ = a + S * p, C = s + S * M);
31202
- const v = t - _, A = e - C;
31203
- return Math.sqrt(v * v + A * A) <= r;
31202
+ const x = t - _, A = e - C;
31203
+ return Math.sqrt(x * x + A * A) <= r;
31204
31204
  }
31205
31205
  getState() {
31206
31206
  return { ...this.state };
@@ -31703,8 +31703,8 @@ class Ci {
31703
31703
  if (isNaN(t) || isNaN(e) || !this._chart || !this._series) return;
31704
31704
  const i = this._chart.timeScale(), r = i.timeToCoordinate(this._handleTime), a = this._series.priceToCoordinate(this._handlePrice), s = i.timeToCoordinate(this._baseStartTime), n = this._series.priceToCoordinate(this._baseStartPrice), o = i.timeToCoordinate(this._baseEndTime), l = this._series.priceToCoordinate(this._baseEndPrice), h = i.timeToCoordinate(this._extensionTime), d = this._series.priceToCoordinate(this._extensionPrice);
31705
31705
  if (r === null || a === null || s === null || n === null || o === null || l === null || h === null || d === null) return;
31706
- const g = r + t, c = a + e, u = s + t, p = n + e, M = o + t, k = l + e, P = h + t, S = d + e, _ = i.coordinateToTime(g), C = this._series.coordinateToPrice(c), v = i.coordinateToTime(u), A = this._series.coordinateToPrice(p), y = i.coordinateToTime(M), B = this._series.coordinateToPrice(k), I = i.coordinateToTime(P), N = this._series.coordinateToPrice(S);
31707
- _ !== null && !isNaN(C) && v !== null && !isNaN(A) && y !== null && !isNaN(B) && I !== null && !isNaN(N) && (this._handleTime = _, this._handlePrice = C, this._baseStartTime = v, this._baseStartPrice = A, this._baseEndTime = y, this._baseEndPrice = B, this._extensionTime = I, this._extensionPrice = N, this.requestUpdate());
31706
+ const g = r + t, c = a + e, u = s + t, p = n + e, M = o + t, k = l + e, P = h + t, S = d + e, _ = i.coordinateToTime(g), C = this._series.coordinateToPrice(c), x = i.coordinateToTime(u), A = this._series.coordinateToPrice(p), y = i.coordinateToTime(M), B = this._series.coordinateToPrice(k), I = i.coordinateToTime(P), N = this._series.coordinateToPrice(S);
31707
+ _ !== null && !isNaN(C) && x !== null && !isNaN(A) && y !== null && !isNaN(B) && I !== null && !isNaN(N) && (this._handleTime = _, this._handlePrice = C, this._baseStartTime = x, this._baseStartPrice = A, this._baseEndTime = y, this._baseEndPrice = B, this._extensionTime = I, this._extensionPrice = N, this.requestUpdate());
31708
31708
  }
31709
31709
  isPointNearHandle(t, e, i = 15) {
31710
31710
  if (!this._chart || !this._series) return null;
@@ -31754,7 +31754,7 @@ class Ci {
31754
31754
  const B = y / (this._numberOfForks - 1), I = a + (n - a) * B, N = s + (o - s) * B;
31755
31755
  C.push({ x: I, y: N });
31756
31756
  }
31757
- const v = [
31757
+ const x = [
31758
31758
  "#FF4444",
31759
31759
  "#FFAA00",
31760
31760
  "#4CAF50",
@@ -31762,7 +31762,7 @@ class Ci {
31762
31762
  "#9C27B0"
31763
31763
  ];
31764
31764
  e.setLineDash(this._isPreview ? [5, 3] : []), C.forEach((y, B) => {
31765
- e.strokeStyle = v[B], e.lineWidth = B === 2 ? this._lineWidth + 1 : this._lineWidth, e.beginPath(), e.moveTo(y.x, y.y), e.lineTo(y.x + S, y.y + _), e.stroke();
31765
+ e.strokeStyle = x[B], e.lineWidth = B === 2 ? this._lineWidth + 1 : this._lineWidth, e.beginPath(), e.moveTo(y.x, y.y), e.lineTo(y.x + S, y.y + _), e.stroke();
31766
31766
  }), e.lineWidth = this._lineWidth;
31767
31767
  const A = e.createLinearGradient(a, s, n, o);
31768
31768
  if (A.addColorStop(0, "#FF4444"), A.addColorStop(0.5, "#4CAF50"), A.addColorStop(1, "#9C27B0"), e.strokeStyle = A, e.setLineDash([]), e.beginPath(), e.moveTo(a, s), e.lineTo(n, o), e.stroke(), !this._isPreview)
@@ -31773,11 +31773,11 @@ class Ci {
31773
31773
  I.x + S,
31774
31774
  I.y + _
31775
31775
  );
31776
- y === 0 ? (N.addColorStop(0, "rgba(255, 68, 68, 0.2)"), N.addColorStop(1, "rgba(255, 170, 0, 0.3)")) : y === 1 ? (N.addColorStop(0, "rgba(255, 170, 0, 0.3)"), N.addColorStop(1, "rgba(76, 175, 80, 0.4)")) : y === 2 ? (N.addColorStop(0, "rgba(76, 175, 80, 0.4)"), N.addColorStop(1, "rgba(33, 150, 243, 0.3)")) : y === 3 && (N.addColorStop(0, "rgba(33, 150, 243, 0.3)"), N.addColorStop(1, "rgba(156, 39, 176, 0.2)")), e.fillStyle = N, e.beginPath(), e.moveTo(B.x, B.y), e.lineTo(B.x + S, B.y + _), e.lineTo(I.x + S, I.y + _), e.lineTo(I.x, I.y), e.closePath(), e.fill(), e.strokeStyle = v[y], e.lineWidth = 0.5, e.setLineDash([2, 2]), e.stroke(), e.setLineDash([]);
31776
+ y === 0 ? (N.addColorStop(0, "rgba(255, 68, 68, 0.2)"), N.addColorStop(1, "rgba(255, 170, 0, 0.3)")) : y === 1 ? (N.addColorStop(0, "rgba(255, 170, 0, 0.3)"), N.addColorStop(1, "rgba(76, 175, 80, 0.4)")) : y === 2 ? (N.addColorStop(0, "rgba(76, 175, 80, 0.4)"), N.addColorStop(1, "rgba(33, 150, 243, 0.3)")) : y === 3 && (N.addColorStop(0, "rgba(33, 150, 243, 0.3)"), N.addColorStop(1, "rgba(156, 39, 176, 0.2)")), e.fillStyle = N, e.beginPath(), e.moveTo(B.x, B.y), e.lineTo(B.x + S, B.y + _), e.lineTo(I.x + S, I.y + _), e.lineTo(I.x, I.y), e.closePath(), e.fill(), e.strokeStyle = x[y], e.lineWidth = 0.5, e.setLineDash([2, 2]), e.stroke(), e.setLineDash([]);
31777
31777
  }
31778
31778
  this._isPreview || C.forEach((y, B) => {
31779
31779
  const I = y.x + S, N = y.y + _;
31780
- e.fillStyle = v[B], e.beginPath(), e.arc(I, N, 3, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(I, N, 1, 0, Math.PI * 2), e.fill();
31780
+ e.fillStyle = x[B], e.beginPath(), e.arc(I, N, 3, 0, Math.PI * 2), e.fill(), e.fillStyle = "#FFFFFF", e.beginPath(), e.arc(I, N, 1, 0, Math.PI * 2), e.fill();
31781
31781
  });
31782
31782
  }
31783
31783
  e.strokeStyle = "#2962FF", e.lineWidth = this._lineWidth, e.setLineDash([]), e.beginPath(), e.moveTo(a, s), e.lineTo(l, h), e.stroke();
@@ -31848,7 +31848,7 @@ class Ci {
31848
31848
  if (t == null || e == null || i == null || r == null || a == null || s == null || n == null || o == null) return null;
31849
31849
  const l = (i + a) / 2, h = (r + s) / 2, d = t - l, g = e - h, c = 3, u = -d * c, p = -g * c, M = [];
31850
31850
  for (let C = 0; C < this._numberOfForks; C++) {
31851
- const v = C / (this._numberOfForks - 1), A = i + (a - i) * v, y = r + (s - r) * v;
31851
+ const x = C / (this._numberOfForks - 1), A = i + (a - i) * x, y = r + (s - r) * x;
31852
31852
  M.push({ x: A, y });
31853
31853
  }
31854
31854
  const k = M.map((C) => ({
@@ -32175,13 +32175,13 @@ class ea {
32175
32175
  const N = I / 4, L = n + (l - n) * N, J = o + (h - o) * N;
32176
32176
  C.push({ x: L, y: J });
32177
32177
  }
32178
- const v = C.map((I) => ({
32178
+ const x = C.map((I) => ({
32179
32179
  start: I.x,
32180
32180
  startY: I.y,
32181
32181
  endX: I.x + S,
32182
32182
  endY: I.y + _
32183
32183
  }));
32184
- for (const I of v)
32184
+ for (const I of x)
32185
32185
  if (this.pointToLineDistance(t, e, I.start, I.startY, I.endX, I.endY) <= r) return !0;
32186
32186
  return this.pointToLineDistance(t, e, k, P, a, s) <= r || this.pointToLineDistance(t, e, n, o, l, h) <= r || this.pointToLineDistance(t, e, n, o, d, g) <= r;
32187
32187
  }
@@ -40279,7 +40279,7 @@ const no = ({
40279
40279
  params: z
40280
40280
  });
40281
40281
  }
40282
- }, v = (q, U) => {
40282
+ }, x = (q, U) => {
40283
40283
  if (!o || !o.params) return;
40284
40284
  const z = [...o.params];
40285
40285
  z[q] = { ...z[q], paramValue: U }, l({
@@ -40424,7 +40424,7 @@ const no = ({
40424
40424
  cursor: "grab",
40425
40425
  userSelect: "none",
40426
40426
  flexShrink: 0
40427
- }, x = {
40427
+ }, v = {
40428
40428
  fontSize: "14px",
40429
40429
  fontWeight: "bold",
40430
40430
  color: r?.layout?.textColor || "#000000",
@@ -40586,7 +40586,7 @@ const no = ({
40586
40586
  onMouseDown: (q) => {
40587
40587
  q.target === k.current && q.preventDefault();
40588
40588
  },
40589
- children: /* @__PURE__ */ m.jsx("div", { style: x, children: L() })
40589
+ children: /* @__PURE__ */ m.jsx("div", { style: v, children: L() })
40590
40590
  }
40591
40591
  ),
40592
40592
  /* @__PURE__ */ m.jsxs("div", { style: K, children: [
@@ -40603,7 +40603,7 @@ const no = ({
40603
40603
  type: "number",
40604
40604
  style: R,
40605
40605
  value: q.paramValue,
40606
- onChange: (z) => v(U, Number(z.target.value)),
40606
+ onChange: (z) => x(U, Number(z.target.value)),
40607
40607
  onClick: (z) => z.stopPropagation()
40608
40608
  }
40609
40609
  ),
@@ -41042,13 +41042,13 @@ class co {
41042
41042
  MinusDI: []
41043
41043
  }, r = t.map((S) => S.time), a = [0], s = [0], n = [0];
41044
41044
  for (let S = 1; S < t.length; S++) {
41045
- const _ = t[S].high, C = t[S].low, v = t[S - 1].high, A = t[S - 1].low, y = t[S - 1].close, B = Math.max(
41045
+ const _ = t[S].high, C = t[S].low, x = t[S - 1].high, A = t[S - 1].low, y = t[S - 1].close, B = Math.max(
41046
41046
  _ - C,
41047
41047
  Math.abs(_ - y),
41048
41048
  Math.abs(C - y)
41049
41049
  );
41050
41050
  a.push(B);
41051
- const I = _ - v, N = A - C;
41051
+ const I = _ - x, N = A - C;
41052
41052
  I > N && I > 0 ? (s.push(I), n.push(0)) : N > I && N > 0 ? (s.push(0), n.push(N)) : (s.push(0), n.push(0));
41053
41053
  }
41054
41054
  const o = [], l = [], h = [];
@@ -41064,7 +41064,7 @@ class co {
41064
41064
  }
41065
41065
  const _ = l[S] / o[S] * 100, C = h[S] / o[S] * 100;
41066
41066
  u.push(_), p.push(C);
41067
- const v = _ + C, A = v > 0 ? Math.abs(_ - C) / v * 100 : 0;
41067
+ const x = _ + C, A = x > 0 ? Math.abs(_ - C) / x * 100 : 0;
41068
41068
  M.push(A);
41069
41069
  }
41070
41070
  const k = [];
@@ -43044,7 +43044,7 @@ const Bo = ({
43044
43044
  ...G[U],
43045
43045
  paramName: z
43046
43046
  }, l(G);
43047
- }, v = (U, z) => {
43047
+ }, x = (U, z) => {
43048
43048
  const G = [...o];
43049
43049
  G[U] = {
43050
43050
  ...G[U],
@@ -43272,7 +43272,7 @@ const Bo = ({
43272
43272
  fontWeight: "bold",
43273
43273
  color: r?.layout?.textColor || "#000000",
43274
43274
  margin: 0
43275
- }, x = {
43275
+ }, v = {
43276
43276
  padding: "16px",
43277
43277
  flex: 1,
43278
43278
  display: "flex",
@@ -43437,7 +43437,7 @@ const Bo = ({
43437
43437
  ] })
43438
43438
  }
43439
43439
  ),
43440
- /* @__PURE__ */ m.jsxs("div", { style: x, children: [
43440
+ /* @__PURE__ */ m.jsxs("div", { style: v, children: [
43441
43441
  /* @__PURE__ */ m.jsx(
43442
43442
  "div",
43443
43443
  {
@@ -43462,7 +43462,7 @@ const Bo = ({
43462
43462
  type: "number",
43463
43463
  style: tt,
43464
43464
  value: U.paramValue,
43465
- onChange: (G) => v(z, Number(G.target.value)),
43465
+ onChange: (G) => x(z, Number(G.target.value)),
43466
43466
  onClick: (G) => G.stopPropagation(),
43467
43467
  min: "1",
43468
43468
  max: "100",
@@ -44883,15 +44883,15 @@ class Qo {
44883
44883
  const p = h[u];
44884
44884
  if (p === 0) continue;
44885
44885
  const M = p / d, P = Math.max(M, 0.01), S = Math.max(g, n * P), _ = Math.pow(P, 0.5);
44886
- let C, v, A;
44886
+ let C, x, A;
44887
44887
  if (_ < 0.5) {
44888
44888
  const L = _ * 2;
44889
- C = Math.floor(0), v = Math.floor(165 * L), A = Math.floor(255 * (1 - L) + 255 * L);
44889
+ C = Math.floor(0), x = Math.floor(165 * L), A = Math.floor(255 * (1 - L) + 255 * L);
44890
44890
  } else {
44891
44891
  const L = (_ - 0.5) * 2;
44892
- C = Math.floor(255 * L), v = Math.floor(255 * (1 - L)), A = Math.floor(255 * (1 - L));
44892
+ C = Math.floor(255 * L), x = Math.floor(255 * (1 - L)), A = Math.floor(255 * (1 - L));
44893
44893
  }
44894
- const y = 0.4 + _ * 0.6, B = `rgba(${C}, ${v}, ${A}, ${y})`, I = o + (n - S), N = this._height - (u + 1) * c;
44894
+ const y = 0.4 + _ * 0.6, B = `rgba(${C}, ${x}, ${A}, ${y})`, I = o + (n - S), N = this._height - (u + 1) * c;
44895
44895
  t.fillStyle = B, t.fillRect(I, N, S, c);
44896
44896
  }
44897
44897
  t.restore();
@@ -45122,17 +45122,17 @@ class Go {
45122
45122
  class $o extends rt.Component {
45123
45123
  constructor(t) {
45124
45124
  super(t), this.canvasRef = rt.createRef(), this.containerRef = rt.createRef(), this.allDrawings = [], this.doubleClickTimeout = null, this.chartEventManager = null, this.originalChartOptions = null, this.currentMarkSettingsStyle = null, this.chartMarkManager = null, this.chartMarkTextEditManager = null, this.mainChartTechnicalIndicatorManager = null, this.staticMarkManager = null, this.volume = null, this.volumeHeatMap = null, this.marketProfile = null, this.mainChartManager = null, this.executeEventMarksScriptForChartData = () => {
45125
- const { chartData: e } = this.props;
45126
- !e || !Array.isArray(e) || e.length === 0 || e.forEach((i) => {
45127
- if (!i) return;
45128
- const { close: r, time: a } = i;
45129
- r !== void 0 && this.chartMarkManager?.priceEventMarkManager?.executeScriptAtPrice(
45130
- i.open,
45131
- i.high,
45132
- i.low,
45133
- i.close
45134
- ), a !== void 0 && this.chartMarkManager?.timeEventMarkManager?.executeScriptAtTime(a);
45135
- });
45125
+ const { chartData: e } = this.props, { isIncrement: i } = this.state;
45126
+ i && (!e || !Array.isArray(e) || e.length === 0 || e.forEach((r) => {
45127
+ if (!r) return;
45128
+ const { close: a, time: s } = r;
45129
+ a !== void 0 && this.chartMarkManager?.priceEventMarkManager?.executeScriptAtPrice(
45130
+ r.open,
45131
+ r.high,
45132
+ r.low,
45133
+ r.close
45134
+ ), s !== void 0 && this.chartMarkManager?.timeEventMarkManager?.executeScriptAtTime(s);
45135
+ }));
45136
45136
  }, this.swtichMainChartType = () => {
45137
45137
  this.mainChartManager?.switchChartType(this.props.currentMainChartType), this.mainChartManager?.refreshData(), this.updateStaticMark();
45138
45138
  }, this.setCursorType = (e) => {
@@ -45971,7 +45971,8 @@ class $o extends rt.Component {
45971
45971
  isPriceEventMode: !1,
45972
45972
  isPriceEventDragging: !1,
45973
45973
  priceEventDragTarget: null,
45974
- currentPriceEventMark: null
45974
+ currentPriceEventMark: null,
45975
+ isIncrement: !1
45975
45976
  }, this.chartEventManager = new Oi(), this.chartMarkManager = new na(), this.chartMarkTextEditManager = new oa(), this.mainChartTechnicalIndicatorManager = new so(this.props.currentTheme), this.initializeGraphManager(), this.staticMarkManager = new ho(), this.chartPanesManager = new Ro(), this.mainChartManager = new zo(this, this.props.currentTheme);
45976
45977
  }
45977
45978
  componentDidMount() {
@@ -45982,7 +45983,9 @@ class $o extends rt.Component {
45982
45983
  }, 50);
45983
45984
  }
45984
45985
  componentDidUpdate(t) {
45985
- (t.chartSeries !== this.props.chartSeries || t.chart !== this.props.chart) && this.initializeGraphManagerProps(), t.i18n !== this.props.i18n && (this.volumeHeatMap?.updateI18n(this.props.i18n), this.marketProfile?.updateI18n(this.props.i18n)), t.currentTheme !== this.props.currentTheme && (this.volumeHeatMap?.updateTheme(this.props.currentTheme), this.marketProfile?.updateTheme(this.props.currentTheme)), t.ai !== this.props.ai && this.props.ai && this.setState({
45986
+ (t.chartSeries !== this.props.chartSeries || t.chart !== this.props.chart) && this.initializeGraphManagerProps(), t.isIncrement !== this.props.isIncrement && this.setState({
45987
+ isIncrement: this.props.isIncrement
45988
+ }), t.i18n !== this.props.i18n && (this.volumeHeatMap?.updateI18n(this.props.i18n), this.marketProfile?.updateI18n(this.props.i18n)), t.currentTheme !== this.props.currentTheme && (this.volumeHeatMap?.updateTheme(this.props.currentTheme), this.marketProfile?.updateTheme(this.props.currentTheme)), t.ai !== this.props.ai && this.props.ai && this.setState({
45986
45989
  ai: this.props.ai
45987
45990
  }), t.aiconfigs !== this.props.aiconfigs && this.props.aiconfigs && this.setState({
45988
45991
  aiconfigs: this.props.aiconfigs
@@ -49143,7 +49146,7 @@ const Tl = [
49143
49146
  chartLayerRef: o,
49144
49147
  candleView: l
49145
49148
  }) => {
49146
- const [h, d] = st(""), [g, c] = st([]), [u, p] = st(-1), [M, k] = st(!1), [P, S] = st(0), [_, C] = st(n), [v, A] = st([]), [y, B] = st(!1), I = Mt(null), N = Mt(null), L = t.terminal.isEn === "en", [J, ot] = st([]), [$, Z] = st(-1), [O, et] = st(!1);
49149
+ const [h, d] = st(""), [g, c] = st([]), [u, p] = st(-1), [M, k] = st(!1), [P, S] = st(0), [_, C] = st(n), [x, A] = st([]), [y, B] = st(!1), I = Mt(null), N = Mt(null), L = t.terminal.isEn === "en", [J, ot] = st([]), [$, Z] = st(-1), [O, et] = st(!1);
49147
49150
  gt(() => {
49148
49151
  A([L ? `🕯️ Welcome to CandleView Terminal v1.0 Type 'help' to see available commands
49149
49152
  This software is licensed under AGPL 3.0
@@ -49207,7 +49210,7 @@ Npm: <a href="https://www.npmjs.com/package/candleview" target="_blank" rel="noo
49207
49210
  localStorage.setItem("terminal_command_history", JSON.stringify(Y));
49208
49211
  } catch {
49209
49212
  }
49210
- }, x = (D) => {
49213
+ }, v = (D) => {
49211
49214
  A((H) => [...H, `$ ${D}`]);
49212
49215
  }, K = (D) => {
49213
49216
  A((H) => [...H, D]);
@@ -49215,11 +49218,11 @@ Npm: <a href="https://www.npmjs.com/package/candleview" target="_blank" rel="noo
49215
49218
  gt(() => {
49216
49219
  const D = document.querySelector(".terminal-scrollbar");
49217
49220
  D && (D.scrollTop = D.scrollHeight);
49218
- }, [v]);
49221
+ }, [x]);
49219
49222
  const at = (D) => {
49220
49223
  D.preventDefault();
49221
49224
  const H = h.trim();
49222
- H && (x(H), e && e(H), wt(H), pt(H), d(""), p(-1), ot([]), et(!1), Z(-1), setTimeout(() => {
49225
+ H && (v(H), e && e(H), wt(H), pt(H), d(""), p(-1), ot([]), et(!1), Z(-1), setTimeout(() => {
49223
49226
  const Y = document.querySelector(".terminal-scrollbar");
49224
49227
  Y && (Y.scrollTop = Y.scrollHeight);
49225
49228
  }, 50), !r && _ && (I.current?.focus(), S(0)));
@@ -49676,7 +49679,7 @@ ${Y}`
49676
49679
  WebkitUserSelect: "text",
49677
49680
  MozUserSelect: "text",
49678
49681
  msUserSelect: "text"
49679
- }, className: "terminal-scrollbar", children: v.map((D, H) => /* @__PURE__ */ m.jsx(
49682
+ }, className: "terminal-scrollbar", children: x.map((D, H) => /* @__PURE__ */ m.jsx(
49680
49683
  "div",
49681
49684
  {
49682
49685
  style: {
@@ -54677,10 +54680,10 @@ const Ol = ({
54677
54680
  onModelChange: l,
54678
54681
  data: h
54679
54682
  }) => {
54680
- const [d, g] = st(""), [c, u] = st([]), [p, M] = st(!1), [k, P] = st(""), [S, _] = st([]), [C, v] = st(!1), A = Mt(null), y = Mt(null), B = Mt(null), [I, N] = st(10), L = 10, J = Mt(!1), ot = Mt(0), $ = Mt(0);
54683
+ const [d, g] = st(""), [c, u] = st([]), [p, M] = st(!1), [k, P] = st(""), [S, _] = st([]), [C, x] = st(!1), A = Mt(null), y = Mt(null), B = Mt(null), [I, N] = st(10), L = 10, J = Mt(!1), ot = Mt(0), $ = Mt(0);
54681
54684
  gt(() => {
54682
54685
  const R = (V) => {
54683
- C && B.current && !B.current.contains(V.target) && v(!1);
54686
+ C && B.current && !B.current.contains(V.target) && x(!1);
54684
54687
  };
54685
54688
  return document.addEventListener("mousedown", R), () => {
54686
54689
  document.removeEventListener("mousedown", R);
@@ -54792,8 +54795,8 @@ const Ol = ({
54792
54795
  }, [o, i, l]);
54793
54796
  const pt = (R) => {
54794
54797
  g(R.target.value);
54795
- }, x = (R) => {
54796
- P(R), v(!1), l && l(R);
54798
+ }, v = (R) => {
54799
+ P(R), x(!1), l && l(R);
54797
54800
  }, K = () => !o || !k ? null : i.find(
54798
54801
  (V) => V.brand === o && V.model === k
54799
54802
  )?.proxyUrl || null, at = async () => {
@@ -54947,7 +54950,7 @@ const Ol = ({
54947
54950
  textOverflow: "ellipsis",
54948
54951
  whiteSpace: "nowrap"
54949
54952
  },
54950
- onClick: () => v(!C),
54953
+ onClick: () => x(!C),
54951
54954
  onMouseEnter: (R) => {
54952
54955
  R.currentTarget.style.borderColor = f.toolbar.button.dropdown.borderActive;
54953
54956
  },
@@ -55015,7 +55018,7 @@ const Ol = ({
55015
55018
  textOverflow: "ellipsis",
55016
55019
  whiteSpace: "nowrap"
55017
55020
  },
55018
- onClick: () => x(R),
55021
+ onClick: () => v(R),
55019
55022
  onMouseEnter: (it) => {
55020
55023
  it.currentTarget.style.backgroundColor = R === k ? f.toolbar.button.dropdown.selected : f.toolbar.button.dropdown.hover;
55021
55024
  },
@@ -55385,21 +55388,28 @@ const Wl = ({
55385
55388
  scriptName: n = "Untitled",
55386
55389
  scriptContext: o = {}
55387
55390
  }) => {
55388
- const [l, h] = st(e), [d, g] = st(!1), [c, u] = st(!1), [p, M] = st(0.7), [k, P] = st(!1), [S, _] = st([]), C = Mt(null), v = Mt(null), A = Mt(null), y = Mt(null);
55391
+ const [l, h] = st(e), [d, g] = st(!1), [c, u] = st(!1), [p, M] = st(0.7), [k, P] = st(!1), [S, _] = st([]), C = Mt(null), x = Mt(null), A = Mt(null), y = Mt(null);
55389
55392
  gt(() => {
55390
- y.current = new jl((x) => {
55391
- _((K) => [...K, x]);
55393
+ const v = (K) => {
55394
+ K.stopPropagation();
55395
+ };
55396
+ return document.addEventListener("keydown", v, !0), () => {
55397
+ document.removeEventListener("keydown", v, !0);
55398
+ };
55399
+ }, []), gt(() => {
55400
+ y.current = new jl((v) => {
55401
+ _((K) => [...K, v]);
55392
55402
  });
55393
55403
  }, []);
55394
- const B = (x) => {
55395
- h(x.target.value);
55404
+ const B = (v) => {
55405
+ h(v.target.value);
55396
55406
  }, I = async () => {
55397
55407
  if (!(!l.trim() || d)) {
55398
55408
  g(!0);
55399
55409
  try {
55400
55410
  await r(l);
55401
- } catch (x) {
55402
- ot(t === nt ? `Save failed: ${x.message}` : `保存失败: ${x.message}`);
55411
+ } catch (v) {
55412
+ ot(t === nt ? `Save failed: ${v.message}` : `保存失败: ${v.message}`);
55403
55413
  } finally {
55404
55414
  g(!1);
55405
55415
  }
@@ -55409,43 +55419,43 @@ const Wl = ({
55409
55419
  u(!0), $();
55410
55420
  try {
55411
55421
  a ? await a(l) : new Function(l)();
55412
- } catch (x) {
55413
- ot(t === nt ? `Execution failed: ${x.message}` : `执行失败: ${x.message}`);
55422
+ } catch (v) {
55423
+ ot(t === nt ? `Execution failed: ${v.message}` : `执行失败: ${v.message}`);
55414
55424
  } finally {
55415
55425
  u(!1);
55416
55426
  }
55417
55427
  }
55418
- }, L = (x) => {
55419
- x.stopPropagation(), (x.ctrlKey || x.metaKey) && x.key === "s" && (x.preventDefault(), I()), (x.ctrlKey || x.metaKey) && x.key === "Enter" && (x.preventDefault(), N());
55420
- }, J = Mt(0), ot = (x) => {
55428
+ }, L = (v) => {
55429
+ v.stopPropagation(), (v.ctrlKey || v.metaKey) && v.key === "s" && (v.preventDefault(), I()), (v.ctrlKey || v.metaKey) && v.key === "Enter" && (v.preventDefault(), N());
55430
+ }, J = Mt(0), ot = (v) => {
55421
55431
  const K = {
55422
55432
  id: ++J.current,
55423
55433
  type: "error",
55424
- content: x,
55434
+ content: v,
55425
55435
  timestamp: /* @__PURE__ */ new Date()
55426
55436
  };
55427
55437
  _((at) => [...at, K]);
55428
55438
  }, $ = () => {
55429
55439
  _([]), y.current?.clear();
55430
- }, Z = (x) => {
55431
- x.preventDefault(), P(!0);
55440
+ }, Z = (v) => {
55441
+ v.preventDefault(), P(!0);
55432
55442
  };
55433
55443
  gt(() => {
55434
- const x = (at) => {
55435
- if (!k || !v.current) return;
55436
- const ct = v.current.getBoundingClientRect(), tt = ct.height, R = at.clientY - ct.top, V = Math.max(0.2, Math.min(0.8, R / tt));
55444
+ const v = (at) => {
55445
+ if (!k || !x.current) return;
55446
+ const ct = x.current.getBoundingClientRect(), tt = ct.height, R = at.clientY - ct.top, V = Math.max(0.2, Math.min(0.8, R / tt));
55437
55447
  M(V);
55438
55448
  }, K = () => {
55439
55449
  P(!1);
55440
55450
  };
55441
- return k && (document.addEventListener("mousemove", x), document.addEventListener("mouseup", K), document.body.style.userSelect = "none"), () => {
55442
- document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", K), document.body.style.userSelect = "";
55451
+ return k && (document.addEventListener("mousemove", v), document.addEventListener("mouseup", K), document.body.style.userSelect = "none"), () => {
55452
+ document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", K), document.body.style.userSelect = "";
55443
55453
  };
55444
55454
  }, [k]), gt(() => {
55445
55455
  A.current && (A.current.scrollTop = A.current.scrollHeight);
55446
55456
  }, [S]);
55447
- const O = `${p * 100}%`, et = `${(1 - p) * 100}%`, ht = (x) => {
55448
- switch (x) {
55457
+ const O = `${p * 100}%`, et = `${(1 - p) * 100}%`, ht = (v) => {
55458
+ switch (v) {
55449
55459
  case "log":
55450
55460
  return { color: f.layout.textColor };
55451
55461
  case "info":
@@ -55475,7 +55485,7 @@ const Wl = ({
55475
55485
  default:
55476
55486
  return { color: f.layout.textColor };
55477
55487
  }
55478
- }, pt = (x) => x.toLocaleTimeString([], {
55488
+ }, pt = (v) => v.toLocaleTimeString([], {
55479
55489
  hour: "2-digit",
55480
55490
  minute: "2-digit",
55481
55491
  second: "2-digit",
@@ -55530,27 +55540,27 @@ const Wl = ({
55530
55540
  if (!(!l.trim() || c)) {
55531
55541
  u(!0), _([]);
55532
55542
  try {
55533
- const x = {
55543
+ const v = {
55534
55544
  log: console.log,
55535
55545
  info: console.info,
55536
55546
  warn: console.warn,
55537
55547
  error: console.error
55538
- }, K = new Proxy(x, {
55548
+ }, K = new Proxy(v, {
55539
55549
  get(tt, R) {
55540
55550
  return R === "log" ? (...V) => {
55541
- y.current?.log(...V), x.log(...V);
55551
+ y.current?.log(...V), v.log(...V);
55542
55552
  } : R === "info" ? (...V) => {
55543
- y.current?.info(...V), x.info(...V);
55553
+ y.current?.info(...V), v.info(...V);
55544
55554
  } : R === "warn" ? (...V) => {
55545
- y.current?.warn(...V), x.warn(...V);
55555
+ y.current?.warn(...V), v.warn(...V);
55546
55556
  } : R === "error" ? (...V) => {
55547
- y.current?.error(...V), x.error(...V);
55557
+ y.current?.error(...V), v.error(...V);
55548
55558
  } : tt[R];
55549
55559
  }
55550
55560
  }), at = window.console;
55551
55561
  window.console = K, new Function(l)(), window.console = at;
55552
- } catch (x) {
55553
- window.console = window.console, y.current?.error(t === nt ? `❌ Error: ${x.message}` : `❌ 错误: ${x.message}`);
55562
+ } catch (v) {
55563
+ window.console = window.console, y.current?.error(t === nt ? `❌ Error: ${v.message}` : `❌ 错误: ${v.message}`);
55554
55564
  } finally {
55555
55565
  u(!1);
55556
55566
  }
@@ -55597,11 +55607,11 @@ const Wl = ({
55597
55607
  gap: "6px",
55598
55608
  transition: "all 0.2s"
55599
55609
  },
55600
- onMouseEnter: (x) => {
55601
- l.trim() && !c && (x.currentTarget.style.opacity = "0.9", x.currentTarget.style.transform = "translateY(-1px)");
55610
+ onMouseEnter: (v) => {
55611
+ l.trim() && !c && (v.currentTarget.style.opacity = "0.9", v.currentTarget.style.transform = "translateY(-1px)");
55602
55612
  },
55603
- onMouseLeave: (x) => {
55604
- l.trim() && !c && (x.currentTarget.style.opacity = "1", x.currentTarget.style.transform = "translateY(0)");
55613
+ onMouseLeave: (v) => {
55614
+ l.trim() && !c && (v.currentTarget.style.opacity = "1", v.currentTarget.style.transform = "translateY(0)");
55605
55615
  },
55606
55616
  children: [
55607
55617
  /* @__PURE__ */ m.jsx(wi, { size: 14 }),
@@ -55629,11 +55639,11 @@ const Wl = ({
55629
55639
  gap: "6px",
55630
55640
  transition: "all 0.2s"
55631
55641
  },
55632
- onMouseEnter: (x) => {
55633
- l.trim() && !d && (x.currentTarget.style.opacity = "0.9", x.currentTarget.style.transform = "translateY(-1px)");
55642
+ onMouseEnter: (v) => {
55643
+ l.trim() && !d && (v.currentTarget.style.opacity = "0.9", v.currentTarget.style.transform = "translateY(-1px)");
55634
55644
  },
55635
- onMouseLeave: (x) => {
55636
- l.trim() && !d && (x.currentTarget.style.opacity = "1", x.currentTarget.style.transform = "translateY(0)");
55645
+ onMouseLeave: (v) => {
55646
+ l.trim() && !d && (v.currentTarget.style.opacity = "1", v.currentTarget.style.transform = "translateY(0)");
55637
55647
  },
55638
55648
  children: [
55639
55649
  /* @__PURE__ */ m.jsx(to, { size: 14 }),
@@ -55658,11 +55668,11 @@ const Wl = ({
55658
55668
  color: f.toolbar.button.color,
55659
55669
  transition: "background-color 0.2s"
55660
55670
  },
55661
- onMouseEnter: (x) => {
55662
- x.currentTarget.style.backgroundColor = f.toolbar.button.hover;
55671
+ onMouseEnter: (v) => {
55672
+ v.currentTarget.style.backgroundColor = f.toolbar.button.hover;
55663
55673
  },
55664
- onMouseLeave: (x) => {
55665
- x.currentTarget.style.backgroundColor = "transparent";
55674
+ onMouseLeave: (v) => {
55675
+ v.currentTarget.style.backgroundColor = "transparent";
55666
55676
  },
55667
55677
  children: /* @__PURE__ */ m.jsx(Ee, { size: 18 })
55668
55678
  }
@@ -55698,7 +55708,7 @@ const Wl = ({
55698
55708
  /* @__PURE__ */ m.jsxs(
55699
55709
  "div",
55700
55710
  {
55701
- ref: v,
55711
+ ref: x,
55702
55712
  style: {
55703
55713
  flex: 1,
55704
55714
  display: "flex",
@@ -55774,14 +55784,14 @@ console.log("结果:", x);
55774
55784
  },
55775
55785
  onMouseEnter: () => {
55776
55786
  if (!k) {
55777
- const x = document.getElementById("script-splitter");
55778
- x && (x.style.backgroundColor = f.divider.hover);
55787
+ const v = document.getElementById("script-splitter");
55788
+ v && (v.style.backgroundColor = f.divider.hover);
55779
55789
  }
55780
55790
  },
55781
55791
  onMouseLeave: () => {
55782
55792
  if (!k) {
55783
- const x = document.getElementById("script-splitter");
55784
- x && (x.style.backgroundColor = f.divider.normal);
55793
+ const v = document.getElementById("script-splitter");
55794
+ v && (v.style.backgroundColor = f.divider.normal);
55785
55795
  }
55786
55796
  },
55787
55797
  id: "script-splitter",
@@ -55841,11 +55851,11 @@ console.log("结果:", x);
55841
55851
  alignItems: "center",
55842
55852
  gap: "4px"
55843
55853
  },
55844
- onMouseEnter: (x) => {
55845
- x.currentTarget.style.opacity = "1";
55854
+ onMouseEnter: (v) => {
55855
+ v.currentTarget.style.opacity = "1";
55846
55856
  },
55847
- onMouseLeave: (x) => {
55848
- x.currentTarget.style.opacity = "0.7";
55857
+ onMouseLeave: (v) => {
55858
+ v.currentTarget.style.opacity = "0.7";
55849
55859
  },
55850
55860
  children: [
55851
55861
  /* @__PURE__ */ m.jsx(eo, { size: 12 }),
@@ -55880,11 +55890,11 @@ console.log("结果:", x);
55880
55890
  // Use console.log() in your script to see output here.
55881
55891
  // Press Ctrl+Enter or click Run to execute the script.` : `// 控制台输出将显示在这里...
55882
55892
  // 在脚本中使用 console.log() 来查看输出。
55883
- // 按 Ctrl+Enter 或点击运行按钮执行脚本。` }) : S.map((x) => /* @__PURE__ */ m.jsxs(
55893
+ // 按 Ctrl+Enter 或点击运行按钮执行脚本。` }) : S.map((v) => /* @__PURE__ */ m.jsxs(
55884
55894
  "div",
55885
55895
  {
55886
55896
  style: {
55887
- ...ht(x.type),
55897
+ ...ht(v.type),
55888
55898
  padding: "2px 0",
55889
55899
  borderBottom: `1px solid ${f.toolbar.border}10`,
55890
55900
  fontFamily: "monospace"
@@ -55897,17 +55907,17 @@ console.log("结果:", x);
55897
55907
  fontFamily: "monospace"
55898
55908
  }, children: [
55899
55909
  "[",
55900
- pt(x.timestamp),
55910
+ pt(v.timestamp),
55901
55911
  "]"
55902
55912
  ] }),
55903
- x.type === "log" && "> ",
55904
- x.type === "info" && "ℹ ",
55905
- x.type === "warn" && "⚠ ",
55906
- x.type === "error" && "✗ ",
55907
- x.content
55913
+ v.type === "log" && "> ",
55914
+ v.type === "info" && "ℹ ",
55915
+ v.type === "warn" && "⚠ ",
55916
+ v.type === "error" && "✗ ",
55917
+ v.content
55908
55918
  ]
55909
55919
  },
55910
- x.id
55920
+ v.id
55911
55921
  ))
55912
55922
  }
55913
55923
  )
@@ -56499,7 +56509,8 @@ class ql extends rt.Component {
56499
56509
  currentScript: "",
56500
56510
  scriptName: "Untitled",
56501
56511
  currentScriptType: Nt.None,
56502
- currentScriptMarkId: ""
56512
+ currentScriptMarkId: "",
56513
+ isIncrement: !1
56503
56514
  }, this.chartEventManager = new Oi(), this.aiManager = new bl();
56504
56515
  }
56505
56516
  // ======================================== life cycle start ========================================
@@ -56518,7 +56529,9 @@ class ql extends rt.Component {
56518
56529
  }), this.handleThemeToggle();
56519
56530
  }
56520
56531
  if (t.data !== this.props.data) {
56521
- this.isIncrementalDataUpdate(t.data, this.props.data) && this.chart && this.currentSeries && this.props.data ? (this.originalData = this.props.data, this.refreshInternalData(() => {
56532
+ this.isIncrementalDataUpdate(t.data, this.props.data) && this.chart && this.currentSeries && this.props.data ? (this.setState({
56533
+ isIncrement: !0
56534
+ }), this.originalData = this.props.data, this.refreshInternalData(() => {
56522
56535
  this.refreshChart();
56523
56536
  })) : (this.clearStaticMarks(), this.setState({
56524
56537
  isDataLoading: !0,
@@ -57057,7 +57070,8 @@ class ql extends rt.Component {
57057
57070
  aiconfigs: this.state.aiconfigs,
57058
57071
  currentAIFunctionType: this.state.currentAIFunctionType,
57059
57072
  timeframe: this.state.timeframe,
57060
- timezone: this.state.timezone
57073
+ timezone: this.state.timezone,
57074
+ isIncrement: this.state.isIncrement
57061
57075
  }
57062
57076
  ),
57063
57077
  /* @__PURE__ */ m.jsxs(