@363045841yyt/klinechart 0.7.5 → 0.7.6

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,21 +1,13 @@
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, ref as C, renderList as w, resolveDynamicComponent as T, shallowRef as E, toDisplayString as D, unref as O, vModelCheckbox as k, vModelSelect as A, watch as j, withCtx as M, withDirectives as N, withModifiers as P } from "vue";
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 ee, onScopeDispose as y, onUnmounted as b, openBlock as x, provide as S, ref as C, renderList as w, resolveDynamicComponent as T, shallowRef as E, toDisplayString as D, unref as O, vModelCheckbox as k, vModelSelect as A, watch as j, withCtx as M, withDirectives as N, withModifiers as P } from "vue";
2
2
  import { VERSION as F, createChartController as I, createIndicatorSelectorController as L } from "@363045841yyt/klinechart-core";
3
- import { allIndicators as R, findIndicator as z, isSubIndicatorId as B } from "@363045841yyt/klinechart-core/engine/renderers/Indicator/indicatorData";
4
- import { createIndicatorSelectorController as ee } from "@363045841yyt/klinechart-core/controllers";
5
- import { SemanticChartController as V, __setDataFetcher as te } from "@363045841yyt/klinechart-core/semantic";
6
- import { Chart as H } from "@363045841yyt/klinechart-core/engine/chart";
7
- import { createChartStore as ne } from "@363045841yyt/klinechart-core/engine/chart-store";
8
- import { kGapFromKWidth as U, zoomLevelToKWidth as re } from "@363045841yyt/klinechart-core/engine/utils/zoom";
9
- import { getPhysicalKLineConfig as W } from "@363045841yyt/klinechart-core/engine/utils/klineConfig";
10
- import { SUB_PANE_INDICATORS as ie, SUB_PANE_INDICATOR_CONFIGS as ae } from "@363045841yyt/klinechart-core/engine/renderers/Indicator/subPaneConfig";
11
- import { createPaneTitleRendererPlugin as oe } from "@363045841yyt/klinechart-core/engine/renderers/paneTitle";
12
- import { DEFAULT_SETTINGS as G, SETTINGS_STORAGE_KEY as se } from "@363045841yyt/klinechart-core/config";
13
- import { DrawingInteractionController as ce } from "@363045841yyt/klinechart-core/engine/drawing";
3
+ import { DrawingInteractionController as te, SUB_PANE_INDICATORS as R, SUB_PANE_INDICATOR_CONFIGS as ne, allIndicators as re, createChartController as z, createIndicatorSelectorController as B, findIndicator as ie, getPhysicalKLineConfig as ae, isSubIndicatorId as V, kGapFromKWidth as H, zoomLevelToKWidth as oe } from "@363045841yyt/klinechart-core/controllers";
4
+ import { SemanticChartController as se, __setDataFetcher as ce } from "@363045841yyt/klinechart-core/semantic";
5
+ import { DEFAULT_SETTINGS as U, SETTINGS_STORAGE_KEY as le } from "@363045841yyt/klinechart-core/config";
14
6
  //#region src/components/DrawingStyleToolbar.vue?vue&type=script&setup=true&lang.ts
15
- var le = {
7
+ var ue = {
16
8
  class: "toolbar-item color-item",
17
9
  title: "颜色"
18
- }, ue = ["value"], de = ["value"], K = ["value"], fe = /* @__PURE__ */ u({
10
+ }, de = ["value"], W = ["value"], G = ["value"], K = /* @__PURE__ */ u({
19
11
  __name: "DrawingStyleToolbar",
20
12
  props: { drawing: {} },
21
13
  emits: ["updateStyle", "delete"],
@@ -24,7 +16,7 @@ var le = {
24
16
  function r(e) {
25
17
  e.key === "Delete" && (e.preventDefault(), n("delete"));
26
18
  }
27
- y(() => document.addEventListener("keydown", r)), x(() => document.removeEventListener("keydown", r));
19
+ ee(() => document.addEventListener("keydown", r)), b(() => document.removeEventListener("keydown", r));
28
20
  function i(e) {
29
21
  n("updateStyle", { stroke: e });
30
22
  }
@@ -34,13 +26,13 @@ var le = {
34
26
  function c(e) {
35
27
  n("updateStyle", { strokeStyle: e });
36
28
  }
37
- return (t, n) => (S(), o("div", {
29
+ return (t, n) => (x(), o("div", {
38
30
  class: "drawing-style-toolbar",
39
31
  onPointerdown: n[4] ||= P(() => {}, ["stop"]),
40
32
  onPointermove: n[5] ||= P(() => {}, ["stop"]),
41
33
  onPointerup: n[6] ||= P(() => {}, ["stop"])
42
34
  }, [
43
- s("div", le, [s("span", {
35
+ s("div", ue, [s("span", {
44
36
  class: "color-swatch",
45
37
  style: _({ background: e.drawing.style.stroke ?? "#2962ff" })
46
38
  }, null, 4), s("input", {
@@ -48,7 +40,7 @@ var le = {
48
40
  class: "color-input",
49
41
  value: e.drawing.style.stroke ?? "#2962ff",
50
42
  onInput: n[0] ||= (e) => i(e.target.value)
51
- }, null, 40, ue)]),
43
+ }, null, 40, de)]),
52
44
  s("select", {
53
45
  class: "toolbar-select",
54
46
  value: e.drawing.style.strokeWidth ?? 1,
@@ -59,7 +51,7 @@ var le = {
59
51
  s("option", { value: 2 }, "2px", -1),
60
52
  s("option", { value: 3 }, "3px", -1),
61
53
  s("option", { value: 4 }, "4px", -1)
62
- ]], 40, de),
54
+ ]], 40, W),
63
55
  s("select", {
64
56
  class: "toolbar-select",
65
57
  value: e.drawing.style.strokeStyle ?? "solid",
@@ -69,7 +61,7 @@ var le = {
69
61
  s("option", { value: "solid" }, "实线", -1),
70
62
  s("option", { value: "dashed" }, "虚线", -1),
71
63
  s("option", { value: "dotted" }, "点线", -1)
72
- ]], 40, K),
64
+ ]], 40, G),
73
65
  s("button", {
74
66
  type: "button",
75
67
  class: "toolbar-btn delete-btn",
@@ -95,22 +87,32 @@ var le = {
95
87
  let n = e.__vccOpts || e;
96
88
  for (let [e, r] of t) n[e] = r;
97
89
  return n;
98
- }, pe = /* @__PURE__ */ q(fe, [["__scopeId", "data-v-4c26f819"]]), me = { class: "params-header" }, J = { class: "header-left" }, Y = { class: "params-title" }, he = { class: "header-right" }, ge = {
90
+ }, fe = /* @__PURE__ */ q(K, [["__scopeId", "data-v-a2cb0547"]]), pe = Symbol("fullscreen-teleport-target");
91
+ function me(e) {
92
+ S(pe, e);
93
+ }
94
+ function J() {
95
+ let e = p(pe, null);
96
+ return r(() => e?.value ?? "body");
97
+ }
98
+ //#endregion
99
+ //#region src/components/IndicatorParams.vue?vue&type=script&setup=true&lang.ts
100
+ var Y = { class: "params-header" }, he = { class: "header-left" }, ge = { class: "params-title" }, _e = { class: "header-right" }, ve = {
99
101
  key: 0,
100
102
  class: "indicator-description"
101
- }, _e = { class: "params-body" }, ve = { class: "param-header" }, ye = { class: "param-label" }, be = { class: "param-label-text" }, xe = {
103
+ }, ye = { class: "params-body" }, be = { class: "param-header" }, xe = { class: "param-label" }, Se = { class: "param-label-text" }, Ce = {
102
104
  key: 0,
103
105
  class: "param-range"
104
- }, Se = { class: "input-wrapper" }, Ce = ["disabled", "onClick"], we = [
106
+ }, we = { class: "input-wrapper" }, Te = ["disabled", "onClick"], Ee = [
105
107
  "value",
106
108
  "min",
107
109
  "max",
108
110
  "step",
109
111
  "onInput"
110
- ], Te = ["disabled", "onClick"], Ee = {
112
+ ], De = ["disabled", "onClick"], Oe = {
111
113
  key: 0,
112
114
  class: "param-description"
113
- }, De = { class: "params-footer" }, Oe = { class: "footer-right" }, ke = /* @__PURE__ */ q(/* @__PURE__ */ u({
115
+ }, ke = { class: "params-footer" }, Ae = { class: "footer-right" }, je = /* @__PURE__ */ q(/* @__PURE__ */ u({
114
116
  __name: "IndicatorParams",
115
117
  props: {
116
118
  visible: { type: Boolean },
@@ -121,53 +123,53 @@ var le = {
121
123
  values: {}
122
124
  },
123
125
  emits: ["close", "confirm"],
124
- setup(u, { emit: d }) {
125
- let f = u, p = d, m = C({ ...f.values }), h = C(!0), _ = r(() => "body");
126
- j(() => f.values, (e) => {
127
- m.value = { ...e };
126
+ setup(r, { emit: u }) {
127
+ let d = r, f = u, p = C({ ...d.values }), m = C(!0), h = J();
128
+ j(() => d.values, (e) => {
129
+ p.value = { ...e };
128
130
  }, {
129
131
  deep: !0,
130
132
  immediate: !0
131
- }), j(() => f.visible, (e) => {
132
- e && (m.value = { ...f.values });
133
+ }), j(() => d.visible, (e) => {
134
+ e && (p.value = { ...d.values });
133
135
  });
134
- function v(e, t) {
136
+ function _(e, t) {
135
137
  let n = t.target, r = parseFloat(n.value);
136
- isNaN(r) || (m.value[e] = r);
138
+ isNaN(r) || (p.value[e] = r);
137
139
  }
138
- function y(e, t) {
139
- let n = e.step || 1, r = (m.value[e.key] || 0) + t * n;
140
- e.min !== void 0 && (r = Math.max(e.min, r)), e.max !== void 0 && (r = Math.min(e.max, r)), m.value[e.key] = parseFloat(r.toFixed(10));
140
+ function v(e, t) {
141
+ let n = e.step || 1, r = (p.value[e.key] || 0) + t * n;
142
+ e.min !== void 0 && (r = Math.max(e.min, r)), e.max !== void 0 && (r = Math.min(e.max, r)), p.value[e.key] = parseFloat(r.toFixed(10));
141
143
  }
142
- function b() {
144
+ function ee() {
143
145
  let e = {};
144
- f.params.forEach((t) => {
145
- e[t.key] = t.default ?? f.values[t.key] ?? 0;
146
- }), m.value = e;
146
+ d.params.forEach((t) => {
147
+ e[t.key] = t.default ?? d.values[t.key] ?? 0;
148
+ }), p.value = e;
147
149
  }
148
- function x() {
149
- p("confirm", { ...m.value });
150
+ function y() {
151
+ f("confirm", { ...p.value });
150
152
  }
151
- return (r, d) => (S(), i(t, { to: _.value }, [l(n, { name: "overlay" }, {
152
- default: M(() => [u.visible ? (S(), o("div", {
153
+ return (u, d) => (x(), i(t, { to: O(h) }, [l(n, { name: "overlay" }, {
154
+ default: M(() => [r.visible ? (x(), o("div", {
153
155
  key: 0,
154
156
  class: "params-overlay",
155
- onClick: d[4] ||= (e) => r.$emit("close")
157
+ onClick: d[4] ||= (e) => u.$emit("close")
156
158
  }, [l(n, { name: "modal" }, {
157
159
  default: M(() => [s("div", {
158
160
  class: "indicator-params",
159
161
  onClick: d[3] ||= P(() => {}, ["stop"])
160
162
  }, [
161
- s("div", me, [s("div", J, [s("span", Y, D(u.indicatorName), 1), d[5] ||= s("span", { class: "params-subtitle" }, "参数设置", -1)]), s("div", he, [s("button", {
162
- class: g(["toggle-desc-btn", { active: h.value }]),
163
- onClick: d[0] ||= (e) => h.value = !h.value,
163
+ s("div", Y, [s("div", he, [s("span", ge, D(r.indicatorName), 1), d[5] ||= s("span", { class: "params-subtitle" }, "参数设置", -1)]), s("div", _e, [s("button", {
164
+ class: g(["toggle-desc-btn", { active: m.value }]),
165
+ onClick: d[0] ||= (e) => m.value = !m.value,
164
166
  title: "显示/隐藏说明"
165
167
  }, [...d[6] ||= [s("svg", { viewBox: "0 0 1024 1024" }, [s("path", {
166
168
  d: "M512 97.52381c228.912762 0 414.47619 185.563429 414.47619 414.47619s-185.563429 414.47619-414.47619 414.47619S97.52381 740.912762 97.52381 512 283.087238 97.52381 512 97.52381z m0 73.142857C323.486476 170.666667 170.666667 323.486476 170.666667 512s152.81981 341.333333 341.333333 341.333333 341.333333-152.81981 341.333333-341.333333S700.513524 170.666667 512 170.666667z m36.571429 268.190476v292.571428h-73.142858V438.857143h73.142858z m0-121.904762v73.142857h-73.142858v-73.142857h73.142858z",
167
169
  fill: "currentColor"
168
170
  })], -1)]], 2), s("button", {
169
171
  class: "params-close",
170
- onClick: d[1] ||= (e) => r.$emit("close")
172
+ onClick: d[1] ||= (e) => u.$emit("close")
171
173
  }, [...d[7] ||= [s("svg", {
172
174
  viewBox: "0 0 24 24",
173
175
  fill: "none",
@@ -175,51 +177,51 @@ var le = {
175
177
  "stroke-width": "2"
176
178
  }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
177
179
  l(n, { name: "slide" }, {
178
- default: M(() => [h.value && u.indicatorDescription ? (S(), o("div", ge, [s("p", null, D(u.indicatorDescription), 1)])) : a("", !0)]),
180
+ default: M(() => [m.value && r.indicatorDescription ? (x(), o("div", ve, [s("p", null, D(r.indicatorDescription), 1)])) : a("", !0)]),
179
181
  _: 1
180
182
  }),
181
- s("div", _e, [(S(!0), o(e, null, w(u.params, (e) => (S(), o("div", {
183
+ s("div", ye, [(x(!0), o(e, null, w(r.params, (e) => (x(), o("div", {
182
184
  key: e.key,
183
- class: g(["param-item", { "has-desc": h.value && e.description }])
184
- }, [s("div", ve, [s("label", ye, [s("span", be, D(e.label), 1), e.min !== void 0 || e.max !== void 0 ? (S(), o("span", xe, D(e.min ?? "-∞") + " ~ " + D(e.max ?? "+∞"), 1)) : a("", !0)]), s("div", Se, [
185
+ class: g(["param-item", { "has-desc": m.value && e.description }])
186
+ }, [s("div", be, [s("label", xe, [s("span", Se, D(e.label), 1), e.min !== void 0 || e.max !== void 0 ? (x(), o("span", Ce, D(e.min ?? "-∞") + " ~ " + D(e.max ?? "+∞"), 1)) : a("", !0)]), s("div", we, [
185
187
  s("button", {
186
188
  class: "stepper-btn",
187
- disabled: e.min !== void 0 && (m.value[e.key] ?? 0) <= e.min,
188
- onClick: (t) => y(e, -1)
189
- }, " − ", 8, Ce),
190
- e.type === "number" ? (S(), o("input", {
189
+ disabled: e.min !== void 0 && (p.value[e.key] ?? 0) <= e.min,
190
+ onClick: (t) => v(e, -1)
191
+ }, " − ", 8, Te),
192
+ e.type === "number" ? (x(), o("input", {
191
193
  key: 0,
192
194
  type: "number",
193
195
  class: "param-input",
194
- value: m.value[e.key],
196
+ value: p.value[e.key],
195
197
  min: e.min,
196
198
  max: e.max,
197
199
  step: e.step || 1,
198
- onInput: (t) => v(e.key, t)
199
- }, null, 40, we)) : a("", !0),
200
+ onInput: (t) => _(e.key, t)
201
+ }, null, 40, Ee)) : a("", !0),
200
202
  s("button", {
201
203
  class: "stepper-btn",
202
- disabled: e.max !== void 0 && (m.value[e.key] ?? 0) >= e.max,
203
- onClick: (t) => y(e, 1)
204
- }, " + ", 8, Te)
204
+ disabled: e.max !== void 0 && (p.value[e.key] ?? 0) >= e.max,
205
+ onClick: (t) => v(e, 1)
206
+ }, " + ", 8, De)
205
207
  ])]), l(n, { name: "slide" }, {
206
- default: M(() => [h.value && e.description ? (S(), o("div", Ee, D(e.description), 1)) : a("", !0)]),
208
+ default: M(() => [m.value && e.description ? (x(), o("div", Oe, D(e.description), 1)) : a("", !0)]),
207
209
  _: 2
208
210
  }, 1024)], 2))), 128))]),
209
- s("div", De, [s("button", {
211
+ s("div", ke, [s("button", {
210
212
  class: "params-btn reset",
211
- onClick: b
213
+ onClick: ee
212
214
  }, [...d[8] ||= [s("svg", {
213
215
  viewBox: "0 0 24 24",
214
216
  fill: "none",
215
217
  stroke: "currentColor",
216
218
  "stroke-width": "2"
217
- }, [s("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), s("path", { d: "M3 3v5h5" })], -1), c(" 重置 ", -1)]]), s("div", Oe, [s("button", {
219
+ }, [s("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), s("path", { d: "M3 3v5h5" })], -1), c(" 重置 ", -1)]]), s("div", Ae, [s("button", {
218
220
  class: "params-btn cancel",
219
- onClick: d[2] ||= (e) => r.$emit("close")
221
+ onClick: d[2] ||= (e) => u.$emit("close")
220
222
  }, "取消"), s("button", {
221
223
  class: "params-btn confirm",
222
- onClick: x
224
+ onClick: y
223
225
  }, [...d[9] ||= [s("svg", {
224
226
  viewBox: "0 0 24 24",
225
227
  fill: "none",
@@ -232,14 +234,7 @@ var le = {
232
234
  _: 1
233
235
  })], 8, ["to"]));
234
236
  }
235
- }), [["__scopeId", "data-v-b82e9094"]]), Ae = Symbol("fullscreen-teleport-target");
236
- function je() {
237
- let e = p(Ae, null);
238
- return r(() => e?.value ?? "body");
239
- }
240
- //#endregion
241
- //#region src/components/IndicatorSelector.vue?vue&type=script&setup=true&lang.ts
242
- var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-container" }, Pe = { class: "indicator-list" }, Fe = {
237
+ }), [["__scopeId", "data-v-ea905f9b"]]), Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-container" }, Pe = { class: "indicator-list" }, Fe = {
243
238
  key: 0,
244
239
  class: "indicator-divider",
245
240
  "aria-hidden": "true"
@@ -269,10 +264,10 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
269
264
  width: "16",
270
265
  height: "16",
271
266
  fill: "currentColor"
272
- }, Ze = { class: "modal-body" }, Qe = { class: "search-box" }, $e = ["value"], X = {
267
+ }, Ze = { class: "modal-body" }, Qe = { class: "search-box" }, X = ["value"], Z = {
273
268
  key: 0,
274
269
  class: "indicator-section"
275
- }, Z = { class: "section-header" }, et = { class: "section-count" }, tt = ["onClick"], nt = { class: "card-label" }, rt = { class: "card-tooltip" }, it = { class: "card-header" }, at = { class: "card-label" }, ot = { class: "card-header-actions" }, st = ["onClick"], ct = { class: "card-name" }, lt = {
270
+ }, $e = { class: "section-header" }, et = { class: "section-count" }, tt = ["onClick"], nt = { class: "card-label" }, rt = { class: "card-tooltip" }, it = { class: "card-header" }, at = { class: "card-label" }, ot = { class: "card-header-actions" }, st = ["onClick"], ct = { class: "card-name" }, lt = {
276
271
  key: 1,
277
272
  class: "section-divider"
278
273
  }, ut = {
@@ -312,23 +307,23 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
312
307
  }))
313
308
  }));
314
309
  }
315
- let h = ee({ catalog: m(R) }), _ = $(h.menuOpen), v = $(h.searchQuery), b = $(h.filteredMain), T = $(h.filteredSub), E = r(() => b.value.length > 0 || T.value.length > 0), k = h.catalog.peek().length, A = C(null), j = C(!1), N = C(null), F = C(null), I = C(null), L = C(null), V = C(!1), te = je(), H = r(() => f.activeIndicators?.length ? f.activeIndicators.map((e) => z(e)).filter((e) => e !== void 0).sort((e, t) => e.pane === t.pane ? 0 : e.pane === "main" ? -1 : 1) : []), ne = r(() => H.value.some((e) => e.pane === "main") ? H.value.find((e) => e.pane === "sub")?.id ?? null : null), U = r(() => N.value ? z(N.value) : null), re = r(() => f.activeIndicators?.length ?? 0);
316
- function W(e) {
310
+ let h = B({ catalog: m(re) }), _ = $(h.menuOpen), v = $(h.searchQuery), y = $(h.filteredMain), S = $(h.filteredSub), T = r(() => y.value.length > 0 || S.value.length > 0), E = h.catalog.peek().length, k = C(null), A = C(!1), j = C(null), N = C(null), F = C(null), I = C(null), L = C(!1), te = J(), R = r(() => f.activeIndicators?.length ? f.activeIndicators.map((e) => ie(e)).filter((e) => e !== void 0).sort((e, t) => e.pane === t.pane ? 0 : e.pane === "main" ? -1 : 1) : []), ne = r(() => R.value.some((e) => e.pane === "main") ? R.value.find((e) => e.pane === "sub")?.id ?? null : null), z = r(() => j.value ? ie(j.value) : null), ae = r(() => f.activeIndicators?.length ?? 0);
311
+ function H(e) {
317
312
  return f.activeIndicators?.includes(e) ?? !1;
318
313
  }
319
- function ie(e) {
320
- if (W(e)) return;
321
- let t = z(e);
322
- t && (t.pane === "main" && R.filter((t) => t.id !== e && W(t.id) && t.pane === "main").forEach((e) => p("toggle", e.id, !1)), p("toggle", e, !0));
314
+ function oe(e) {
315
+ if (H(e)) return;
316
+ let t = ie(e);
317
+ t && (t.pane === "main" && re.filter((t) => t.id !== e && H(t.id) && t.pane === "main").forEach((e) => p("toggle", e.id, !1)), p("toggle", e, !0));
323
318
  }
324
- function ae(e) {
319
+ function se(e) {
325
320
  p("toggle", e, !1);
326
321
  }
327
- function oe(e) {
328
- N.value = e, j.value = !0;
322
+ function ce(e) {
323
+ j.value = e, A.value = !0;
329
324
  }
330
- function G(e) {
331
- let t = z(e);
325
+ function U(e) {
326
+ let t = ie(e);
332
327
  if (!t?.params) return {};
333
328
  let n = {};
334
329
  for (let e of t.params) n[e.key] = e.default ?? e.min ?? 1;
@@ -336,80 +331,80 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
336
331
  for (let [e, t] of Object.entries(r)) typeof t == "number" && (i[e] = t);
337
332
  return i;
338
333
  }
339
- function se(e) {
340
- let t = G(e.id);
334
+ function le(e) {
335
+ let t = U(e.id);
341
336
  return e.params ? e.params.map((e) => t[e.key] ?? "").join(",") : "";
342
337
  }
343
- function ce(e) {
344
- N.value && p("updateParams", N.value, e), j.value = !1;
338
+ function ue(e) {
339
+ j.value && p("updateParams", j.value, e), A.value = !1;
345
340
  }
346
- function le(e, t) {
347
- if (!B(t)) {
341
+ function de(e, t) {
342
+ if (!V(t)) {
348
343
  e.preventDefault();
349
344
  return;
350
345
  }
351
- L.value = t, I.value = null, e.dataTransfer?.setData("text/plain", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
346
+ I.value = t, F.value = null, e.dataTransfer?.setData("text/plain", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
352
347
  }
353
- function ue(e, t) {
354
- !L.value || !B(t) || L.value === t || (I.value = t, e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
348
+ function W(e, t) {
349
+ !I.value || !V(t) || I.value === t || (F.value = t, e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
355
350
  }
356
- function de(e, t) {
357
- let n = L.value || e.dataTransfer?.getData("text/plain") || "";
351
+ function G(e, t) {
352
+ let n = I.value || e.dataTransfer?.getData("text/plain") || "";
358
353
  if (!n || n === t) {
359
354
  K();
360
355
  return;
361
356
  }
362
- if (!B(n) || !B(t)) {
357
+ if (!V(n) || !V(t)) {
363
358
  K();
364
359
  return;
365
360
  }
366
- let r = H.value.findIndex((e) => e.id === n), i = H.value.findIndex((e) => e.id === t);
361
+ let r = R.value.findIndex((e) => e.id === n), i = R.value.findIndex((e) => e.id === t);
367
362
  if (r < 0 || i < 0) {
368
363
  K();
369
364
  return;
370
365
  }
371
- let a = [...H.value.map((e) => e.id)], [o] = a.splice(r, 1);
366
+ let a = [...R.value.map((e) => e.id)], [o] = a.splice(r, 1);
372
367
  if (!o) {
373
368
  K();
374
369
  return;
375
370
  }
376
- a.splice(i, 0, o), p("reorderSubIndicators", a.filter((e) => B(e))), K();
371
+ a.splice(i, 0, o), p("reorderSubIndicators", a.filter((e) => V(e))), K();
377
372
  }
378
373
  function K() {
379
- I.value = null, L.value = null;
374
+ F.value = null, I.value = null;
380
375
  }
381
- function fe(e) {
376
+ function q(e) {
382
377
  e.key === "Escape" && h.menuOpen.peek() && h.closeMenu();
383
378
  }
384
- return y(() => {
385
- document.addEventListener("keydown", fe);
386
- }), x(() => {
387
- document.removeEventListener("keydown", fe);
388
- }), (r, u) => (S(), o("div", Me, [
389
- s("div", Ne, [s("div", Pe, [(S(!0), o(e, null, w(H.value, (t) => (S(), o(e, { key: t.id }, [t.id === ne.value ? (S(), o("div", Fe)) : a("", !0), s("div", {
379
+ return ee(() => {
380
+ document.addEventListener("keydown", q);
381
+ }), b(() => {
382
+ document.removeEventListener("keydown", q);
383
+ }), (r, u) => (x(), o("div", Me, [
384
+ s("div", Ne, [s("div", Pe, [(x(!0), o(e, null, w(R.value, (t) => (x(), o(e, { key: t.id }, [t.id === ne.value ? (x(), o("div", Fe)) : a("", !0), s("div", {
390
385
  class: g(["indicator-item", {
391
- draggable: O(B)(t.id),
392
- "drag-over": I.value === t.id,
393
- "is-dragging": L.value === t.id
386
+ draggable: O(V)(t.id),
387
+ "drag-over": F.value === t.id,
388
+ "is-dragging": I.value === t.id
394
389
  }]),
395
- draggable: O(B)(t.id),
396
- onDragstart: (e) => le(e, t.id),
397
- onDragover: P((e) => ue(e, t.id), ["prevent"]),
398
- onDrop: P((e) => de(e, t.id), ["prevent"]),
390
+ draggable: O(V)(t.id),
391
+ onDragstart: (e) => de(e, t.id),
392
+ onDragover: P((e) => W(e, t.id), ["prevent"]),
393
+ onDrop: P((e) => G(e, t.id), ["prevent"]),
399
394
  onDragend: K
400
395
  }, [s("div", {
401
396
  class: "indicator-btn-wrapper",
402
- onMouseenter: (e) => F.value = t.id,
403
- onMouseleave: u[0] ||= (e) => F.value = null
397
+ onMouseenter: (e) => N.value = t.id,
398
+ onMouseleave: u[0] ||= (e) => N.value = null
404
399
  }, [s("button", { class: g(["indicator-btn", {
405
400
  active: !0,
406
- hovering: F.value === t.id
407
- }]) }, [s("span", Re, [c(D(t.label) + " ", 1), t.params?.length ? (S(), o("span", ze, " (" + D(se(t)) + ") ", 1)) : a("", !0)]), l(n, { name: "fade" }, {
408
- default: M(() => [F.value === t.id ? (S(), o("div", Be, [
409
- t.params?.length ? (S(), o("button", {
401
+ hovering: N.value === t.id
402
+ }]) }, [s("span", Re, [c(D(t.label) + " ", 1), t.params?.length ? (x(), o("span", ze, " (" + D(le(t)) + ") ", 1)) : a("", !0)]), l(n, { name: "fade" }, {
403
+ default: M(() => [N.value === t.id ? (x(), o("div", Be, [
404
+ t.params?.length ? (x(), o("button", {
410
405
  key: 0,
411
406
  class: "action-btn settings-btn",
412
- onClick: P((e) => oe(t.id), ["stop"]),
407
+ onClick: P((e) => ce(t.id), ["stop"]),
413
408
  title: "编辑参数"
414
409
  }, [...u[9] ||= [s("svg", {
415
410
  viewBox: "0 0 24 24",
@@ -417,10 +412,10 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
417
412
  height: "14",
418
413
  fill: "currentColor"
419
414
  }, [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, Ve)) : a("", !0),
420
- t.params?.length ? (S(), o("span", He)) : a("", !0),
415
+ t.params?.length ? (x(), o("span", He)) : a("", !0),
421
416
  s("button", {
422
417
  class: "action-btn remove-btn",
423
- onClick: P((e) => ae(t.id), ["stop"]),
418
+ onClick: P((e) => se(t.id), ["stop"]),
424
419
  title: "移除指标"
425
420
  }, [...u[10] ||= [s("svg", {
426
421
  viewBox: "0 0 24 24",
@@ -432,7 +427,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
432
427
  _: 2
433
428
  }, 1024)], 2)], 40, Le)], 42, Ie)], 64))), 128)), s("div", We, [s("button", {
434
429
  ref_key: "addBtnRef",
435
- ref: A,
430
+ ref: k,
436
431
  class: "add-btn",
437
432
  onClick: u[1] ||= P((e) => O(h).toggleMenu(), ["stop"]),
438
433
  title: "添加指标"
@@ -442,22 +437,22 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
442
437
  height: "16",
443
438
  fill: "currentColor"
444
439
  }, [s("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })], -1)]], 512)])])]),
445
- (S(), i(t, { to: O(te) }, [l(n, { name: "overlay" }, {
446
- default: M(() => [O(_) ? (S(), o("div", {
440
+ (x(), i(t, { to: O(te) }, [l(n, { name: "overlay" }, {
441
+ default: M(() => [O(_) ? (x(), o("div", {
447
442
  key: 0,
448
443
  class: "selector-overlay",
449
444
  onClick: u[7] ||= (e) => O(h).closeMenu()
450
445
  }, [l(n, { name: "modal" }, {
451
- default: M(() => [O(_) ? (S(), o("div", {
446
+ default: M(() => [O(_) ? (x(), o("div", {
452
447
  key: 0,
453
448
  class: "selector-modal",
454
449
  onClick: u[6] ||= P(() => {}, ["stop"])
455
450
  }, [
456
- s("div", Ge, [s("div", Ke, [u[12] ||= s("span", { class: "title-text" }, "添加指标", -1), s("span", qe, D(O(k)) + " 个可用指标", 1)]), s("div", Je, [s("button", {
457
- class: g(["view-toggle-btn", { active: V.value }]),
458
- onClick: u[2] ||= (e) => V.value = !V.value,
451
+ s("div", Ge, [s("div", Ke, [u[12] ||= s("span", { class: "title-text" }, "添加指标", -1), s("span", qe, D(O(E)) + " 个可用指标", 1)]), s("div", Je, [s("button", {
452
+ class: g(["view-toggle-btn", { active: L.value }]),
453
+ onClick: u[2] ||= (e) => L.value = !L.value,
459
454
  title: "简洁模式"
460
- }, [V.value ? (S(), o("svg", Xe, [...u[14] ||= [s("path", { d: "M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z" }, null, -1)]])) : (S(), o("svg", Ye, [...u[13] ||= [s("path", { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, null, -1)]]))], 2), s("button", {
455
+ }, [L.value ? (x(), o("svg", Xe, [...u[14] ||= [s("path", { d: "M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z" }, null, -1)]])) : (x(), o("svg", Ye, [...u[13] ||= [s("path", { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, null, -1)]]))], 2), s("button", {
461
456
  class: "modal-close",
462
457
  onClick: u[3] ||= (e) => O(h).closeMenu(),
463
458
  title: "关闭"
@@ -480,18 +475,18 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
480
475
  type: "text",
481
476
  class: "search-input",
482
477
  placeholder: "搜索指标名称..."
483
- }, null, 40, $e)]),
484
- O(b).length > 0 ? (S(), o("div", X, [s("div", Z, [u[17] ||= s("span", { class: "section-title" }, "主图指标", -1), s("span", et, D(O(b).length), 1)]), s("div", { class: g(["indicator-grid", { compact: V.value }]) }, [(S(!0), o(e, null, w(O(b), (t) => (S(), o("button", {
478
+ }, null, 40, X)]),
479
+ O(y).length > 0 ? (x(), o("div", Z, [s("div", $e, [u[17] ||= s("span", { class: "section-title" }, "主图指标", -1), s("span", et, D(O(y).length), 1)]), s("div", { class: g(["indicator-grid", { compact: L.value }]) }, [(x(!0), o(e, null, w(O(y), (t) => (x(), o("button", {
485
480
  key: t.id,
486
481
  class: g(["indicator-card", {
487
- active: W(t.id),
488
- compact: V.value
482
+ active: H(t.id),
483
+ compact: L.value
489
484
  }]),
490
- onClick: (e) => W(t.id) ? ae(t.id) : ie(t.id)
491
- }, [V.value ? (S(), o(e, { key: 0 }, [s("span", nt, D(t.label), 1), s("span", rt, D(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", it, [s("span", at, D(t.label), 1), s("div", ot, [t.params?.length ? (S(), o("button", {
485
+ onClick: (e) => H(t.id) ? se(t.id) : oe(t.id)
486
+ }, [L.value ? (x(), o(e, { key: 0 }, [s("span", nt, D(t.label), 1), s("span", rt, D(t.name), 1)], 64)) : (x(), o(e, { key: 1 }, [s("div", it, [s("span", at, D(t.label), 1), s("div", ot, [t.params?.length ? (x(), o("button", {
492
487
  key: 0,
493
488
  class: "card-settings-btn",
494
- onClick: P((e) => oe(t.id), ["stop"]),
489
+ onClick: P((e) => ce(t.id), ["stop"]),
495
490
  title: "编辑参数"
496
491
  }, [...u[18] ||= [s("svg", {
497
492
  viewBox: "0 0 24 24",
@@ -499,8 +494,8 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
499
494
  height: "14",
500
495
  fill: "currentColor"
501
496
  }, [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, st)) : a("", !0)])]), s("div", ct, D(t.name), 1)], 64))], 10, tt))), 128))], 2)])) : a("", !0),
502
- O(b).length > 0 && O(T).length > 0 ? (S(), o("div", lt)) : a("", !0),
503
- !E.value && O(v).trim() ? (S(), o("div", ut, [...u[19] ||= [
497
+ O(y).length > 0 && O(S).length > 0 ? (x(), o("div", lt)) : a("", !0),
498
+ !T.value && O(v).trim() ? (x(), o("div", ut, [...u[19] ||= [
504
499
  s("svg", {
505
500
  viewBox: "0 0 24 24",
506
501
  width: "48",
@@ -510,17 +505,17 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
510
505
  s("p", null, "未找到匹配的指标", -1),
511
506
  s("span", { class: "no-results-hint" }, "请尝试其他关键词", -1)
512
507
  ]])) : a("", !0),
513
- O(T).length > 0 ? (S(), o("div", dt, [s("div", ft, [u[20] ||= s("span", { class: "section-title" }, "副图指标", -1), s("span", pt, D(O(T).length), 1)]), s("div", { class: g(["indicator-grid", { compact: V.value }]) }, [(S(!0), o(e, null, w(O(T), (t) => (S(), o("button", {
508
+ O(S).length > 0 ? (x(), o("div", dt, [s("div", ft, [u[20] ||= s("span", { class: "section-title" }, "副图指标", -1), s("span", pt, D(O(S).length), 1)]), s("div", { class: g(["indicator-grid", { compact: L.value }]) }, [(x(!0), o(e, null, w(O(S), (t) => (x(), o("button", {
514
509
  key: t.id,
515
510
  class: g(["indicator-card", {
516
- active: W(t.id),
517
- compact: V.value
511
+ active: H(t.id),
512
+ compact: L.value
518
513
  }]),
519
- onClick: (e) => W(t.id) ? ae(t.id) : ie(t.id)
520
- }, [V.value ? (S(), o(e, { key: 0 }, [s("span", ht, D(t.label), 1), s("span", gt, D(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", _t, [s("span", vt, D(t.label), 1), s("div", yt, [t.params?.length ? (S(), o("button", {
514
+ onClick: (e) => H(t.id) ? se(t.id) : oe(t.id)
515
+ }, [L.value ? (x(), o(e, { key: 0 }, [s("span", ht, D(t.label), 1), s("span", gt, D(t.name), 1)], 64)) : (x(), o(e, { key: 1 }, [s("div", _t, [s("span", vt, D(t.label), 1), s("div", yt, [t.params?.length ? (x(), o("button", {
521
516
  key: 0,
522
517
  class: "card-settings-btn",
523
- onClick: P((e) => oe(t.id), ["stop"]),
518
+ onClick: P((e) => ce(t.id), ["stop"]),
524
519
  title: "编辑参数"
525
520
  }, [...u[21] ||= [s("svg", {
526
521
  viewBox: "0 0 24 24",
@@ -529,7 +524,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
529
524
  fill: "currentColor"
530
525
  }, [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, bt)) : a("", !0)])]), s("div", xt, D(t.name), 1)], 64))], 10, mt))), 128))], 2)])) : a("", !0)
531
526
  ]),
532
- s("div", St, [s("div", Ct, [s("span", wt, "已激活 " + D(re.value) + " 个指标", 1)]), s("button", {
527
+ s("div", St, [s("div", Ct, [s("span", wt, "已激活 " + D(ae.value) + " 个指标", 1)]), s("button", {
533
528
  class: "btn btn-confirm",
534
529
  onClick: u[5] ||= (e) => O(h).closeMenu()
535
530
  }, "确认")])
@@ -538,16 +533,16 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
538
533
  })])) : a("", !0)]),
539
534
  _: 1
540
535
  })], 8, ["to"])),
541
- U.value ? (S(), i(ke, {
536
+ z.value ? (x(), i(je, {
542
537
  key: 0,
543
- visible: j.value,
544
- "indicator-id": U.value.id,
545
- "indicator-name": U.value.name,
546
- "indicator-description": U.value.description,
547
- params: U.value.params || [],
548
- values: G(U.value.id),
549
- onClose: u[8] ||= (e) => j.value = !1,
550
- onConfirm: ce
538
+ visible: A.value,
539
+ "indicator-id": z.value.id,
540
+ "indicator-name": z.value.name,
541
+ "indicator-description": z.value.description,
542
+ params: z.value.params || [],
543
+ values: U(z.value.id),
544
+ onClose: u[8] ||= (e) => A.value = !1,
545
+ onConfirm: ue
551
546
  }, null, 8, [
552
547
  "visible",
553
548
  "indicator-id",
@@ -558,7 +553,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
558
553
  ])) : a("", !0)
559
554
  ]));
560
555
  }
561
- }), [["__scopeId", "data-v-6eb58214"]]), Et = { class: "kline-tooltip__title" }, Dt = { key: 0 }, Ot = { class: "kline-tooltip__grid" }, kt = { class: "row" }, At = { class: "row" }, jt = { class: "row" }, Mt = { class: "row" }, Nt = {
556
+ }), [["__scopeId", "data-v-7a4dfe73"]]), Et = { class: "kline-tooltip__title" }, Dt = { key: 0 }, Ot = { class: "kline-tooltip__grid" }, kt = { class: "row" }, At = { class: "row" }, jt = { class: "row" }, Mt = { class: "row" }, Nt = {
562
557
  key: 0,
563
558
  class: "row"
564
559
  }, Pt = {
@@ -623,7 +618,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
623
618
  let n = e.changePercent ?? (e.close - e.open) / e.open * 100;
624
619
  return n > 0 ? zt : n < 0 ? Bt : Vt;
625
620
  });
626
- return (t, r) => e.k ? (S(), o("div", {
621
+ return (t, r) => e.k ? (x(), o("div", {
627
622
  key: 0,
628
623
  ref: c,
629
624
  class: g(["kline-tooltip", [{ "use-anchor": n.value }, i.value]]),
@@ -631,20 +626,20 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
631
626
  left: `${e.pos.x}px`,
632
627
  top: `${e.pos.y}px`
633
628
  })
634
- }, [s("div", Et, [e.k.stockCode ? (S(), o("span", Dt, D(e.k.stockCode), 1)) : a("", !0), s("span", null, D(l(e.k.timestamp)), 1)]), s("div", Ot, [
629
+ }, [s("div", Et, [e.k.stockCode ? (x(), o("span", Dt, D(e.k.stockCode), 1)) : a("", !0), s("span", null, D(l(e.k.timestamp)), 1)]), s("div", Ot, [
635
630
  s("div", kt, [r[0] ||= s("span", null, "开", -1), s("span", { style: _({ color: p.value }) }, D(e.k.open.toFixed(2)), 5)]),
636
631
  s("div", At, [r[1] ||= s("span", null, "高", -1), s("span", null, D(e.k.high.toFixed(2)), 1)]),
637
632
  s("div", jt, [r[2] ||= s("span", null, "低", -1), s("span", null, D(e.k.low.toFixed(2)), 1)]),
638
633
  s("div", Mt, [r[3] ||= s("span", null, "收", -1), s("span", { style: _({ color: m.value }) }, D(e.k.close.toFixed(2)), 5)]),
639
- typeof e.k.volume == "number" ? (S(), o("div", Nt, [r[4] ||= s("span", null, "成交量", -1), s("span", null, D(u(e.k.volume)), 1)])) : a("", !0),
640
- typeof e.k.turnover == "number" ? (S(), o("div", Pt, [r[5] ||= s("span", null, "成交额", -1), s("span", null, D(u(e.k.turnover)), 1)])) : a("", !0),
641
- typeof e.k.amplitude == "number" ? (S(), o("div", Ft, [r[6] ||= s("span", null, "振幅", -1), s("span", null, D(e.k.amplitude) + "%", 1)])) : a("", !0),
642
- typeof e.k.changePercent == "number" ? (S(), o("div", It, [r[7] ||= s("span", null, "涨跌幅", -1), s("span", { style: _({ color: h.value }) }, D(d(e.k.changePercent, "%")), 5)])) : a("", !0),
643
- typeof e.k.changeAmount == "number" ? (S(), o("div", Lt, [r[8] ||= s("span", null, "涨跌额", -1), s("span", { style: _({ color: h.value }) }, D(d(e.k.changeAmount, "")), 5)])) : a("", !0),
644
- typeof e.k.turnoverRate == "number" ? (S(), o("div", Rt, [r[9] ||= s("span", null, "换手率", -1), s("span", null, D(e.k.turnoverRate.toFixed(2)) + "%", 1)])) : a("", !0)
634
+ typeof e.k.volume == "number" ? (x(), o("div", Nt, [r[4] ||= s("span", null, "成交量", -1), s("span", null, D(u(e.k.volume)), 1)])) : a("", !0),
635
+ typeof e.k.turnover == "number" ? (x(), o("div", Pt, [r[5] ||= s("span", null, "成交额", -1), s("span", null, D(u(e.k.turnover)), 1)])) : a("", !0),
636
+ typeof e.k.amplitude == "number" ? (x(), o("div", Ft, [r[6] ||= s("span", null, "振幅", -1), s("span", null, D(e.k.amplitude) + "%", 1)])) : a("", !0),
637
+ typeof e.k.changePercent == "number" ? (x(), o("div", It, [r[7] ||= s("span", null, "涨跌幅", -1), s("span", { style: _({ color: h.value }) }, D(d(e.k.changePercent, "%")), 5)])) : a("", !0),
638
+ typeof e.k.changeAmount == "number" ? (x(), o("div", Lt, [r[8] ||= s("span", null, "涨跌额", -1), s("span", { style: _({ color: h.value }) }, D(d(e.k.changeAmount, "")), 5)])) : a("", !0),
639
+ typeof e.k.turnoverRate == "number" ? (x(), o("div", Rt, [r[9] ||= s("span", null, "换手率", -1), s("span", null, D(e.k.turnoverRate.toFixed(2)) + "%", 1)])) : a("", !0)
645
640
  ])], 6)) : a("", !0);
646
641
  }
647
- }), [["__scopeId", "data-v-93207d24"]]), Ut = { class: "marker-tooltip__title" }, Wt = {
642
+ }), [["__scopeId", "data-v-61c103af"]]), Ut = { class: "marker-tooltip__title" }, Wt = {
648
643
  key: 0,
649
644
  class: "marker-tooltip__content"
650
645
  }, Gt = /* @__PURE__ */ q(/* @__PURE__ */ u({
@@ -688,7 +683,7 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
688
683
  function h(e) {
689
684
  return typeof e == "number" ? e.toFixed(2) : String(e);
690
685
  }
691
- return (n, r) => t.marker ? (S(), o("div", {
686
+ return (n, r) => t.marker ? (x(), o("div", {
692
687
  key: 0,
693
688
  ref: u,
694
689
  class: g(["marker-tooltip", [{ "use-anchor": c.value }, l.value]]),
@@ -696,18 +691,18 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
696
691
  left: `${t.pos.x + 12}px`,
697
692
  top: `${t.pos.y + 12}px`
698
693
  })
699
- }, [s("div", Ut, D(f.value), 1), m.value ? (S(), o("div", Wt, [(S(!0), o(e, null, w(p.value, (e, t) => (S(), o("div", {
694
+ }, [s("div", Ut, D(f.value), 1), m.value ? (x(), o("div", Wt, [(x(!0), o(e, null, w(p.value, (e, t) => (x(), o("div", {
700
695
  key: t,
701
696
  class: "row"
702
697
  }, [s("span", null, D(t), 1), s("span", null, D(h(e)), 1)]))), 128))])) : a("", !0)], 6)) : a("", !0);
703
698
  }
704
- }), [["__scopeId", "data-v-f56bc484"]]), Kt = {
699
+ }), [["__scopeId", "data-v-dc844eda"]]), Kt = {
705
700
  viewBox: "0 0 24 24",
706
701
  width: "1.2em",
707
702
  height: "1.2em"
708
703
  };
709
704
  function qt(e, t) {
710
- return S(), o("svg", Kt, [...t[0] ||= [s("path", {
705
+ return x(), o("svg", Kt, [...t[0] ||= [s("path", {
711
706
  fill: "none",
712
707
  stroke: "currentColor",
713
708
  "stroke-linecap": "round",
@@ -725,7 +720,7 @@ var Jt = m({
725
720
  height: "1.2em"
726
721
  };
727
722
  function Xt(e, t) {
728
- return S(), o("svg", Yt, [...t[0] ||= [s("path", {
723
+ return x(), o("svg", Yt, [...t[0] ||= [s("path", {
729
724
  fill: "none",
730
725
  stroke: "currentColor",
731
726
  "stroke-linecap": "round",
@@ -743,7 +738,7 @@ var Zt = m({
743
738
  height: "1.2em"
744
739
  };
745
740
  function $t(e, t) {
746
- return S(), o("svg", Qt, [...t[0] ||= [s("path", {
741
+ return x(), o("svg", Qt, [...t[0] ||= [s("path", {
747
742
  fill: "none",
748
743
  stroke: "currentColor",
749
744
  "stroke-linecap": "round",
@@ -761,7 +756,7 @@ var en = m({
761
756
  height: "1.2em"
762
757
  };
763
758
  function nn(e, t) {
764
- return S(), o("svg", tn, [...t[0] ||= [s("path", {
759
+ return x(), o("svg", tn, [...t[0] ||= [s("path", {
765
760
  fill: "none",
766
761
  stroke: "currentColor",
767
762
  "stroke-linecap": "round",
@@ -779,7 +774,7 @@ var rn = m({
779
774
  height: "1.2em"
780
775
  };
781
776
  function on(e, t) {
782
- return S(), o("svg", an, [...t[0] ||= [s("path", {
777
+ return x(), o("svg", an, [...t[0] ||= [s("path", {
783
778
  fill: "none",
784
779
  stroke: "currentColor",
785
780
  "stroke-linecap": "round",
@@ -797,7 +792,7 @@ var sn = m({
797
792
  height: "1.2em"
798
793
  };
799
794
  function ln(e, t) {
800
- return S(), o("svg", cn, [...t[0] ||= [s("path", {
795
+ return x(), o("svg", cn, [...t[0] ||= [s("path", {
801
796
  fill: "none",
802
797
  stroke: "currentColor",
803
798
  "stroke-linecap": "round",
@@ -815,7 +810,7 @@ var un = m({
815
810
  height: "1.2em"
816
811
  };
817
812
  function fn(e, t) {
818
- return S(), o("svg", dn, [...t[0] ||= [s("path", {
813
+ return x(), o("svg", dn, [...t[0] ||= [s("path", {
819
814
  fill: "none",
820
815
  stroke: "currentColor",
821
816
  "stroke-linecap": "round",
@@ -833,7 +828,7 @@ var pn = m({
833
828
  height: "1.2em"
834
829
  };
835
830
  function hn(e, t) {
836
- return S(), o("svg", mn, [...t[0] ||= [s("g", {
831
+ return x(), o("svg", mn, [...t[0] ||= [s("g", {
837
832
  fill: "none",
838
833
  stroke: "currentColor",
839
834
  "stroke-linecap": "round",
@@ -850,7 +845,7 @@ var gn = m({
850
845
  height: "1.2em"
851
846
  };
852
847
  function vn(e, t) {
853
- return S(), o("svg", _n, [...t[0] ||= [s("path", {
848
+ return x(), o("svg", _n, [...t[0] ||= [s("path", {
854
849
  fill: "none",
855
850
  stroke: "currentColor",
856
851
  "stroke-linecap": "round",
@@ -868,7 +863,7 @@ var yn = m({
868
863
  height: "1.2em"
869
864
  };
870
865
  function xn(e, t) {
871
- return S(), o("svg", bn, [...t[0] ||= [s("path", {
866
+ return x(), o("svg", bn, [...t[0] ||= [s("path", {
872
867
  fill: "none",
873
868
  stroke: "currentColor",
874
869
  "stroke-linecap": "round",
@@ -886,7 +881,7 @@ var Sn = m({
886
881
  height: "1.2em"
887
882
  };
888
883
  function wn(e, t) {
889
- return S(), o("svg", Cn, [...t[0] ||= [s("path", {
884
+ return x(), o("svg", Cn, [...t[0] ||= [s("path", {
890
885
  fill: "none",
891
886
  stroke: "currentColor",
892
887
  "stroke-linecap": "round",
@@ -904,7 +899,7 @@ var Tn = m({
904
899
  height: "1.2em"
905
900
  };
906
901
  function Dn(e, t) {
907
- return S(), o("svg", En, [...t[0] ||= [s("path", {
902
+ return x(), o("svg", En, [...t[0] ||= [s("path", {
908
903
  fill: "none",
909
904
  stroke: "currentColor",
910
905
  "stroke-linecap": "round",
@@ -922,7 +917,7 @@ var On = m({
922
917
  height: "1.2em"
923
918
  };
924
919
  function An(e, t) {
925
- return S(), o("svg", kn, [...t[0] ||= [s("g", {
920
+ return x(), o("svg", kn, [...t[0] ||= [s("g", {
926
921
  fill: "none",
927
922
  stroke: "currentColor",
928
923
  "stroke-linecap": "round",
@@ -939,7 +934,7 @@ var jn = m({
939
934
  height: "1.2em"
940
935
  };
941
936
  function Nn(e, t) {
942
- return S(), o("svg", Mn, [...t[0] ||= [s("path", {
937
+ return x(), o("svg", Mn, [...t[0] ||= [s("path", {
943
938
  fill: "none",
944
939
  stroke: "currentColor",
945
940
  "stroke-linecap": "round",
@@ -957,7 +952,7 @@ var Pn = m({
957
952
  height: "1.2em"
958
953
  };
959
954
  function In(e, t) {
960
- return S(), o("svg", Fn, [...t[0] ||= [s("path", {
955
+ return x(), o("svg", Fn, [...t[0] ||= [s("path", {
961
956
  fill: "none",
962
957
  stroke: "currentColor",
963
958
  "stroke-linecap": "round",
@@ -975,7 +970,7 @@ var Ln = m({
975
970
  height: "1.2em"
976
971
  };
977
972
  function zn(e, t) {
978
- return S(), o("svg", Rn, [...t[0] ||= [s("path", {
973
+ return x(), o("svg", Rn, [...t[0] ||= [s("path", {
979
974
  fill: "none",
980
975
  stroke: "currentColor",
981
976
  "stroke-linecap": "round",
@@ -993,7 +988,7 @@ var Bn = m({
993
988
  height: "1.2em"
994
989
  };
995
990
  function Hn(e, t) {
996
- return S(), o("svg", Vn, [...t[0] ||= [s("path", {
991
+ return x(), o("svg", Vn, [...t[0] ||= [s("path", {
997
992
  fill: "none",
998
993
  stroke: "currentColor",
999
994
  "stroke-linecap": "round",
@@ -1216,110 +1211,110 @@ var rr = {
1216
1211
  }
1217
1212
  ]
1218
1213
  }
1219
- ], m = f, h = C("cursor"), _ = C(null), v = C(!1), b = je(), E = r(() => G.filter((e) => e.group === "main")), j = r(() => G.filter((e) => e.group === "experimental"));
1220
- function F() {
1214
+ ], m = f, h = C("cursor"), _ = C(null), v = C(!1), y = J(), S = r(() => U.filter((e) => e.group === "main")), E = r(() => U.filter((e) => e.group === "experimental"));
1215
+ function j() {
1221
1216
  try {
1222
- let e = localStorage.getItem(se);
1217
+ let e = localStorage.getItem(le);
1223
1218
  if (e) {
1224
1219
  let t = JSON.parse(e), n = {};
1225
- return G.forEach((e) => {
1220
+ return U.forEach((e) => {
1226
1221
  n[e.key] = t[e.key] ?? e.default;
1227
1222
  }), n;
1228
1223
  }
1229
1224
  } catch {}
1230
1225
  let e = {};
1231
- return G.forEach((t) => {
1226
+ return U.forEach((t) => {
1232
1227
  e[t.key] = t.default;
1233
1228
  }), e;
1234
1229
  }
1235
- function I(e) {
1230
+ function F(e) {
1236
1231
  try {
1237
- localStorage.setItem(se, JSON.stringify(e));
1232
+ localStorage.setItem(le, JSON.stringify(e));
1238
1233
  } catch {}
1239
1234
  }
1240
- let L = C(F()), R = C({ ...L.value });
1241
- function z(e) {
1235
+ let I = C(j()), L = C({ ...I.value });
1236
+ function te(e) {
1242
1237
  return h.value === e.id ? !0 : e.children ? e.children.some((e) => e.id === h.value) : !1;
1243
1238
  }
1244
- function B(e) {
1239
+ function R(e) {
1245
1240
  if (e.children?.length) {
1246
1241
  if (!e.children.some((e) => e.id === h.value)) {
1247
1242
  let t = e.children[0];
1248
1243
  h.value = t.id, m("selectTool", t.id);
1249
1244
  }
1250
- V(e.id);
1245
+ re(e.id);
1251
1246
  return;
1252
1247
  }
1253
1248
  h.value = e.id, m("selectTool", e.id), _.value = null;
1254
1249
  }
1255
- function ee(e) {
1250
+ function ne(e) {
1256
1251
  h.value = e.id, m("selectTool", e.id), _.value = null;
1257
1252
  }
1258
- function V(e) {
1253
+ function re(e) {
1259
1254
  _.value = _.value === e ? null : e;
1260
1255
  }
1261
- function te() {
1262
- R.value = { ...L.value }, v.value = !0;
1256
+ function z() {
1257
+ L.value = { ...I.value }, v.value = !0;
1263
1258
  }
1264
- function H() {
1259
+ function B() {
1265
1260
  v.value = !1;
1266
1261
  }
1267
- function ne() {
1262
+ function ie() {
1268
1263
  let e = {};
1269
- G.forEach((t) => {
1264
+ U.forEach((t) => {
1270
1265
  e[t.key] = t.default;
1271
- }), R.value = e;
1266
+ }), L.value = e;
1272
1267
  }
1273
- function U() {
1274
- L.value = { ...R.value }, I(L.value), Qn(!!L.value.enableCanvasProfiler), m("settingsChange", { ...L.value }), H();
1268
+ function ae() {
1269
+ I.value = { ...L.value }, F(I.value), Qn(!!I.value.enableCanvasProfiler), m("settingsChange", { ...I.value }), B();
1275
1270
  }
1276
- function re() {
1277
- return { ...L.value };
1271
+ function V() {
1272
+ return { ...I.value };
1278
1273
  }
1279
- d({ getSettings: re });
1280
- function W(e) {
1274
+ d({ getSettings: V });
1275
+ function H(e) {
1281
1276
  e.target.closest(".tool-item") || (_.value = null);
1282
1277
  }
1283
- return y(() => {
1284
- document.addEventListener("click", W, !0), m("settingsChange", { ...L.value }), Qn(!!L.value.enableCanvasProfiler);
1285
- }), x(() => {
1286
- document.removeEventListener("click", W, !0);
1287
- }), (r, d) => (S(), o(e, null, [s("nav", rr, [
1288
- s("div", ir, [(S(), o(e, null, w(p, (t) => s("div", {
1278
+ return ee(() => {
1279
+ document.addEventListener("click", H, !0), m("settingsChange", { ...I.value }), Qn(!!I.value.enableCanvasProfiler);
1280
+ }), b(() => {
1281
+ document.removeEventListener("click", H, !0);
1282
+ }), (r, d) => (x(), o(e, null, [s("nav", rr, [
1283
+ s("div", ir, [(x(), o(e, null, w(p, (t) => s("div", {
1289
1284
  key: t.id,
1290
1285
  class: "tool-item"
1291
1286
  }, [s("button", {
1292
1287
  type: "button",
1293
- class: g(["left-toolbar__button", { active: z(t) }]),
1288
+ class: g(["left-toolbar__button", { active: te(t) }]),
1294
1289
  title: t.title,
1295
1290
  "aria-label": t.title,
1296
- onClick: (e) => B(t),
1291
+ onClick: (e) => R(t),
1297
1292
  onPointerdown: d[0] ||= P(() => {}, ["stop"]),
1298
1293
  onPointermove: d[1] ||= P(() => {}, ["stop"]),
1299
1294
  onPointerup: d[2] ||= P(() => {}, ["stop"])
1300
- }, [(S(), i(T(t.icon), {
1295
+ }, [(x(), i(T(t.icon), {
1301
1296
  class: "tool-icon",
1302
1297
  "aria-hidden": "true"
1303
- })), t.children && t.children.length ? (S(), o("span", {
1298
+ })), t.children && t.children.length ? (x(), o("span", {
1304
1299
  key: 0,
1305
1300
  class: g(["corner-indicator", { open: _.value === t.id }]),
1306
- onClick: P((e) => V(t.id), ["stop"]),
1301
+ onClick: P((e) => re(t.id), ["stop"]),
1307
1302
  "aria-label": "展开子菜单"
1308
1303
  }, null, 10, or)) : a("", !0)], 42, ar), l(n, { name: "dropdown" }, {
1309
- default: M(() => [_.value === t.id && t.children && t.children.length ? (S(), o("div", {
1304
+ default: M(() => [_.value === t.id && t.children && t.children.length ? (x(), o("div", {
1310
1305
  key: 0,
1311
1306
  class: "tool-dropdown",
1312
1307
  onPointerdown: d[3] ||= P(() => {}, ["stop"]),
1313
1308
  onPointermove: d[4] ||= P(() => {}, ["stop"]),
1314
1309
  onPointerup: d[5] ||= P(() => {}, ["stop"])
1315
- }, [(S(!0), o(e, null, w(t.children, (e) => (S(), o("button", {
1310
+ }, [(x(!0), o(e, null, w(t.children, (e) => (x(), o("button", {
1316
1311
  key: e.id,
1317
1312
  type: "button",
1318
1313
  class: g(["left-toolbar__button", { active: h.value === e.id }]),
1319
1314
  title: e.title,
1320
1315
  "aria-label": e.title,
1321
- onClick: (t) => ee(e)
1322
- }, [(S(), i(T(e.icon), {
1316
+ onClick: (t) => ne(e)
1317
+ }, [(x(), i(T(e.icon), {
1323
1318
  class: "tool-icon",
1324
1319
  "aria-hidden": "true"
1325
1320
  }))], 10, sr))), 128))], 32)) : a("", !0)]),
@@ -1361,11 +1356,11 @@ var rr = {
1361
1356
  onPointerdown: d[15] ||= P(() => {}, ["stop"]),
1362
1357
  onPointermove: d[16] ||= P(() => {}, ["stop"]),
1363
1358
  onPointerup: d[17] ||= P(() => {}, ["stop"])
1364
- }, [u.isFullscreen ? (S(), i(O(On), {
1359
+ }, [u.isFullscreen ? (x(), i(O(On), {
1365
1360
  key: 0,
1366
1361
  class: "tool-icon",
1367
1362
  "aria-hidden": "true"
1368
- })) : (S(), i(O(Tn), {
1363
+ })) : (x(), i(O(Tn), {
1369
1364
  key: 1,
1370
1365
  class: "tool-icon",
1371
1366
  "aria-hidden": "true"
@@ -1376,7 +1371,7 @@ var rr = {
1376
1371
  class: "left-toolbar__button",
1377
1372
  title: "设置",
1378
1373
  "aria-label": "设置",
1379
- onClick: te,
1374
+ onClick: z,
1380
1375
  onPointerdown: d[18] ||= P(() => {}, ["stop"]),
1381
1376
  onPointermove: d[19] ||= P(() => {}, ["stop"]),
1382
1377
  onPointerup: d[20] ||= P(() => {}, ["stop"])
@@ -1384,11 +1379,11 @@ var rr = {
1384
1379
  class: "tool-icon",
1385
1380
  "aria-hidden": "true"
1386
1381
  })], 32)])
1387
- ]), (S(), i(t, { to: O(b) }, [l(n, { name: "overlay" }, {
1388
- default: M(() => [v.value ? (S(), o("div", {
1382
+ ]), (x(), i(t, { to: O(y) }, [l(n, { name: "overlay" }, {
1383
+ default: M(() => [v.value ? (x(), o("div", {
1389
1384
  key: 0,
1390
1385
  class: "settings-overlay",
1391
- onClick: H
1386
+ onClick: B
1392
1387
  }, [l(n, { name: "modal" }, {
1393
1388
  default: M(() => [s("div", {
1394
1389
  class: "settings-modal",
@@ -1396,47 +1391,47 @@ var rr = {
1396
1391
  }, [
1397
1392
  s("div", { class: "settings-header" }, [d[26] ||= s("div", { class: "header-left" }, [s("span", { class: "settings-title" }, "图表设置"), s("span", { class: "settings-subtitle" }, "个性化配置")], -1), s("div", { class: "header-right" }, [s("button", {
1398
1393
  class: "settings-close",
1399
- onClick: H
1394
+ onClick: B
1400
1395
  }, [...d[25] ||= [s("svg", {
1401
1396
  viewBox: "0 0 24 24",
1402
1397
  fill: "none",
1403
1398
  stroke: "currentColor",
1404
1399
  "stroke-width": "2"
1405
1400
  }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
1406
- s("div", fr, [E.value.length > 0 ? (S(), o(e, { key: 0 }, [d[27] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "主图设置")], -1), (S(!0), o(e, null, w(E.value, (t) => (S(), o("div", {
1401
+ s("div", fr, [S.value.length > 0 ? (x(), o(e, { key: 0 }, [d[27] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "主图设置")], -1), (x(!0), o(e, null, w(S.value, (t) => (x(), o("div", {
1407
1402
  key: t.key,
1408
1403
  class: "settings-item"
1409
- }, [s("label", pr, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((S(), o("input", {
1404
+ }, [s("label", pr, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((x(), o("input", {
1410
1405
  key: 0,
1411
1406
  type: "checkbox",
1412
1407
  class: "settings-checkbox",
1413
- "onUpdate:modelValue": (e) => R.value[t.key] = e
1414
- }, null, 8, mr)), [[k, R.value[t.key]]]) : t.type === "select" && t.options ? N((S(), o("select", {
1408
+ "onUpdate:modelValue": (e) => L.value[t.key] = e
1409
+ }, null, 8, mr)), [[k, L.value[t.key]]]) : t.type === "select" && t.options ? N((x(), o("select", {
1415
1410
  key: 1,
1416
1411
  class: "settings-select",
1417
- "onUpdate:modelValue": (e) => R.value[t.key] = e
1418
- }, [(S(!0), o(e, null, w(t.options, (e) => (S(), o("option", {
1412
+ "onUpdate:modelValue": (e) => L.value[t.key] = e
1413
+ }, [(x(!0), o(e, null, w(t.options, (e) => (x(), o("option", {
1419
1414
  key: e.value,
1420
1415
  value: e.value
1421
- }, D(e.label), 9, gr))), 128))], 8, hr)), [[A, R.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0), j.value.length > 0 ? (S(), o(e, { key: 1 }, [d[28] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "实验性 / 调试设置")], -1), (S(!0), o(e, null, w(j.value, (t) => (S(), o("div", {
1416
+ }, D(e.label), 9, gr))), 128))], 8, hr)), [[A, L.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0), E.value.length > 0 ? (x(), o(e, { key: 1 }, [d[28] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "实验性 / 调试设置")], -1), (x(!0), o(e, null, w(E.value, (t) => (x(), o("div", {
1422
1417
  key: t.key,
1423
1418
  class: "settings-item experimental"
1424
- }, [s("label", _r, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((S(), o("input", {
1419
+ }, [s("label", _r, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((x(), o("input", {
1425
1420
  key: 0,
1426
1421
  type: "checkbox",
1427
1422
  class: "settings-checkbox",
1428
- "onUpdate:modelValue": (e) => R.value[t.key] = e
1429
- }, null, 8, vr)), [[k, R.value[t.key]]]) : t.type === "select" && t.options ? N((S(), o("select", {
1423
+ "onUpdate:modelValue": (e) => L.value[t.key] = e
1424
+ }, null, 8, vr)), [[k, L.value[t.key]]]) : t.type === "select" && t.options ? N((x(), o("select", {
1430
1425
  key: 1,
1431
1426
  class: "settings-select",
1432
- "onUpdate:modelValue": (e) => R.value[t.key] = e
1433
- }, [(S(!0), o(e, null, w(t.options, (e) => (S(), o("option", {
1427
+ "onUpdate:modelValue": (e) => L.value[t.key] = e
1428
+ }, [(x(!0), o(e, null, w(t.options, (e) => (x(), o("option", {
1434
1429
  key: e.value,
1435
1430
  value: e.value
1436
- }, D(e.label), 9, br))), 128))], 8, yr)), [[A, R.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0)]),
1431
+ }, D(e.label), 9, br))), 128))], 8, yr)), [[A, L.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0)]),
1437
1432
  s("div", { class: "settings-footer" }, [s("button", {
1438
1433
  class: "settings-btn reset",
1439
- onClick: ne
1434
+ onClick: ie
1440
1435
  }, [...d[29] ||= [s("svg", {
1441
1436
  viewBox: "0 0 24 24",
1442
1437
  fill: "none",
@@ -1444,10 +1439,10 @@ var rr = {
1444
1439
  "stroke-width": "2"
1445
1440
  }, [s("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), s("path", { d: "M3 3v5h5" })], -1), c(" 重置 ", -1)]]), s("div", { class: "footer-right" }, [s("button", {
1446
1441
  class: "settings-btn cancel",
1447
- onClick: H
1442
+ onClick: B
1448
1443
  }, "取消"), s("button", {
1449
1444
  class: "settings-btn confirm",
1450
- onClick: U
1445
+ onClick: ae
1451
1446
  }, [...d[30] ||= [s("svg", {
1452
1447
  viewBox: "0 0 24 24",
1453
1448
  fill: "none",
@@ -1463,7 +1458,13 @@ var rr = {
1463
1458
  }), [["__scopeId", "data-v-3e3ffb4f"]]), Sr = ["data-theme"], Cr = {
1464
1459
  class: "pane-separator-layer",
1465
1460
  "aria-hidden": "true"
1466
- }, wr = 4, Tr = /* @__PURE__ */ q(/* @__PURE__ */ u({
1461
+ }, wr = {
1462
+ class: "canvas-layer",
1463
+ ref: "canvasLayerRef"
1464
+ }, Tr = {
1465
+ class: "x-axis-canvas",
1466
+ ref: "xAxisCanvasRef"
1467
+ }, Er = 4, Dr = /* @__PURE__ */ q(/* @__PURE__ */ u({
1467
1468
  __name: "KLineChart",
1468
1469
  props: {
1469
1470
  semanticConfig: {},
@@ -1483,36 +1484,24 @@ var rr = {
1483
1484
  },
1484
1485
  emits: ["zoomLevelChange", "toggleFullscreen"],
1485
1486
  setup(n, { expose: c, emit: u }) {
1486
- let d = n, f = C(null), p = C(null), m = C(null), v = C(null), b = C(null), T = C(null), D = C(null), k = E(null), A = E(null), M = ne({
1487
- initialZoomLevel: d.initialZoomLevel ?? 1,
1488
- minKWidth: d.minKWidth,
1489
- maxKWidth: d.maxKWidth,
1490
- zoomLevels: d.zoomLevels,
1491
- rightAxisWidth: d.rightAxisWidth,
1492
- priceLabelWidth: d.priceLabelWidth
1493
- }), N = C("light");
1494
- M.actions.setZoomState(M.state.zoomLevel, re(M.state.zoomLevel, {
1495
- minKWidth: d.minKWidth,
1496
- maxKWidth: d.maxKWidth,
1497
- zoomLevelCount: d.zoomLevels,
1498
- dpr: M.state.viewportDpr
1499
- }), U(re(M.state.zoomLevel, {
1487
+ let d = n, f = C(null), p = C(null), m = C(null), v = C(null), y = C(null);
1488
+ me(m);
1489
+ let S = E(null), T = E(null), D = C(0), O = C(0), k = C(1), A = C(d.initialZoomLevel ?? 1), M = C(0), N = C(1), P = C(0), F = C({}), I = C(null), L = C([]), re = A.value;
1490
+ M.value = oe(re, {
1500
1491
  minKWidth: d.minKWidth,
1501
1492
  maxKWidth: d.maxKWidth,
1502
1493
  zoomLevelCount: d.zoomLevels,
1503
- dpr: M.state.viewportDpr
1504
- }), M.state.viewportDpr)), r(() => M.state.dataLength), r(() => M.state.viewportDpr);
1505
- let P = r(() => M.state.zoomLevel), F = r(() => M.state.kWidth), I = r(() => M.state.kGap), L = r(() => M.state.paneRatios), R = r(() => M.state.selectedDrawingId), z = r(() => M.state.dataVersion);
1506
- function B() {
1507
- k.value?.scheduleDraw();
1508
- }
1509
- function ee(e) {
1510
- if (k.value?.updateSettings(e), e.performanceTest10kKlines) {
1511
- let e = G();
1512
- console.time("updateData-10k"), k.value?.updateData(e), console.timeEnd("updateData-10k"), M.actions.setDataLength(e.length), M.actions.bumpDataVersion();
1513
- } else A.value && k.value?.getData()?.length === 1e4 && A.value.applyConfig(d.semanticConfig);
1494
+ dpr: k.value
1495
+ }), N.value = H(M.value, k.value);
1496
+ let B = C("light");
1497
+ function ie() {}
1498
+ function V(e) {
1499
+ if (S.value?.updateSettingsFacade(e), e.performanceTest10kKlines) {
1500
+ let e = U();
1501
+ console.time("updateData-10k"), S.value?.updateData(e), console.timeEnd("updateData-10k"), D.value = e.length, O.value++;
1502
+ } else T.value && S.value?.getData()?.length === 1e4 && T.value.applyConfig(d.semanticConfig);
1514
1503
  }
1515
- function G() {
1504
+ function U() {
1516
1505
  let e = [], t = (/* @__PURE__ */ new Date("2020-01-01")).getTime(), n = 3e3;
1517
1506
  for (let r = 0; r < 1e4; r++) {
1518
1507
  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);
@@ -1527,34 +1516,34 @@ var rr = {
1527
1516
  }
1528
1517
  return e;
1529
1518
  }
1530
- function se(e, t, n) {
1519
+ function le(e, t, n) {
1531
1520
  let r = e.getBoundingClientRect();
1532
1521
  return {
1533
1522
  width: Math.max(t, Math.round(r.width)),
1534
1523
  height: Math.max(n, Math.round(r.height))
1535
1524
  };
1536
1525
  }
1537
- function le(e) {
1526
+ function ue(e) {
1538
1527
  e && h(() => {
1539
1528
  if (!e.isConnected) return;
1540
- let t = se(e, 180, 80);
1541
- k.value?.interaction.setTooltipSize(t);
1529
+ let t = le(e, 180, 80);
1530
+ S.value?.setTooltipSize(t);
1542
1531
  });
1543
1532
  }
1544
- function ue(e) {
1533
+ function de(e) {
1545
1534
  e && h(() => {
1546
- e.isConnected && (_e.value = se(e, 120, 60));
1535
+ e.isConnected && (_e.value = le(e, 120, 60));
1547
1536
  });
1548
1537
  }
1549
- let de = C({
1538
+ let W = C({
1550
1539
  x: 0,
1551
1540
  y: 0
1552
- }), K = C(!1), fe = null;
1541
+ }), G = C(!1), K = null;
1553
1542
  function q() {
1554
- fe = null;
1543
+ K = null;
1555
1544
  }
1556
- function me(e) {
1557
- return fe ||= e.getBoundingClientRect(), fe;
1545
+ function pe(e) {
1546
+ return K ||= e.getBoundingClientRect(), K;
1558
1547
  }
1559
1548
  let J = E({
1560
1549
  crosshairPos: null,
@@ -1575,13 +1564,13 @@ var rr = {
1575
1564
  hoveredPaneBoundaryId: null,
1576
1565
  isHoveringRightAxis: !1
1577
1566
  }), Y = E(null), he = r(() => {
1578
- let e = R.value;
1579
- return e ? M.state.drawings.find((t) => t.id === e) ?? null : null;
1567
+ let e = I.value;
1568
+ return e ? L.value.find((t) => t.id === e) ?? null : null;
1580
1569
  }), ge = C([]), _e = C({
1581
1570
  width: 220,
1582
1571
  height: 120
1583
1572
  }), ve = r(() => {
1584
- let e = v.value, t = b.value;
1573
+ let e = f.value, t = p.value;
1585
1574
  return !e || !t ? {
1586
1575
  x: 0,
1587
1576
  y: 0
@@ -1589,81 +1578,83 @@ var rr = {
1589
1578
  x: e.offsetLeft,
1590
1579
  y: e.offsetTop
1591
1580
  };
1592
- }), ye = r(() => J.value.hoveredMarkerData), be = r(() => J.value.hoveredCustomMarker), xe = r(() => J.value.isDragging), Se = r(() => J.value.isResizingPaneBoundary), Ce = r(() => J.value.isHoveringPaneBoundary), we = r(() => J.value.hoveredPaneBoundaryId), Te = r(() => J.value.isHoveringRightAxis), Ee = r(() => J.value.hoveredIndex), De = r(() => J.value.crosshairIndex), Oe = r(() => xe.value ? "grabbing" : Se.value || Ce.value ? "ns-resize" : Ee.value === null ? "crosshair" : "pointer"), ke = r(() => {
1581
+ }), ye = r(() => J.value.hoveredMarkerData), be = r(() => J.value.hoveredCustomMarker), xe = r(() => J.value.isDragging), Se = r(() => J.value.isResizingPaneBoundary), Ce = r(() => J.value.isHoveringPaneBoundary), we = r(() => J.value.hoveredPaneBoundaryId), Te = r(() => J.value.isHoveringRightAxis), Ee = r(() => J.value.hoveredIndex);
1582
+ r(() => J.value.crosshairIndex);
1583
+ let De = r(() => xe.value ? "grabbing" : Se.value || Ce.value ? "ns-resize" : Ee.value === null ? "crosshair" : "pointer"), Oe = r(() => {
1593
1584
  let e = J.value.hoveredIndex;
1594
1585
  if (typeof e != "number") return null;
1595
- z.value;
1596
- let t = k.value?.getData();
1586
+ O.value;
1587
+ let t = S.value?.getData();
1597
1588
  return t && e >= 0 && e < t.length ? t[e] : null;
1598
- }), Ae = r(() => J.value.hoveredIndex), je = r(() => J.value.tooltipPos), Me = r(() => ({
1599
- x: je.value.x + ve.value.x,
1600
- y: je.value.y + ve.value.y
1589
+ }), ke = r(() => J.value.hoveredIndex), Ae = r(() => J.value.tooltipPos), je = r(() => ({
1590
+ x: Ae.value.x + ve.value.x,
1591
+ y: Ae.value.y + ve.value.y
1592
+ })), Me = r(() => ({
1593
+ left: `${je.value.x}px`,
1594
+ top: `${je.value.y}px`
1601
1595
  })), Ne = r(() => ({
1602
- left: `${Me.value.x}px`,
1603
- top: `${Me.value.y}px`
1596
+ x: W.value.x + ve.value.x,
1597
+ y: W.value.y + ve.value.y
1604
1598
  })), Pe = r(() => ({
1605
- x: de.value.x + ve.value.x,
1606
- y: de.value.y + ve.value.y
1607
- })), Fe = r(() => ({
1608
- left: `${Pe.value.x}px`,
1609
- top: `${Pe.value.y}px`
1610
- })), Ie = r(() => J.value.tooltipAnchorPlacement), Le = r(() => {
1611
- let e = k.value?.getViewport(), t = v.value, n = e?.plotWidth ?? (t ? t.clientWidth : 0);
1612
- return de.value.x + 12 + _e.value.width + 12 > n ? "left-bottom" : "right-bottom";
1613
- }), Re = r(() => (z.value, k.value?.getData() ?? []));
1614
- function ze(e) {
1599
+ left: `${Ne.value.x}px`,
1600
+ top: `${Ne.value.y}px`
1601
+ })), Fe = r(() => J.value.tooltipAnchorPlacement), Ie = r(() => {
1602
+ let e = S.value?.viewport.peek(), t = f.value, n = e?.plotWidth ?? (t ? t.clientWidth : 0);
1603
+ return W.value.x + 12 + _e.value.width + 12 > n ? "left-bottom" : "right-bottom";
1604
+ }), Le = r(() => (O.value, S.value?.getData() ?? []));
1605
+ function Re(e) {
1615
1606
  Y.value?.setTool(e);
1616
1607
  }
1617
- function Be(e) {
1608
+ function ze(e) {
1618
1609
  let t = he.value;
1619
- !t || !Y.value || (Y.value.updateDrawingStyle(t.id, e), M.actions.bumpDrawingVersion());
1610
+ !t || !Y.value || Y.value.updateDrawingStyle(t.id, e);
1620
1611
  }
1621
- function Ve() {
1612
+ function Be() {
1622
1613
  let e = he.value;
1623
- !e || !Y.value || (Y.value.removeDrawing(e.id), M.actions.setSelectedDrawingId(null), M.actions.bumpDrawingVersion(), M.actions.setDrawings(Y.value.getDrawings()));
1614
+ !e || !Y.value || (Y.value.removeDrawing(e.id), I.value = null, L.value = Y.value.getDrawings());
1624
1615
  }
1625
- function He(e) {
1626
- k.value?.handlePointerEvent(e, { onPointerDown: (e, t) => Y.value?.onPointerDown(e, t) ? (M.actions.setDrawings(Y.value.getDrawings()), M.actions.bumpDrawingVersion(), !0) : !1 });
1616
+ function Ve(e) {
1617
+ S.value?.handlePointerEvent(e, { onPointerDown: (e, t) => Y.value?.onPointerDown(e, t) ? (L.value = Y.value.getDrawings(), !0) : !1 });
1627
1618
  }
1628
- function Ue(e) {
1629
- let t = v.value;
1619
+ function He(e) {
1620
+ let t = f.value;
1630
1621
  if (t) {
1631
- let n = me(t);
1632
- de.value = {
1622
+ let n = pe(t);
1623
+ W.value = {
1633
1624
  x: e.clientX - n.left,
1634
1625
  y: e.clientY - n.top
1635
1626
  };
1636
1627
  }
1637
- k.value?.handlePointerEvent(e, { onPointerMove: (e, t) => Y.value?.onPointerMove(e, t) ? (M.actions.setDrawings(Y.value.getDrawings()), !0) : !1 });
1628
+ S.value?.handlePointerEvent(e, { onPointerMove: (e, t) => Y.value?.onPointerMove(e, t) ? (L.value = Y.value.getDrawings(), !0) : !1 });
1629
+ }
1630
+ function Ue(e) {
1631
+ S.value?.handlePointerEvent(e, { onPointerUp: (e, t) => Y.value?.onPointerUp(e, t) ? (L.value = Y.value.getDrawings(), !0) : !1 });
1638
1632
  }
1639
1633
  function We(e) {
1640
- k.value?.handlePointerEvent(e, { onPointerUp: (e, t) => Y.value?.onPointerUp(e, t) ? (M.actions.setDrawings(Y.value.getDrawings()), !0) : !1 });
1634
+ S.value?.handlePointerEvent(e);
1641
1635
  }
1642
1636
  function Ge(e) {
1643
- k.value?.handlePointerEvent(e);
1637
+ S.value?.handlePointerEvent(e);
1644
1638
  }
1645
1639
  function Ke(e) {
1646
- k.value?.handlePointerEvent(e);
1640
+ S.value?.handlePointerEvent(e);
1647
1641
  }
1648
1642
  function qe(e) {
1649
- k.value?.handlePointerEvent(e);
1643
+ S.value?.handlePointerEvent(e);
1650
1644
  }
1651
1645
  function Je(e) {
1652
- k.value?.handlePointerEvent(e);
1646
+ S.value?.handlePointerEvent(e);
1653
1647
  }
1654
- function Ye(e) {
1655
- k.value?.handlePointerEvent(e);
1648
+ function Ye() {
1649
+ S.value?.handleScrollEvent();
1656
1650
  }
1657
- function Xe() {
1658
- k.value?.handleScrollEvent();
1659
- }
1660
- let Ze = C([]), Qe = r(() => {
1651
+ let Xe = C([]), Ze = r(() => {
1661
1652
  let e = [], t = /* @__PURE__ */ new Set();
1662
1653
  for (let n of Z.value) t.has(n.indicatorId) || (t.add(n.indicatorId), e.push(n.indicatorId));
1663
1654
  return e;
1664
- }), $e = r(() => [...Ze.value, ...Qe.value]), X = C({}), Z = C([]);
1665
- function et() {
1666
- let e = L.value.main ?? 3;
1655
+ }), Qe = r(() => [...Xe.value, ...Ze.value]), X = C({}), Z = C([]);
1656
+ function $e() {
1657
+ let e = F.value.main ?? 3;
1667
1658
  return Z.value.length === 0 ? [{
1668
1659
  id: "main",
1669
1660
  ratio: e,
@@ -1676,78 +1667,49 @@ var rr = {
1676
1667
  role: "price"
1677
1668
  }, ...Z.value.map((e) => ({
1678
1669
  id: e.id,
1679
- ratio: L.value[e.id] ?? 1,
1670
+ ratio: F.value[e.id] ?? 1,
1680
1671
  visible: !0,
1681
1672
  role: "indicator"
1682
1673
  }))];
1683
1674
  }
1684
- function tt(e) {
1685
- return { ...ae[e].defaultParams };
1686
- }
1687
- let nt = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Map();
1688
- function it(e, t) {
1689
- let n = oe({
1690
- paneId: e,
1691
- title: t,
1692
- getTitleInfo: () => pt(e)
1693
- });
1694
- k.value?.useRenderer(n), rt.set(e, n.name);
1675
+ function et(e) {
1676
+ return { ...ne[e].defaultParams };
1695
1677
  }
1696
- function at(e) {
1697
- let t = rt.get(e);
1698
- t && (k.value?.removeRenderer(t), rt.delete(e));
1678
+ let tt = /* @__PURE__ */ new Map();
1679
+ function nt(e = "VOLUME", t) {
1680
+ if (Z.value.length >= Er) return !1;
1681
+ let n = t ?? et(e);
1682
+ return !!S.value?.addIndicator(e, "sub", n);
1699
1683
  }
1700
- function ot(e = "VOLUME", t) {
1701
- if (Z.value.length >= wr) return !1;
1702
- let n = t ?? tt(e), r = k.value?.addIndicator(e, "sub", n);
1703
- return r ? (it(r, e), !0) : !1;
1684
+ function rt(e) {
1685
+ S.value?.removeIndicator(e);
1704
1686
  }
1705
- function st(e) {
1706
- at(e), k.value?.removeIndicator(e);
1687
+ function it() {
1688
+ for (let e of Z.value) S.value?.removeIndicator(e.id);
1689
+ tt.clear();
1707
1690
  }
1708
- function ct() {
1709
- for (let e of Z.value) k.value?.removeIndicator(e.id), at(e.id);
1710
- nt.clear(), rt.clear();
1711
- }
1712
- function lt() {
1713
- let e = d.semanticConfig, t = k.value;
1691
+ function at() {
1692
+ let e = d.semanticConfig, t = S.value;
1714
1693
  if (!t) return;
1715
1694
  let n = e.indicators?.main;
1716
- if (n) for (let e of n) e.enabled && t.enableMainIndicator(e.type, e.params);
1695
+ if (n) for (let e of n) e.enabled && t.addIndicator(e.type, "main", e.params);
1717
1696
  }
1718
- function ut() {
1719
- let e = k.value?.getSubPaneEntries() ?? [];
1720
- rt.clear();
1697
+ function ot() {
1698
+ let e = S.value?.subPanes.peek() ?? [];
1721
1699
  for (let t of e) {
1722
1700
  let { paneId: e, indicatorId: n, params: r } = t, i = e.match(/^(.+)_(\d+)$/);
1723
1701
  if (i) {
1724
1702
  let [, e, t] = i, n = parseInt(t, 10);
1725
- n >= (nt.get(e) ?? 0) && nt.set(e, n + 1);
1703
+ n >= (tt.get(e) ?? 0) && tt.set(e, n + 1);
1726
1704
  }
1727
- it(e, n);
1728
1705
  }
1729
1706
  }
1730
- function dt(e, t) {
1731
- let n = tt(t);
1732
- at(e), k.value?.replaceSubPaneIndicator(e, t, n), it(e, t);
1733
- }
1734
- let ft = /* @__PURE__ */ new Map();
1735
- function pt(e) {
1736
- let t = Z.value.find((t) => t.id === e);
1737
- if (!t) return null;
1738
- let n = k.value?.getData();
1739
- if (!n || n.length === 0) return null;
1740
- let r = De.value, i = n.length, a = ft.get(e);
1741
- if (a && a.idx === r && a.dataLen === i) return a.result;
1742
- let o = ae[t.indicatorId], s = t.params, c = k.value?.plugin, l = c ? o.getTitleInfo(n, r, s, c, e) : null;
1743
- return ft.set(e, {
1744
- idx: r,
1745
- dataLen: i,
1746
- result: l
1747
- }), l;
1707
+ function st(e, t) {
1708
+ let n = et(t);
1709
+ S.value?.replaceSubPaneIndicator(e, t, n);
1748
1710
  }
1749
- function mt(e, t) {
1750
- let n = k.value;
1711
+ function ct(e, t) {
1712
+ let n = S.value;
1751
1713
  if (n) {
1752
1714
  if ([
1753
1715
  "MA",
@@ -1769,42 +1731,33 @@ var rr = {
1769
1731
  "STRUCTURE",
1770
1732
  "ZONES"
1771
1733
  ].includes(e)) {
1772
- let r = Ze.value.find((t) => t === e);
1773
- if (t && !r) n.addIndicator(e, "main", X.value[e]);
1774
- else if (!t && r) {
1775
- let t = e.toUpperCase();
1776
- n.removeIndicator(t);
1777
- }
1734
+ let r = Xe.value.find((t) => t === e);
1735
+ t && !r ? n.addIndicator(e, "main", X.value[e]) : !t && r && n.removeIndicator(e.toUpperCase());
1778
1736
  return;
1779
1737
  }
1780
- if (ie.includes(e)) if (t) {
1781
- if (Z.value.find((t) => t.indicatorId === e) || Z.value.length >= wr) return;
1782
- let t = n.addIndicator(e, "sub", X.value[e]);
1783
- if (t) it(t, e);
1784
- else if (Z.value.length > 0) {
1738
+ if (R.includes(e)) if (t) {
1739
+ if (Z.value.find((t) => t.indicatorId === e) || Z.value.length >= Er) return;
1740
+ if (!n.addIndicator(e, "sub", X.value[e]) && Z.value.length > 0) {
1785
1741
  let t = Z.value[Z.value.length - 1];
1786
- dt(t.id, e);
1742
+ st(t.id, e);
1787
1743
  }
1788
1744
  } else Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
1789
- n.removeIndicator(e.id), at(e.id);
1745
+ n.removeIndicator(e.id);
1790
1746
  });
1791
1747
  }
1792
1748
  }
1793
- function ht(e, t) {
1749
+ function lt(e, t) {
1794
1750
  if (e === "MA" || e === "BOLL" || e === "EXPMA" || e === "ENE") {
1795
- k.value?.updateMainIndicatorParams(e, t);
1796
- return;
1797
- }
1798
- if (ie.includes(e)) {
1799
- Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
1800
- k.value?.updateSubPaneParams(e.id, t);
1801
- });
1751
+ S.value?.updateIndicatorParams(e, t);
1802
1752
  return;
1803
1753
  }
1754
+ R.includes(e) && Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
1755
+ S.value?.updateIndicatorParams(e.id, t);
1756
+ });
1804
1757
  }
1805
- function gt(e) {
1758
+ function ut(e) {
1806
1759
  if (!e.length || Z.value.length <= 1) return;
1807
- let t = e.filter((e) => ie.includes(e));
1760
+ let t = e.filter((e) => R.includes(e));
1808
1761
  if (!t.length) return;
1809
1762
  let n = new Map(Z.value.map((e) => [e.indicatorId, e])), r = [];
1810
1763
  for (let e of t) {
@@ -1816,101 +1769,86 @@ var rr = {
1816
1769
  let i = Z.value.map((e) => e.id), a = r.map((e) => e.id);
1817
1770
  if (i.join("|") === a.join("|")) return;
1818
1771
  Z.value = r;
1819
- let o = k.value;
1820
- o && o.updatePaneLayout(et());
1772
+ let o = S.value;
1773
+ o && o.updatePaneLayout($e());
1821
1774
  }
1822
- let _t = r(() => d.rightAxisWidth + d.priceLabelWidth), vt = M.computed.totalWidth;
1823
- function yt() {
1824
- let e = v.value, t = k.value;
1775
+ let dt = r(() => d.rightAxisWidth + d.priceLabelWidth), ft = r(() => S.value?.getContentWidth() ?? 0);
1776
+ function pt() {
1777
+ let e = f.value, t = S.value;
1825
1778
  if (!e || !t) return;
1826
1779
  let n = t.getData()?.length ?? 0;
1827
1780
  if (n === 0) return;
1828
- let r = t.getCurrentDpr(), { unitPx: i, startXPx: a } = W(F.value, I.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));
1829
- e.scrollLeft = Math.round(c * r) / r, B();
1781
+ let r = t.viewport.peek().dpr, { unitPx: i, startXPx: a } = ae(M.value, N.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));
1782
+ e.scrollLeft = Math.round(c * r) / r;
1830
1783
  }
1831
- function bt(e, t) {
1832
- let n = k.value;
1833
- n && n.zoomToLevel(e, t);
1784
+ function mt(e, t) {
1785
+ S.value?.zoomToLevel(e, t);
1834
1786
  }
1835
1787
  c({
1836
- scheduleRender: B,
1837
- scrollToRight: yt,
1838
- addSubPane: ot,
1839
- removeSubPane: st,
1840
- switchSubIndicator: dt,
1841
- clearAllSubPanes: ct,
1842
- get plugin() {
1843
- return k.value?.plugin;
1844
- },
1845
- zoomToLevel: bt,
1846
- zoomIn: (e) => bt(P.value + 1, e),
1847
- zoomOut: (e) => bt(P.value - 1, e),
1848
- getZoomLevel: () => P.value,
1849
- getZoomLevelCount: () => k.value?.getZoomLevelCount() ?? 10
1788
+ scheduleRender: ie,
1789
+ scrollToRight: pt,
1790
+ addSubPane: nt,
1791
+ removeSubPane: rt,
1792
+ switchSubIndicator: st,
1793
+ clearAllSubPanes: it,
1794
+ zoomToLevel: mt,
1795
+ zoomIn: (e) => mt(A.value + 1, e),
1796
+ zoomOut: (e) => mt(A.value - 1, e),
1797
+ getZoomLevel: () => A.value,
1798
+ getZoomLevelCount: () => S.value?.getZoomLevelCount() ?? 10
1850
1799
  });
1851
- function xt(e) {
1852
- let t = (e) => {
1853
- e.preventDefault();
1854
- let t = k.value;
1855
- t && t.handleWheelEvent(e);
1800
+ function ht() {
1801
+ return (e) => {
1802
+ e.preventDefault(), S.value?.handleWheelEvent(e);
1856
1803
  };
1857
- return e.addEventListener("wheel", t, { passive: !1 }), t;
1858
1804
  }
1859
- function St(e, t, n, r) {
1860
- return new H({
1805
+ function gt(e, t, n, r) {
1806
+ return z({
1861
1807
  container: e,
1808
+ data: [],
1862
1809
  canvasLayer: t,
1863
1810
  rightAxisLayer: n,
1864
- xAxisCanvas: r
1865
- }, {
1811
+ xAxisCanvas: r,
1812
+ initialZoomLevel: d.initialZoomLevel,
1813
+ zoomLevels: d.zoomLevels,
1866
1814
  yPaddingPx: d.yPaddingPx,
1867
1815
  rightAxisWidth: d.rightAxisWidth,
1868
1816
  bottomAxisHeight: d.bottomAxisHeight,
1869
1817
  priceLabelWidth: d.priceLabelWidth,
1870
1818
  minKWidth: d.minKWidth,
1871
- maxKWidth: d.maxKWidth,
1872
- panes: [{
1873
- id: "main",
1874
- ratio: 1
1875
- }],
1876
- paneGap: 0,
1877
- zoomLevels: d.zoomLevels,
1878
- initialZoomLevel: d.initialZoomLevel
1819
+ maxKWidth: d.maxKWidth
1879
1820
  });
1880
1821
  }
1881
- function Ct(e) {
1882
- e.setOnPaneLayoutChange(() => {
1822
+ function _t(e) {
1823
+ let t = e.paneLayout.subscribe(() => {
1883
1824
  q();
1884
- let t = e.getPaneRenderers(), n = v.value && parseInt(getComputedStyle(v.value).borderTopWidth) || 0;
1885
- ge.value = t.slice(0, -1).map((e) => {
1886
- let t = e.getPane();
1825
+ let t = f.value && parseInt(getComputedStyle(f.value).borderTopWidth) || 0;
1826
+ ge.value = e.paneLayout.peek().slice(0, -1).map((n) => {
1827
+ let r = e.getPaneInfo(n.id), i = (r?.top ?? 0) + (r?.height ?? 0);
1887
1828
  return {
1888
- id: t.id,
1889
- top: t.top + t.height + n
1829
+ id: n.id,
1830
+ top: i + t
1890
1831
  };
1891
1832
  });
1892
- });
1893
- let t = e.paneRatios.subscribe(() => {
1894
- let t = e.paneRatios.peek();
1895
- M.actions.setPaneRatios({ ...t });
1896
- }), n = e.viewport.subscribe(() => {
1833
+ }), n = e.paneRatios.subscribe(() => {
1834
+ F.value = { ...e.paneRatios.peek() };
1835
+ }), r = e.viewport.subscribe(() => {
1897
1836
  let t = e.viewport.peek();
1898
- M.state.viewportDpr !== t.dpr && M.actions.setViewportDpr(t.dpr), M.state.viewWidth !== t.plotWidth && M.actions.setViewWidth(t.plotWidth), (M.state.zoomLevel !== t.zoomLevel || M.state.kWidth !== t.kWidth || M.state.kGap !== t.kGap) && M.actions.setZoomState(t.zoomLevel, t.kWidth, t.kGap);
1837
+ k.value !== t.dpr && (k.value = t.dpr), P.value !== t.plotWidth && (P.value = t.plotWidth), (A.value !== t.zoomLevel || M.value !== t.kWidth || N.value !== t.kGap) && (A.value = t.zoomLevel, M.value = t.kWidth, N.value = t.kGap);
1899
1838
  let n = t.desiredScrollLeft;
1900
- n !== void 0 && n !== v.value?.scrollLeft && (q(), h(() => {
1901
- let t = v.value;
1902
- if (!t) return;
1903
- let r = Math.max(0, t.scrollWidth - t.clientWidth), i = Math.min(Math.max(0, n), r), a = e.getCurrentDpr();
1904
- t.scrollLeft = Math.round(i * a) / a;
1839
+ n !== void 0 && n !== f.value?.scrollLeft && (q(), h(() => {
1840
+ let e = f.value;
1841
+ if (!e) return;
1842
+ let r = Math.max(0, e.scrollWidth - e.clientWidth), i = Math.min(Math.max(0, n), r), a = t.dpr;
1843
+ e.scrollLeft = Math.round(i * a) / a;
1905
1844
  }));
1906
- }), r = e.data.subscribe(() => {
1907
- let t = e.data.peek();
1908
- M.actions.setDataLength(t.length), M.actions.bumpDataVersion();
1909
- }), i = e.theme.subscribe(() => {
1910
- N.value = e.theme.peek();
1911
- }), a = e.indicators.subscribe(() => {
1845
+ }), i = e.data.subscribe(() => {
1846
+ D.value = e.data.peek().length, O.value++;
1847
+ }), a = e.theme.subscribe(() => {
1848
+ B.value = e.theme.peek();
1849
+ }), o = e.indicators.subscribe(() => {
1912
1850
  let t = e.indicators.peek(), n = t.filter((e) => e.role === "main").map((e) => e.definitionId);
1913
- Ze.value = n;
1851
+ Xe.value = n;
1914
1852
  let r = { ...X.value };
1915
1853
  for (let e of t) e.role === "main" && e.params && Object.keys(e.params).length > 0 && (r[e.definitionId] = { ...e.params });
1916
1854
  e.updateRendererConfig("mainIndicatorLegend", { indicators: {
@@ -1931,7 +1869,7 @@ var rr = {
1931
1869
  params: r.ENE || {}
1932
1870
  }
1933
1871
  } }), X.value = r;
1934
- }), o = e.subPanes.subscribe(() => {
1872
+ }), s = e.subPanes.subscribe(() => {
1935
1873
  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));
1936
1874
  for (let e of t) i.has(e.paneId) || r.push({
1937
1875
  id: e.paneId,
@@ -1943,71 +1881,65 @@ var rr = {
1943
1881
  for (let e of t) e.params && Object.keys(e.params).length > 0 && (a[e.indicatorId] = { ...e.params });
1944
1882
  X.value = a;
1945
1883
  });
1946
- x(() => {
1947
- n(), r(), t(), i(), a(), o();
1884
+ b(() => {
1885
+ r(), i(), n(), t(), a(), o(), s();
1948
1886
  });
1949
1887
  }
1950
- function wt(e) {
1951
- let t = D.value?.getSettings() ?? { showVolumePriceMarkers: !0 };
1952
- if (e.updateSettings(t), t.performanceTest10kKlines) {
1953
- let t = G();
1888
+ function vt(e) {
1889
+ let t = y.value?.getSettings() ?? { showVolumePriceMarkers: !0 };
1890
+ if (e.updateSettingsFacade(t), t.performanceTest10kKlines) {
1891
+ let t = U();
1954
1892
  console.time("updateData-10k"), e.updateData(t), console.timeEnd("updateData-10k");
1955
1893
  }
1956
1894
  }
1957
- function Et(e) {
1958
- Y.value = new ce(e), Y.value.setCallbacks({
1895
+ function yt(e) {
1896
+ Y.value = new te(e), Y.value.setCallbacks({
1959
1897
  onDrawingCreated: (e) => {
1960
- M.actions.setDrawings([...M.state.drawings, e]), M.actions.setSelectedDrawingId(e.id);
1898
+ L.value = [...L.value, e], I.value = e.id;
1961
1899
  },
1962
1900
  onToolChange: () => {},
1963
1901
  onDrawingSelected: (e) => {
1964
- M.actions.setSelectedDrawingId(e?.id ?? null);
1902
+ I.value = e?.id ?? null;
1965
1903
  }
1966
1904
  });
1967
1905
  }
1968
- function Dt(e) {
1969
- e.interaction.setTooltipAnchorPositioning(K.value), e.interaction.setOnInteractionChange((e) => {
1970
- J.value = e;
1971
- }), e.interaction.setOnPinchZoom((t, n) => {
1972
- if (!e) return;
1973
- let r = v.value;
1974
- if (!r) return;
1975
- let i = n - r.getBoundingClientRect().left;
1976
- e.handlePinchZoom(t, i);
1977
- }), J.value = e.interaction.getInteractionSnapshot(), M.actions.setViewportDpr(e.getCurrentDpr()), e.resize();
1978
- }
1979
- function Ot(e) {
1980
- te(d.dataFetcher), A.value = new V(e), A.value.on("config:error", (e) => {
1906
+ function bt(e) {
1907
+ e.setTooltipAnchorPositioning(G.value), e.interactionState.subscribe(() => {
1908
+ J.value = e.interactionState.peek();
1909
+ }), J.value = e.interactionState.peek(), k.value = e.viewport.peek().dpr;
1910
+ }
1911
+ function xt(e) {
1912
+ ce(d.dataFetcher), T.value = new se(e), T.value.on("config:error", (e) => {
1981
1913
  console.error("Semantic config error:", e);
1982
- }), A.value.on("config:ready", () => {
1983
- lt(), ut(), h(() => yt());
1984
- }), A.value.applyConfig(d.semanticConfig).then((e) => {
1914
+ }), T.value.on("config:ready", () => {
1915
+ at(), ot(), h(() => pt());
1916
+ }), T.value.applyConfig(d.semanticConfig).then((e) => {
1985
1917
  e && !e.success && console.error("Semantic config apply failed:", e.errors);
1986
1918
  });
1987
1919
  }
1988
- return y(() => {
1989
- K.value = !1;
1990
- let e = v.value, t = p.value, n = m.value, r = f.value;
1991
- if (!e || !t || !n || !r) return;
1992
- let i = xt(e), a = St(e, t, n, r);
1993
- k.value = a, Ct(a), a.applyRenderState(M.state.kWidth, M.state.kGap, M.state.zoomLevel), wt(a), Et(a), Dt(a), Ot(a), a.__onWheel = i;
1994
- }), x(() => {
1995
- let e = k.value;
1996
- if (e) {
1997
- let t = e.__onWheel, n = v.value;
1998
- t && n && n.removeEventListener("wheel", t), e.destroy();
1999
- }
2000
- k.value = null, Y.value = null;
1920
+ return ee(() => {
1921
+ G.value = !1;
1922
+ let e = f.value, t = p.value;
1923
+ if (!e || !t) return;
1924
+ let n = ht();
1925
+ e.addEventListener("wheel", n, { passive: !1 });
1926
+ let r = e.querySelector(".canvas-layer"), i = e.querySelector(".x-axis-canvas"), a = gt(e, r, t.querySelector(".right-axis-host"), i);
1927
+ S.value = a, _t(a), vt(a), yt(a), bt(a), xt(a);
1928
+ }), b(() => {
1929
+ let e = S.value;
1930
+ e && (S.value = null, e.dispose()), Y.value = null;
2001
1931
  }), j(() => d.yPaddingPx, (e) => {
2002
- k.value?.updateOptions({ yPaddingPx: e });
1932
+ S.value?.updateOptionsFacade({ yPaddingPx: e });
2003
1933
  }), j(() => d.semanticConfig, async (e, t) => {
2004
1934
  if (e && e !== t) {
2005
- let t = await A.value?.applyConfig(e);
1935
+ let t = await T.value?.applyConfig(e);
2006
1936
  t && !t.success && console.error("Semantic config apply failed:", t.errors);
2007
1937
  }
2008
- }, { deep: !0 }), (r, c) => (S(), o("div", {
1938
+ }, { deep: !0 }), (r, c) => (x(), o("div", {
1939
+ ref_key: "chartWrapperRef",
1940
+ ref: m,
2009
1941
  class: "chart-wrapper",
2010
- "data-theme": N.value
1942
+ "data-theme": B.value
2011
1943
  }, [s("div", { class: g(["chart-stage", {
2012
1944
  "is-dragging": xe.value,
2013
1945
  "is-resizing-pane": Se.value,
@@ -2016,78 +1948,70 @@ var rr = {
2016
1948
  "is-hovering-kline": Ee.value !== null
2017
1949
  }]) }, [l(xr, {
2018
1950
  ref_key: "toolbarRef",
2019
- ref: D,
1951
+ ref: y,
2020
1952
  "is-fullscreen": n.isFullscreen,
2021
- onSelectTool: ze,
1953
+ onSelectTool: Re,
2022
1954
  onToggleFullscreen: c[0] ||= (e) => r.$emit("toggleFullscreen"),
2023
- onZoomIn: c[1] ||= (e) => bt(P.value + 1),
2024
- onZoomOut: c[2] ||= (e) => bt(P.value - 1),
2025
- onSettingsChange: ee
1955
+ onZoomIn: c[1] ||= (e) => mt(A.value + 1),
1956
+ onZoomOut: c[2] ||= (e) => mt(A.value - 1),
1957
+ onSettingsChange: V
2026
1958
  }, null, 8, ["is-fullscreen"]), s("div", {
2027
1959
  class: "chart-main",
2028
1960
  ref_key: "chartMainRef",
2029
- ref: b
1961
+ ref: p
2030
1962
  }, [
2031
- s("div", Cr, [(S(!0), o(e, null, w(ge.value, (e) => (S(), o("div", {
1963
+ s("div", Cr, [(x(!0), o(e, null, w(ge.value, (e) => (x(), o("div", {
2032
1964
  key: e.id,
2033
1965
  class: g(["pane-separator-line", { "is-active": we.value === e.id }]),
2034
1966
  style: _({ top: `${e.top}px` })
2035
1967
  }, null, 6))), 128))]),
2036
1968
  s("div", {
2037
1969
  ref_key: "tooltipLayerRef",
2038
- ref: T,
1970
+ ref: v,
2039
1971
  class: "tooltip-layer"
2040
1972
  }, null, 512),
2041
1973
  s("div", {
2042
1974
  class: "chart-container",
2043
- style: _({ cursor: Oe.value }),
1975
+ style: _({ cursor: De.value }),
2044
1976
  ref_key: "containerRef",
2045
- ref: v,
2046
- onScrollPassive: Xe,
2047
- onPointerdown: He,
2048
- onPointermove: Ue,
2049
- onPointerup: We,
2050
- onPointerleave: Ge
1977
+ ref: f,
1978
+ onScrollPassive: Ye,
1979
+ onPointerdown: Ve,
1980
+ onPointermove: He,
1981
+ onPointerup: Ue,
1982
+ onPointerleave: We
2051
1983
  }, [s("div", {
2052
1984
  class: "scroll-content",
2053
- style: _({ width: O(vt) + "px" })
2054
- }, [s("div", {
2055
- class: "canvas-layer",
2056
- ref_key: "canvasLayerRef",
2057
- ref: p
2058
- }, [s("canvas", {
2059
- class: "x-axis-canvas",
2060
- ref_key: "xAxisCanvasRef",
2061
- ref: f
2062
- }, null, 512), he.value ? (S(), i(pe, {
1985
+ style: _({ width: ft.value + "px" })
1986
+ }, [s("div", wr, [s("canvas", Tr, null, 512), he.value ? (x(), i(fe, {
2063
1987
  key: 0,
2064
1988
  drawing: he.value,
2065
- onUpdateStyle: Be,
2066
- onDelete: Ve
1989
+ onUpdateStyle: ze,
1990
+ onDelete: Be
2067
1991
  }, null, 8, ["drawing"])) : a("", !0)], 512)], 4)], 36),
2068
- T.value ? (S(), i(t, {
1992
+ v.value ? (x(), i(t, {
2069
1993
  key: 0,
2070
- to: T.value
1994
+ to: v.value
2071
1995
  }, [
2072
- ke.value ? (S(), o("div", {
1996
+ Oe.value ? (x(), o("div", {
2073
1997
  key: 0,
2074
- class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": K.value }]),
2075
- style: _(Ne.value)
1998
+ class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": G.value }]),
1999
+ style: _(Me.value)
2076
2000
  }, null, 6)) : a("", !0),
2077
- ye.value || be.value ? (S(), o("div", {
2001
+ ye.value || be.value ? (x(), o("div", {
2078
2002
  key: 1,
2079
- class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": K.value }]),
2080
- style: _(Fe.value)
2003
+ class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": G.value }]),
2004
+ style: _(Pe.value)
2081
2005
  }, null, 6)) : a("", !0),
2082
- ke.value ? (S(), i(Ht, {
2006
+ Oe.value ? (x(), i(Ht, {
2083
2007
  key: 2,
2084
- k: ke.value,
2085
- index: Ae.value,
2086
- data: Re.value,
2087
- pos: Me.value,
2088
- "set-el": le,
2089
- "use-anchor": K.value,
2090
- "anchor-placement": Ie.value
2008
+ k: Oe.value,
2009
+ index: ke.value,
2010
+ data: Le.value,
2011
+ pos: je.value,
2012
+ "set-el": ue,
2013
+ "use-anchor": G.value,
2014
+ "anchor-placement": Fe.value
2091
2015
  }, null, 8, [
2092
2016
  "k",
2093
2017
  "index",
@@ -2096,13 +2020,13 @@ var rr = {
2096
2020
  "use-anchor",
2097
2021
  "anchor-placement"
2098
2022
  ])) : a("", !0),
2099
- ye.value || be.value ? (S(), i(Gt, {
2023
+ ye.value || be.value ? (x(), i(Gt, {
2100
2024
  key: 3,
2101
2025
  marker: ye.value || be.value,
2102
- pos: Pe.value,
2103
- "use-anchor": K.value,
2104
- "anchor-placement": Le.value,
2105
- "set-el": ue
2026
+ pos: Ne.value,
2027
+ "use-anchor": G.value,
2028
+ "anchor-placement": Ie.value,
2029
+ "set-el": de
2106
2030
  }, null, 8, [
2107
2031
  "marker",
2108
2032
  "pos",
@@ -2112,25 +2036,24 @@ var rr = {
2112
2036
  ], 8, ["to"])) : a("", !0),
2113
2037
  s("div", {
2114
2038
  class: "right-axis-host",
2115
- ref_key: "rightAxisLayerRef",
2116
- ref: m,
2117
- style: _({ width: _t.value + "px" }),
2118
- onPointerdown: Ke,
2119
- onPointermove: qe,
2120
- onPointerup: Je,
2121
- onPointerleave: Ye
2039
+ ref: "rightAxisLayerRef",
2040
+ style: _({ width: dt.value + "px" }),
2041
+ onPointerdown: Ge,
2042
+ onPointermove: Ke,
2043
+ onPointerup: qe,
2044
+ onPointerleave: Je
2122
2045
  }, null, 36)
2123
2046
  ], 512)], 2), l(Tt, {
2124
- "active-indicators": $e.value,
2047
+ "active-indicators": Qe.value,
2125
2048
  "indicator-params": X.value,
2126
- onToggle: mt,
2127
- onUpdateParams: ht,
2128
- onReorderSubIndicators: gt
2049
+ onToggle: ct,
2050
+ onUpdateParams: lt,
2051
+ onReorderSubIndicators: ut
2129
2052
  }, null, 8, ["active-indicators", "indicator-params"])], 8, Sr));
2130
2053
  }
2131
- }), [["__scopeId", "data-v-b0cae9be"]]), Er = {
2054
+ }), [["__scopeId", "data-v-4ea7c1af"]]), Or = {
2132
2055
  name: "@363045841yyt/klinechart",
2133
- version: "0.7.5",
2056
+ version: "0.7.6",
2134
2057
  description: "Vue 3 bindings for @363045841yyt/klinechart-core. Idiomatic composables, SFC components.",
2135
2058
  license: "MIT",
2136
2059
  repository: {
@@ -2156,13 +2079,15 @@ var rr = {
2156
2079
  default: "./dist/index.cjs"
2157
2080
  }
2158
2081
  },
2082
+ "./web-component": { import: { default: "./dist/kline-chart.js" } },
2159
2083
  "./style.css": "./dist/klinechart.css"
2160
2084
  },
2161
2085
  files: ["dist", "src"],
2162
2086
  publishConfig: { access: "public" },
2163
2087
  scripts: {
2164
2088
  dev: "vite --config preview/vite.config.ts",
2165
- build: "vite build && node -e \"require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')\"",
2089
+ build: "vite build",
2090
+ "build:wc": "cross-env BUILD_TARGET=web-component vite build",
2166
2091
  postbuild: "node -e \"require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')\"",
2167
2092
  test: "vitest run",
2168
2093
  "test:watch": "vitest",
@@ -2187,6 +2112,7 @@ var rr = {
2187
2112
  "@size-limit/preset-small-lib": "^12.1.0",
2188
2113
  "@vitejs/plugin-vue": "^6.0.0",
2189
2114
  "@vue/test-utils": "^2.4.10",
2115
+ "cross-env": "^7.0.3",
2190
2116
  jsdom: "^29.1.1",
2191
2117
  publint: "^0.3.0",
2192
2118
  "size-limit": "^12.1.0",
@@ -2194,28 +2120,29 @@ var rr = {
2194
2120
  "unplugin-icons": "^23.0.1",
2195
2121
  vite: "^8.0.14",
2196
2122
  "vite-plugin-babel": "^1.3.2",
2123
+ "vite-plugin-css-injected-by-js": "^5.0.1",
2197
2124
  "vite-plugin-dts": "^5.0.1",
2198
2125
  vitest: "^4.1.5",
2199
2126
  vue: "^3.5.0"
2200
2127
  }
2201
- }.version, Dr = null;
2202
- function Or(e) {
2203
- Dr = e;
2128
+ }.version, kr = null;
2129
+ function Ar(e) {
2130
+ kr = e;
2204
2131
  }
2205
- function kr(e) {
2132
+ function jr(e) {
2206
2133
  if (e.container == null) throw Error("[@363045841yyt/klinechart] createChart: `container` is required and must be a non-null HTMLElement");
2207
- if (Dr === null) throw Error("[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).");
2208
- return Dr(e);
2134
+ if (kr === null) throw Error("[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).");
2135
+ return kr(e);
2209
2136
  }
2210
2137
  function $(e) {
2211
2138
  let t = E(e.peek());
2212
- return b(e.subscribe(() => {
2139
+ return y(e.subscribe(() => {
2213
2140
  t.value = e.peek();
2214
2141
  })), t;
2215
2142
  }
2216
- function Ar(e, t) {
2143
+ function Mr(e, t) {
2217
2144
  let n = E(null), r = (e) => {
2218
- e == null || n.value != null || (n.value = kr({
2145
+ e == null || n.value != null || (n.value = jr({
2219
2146
  ...t,
2220
2147
  container: e
2221
2148
  }));
@@ -2231,11 +2158,11 @@ function Ar(e, t) {
2231
2158
  let e = n.value;
2232
2159
  e != null && (e.dispose(), n.value = null);
2233
2160
  };
2234
- return b(a), v(a), { chart: n };
2161
+ return y(a), v(a), { chart: n };
2235
2162
  }
2236
- function jr(e) {
2163
+ function Nr(e) {
2237
2164
  let t = E(e.indicators.peek());
2238
- return b(e.indicators.subscribe(() => {
2165
+ return y(e.indicators.subscribe(() => {
2239
2166
  t.value = e.indicators.peek();
2240
2167
  })), {
2241
2168
  indicators: t,
@@ -2244,27 +2171,27 @@ function jr(e) {
2244
2171
  updateParams: e.updateIndicatorParams.bind(e)
2245
2172
  };
2246
2173
  }
2247
- function Mr(e) {
2174
+ function Pr(e) {
2248
2175
  let t = E(e.interactionState.peek());
2249
- return b(e.interactionState.subscribe(() => {
2176
+ return y(e.interactionState.subscribe(() => {
2250
2177
  t.value = e.interactionState.peek();
2251
2178
  })), t;
2252
2179
  }
2253
- function Nr(e) {
2180
+ function Fr(e) {
2254
2181
  let t = E(e.paneRatios.peek());
2255
- return b(e.paneRatios.subscribe(() => {
2182
+ return y(e.paneRatios.subscribe(() => {
2256
2183
  t.value = e.paneRatios.peek();
2257
2184
  })), t;
2258
2185
  }
2259
- function Pr(e) {
2186
+ function Ir(e) {
2260
2187
  let t = E(e.viewport.peek());
2261
- return b(e.viewport.subscribe(() => {
2188
+ return y(e.viewport.subscribe(() => {
2262
2189
  t.value = e.viewport.peek();
2263
2190
  })), t;
2264
2191
  }
2265
- function Fr(e) {
2192
+ function Lr(e) {
2266
2193
  let t = L({ catalog: e.catalog });
2267
- b(() => t.dispose());
2194
+ y(() => t.dispose());
2268
2195
  let n = $(t.filteredMain), r = $(t.filteredSub), i = $(t.menuOpen), a = $(t.searchQuery);
2269
2196
  function o(t) {
2270
2197
  let n = e.catalog.find((e) => e.id === t);
@@ -2291,7 +2218,7 @@ function Fr(e) {
2291
2218
  isActive: c
2292
2219
  };
2293
2220
  }
2294
- var Ir = u({
2221
+ var Rr = u({
2295
2222
  name: "KLineChart",
2296
2223
  props: {
2297
2224
  data: {
@@ -2321,10 +2248,10 @@ var Ir = u({
2321
2248
  },
2322
2249
  setup(e, { emit: t, expose: n }) {
2323
2250
  let r = E(null), i = d(), a = E(null);
2324
- y(() => {
2251
+ ee(() => {
2325
2252
  let n = r.value;
2326
2253
  n != null && (i.run(() => {
2327
- if (a.value = kr({
2254
+ if (a.value = jr({
2328
2255
  container: n,
2329
2256
  data: e.data,
2330
2257
  initialZoomLevel: e.initialZoomLevel,
@@ -2336,14 +2263,14 @@ var Ir = u({
2336
2263
  let n = e.viewport.peek();
2337
2264
  t("zoomLevelChange", n.zoomLevel, n.kWidth);
2338
2265
  };
2339
- n(), b(e.viewport.subscribe(n));
2266
+ n(), y(e.viewport.subscribe(n));
2340
2267
  }
2341
2268
  }), j(() => e.data, (e) => {
2342
2269
  a.value?.setData(e);
2343
2270
  }), j(() => e.theme, (e) => {
2344
2271
  a.value?.setTheme(e);
2345
2272
  }));
2346
- }), x(() => {
2273
+ }), b(() => {
2347
2274
  a.value?.dispose(), a.value = null, i.stop();
2348
2275
  }), n({
2349
2276
  getController: () => a.value,
@@ -2370,9 +2297,9 @@ var Ir = u({
2370
2297
  }
2371
2298
  });
2372
2299
  }
2373
- }), Lr = { install(e) {
2374
- e.component("KLineChart", Ir);
2300
+ }), zr = { install(e) {
2301
+ e.component("KLineChart", Rr);
2375
2302
  } };
2376
- Or(I);
2303
+ Ar(I);
2377
2304
  //#endregion
2378
- export { F as CORE_VERSION, pe as DrawingStyleToolbar, ke as IndicatorParams, Tt as IndicatorSelector, Ir as KLineChart, Tr as KLineChartVue, Ht as KLineTooltip, Lr as KMapPlugin, xr as LeftToolbar, Gt as MarkerTooltip, Er as VERSION, Or as __setControllerFactory, $ as coreSignalToVueRef, kr as createChart, Ar as useChart, Fr as useIndicatorSelector, jr as useIndicators, Mr as useInteractionState, Nr as usePaneRatios, Pr as useViewport };
2305
+ export { F as CORE_VERSION, fe as DrawingStyleToolbar, je as IndicatorParams, Tt as IndicatorSelector, Rr as KLineChart, Dr as KLineChartVue, Ht as KLineTooltip, zr as KMapPlugin, xr as LeftToolbar, Gt as MarkerTooltip, Or as VERSION, Ar as __setControllerFactory, $ as coreSignalToVueRef, jr as createChart, Mr as useChart, Lr as useIndicatorSelector, Nr as useIndicators, Pr as useInteractionState, Fr as usePaneRatios, Ir as useViewport };