@363045841yyt/klinechart 0.8.0 → 0.8.1-alpha.2

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.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, effectScope as d, h as f, inject as p, markRaw as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, onScopeDispose as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, resolveDynamicComponent as E, shallowRef as D, toDisplayString as O, unref as k, vModelCheckbox as A, watch as j, withCtx as M, withDirectives as N, withKeys as P, withModifiers as F } from "vue";
2
- import { COLOR_PRESET_ITEMS as I, VERSION as L, createChartController as R, createIndicatorSelectorController as ee, darkTheme as te, lightTheme as ne, normalizeColorPresetSettings as z, resolveThemeColors as re, themeToCssVars as ie } from "@363045841yyt/klinechart-core";
3
- import { DrawingInteractionController as ae, allIndicators as oe, createChartController as se, createIndicatorSelectorController as B, findIndicator as ce, getPhysicalKLineConfig as le, kGapFromKWidth as ue, zoomLevelToKWidth as de } from "@363045841yyt/klinechart-core/controllers";
4
- import { SemanticChartController as fe, __setDataFetcher as pe } from "@363045841yyt/klinechart-core/semantic";
1
+ import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, effectScope as d, h as f, inject as p, markRaw as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, onScopeDispose as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, resolveDynamicComponent as E, shallowRef as D, toDisplayString as O, unref as k, vModelCheckbox as A, vModelText as j, watch as M, withCtx as N, withDirectives as P, withKeys as F, withModifiers as I } from "vue";
2
+ import { COLOR_PRESET_ITEMS as ee, VERSION as L, createChartController as R, createIndicatorSelectorController as z, darkTheme as te, lightTheme as ne, normalizeColorPresetSettings as B, resolveThemeColors as re, themeToCssVars as ie } from "@363045841yyt/klinechart-core";
3
+ import { DrawingInteractionController as ae, allIndicators as oe, createChartController as se, createIndicatorSelectorController as ce, findIndicator as le, getPhysicalKLineConfig as ue, kGapFromKWidth as de, zoomLevelToKWidth as fe } from "@363045841yyt/klinechart-core/controllers";
4
+ import { SemanticChartController as pe } from "@363045841yyt/klinechart-core/semantic";
5
5
  import { getRegisteredIndicatorDefinition as me } from "@363045841yyt/klinechart-core/indicators";
6
6
  import { DEFAULT_SETTINGS as V, SETTINGS_STORAGE_KEY as H } from "@363045841yyt/klinechart-core/config";
7
7
  //#region src/components/ColorPresetPanel.vue?vue&type=script&setup=true&lang.ts
@@ -9,7 +9,7 @@ var he = { class: "color-preset-tools" }, ge = {
9
9
  class: "theme-tabs",
10
10
  role: "tablist",
11
11
  "aria-label": "颜色主题"
12
- }, U = ["onClick"], _e = { class: "color-group-label" }, ve = { class: "color-grid" }, ye = ["value", "onInput"], be = /*@__PURE__*/ u({
12
+ }, _e = ["onClick"], ve = { class: "color-group-label" }, ye = { class: "color-grid" }, U = ["value", "onInput"], be = /*@__PURE__*/ u({
13
13
  __name: "ColorPresetPanel",
14
14
  props: { colorPresetSettings: {} },
15
15
  emits: ["update:colorPresetSettings"],
@@ -28,16 +28,16 @@ var he = { class: "color-preset-tools" }, ge = {
28
28
  }, u = r(() => Object.keys(l).map((e) => ({
29
29
  group: e,
30
30
  label: l[e],
31
- items: I.filter((t) => t.group === e)
31
+ items: ee.filter((t) => t.group === e)
32
32
  })).filter((e) => e.items.length > 0)), d = w("light");
33
33
  function f(e, t) {
34
34
  return (e === "dark" ? te : ne).colors[t];
35
35
  }
36
36
  function p(e) {
37
- return z(i.colorPresetSettings)[d.value]?.[e] ?? f(d.value, e);
37
+ return B(i.colorPresetSettings)[d.value]?.[e] ?? f(d.value, e);
38
38
  }
39
39
  function m(e, t) {
40
- let n = z(i.colorPresetSettings);
40
+ let n = B(i.colorPresetSettings);
41
41
  a("update:colorPresetSettings", {
42
42
  ...n,
43
43
  [d.value]: {
@@ -47,7 +47,7 @@ var he = { class: "color-preset-tools" }, ge = {
47
47
  });
48
48
  }
49
49
  function h() {
50
- let e = { ...z(i.colorPresetSettings) };
50
+ let e = { ...B(i.colorPresetSettings) };
51
51
  delete e[d.value], a("update:colorPresetSettings", e);
52
52
  }
53
53
  return (t, n) => (S(), o("div", null, [s("div", he, [s("div", ge, [(S(), o(e, null, T(c, (e) => s("button", {
@@ -55,11 +55,11 @@ var he = { class: "color-preset-tools" }, ge = {
55
55
  type: "button",
56
56
  class: g(["theme-tab", { active: d.value === e.value }]),
57
57
  onClick: (t) => d.value = e.value
58
- }, O(e.label), 11, U)), 64))]), s("button", {
58
+ }, O(e.label), 11, _e)), 64))]), s("button", {
59
59
  type: "button",
60
60
  class: "color-reset-btn",
61
61
  onClick: h
62
- }, " 重置颜色 ")]), (S(!0), o(e, null, T(u.value, (t) => (S(), o(e, { key: t.group }, [s("div", _e, O(t.label), 1), s("div", ve, [(S(!0), o(e, null, T(t.items, (e) => (S(), o("label", {
62
+ }, " 重置颜色 ")]), (S(!0), o(e, null, T(u.value, (t) => (S(), o(e, { key: t.group }, [s("div", ve, O(t.label), 1), s("div", ye, [(S(!0), o(e, null, T(t.items, (e) => (S(), o("label", {
63
63
  key: e.key,
64
64
  class: "color-item"
65
65
  }, [s("span", null, O(e.label), 1), s("input", {
@@ -67,7 +67,7 @@ var he = { class: "color-preset-tools" }, ge = {
67
67
  class: "color-input",
68
68
  value: p(e.key),
69
69
  onInput: (t) => m(e.key, t.target.value)
70
- }, null, 40, ye)]))), 128))])], 64))), 128))]));
70
+ }, null, 40, U)]))), 128))])], 64))), 128))]));
71
71
  }
72
72
  }), W = (e, t) => {
73
73
  let n = e.__vccOpts || e;
@@ -80,7 +80,7 @@ var he = { class: "color-preset-tools" }, ge = {
80
80
  ], Ce = {
81
81
  key: 0,
82
82
  class: "dropdown__label"
83
- }, we = { class: "dropdown__value" }, G = ["aria-selected", "onClick"], K = 0, q = null, Te = 0, J = /*#__PURE__*/ W(/* @__PURE__ */ u({
83
+ }, we = { class: "dropdown__value" }, Te = ["aria-selected", "onClick"], G = 0, K = null, Ee = 0, q = /*#__PURE__*/ W(/* @__PURE__ */ u({
84
84
  __name: "Dropdown",
85
85
  props: {
86
86
  modelValue: {},
@@ -92,7 +92,7 @@ var he = { class: "color-preset-tools" }, ge = {
92
92
  },
93
93
  emits: ["update:modelValue"],
94
94
  setup(t, { emit: n }) {
95
- let i = t, c = n, l = w(null), u = w(null), d = w(!1), f = w(0), p = ++Te, m = r(() => i.minWidth ? { minWidth: i.minWidth } : {}), h = r(() => {
95
+ let i = t, c = n, l = w(null), u = w(null), d = w(!1), f = w(0), p = ++Ee, m = r(() => i.minWidth ? { minWidth: i.minWidth } : {}), h = r(() => {
96
96
  if (!d.value) return;
97
97
  let e = f.value || (i.minWidth ? parseInt(i.minWidth) : 0);
98
98
  return { width: e ? `${e}px` : void 0 };
@@ -101,10 +101,10 @@ var he = { class: "color-preset-tools" }, ge = {
101
101
  return e && i.options.some((t) => t.value === e) ? e : i.options[0]?.value ?? "";
102
102
  }), b = r(() => i.options.find((e) => e.value === y.value) ?? i.options[0]);
103
103
  function x() {
104
- K !== p && q && q(), !d.value && (K = p, q = C, f.value = u.value?.offsetWidth ?? 0, d.value = !0, document.addEventListener("pointerdown", k));
104
+ G !== p && K && K(), !d.value && (G = p, K = C, f.value = u.value?.offsetWidth ?? 0, d.value = !0, document.addEventListener("pointerdown", k));
105
105
  }
106
106
  function C() {
107
- d.value && (d.value = !1, K === p && (K = 0, q = null), document.removeEventListener("pointerdown", k));
107
+ d.value && (d.value = !1, G === p && (G = 0, K = null), document.removeEventListener("pointerdown", k));
108
108
  }
109
109
  function E() {
110
110
  d.value ? C() : x();
@@ -131,10 +131,10 @@ var he = { class: "color-preset-tools" }, ge = {
131
131
  "aria-expanded": d.value,
132
132
  onClick: E,
133
133
  onKeydown: [
134
- P(F(C, ["stop"]), ["escape"]),
135
- P(F(x, ["prevent"]), ["down"]),
136
- P(F(E, ["prevent"]), ["enter"]),
137
- P(F(E, ["prevent"]), ["space"])
134
+ F(I(C, ["stop"]), ["escape"]),
135
+ F(I(x, ["prevent"]), ["down"]),
136
+ F(I(E, ["prevent"]), ["enter"]),
137
+ F(I(E, ["prevent"]), ["space"])
138
138
  ]
139
139
  }, [
140
140
  t.label ? (S(), o("span", Ce, O(t.label), 1)) : a("", !0),
@@ -156,12 +156,12 @@ var he = { class: "color-preset-tools" }, ge = {
156
156
  role: "option",
157
157
  "aria-selected": e.value === y.value,
158
158
  onClick: (t) => D(e.value)
159
- }, O(e.label), 11, G))), 128))], 4)) : a("", !0)], 2));
159
+ }, O(e.label), 11, Te))), 128))], 4)) : a("", !0)], 2));
160
160
  }
161
- }), [["__scopeId", "data-v-126e11f2"]]), Y = {
161
+ }), [["__scopeId", "data-v-126e11f2"]]), De = {
162
162
  class: "toolbar-item color-item",
163
163
  title: "颜色"
164
- }, Ee = ["value"], De = /*#__PURE__*/ W(/* @__PURE__ */ u({
164
+ }, J = ["value"], Oe = /*#__PURE__*/ W(/* @__PURE__ */ u({
165
165
  __name: "DrawingStyleToolbar",
166
166
  props: { drawing: {} },
167
167
  emits: ["updateStyle", "delete"],
@@ -212,11 +212,11 @@ var he = { class: "color-preset-tools" }, ge = {
212
212
  }
213
213
  return (t, i) => (S(), o("div", {
214
214
  class: "drawing-style-toolbar",
215
- onPointerdown: i[4] ||= F(() => {}, ["stop"]),
216
- onPointermove: i[5] ||= F(() => {}, ["stop"]),
217
- onPointerup: i[6] ||= F(() => {}, ["stop"])
215
+ onPointerdown: i[4] ||= I(() => {}, ["stop"]),
216
+ onPointermove: i[5] ||= I(() => {}, ["stop"]),
217
+ onPointerup: i[6] ||= I(() => {}, ["stop"])
218
218
  }, [
219
- s("div", Y, [s("span", {
219
+ s("div", De, [s("span", {
220
220
  class: "color-swatch",
221
221
  style: _({ background: e.drawing.style.stroke ?? "#2962ff" })
222
222
  }, null, 4), s("input", {
@@ -224,15 +224,15 @@ var he = { class: "color-preset-tools" }, ge = {
224
224
  class: "color-input",
225
225
  value: e.drawing.style.stroke ?? "#2962ff",
226
226
  onInput: i[0] ||= (e) => c(e.target.value)
227
- }, null, 40, Ee)]),
228
- l(J, {
227
+ }, null, 40, J)]),
228
+ l(q, {
229
229
  "model-value": String(e.drawing.style.strokeWidth ?? 1),
230
230
  options: n,
231
231
  size: "sm",
232
232
  title: "线宽",
233
233
  "onUpdate:modelValue": i[1] ||= (e) => u(Number(e))
234
234
  }, null, 8, ["model-value"]),
235
- l(J, {
235
+ l(q, {
236
236
  "model-value": e.drawing.style.strokeStyle ?? "solid",
237
237
  options: r,
238
238
  size: "sm",
@@ -260,12 +260,12 @@ var he = { class: "color-preset-tools" }, ge = {
260
260
  ], -1)]])
261
261
  ], 32));
262
262
  }
263
- }), [["__scopeId", "data-v-e9b6a8a9"]]), Oe = Symbol("fullscreen-teleport-target");
263
+ }), [["__scopeId", "data-v-e9b6a8a9"]]), Y = Symbol("fullscreen-teleport-target");
264
264
  function ke(e) {
265
- C(Oe, e);
265
+ C(Y, e);
266
266
  }
267
267
  function Ae() {
268
- let e = p(Oe, null);
268
+ let e = p(Y, null);
269
269
  return r(() => e?.value ?? "body");
270
270
  }
271
271
  //#endregion
@@ -298,12 +298,12 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
298
298
  emits: ["close", "confirm"],
299
299
  setup(r, { emit: u }) {
300
300
  let d = r, f = u, p = w({ ...d.values }), m = w(!0), h = Ae();
301
- j(() => d.values, (e) => {
301
+ M(() => d.values, (e) => {
302
302
  p.value = { ...e };
303
303
  }, {
304
304
  deep: !0,
305
305
  immediate: !0
306
- }), j(() => d.visible, (e) => {
306
+ }), M(() => d.visible, (e) => {
307
307
  e && (p.value = { ...d.values });
308
308
  });
309
309
  function _(e, t) {
@@ -324,14 +324,14 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
324
324
  f("confirm", { ...p.value });
325
325
  }
326
326
  return (u, d) => (S(), i(t, { to: k(h) }, [l(n, { name: "overlay" }, {
327
- default: M(() => [r.visible ? (S(), o("div", {
327
+ default: N(() => [r.visible ? (S(), o("div", {
328
328
  key: 0,
329
329
  class: "params-overlay",
330
330
  onClick: d[4] ||= (e) => u.$emit("close")
331
331
  }, [l(n, { name: "modal" }, {
332
- default: M(() => [s("div", {
332
+ default: N(() => [s("div", {
333
333
  class: "indicator-params",
334
- onClick: d[3] ||= F(() => {}, ["stop"])
334
+ onClick: d[3] ||= I(() => {}, ["stop"])
335
335
  }, [
336
336
  s("div", je, [s("div", Me, [s("span", Ne, O(r.indicatorName), 1), d[5] ||= s("span", { class: "params-subtitle" }, "参数设置", -1)]), s("div", Pe, [s("button", {
337
337
  class: g(["toggle-desc-btn", { active: m.value }]),
@@ -350,7 +350,7 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
350
350
  "stroke-width": "2"
351
351
  }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
352
352
  l(n, { name: "slide" }, {
353
- default: M(() => [m.value && r.indicatorDescription ? (S(), o("div", Fe, [s("p", null, O(r.indicatorDescription), 1)])) : a("", !0)]),
353
+ default: N(() => [m.value && r.indicatorDescription ? (S(), o("div", Fe, [s("p", null, O(r.indicatorDescription), 1)])) : a("", !0)]),
354
354
  _: 1
355
355
  }),
356
356
  s("div", Ie, [(S(!0), o(e, null, T(r.params, (e) => (S(), o("div", {
@@ -378,7 +378,7 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
378
378
  onClick: (t) => v(e, 1)
379
379
  }, " + ", 8, We)
380
380
  ])]), l(n, { name: "slide" }, {
381
- default: M(() => [m.value && e.description ? (S(), o("div", Ge, O(e.description), 1)) : a("", !0)]),
381
+ default: N(() => [m.value && e.description ? (S(), o("div", Ge, O(e.description), 1)) : a("", !0)]),
382
382
  _: 2
383
383
  }, 1024)], 2))), 128))]),
384
384
  s("div", Ke, [s("button", {
@@ -422,7 +422,7 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
422
422
  }, nt = { class: "modal-search-area" }, rt = { class: "search-box" }, it = ["value"], at = { class: "modal-body" }, ot = {
423
423
  key: 0,
424
424
  class: "indicator-section"
425
- }, st = { class: "section-header" }, ct = { class: "section-count" }, lt = ["onClick"], ut = { class: "card-label" }, dt = { class: "card-tooltip" }, ft = { class: "card-header" }, X = { class: "card-label" }, Z = { class: "card-header-actions" }, pt = ["onClick"], mt = { class: "card-name" }, ht = {
425
+ }, st = { class: "section-header" }, ct = { class: "section-count" }, lt = ["onClick"], ut = { class: "card-label" }, dt = { class: "card-tooltip" }, ft = { class: "card-header" }, pt = { class: "card-label" }, mt = { class: "card-header-actions" }, X = ["onClick"], Z = { class: "card-name" }, ht = {
426
426
  key: 1,
427
427
  class: "section-divider"
428
428
  }, gt = {
@@ -462,21 +462,21 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
462
462
  }))
463
463
  }));
464
464
  }
465
- let h = B({ catalog: m(oe) }), _ = $(h.menuOpen), v = $(h.searchQuery), b = $(h.filteredMain), C = $(h.filteredSub), E = r(() => b.value.length > 0 || C.value.length > 0), D = h.catalog.peek().length, A = w(!1), j = w(null), N = w(!1), P = Ae(), I = r(() => j.value ? ce(j.value) : null), L = r(() => f.activeIndicators?.length ?? 0);
466
- function R(e) {
465
+ let h = ce({ catalog: m(oe) }), _ = $(h.menuOpen), v = $(h.searchQuery), b = $(h.filteredMain), C = $(h.filteredSub), E = r(() => b.value.length > 0 || C.value.length > 0), D = h.catalog.peek().length, A = w(!1), j = w(null), M = w(!1), P = Ae(), F = r(() => j.value ? le(j.value) : null), ee = r(() => f.activeIndicators?.length ?? 0);
466
+ function L(e) {
467
467
  return f.activeIndicators?.includes(e) ?? !1;
468
468
  }
469
- function ee(e) {
470
- R(e) || ce(e) && p("toggle", e, !0);
469
+ function R(e) {
470
+ L(e) || le(e) && p("toggle", e, !0);
471
471
  }
472
- function te(e) {
472
+ function z(e) {
473
473
  p("toggle", e, !1);
474
474
  }
475
- function ne(e) {
475
+ function te(e) {
476
476
  j.value = e, A.value = !0;
477
477
  }
478
- function z(e) {
479
- let t = ce(e);
478
+ function ne(e) {
479
+ let t = le(e);
480
480
  if (!t?.params) return {};
481
481
  let n = {};
482
482
  for (let e of t.params) n[e.key] = e.default ?? e.min ?? 1;
@@ -484,36 +484,36 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
484
484
  for (let [e, t] of Object.entries(r)) typeof t == "number" && (i[e] = t);
485
485
  return i;
486
486
  }
487
- function re(e) {
487
+ function B(e) {
488
488
  j.value && p("updateParams", j.value, e), A.value = !1;
489
489
  }
490
- function ie(e) {
490
+ function re(e) {
491
491
  e.key === "Escape" && h.menuOpen.peek() && h.closeMenu();
492
492
  }
493
493
  return y(() => {
494
- document.addEventListener("keydown", ie);
494
+ document.addEventListener("keydown", re);
495
495
  }), x(() => {
496
- document.removeEventListener("keydown", ie);
496
+ document.removeEventListener("keydown", re);
497
497
  }), u({
498
498
  openMenu: () => h.openMenu(),
499
499
  closeMenu: () => h.closeMenu(),
500
500
  toggleMenu: () => h.toggleMenu()
501
501
  }), (r, c) => (S(), o("div", Ye, [(S(), i(t, { to: k(P) }, [l(n, { name: "overlay" }, {
502
- default: M(() => [k(_) ? (S(), o("div", {
502
+ default: N(() => [k(_) ? (S(), o("div", {
503
503
  key: 0,
504
504
  class: "selector-overlay",
505
505
  onClick: c[5] ||= (e) => k(h).closeMenu()
506
506
  }, [l(n, { name: "modal" }, {
507
- default: M(() => [k(_) ? (S(), o("div", {
507
+ default: N(() => [k(_) ? (S(), o("div", {
508
508
  key: 0,
509
509
  class: "selector-modal",
510
- onClick: c[4] ||= F(() => {}, ["stop"])
510
+ onClick: c[4] ||= I(() => {}, ["stop"])
511
511
  }, [
512
512
  s("div", Xe, [s("div", Ze, [c[7] ||= s("span", { class: "title-text" }, "添加指标", -1), s("span", Qe, O(k(D)) + " 个可用指标", 1)]), s("div", $e, [s("button", {
513
- class: g(["view-toggle-btn", { active: N.value }]),
514
- onClick: c[0] ||= (e) => N.value = !N.value,
513
+ class: g(["view-toggle-btn", { active: M.value }]),
514
+ onClick: c[0] ||= (e) => M.value = !M.value,
515
515
  title: "简洁模式"
516
- }, [N.value ? (S(), o("svg", tt, [...c[9] ||= [s("path", { d: "M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z" }, null, -1)]])) : (S(), o("svg", et, [...c[8] ||= [s("path", { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, null, -1)]]))], 2), s("button", {
516
+ }, [M.value ? (S(), o("svg", tt, [...c[9] ||= [s("path", { d: "M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z" }, null, -1)]])) : (S(), o("svg", et, [...c[8] ||= [s("path", { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, null, -1)]]))], 2), s("button", {
517
517
  class: "modal-close",
518
518
  onClick: c[1] ||= (e) => k(h).closeMenu(),
519
519
  title: "关闭"
@@ -537,24 +537,24 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
537
537
  placeholder: "搜索指标名称..."
538
538
  }, null, 40, it)])]),
539
539
  s("div", at, [
540
- k(b).length > 0 ? (S(), o("div", ot, [s("div", st, [c[12] ||= s("span", { class: "section-title" }, "主图指标", -1), s("span", ct, O(k(b).length), 1)]), s("div", { class: g(["indicator-grid", { compact: N.value }]) }, [(S(!0), o(e, null, T(k(b), (t) => (S(), o("button", {
540
+ k(b).length > 0 ? (S(), o("div", ot, [s("div", st, [c[12] ||= s("span", { class: "section-title" }, "主图指标", -1), s("span", ct, O(k(b).length), 1)]), s("div", { class: g(["indicator-grid", { compact: M.value }]) }, [(S(!0), o(e, null, T(k(b), (t) => (S(), o("button", {
541
541
  key: t.id,
542
542
  class: g(["indicator-card", {
543
- active: R(t.id),
544
- compact: N.value
543
+ active: L(t.id),
544
+ compact: M.value
545
545
  }]),
546
- onClick: (e) => R(t.id) ? te(t.id) : ee(t.id)
547
- }, [N.value ? (S(), o(e, { key: 0 }, [s("span", ut, O(t.label), 1), s("span", dt, O(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", ft, [s("span", X, O(t.label), 1), s("div", Z, [t.params?.length ? (S(), o("button", {
546
+ onClick: (e) => L(t.id) ? z(t.id) : R(t.id)
547
+ }, [M.value ? (S(), o(e, { key: 0 }, [s("span", ut, O(t.label), 1), s("span", dt, O(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", ft, [s("span", pt, O(t.label), 1), s("div", mt, [t.params?.length ? (S(), o("button", {
548
548
  key: 0,
549
549
  class: "card-settings-btn",
550
- onClick: F((e) => ne(t.id), ["stop"]),
550
+ onClick: I((e) => te(t.id), ["stop"]),
551
551
  title: "编辑参数"
552
552
  }, [...c[13] ||= [s("svg", {
553
553
  viewBox: "0 0 24 24",
554
554
  width: "14",
555
555
  height: "14",
556
556
  fill: "currentColor"
557
- }, [s("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)]], 8, pt)) : a("", !0)])]), s("div", mt, O(t.name), 1)], 64))], 10, lt))), 128))], 2)])) : a("", !0),
557
+ }, [s("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)]], 8, X)) : a("", !0)])]), s("div", Z, O(t.name), 1)], 64))], 10, lt))), 128))], 2)])) : a("", !0),
558
558
  k(b).length > 0 && k(C).length > 0 ? (S(), o("div", ht)) : a("", !0),
559
559
  !E.value && k(v).trim() ? (S(), o("div", gt, [...c[14] ||= [
560
560
  s("svg", {
@@ -566,17 +566,17 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
566
566
  s("p", null, "未找到匹配的指标", -1),
567
567
  s("span", { class: "no-results-hint" }, "请尝试其他关键词", -1)
568
568
  ]])) : a("", !0),
569
- k(C).length > 0 ? (S(), o("div", _t, [s("div", vt, [c[15] ||= s("span", { class: "section-title" }, "副图指标", -1), s("span", yt, O(k(C).length), 1)]), s("div", { class: g(["indicator-grid", { compact: N.value }]) }, [(S(!0), o(e, null, T(k(C), (t) => (S(), o("button", {
569
+ k(C).length > 0 ? (S(), o("div", _t, [s("div", vt, [c[15] ||= s("span", { class: "section-title" }, "副图指标", -1), s("span", yt, O(k(C).length), 1)]), s("div", { class: g(["indicator-grid", { compact: M.value }]) }, [(S(!0), o(e, null, T(k(C), (t) => (S(), o("button", {
570
570
  key: t.id,
571
571
  class: g(["indicator-card", {
572
- active: R(t.id),
573
- compact: N.value
572
+ active: L(t.id),
573
+ compact: M.value
574
574
  }]),
575
- onClick: (e) => R(t.id) ? te(t.id) : ee(t.id)
576
- }, [N.value ? (S(), o(e, { key: 0 }, [s("span", xt, O(t.label), 1), s("span", St, O(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", Ct, [s("span", wt, O(t.label), 1), s("div", Tt, [t.params?.length ? (S(), o("button", {
575
+ onClick: (e) => L(t.id) ? z(t.id) : R(t.id)
576
+ }, [M.value ? (S(), o(e, { key: 0 }, [s("span", xt, O(t.label), 1), s("span", St, O(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", Ct, [s("span", wt, O(t.label), 1), s("div", Tt, [t.params?.length ? (S(), o("button", {
577
577
  key: 0,
578
578
  class: "card-settings-btn",
579
- onClick: F((e) => ne(t.id), ["stop"]),
579
+ onClick: I((e) => te(t.id), ["stop"]),
580
580
  title: "编辑参数"
581
581
  }, [...c[16] ||= [s("svg", {
582
582
  viewBox: "0 0 24 24",
@@ -585,7 +585,7 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
585
585
  fill: "currentColor"
586
586
  }, [s("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)]], 8, Et)) : a("", !0)])]), s("div", Dt, O(t.name), 1)], 64))], 10, bt))), 128))], 2)])) : a("", !0)
587
587
  ]),
588
- s("div", Ot, [s("div", kt, [s("span", At, "已激活 " + O(L.value) + " 个指标", 1)]), s("button", {
588
+ s("div", Ot, [s("div", kt, [s("span", At, "已激活 " + O(ee.value) + " 个指标", 1)]), s("button", {
589
589
  class: "btn btn-confirm",
590
590
  onClick: c[3] ||= (e) => k(h).closeMenu()
591
591
  }, "确认")])
@@ -593,16 +593,16 @@ var je = { class: "params-header" }, Me = { class: "header-left" }, Ne = { class
593
593
  _: 1
594
594
  })])) : a("", !0)]),
595
595
  _: 1
596
- })], 8, ["to"])), I.value ? (S(), i(Je, {
596
+ })], 8, ["to"])), F.value ? (S(), i(Je, {
597
597
  key: 0,
598
598
  visible: A.value,
599
- "indicator-id": I.value.id,
600
- "indicator-name": I.value.name,
601
- "indicator-description": I.value.description,
602
- params: I.value.params || [],
603
- values: z(I.value.id),
599
+ "indicator-id": F.value.id,
600
+ "indicator-name": F.value.name,
601
+ "indicator-description": F.value.description,
602
+ params: F.value.params || [],
603
+ values: ne(F.value.id),
604
604
  onClose: c[6] ||= (e) => A.value = !1,
605
- onConfirm: re
605
+ onConfirm: B
606
606
  }, null, 8, [
607
607
  "visible",
608
608
  "indicator-id",
@@ -1188,7 +1188,7 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1188
1188
  let t = JSON.parse(e), n = {};
1189
1189
  return V.forEach((e) => {
1190
1190
  n[e.key] = t[e.key] ?? e.default;
1191
- }), n.colorPresetSettings = z(t.colorPresetSettings), n;
1191
+ }), n.colorPresetSettings = B(t.colorPresetSettings), n;
1192
1192
  }
1193
1193
  } catch {}
1194
1194
  let e = {};
@@ -1197,7 +1197,7 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1197
1197
  }), e.colorPresetSettings = {}, e;
1198
1198
  }
1199
1199
  let y = w(v());
1200
- j(() => f.show, (e) => {
1200
+ M(() => f.show, (e) => {
1201
1201
  e && (y.value = v());
1202
1202
  });
1203
1203
  function b() {
@@ -1213,14 +1213,14 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1213
1213
  p("confirm", { ...y.value });
1214
1214
  }
1215
1215
  return (r, d) => (S(), i(t, { to: k(m) }, [l(n, { name: "overlay" }, {
1216
- default: M(() => [u.show ? (S(), o("div", {
1216
+ default: N(() => [u.show ? (S(), o("div", {
1217
1217
  key: 0,
1218
1218
  class: "settings-overlay",
1219
1219
  onClick: b
1220
1220
  }, [l(n, { name: "modal" }, {
1221
- default: M(() => [s("div", {
1221
+ default: N(() => [s("div", {
1222
1222
  class: "settings-modal",
1223
- onClick: d[1] ||= F(() => {}, ["stop"])
1223
+ onClick: d[1] ||= I(() => {}, ["stop"])
1224
1224
  }, [
1225
1225
  s("div", { class: "settings-header" }, [d[7] ||= s("div", { class: "header-left" }, [s("span", { class: "settings-title" }, "图表设置"), s("span", { class: "settings-subtitle" }, "个性化配置")], -1), s("div", { class: "header-right" }, [s("button", {
1226
1226
  class: "settings-close",
@@ -1235,12 +1235,12 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1235
1235
  h.value.length > 0 ? (S(), o(e, { key: 0 }, [d[8] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "主图设置")], -1), (S(!0), o(e, null, T(h.value, (e) => (S(), o("div", {
1236
1236
  key: e.key,
1237
1237
  class: "settings-item"
1238
- }, [s("label", cr, [s("span", null, O(e.label), 1), e.type === "boolean" ? N((S(), o("input", {
1238
+ }, [s("label", cr, [s("span", null, O(e.label), 1), e.type === "boolean" ? P((S(), o("input", {
1239
1239
  key: 0,
1240
1240
  type: "checkbox",
1241
1241
  class: "settings-checkbox",
1242
1242
  "onUpdate:modelValue": (t) => y.value[e.key] = t
1243
- }, null, 8, lr)), [[A, y.value[e.key]]]) : e.type === "select" && e.options ? (S(), i(J, {
1243
+ }, null, 8, lr)), [[A, y.value[e.key]]]) : e.type === "select" && e.options ? (S(), i(q, {
1244
1244
  key: 1,
1245
1245
  "model-value": String(y.value[e.key]),
1246
1246
  options: e.options,
@@ -1268,12 +1268,12 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1268
1268
  g.value.length > 0 ? (S(), o(e, { key: 1 }, [d[10] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "实验性 / 调试设置")], -1), (S(!0), o(e, null, T(g.value, (e) => (S(), o("div", {
1269
1269
  key: e.key,
1270
1270
  class: "settings-item experimental"
1271
- }, [s("label", ur, [s("span", null, O(e.label), 1), e.type === "boolean" ? N((S(), o("input", {
1271
+ }, [s("label", ur, [s("span", null, O(e.label), 1), e.type === "boolean" ? P((S(), o("input", {
1272
1272
  key: 0,
1273
1273
  type: "checkbox",
1274
1274
  class: "settings-checkbox",
1275
1275
  "onUpdate:modelValue": (t) => y.value[e.key] = t
1276
- }, null, 8, dr)), [[A, y.value[e.key]]]) : e.type === "select" && e.options ? (S(), i(J, {
1276
+ }, null, 8, dr)), [[A, y.value[e.key]]]) : e.type === "select" && e.options ? (S(), i(q, {
1277
1277
  key: 1,
1278
1278
  "model-value": String(y.value[e.key]),
1279
1279
  options: e.options,
@@ -1311,14 +1311,14 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1311
1311
  })])) : a("", !0)]),
1312
1312
  _: 1
1313
1313
  }), l(n, { name: "overlay" }, {
1314
- default: M(() => [_.value ? (S(), o("div", {
1314
+ default: N(() => [_.value ? (S(), o("div", {
1315
1315
  key: 0,
1316
1316
  class: "settings-overlay nested-overlay",
1317
1317
  onClick: d[5] ||= (e) => _.value = !1
1318
1318
  }, [l(n, { name: "modal" }, {
1319
- default: M(() => [s("div", {
1319
+ default: N(() => [s("div", {
1320
1320
  class: "settings-modal",
1321
- onClick: d[4] ||= F(() => {}, ["stop"])
1321
+ onClick: d[4] ||= I(() => {}, ["stop"])
1322
1322
  }, [s("div", fr, [d[15] ||= s("div", { class: "header-left" }, [s("span", { class: "settings-title" }, "颜色预设"), s("span", { class: "settings-subtitle" }, "自定义图表颜色")], -1), s("div", pr, [s("button", {
1323
1323
  class: "settings-close",
1324
1324
  onClick: d[2] ||= (e) => _.value = !1
@@ -1485,7 +1485,7 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1485
1485
  return { ...v.value };
1486
1486
  }
1487
1487
  r({ getSettings: j });
1488
- function N(e) {
1488
+ function M(e) {
1489
1489
  v.value = { ...e }, _(v.value), nr(!!v.value.enableCanvasProfiler), d("settingsChange", { ...v.value }), m.value = !1;
1490
1490
  }
1491
1491
  function P(e) {
@@ -1505,24 +1505,24 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1505
1505
  title: t.title,
1506
1506
  "aria-label": t.title,
1507
1507
  onClick: (e) => C(t),
1508
- onPointerdown: c[0] ||= F(() => {}, ["stop"]),
1509
- onPointermove: c[1] ||= F(() => {}, ["stop"]),
1510
- onPointerup: c[2] ||= F(() => {}, ["stop"])
1508
+ onPointerdown: c[0] ||= I(() => {}, ["stop"]),
1509
+ onPointermove: c[1] ||= I(() => {}, ["stop"]),
1510
+ onPointerup: c[2] ||= I(() => {}, ["stop"])
1511
1511
  }, [(S(), i(E(t.icon), {
1512
1512
  class: "tool-icon",
1513
1513
  "aria-hidden": "true"
1514
1514
  })), t.children && t.children.length ? (S(), o("span", {
1515
1515
  key: 0,
1516
1516
  class: g(["corner-indicator", { open: p.value === t.id }]),
1517
- onClick: F((e) => O(t.id), ["stop"]),
1517
+ onClick: I((e) => O(t.id), ["stop"]),
1518
1518
  "aria-label": "展开子菜单"
1519
1519
  }, null, 10, yr)) : a("", !0)], 42, vr), l(n, { name: "dropdown" }, {
1520
- default: M(() => [p.value === t.id && t.children && t.children.length ? (S(), o("div", {
1520
+ default: N(() => [p.value === t.id && t.children && t.children.length ? (S(), o("div", {
1521
1521
  key: 0,
1522
1522
  class: "tool-dropdown",
1523
- onPointerdown: c[3] ||= F(() => {}, ["stop"]),
1524
- onPointermove: c[4] ||= F(() => {}, ["stop"]),
1525
- onPointerup: c[5] ||= F(() => {}, ["stop"])
1523
+ onPointerdown: c[3] ||= I(() => {}, ["stop"]),
1524
+ onPointermove: c[4] ||= I(() => {}, ["stop"]),
1525
+ onPointerup: c[5] ||= I(() => {}, ["stop"])
1526
1526
  }, [(S(!0), o(e, null, T(t.children, (e) => (S(), o("button", {
1527
1527
  key: e.id,
1528
1528
  type: "button",
@@ -1543,9 +1543,9 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1543
1543
  title: "放大",
1544
1544
  "aria-label": "放大",
1545
1545
  onClick: c[6] ||= (e) => r.$emit("zoomIn"),
1546
- onPointerdown: c[7] ||= F(() => {}, ["stop"]),
1547
- onPointermove: c[8] ||= F(() => {}, ["stop"]),
1548
- onPointerup: c[9] ||= F(() => {}, ["stop"])
1546
+ onPointerdown: c[7] ||= I(() => {}, ["stop"]),
1547
+ onPointermove: c[8] ||= I(() => {}, ["stop"]),
1548
+ onPointerup: c[9] ||= I(() => {}, ["stop"])
1549
1549
  }, [l(k(Cn), {
1550
1550
  class: "tool-icon",
1551
1551
  "aria-hidden": "true"
@@ -1555,9 +1555,9 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1555
1555
  title: "缩小",
1556
1556
  "aria-label": "缩小",
1557
1557
  onClick: c[10] ||= (e) => r.$emit("zoomOut"),
1558
- onPointerdown: c[11] ||= F(() => {}, ["stop"]),
1559
- onPointermove: c[12] ||= F(() => {}, ["stop"]),
1560
- onPointerup: c[13] ||= F(() => {}, ["stop"])
1558
+ onPointerdown: c[11] ||= I(() => {}, ["stop"]),
1559
+ onPointermove: c[12] ||= I(() => {}, ["stop"]),
1560
+ onPointerup: c[13] ||= I(() => {}, ["stop"])
1561
1561
  }, [l(k(En), {
1562
1562
  class: "tool-icon",
1563
1563
  "aria-hidden": "true"
@@ -1569,9 +1569,9 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1569
1569
  title: t.isFullscreen ? "退出全屏" : "全屏显示",
1570
1570
  "aria-label": t.isFullscreen ? "退出全屏" : "全屏显示",
1571
1571
  onClick: c[14] ||= (e) => r.$emit("toggleFullscreen"),
1572
- onPointerdown: c[15] ||= F(() => {}, ["stop"]),
1573
- onPointermove: c[16] ||= F(() => {}, ["stop"]),
1574
- onPointerup: c[17] ||= F(() => {}, ["stop"])
1572
+ onPointerdown: c[15] ||= I(() => {}, ["stop"]),
1573
+ onPointermove: c[16] ||= I(() => {}, ["stop"]),
1574
+ onPointerup: c[17] ||= I(() => {}, ["stop"])
1575
1575
  }, [t.isFullscreen ? (S(), i(k(Mn), {
1576
1576
  key: 0,
1577
1577
  class: "tool-icon",
@@ -1588,9 +1588,9 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1588
1588
  title: "设置",
1589
1589
  "aria-label": "设置",
1590
1590
  onClick: A,
1591
- onPointerdown: c[18] ||= F(() => {}, ["stop"]),
1592
- onPointermove: c[19] ||= F(() => {}, ["stop"]),
1593
- onPointerup: c[20] ||= F(() => {}, ["stop"])
1591
+ onPointerdown: c[18] ||= I(() => {}, ["stop"]),
1592
+ onPointermove: c[19] ||= I(() => {}, ["stop"]),
1593
+ onPointerup: c[20] ||= I(() => {}, ["stop"])
1594
1594
  }, [l(k(Fn), {
1595
1595
  class: "tool-icon",
1596
1596
  "aria-hidden": "true"
@@ -1598,7 +1598,7 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1598
1598
  ]), l(hr, {
1599
1599
  show: m.value,
1600
1600
  onClose: c[21] ||= (e) => m.value = !1,
1601
- onConfirm: N
1601
+ onConfirm: M
1602
1602
  }, null, 8, ["show"])], 64));
1603
1603
  }
1604
1604
  }), [["__scopeId", "data-v-66411b58"]]), Er = /* @__PURE__ */ u({
@@ -1644,7 +1644,7 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1644
1644
  value: "yearly"
1645
1645
  }
1646
1646
  ], r = t;
1647
- return (t, a) => (S(), i(J, {
1647
+ return (t, a) => (S(), i(q, {
1648
1648
  "model-value": e.modelValue,
1649
1649
  options: n,
1650
1650
  label: "级别",
@@ -1653,62 +1653,354 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1653
1653
  "onUpdate:modelValue": a[0] ||= (e) => r("update:modelValue", e)
1654
1654
  }, null, 8, ["model-value"]));
1655
1655
  }
1656
- }), Dr = { class: "top-toolbar" }, Or = ["title"], kr = { class: "symbol-chip__code" }, Ar = /*#__PURE__*/ W(/* @__PURE__ */ u({
1656
+ }), Dr = {
1657
+ viewBox: "0 0 24 24",
1658
+ width: "1.2em",
1659
+ height: "1.2em"
1660
+ };
1661
+ function Or(e, t) {
1662
+ return S(), o("svg", Dr, [...t[0] ||= [s("path", {
1663
+ fill: "none",
1664
+ stroke: "currentColor",
1665
+ "stroke-linecap": "round",
1666
+ "stroke-linejoin": "round",
1667
+ "stroke-width": "2",
1668
+ d: "M12 9v4m-1.637-9.409L2.257 17.125a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636-2.87L13.637 3.59a1.914 1.914 0 0 0-3.274 0M12 16h.01"
1669
+ }, null, -1)]]);
1670
+ }
1671
+ var kr = m({
1672
+ name: "tabler-alert-triangle",
1673
+ render: Or
1674
+ }), Ar = ["title", "aria-expanded"], jr = { class: "symbol-chip__code" }, Mr = {
1675
+ key: 0,
1676
+ class: "symbol-chip__spinner",
1677
+ "aria-hidden": "true"
1678
+ }, Nr = {
1679
+ key: 0,
1680
+ class: "symbol-popover",
1681
+ role: "dialog",
1682
+ "aria-label": "切换合约"
1683
+ }, Pr = { class: "symbol-search" }, Fr = {
1684
+ class: "symbol-list",
1685
+ role: "listbox",
1686
+ "aria-label": "商品列表"
1687
+ }, Ir = {
1688
+ key: 0,
1689
+ class: "symbol-list__empty"
1690
+ }, Lr = {
1691
+ width: "32",
1692
+ height: "32",
1693
+ viewBox: "0 0 32 32",
1694
+ fill: "none",
1695
+ style: {
1696
+ "margin-bottom": "8px",
1697
+ opacity: "0.35"
1698
+ }
1699
+ }, Rr = ["aria-selected", "onClick"], zr = { class: "symbol-list__left" }, Br = { class: "symbol-list__code" }, Vr = { class: "symbol-list__desc" }, Hr = { class: "symbol-list__exchange" }, Ur = /*#__PURE__*/ W(/* @__PURE__ */ u({
1700
+ __name: "SymbolSelector",
1701
+ props: {
1702
+ symbol: {},
1703
+ symbols: {},
1704
+ loading: { type: Boolean },
1705
+ error: { type: Boolean }
1706
+ },
1707
+ emits: ["change"],
1708
+ setup(t, { emit: c }) {
1709
+ let u = t, d = c, f = w(!1), p = w(""), m = w(null), _ = w(null), b = r(() => {
1710
+ let e = p.value.trim().toLowerCase();
1711
+ return e ? u.symbols.filter((t) => t.code.toLowerCase().includes(e) || t.description.toLowerCase().includes(e) || t.exchange.toLowerCase().includes(e)) : u.symbols;
1712
+ });
1713
+ function x() {
1714
+ f.value = !f.value, f.value && h(() => m.value?.focus());
1715
+ }
1716
+ function C() {
1717
+ p.value = "", m.value?.focus();
1718
+ }
1719
+ function E() {}
1720
+ function D(e) {
1721
+ d("change", e), f.value = !1, p.value = "";
1722
+ }
1723
+ function A(e) {
1724
+ _.value && !_.value.contains(e.target) && (f.value = !1);
1725
+ }
1726
+ return y(() => document.addEventListener("mousedown", A)), v(() => document.removeEventListener("mousedown", A)), M(() => u.symbol, () => {
1727
+ f.value = !1, p.value = "";
1728
+ }), (r, c) => (S(), o("div", {
1729
+ ref_key: "chipWrapRef",
1730
+ ref: _,
1731
+ class: "symbol-chip-wrap"
1732
+ }, [s("button", {
1733
+ type: "button",
1734
+ class: g(["symbol-chip", { "is-open": f.value }]),
1735
+ title: t.symbol,
1736
+ "aria-expanded": f.value,
1737
+ "aria-haspopup": "dialog",
1738
+ onClick: x
1739
+ }, [s("span", jr, O(t.symbol), 1), t.loading ? (S(), o("span", Mr)) : t.error ? (S(), i(k(kr), {
1740
+ key: 1,
1741
+ class: "symbol-chip__warn",
1742
+ "aria-hidden": "true"
1743
+ })) : a("", !0)], 10, Ar), l(n, { name: "symbol-popover" }, {
1744
+ default: N(() => [f.value ? (S(), o("div", Nr, [s("div", Pr, [
1745
+ c[2] ||= s("span", {
1746
+ class: "symbol-search__icon",
1747
+ "aria-hidden": "true"
1748
+ }, [s("svg", {
1749
+ width: "14",
1750
+ height: "14",
1751
+ viewBox: "0 0 16 16",
1752
+ fill: "none"
1753
+ }, [s("circle", {
1754
+ cx: "6.5",
1755
+ cy: "6.5",
1756
+ r: "5",
1757
+ stroke: "currentColor",
1758
+ "stroke-width": "1.6"
1759
+ }), s("line", {
1760
+ x1: "10.5",
1761
+ y1: "10.5",
1762
+ x2: "14.5",
1763
+ y2: "14.5",
1764
+ stroke: "currentColor",
1765
+ "stroke-width": "1.6",
1766
+ "stroke-linecap": "round"
1767
+ })])], -1),
1768
+ P(s("input", {
1769
+ ref_key: "searchInputRef",
1770
+ ref: m,
1771
+ "onUpdate:modelValue": c[0] ||= (e) => p.value = e,
1772
+ class: "symbol-search__input",
1773
+ type: "text",
1774
+ placeholder: "搜索代码或名称…",
1775
+ autocomplete: "off",
1776
+ spellcheck: "false",
1777
+ "aria-label": "搜索商品",
1778
+ onInput: E
1779
+ }, null, 544), [[j, p.value]]),
1780
+ p.value ? (S(), o("button", {
1781
+ key: 0,
1782
+ type: "button",
1783
+ class: "symbol-search__clear",
1784
+ "aria-label": "清空搜索",
1785
+ onClick: C
1786
+ }, [...c[1] ||= [s("svg", {
1787
+ class: "delete-icon",
1788
+ viewBox: "0 0 24 24",
1789
+ fill: "none",
1790
+ stroke: "currentColor",
1791
+ "stroke-width": "2",
1792
+ "stroke-linecap": "round",
1793
+ "stroke-linejoin": "round",
1794
+ "aria-hidden": "true"
1795
+ }, [
1796
+ s("path", { d: "M3 6h18" }),
1797
+ s("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
1798
+ s("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
1799
+ ], -1)]])) : a("", !0)
1800
+ ]), s("div", Fr, [b.value.length === 0 ? (S(), o("div", Ir, [(S(), o("svg", Lr, [...c[3] ||= [s("circle", {
1801
+ cx: "13",
1802
+ cy: "13",
1803
+ r: "10",
1804
+ stroke: "currentColor",
1805
+ "stroke-width": "2"
1806
+ }, null, -1), s("line", {
1807
+ x1: "21",
1808
+ y1: "21",
1809
+ x2: "29",
1810
+ y2: "29",
1811
+ stroke: "currentColor",
1812
+ "stroke-width": "2",
1813
+ "stroke-linecap": "round"
1814
+ }, null, -1)]])), c[4] ||= s("span", null, "未找到相关商品", -1)])) : a("", !0), (S(!0), o(e, null, T(b.value, (e) => (S(), o("button", {
1815
+ key: e.code,
1816
+ type: "button",
1817
+ class: g(["symbol-list__item", { "is-active": e.code === t.symbol }]),
1818
+ role: "option",
1819
+ "aria-selected": e.code === t.symbol,
1820
+ onClick: (t) => D(e)
1821
+ }, [s("span", zr, [s("span", Br, O(e.code), 1), s("span", Vr, O(e.description), 1)]), s("span", Hr, O(e.exchange), 1)], 10, Rr))), 128))])])) : a("", !0)]),
1822
+ _: 1
1823
+ })], 512));
1824
+ }
1825
+ }), [["__scopeId", "data-v-e22f59e1"]]), Wr = { class: "top-toolbar" }, Gr = /*#__PURE__*/ W(/* @__PURE__ */ u({
1657
1826
  __name: "TopToolbar",
1658
1827
  props: {
1659
1828
  symbol: {},
1660
- kLineLevel: {}
1829
+ kLineLevel: {},
1830
+ symbols: {},
1831
+ symbolLoading: { type: Boolean },
1832
+ symbolError: { type: Boolean }
1661
1833
  },
1662
1834
  emits: [
1663
1835
  "addOverlaySymbol",
1664
1836
  "kLineLevelChange",
1665
- "toggleIndicator"
1837
+ "toggleIndicator",
1838
+ "symbolChange"
1666
1839
  ],
1667
1840
  setup(e, { emit: t }) {
1668
- let n = e, i = t, c = r(() => n.symbol?.trim() ?? "");
1669
- return (t, n) => (S(), o("div", Dr, [
1670
- c.value ? (S(), o("button", {
1841
+ let n = e, c = t, u = [
1842
+ {
1843
+ code: "AAPL",
1844
+ description: "Apple Inc.",
1845
+ exchange: "NASDAQ",
1846
+ source: "baostock"
1847
+ },
1848
+ {
1849
+ code: "TSLA",
1850
+ description: "Tesla, Inc.",
1851
+ exchange: "NASDAQ",
1852
+ source: "baostock"
1853
+ },
1854
+ {
1855
+ code: "GOOGL",
1856
+ description: "Alphabet Inc.",
1857
+ exchange: "NASDAQ",
1858
+ source: "baostock"
1859
+ },
1860
+ {
1861
+ code: "MSFT",
1862
+ description: "Microsoft Corporation",
1863
+ exchange: "NASDAQ",
1864
+ source: "baostock"
1865
+ },
1866
+ {
1867
+ code: "AMZN",
1868
+ description: "Amazon.com, Inc.",
1869
+ exchange: "NASDAQ",
1870
+ source: "baostock"
1871
+ },
1872
+ {
1873
+ code: "NVDA",
1874
+ description: "NVIDIA Corporation",
1875
+ exchange: "NASDAQ",
1876
+ source: "baostock"
1877
+ },
1878
+ {
1879
+ code: "META",
1880
+ description: "Meta Platforms, Inc.",
1881
+ exchange: "NASDAQ",
1882
+ source: "baostock"
1883
+ },
1884
+ {
1885
+ code: "BRK.B",
1886
+ description: "Berkshire Hathaway Inc.",
1887
+ exchange: "NYSE",
1888
+ source: "baostock"
1889
+ },
1890
+ {
1891
+ code: "JPM",
1892
+ description: "JPMorgan Chase & Co.",
1893
+ exchange: "NYSE",
1894
+ source: "baostock"
1895
+ },
1896
+ {
1897
+ code: "V",
1898
+ description: "Visa Inc.",
1899
+ exchange: "NYSE",
1900
+ source: "baostock"
1901
+ },
1902
+ {
1903
+ code: "BTCUSDT",
1904
+ description: "Bitcoin / Tether",
1905
+ exchange: "BINANCE",
1906
+ source: "baostock"
1907
+ },
1908
+ {
1909
+ code: "ETHUSDT",
1910
+ description: "Ethereum / Tether",
1911
+ exchange: "BINANCE",
1912
+ source: "baostock"
1913
+ },
1914
+ {
1915
+ code: "sh.601360",
1916
+ description: "三六零",
1917
+ exchange: "SSE",
1918
+ source: "baostock"
1919
+ },
1920
+ {
1921
+ code: "sh.600519",
1922
+ description: "贵州茅台",
1923
+ exchange: "SSE",
1924
+ source: "baostock"
1925
+ },
1926
+ {
1927
+ code: "000858",
1928
+ description: "五 粮 液",
1929
+ exchange: "SZSE",
1930
+ source: "baostock"
1931
+ },
1932
+ {
1933
+ code: "000001",
1934
+ description: "平安银行",
1935
+ exchange: "SZSE",
1936
+ source: "baostock"
1937
+ },
1938
+ {
1939
+ code: "MOCK-100",
1940
+ description: "Mock 100 条",
1941
+ exchange: "MOCK",
1942
+ source: "mock-100"
1943
+ },
1944
+ {
1945
+ code: "MOCK-10000",
1946
+ description: "Mock 10000 条",
1947
+ exchange: "MOCK",
1948
+ source: "mock-10000"
1949
+ }
1950
+ ], d = r(() => n.symbol?.trim() ?? ""), f = r(() => n.symbols && n.symbols.length ? n.symbols : u);
1951
+ function p(e) {
1952
+ c("symbolChange", e);
1953
+ }
1954
+ return (t, n) => (S(), o("div", Wr, [
1955
+ d.value ? (S(), i(Ur, {
1671
1956
  key: 0,
1672
- type: "button",
1673
- class: "symbol-chip",
1674
- title: c.value
1675
- }, [s("span", kr, O(c.value), 1)], 8, Or)) : a("", !0),
1957
+ symbol: d.value,
1958
+ symbols: f.value,
1959
+ loading: e.symbolLoading,
1960
+ error: e.symbolError,
1961
+ onChange: p
1962
+ }, null, 8, [
1963
+ "symbol",
1964
+ "symbols",
1965
+ "loading",
1966
+ "error"
1967
+ ])) : a("", !0),
1676
1968
  s("button", {
1677
1969
  type: "button",
1678
1970
  class: "overlay-symbol-button",
1679
- title: "添加叠加商品",
1680
- "aria-label": "添加叠加商品",
1681
- onClick: n[0] ||= (e) => i("addOverlaySymbol")
1971
+ title: "添加比较商品",
1972
+ "aria-label": "添加比较商品",
1973
+ onClick: n[0] ||= (e) => c("addOverlaySymbol")
1682
1974
  }, [...n[3] ||= [s("span", {
1683
1975
  class: "overlay-symbol-button__icon",
1684
1976
  "aria-hidden": "true"
1685
- }, "+", -1), s("span", { class: "overlay-symbol-button__text" }, "添加叠加商品", -1)]]),
1977
+ }, "+", -1), s("span", { class: "overlay-symbol-button__text" }, "添加比较商品", -1)]]),
1686
1978
  l(Er, {
1687
1979
  "model-value": e.kLineLevel,
1688
- "onUpdate:modelValue": n[1] ||= (e) => i("kLineLevelChange", e)
1980
+ "onUpdate:modelValue": n[1] ||= (e) => c("kLineLevelChange", e)
1689
1981
  }, null, 8, ["model-value"]),
1690
1982
  s("button", {
1691
1983
  type: "button",
1692
1984
  class: "indicator-button",
1693
1985
  title: "指标",
1694
1986
  "aria-label": "指标",
1695
- onClick: n[2] ||= (e) => i("toggleIndicator")
1987
+ onClick: n[2] ||= (e) => c("toggleIndicator")
1696
1988
  }, [...n[4] ||= [s("span", {
1697
1989
  class: "indicator-button__icon",
1698
1990
  "aria-hidden": "true"
1699
1991
  }, "fx", -1), s("span", { class: "indicator-button__text" }, "指标", -1)]])
1700
1992
  ]));
1701
1993
  }
1702
- }), [["__scopeId", "data-v-b7ad5d1c"]]), jr = ["data-theme"], Mr = {
1994
+ }), [["__scopeId", "data-v-52799f85"]]), Kr = ["data-theme"], qr = {
1703
1995
  class: "pane-separator-layer",
1704
1996
  "aria-hidden": "true"
1705
- }, Nr = {
1997
+ }, Jr = {
1706
1998
  class: "canvas-layer",
1707
1999
  ref: "canvasLayerRef"
1708
- }, Pr = {
2000
+ }, Yr = {
1709
2001
  class: "x-axis-canvas",
1710
2002
  ref: "xAxisCanvasRef"
1711
- }, Fr = 4, Ir = /*#__PURE__*/ W(/* @__PURE__ */ u({
2003
+ }, Xr = 4, Zr = /*#__PURE__*/ W(/* @__PURE__ */ u({
1712
2004
  __name: "KLineChart",
1713
2005
  props: {
1714
2006
  semanticConfig: {},
@@ -1734,27 +2026,38 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1734
2026
  "kLineLevelChange"
1735
2027
  ],
1736
2028
  setup(n, { expose: c, emit: u }) {
1737
- let d = n, f = u, p = w(d.semanticConfig.data.period);
1738
- function m(e) {
2029
+ let d = n, f = u, p = w(d.semanticConfig.data.period), m = w("选择商品"), v = w(!1), b = w(!1);
2030
+ function C(e) {
1739
2031
  p.value = e, f("kLineLevelChange", e);
1740
2032
  }
1741
- let v = w(null), b = w(null), C = w(null), E = w(null), O = w(null), k = w(null);
1742
- ke(C);
1743
- let A = D(null), M = D(null), N = w(0), P = w(0), F = w(1), I = w(d.initialZoomLevel ?? 1), L = w(0), R = w(1), ee = w(0), z = w({}), oe = w(null), B = w([]), ce = I.value;
1744
- L.value = de(ce, {
2033
+ function E(e) {
2034
+ b.value = !1, m.value = e.code, F.value?.setSymbols([{
2035
+ symbol: e.code,
2036
+ exchange: e.exchange,
2037
+ period: p.value,
2038
+ source: e.source,
2039
+ startDate: d.semanticConfig.data.startDate,
2040
+ endDate: d.semanticConfig.data.endDate,
2041
+ adjust: d.semanticConfig.data.adjust
2042
+ }]);
2043
+ }
2044
+ let O = w(null), k = w(null), A = w(null), j = w(null), N = w(null), P = w(null);
2045
+ ke(A);
2046
+ let F = D(null), I = D(null), ee = w(0), L = w(0), R = w(1), z = w(d.initialZoomLevel ?? 1), B = w(0), oe = w(1), ce = w(0), le = w({}), V = w(null), H = w([]), he = z.value;
2047
+ B.value = fe(he, {
1745
2048
  minKWidth: d.minKWidth,
1746
2049
  maxKWidth: d.maxKWidth,
1747
2050
  zoomLevelCount: d.zoomLevels,
1748
- dpr: F.value
1749
- }), R.value = ue(L.value, F.value);
1750
- let V = w("light"), H = w({}), he = r(() => {
1751
- let e = H.value.isAsiaMarket ?? !1, t = re(V.value, e);
2051
+ dpr: R.value
2052
+ }), oe.value = de(B.value, R.value);
2053
+ let ge = w("light"), _e = w({}), ve = r(() => {
2054
+ let e = _e.value.isAsiaMarket ?? !1, t = re(ge.value, e);
1752
2055
  return {
1753
2056
  upColor: t.candleUpBody,
1754
2057
  downColor: t.candleDownBody
1755
2058
  };
1756
- }), ge = r(() => {
1757
- let e = V.value === "dark" ? te : ne, t = H.value.colorPresetSettings?.[V.value];
2059
+ }), ye = r(() => {
2060
+ let e = ge.value === "dark" ? te : ne, t = _e.value.colorPresetSettings?.[ge.value];
1758
2061
  return t && Object.keys(t).length > 0 ? ie({
1759
2062
  ...e,
1760
2063
  colors: {
@@ -1763,65 +2066,47 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1763
2066
  }
1764
2067
  }) : ie(e);
1765
2068
  }), U = null;
1766
- function _e(e) {
1767
- A.value?.setTheme(e.matches ? "dark" : "light");
2069
+ function be(e) {
2070
+ F.value?.setTheme(e.matches ? "dark" : "light");
1768
2071
  }
1769
- function ve(e, t) {
2072
+ function W(e, t) {
1770
2073
  if (!(!e || !t)) if (t === "auto") {
1771
2074
  let t = window.matchMedia("(prefers-color-scheme: dark)");
1772
- e.setTheme(t.matches ? "dark" : "light"), U !== t && (U?.removeEventListener("change", _e), U = t, t.addEventListener("change", _e));
1773
- } else U?.removeEventListener("change", _e), U = null, e.setTheme(t);
2075
+ e.setTheme(t.matches ? "dark" : "light"), U !== t && (U?.removeEventListener("change", be), U = t, t.addEventListener("change", be));
2076
+ } else U?.removeEventListener("change", be), U = null, e.setTheme(t);
1774
2077
  }
1775
- function ye() {}
1776
- function be(e) {
1777
- if (H.value = e, ve(A.value, e.theme), A.value?.updateSettingsFacade(e), e.performanceTest10kKlines) {
1778
- let e = W();
1779
- console.time("updateData-10k"), A.value?.updateData(e), console.timeEnd("updateData-10k"), N.value = e.length, P.value++;
1780
- } else M.value && A.value?.getData()?.length === 1e4 && M.value.applyConfig(d.semanticConfig);
1781
- }
1782
- function W() {
1783
- let e = [], t = (/* @__PURE__ */ new Date("2020-01-01")).getTime(), n = 3e3;
1784
- for (let r = 0; r < 1e4; r++) {
1785
- let i = t + r * 864e5, a = (Math.random() - .5) * 2 * .02 + 1e-4, o = n, s = o * (1 + a), c = Math.max(o, s) * (1 + Math.random() * .01), l = Math.min(o, s) * (1 - Math.random() * .01), u = Math.floor(1e6 + Math.random() * 5e6);
1786
- e.push({
1787
- timestamp: i,
1788
- open: parseFloat(o.toFixed(2)),
1789
- high: parseFloat(c.toFixed(2)),
1790
- low: parseFloat(l.toFixed(2)),
1791
- close: parseFloat(s.toFixed(2)),
1792
- volume: u
1793
- }), n = s;
1794
- }
1795
- return e;
2078
+ function xe() {}
2079
+ function Se(e) {
2080
+ _e.value = e, W(F.value, e.theme), F.value?.updateSettingsFacade(e), F.value?.setDataFetcher(d.dataFetcher), I.value && d.semanticConfig && I.value.applyConfig(d.semanticConfig);
1796
2081
  }
1797
- function xe(e, t, n) {
2082
+ function Ce(e, t, n) {
1798
2083
  let r = e.getBoundingClientRect();
1799
2084
  return {
1800
2085
  width: Math.max(t, Math.round(r.width)),
1801
2086
  height: Math.max(n, Math.round(r.height))
1802
2087
  };
1803
2088
  }
1804
- function Se(e) {
2089
+ function we(e) {
1805
2090
  e && h(() => {
1806
2091
  if (!e.isConnected) return;
1807
- let t = xe(e, 180, 80);
1808
- A.value?.setTooltipSize(t);
2092
+ let t = Ce(e, 180, 80);
2093
+ F.value?.setTooltipSize(t);
1809
2094
  });
1810
2095
  }
1811
- function Ce(e) {
2096
+ function Te(e) {
1812
2097
  e && h(() => {
1813
- e.isConnected && (Ae.value = xe(e, 120, 60));
2098
+ e.isConnected && (Me.value = Ce(e, 120, 60));
1814
2099
  });
1815
2100
  }
1816
- let we = w({
2101
+ let G = w({
1817
2102
  x: 0,
1818
2103
  y: 0
1819
- }), G = w(!1), K = null;
2104
+ }), K = w(!1), Ee = null;
1820
2105
  function q() {
1821
- K = null;
2106
+ Ee = null;
1822
2107
  }
1823
- function Te(e) {
1824
- return K ||= e.getBoundingClientRect(), K;
2108
+ function De(e) {
2109
+ return Ee ||= e.getBoundingClientRect(), Ee;
1825
2110
  }
1826
2111
  let J = D({
1827
2112
  crosshairPos: null,
@@ -1841,14 +2126,14 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1841
2126
  isHoveringPaneBoundary: !1,
1842
2127
  hoveredPaneBoundaryId: null,
1843
2128
  isHoveringRightAxis: !1
1844
- }), Y = D(null), Ee = r(() => {
1845
- let e = oe.value;
1846
- return e ? B.value.find((t) => t.id === e) ?? null : null;
1847
- }), Oe = w([]), Ae = w({
2129
+ }), Y = D(null), Ae = r(() => {
2130
+ let e = V.value;
2131
+ return e ? H.value.find((t) => t.id === e) ?? null : null;
2132
+ }), je = w([]), Me = w({
1848
2133
  width: 220,
1849
2134
  height: 120
1850
- }), je = r(() => {
1851
- let e = v.value, t = b.value;
2135
+ }), Ne = r(() => {
2136
+ let e = O.value, t = k.value;
1852
2137
  return !e || !t ? {
1853
2138
  x: 0,
1854
2139
  y: 0
@@ -1856,86 +2141,86 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1856
2141
  x: e.offsetLeft,
1857
2142
  y: e.offsetTop
1858
2143
  };
1859
- }), Me = r(() => J.value.hoveredMarkerData), Ne = r(() => J.value.hoveredCustomMarker), Pe = r(() => J.value.isDragging), Fe = r(() => J.value.isResizingPaneBoundary), Ie = r(() => J.value.isHoveringPaneBoundary), Le = r(() => J.value.hoveredPaneBoundaryId), Re = r(() => J.value.isHoveringRightAxis), ze = r(() => J.value.hoveredIndex);
2144
+ }), Pe = r(() => J.value.hoveredMarkerData), Fe = r(() => J.value.hoveredCustomMarker), Ie = r(() => J.value.isDragging), Le = r(() => J.value.isResizingPaneBoundary), Re = r(() => J.value.isHoveringPaneBoundary), ze = r(() => J.value.hoveredPaneBoundaryId), Be = r(() => J.value.isHoveringRightAxis), Ve = r(() => J.value.hoveredIndex);
1860
2145
  r(() => J.value.crosshairIndex);
1861
- let Be = r(() => Pe.value ? "grabbing" : Fe.value || Ie.value ? "ns-resize" : ze.value === null ? "crosshair" : "pointer"), Ve = r(() => {
2146
+ let He = r(() => Ie.value ? "grabbing" : Le.value || Re.value ? "ns-resize" : Ve.value === null ? "crosshair" : "pointer"), Ue = r(() => {
1862
2147
  let e = J.value.hoveredIndex;
1863
2148
  if (typeof e != "number") return null;
1864
- P.value;
1865
- let t = A.value?.getData();
2149
+ L.value;
2150
+ let t = F.value?.getData();
1866
2151
  return t && e >= 0 && e < t.length ? t[e] : null;
1867
- }), He = r(() => J.value.hoveredIndex), Ue = r(() => J.value.tooltipPos), We = r(() => ({
1868
- x: Ue.value.x + je.value.x,
1869
- y: Ue.value.y + je.value.y
1870
- })), Ge = r(() => ({
1871
- left: `${We.value.x}px`,
1872
- top: `${We.value.y}px`
1873
- })), Ke = r(() => ({
1874
- x: we.value.x + je.value.x,
1875
- y: we.value.y + je.value.y
2152
+ }), We = r(() => J.value.hoveredIndex), Ge = r(() => J.value.tooltipPos), Ke = r(() => ({
2153
+ x: Ge.value.x + Ne.value.x,
2154
+ y: Ge.value.y + Ne.value.y
1876
2155
  })), qe = r(() => ({
1877
2156
  left: `${Ke.value.x}px`,
1878
2157
  top: `${Ke.value.y}px`
1879
- })), Je = r(() => J.value.tooltipAnchorPlacement), Ye = r(() => {
1880
- let e = A.value?.viewport.peek(), t = v.value, n = e?.plotWidth ?? (t ? t.clientWidth : 0);
1881
- return we.value.x + 12 + Ae.value.width + 12 > n ? "left-bottom" : "right-bottom";
1882
- }), Xe = r(() => (P.value, A.value?.getData() ?? []));
1883
- function Ze(e) {
1884
- Y.value?.setTool(e);
1885
- }
1886
- function Qe() {
1887
- k.value?.toggleMenu();
1888
- }
2158
+ })), Je = r(() => ({
2159
+ x: G.value.x + Ne.value.x,
2160
+ y: G.value.y + Ne.value.y
2161
+ })), Ye = r(() => ({
2162
+ left: `${Je.value.x}px`,
2163
+ top: `${Je.value.y}px`
2164
+ })), Xe = r(() => J.value.tooltipAnchorPlacement), Ze = r(() => {
2165
+ let e = F.value?.viewport.peek(), t = O.value, n = e?.plotWidth ?? (t ? t.clientWidth : 0);
2166
+ return G.value.x + 12 + Me.value.width + 12 > n ? "left-bottom" : "right-bottom";
2167
+ }), Qe = r(() => (L.value, F.value?.getData() ?? []));
1889
2168
  function $e(e) {
1890
- let t = Ee.value;
1891
- !t || !Y.value || (Y.value.updateDrawingStyle(t.id, e), B.value = Y.value.getDrawings());
2169
+ Y.value?.setTool(e);
1892
2170
  }
1893
2171
  function et() {
1894
- let e = Ee.value;
1895
- !e || !Y.value || (Y.value.removeDrawing(e.id), oe.value = null, B.value = Y.value.getDrawings());
2172
+ P.value?.toggleMenu();
1896
2173
  }
1897
2174
  function tt(e) {
1898
- A.value?.handlePointerEvent(e, { onPointerDown: (e, t) => Y.value?.onPointerDown(e, t) ? (B.value = Y.value.getDrawings(), !0) : !1 });
2175
+ let t = Ae.value;
2176
+ !t || !Y.value || (Y.value.updateDrawingStyle(t.id, e), H.value = Y.value.getDrawings());
1899
2177
  }
1900
- function nt(e) {
1901
- let t = v.value;
2178
+ function nt() {
2179
+ let e = Ae.value;
2180
+ !e || !Y.value || (Y.value.removeDrawing(e.id), V.value = null, H.value = Y.value.getDrawings());
2181
+ }
2182
+ function rt(e) {
2183
+ F.value?.handlePointerEvent(e, { onPointerDown: (e, t) => Y.value?.onPointerDown(e, t) ? (H.value = Y.value.getDrawings(), !0) : !1 });
2184
+ }
2185
+ function it(e) {
2186
+ let t = O.value;
1902
2187
  if (t) {
1903
- let n = Te(t);
1904
- we.value = {
2188
+ let n = De(t);
2189
+ G.value = {
1905
2190
  x: e.clientX - n.left,
1906
2191
  y: e.clientY - n.top
1907
2192
  };
1908
2193
  }
1909
- A.value?.handlePointerEvent(e, { onPointerMove: (e, t) => Y.value?.onPointerMove(e, t) ? (B.value = Y.value.getDrawings(), !0) : !1 });
1910
- }
1911
- function rt(e) {
1912
- A.value?.handlePointerEvent(e, { onPointerUp: (e, t) => Y.value?.onPointerUp(e, t) ? (B.value = Y.value.getDrawings(), !0) : !1 });
1913
- }
1914
- function it(e) {
1915
- A.value?.handlePointerEvent(e);
2194
+ F.value?.handlePointerEvent(e, { onPointerMove: (e, t) => Y.value?.onPointerMove(e, t) ? (H.value = Y.value.getDrawings(), !0) : !1 });
1916
2195
  }
1917
2196
  function at(e) {
1918
- A.value?.handlePointerEvent(e);
2197
+ F.value?.handlePointerEvent(e, { onPointerUp: (e, t) => Y.value?.onPointerUp(e, t) ? (H.value = Y.value.getDrawings(), !0) : !1 });
1919
2198
  }
1920
2199
  function ot(e) {
1921
- A.value?.handlePointerEvent(e);
2200
+ F.value?.handlePointerEvent(e);
1922
2201
  }
1923
2202
  function st(e) {
1924
- A.value?.handlePointerEvent(e);
2203
+ F.value?.handlePointerEvent(e);
1925
2204
  }
1926
2205
  function ct(e) {
1927
- A.value?.handlePointerEvent(e);
2206
+ F.value?.handlePointerEvent(e);
2207
+ }
2208
+ function lt(e) {
2209
+ F.value?.handlePointerEvent(e);
2210
+ }
2211
+ function ut(e) {
2212
+ F.value?.handlePointerEvent(e);
1928
2213
  }
1929
- function lt() {
1930
- A.value?.handleScrollEvent();
2214
+ function dt() {
2215
+ F.value?.handleScrollEvent();
1931
2216
  }
1932
- let ut = w([]), dt = r(() => {
2217
+ let ft = w([]), pt = r(() => {
1933
2218
  let e = [], t = /* @__PURE__ */ new Set();
1934
2219
  for (let n of Z.value) t.has(n.indicatorId) || (t.add(n.indicatorId), e.push(n.indicatorId));
1935
2220
  return e;
1936
- }), ft = r(() => [...ut.value, ...dt.value]), X = w({}), Z = w([]);
1937
- function pt() {
1938
- let e = z.value.main ?? 3;
2221
+ }), mt = r(() => [...ft.value, ...pt.value]), X = w({}), Z = w([]);
2222
+ function ht() {
2223
+ let e = le.value.main ?? 3;
1939
2224
  return Z.value.length === 0 ? [{
1940
2225
  id: "main",
1941
2226
  ratio: e,
@@ -1948,56 +2233,56 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
1948
2233
  role: "price"
1949
2234
  }, ...Z.value.map((e) => ({
1950
2235
  id: e.id,
1951
- ratio: z.value[e.id] ?? 1,
2236
+ ratio: le.value[e.id] ?? 1,
1952
2237
  visible: !0,
1953
2238
  role: "indicator"
1954
2239
  }))];
1955
2240
  }
1956
- function mt(e) {
2241
+ function gt(e) {
1957
2242
  if (e === "VOLUME") return {};
1958
2243
  let t = me(e);
1959
2244
  return t?.runtime?.defaultConfig ? { ...t.runtime.defaultConfig } : {};
1960
2245
  }
1961
- function ht(e) {
2246
+ function _t(e) {
1962
2247
  if (e === "VOLUME") return !0;
1963
2248
  let t = me(e);
1964
2249
  return !!t && t.category !== "main";
1965
2250
  }
1966
- let gt = /* @__PURE__ */ new Map();
1967
- function _t(e = "VOLUME", t) {
1968
- if (Z.value.length >= Fr) return !1;
1969
- let n = t ?? mt(e);
1970
- return !!A.value?.addIndicator(e, "sub", n);
2251
+ let vt = /* @__PURE__ */ new Map();
2252
+ function yt(e = "VOLUME", t) {
2253
+ if (Z.value.length >= Xr) return !1;
2254
+ let n = t ?? gt(e);
2255
+ return !!F.value?.addIndicator(e, "sub", n);
1971
2256
  }
1972
- function vt(e) {
1973
- A.value?.removeIndicator(e);
2257
+ function bt(e) {
2258
+ F.value?.removeIndicator(e);
1974
2259
  }
1975
- function yt() {
1976
- for (let e of Z.value) A.value?.removeIndicator(e.id);
1977
- gt.clear();
2260
+ function xt() {
2261
+ for (let e of Z.value) F.value?.removeIndicator(e.id);
2262
+ vt.clear();
1978
2263
  }
1979
- function bt() {
1980
- let e = d.semanticConfig, t = A.value;
2264
+ function St() {
2265
+ let e = d.semanticConfig, t = F.value;
1981
2266
  if (!t) return;
1982
2267
  let n = e.indicators?.main;
1983
2268
  if (n) for (let e of n) e.enabled && t.addIndicator(e.type, "main", e.params);
1984
2269
  }
1985
- function xt() {
1986
- let e = A.value?.subPanes.peek() ?? [];
2270
+ function Ct() {
2271
+ let e = F.value?.subPanes.peek() ?? [];
1987
2272
  for (let t of e) {
1988
2273
  let { paneId: e, indicatorId: n, params: r } = t, i = e.match(/^(.+)_(\d+)$/);
1989
2274
  if (i) {
1990
2275
  let [, e, t] = i, n = parseInt(t, 10);
1991
- n >= (gt.get(e) ?? 0) && gt.set(e, n + 1);
2276
+ n >= (vt.get(e) ?? 0) && vt.set(e, n + 1);
1992
2277
  }
1993
2278
  }
1994
2279
  }
1995
- function St(e, t) {
1996
- let n = mt(t);
1997
- A.value?.replaceSubPaneIndicator(e, t, n);
2280
+ function wt(e, t) {
2281
+ let n = gt(t);
2282
+ F.value?.replaceSubPaneIndicator(e, t, n);
1998
2283
  }
1999
- function Ct(e, t) {
2000
- let n = A.value;
2284
+ function Tt(e, t) {
2285
+ let n = F.value;
2001
2286
  if (n) {
2002
2287
  if ([
2003
2288
  "MA",
@@ -2019,33 +2304,33 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
2019
2304
  "STRUCTURE",
2020
2305
  "ZONES"
2021
2306
  ].includes(e)) {
2022
- let r = ut.value.find((t) => t === e);
2307
+ let r = ft.value.find((t) => t === e);
2023
2308
  t && !r ? n.addIndicator(e, "main", X.value[e]) : !t && r && n.removeIndicator(e.toUpperCase());
2024
2309
  return;
2025
2310
  }
2026
- if (ht(e)) if (t) {
2027
- if (Z.value.find((t) => t.indicatorId === e) || Z.value.length >= Fr) return;
2311
+ if (_t(e)) if (t) {
2312
+ if (Z.value.find((t) => t.indicatorId === e) || Z.value.length >= Xr) return;
2028
2313
  if (!n.addIndicator(e, "sub", X.value[e]) && Z.value.length > 0) {
2029
2314
  let t = Z.value[Z.value.length - 1];
2030
- St(t.id, e);
2315
+ wt(t.id, e);
2031
2316
  }
2032
2317
  } else Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
2033
2318
  n.removeIndicator(e.id);
2034
2319
  });
2035
2320
  }
2036
2321
  }
2037
- function wt(e, t) {
2322
+ function Et(e, t) {
2038
2323
  if (e === "MA" || e === "BOLL" || e === "EXPMA" || e === "ENE") {
2039
- A.value?.updateIndicatorParams(e, t);
2324
+ F.value?.updateIndicatorParams(e, t);
2040
2325
  return;
2041
2326
  }
2042
- ht(e) && Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
2043
- A.value?.updateIndicatorParams(e.id, t);
2327
+ _t(e) && Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
2328
+ F.value?.updateIndicatorParams(e.id, t);
2044
2329
  });
2045
2330
  }
2046
- function Tt(e) {
2331
+ function Dt(e) {
2047
2332
  if (!e.length || Z.value.length <= 1) return;
2048
- let t = e.filter((e) => ht(e));
2333
+ let t = e.filter((e) => _t(e));
2049
2334
  if (!t.length) return;
2050
2335
  let n = new Map(Z.value.map((e) => [e.indicatorId, e])), r = [];
2051
2336
  for (let e of t) {
@@ -2057,40 +2342,40 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
2057
2342
  let i = Z.value.map((e) => e.id), a = r.map((e) => e.id);
2058
2343
  if (i.join("|") === a.join("|")) return;
2059
2344
  Z.value = r;
2060
- let o = A.value;
2061
- o && o.updatePaneLayout(pt());
2345
+ let o = F.value;
2346
+ o && o.updatePaneLayout(ht());
2062
2347
  }
2063
- let Et = r(() => d.rightAxisWidth + d.priceLabelWidth), Dt = r(() => (P.value, ee.value, L.value, R.value, F.value, A.value?.getContentWidth() ?? 0));
2064
- function Ot() {
2065
- let e = v.value, t = A.value;
2348
+ let Ot = r(() => d.rightAxisWidth + d.priceLabelWidth), kt = r(() => (L.value, ce.value, B.value, oe.value, R.value, F.value?.getContentWidth() ?? 0));
2349
+ function At() {
2350
+ let e = O.value, t = F.value;
2066
2351
  if (!e || !t) return;
2067
2352
  let n = t.getData()?.length ?? 0;
2068
2353
  if (n === 0) return;
2069
- let r = t.viewport.peek().dpr, { unitPx: i, startXPx: a } = le(L.value, R.value, r), o = (a + n * i) / r, s = Math.max(0, e.scrollWidth - e.clientWidth), c = Math.min(s, Math.max(0, o - e.clientWidth));
2354
+ let r = t.viewport.peek().dpr, { unitPx: i, startXPx: a } = ue(B.value, oe.value, r), o = (a + n * i) / r, s = Math.max(0, e.scrollWidth - e.clientWidth), c = Math.min(s, Math.max(0, o - e.clientWidth));
2070
2355
  e.scrollLeft = Math.round(c * r) / r;
2071
2356
  }
2072
- function kt(e, t) {
2073
- A.value?.zoomToLevel(e, t);
2357
+ function Mt(e, t) {
2358
+ F.value?.zoomToLevel(e, t);
2074
2359
  }
2075
2360
  c({
2076
- scheduleRender: ye,
2077
- scrollToRight: Ot,
2078
- addSubPane: _t,
2079
- removeSubPane: vt,
2080
- switchSubIndicator: St,
2081
- clearAllSubPanes: yt,
2082
- zoomToLevel: kt,
2083
- zoomIn: (e) => kt(I.value + 1, e),
2084
- zoomOut: (e) => kt(I.value - 1, e),
2085
- getZoomLevel: () => I.value,
2086
- getZoomLevelCount: () => A.value?.getZoomLevelCount() ?? 10
2361
+ scheduleRender: xe,
2362
+ scrollToRight: At,
2363
+ addSubPane: yt,
2364
+ removeSubPane: bt,
2365
+ switchSubIndicator: wt,
2366
+ clearAllSubPanes: xt,
2367
+ zoomToLevel: Mt,
2368
+ zoomIn: (e) => Mt(z.value + 1, e),
2369
+ zoomOut: (e) => Mt(z.value - 1, e),
2370
+ getZoomLevel: () => z.value,
2371
+ getZoomLevelCount: () => F.value?.getZoomLevelCount() ?? 10
2087
2372
  });
2088
- function At() {
2373
+ function Nt() {
2089
2374
  return (e) => {
2090
- e.preventDefault(), A.value?.handleWheelEvent(e);
2375
+ e.preventDefault(), F.value?.handleWheelEvent(e);
2091
2376
  };
2092
2377
  }
2093
- function Mt(e, t, n, r) {
2378
+ function Pt(e, t, n, r) {
2094
2379
  return se({
2095
2380
  container: e,
2096
2381
  data: [],
@@ -2107,11 +2392,11 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
2107
2392
  maxKWidth: d.maxKWidth
2108
2393
  });
2109
2394
  }
2110
- function Nt(e) {
2395
+ function Ft(e) {
2111
2396
  let t = e.paneLayout.subscribe(() => {
2112
2397
  q();
2113
- let t = v.value && parseInt(getComputedStyle(v.value).borderTopWidth) || 0;
2114
- Oe.value = e.paneLayout.peek().slice(0, -1).map((n) => {
2398
+ let t = O.value && parseInt(getComputedStyle(O.value).borderTopWidth) || 0;
2399
+ je.value = e.paneLayout.peek().slice(0, -1).map((n) => {
2115
2400
  let r = e.getPaneInfo(n.id), i = (r?.top ?? 0) + (r?.height ?? 0);
2116
2401
  return {
2117
2402
  id: n.id,
@@ -2119,25 +2404,28 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
2119
2404
  };
2120
2405
  });
2121
2406
  }), n = e.paneRatios.subscribe(() => {
2122
- z.value = { ...e.paneRatios.peek() };
2407
+ le.value = { ...e.paneRatios.peek() };
2123
2408
  }), r = e.viewport.subscribe(() => {
2124
2409
  let t = e.viewport.peek();
2125
- F.value !== t.dpr && (F.value = t.dpr), ee.value !== t.plotWidth && (ee.value = t.plotWidth), (I.value !== t.zoomLevel || L.value !== t.kWidth || R.value !== t.kGap) && (I.value = t.zoomLevel, L.value = t.kWidth, R.value = t.kGap);
2410
+ R.value !== t.dpr && (R.value = t.dpr), ce.value !== t.plotWidth && (ce.value = t.plotWidth), (z.value !== t.zoomLevel || B.value !== t.kWidth || oe.value !== t.kGap) && (z.value = t.zoomLevel, B.value = t.kWidth, oe.value = t.kGap);
2126
2411
  let n = t.desiredScrollLeft;
2127
- n !== void 0 && n !== v.value?.scrollLeft && (q(), h(() => {
2128
- let e = v.value;
2412
+ n !== void 0 && n !== O.value?.scrollLeft && (q(), h(() => {
2413
+ let e = O.value;
2129
2414
  if (!e) return;
2130
2415
  let r = Math.max(0, e.scrollWidth - e.clientWidth), i = Math.min(Math.max(0, n), r), a = t.dpr;
2131
2416
  e.scrollLeft = Math.round(i * a) / a;
2132
2417
  }));
2133
2418
  }), i = e.data.subscribe(() => {
2134
- N.value = e.data.peek().length, P.value++;
2135
- }), a = e.theme.subscribe(() => {
2419
+ let t = e.data.peek();
2420
+ ee.value = t.length, L.value++, b.value = t.length === 0;
2421
+ }), a = e.dataLoading.subscribe(() => {
2422
+ v.value = e.dataLoading.peek();
2423
+ }), o = e.theme.subscribe(() => {
2136
2424
  let t = e.theme.peek();
2137
- V.value = t, f("themeChange", t);
2138
- }), o = e.indicators.subscribe(() => {
2425
+ ge.value = t, f("themeChange", t);
2426
+ }), s = e.indicators.subscribe(() => {
2139
2427
  let t = e.indicators.peek(), n = t.filter((e) => e.role === "main").map((e) => e.definitionId);
2140
- ut.value = n;
2428
+ ft.value = n;
2141
2429
  let r = { ...X.value };
2142
2430
  for (let e of t) e.role === "main" && e.params && Object.keys(e.params).length > 0 && (r[e.definitionId] = { ...e.params });
2143
2431
  e.updateRendererConfig("mainIndicatorLegend", { indicators: {
@@ -2158,7 +2446,7 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
2158
2446
  params: r.ENE || {}
2159
2447
  }
2160
2448
  } }), X.value = r;
2161
- }), s = e.subPanes.subscribe(() => {
2449
+ }), c = e.subPanes.subscribe(() => {
2162
2450
  let t = e.subPanes.peek(), n = new Set(t.map((e) => e.paneId)), r = Z.value.filter((e) => n.has(e.id)), i = new Set(r.map((e) => e.id));
2163
2451
  for (let e of t) i.has(e.paneId) || r.push({
2164
2452
  id: e.paneId,
@@ -2171,150 +2459,150 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
2171
2459
  X.value = a;
2172
2460
  });
2173
2461
  x(() => {
2174
- r(), i(), n(), t(), a(), o(), s(), U?.removeEventListener("change", _e);
2462
+ r(), i(), a(), n(), t(), o(), s(), c(), U?.removeEventListener("change", be);
2175
2463
  });
2176
2464
  }
2177
- function Pt(e) {
2178
- let t = O.value?.getSettings() ?? { showVolumePriceMarkers: !0 };
2179
- if (H.value = t, ve(e, t.theme), e.updateSettingsFacade(t), t.performanceTest10kKlines) {
2180
- let t = W();
2181
- console.time("updateData-10k"), e.updateData(t), console.timeEnd("updateData-10k");
2182
- }
2465
+ function It(e) {
2466
+ let t = N.value?.getSettings() ?? { showVolumePriceMarkers: !0 };
2467
+ _e.value = t, W(e, t.theme), e.updateSettingsFacade(t);
2183
2468
  }
2184
- function Ft(e) {
2469
+ function Lt(e) {
2185
2470
  Y.value = new ae(e), Y.value.setCallbacks({
2186
2471
  onDrawingCreated: (e) => {
2187
- B.value = [...B.value, e], oe.value = e.id;
2472
+ H.value = [...H.value, e], V.value = e.id;
2188
2473
  },
2189
2474
  onToolChange: () => {},
2190
2475
  onDrawingSelected: (e) => {
2191
- oe.value = e?.id ?? null;
2476
+ V.value = e?.id ?? null;
2192
2477
  }
2193
2478
  });
2194
2479
  }
2195
- function It(e) {
2196
- e.setTooltipAnchorPositioning(G.value), e.interactionState.subscribe(() => {
2480
+ function Rt(e) {
2481
+ e.setTooltipAnchorPositioning(K.value), e.interactionState.subscribe(() => {
2197
2482
  J.value = e.interactionState.peek();
2198
- }), J.value = e.interactionState.peek(), F.value = e.viewport.peek().dpr;
2483
+ }), J.value = e.interactionState.peek(), R.value = e.viewport.peek().dpr;
2199
2484
  }
2200
- function Lt(e) {
2201
- if (pe(d.dataFetcher), M.value = new fe(e), M.value.on("config:error", (e) => {
2485
+ function zt(e) {
2486
+ e.setDataFetcher(d.dataFetcher), I.value = new pe(e), I.value.on("config:error", (e) => {
2202
2487
  console.error("Semantic config error:", e);
2203
- }), M.value.on("config:ready", () => {
2204
- bt(), xt(), h(() => Ot());
2205
- }), H.value.performanceTest10kKlines) {
2206
- let e = M.value.applyIndicatorsOnly(d.semanticConfig);
2207
- e && !e.success && console.error("Semantic config apply failed:", e.errors);
2208
- } else M.value.applyConfig(d.semanticConfig).then((e) => {
2209
- e && !e.success && console.error("Semantic config apply failed:", e.errors);
2488
+ }), I.value.on("config:ready", () => {
2489
+ St(), Ct(), h(() => At());
2210
2490
  });
2211
2491
  }
2212
2492
  return y(() => {
2213
- G.value = !1;
2214
- let e = v.value, t = b.value;
2493
+ K.value = !1;
2494
+ let e = O.value, t = k.value;
2215
2495
  if (!e || !t) return;
2216
- let n = At();
2496
+ let n = Nt();
2217
2497
  e.addEventListener("wheel", n, { passive: !1 });
2218
- let r = e.querySelector(".canvas-layer"), i = e.querySelector(".x-axis-canvas"), a = Mt(e, r, t.querySelector(".right-axis-host"), i);
2219
- A.value = a, Nt(a), bt(), Pt(a), Ft(a), It(a), Lt(a);
2498
+ let r = e.querySelector(".canvas-layer"), i = e.querySelector(".x-axis-canvas"), a = Pt(e, r, t.querySelector(".right-axis-host"), i);
2499
+ F.value = a, Ft(a), St(), It(a), Lt(a), Rt(a), zt(a);
2220
2500
  }), x(() => {
2221
- let e = A.value;
2222
- e && (A.value = null, e.dispose()), Y.value = null;
2223
- }), j(() => d.yPaddingPx, (e) => {
2224
- A.value?.updateOptionsFacade({ yPaddingPx: e });
2225
- }), j(() => d.semanticConfig, async (e, t) => {
2501
+ let e = F.value;
2502
+ e && (F.value = null, e.dispose()), Y.value = null;
2503
+ }), M(() => d.yPaddingPx, (e) => {
2504
+ F.value?.updateOptionsFacade({ yPaddingPx: e });
2505
+ }), M(() => d.semanticConfig, async (e, t) => {
2226
2506
  if (e && e !== t) {
2227
- let t = await M.value?.applyConfig(e);
2507
+ let t = await I.value?.applyConfig(e);
2228
2508
  t && !t.success && console.error("Semantic config apply failed:", t.errors);
2229
2509
  }
2230
2510
  }, { deep: !0 }), (r, c) => (S(), o("div", {
2231
2511
  ref_key: "chartWrapperRef",
2232
- ref: C,
2512
+ ref: A,
2233
2513
  class: "chart-wrapper",
2234
- "data-theme": V.value,
2235
- style: _(ge.value)
2514
+ "data-theme": ge.value,
2515
+ style: _(ye.value)
2236
2516
  }, [
2237
- l(Ar, {
2238
- symbol: n.semanticConfig.data.symbol,
2517
+ l(Gr, {
2518
+ symbol: m.value,
2239
2519
  "k-line-level": p.value,
2520
+ "symbol-loading": v.value,
2521
+ "symbol-error": b.value,
2240
2522
  onAddOverlaySymbol: c[0] ||= (e) => r.$emit("addOverlaySymbol"),
2241
- onKLineLevelChange: m,
2242
- onToggleIndicator: Qe
2243
- }, null, 8, ["symbol", "k-line-level"]),
2523
+ onKLineLevelChange: C,
2524
+ onToggleIndicator: et,
2525
+ onSymbolChange: E
2526
+ }, null, 8, [
2527
+ "symbol",
2528
+ "k-line-level",
2529
+ "symbol-loading",
2530
+ "symbol-error"
2531
+ ]),
2244
2532
  s("div", { class: g(["chart-stage", {
2245
- "is-dragging": Pe.value,
2246
- "is-resizing-pane": Fe.value,
2247
- "is-hovering-pane-separator": Ie.value,
2248
- "is-hovering-right-axis": Re.value,
2249
- "is-hovering-kline": ze.value !== null
2533
+ "is-dragging": Ie.value,
2534
+ "is-resizing-pane": Le.value,
2535
+ "is-hovering-pane-separator": Re.value,
2536
+ "is-hovering-right-axis": Be.value,
2537
+ "is-hovering-kline": Ve.value !== null
2250
2538
  }]) }, [l(Tr, {
2251
2539
  ref_key: "toolbarRef",
2252
- ref: O,
2540
+ ref: N,
2253
2541
  "is-fullscreen": n.isFullscreen,
2254
- onSelectTool: Ze,
2542
+ onSelectTool: $e,
2255
2543
  onToggleFullscreen: c[1] ||= (e) => r.$emit("toggleFullscreen"),
2256
- onZoomIn: c[2] ||= (e) => kt(I.value + 1),
2257
- onZoomOut: c[3] ||= (e) => kt(I.value - 1),
2258
- onSettingsChange: be
2544
+ onZoomIn: c[2] ||= (e) => Mt(z.value + 1),
2545
+ onZoomOut: c[3] ||= (e) => Mt(z.value - 1),
2546
+ onSettingsChange: Se
2259
2547
  }, null, 8, ["is-fullscreen"]), s("div", {
2260
2548
  class: "chart-main",
2261
2549
  ref_key: "chartMainRef",
2262
- ref: b
2550
+ ref: k
2263
2551
  }, [
2264
- s("div", Mr, [(S(!0), o(e, null, T(Oe.value, (e) => (S(), o("div", {
2552
+ s("div", qr, [(S(!0), o(e, null, T(je.value, (e) => (S(), o("div", {
2265
2553
  key: e.id,
2266
- class: g(["pane-separator-line", { "is-active": Le.value === e.id }]),
2554
+ class: g(["pane-separator-line", { "is-active": ze.value === e.id }]),
2267
2555
  style: _({ top: `${e.top}px` })
2268
2556
  }, null, 6))), 128))]),
2269
2557
  s("div", {
2270
2558
  ref_key: "tooltipLayerRef",
2271
- ref: E,
2559
+ ref: j,
2272
2560
  class: "tooltip-layer"
2273
2561
  }, null, 512),
2274
2562
  s("div", {
2275
2563
  class: "chart-container",
2276
- style: _({ cursor: Be.value }),
2564
+ style: _({ cursor: He.value }),
2277
2565
  ref_key: "containerRef",
2278
- ref: v,
2279
- onScrollPassive: lt,
2280
- onPointerdown: tt,
2281
- onPointermove: nt,
2282
- onPointerup: rt,
2283
- onPointerleave: it
2566
+ ref: O,
2567
+ onScrollPassive: dt,
2568
+ onPointerdown: rt,
2569
+ onPointermove: it,
2570
+ onPointerup: at,
2571
+ onPointerleave: ot
2284
2572
  }, [s("div", {
2285
2573
  class: "scroll-content",
2286
- style: _({ width: Dt.value + "px" })
2287
- }, [s("div", Nr, [s("canvas", Pr, null, 512), Ee.value ? (S(), i(De, {
2574
+ style: _({ width: kt.value + "px" })
2575
+ }, [s("div", Jr, [s("canvas", Yr, null, 512), Ae.value ? (S(), i(Oe, {
2288
2576
  key: 0,
2289
- drawing: Ee.value,
2290
- onUpdateStyle: $e,
2291
- onDelete: et
2577
+ drawing: Ae.value,
2578
+ onUpdateStyle: tt,
2579
+ onDelete: nt
2292
2580
  }, null, 8, ["drawing"])) : a("", !0)], 512)], 4)], 36),
2293
- E.value ? (S(), i(t, {
2581
+ j.value ? (S(), i(t, {
2294
2582
  key: 0,
2295
- to: E.value
2583
+ to: j.value
2296
2584
  }, [
2297
- Ve.value ? (S(), o("div", {
2585
+ Ue.value ? (S(), o("div", {
2298
2586
  key: 0,
2299
- class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": G.value }]),
2300
- style: _(Ge.value)
2587
+ class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": K.value }]),
2588
+ style: _(qe.value)
2301
2589
  }, null, 6)) : a("", !0),
2302
- Me.value || Ne.value ? (S(), o("div", {
2590
+ Pe.value || Fe.value ? (S(), o("div", {
2303
2591
  key: 1,
2304
- class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": G.value }]),
2305
- style: _(qe.value)
2592
+ class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": K.value }]),
2593
+ style: _(Ye.value)
2306
2594
  }, null, 6)) : a("", !0),
2307
- Ve.value ? (S(), i(Kt, {
2595
+ Ue.value ? (S(), i(Kt, {
2308
2596
  key: 2,
2309
- k: Ve.value,
2310
- index: He.value,
2311
- data: Xe.value,
2312
- pos: We.value,
2313
- "set-el": Se,
2314
- "use-anchor": G.value,
2315
- "anchor-placement": Je.value,
2316
- "up-color": he.value.upColor,
2317
- "down-color": he.value.downColor
2597
+ k: Ue.value,
2598
+ index: We.value,
2599
+ data: Qe.value,
2600
+ pos: Ke.value,
2601
+ "set-el": we,
2602
+ "use-anchor": K.value,
2603
+ "anchor-placement": Xe.value,
2604
+ "up-color": ve.value.upColor,
2605
+ "down-color": ve.value.downColor
2318
2606
  }, null, 8, [
2319
2607
  "k",
2320
2608
  "index",
@@ -2325,13 +2613,13 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
2325
2613
  "up-color",
2326
2614
  "down-color"
2327
2615
  ])) : a("", !0),
2328
- Me.value || Ne.value ? (S(), i(Yt, {
2616
+ Pe.value || Fe.value ? (S(), i(Yt, {
2329
2617
  key: 3,
2330
- marker: Me.value || Ne.value,
2331
- pos: Ke.value,
2332
- "use-anchor": G.value,
2333
- "anchor-placement": Ye.value,
2334
- "set-el": Ce
2618
+ marker: Pe.value || Fe.value,
2619
+ pos: Je.value,
2620
+ "use-anchor": K.value,
2621
+ "anchor-placement": Ze.value,
2622
+ "set-el": Te
2335
2623
  }, null, 8, [
2336
2624
  "marker",
2337
2625
  "pos",
@@ -2342,27 +2630,27 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
2342
2630
  s("div", {
2343
2631
  class: "right-axis-host",
2344
2632
  ref: "rightAxisLayerRef",
2345
- style: _({ width: Et.value + "px" }),
2346
- onPointerdown: at,
2347
- onPointermove: ot,
2348
- onPointerup: st,
2349
- onPointerleave: ct
2633
+ style: _({ width: Ot.value + "px" }),
2634
+ onPointerdown: st,
2635
+ onPointermove: ct,
2636
+ onPointerup: lt,
2637
+ onPointerleave: ut
2350
2638
  }, null, 36)
2351
2639
  ], 512)], 2),
2352
2640
  l(jt, {
2353
2641
  ref_key: "indicatorSelectorRef",
2354
- ref: k,
2355
- "active-indicators": ft.value,
2642
+ ref: P,
2643
+ "active-indicators": mt.value,
2356
2644
  "indicator-params": X.value,
2357
- onToggle: Ct,
2358
- onUpdateParams: wt,
2359
- onReorderSubIndicators: Tt
2645
+ onToggle: Tt,
2646
+ onUpdateParams: Et,
2647
+ onReorderSubIndicators: Dt
2360
2648
  }, null, 8, ["active-indicators", "indicator-params"])
2361
- ], 12, jr));
2649
+ ], 12, Kr));
2362
2650
  }
2363
- }), [["__scopeId", "data-v-bfe6c39c"]]), Lr = {
2651
+ }), [["__scopeId", "data-v-67f73cf1"]]), Qr = {
2364
2652
  name: "@363045841yyt/klinechart",
2365
- version: "0.8.0",
2653
+ version: "0.8.1-alpha.2",
2366
2654
  description: "Vue 3 bindings for @363045841yyt/klinechart-core. Idiomatic composables, SFC components.",
2367
2655
  license: "MIT",
2368
2656
  repository: {
@@ -2434,14 +2722,14 @@ var sr = { class: "settings-body" }, cr = { class: "settings-label" }, lr = ["on
2434
2722
  vitest: "^4.1.8",
2435
2723
  vue: "^3.5.35"
2436
2724
  }
2437
- }.version, Rr = null;
2438
- function zr(e) {
2439
- Rr = e;
2725
+ }.version, $r = null;
2726
+ function ei(e) {
2727
+ $r = e;
2440
2728
  }
2441
- function Br(e) {
2729
+ function ti(e) {
2442
2730
  if (e.container == null) throw Error("[@363045841yyt/klinechart] createChart: `container` is required and must be a non-null HTMLElement");
2443
- if (Rr === null) throw Error("[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).");
2444
- return Rr(e);
2731
+ if ($r === null) throw Error("[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).");
2732
+ return $r(e);
2445
2733
  }
2446
2734
  function $(e) {
2447
2735
  let t = D(e.peek());
@@ -2449,15 +2737,15 @@ function $(e) {
2449
2737
  t.value = e.peek();
2450
2738
  })), t;
2451
2739
  }
2452
- function Vr(e, t) {
2740
+ function ni(e, t) {
2453
2741
  let n = D(null), r = (e) => {
2454
- e == null || n.value != null || (n.value = Br({
2742
+ e == null || n.value != null || (n.value = ti({
2455
2743
  ...t,
2456
2744
  container: e
2457
2745
  }));
2458
2746
  };
2459
2747
  r(e.value);
2460
- let i = j(e, (e) => {
2748
+ let i = M(e, (e) => {
2461
2749
  r(e);
2462
2750
  }, {
2463
2751
  immediate: !0,
@@ -2469,7 +2757,7 @@ function Vr(e, t) {
2469
2757
  };
2470
2758
  return b(a), v(a), { chart: n };
2471
2759
  }
2472
- function Hr(e) {
2760
+ function ri(e) {
2473
2761
  let t = D(e.indicators.peek());
2474
2762
  return b(e.indicators.subscribe(() => {
2475
2763
  t.value = e.indicators.peek();
@@ -2480,26 +2768,26 @@ function Hr(e) {
2480
2768
  updateParams: e.updateIndicatorParams.bind(e)
2481
2769
  };
2482
2770
  }
2483
- function Ur(e) {
2771
+ function ii(e) {
2484
2772
  let t = D(e.interactionState.peek());
2485
2773
  return b(e.interactionState.subscribe(() => {
2486
2774
  t.value = e.interactionState.peek();
2487
2775
  })), t;
2488
2776
  }
2489
- function Wr(e) {
2777
+ function ai(e) {
2490
2778
  let t = D(e.paneRatios.peek());
2491
2779
  return b(e.paneRatios.subscribe(() => {
2492
2780
  t.value = e.paneRatios.peek();
2493
2781
  })), t;
2494
2782
  }
2495
- function Gr(e) {
2783
+ function oi(e) {
2496
2784
  let t = D(e.viewport.peek());
2497
2785
  return b(e.viewport.subscribe(() => {
2498
2786
  t.value = e.viewport.peek();
2499
2787
  })), t;
2500
2788
  }
2501
- function Kr(e) {
2502
- let t = ee({ catalog: e.catalog });
2789
+ function si(e) {
2790
+ let t = z({ catalog: e.catalog });
2503
2791
  b(() => t.dispose());
2504
2792
  let n = $(t.filteredMain), r = $(t.filteredSub), i = $(t.menuOpen), a = $(t.searchQuery);
2505
2793
  function o(t) {
@@ -2527,7 +2815,7 @@ function Kr(e) {
2527
2815
  isActive: c
2528
2816
  };
2529
2817
  }
2530
- var qr = u({
2818
+ var ci = u({
2531
2819
  name: "KLineChart",
2532
2820
  props: {
2533
2821
  data: {
@@ -2560,7 +2848,7 @@ var qr = u({
2560
2848
  y(() => {
2561
2849
  let n = r.value;
2562
2850
  n != null && (i.run(() => {
2563
- if (a.value = Br({
2851
+ if (a.value = ti({
2564
2852
  container: n,
2565
2853
  data: e.data,
2566
2854
  initialZoomLevel: e.initialZoomLevel,
@@ -2574,9 +2862,9 @@ var qr = u({
2574
2862
  };
2575
2863
  n(), b(e.viewport.subscribe(n));
2576
2864
  }
2577
- }), j(() => e.data, (e) => {
2865
+ }), M(() => e.data, (e) => {
2578
2866
  a.value?.setData(e);
2579
- }), j(() => e.theme, (e) => {
2867
+ }), M(() => e.theme, (e) => {
2580
2868
  a.value?.setTheme(e);
2581
2869
  }));
2582
2870
  }), x(() => {
@@ -2606,9 +2894,9 @@ var qr = u({
2606
2894
  }
2607
2895
  });
2608
2896
  }
2609
- }), Jr = { install(e) {
2610
- e.component("KLineChart", qr);
2897
+ }), li = { install(e) {
2898
+ e.component("KLineChart", ci);
2611
2899
  } };
2612
- zr(R);
2900
+ ei(R);
2613
2901
  //#endregion
2614
- export { L as CORE_VERSION, De as DrawingStyleToolbar, Je as IndicatorParams, jt as IndicatorSelector, qr as KLineChart, Ir as KLineChartVue, Kt as KLineTooltip, Jr as KMapPlugin, Tr as LeftToolbar, Yt as MarkerTooltip, Lr as VERSION, zr as __setControllerFactory, $ as coreSignalToVueRef, Br as createChart, Vr as useChart, Kr as useIndicatorSelector, Hr as useIndicators, Ur as useInteractionState, Wr as usePaneRatios, Gr as useViewport };
2902
+ export { L as CORE_VERSION, Oe as DrawingStyleToolbar, Je as IndicatorParams, jt as IndicatorSelector, ci as KLineChart, Zr as KLineChartVue, Kt as KLineTooltip, li as KMapPlugin, Tr as LeftToolbar, Yt as MarkerTooltip, Qr as VERSION, ei as __setControllerFactory, $ as coreSignalToVueRef, ti as createChart, ni as useChart, si as useIndicatorSelector, ri as useIndicators, ii as useInteractionState, ai as usePaneRatios, oi as useViewport };