@363045841yyt/klinechart 0.7.5 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +4 -4
  2. package/dist/components/ChartSettingsDialog.vue.d.ts +14 -0
  3. package/dist/components/ChartSettingsDialog.vue.d.ts.map +1 -0
  4. package/dist/components/ColorPresetPanel.vue.d.ts +12 -0
  5. package/dist/components/ColorPresetPanel.vue.d.ts.map +1 -0
  6. package/dist/components/DrawingStyleToolbar.vue.d.ts +1 -15
  7. package/dist/components/DrawingStyleToolbar.vue.d.ts.map +1 -1
  8. package/dist/components/IndicatorParams.vue.d.ts.map +1 -1
  9. package/dist/components/IndicatorSelector.vue.d.ts.map +1 -1
  10. package/dist/components/KLineChart.vue.d.ts +7 -6
  11. package/dist/components/KLineChart.vue.d.ts.map +1 -1
  12. package/dist/components/KLineTooltip.vue.d.ts +9 -2
  13. package/dist/components/KLineTooltip.vue.d.ts.map +1 -1
  14. package/dist/components/LeftToolbar.vue.d.ts +4 -3
  15. package/dist/components/LeftToolbar.vue.d.ts.map +1 -1
  16. package/dist/components/MarkerTooltip.vue.d.ts +1 -12
  17. package/dist/components/MarkerTooltip.vue.d.ts.map +1 -1
  18. package/dist/components/index.d.ts +1 -0
  19. package/dist/components/index.d.ts.map +1 -1
  20. package/dist/composables/useFullscreenTeleportTarget.d.ts.map +1 -1
  21. package/dist/index.cjs +2 -2
  22. package/dist/index.css +1 -0
  23. package/dist/index.d.cts +5 -5
  24. package/dist/index.d.ts +5 -5
  25. package/dist/index.js +1009 -905
  26. package/dist/version.d.ts +1 -1
  27. package/dist/web-component.d.ts +18 -0
  28. package/dist/web-component.d.ts.map +1 -0
  29. package/package.json +10 -2
  30. package/src/__tests__/_mockController.ts +11 -1
  31. package/src/components/ChartSettingsDialog.vue +624 -0
  32. package/src/components/ColorPresetPanel.vue +289 -0
  33. package/src/components/DrawingStyleToolbar.vue +12 -25
  34. package/src/components/IndicatorParams.vue +58 -57
  35. package/src/components/IndicatorSelector.vue +91 -88
  36. package/src/components/KLineChart.vue +267 -442
  37. package/src/components/KLineTooltip.vue +19 -13
  38. package/src/components/LeftToolbar.vue +35 -393
  39. package/src/components/MarkerTooltip.vue +5 -16
  40. package/src/components/index.ts +1 -0
  41. package/src/composables/useFullscreenTeleportTarget.ts +0 -2
  42. package/src/web-component.ts +14 -0
  43. package/dist/klinechart.css +0 -2
package/dist/index.js CHANGED
@@ -1,21 +1,81 @@
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";
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";
14
- //#region src/components/DrawingStyleToolbar.vue?vue&type=script&setup=true&lang.ts
15
- var le = {
1
+ import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, effectScope as d, h as f, inject as p, markRaw as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, onScopeDispose as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, resolveDynamicComponent as E, shallowRef as D, toDisplayString as O, unref as k, vModelCheckbox as A, vModelSelect as j, watch as M, withCtx as N, withDirectives as P, withModifiers as F } from "vue";
2
+ import { COLOR_PRESET_ITEMS as I, VERSION as L, createChartController as R, createIndicatorSelectorController as z, darkTheme as B, lightTheme as ee, normalizeColorPresetSettings as V, resolveThemeColors as te, themeToCssVars as H } from "@363045841yyt/klinechart-core";
3
+ import { DrawingInteractionController as ne, SUB_PANE_INDICATORS as re, SUB_PANE_INDICATOR_CONFIGS as ie, allIndicators as U, createChartController as ae, createIndicatorSelectorController as oe, findIndicator as se, getPhysicalKLineConfig as ce, isSubIndicatorId as W, kGapFromKWidth as le, zoomLevelToKWidth as ue } from "@363045841yyt/klinechart-core/controllers";
4
+ import { SemanticChartController as de, __setDataFetcher as fe } from "@363045841yyt/klinechart-core/semantic";
5
+ import { DEFAULT_SETTINGS as G, SETTINGS_STORAGE_KEY as K } from "@363045841yyt/klinechart-core/config";
6
+ //#region src/components/ColorPresetPanel.vue?vue&type=script&setup=true&lang.ts
7
+ var pe = { class: "color-preset-tools" }, me = {
8
+ class: "theme-tabs",
9
+ role: "tablist",
10
+ "aria-label": "颜色主题"
11
+ }, he = ["onClick"], ge = { class: "color-group-label" }, _e = { class: "color-grid" }, ve = ["value", "onInput"], ye = /* @__PURE__ */ u({
12
+ __name: "ColorPresetPanel",
13
+ props: { colorPresetSettings: {} },
14
+ emits: ["update:colorPresetSettings"],
15
+ setup(t, { emit: n }) {
16
+ let i = t, a = n, c = [{
17
+ value: "light",
18
+ label: "浅色"
19
+ }, {
20
+ value: "dark",
21
+ label: "深色"
22
+ }], l = {
23
+ canvas: "画布",
24
+ candle: "K线 / 成交量",
25
+ axis: "坐标轴",
26
+ interaction: "交互 / 标记"
27
+ }, u = r(() => Object.keys(l).map((e) => ({
28
+ group: e,
29
+ label: l[e],
30
+ items: I.filter((t) => t.group === e)
31
+ })).filter((e) => e.items.length > 0)), d = w("light");
32
+ function f(e, t) {
33
+ return (e === "dark" ? B : ee).colors[t];
34
+ }
35
+ function p(e) {
36
+ return V(i.colorPresetSettings)[d.value]?.[e] ?? f(d.value, e);
37
+ }
38
+ function m(e, t) {
39
+ let n = V(i.colorPresetSettings);
40
+ a("update:colorPresetSettings", {
41
+ ...n,
42
+ [d.value]: {
43
+ ...n[d.value],
44
+ [e]: t
45
+ }
46
+ });
47
+ }
48
+ function h() {
49
+ let e = { ...V(i.colorPresetSettings) };
50
+ delete e[d.value], a("update:colorPresetSettings", e);
51
+ }
52
+ return (t, n) => (S(), o("div", null, [s("div", pe, [s("div", me, [(S(), o(e, null, T(c, (e) => s("button", {
53
+ key: e.value,
54
+ type: "button",
55
+ class: g(["theme-tab", { active: d.value === e.value }]),
56
+ onClick: (t) => d.value = e.value
57
+ }, O(e.label), 11, he)), 64))]), s("button", {
58
+ type: "button",
59
+ class: "color-reset-btn",
60
+ onClick: h
61
+ }, " 重置颜色 ")]), (S(!0), o(e, null, T(u.value, (t) => (S(), o(e, { key: t.group }, [s("div", ge, O(t.label), 1), s("div", _e, [(S(!0), o(e, null, T(t.items, (e) => (S(), o("label", {
62
+ key: e.key,
63
+ class: "color-item"
64
+ }, [s("span", null, O(e.label), 1), s("input", {
65
+ type: "color",
66
+ class: "color-input",
67
+ value: p(e.key),
68
+ onInput: (t) => m(e.key, t.target.value)
69
+ }, null, 40, ve)]))), 128))])], 64))), 128))]));
70
+ }
71
+ }), q = (e, t) => {
72
+ let n = e.__vccOpts || e;
73
+ for (let [e, r] of t) n[e] = r;
74
+ return n;
75
+ }, be = /* @__PURE__ */ q(ye, [["__scopeId", "data-v-a52947a4"]]), xe = {
16
76
  class: "toolbar-item color-item",
17
77
  title: "颜色"
18
- }, ue = ["value"], de = ["value"], K = ["value"], fe = /* @__PURE__ */ u({
78
+ }, Se = ["value"], Ce = ["value"], J = ["value"], we = /* @__PURE__ */ q(/* @__PURE__ */ u({
19
79
  __name: "DrawingStyleToolbar",
20
80
  props: { drawing: {} },
21
81
  emits: ["updateStyle", "delete"],
@@ -36,11 +96,11 @@ var le = {
36
96
  }
37
97
  return (t, n) => (S(), o("div", {
38
98
  class: "drawing-style-toolbar",
39
- onPointerdown: n[4] ||= P(() => {}, ["stop"]),
40
- onPointermove: n[5] ||= P(() => {}, ["stop"]),
41
- onPointerup: n[6] ||= P(() => {}, ["stop"])
99
+ onPointerdown: n[4] ||= F(() => {}, ["stop"]),
100
+ onPointermove: n[5] ||= F(() => {}, ["stop"]),
101
+ onPointerup: n[6] ||= F(() => {}, ["stop"])
42
102
  }, [
43
- s("div", le, [s("span", {
103
+ s("div", xe, [s("span", {
44
104
  class: "color-swatch",
45
105
  style: _({ background: e.drawing.style.stroke ?? "#2962ff" })
46
106
  }, null, 4), s("input", {
@@ -48,7 +108,7 @@ var le = {
48
108
  class: "color-input",
49
109
  value: e.drawing.style.stroke ?? "#2962ff",
50
110
  onInput: n[0] ||= (e) => i(e.target.value)
51
- }, null, 40, ue)]),
111
+ }, null, 40, Se)]),
52
112
  s("select", {
53
113
  class: "toolbar-select",
54
114
  value: e.drawing.style.strokeWidth ?? 1,
@@ -59,7 +119,7 @@ var le = {
59
119
  s("option", { value: 2 }, "2px", -1),
60
120
  s("option", { value: 3 }, "3px", -1),
61
121
  s("option", { value: 4 }, "4px", -1)
62
- ]], 40, de),
122
+ ]], 40, Ce),
63
123
  s("select", {
64
124
  class: "toolbar-select",
65
125
  value: e.drawing.style.strokeStyle ?? "solid",
@@ -69,7 +129,7 @@ var le = {
69
129
  s("option", { value: "solid" }, "实线", -1),
70
130
  s("option", { value: "dashed" }, "虚线", -1),
71
131
  s("option", { value: "dotted" }, "点线", -1)
72
- ]], 40, K),
132
+ ]], 40, J),
73
133
  s("button", {
74
134
  type: "button",
75
135
  class: "toolbar-btn delete-btn",
@@ -91,26 +151,32 @@ var le = {
91
151
  ], -1)]])
92
152
  ], 32));
93
153
  }
94
- }), q = (e, t) => {
95
- let n = e.__vccOpts || e;
96
- for (let [e, r] of t) n[e] = r;
97
- 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 = {
154
+ }), [["__scopeId", "data-v-02a1f4d6"]]), Y = Symbol("fullscreen-teleport-target");
155
+ function Te(e) {
156
+ C(Y, e);
157
+ }
158
+ function Ee() {
159
+ let e = p(Y, null);
160
+ return r(() => e?.value ?? "body");
161
+ }
162
+ //#endregion
163
+ //#region src/components/IndicatorParams.vue?vue&type=script&setup=true&lang.ts
164
+ var De = { class: "params-header" }, Oe = { class: "header-left" }, ke = { class: "params-title" }, Ae = { class: "header-right" }, je = {
99
165
  key: 0,
100
166
  class: "indicator-description"
101
- }, _e = { class: "params-body" }, ve = { class: "param-header" }, ye = { class: "param-label" }, be = { class: "param-label-text" }, xe = {
167
+ }, Me = { class: "params-body" }, Ne = { class: "param-header" }, Pe = { class: "param-label" }, Fe = { class: "param-label-text" }, Ie = {
102
168
  key: 0,
103
169
  class: "param-range"
104
- }, Se = { class: "input-wrapper" }, Ce = ["disabled", "onClick"], we = [
170
+ }, Le = { class: "input-wrapper" }, Re = ["disabled", "onClick"], ze = [
105
171
  "value",
106
172
  "min",
107
173
  "max",
108
174
  "step",
109
175
  "onInput"
110
- ], Te = ["disabled", "onClick"], Ee = {
176
+ ], Be = ["disabled", "onClick"], Ve = {
111
177
  key: 0,
112
178
  class: "param-description"
113
- }, De = { class: "params-footer" }, Oe = { class: "footer-right" }, ke = /* @__PURE__ */ q(/* @__PURE__ */ u({
179
+ }, He = { class: "params-footer" }, Ue = { class: "footer-right" }, We = /* @__PURE__ */ q(/* @__PURE__ */ u({
114
180
  __name: "IndicatorParams",
115
181
  props: {
116
182
  visible: { type: Boolean },
@@ -121,53 +187,53 @@ var le = {
121
187
  values: {}
122
188
  },
123
189
  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 };
190
+ setup(r, { emit: u }) {
191
+ let d = r, f = u, p = w({ ...d.values }), m = w(!0), h = Ee();
192
+ M(() => d.values, (e) => {
193
+ p.value = { ...e };
128
194
  }, {
129
195
  deep: !0,
130
196
  immediate: !0
131
- }), j(() => f.visible, (e) => {
132
- e && (m.value = { ...f.values });
197
+ }), M(() => d.visible, (e) => {
198
+ e && (p.value = { ...d.values });
133
199
  });
134
- function v(e, t) {
200
+ function _(e, t) {
135
201
  let n = t.target, r = parseFloat(n.value);
136
- isNaN(r) || (m.value[e] = r);
202
+ isNaN(r) || (p.value[e] = r);
137
203
  }
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));
204
+ function v(e, t) {
205
+ let n = e.step || 1, r = (p.value[e.key] || 0) + t * n;
206
+ 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
207
  }
142
- function b() {
208
+ function y() {
143
209
  let e = {};
144
- f.params.forEach((t) => {
145
- e[t.key] = t.default ?? f.values[t.key] ?? 0;
146
- }), m.value = e;
210
+ d.params.forEach((t) => {
211
+ e[t.key] = t.default ?? d.values[t.key] ?? 0;
212
+ }), p.value = e;
147
213
  }
148
- function x() {
149
- p("confirm", { ...m.value });
214
+ function b() {
215
+ f("confirm", { ...p.value });
150
216
  }
151
- return (r, d) => (S(), i(t, { to: _.value }, [l(n, { name: "overlay" }, {
152
- default: M(() => [u.visible ? (S(), o("div", {
217
+ return (u, d) => (S(), i(t, { to: k(h) }, [l(n, { name: "overlay" }, {
218
+ default: N(() => [r.visible ? (S(), o("div", {
153
219
  key: 0,
154
220
  class: "params-overlay",
155
- onClick: d[4] ||= (e) => r.$emit("close")
221
+ onClick: d[4] ||= (e) => u.$emit("close")
156
222
  }, [l(n, { name: "modal" }, {
157
- default: M(() => [s("div", {
223
+ default: N(() => [s("div", {
158
224
  class: "indicator-params",
159
- onClick: d[3] ||= P(() => {}, ["stop"])
225
+ onClick: d[3] ||= F(() => {}, ["stop"])
160
226
  }, [
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,
227
+ s("div", De, [s("div", Oe, [s("span", ke, O(r.indicatorName), 1), d[5] ||= s("span", { class: "params-subtitle" }, "参数设置", -1)]), s("div", Ae, [s("button", {
228
+ class: g(["toggle-desc-btn", { active: m.value }]),
229
+ onClick: d[0] ||= (e) => m.value = !m.value,
164
230
  title: "显示/隐藏说明"
165
231
  }, [...d[6] ||= [s("svg", { viewBox: "0 0 1024 1024" }, [s("path", {
166
232
  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
233
  fill: "currentColor"
168
234
  })], -1)]], 2), s("button", {
169
235
  class: "params-close",
170
- onClick: d[1] ||= (e) => r.$emit("close")
236
+ onClick: d[1] ||= (e) => u.$emit("close")
171
237
  }, [...d[7] ||= [s("svg", {
172
238
  viewBox: "0 0 24 24",
173
239
  fill: "none",
@@ -175,51 +241,51 @@ var le = {
175
241
  "stroke-width": "2"
176
242
  }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
177
243
  l(n, { name: "slide" }, {
178
- default: M(() => [h.value && u.indicatorDescription ? (S(), o("div", ge, [s("p", null, D(u.indicatorDescription), 1)])) : a("", !0)]),
244
+ default: N(() => [m.value && r.indicatorDescription ? (S(), o("div", je, [s("p", null, O(r.indicatorDescription), 1)])) : a("", !0)]),
179
245
  _: 1
180
246
  }),
181
- s("div", _e, [(S(!0), o(e, null, w(u.params, (e) => (S(), o("div", {
247
+ s("div", Me, [(S(!0), o(e, null, T(r.params, (e) => (S(), o("div", {
182
248
  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, [
249
+ class: g(["param-item", { "has-desc": m.value && e.description }])
250
+ }, [s("div", Ne, [s("label", Pe, [s("span", Fe, O(e.label), 1), e.min !== void 0 || e.max !== void 0 ? (S(), o("span", Ie, O(e.min ?? "-∞") + " ~ " + O(e.max ?? "+∞"), 1)) : a("", !0)]), s("div", Le, [
185
251
  s("button", {
186
252
  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),
253
+ disabled: e.min !== void 0 && (p.value[e.key] ?? 0) <= e.min,
254
+ onClick: (t) => v(e, -1)
255
+ }, " − ", 8, Re),
190
256
  e.type === "number" ? (S(), o("input", {
191
257
  key: 0,
192
258
  type: "number",
193
259
  class: "param-input",
194
- value: m.value[e.key],
260
+ value: p.value[e.key],
195
261
  min: e.min,
196
262
  max: e.max,
197
263
  step: e.step || 1,
198
- onInput: (t) => v(e.key, t)
199
- }, null, 40, we)) : a("", !0),
264
+ onInput: (t) => _(e.key, t)
265
+ }, null, 40, ze)) : a("", !0),
200
266
  s("button", {
201
267
  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)
268
+ disabled: e.max !== void 0 && (p.value[e.key] ?? 0) >= e.max,
269
+ onClick: (t) => v(e, 1)
270
+ }, " + ", 8, Be)
205
271
  ])]), l(n, { name: "slide" }, {
206
- default: M(() => [h.value && e.description ? (S(), o("div", Ee, D(e.description), 1)) : a("", !0)]),
272
+ default: N(() => [m.value && e.description ? (S(), o("div", Ve, O(e.description), 1)) : a("", !0)]),
207
273
  _: 2
208
274
  }, 1024)], 2))), 128))]),
209
- s("div", De, [s("button", {
275
+ s("div", He, [s("button", {
210
276
  class: "params-btn reset",
211
- onClick: b
277
+ onClick: y
212
278
  }, [...d[8] ||= [s("svg", {
213
279
  viewBox: "0 0 24 24",
214
280
  fill: "none",
215
281
  stroke: "currentColor",
216
282
  "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", {
283
+ }, [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", Ue, [s("button", {
218
284
  class: "params-btn cancel",
219
- onClick: d[2] ||= (e) => r.$emit("close")
285
+ onClick: d[2] ||= (e) => u.$emit("close")
220
286
  }, "取消"), s("button", {
221
287
  class: "params-btn confirm",
222
- onClick: x
288
+ onClick: b
223
289
  }, [...d[9] ||= [s("svg", {
224
290
  viewBox: "0 0 24 24",
225
291
  fill: "none",
@@ -232,56 +298,49 @@ var le = {
232
298
  _: 1
233
299
  })], 8, ["to"]));
234
300
  }
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 = {
301
+ }), [["__scopeId", "data-v-30f2f611"]]), Ge = { class: "indicator-selector" }, Ke = { class: "indicator-scroll-container" }, qe = { class: "indicator-list" }, Je = {
243
302
  key: 0,
244
303
  class: "indicator-divider",
245
304
  "aria-hidden": "true"
246
- }, Ie = [
305
+ }, Ye = [
247
306
  "draggable",
248
307
  "onDragstart",
249
308
  "onDragover",
250
309
  "onDrop"
251
- ], Le = ["onMouseenter"], Re = { class: "btn-content" }, ze = {
310
+ ], Xe = ["onMouseenter"], Ze = { class: "btn-content" }, Qe = {
252
311
  key: 0,
253
312
  class: "param-hint"
254
- }, Be = {
313
+ }, $e = {
255
314
  key: 0,
256
315
  class: "hover-overlay"
257
- }, Ve = ["onClick"], He = {
316
+ }, et = ["onClick"], tt = {
258
317
  key: 1,
259
318
  class: "divider"
260
- }, Ue = ["onClick"], We = { class: "indicator-item" }, Ge = { class: "modal-header" }, Ke = { class: "header-title" }, qe = { class: "title-sub" }, Je = { class: "header-actions" }, Ye = {
319
+ }, nt = ["onClick"], rt = { class: "indicator-item" }, it = { class: "modal-header" }, at = { class: "header-title" }, ot = { class: "title-sub" }, st = { class: "header-actions" }, ct = {
261
320
  key: 0,
262
321
  viewBox: "0 0 24 24",
263
322
  width: "16",
264
323
  height: "16",
265
324
  fill: "currentColor"
266
- }, Xe = {
325
+ }, lt = {
267
326
  key: 1,
268
327
  viewBox: "0 0 24 24",
269
328
  width: "16",
270
329
  height: "16",
271
330
  fill: "currentColor"
272
- }, Ze = { class: "modal-body" }, Qe = { class: "search-box" }, $e = ["value"], X = {
331
+ }, X = { class: "modal-body" }, Z = { class: "search-box" }, ut = ["value"], dt = {
273
332
  key: 0,
274
333
  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 = {
334
+ }, ft = { class: "section-header" }, pt = { class: "section-count" }, mt = ["onClick"], ht = { class: "card-label" }, gt = { class: "card-tooltip" }, _t = { class: "card-header" }, vt = { class: "card-label" }, yt = { class: "card-header-actions" }, bt = ["onClick"], xt = { class: "card-name" }, St = {
276
335
  key: 1,
277
336
  class: "section-divider"
278
- }, ut = {
337
+ }, Ct = {
279
338
  key: 2,
280
339
  class: "no-results"
281
- }, dt = {
340
+ }, wt = {
282
341
  key: 3,
283
342
  class: "indicator-section"
284
- }, ft = { class: "section-header" }, pt = { class: "section-count" }, mt = ["onClick"], ht = { class: "card-label" }, gt = { class: "card-tooltip" }, _t = { class: "card-header" }, vt = { class: "card-label" }, yt = { class: "card-header-actions" }, bt = ["onClick"], xt = { class: "card-name" }, St = { class: "modal-footer" }, Ct = { class: "footer-info" }, wt = { class: "info-text" }, Tt = /* @__PURE__ */ q(/* @__PURE__ */ u({
343
+ }, Tt = { class: "section-header" }, Et = { class: "section-count" }, Dt = ["onClick"], Ot = { class: "card-label" }, kt = { class: "card-tooltip" }, At = { class: "card-header" }, jt = { class: "card-label" }, Mt = { class: "card-header-actions" }, Nt = ["onClick"], Pt = { class: "card-name" }, Ft = { class: "modal-footer" }, It = { class: "footer-info" }, Lt = { class: "info-text" }, Rt = /* @__PURE__ */ q(/* @__PURE__ */ u({
285
344
  __name: "IndicatorSelector",
286
345
  props: {
287
346
  activeIndicators: {},
@@ -312,23 +371,23 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
312
371
  }))
313
372
  }));
314
373
  }
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) {
374
+ let h = oe({ catalog: m(U) }), _ = $(h.menuOpen), v = $(h.searchQuery), b = $(h.filteredMain), C = $(h.filteredSub), E = r(() => b.value.length > 0 || C.value.length > 0), D = h.catalog.peek().length, A = w(null), j = w(!1), M = w(null), P = w(null), I = w(null), L = w(null), R = w(!1), z = Ee(), B = r(() => f.activeIndicators?.length ? f.activeIndicators.map((e) => se(e)).filter((e) => e !== void 0).sort((e, t) => e.pane === t.pane ? 0 : e.pane === "main" ? -1 : 1) : []), ee = r(() => B.value.some((e) => e.pane === "main") ? B.value.find((e) => e.pane === "sub")?.id ?? null : null), V = r(() => M.value ? se(M.value) : null), te = r(() => f.activeIndicators?.length ?? 0);
375
+ function H(e) {
317
376
  return f.activeIndicators?.includes(e) ?? !1;
318
377
  }
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));
378
+ function ne(e) {
379
+ if (H(e)) return;
380
+ let t = se(e);
381
+ t && (t.pane === "main" && U.filter((t) => t.id !== e && H(t.id) && t.pane === "main").forEach((e) => p("toggle", e.id, !1)), p("toggle", e, !0));
323
382
  }
324
- function ae(e) {
383
+ function re(e) {
325
384
  p("toggle", e, !1);
326
385
  }
327
- function oe(e) {
328
- N.value = e, j.value = !0;
386
+ function ie(e) {
387
+ M.value = e, j.value = !0;
329
388
  }
330
- function G(e) {
331
- let t = z(e);
389
+ function ae(e) {
390
+ let t = se(e);
332
391
  if (!t?.params) return {};
333
392
  let n = {};
334
393
  for (let e of t.params) n[e.key] = e.default ?? e.min ?? 1;
@@ -336,105 +395,105 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
336
395
  for (let [e, t] of Object.entries(r)) typeof t == "number" && (i[e] = t);
337
396
  return i;
338
397
  }
339
- function se(e) {
340
- let t = G(e.id);
398
+ function ce(e) {
399
+ let t = ae(e.id);
341
400
  return e.params ? e.params.map((e) => t[e.key] ?? "").join(",") : "";
342
401
  }
343
- function ce(e) {
344
- N.value && p("updateParams", N.value, e), j.value = !1;
402
+ function le(e) {
403
+ M.value && p("updateParams", M.value, e), j.value = !1;
345
404
  }
346
- function le(e, t) {
347
- if (!B(t)) {
405
+ function ue(e, t) {
406
+ if (!W(t)) {
348
407
  e.preventDefault();
349
408
  return;
350
409
  }
351
410
  L.value = t, I.value = null, e.dataTransfer?.setData("text/plain", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
352
411
  }
353
- function ue(e, t) {
354
- !L.value || !B(t) || L.value === t || (I.value = t, e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
355
- }
356
412
  function de(e, t) {
413
+ !L.value || !W(t) || L.value === t || (I.value = t, e.dataTransfer && (e.dataTransfer.dropEffect = "move"));
414
+ }
415
+ function fe(e, t) {
357
416
  let n = L.value || e.dataTransfer?.getData("text/plain") || "";
358
417
  if (!n || n === t) {
359
- K();
418
+ G();
360
419
  return;
361
420
  }
362
- if (!B(n) || !B(t)) {
363
- K();
421
+ if (!W(n) || !W(t)) {
422
+ G();
364
423
  return;
365
424
  }
366
- let r = H.value.findIndex((e) => e.id === n), i = H.value.findIndex((e) => e.id === t);
425
+ let r = B.value.findIndex((e) => e.id === n), i = B.value.findIndex((e) => e.id === t);
367
426
  if (r < 0 || i < 0) {
368
- K();
427
+ G();
369
428
  return;
370
429
  }
371
- let a = [...H.value.map((e) => e.id)], [o] = a.splice(r, 1);
430
+ let a = [...B.value.map((e) => e.id)], [o] = a.splice(r, 1);
372
431
  if (!o) {
373
- K();
432
+ G();
374
433
  return;
375
434
  }
376
- a.splice(i, 0, o), p("reorderSubIndicators", a.filter((e) => B(e))), K();
435
+ a.splice(i, 0, o), p("reorderSubIndicators", a.filter((e) => W(e))), G();
377
436
  }
378
- function K() {
437
+ function G() {
379
438
  I.value = null, L.value = null;
380
439
  }
381
- function fe(e) {
440
+ function K(e) {
382
441
  e.key === "Escape" && h.menuOpen.peek() && h.closeMenu();
383
442
  }
384
443
  return y(() => {
385
- document.addEventListener("keydown", fe);
444
+ document.addEventListener("keydown", K);
386
445
  }), 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", {
446
+ document.removeEventListener("keydown", K);
447
+ }), (r, u) => (S(), o("div", Ge, [
448
+ s("div", Ke, [s("div", qe, [(S(!0), o(e, null, T(B.value, (t) => (S(), o(e, { key: t.id }, [t.id === ee.value ? (S(), o("div", Je)) : a("", !0), s("div", {
390
449
  class: g(["indicator-item", {
391
- draggable: O(B)(t.id),
450
+ draggable: k(W)(t.id),
392
451
  "drag-over": I.value === t.id,
393
452
  "is-dragging": L.value === t.id
394
453
  }]),
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"]),
399
- onDragend: K
454
+ draggable: k(W)(t.id),
455
+ onDragstart: (e) => ue(e, t.id),
456
+ onDragover: F((e) => de(e, t.id), ["prevent"]),
457
+ onDrop: F((e) => fe(e, t.id), ["prevent"]),
458
+ onDragend: G
400
459
  }, [s("div", {
401
460
  class: "indicator-btn-wrapper",
402
- onMouseenter: (e) => F.value = t.id,
403
- onMouseleave: u[0] ||= (e) => F.value = null
461
+ onMouseenter: (e) => P.value = t.id,
462
+ onMouseleave: u[0] ||= (e) => P.value = null
404
463
  }, [s("button", { class: g(["indicator-btn", {
405
464
  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, [
465
+ hovering: P.value === t.id
466
+ }]) }, [s("span", Ze, [c(O(t.label) + " ", 1), t.params?.length ? (S(), o("span", Qe, " (" + O(ce(t)) + ") ", 1)) : a("", !0)]), l(n, { name: "fade" }, {
467
+ default: N(() => [P.value === t.id ? (S(), o("div", $e, [
409
468
  t.params?.length ? (S(), o("button", {
410
469
  key: 0,
411
470
  class: "action-btn settings-btn",
412
- onClick: P((e) => oe(t.id), ["stop"]),
471
+ onClick: F((e) => ie(t.id), ["stop"]),
413
472
  title: "编辑参数"
414
473
  }, [...u[9] ||= [s("svg", {
415
474
  viewBox: "0 0 24 24",
416
475
  width: "14",
417
476
  height: "14",
418
477
  fill: "currentColor"
419
- }, [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),
478
+ }, [s("path", { d: "M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" })], -1)]], 8, et)) : a("", !0),
479
+ t.params?.length ? (S(), o("span", tt)) : a("", !0),
421
480
  s("button", {
422
481
  class: "action-btn remove-btn",
423
- onClick: P((e) => ae(t.id), ["stop"]),
482
+ onClick: F((e) => re(t.id), ["stop"]),
424
483
  title: "移除指标"
425
484
  }, [...u[10] ||= [s("svg", {
426
485
  viewBox: "0 0 24 24",
427
486
  width: "14",
428
487
  height: "14",
429
488
  fill: "currentColor"
430
- }, [s("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })], -1)]], 8, Ue)
489
+ }, [s("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })], -1)]], 8, nt)
431
490
  ])) : a("", !0)]),
432
491
  _: 2
433
- }, 1024)], 2)], 40, Le)], 42, Ie)], 64))), 128)), s("div", We, [s("button", {
492
+ }, 1024)], 2)], 40, Xe)], 42, Ye)], 64))), 128)), s("div", rt, [s("button", {
434
493
  ref_key: "addBtnRef",
435
494
  ref: A,
436
495
  class: "add-btn",
437
- onClick: u[1] ||= P((e) => O(h).toggleMenu(), ["stop"]),
496
+ onClick: u[1] ||= F((e) => k(h).toggleMenu(), ["stop"]),
438
497
  title: "添加指标"
439
498
  }, [...u[11] ||= [s("svg", {
440
499
  viewBox: "0 0 24 24",
@@ -442,24 +501,24 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
442
501
  height: "16",
443
502
  fill: "currentColor"
444
503
  }, [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", {
504
+ (S(), i(t, { to: k(z) }, [l(n, { name: "overlay" }, {
505
+ default: N(() => [k(_) ? (S(), o("div", {
447
506
  key: 0,
448
507
  class: "selector-overlay",
449
- onClick: u[7] ||= (e) => O(h).closeMenu()
508
+ onClick: u[7] ||= (e) => k(h).closeMenu()
450
509
  }, [l(n, { name: "modal" }, {
451
- default: M(() => [O(_) ? (S(), o("div", {
510
+ default: N(() => [k(_) ? (S(), o("div", {
452
511
  key: 0,
453
512
  class: "selector-modal",
454
- onClick: u[6] ||= P(() => {}, ["stop"])
513
+ onClick: u[6] ||= F(() => {}, ["stop"])
455
514
  }, [
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,
515
+ s("div", it, [s("div", at, [u[12] ||= s("span", { class: "title-text" }, "添加指标", -1), s("span", ot, O(k(D)) + " 个可用指标", 1)]), s("div", st, [s("button", {
516
+ class: g(["view-toggle-btn", { active: R.value }]),
517
+ onClick: u[2] ||= (e) => R.value = !R.value,
459
518
  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", {
519
+ }, [R.value ? (S(), o("svg", lt, [...u[14] ||= [s("path", { d: "M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z" }, null, -1)]])) : (S(), o("svg", ct, [...u[13] ||= [s("path", { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, null, -1)]]))], 2), s("button", {
461
520
  class: "modal-close",
462
- onClick: u[3] ||= (e) => O(h).closeMenu(),
521
+ onClick: u[3] ||= (e) => k(h).closeMenu(),
463
522
  title: "关闭"
464
523
  }, [...u[15] ||= [s("svg", {
465
524
  viewBox: "0 0 24 24",
@@ -467,40 +526,40 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
467
526
  height: "14",
468
527
  fill: "currentColor"
469
528
  }, [s("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })], -1)]])])]),
470
- s("div", Ze, [
471
- s("div", Qe, [u[16] ||= s("svg", {
529
+ s("div", X, [
530
+ s("div", Z, [u[16] ||= s("svg", {
472
531
  class: "search-icon",
473
532
  viewBox: "0 0 24 24",
474
533
  width: "16",
475
534
  height: "16",
476
535
  fill: "currentColor"
477
536
  }, [s("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" })], -1), s("input", {
478
- value: O(v),
479
- onInput: u[4] ||= (e) => O(h).setSearchQuery(e.target.value),
537
+ value: k(v),
538
+ onInput: u[4] ||= (e) => k(h).setSearchQuery(e.target.value),
480
539
  type: "text",
481
540
  class: "search-input",
482
541
  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", {
542
+ }, null, 40, ut)]),
543
+ k(b).length > 0 ? (S(), o("div", dt, [s("div", ft, [u[17] ||= s("span", { class: "section-title" }, "主图指标", -1), s("span", pt, O(k(b).length), 1)]), s("div", { class: g(["indicator-grid", { compact: R.value }]) }, [(S(!0), o(e, null, T(k(b), (t) => (S(), o("button", {
485
544
  key: t.id,
486
545
  class: g(["indicator-card", {
487
- active: W(t.id),
488
- compact: V.value
546
+ active: H(t.id),
547
+ compact: R.value
489
548
  }]),
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", {
549
+ onClick: (e) => H(t.id) ? re(t.id) : ne(t.id)
550
+ }, [R.value ? (S(), o(e, { key: 0 }, [s("span", ht, O(t.label), 1), s("span", gt, O(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", _t, [s("span", vt, O(t.label), 1), s("div", yt, [t.params?.length ? (S(), o("button", {
492
551
  key: 0,
493
552
  class: "card-settings-btn",
494
- onClick: P((e) => oe(t.id), ["stop"]),
553
+ onClick: F((e) => ie(t.id), ["stop"]),
495
554
  title: "编辑参数"
496
555
  }, [...u[18] ||= [s("svg", {
497
556
  viewBox: "0 0 24 24",
498
557
  width: "14",
499
558
  height: "14",
500
559
  fill: "currentColor"
501
- }, [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] ||= [
560
+ }, [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, O(t.name), 1)], 64))], 10, mt))), 128))], 2)])) : a("", !0),
561
+ k(b).length > 0 && k(C).length > 0 ? (S(), o("div", St)) : a("", !0),
562
+ !E.value && k(v).trim() ? (S(), o("div", Ct, [...u[19] ||= [
504
563
  s("svg", {
505
564
  viewBox: "0 0 24 24",
506
565
  width: "48",
@@ -510,44 +569,44 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
510
569
  s("p", null, "未找到匹配的指标", -1),
511
570
  s("span", { class: "no-results-hint" }, "请尝试其他关键词", -1)
512
571
  ]])) : 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", {
572
+ k(C).length > 0 ? (S(), o("div", wt, [s("div", Tt, [u[20] ||= s("span", { class: "section-title" }, "副图指标", -1), s("span", Et, O(k(C).length), 1)]), s("div", { class: g(["indicator-grid", { compact: R.value }]) }, [(S(!0), o(e, null, T(k(C), (t) => (S(), o("button", {
514
573
  key: t.id,
515
574
  class: g(["indicator-card", {
516
- active: W(t.id),
517
- compact: V.value
575
+ active: H(t.id),
576
+ compact: R.value
518
577
  }]),
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", {
578
+ onClick: (e) => H(t.id) ? re(t.id) : ne(t.id)
579
+ }, [R.value ? (S(), o(e, { key: 0 }, [s("span", Ot, O(t.label), 1), s("span", kt, O(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", At, [s("span", jt, O(t.label), 1), s("div", Mt, [t.params?.length ? (S(), o("button", {
521
580
  key: 0,
522
581
  class: "card-settings-btn",
523
- onClick: P((e) => oe(t.id), ["stop"]),
582
+ onClick: F((e) => ie(t.id), ["stop"]),
524
583
  title: "编辑参数"
525
584
  }, [...u[21] ||= [s("svg", {
526
585
  viewBox: "0 0 24 24",
527
586
  width: "14",
528
587
  height: "14",
529
588
  fill: "currentColor"
530
- }, [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)
589
+ }, [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, Nt)) : a("", !0)])]), s("div", Pt, O(t.name), 1)], 64))], 10, Dt))), 128))], 2)])) : a("", !0)
531
590
  ]),
532
- s("div", St, [s("div", Ct, [s("span", wt, "已激活 " + D(re.value) + " 个指标", 1)]), s("button", {
591
+ s("div", Ft, [s("div", It, [s("span", Lt, "已激活 " + O(te.value) + " 个指标", 1)]), s("button", {
533
592
  class: "btn btn-confirm",
534
- onClick: u[5] ||= (e) => O(h).closeMenu()
593
+ onClick: u[5] ||= (e) => k(h).closeMenu()
535
594
  }, "确认")])
536
595
  ])) : a("", !0)]),
537
596
  _: 1
538
597
  })])) : a("", !0)]),
539
598
  _: 1
540
599
  })], 8, ["to"])),
541
- U.value ? (S(), i(ke, {
600
+ V.value ? (S(), i(We, {
542
601
  key: 0,
543
602
  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),
603
+ "indicator-id": V.value.id,
604
+ "indicator-name": V.value.name,
605
+ "indicator-description": V.value.description,
606
+ params: V.value.params || [],
607
+ values: ae(V.value.id),
549
608
  onClose: u[8] ||= (e) => j.value = !1,
550
- onConfirm: ce
609
+ onConfirm: le
551
610
  }, null, 8, [
552
611
  "visible",
553
612
  "indicator-id",
@@ -558,25 +617,25 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
558
617
  ])) : a("", !0)
559
618
  ]));
560
619
  }
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 = {
620
+ }), [["__scopeId", "data-v-01a99263"]]), zt = { class: "kline-tooltip__title" }, Bt = { key: 0 }, Vt = { class: "kline-tooltip__grid" }, Ht = { class: "row" }, Ut = { class: "row" }, Wt = { class: "row" }, Gt = { class: "row" }, Kt = {
562
621
  key: 0,
563
622
  class: "row"
564
- }, Pt = {
623
+ }, qt = {
565
624
  key: 1,
566
625
  class: "row"
567
- }, Ft = {
626
+ }, Jt = {
568
627
  key: 2,
569
628
  class: "row"
570
- }, It = {
629
+ }, Yt = {
571
630
  key: 3,
572
631
  class: "row"
573
- }, Lt = {
632
+ }, Xt = {
574
633
  key: 4,
575
634
  class: "row"
576
- }, Rt = {
635
+ }, Zt = {
577
636
  key: 5,
578
637
  class: "row"
579
- }, zt = "#ef4444", Bt = "#22c55e", Vt = "#6b7280", Ht = /* @__PURE__ */ q(/* @__PURE__ */ u({
638
+ }, Qt = "#6b7280", $t = /* @__PURE__ */ q(/* @__PURE__ */ u({
580
639
  __name: "KLineTooltip",
581
640
  props: {
582
641
  k: {},
@@ -585,7 +644,9 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
585
644
  pos: {},
586
645
  useAnchor: { type: Boolean },
587
646
  anchorPlacement: {},
588
- setEl: { type: Function }
647
+ setEl: {},
648
+ upColor: { default: "#ef4444" },
649
+ downColor: { default: "#22c55e" }
589
650
  },
590
651
  setup(e) {
591
652
  let t = e, n = r(() => t.useAnchor === !0), i = r(() => t.anchorPlacement === "left-bottom" ? "anchor-left-bottom" : "anchor-right-bottom");
@@ -609,19 +670,19 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
609
670
  }
610
671
  let p = r(() => {
611
672
  let e = t.k;
612
- if (!e) return Vt;
673
+ if (!e) return Qt;
613
674
  let n = f(e, t.data, t.index);
614
- return n > 0 ? zt : n < 0 ? Bt : Vt;
675
+ return n > 0 ? t.upColor : n < 0 ? t.downColor : Qt;
615
676
  }), m = r(() => {
616
677
  let e = t.k;
617
- if (!e) return Vt;
678
+ if (!e) return Qt;
618
679
  let n = e.close - e.open;
619
- return n > 0 ? zt : n < 0 ? Bt : Vt;
680
+ return n > 0 ? t.upColor : n < 0 ? t.downColor : Qt;
620
681
  }), h = r(() => {
621
682
  let e = t.k;
622
- if (!e) return Vt;
683
+ if (!e) return Qt;
623
684
  let n = e.changePercent ?? (e.close - e.open) / e.open * 100;
624
- return n > 0 ? zt : n < 0 ? Bt : Vt;
685
+ return n > 0 ? t.upColor : n < 0 ? t.downColor : Qt;
625
686
  });
626
687
  return (t, r) => e.k ? (S(), o("div", {
627
688
  key: 0,
@@ -631,23 +692,23 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
631
692
  left: `${e.pos.x}px`,
632
693
  top: `${e.pos.y}px`
633
694
  })
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, [
635
- s("div", kt, [r[0] ||= s("span", null, "开", -1), s("span", { style: _({ color: p.value }) }, D(e.k.open.toFixed(2)), 5)]),
636
- s("div", At, [r[1] ||= s("span", null, "高", -1), s("span", null, D(e.k.high.toFixed(2)), 1)]),
637
- s("div", jt, [r[2] ||= s("span", null, "低", -1), s("span", null, D(e.k.low.toFixed(2)), 1)]),
638
- 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)
695
+ }, [s("div", zt, [e.k.stockCode ? (S(), o("span", Bt, O(e.k.stockCode), 1)) : a("", !0), s("span", null, O(l(e.k.timestamp)), 1)]), s("div", Vt, [
696
+ s("div", Ht, [r[0] ||= s("span", null, "开", -1), s("span", { style: _({ color: p.value }) }, O(e.k.open.toFixed(2)), 5)]),
697
+ s("div", Ut, [r[1] ||= s("span", null, "高", -1), s("span", null, O(e.k.high.toFixed(2)), 1)]),
698
+ s("div", Wt, [r[2] ||= s("span", null, "低", -1), s("span", null, O(e.k.low.toFixed(2)), 1)]),
699
+ s("div", Gt, [r[3] ||= s("span", null, "收", -1), s("span", { style: _({ color: m.value }) }, O(e.k.close.toFixed(2)), 5)]),
700
+ typeof e.k.volume == "number" ? (S(), o("div", Kt, [r[4] ||= s("span", null, "成交量", -1), s("span", null, O(u(e.k.volume)), 1)])) : a("", !0),
701
+ typeof e.k.turnover == "number" ? (S(), o("div", qt, [r[5] ||= s("span", null, "成交额", -1), s("span", null, O(u(e.k.turnover)), 1)])) : a("", !0),
702
+ typeof e.k.amplitude == "number" ? (S(), o("div", Jt, [r[6] ||= s("span", null, "振幅", -1), s("span", null, O(e.k.amplitude) + "%", 1)])) : a("", !0),
703
+ typeof e.k.changePercent == "number" ? (S(), o("div", Yt, [r[7] ||= s("span", null, "涨跌幅", -1), s("span", { style: _({ color: h.value }) }, O(d(e.k.changePercent, "%")), 5)])) : a("", !0),
704
+ typeof e.k.changeAmount == "number" ? (S(), o("div", Xt, [r[8] ||= s("span", null, "涨跌额", -1), s("span", { style: _({ color: h.value }) }, O(d(e.k.changeAmount, "")), 5)])) : a("", !0),
705
+ typeof e.k.turnoverRate == "number" ? (S(), o("div", Zt, [r[9] ||= s("span", null, "换手率", -1), s("span", null, O(e.k.turnoverRate.toFixed(2)) + "%", 1)])) : a("", !0)
645
706
  ])], 6)) : a("", !0);
646
707
  }
647
- }), [["__scopeId", "data-v-93207d24"]]), Ut = { class: "marker-tooltip__title" }, Wt = {
708
+ }), [["__scopeId", "data-v-a068b75e"]]), en = { class: "marker-tooltip__title" }, tn = {
648
709
  key: 0,
649
710
  class: "marker-tooltip__content"
650
- }, Gt = /* @__PURE__ */ q(/* @__PURE__ */ u({
711
+ }, nn = /* @__PURE__ */ q(/* @__PURE__ */ u({
651
712
  __name: "MarkerTooltip",
652
713
  props: {
653
714
  marker: {},
@@ -696,18 +757,18 @@ var Me = { class: "indicator-selector" }, Ne = { class: "indicator-scroll-contai
696
757
  left: `${t.pos.x + 12}px`,
697
758
  top: `${t.pos.y + 12}px`
698
759
  })
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", {
760
+ }, [s("div", en, O(f.value), 1), m.value ? (S(), o("div", tn, [(S(!0), o(e, null, T(p.value, (e, t) => (S(), o("div", {
700
761
  key: t,
701
762
  class: "row"
702
- }, [s("span", null, D(t), 1), s("span", null, D(h(e)), 1)]))), 128))])) : a("", !0)], 6)) : a("", !0);
763
+ }, [s("span", null, O(t), 1), s("span", null, O(h(e)), 1)]))), 128))])) : a("", !0)], 6)) : a("", !0);
703
764
  }
704
- }), [["__scopeId", "data-v-f56bc484"]]), Kt = {
765
+ }), [["__scopeId", "data-v-f2a21012"]]), rn = {
705
766
  viewBox: "0 0 24 24",
706
767
  width: "1.2em",
707
768
  height: "1.2em"
708
769
  };
709
- function qt(e, t) {
710
- return S(), o("svg", Kt, [...t[0] ||= [s("path", {
770
+ function an(e, t) {
771
+ return S(), o("svg", rn, [...t[0] ||= [s("path", {
711
772
  fill: "none",
712
773
  stroke: "currentColor",
713
774
  "stroke-linecap": "round",
@@ -716,16 +777,16 @@ function qt(e, t) {
716
777
  d: "M7.904 17.563a1.2 1.2 0 0 0 2.228.308l2.09-3.093l4.907 4.907a1.067 1.067 0 0 0 1.509 0l1.047-1.047a1.067 1.067 0 0 0 0-1.509l-4.907-4.907l3.113-2.09a1.2 1.2 0 0 0-.309-2.228L4 4z"
717
778
  }, null, -1)]]);
718
779
  }
719
- var Jt = m({
780
+ var on = m({
720
781
  name: "tabler-pointer",
721
- render: qt
722
- }), Yt = {
782
+ render: an
783
+ }), sn = {
723
784
  viewBox: "0 0 24 24",
724
785
  width: "1.2em",
725
786
  height: "1.2em"
726
787
  };
727
- function Xt(e, t) {
728
- return S(), o("svg", Yt, [...t[0] ||= [s("path", {
788
+ function cn(e, t) {
789
+ return S(), o("svg", sn, [...t[0] ||= [s("path", {
729
790
  fill: "none",
730
791
  stroke: "currentColor",
731
792
  "stroke-linecap": "round",
@@ -734,16 +795,16 @@ function Xt(e, t) {
734
795
  d: "M4 19h16M4 15l4-6l4 2l4-5l4 4"
735
796
  }, null, -1)]]);
736
797
  }
737
- var Zt = m({
798
+ var ln = m({
738
799
  name: "tabler-chart-line",
739
- render: Xt
740
- }), Qt = {
800
+ render: cn
801
+ }), un = {
741
802
  viewBox: "0 0 24 24",
742
803
  width: "1.2em",
743
804
  height: "1.2em"
744
805
  };
745
- function $t(e, t) {
746
- return S(), o("svg", Qt, [...t[0] ||= [s("path", {
806
+ function dn(e, t) {
807
+ return S(), o("svg", un, [...t[0] ||= [s("path", {
747
808
  fill: "none",
748
809
  stroke: "currentColor",
749
810
  "stroke-linecap": "round",
@@ -752,16 +813,16 @@ function $t(e, t) {
752
813
  d: "M17 7L7 17M8 7h9v9"
753
814
  }, null, -1)]]);
754
815
  }
755
- var en = m({
816
+ var fn = m({
756
817
  name: "tabler-arrow-up-right",
757
- render: $t
758
- }), tn = {
818
+ render: dn
819
+ }), pn = {
759
820
  viewBox: "0 0 24 24",
760
821
  width: "1.2em",
761
822
  height: "1.2em"
762
823
  };
763
- function nn(e, t) {
764
- return S(), o("svg", tn, [...t[0] ||= [s("path", {
824
+ function mn(e, t) {
825
+ return S(), o("svg", pn, [...t[0] ||= [s("path", {
765
826
  fill: "none",
766
827
  stroke: "currentColor",
767
828
  "stroke-linecap": "round",
@@ -770,16 +831,16 @@ function nn(e, t) {
770
831
  d: "M5 12h14m-6 6l6-6m-6-6l6 6"
771
832
  }, null, -1)]]);
772
833
  }
773
- var rn = m({
834
+ var hn = m({
774
835
  name: "tabler-arrow-right",
775
- render: nn
776
- }), an = {
836
+ render: mn
837
+ }), gn = {
777
838
  viewBox: "0 0 24 24",
778
839
  width: "1.2em",
779
840
  height: "1.2em"
780
841
  };
781
- function on(e, t) {
782
- return S(), o("svg", an, [...t[0] ||= [s("path", {
842
+ function _n(e, t) {
843
+ return S(), o("svg", gn, [...t[0] ||= [s("path", {
783
844
  fill: "none",
784
845
  stroke: "currentColor",
785
846
  "stroke-linecap": "round",
@@ -788,16 +849,16 @@ function on(e, t) {
788
849
  d: "M5 12h14"
789
850
  }, null, -1)]]);
790
851
  }
791
- var sn = m({
852
+ var vn = m({
792
853
  name: "tabler-minus",
793
- render: on
794
- }), cn = {
854
+ render: _n
855
+ }), yn = {
795
856
  viewBox: "0 0 24 24",
796
857
  width: "1.2em",
797
858
  height: "1.2em"
798
859
  };
799
- function ln(e, t) {
800
- return S(), o("svg", cn, [...t[0] ||= [s("path", {
860
+ function bn(e, t) {
861
+ return S(), o("svg", yn, [...t[0] ||= [s("path", {
801
862
  fill: "none",
802
863
  stroke: "currentColor",
803
864
  "stroke-linecap": "round",
@@ -806,16 +867,16 @@ function ln(e, t) {
806
867
  d: "M3 12v.01M7 12h10m4 0v.01"
807
868
  }, null, -1)]]);
808
869
  }
809
- var un = m({
870
+ var xn = m({
810
871
  name: "tabler-separator",
811
- render: ln
812
- }), dn = {
872
+ render: bn
873
+ }), Sn = {
813
874
  viewBox: "0 0 24 24",
814
875
  width: "1.2em",
815
876
  height: "1.2em"
816
877
  };
817
- function fn(e, t) {
818
- return S(), o("svg", dn, [...t[0] ||= [s("path", {
878
+ function Cn(e, t) {
879
+ return S(), o("svg", Sn, [...t[0] ||= [s("path", {
819
880
  fill: "none",
820
881
  stroke: "currentColor",
821
882
  "stroke-linecap": "round",
@@ -824,16 +885,16 @@ function fn(e, t) {
824
885
  d: "M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2m8-16h2a2 2 0 0 1 2 2v2m-4 12h2a2 2 0 0 0 2-2v-2M9 12h6m-3-3v6"
825
886
  }, null, -1)]]);
826
887
  }
827
- var pn = m({
888
+ var wn = m({
828
889
  name: "tabler-crosshair",
829
- render: fn
830
- }), mn = {
890
+ render: Cn
891
+ }), Tn = {
831
892
  viewBox: "0 0 24 24",
832
893
  width: "1.2em",
833
894
  height: "1.2em"
834
895
  };
835
- function hn(e, t) {
836
- return S(), o("svg", mn, [...t[0] ||= [s("g", {
896
+ function En(e, t) {
897
+ return S(), o("svg", Tn, [...t[0] ||= [s("g", {
837
898
  fill: "none",
838
899
  stroke: "currentColor",
839
900
  "stroke-linecap": "round",
@@ -841,16 +902,16 @@ function hn(e, t) {
841
902
  "stroke-width": "2"
842
903
  }, [s("path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01" }), s("path", { d: "M11 12h1v4h1" })], -1)]]);
843
904
  }
844
- var gn = m({
905
+ var Dn = m({
845
906
  name: "tabler-info-circle",
846
- render: hn
847
- }), _n = {
907
+ render: En
908
+ }), On = {
848
909
  viewBox: "0 0 24 24",
849
910
  width: "1.2em",
850
911
  height: "1.2em"
851
912
  };
852
- function vn(e, t) {
853
- return S(), o("svg", _n, [...t[0] ||= [s("path", {
913
+ function kn(e, t) {
914
+ return S(), o("svg", On, [...t[0] ||= [s("path", {
854
915
  fill: "none",
855
916
  stroke: "currentColor",
856
917
  "stroke-linecap": "round",
@@ -859,16 +920,16 @@ function vn(e, t) {
859
920
  d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m-3-3v6m11 8l-6-6"
860
921
  }, null, -1)]]);
861
922
  }
862
- var yn = m({
923
+ var An = m({
863
924
  name: "tabler-zoom-in",
864
- render: vn
865
- }), bn = {
925
+ render: kn
926
+ }), jn = {
866
927
  viewBox: "0 0 24 24",
867
928
  width: "1.2em",
868
929
  height: "1.2em"
869
930
  };
870
- function xn(e, t) {
871
- return S(), o("svg", bn, [...t[0] ||= [s("path", {
931
+ function Mn(e, t) {
932
+ return S(), o("svg", jn, [...t[0] ||= [s("path", {
872
933
  fill: "none",
873
934
  stroke: "currentColor",
874
935
  "stroke-linecap": "round",
@@ -877,16 +938,16 @@ function xn(e, t) {
877
938
  d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m8 11l-6-6"
878
939
  }, null, -1)]]);
879
940
  }
880
- var Sn = m({
941
+ var Nn = m({
881
942
  name: "tabler-zoom-out",
882
- render: xn
883
- }), Cn = {
943
+ render: Mn
944
+ }), Pn = {
884
945
  viewBox: "0 0 24 24",
885
946
  width: "1.2em",
886
947
  height: "1.2em"
887
948
  };
888
- function wn(e, t) {
889
- return S(), o("svg", Cn, [...t[0] ||= [s("path", {
949
+ function Fn(e, t) {
950
+ return S(), o("svg", Pn, [...t[0] ||= [s("path", {
890
951
  fill: "none",
891
952
  stroke: "currentColor",
892
953
  "stroke-linecap": "round",
@@ -895,16 +956,16 @@ function wn(e, t) {
895
956
  d: "M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2m8-16h2a2 2 0 0 1 2 2v2m-4 12h2a2 2 0 0 0 2-2v-2"
896
957
  }, null, -1)]]);
897
958
  }
898
- var Tn = m({
959
+ var In = m({
899
960
  name: "tabler-maximize",
900
- render: wn
901
- }), En = {
961
+ render: Fn
962
+ }), Ln = {
902
963
  viewBox: "0 0 24 24",
903
964
  width: "1.2em",
904
965
  height: "1.2em"
905
966
  };
906
- function Dn(e, t) {
907
- return S(), o("svg", En, [...t[0] ||= [s("path", {
967
+ function Rn(e, t) {
968
+ return S(), o("svg", Ln, [...t[0] ||= [s("path", {
908
969
  fill: "none",
909
970
  stroke: "currentColor",
910
971
  "stroke-linecap": "round",
@@ -913,16 +974,16 @@ function Dn(e, t) {
913
974
  d: "M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"
914
975
  }, null, -1)]]);
915
976
  }
916
- var On = m({
977
+ var zn = m({
917
978
  name: "tabler-minimize",
918
- render: Dn
919
- }), kn = {
979
+ render: Rn
980
+ }), Bn = {
920
981
  viewBox: "0 0 24 24",
921
982
  width: "1.2em",
922
983
  height: "1.2em"
923
984
  };
924
- function An(e, t) {
925
- return S(), o("svg", kn, [...t[0] ||= [s("g", {
985
+ function Vn(e, t) {
986
+ return S(), o("svg", Bn, [...t[0] ||= [s("g", {
926
987
  fill: "none",
927
988
  stroke: "currentColor",
928
989
  "stroke-linecap": "round",
@@ -930,16 +991,16 @@ function An(e, t) {
930
991
  "stroke-width": "2"
931
992
  }, [s("path", { d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065" }), s("path", { d: "M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0" })], -1)]]);
932
993
  }
933
- var jn = m({
994
+ var Hn = m({
934
995
  name: "tabler-settings",
935
- render: An
936
- }), Mn = {
996
+ render: Vn
997
+ }), Un = {
937
998
  viewBox: "0 0 24 24",
938
999
  width: "1.2em",
939
1000
  height: "1.2em"
940
1001
  };
941
- function Nn(e, t) {
942
- return S(), o("svg", Mn, [...t[0] ||= [s("path", {
1002
+ function Wn(e, t) {
1003
+ return S(), o("svg", Un, [...t[0] ||= [s("path", {
943
1004
  fill: "none",
944
1005
  stroke: "currentColor",
945
1006
  "stroke-linecap": "round",
@@ -948,16 +1009,16 @@ function Nn(e, t) {
948
1009
  d: "M3 5a2 2 0 1 0 4 0a2 2 0 1 0-4 0m14 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0M3 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m14 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0M5 7v10M7 5h10M7 19h10m2-12v10"
949
1010
  }, null, -1)]]);
950
1011
  }
951
- var Pn = m({
1012
+ var Gn = m({
952
1013
  name: "tabler-shape",
953
- render: Nn
954
- }), Fn = {
1014
+ render: Wn
1015
+ }), Kn = {
955
1016
  viewBox: "0 0 24 24",
956
1017
  width: "1.2em",
957
1018
  height: "1.2em"
958
1019
  };
959
- function In(e, t) {
960
- return S(), o("svg", Fn, [...t[0] ||= [s("path", {
1020
+ function qn(e, t) {
1021
+ return S(), o("svg", Kn, [...t[0] ||= [s("path", {
961
1022
  fill: "none",
962
1023
  stroke: "currentColor",
963
1024
  "stroke-linecap": "round",
@@ -966,16 +1027,16 @@ function In(e, t) {
966
1027
  d: "M3 7a2 2 0 1 0 4 0a2 2 0 1 0-4 0m11 8a2 2 0 1 0 4 0a2 2 0 1 0-4 0m1-9a3 3 0 1 0 6 0a3 3 0 1 0-6 0M3 18a3 3 0 1 0 6 0a3 3 0 1 0-6 0m6-1l5-1.5m-7.5-7l7.81 5.37M7 7l8-1"
967
1028
  }, null, -1)]]);
968
1029
  }
969
- var Ln = m({
1030
+ var Jn = m({
970
1031
  name: "tabler-chart-dots-3",
971
- render: In
972
- }), Rn = {
1032
+ render: qn
1033
+ }), Yn = {
973
1034
  viewBox: "0 0 24 24",
974
1035
  width: "1.2em",
975
1036
  height: "1.2em"
976
1037
  };
977
- function zn(e, t) {
978
- return S(), o("svg", Rn, [...t[0] ||= [s("path", {
1038
+ function Xn(e, t) {
1039
+ return S(), o("svg", Yn, [...t[0] ||= [s("path", {
979
1040
  fill: "none",
980
1041
  stroke: "currentColor",
981
1042
  "stroke-linecap": "round",
@@ -984,16 +1045,16 @@ function zn(e, t) {
984
1045
  d: "m18 10l-6-6l-6 6zm0 4l-6 6l-6-6z"
985
1046
  }, null, -1)]]);
986
1047
  }
987
- var Bn = m({
1048
+ var Zn = m({
988
1049
  name: "tabler-caret-up-down",
989
- render: zn
990
- }), Vn = {
1050
+ render: Xn
1051
+ }), Qn = {
991
1052
  viewBox: "0 0 24 24",
992
1053
  width: "1.2em",
993
1054
  height: "1.2em"
994
1055
  };
995
- function Hn(e, t) {
996
- return S(), o("svg", Vn, [...t[0] ||= [s("path", {
1056
+ function $n(e, t) {
1057
+ return S(), o("svg", Qn, [...t[0] ||= [s("path", {
997
1058
  fill: "none",
998
1059
  stroke: "currentColor",
999
1060
  "stroke-linecap": "round",
@@ -1002,34 +1063,34 @@ function Hn(e, t) {
1002
1063
  d: "M8 4H5v16h3m8-16h3v16h-3"
1003
1064
  }, null, -1)]]);
1004
1065
  }
1005
- var Un = m({
1066
+ var er = m({
1006
1067
  name: "tabler-brackets",
1007
- render: Hn
1068
+ render: $n
1008
1069
  });
1009
1070
  //#endregion
1010
1071
  //#region src/debug/canvasProfiler.ts
1011
- function Wn() {
1072
+ function tr() {
1012
1073
  return Object.create(null);
1013
1074
  }
1014
- function Gn() {
1075
+ function nr() {
1015
1076
  return {
1016
- ctxMethods: Wn(),
1017
- ctxProps: Wn(),
1018
- canvasProps: Wn(),
1077
+ ctxMethods: tr(),
1078
+ ctxProps: tr(),
1079
+ canvasProps: tr(),
1019
1080
  ctxMethodSources: Object.create(null)
1020
1081
  };
1021
1082
  }
1022
- function Kn(e, t, n) {
1083
+ function rr(e, t, n) {
1023
1084
  let r = e[t] ??= {
1024
1085
  count: 0,
1025
1086
  totalTime: 0
1026
1087
  };
1027
1088
  r.count += 1, r.totalTime += n;
1028
1089
  }
1029
- function qn(e, t, n, r) {
1030
- Kn(e.ctxMethodSources[t] ??= Wn(), n, r);
1090
+ function ir(e, t, n, r) {
1091
+ rr(e.ctxMethodSources[t] ??= tr(), n, r);
1031
1092
  }
1032
- function Jn(e) {
1093
+ function ar(e) {
1033
1094
  return Object.entries(e).filter(([, e]) => e.count > 0).map(([e, t]) => ({
1034
1095
  name: e,
1035
1096
  count: t.count,
@@ -1037,12 +1098,12 @@ function Jn(e) {
1037
1098
  averageTime: (t.totalTime / t.count).toFixed(4)
1038
1099
  })).sort((e, t) => Number(t.totalTime) - Number(e.totalTime));
1039
1100
  }
1040
- var Yn = !1, Xn = /* @__PURE__ */ new Map(), Zn = /* @__PURE__ */ new Map();
1041
- function Qn(e) {
1042
- Yn = e, e ? typeof window < "u" && !window.__KMAP_CANVAS_PROFILER_INSTALLED__ && tr() : nr();
1101
+ var or = !1, sr = /* @__PURE__ */ new Map(), cr = /* @__PURE__ */ new Map();
1102
+ function lr(e) {
1103
+ or = e, e ? typeof window < "u" && !window.__KMAP_CANVAS_PROFILER_INSTALLED__ && fr() : pr();
1043
1104
  }
1044
- function $n() {
1045
- if (!Yn) return "disabled";
1105
+ function ur() {
1106
+ if (!or) return "disabled";
1046
1107
  let e = (/* @__PURE__ */ Error()).stack;
1047
1108
  if (!e) return "unknown";
1048
1109
  let t = e.split("\n").map((e) => e.trim()).filter(Boolean);
@@ -1057,80 +1118,236 @@ function $n() {
1057
1118
  }
1058
1119
  function Q(e, t, n, r) {
1059
1120
  let i = `${e.constructor?.name ?? "proto"}:${t}`;
1060
- if (Xn.has(i)) return;
1121
+ if (sr.has(i)) return;
1061
1122
  let a = Reflect.get(e, t);
1062
- typeof a == "function" && (Xn.set(i, a), Reflect.set(e, t, function(...e) {
1063
- if (!Yn) return a.apply(this, e);
1064
- let i = r?.captureSource ? $n() : null, o = performance.now(), s = a.apply(this, e), c = performance.now() - o;
1065
- return Kn(n.ctxMethods, t, c), i && qn(n, t, i, c), s;
1123
+ typeof a == "function" && (sr.set(i, a), Reflect.set(e, t, function(...e) {
1124
+ if (!or) return a.apply(this, e);
1125
+ let i = r?.captureSource ? ur() : null, o = performance.now(), s = a.apply(this, e), c = performance.now() - o;
1126
+ return rr(n.ctxMethods, t, c), i && ir(n, t, i, c), s;
1066
1127
  }));
1067
1128
  }
1068
- function er(e, t, n) {
1129
+ function dr(e, t, n) {
1069
1130
  let r = Object.getOwnPropertyDescriptor(e, t);
1070
1131
  if (!r?.set || !r.configurable) return;
1071
1132
  let i = `${e.constructor?.name ?? "proto"}:${t}`;
1072
- Zn.has(i) || (Zn.set(i, r), Object.defineProperty(e, t, {
1133
+ cr.has(i) || (cr.set(i, r), Object.defineProperty(e, t, {
1073
1134
  configurable: !0,
1074
1135
  enumerable: r.enumerable ?? !1,
1075
1136
  get: r.get,
1076
1137
  set(e) {
1077
- if (!Yn) {
1138
+ if (!or) {
1078
1139
  r.set.call(this, e);
1079
1140
  return;
1080
1141
  }
1081
1142
  let i = performance.now();
1082
- r.set.call(this, e), Kn(n, t, performance.now() - i);
1143
+ r.set.call(this, e), rr(n, t, performance.now() - i);
1083
1144
  }
1084
1145
  }));
1085
1146
  }
1086
- function tr() {
1147
+ function fr() {
1087
1148
  if (typeof window > "u" || window.__KMAP_CANVAS_PROFILER_INSTALLED__) return;
1088
1149
  let e = CanvasRenderingContext2D?.prototype, t = HTMLCanvasElement?.prototype;
1089
1150
  if (!e || !t) return;
1090
- let n = Gn();
1091
- Q(e, "fillText", n, { captureSource: !0 }), Q(e, "measureText", n, { captureSource: !0 }), Q(e, "drawImage", n), Q(e, "save", n), Q(e, "restore", n), Q(e, "clip", n), Q(e, "setTransform", n), Q(e, "scale", n), er(e, "font", n.ctxProps), er(e, "filter", n.ctxProps), er(e, "shadowBlur", n.ctxProps), er(e, "lineWidth", n.ctxProps), er(t, "width", n.canvasProps), er(t, "height", n.canvasProps), window.__KMAP_CANVAS_PROFILER_METRICS__ = n, window.__KMAP_CANVAS_PROFILER_INSTALLED__ = !0, window.showCanvasReport = () => {
1151
+ let n = nr();
1152
+ Q(e, "fillText", n, { captureSource: !0 }), Q(e, "measureText", n, { captureSource: !0 }), Q(e, "drawImage", n), Q(e, "save", n), Q(e, "restore", n), Q(e, "clip", n), Q(e, "setTransform", n), Q(e, "scale", n), dr(e, "font", n.ctxProps), dr(e, "filter", n.ctxProps), dr(e, "shadowBlur", n.ctxProps), dr(e, "lineWidth", n.ctxProps), dr(t, "width", n.canvasProps), dr(t, "height", n.canvasProps), window.__KMAP_CANVAS_PROFILER_METRICS__ = n, window.__KMAP_CANVAS_PROFILER_INSTALLED__ = !0, window.showCanvasReport = () => {
1092
1153
  let e = window.__KMAP_CANVAS_PROFILER_METRICS__;
1093
1154
  if (e) {
1094
- console.group("[kmap] Canvas profiler report"), console.log("ctx methods"), console.table(Jn(e.ctxMethods)), console.log("ctx props"), console.table(Jn(e.ctxProps)), console.log("canvas props"), console.table(Jn(e.canvasProps));
1155
+ console.group("[kmap] Canvas profiler report"), console.log("ctx methods"), console.table(ar(e.ctxMethods)), console.log("ctx props"), console.table(ar(e.ctxProps)), console.log("canvas props"), console.table(ar(e.canvasProps));
1095
1156
  for (let t of ["fillText", "measureText"]) {
1096
1157
  let n = e.ctxMethodSources[t];
1097
- n && (console.log(`${t} sources`), console.table(Jn(n).slice(0, 20)));
1158
+ n && (console.log(`${t} sources`), console.table(ar(n).slice(0, 20)));
1098
1159
  }
1099
1160
  console.groupEnd();
1100
1161
  }
1101
1162
  }, window.resetCanvasReport = () => {
1102
- window.__KMAP_CANVAS_PROFILER_METRICS__ = Gn();
1163
+ window.__KMAP_CANVAS_PROFILER_METRICS__ = nr();
1103
1164
  }, console.info("[kmap] Canvas profiler enabled. Use window.showCanvasReport() and window.resetCanvasReport().");
1104
1165
  }
1105
- function nr() {
1166
+ function pr() {
1106
1167
  if (typeof window > "u" || !window.__KMAP_CANVAS_PROFILER_INSTALLED__) return;
1107
1168
  let e = CanvasRenderingContext2D?.prototype, t = HTMLCanvasElement?.prototype;
1108
- Xn.forEach((n, r) => {
1169
+ sr.forEach((n, r) => {
1109
1170
  let i = r.match(/^(.+):(.+)$/);
1110
1171
  if (!i) return;
1111
1172
  let [, a, o] = i, s = null;
1112
1173
  a === "CanvasRenderingContext2D" ? s = e : a === "HTMLCanvasElement" && (s = t), s && Reflect.set(s, o, n);
1113
- }), Xn.clear(), Zn.forEach((n, r) => {
1174
+ }), sr.clear(), cr.forEach((n, r) => {
1114
1175
  let i = r.match(/^(.+):(.+)$/);
1115
1176
  if (!i) return;
1116
1177
  let [, a, o] = i, s = null;
1117
1178
  a === "CanvasRenderingContext2D" ? s = e : a === "HTMLCanvasElement" && (s = t), s && n.configurable && Object.defineProperty(s, o, n);
1118
- }), Zn.clear(), window.__KMAP_CANVAS_PROFILER_INSTALLED__ = !1, window.__KMAP_CANVAS_PROFILER_METRICS__ = void 0, window.showCanvasReport = void 0, window.resetCanvasReport = void 0, console.info("[kmap] Canvas profiler disabled.");
1179
+ }), cr.clear(), window.__KMAP_CANVAS_PROFILER_INSTALLED__ = !1, window.__KMAP_CANVAS_PROFILER_METRICS__ = void 0, window.showCanvasReport = void 0, window.resetCanvasReport = void 0, console.info("[kmap] Canvas profiler disabled.");
1119
1180
  }
1120
1181
  //#endregion
1121
- //#region src/components/LeftToolbar.vue?vue&type=script&setup=true&lang.ts
1122
- var rr = {
1182
+ //#region src/components/ChartSettingsDialog.vue?vue&type=script&setup=true&lang.ts
1183
+ var mr = { class: "settings-body" }, hr = { class: "settings-label" }, gr = ["onUpdate:modelValue"], _r = ["onUpdate:modelValue"], vr = ["value"], yr = { class: "settings-label" }, br = ["onUpdate:modelValue"], xr = ["onUpdate:modelValue"], Sr = ["value"], Cr = { class: "settings-header" }, wr = { class: "header-right" }, Tr = { class: "settings-body" }, Er = /* @__PURE__ */ q(/* @__PURE__ */ u({
1184
+ __name: "ChartSettingsDialog",
1185
+ props: { show: { type: Boolean } },
1186
+ emits: ["close", "confirm"],
1187
+ setup(u, { emit: d }) {
1188
+ let f = u, p = d, m = Ee(), h = r(() => G.filter((e) => e.group === "main")), g = r(() => G.filter((e) => e.group === "experimental")), _ = w(!1);
1189
+ function v() {
1190
+ try {
1191
+ let e = localStorage.getItem(K);
1192
+ if (e) {
1193
+ let t = JSON.parse(e), n = {};
1194
+ return G.forEach((e) => {
1195
+ n[e.key] = t[e.key] ?? e.default;
1196
+ }), n.colorPresetSettings = V(t.colorPresetSettings), n;
1197
+ }
1198
+ } catch {}
1199
+ let e = {};
1200
+ return G.forEach((t) => {
1201
+ e[t.key] = t.default;
1202
+ }), e.colorPresetSettings = {}, e;
1203
+ }
1204
+ let y = w(v());
1205
+ M(() => f.show, (e) => {
1206
+ e && (y.value = v());
1207
+ });
1208
+ function b() {
1209
+ p("close");
1210
+ }
1211
+ function x() {
1212
+ let e = {};
1213
+ G.forEach((t) => {
1214
+ e[t.key] = t.default;
1215
+ }), e.colorPresetSettings = {}, y.value = e;
1216
+ }
1217
+ function C() {
1218
+ p("confirm", { ...y.value });
1219
+ }
1220
+ return (r, d) => (S(), i(t, { to: k(m) }, [l(n, { name: "overlay" }, {
1221
+ default: N(() => [u.show ? (S(), o("div", {
1222
+ key: 0,
1223
+ class: "settings-overlay",
1224
+ onClick: b
1225
+ }, [l(n, { name: "modal" }, {
1226
+ default: N(() => [s("div", {
1227
+ class: "settings-modal",
1228
+ onClick: d[1] ||= F(() => {}, ["stop"])
1229
+ }, [
1230
+ s("div", { class: "settings-header" }, [d[7] ||= s("div", { class: "header-left" }, [s("span", { class: "settings-title" }, "图表设置"), s("span", { class: "settings-subtitle" }, "个性化配置")], -1), s("div", { class: "header-right" }, [s("button", {
1231
+ class: "settings-close",
1232
+ onClick: b
1233
+ }, [...d[6] ||= [s("svg", {
1234
+ viewBox: "0 0 24 24",
1235
+ fill: "none",
1236
+ stroke: "currentColor",
1237
+ "stroke-width": "2"
1238
+ }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
1239
+ s("div", mr, [
1240
+ h.value.length > 0 ? (S(), o(e, { key: 0 }, [d[8] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "主图设置")], -1), (S(!0), o(e, null, T(h.value, (t) => (S(), o("div", {
1241
+ key: t.key,
1242
+ class: "settings-item"
1243
+ }, [s("label", hr, [s("span", null, O(t.label), 1), t.type === "boolean" ? P((S(), o("input", {
1244
+ key: 0,
1245
+ type: "checkbox",
1246
+ class: "settings-checkbox",
1247
+ "onUpdate:modelValue": (e) => y.value[t.key] = e
1248
+ }, null, 8, gr)), [[A, y.value[t.key]]]) : t.type === "select" && t.options ? P((S(), o("select", {
1249
+ key: 1,
1250
+ class: "settings-select",
1251
+ "onUpdate:modelValue": (e) => y.value[t.key] = e
1252
+ }, [(S(!0), o(e, null, T(t.options, (e) => (S(), o("option", {
1253
+ key: e.value,
1254
+ value: e.value
1255
+ }, O(e.label), 9, vr))), 128))], 8, _r)), [[j, y.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0),
1256
+ d[11] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "样式 / 颜色")], -1),
1257
+ s("div", {
1258
+ class: "settings-item nav-item",
1259
+ onClick: d[0] ||= (e) => _.value = !0
1260
+ }, [...d[9] ||= [s("label", { class: "settings-label" }, [s("span", null, "颜色配置"), s("svg", {
1261
+ viewBox: "0 0 24 24",
1262
+ fill: "none",
1263
+ stroke: "currentColor",
1264
+ "stroke-width": "2",
1265
+ width: "16",
1266
+ height: "16",
1267
+ class: "nav-arrow"
1268
+ }, [s("path", { d: "M9 18l6-6-6-6" })])], -1)]]),
1269
+ g.value.length > 0 ? (S(), o(e, { key: 1 }, [d[10] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "实验性 / 调试设置")], -1), (S(!0), o(e, null, T(g.value, (t) => (S(), o("div", {
1270
+ key: t.key,
1271
+ class: "settings-item experimental"
1272
+ }, [s("label", yr, [s("span", null, O(t.label), 1), t.type === "boolean" ? P((S(), o("input", {
1273
+ key: 0,
1274
+ type: "checkbox",
1275
+ class: "settings-checkbox",
1276
+ "onUpdate:modelValue": (e) => y.value[t.key] = e
1277
+ }, null, 8, br)), [[A, y.value[t.key]]]) : t.type === "select" && t.options ? P((S(), o("select", {
1278
+ key: 1,
1279
+ class: "settings-select",
1280
+ "onUpdate:modelValue": (e) => y.value[t.key] = e
1281
+ }, [(S(!0), o(e, null, T(t.options, (e) => (S(), o("option", {
1282
+ key: e.value,
1283
+ value: e.value
1284
+ }, O(e.label), 9, Sr))), 128))], 8, xr)), [[j, y.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0)
1285
+ ]),
1286
+ s("div", { class: "settings-footer" }, [s("button", {
1287
+ class: "settings-btn reset",
1288
+ onClick: x
1289
+ }, [...d[12] ||= [s("svg", {
1290
+ viewBox: "0 0 24 24",
1291
+ fill: "none",
1292
+ stroke: "currentColor",
1293
+ "stroke-width": "2"
1294
+ }, [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", {
1295
+ class: "settings-btn cancel",
1296
+ onClick: b
1297
+ }, "取消"), s("button", {
1298
+ class: "settings-btn confirm",
1299
+ onClick: C
1300
+ }, [...d[13] ||= [s("svg", {
1301
+ viewBox: "0 0 24 24",
1302
+ fill: "none",
1303
+ stroke: "currentColor",
1304
+ "stroke-width": "2.5"
1305
+ }, [s("path", { d: "M20 6L9 17l-5-5" })], -1), c(" 确定 ", -1)]])])])
1306
+ ])]),
1307
+ _: 1
1308
+ })])) : a("", !0)]),
1309
+ _: 1
1310
+ }), l(n, { name: "overlay" }, {
1311
+ default: N(() => [_.value ? (S(), o("div", {
1312
+ key: 0,
1313
+ class: "settings-overlay nested-overlay",
1314
+ onClick: d[5] ||= (e) => _.value = !1
1315
+ }, [l(n, { name: "modal" }, {
1316
+ default: N(() => [s("div", {
1317
+ class: "settings-modal",
1318
+ onClick: d[4] ||= F(() => {}, ["stop"])
1319
+ }, [s("div", Cr, [d[15] ||= s("div", { class: "header-left" }, [s("span", { class: "settings-title" }, "颜色预设"), s("span", { class: "settings-subtitle" }, "自定义图表颜色")], -1), s("div", wr, [s("button", {
1320
+ class: "settings-close",
1321
+ onClick: d[2] ||= (e) => _.value = !1
1322
+ }, [...d[14] ||= [s("svg", {
1323
+ viewBox: "0 0 24 24",
1324
+ fill: "none",
1325
+ stroke: "currentColor",
1326
+ "stroke-width": "2"
1327
+ }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]), s("div", Tr, [l(be, {
1328
+ "color-preset-settings": y.value.colorPresetSettings,
1329
+ "onUpdate:colorPresetSettings": d[3] ||= (e) => y.value = {
1330
+ ...y.value,
1331
+ colorPresetSettings: e
1332
+ }
1333
+ }, null, 8, ["color-preset-settings"])])])]),
1334
+ _: 1
1335
+ })])) : a("", !0)]),
1336
+ _: 1
1337
+ })], 8, ["to"]));
1338
+ }
1339
+ }), [["__scopeId", "data-v-49dd396c"]]), Dr = {
1123
1340
  class: "left-toolbar",
1124
1341
  "aria-label": "图表工具栏"
1125
- }, ir = { class: "left-toolbar__group" }, ar = [
1342
+ }, Or = { class: "left-toolbar__group" }, kr = [
1126
1343
  "title",
1127
1344
  "aria-label",
1128
1345
  "onClick"
1129
- ], or = ["onClick"], sr = [
1346
+ ], Ar = ["onClick"], jr = [
1130
1347
  "title",
1131
1348
  "aria-label",
1132
1349
  "onClick"
1133
- ], cr = { class: "left-toolbar__group" }, lr = { class: "left-toolbar__group" }, ur = ["title", "aria-label"], dr = { class: "left-toolbar__group" }, fr = { class: "settings-body" }, pr = { class: "settings-label" }, mr = ["onUpdate:modelValue"], hr = ["onUpdate:modelValue"], gr = ["value"], _r = { class: "settings-label" }, vr = ["onUpdate:modelValue"], yr = ["onUpdate:modelValue"], br = ["value"], xr = /* @__PURE__ */ q(/* @__PURE__ */ u({
1350
+ ], Mr = { class: "left-toolbar__group" }, Nr = { class: "left-toolbar__group" }, Pr = ["title", "aria-label"], Fr = { class: "left-toolbar__group" }, Ir = /* @__PURE__ */ q(/* @__PURE__ */ u({
1134
1351
  __name: "LeftToolbar",
1135
1352
  props: { isFullscreen: { type: Boolean } },
1136
1353
  emits: [
@@ -1140,88 +1357,88 @@ var rr = {
1140
1357
  "zoomOut",
1141
1358
  "settingsChange"
1142
1359
  ],
1143
- setup(u, { expose: d, emit: f }) {
1144
- let p = [
1360
+ setup(t, { expose: r, emit: c }) {
1361
+ let u = [
1145
1362
  {
1146
1363
  id: "cursor",
1147
1364
  title: "光标",
1148
- icon: Jt
1365
+ icon: on
1149
1366
  },
1150
1367
  {
1151
1368
  id: "lines",
1152
1369
  title: "线条",
1153
- icon: Zt,
1370
+ icon: ln,
1154
1371
  children: [
1155
1372
  {
1156
1373
  id: "trend-line",
1157
1374
  title: "线段",
1158
- icon: Zt
1375
+ icon: ln
1159
1376
  },
1160
1377
  {
1161
1378
  id: "ray",
1162
1379
  title: "射线",
1163
- icon: en
1380
+ icon: fn
1164
1381
  },
1165
1382
  {
1166
1383
  id: "h-line",
1167
1384
  title: "水平线",
1168
- icon: sn
1385
+ icon: vn
1169
1386
  },
1170
1387
  {
1171
1388
  id: "h-ray",
1172
1389
  title: "水平射线",
1173
- icon: rn
1390
+ icon: hn
1174
1391
  },
1175
1392
  {
1176
1393
  id: "v-line",
1177
1394
  title: "垂直线",
1178
- icon: un
1395
+ icon: xn
1179
1396
  },
1180
1397
  {
1181
1398
  id: "crosshair-line",
1182
1399
  title: "十字线",
1183
- icon: pn
1400
+ icon: wn
1184
1401
  },
1185
1402
  {
1186
1403
  id: "info-line",
1187
1404
  title: "信息线",
1188
- icon: gn
1405
+ icon: Dn
1189
1406
  }
1190
1407
  ]
1191
1408
  },
1192
1409
  {
1193
1410
  id: "channels",
1194
1411
  title: "通道",
1195
- icon: Pn,
1412
+ icon: Gn,
1196
1413
  children: [
1197
1414
  {
1198
1415
  id: "parallel-channel",
1199
1416
  title: "平行通道",
1200
- icon: Pn
1417
+ icon: Gn
1201
1418
  },
1202
1419
  {
1203
1420
  id: "regression-channel",
1204
1421
  title: "回归趋势",
1205
- icon: Ln
1422
+ icon: Jn
1206
1423
  },
1207
1424
  {
1208
1425
  id: "flat-line",
1209
1426
  title: "平滑顶底",
1210
- icon: Bn
1427
+ icon: Zn
1211
1428
  },
1212
1429
  {
1213
1430
  id: "disjoint-channel",
1214
1431
  title: "不相交通道",
1215
- icon: Un
1432
+ icon: er
1216
1433
  }
1217
1434
  ]
1218
1435
  }
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() {
1436
+ ], d = c, f = w("cursor"), p = w(null), m = w(!1);
1437
+ function h() {
1221
1438
  try {
1222
- let e = localStorage.getItem(se);
1439
+ let e = localStorage.getItem(K);
1223
1440
  if (e) {
1224
- let t = JSON.parse(e), n = {};
1441
+ let t = JSON.parse(e), n = { ...t };
1225
1442
  return G.forEach((e) => {
1226
1443
  n[e.key] = t[e.key] ?? e.default;
1227
1444
  }), n;
@@ -1232,110 +1449,101 @@ var rr = {
1232
1449
  e[t.key] = t.default;
1233
1450
  }), e;
1234
1451
  }
1235
- function I(e) {
1452
+ function _(e) {
1236
1453
  try {
1237
- localStorage.setItem(se, JSON.stringify(e));
1454
+ localStorage.setItem(K, JSON.stringify(e));
1238
1455
  } catch {}
1239
1456
  }
1240
- let L = C(F()), R = C({ ...L.value });
1241
- function z(e) {
1242
- return h.value === e.id ? !0 : e.children ? e.children.some((e) => e.id === h.value) : !1;
1457
+ let v = w(h());
1458
+ function b(e) {
1459
+ return f.value === e.id ? !0 : e.children ? e.children.some((e) => e.id === f.value) : !1;
1243
1460
  }
1244
- function B(e) {
1461
+ function C(e) {
1245
1462
  if (e.children?.length) {
1246
- if (!e.children.some((e) => e.id === h.value)) {
1463
+ if (!e.children.some((e) => e.id === f.value)) {
1247
1464
  let t = e.children[0];
1248
- h.value = t.id, m("selectTool", t.id);
1465
+ f.value = t.id, d("selectTool", t.id);
1249
1466
  }
1250
- V(e.id);
1467
+ O(e.id);
1251
1468
  return;
1252
1469
  }
1253
- h.value = e.id, m("selectTool", e.id), _.value = null;
1254
- }
1255
- function ee(e) {
1256
- h.value = e.id, m("selectTool", e.id), _.value = null;
1470
+ f.value = e.id, d("selectTool", e.id), p.value = null;
1257
1471
  }
1258
- function V(e) {
1259
- _.value = _.value === e ? null : e;
1472
+ function D(e) {
1473
+ f.value = e.id, d("selectTool", e.id), p.value = null;
1260
1474
  }
1261
- function te() {
1262
- R.value = { ...L.value }, v.value = !0;
1475
+ function O(e) {
1476
+ p.value = p.value === e ? null : e;
1263
1477
  }
1264
- function H() {
1265
- v.value = !1;
1266
- }
1267
- function ne() {
1268
- let e = {};
1269
- G.forEach((t) => {
1270
- e[t.key] = t.default;
1271
- }), R.value = e;
1478
+ function A() {
1479
+ m.value = !0;
1272
1480
  }
1273
- function U() {
1274
- L.value = { ...R.value }, I(L.value), Qn(!!L.value.enableCanvasProfiler), m("settingsChange", { ...L.value }), H();
1481
+ function j() {
1482
+ return { ...v.value };
1275
1483
  }
1276
- function re() {
1277
- return { ...L.value };
1484
+ r({ getSettings: j });
1485
+ function M(e) {
1486
+ v.value = { ...e }, _(v.value), lr(!!v.value.enableCanvasProfiler), d("settingsChange", { ...v.value }), m.value = !1;
1278
1487
  }
1279
- d({ getSettings: re });
1280
- function W(e) {
1281
- e.target.closest(".tool-item") || (_.value = null);
1488
+ function P(e) {
1489
+ e.target.closest(".tool-item") || (p.value = null);
1282
1490
  }
1283
1491
  return y(() => {
1284
- document.addEventListener("click", W, !0), m("settingsChange", { ...L.value }), Qn(!!L.value.enableCanvasProfiler);
1492
+ document.addEventListener("click", P, !0), d("settingsChange", { ...v.value }), lr(!!v.value.enableCanvasProfiler);
1285
1493
  }), 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", {
1494
+ document.removeEventListener("click", P, !0);
1495
+ }), (r, c) => (S(), o(e, null, [s("nav", Dr, [
1496
+ s("div", Or, [(S(), o(e, null, T(u, (t) => s("div", {
1289
1497
  key: t.id,
1290
1498
  class: "tool-item"
1291
1499
  }, [s("button", {
1292
1500
  type: "button",
1293
- class: g(["left-toolbar__button", { active: z(t) }]),
1501
+ class: g(["left-toolbar__button", { active: b(t) }]),
1294
1502
  title: t.title,
1295
1503
  "aria-label": t.title,
1296
- onClick: (e) => B(t),
1297
- onPointerdown: d[0] ||= P(() => {}, ["stop"]),
1298
- onPointermove: d[1] ||= P(() => {}, ["stop"]),
1299
- onPointerup: d[2] ||= P(() => {}, ["stop"])
1300
- }, [(S(), i(T(t.icon), {
1504
+ onClick: (e) => C(t),
1505
+ onPointerdown: c[0] ||= F(() => {}, ["stop"]),
1506
+ onPointermove: c[1] ||= F(() => {}, ["stop"]),
1507
+ onPointerup: c[2] ||= F(() => {}, ["stop"])
1508
+ }, [(S(), i(E(t.icon), {
1301
1509
  class: "tool-icon",
1302
1510
  "aria-hidden": "true"
1303
1511
  })), t.children && t.children.length ? (S(), o("span", {
1304
1512
  key: 0,
1305
- class: g(["corner-indicator", { open: _.value === t.id }]),
1306
- onClick: P((e) => V(t.id), ["stop"]),
1513
+ class: g(["corner-indicator", { open: p.value === t.id }]),
1514
+ onClick: F((e) => O(t.id), ["stop"]),
1307
1515
  "aria-label": "展开子菜单"
1308
- }, 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", {
1516
+ }, null, 10, Ar)) : a("", !0)], 42, kr), l(n, { name: "dropdown" }, {
1517
+ default: N(() => [p.value === t.id && t.children && t.children.length ? (S(), o("div", {
1310
1518
  key: 0,
1311
1519
  class: "tool-dropdown",
1312
- onPointerdown: d[3] ||= P(() => {}, ["stop"]),
1313
- onPointermove: d[4] ||= P(() => {}, ["stop"]),
1314
- onPointerup: d[5] ||= P(() => {}, ["stop"])
1315
- }, [(S(!0), o(e, null, w(t.children, (e) => (S(), o("button", {
1520
+ onPointerdown: c[3] ||= F(() => {}, ["stop"]),
1521
+ onPointermove: c[4] ||= F(() => {}, ["stop"]),
1522
+ onPointerup: c[5] ||= F(() => {}, ["stop"])
1523
+ }, [(S(!0), o(e, null, T(t.children, (e) => (S(), o("button", {
1316
1524
  key: e.id,
1317
1525
  type: "button",
1318
- class: g(["left-toolbar__button", { active: h.value === e.id }]),
1526
+ class: g(["left-toolbar__button", { active: f.value === e.id }]),
1319
1527
  title: e.title,
1320
1528
  "aria-label": e.title,
1321
- onClick: (t) => ee(e)
1322
- }, [(S(), i(T(e.icon), {
1529
+ onClick: (t) => D(e)
1530
+ }, [(S(), i(E(e.icon), {
1323
1531
  class: "tool-icon",
1324
1532
  "aria-hidden": "true"
1325
- }))], 10, sr))), 128))], 32)) : a("", !0)]),
1533
+ }))], 10, jr))), 128))], 32)) : a("", !0)]),
1326
1534
  _: 2
1327
1535
  }, 1024)])), 64))]),
1328
- d[22] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
1329
- s("div", cr, [s("button", {
1536
+ c[22] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
1537
+ s("div", Mr, [s("button", {
1330
1538
  type: "button",
1331
1539
  class: "left-toolbar__button",
1332
1540
  title: "放大",
1333
1541
  "aria-label": "放大",
1334
- onClick: d[6] ||= (e) => r.$emit("zoomIn"),
1335
- onPointerdown: d[7] ||= P(() => {}, ["stop"]),
1336
- onPointermove: d[8] ||= P(() => {}, ["stop"]),
1337
- onPointerup: d[9] ||= P(() => {}, ["stop"])
1338
- }, [l(O(yn), {
1542
+ onClick: c[6] ||= (e) => r.$emit("zoomIn"),
1543
+ onPointerdown: c[7] ||= F(() => {}, ["stop"]),
1544
+ onPointermove: c[8] ||= F(() => {}, ["stop"]),
1545
+ onPointerup: c[9] ||= F(() => {}, ["stop"])
1546
+ }, [l(k(An), {
1339
1547
  class: "tool-icon",
1340
1548
  "aria-hidden": "true"
1341
1549
  })], 32), s("button", {
@@ -1343,127 +1551,63 @@ var rr = {
1343
1551
  class: "left-toolbar__button",
1344
1552
  title: "缩小",
1345
1553
  "aria-label": "缩小",
1346
- onClick: d[10] ||= (e) => r.$emit("zoomOut"),
1347
- onPointerdown: d[11] ||= P(() => {}, ["stop"]),
1348
- onPointermove: d[12] ||= P(() => {}, ["stop"]),
1349
- onPointerup: d[13] ||= P(() => {}, ["stop"])
1350
- }, [l(O(Sn), {
1554
+ onClick: c[10] ||= (e) => r.$emit("zoomOut"),
1555
+ onPointerdown: c[11] ||= F(() => {}, ["stop"]),
1556
+ onPointermove: c[12] ||= F(() => {}, ["stop"]),
1557
+ onPointerup: c[13] ||= F(() => {}, ["stop"])
1558
+ }, [l(k(Nn), {
1351
1559
  class: "tool-icon",
1352
1560
  "aria-hidden": "true"
1353
1561
  })], 32)]),
1354
- d[23] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
1355
- s("div", lr, [s("button", {
1562
+ c[23] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
1563
+ s("div", Nr, [s("button", {
1356
1564
  type: "button",
1357
1565
  class: "left-toolbar__button",
1358
- title: u.isFullscreen ? "退出全屏" : "全屏显示",
1359
- "aria-label": u.isFullscreen ? "退出全屏" : "全屏显示",
1360
- onClick: d[14] ||= (e) => r.$emit("toggleFullscreen"),
1361
- onPointerdown: d[15] ||= P(() => {}, ["stop"]),
1362
- onPointermove: d[16] ||= P(() => {}, ["stop"]),
1363
- onPointerup: d[17] ||= P(() => {}, ["stop"])
1364
- }, [u.isFullscreen ? (S(), i(O(On), {
1566
+ title: t.isFullscreen ? "退出全屏" : "全屏显示",
1567
+ "aria-label": t.isFullscreen ? "退出全屏" : "全屏显示",
1568
+ onClick: c[14] ||= (e) => r.$emit("toggleFullscreen"),
1569
+ onPointerdown: c[15] ||= F(() => {}, ["stop"]),
1570
+ onPointermove: c[16] ||= F(() => {}, ["stop"]),
1571
+ onPointerup: c[17] ||= F(() => {}, ["stop"])
1572
+ }, [t.isFullscreen ? (S(), i(k(zn), {
1365
1573
  key: 0,
1366
1574
  class: "tool-icon",
1367
1575
  "aria-hidden": "true"
1368
- })) : (S(), i(O(Tn), {
1576
+ })) : (S(), i(k(In), {
1369
1577
  key: 1,
1370
1578
  class: "tool-icon",
1371
1579
  "aria-hidden": "true"
1372
- }))], 40, ur)]),
1373
- d[24] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
1374
- s("div", dr, [s("button", {
1580
+ }))], 40, Pr)]),
1581
+ c[24] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
1582
+ s("div", Fr, [s("button", {
1375
1583
  type: "button",
1376
1584
  class: "left-toolbar__button",
1377
1585
  title: "设置",
1378
1586
  "aria-label": "设置",
1379
- onClick: te,
1380
- onPointerdown: d[18] ||= P(() => {}, ["stop"]),
1381
- onPointermove: d[19] ||= P(() => {}, ["stop"]),
1382
- onPointerup: d[20] ||= P(() => {}, ["stop"])
1383
- }, [l(O(jn), {
1587
+ onClick: A,
1588
+ onPointerdown: c[18] ||= F(() => {}, ["stop"]),
1589
+ onPointermove: c[19] ||= F(() => {}, ["stop"]),
1590
+ onPointerup: c[20] ||= F(() => {}, ["stop"])
1591
+ }, [l(k(Hn), {
1384
1592
  class: "tool-icon",
1385
1593
  "aria-hidden": "true"
1386
1594
  })], 32)])
1387
- ]), (S(), i(t, { to: O(b) }, [l(n, { name: "overlay" }, {
1388
- default: M(() => [v.value ? (S(), o("div", {
1389
- key: 0,
1390
- class: "settings-overlay",
1391
- onClick: H
1392
- }, [l(n, { name: "modal" }, {
1393
- default: M(() => [s("div", {
1394
- class: "settings-modal",
1395
- onClick: d[21] ||= P(() => {}, ["stop"])
1396
- }, [
1397
- 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
- class: "settings-close",
1399
- onClick: H
1400
- }, [...d[25] ||= [s("svg", {
1401
- viewBox: "0 0 24 24",
1402
- fill: "none",
1403
- stroke: "currentColor",
1404
- "stroke-width": "2"
1405
- }, [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", {
1407
- key: t.key,
1408
- class: "settings-item"
1409
- }, [s("label", pr, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((S(), o("input", {
1410
- key: 0,
1411
- type: "checkbox",
1412
- 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", {
1415
- key: 1,
1416
- 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", {
1419
- key: e.value,
1420
- 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", {
1422
- key: t.key,
1423
- class: "settings-item experimental"
1424
- }, [s("label", _r, [s("span", null, D(t.label), 1), t.type === "boolean" ? N((S(), o("input", {
1425
- key: 0,
1426
- type: "checkbox",
1427
- 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", {
1430
- key: 1,
1431
- 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", {
1434
- key: e.value,
1435
- value: e.value
1436
- }, D(e.label), 9, br))), 128))], 8, yr)), [[A, R.value[t.key]]]) : a("", !0)])]))), 128))], 64)) : a("", !0)]),
1437
- s("div", { class: "settings-footer" }, [s("button", {
1438
- class: "settings-btn reset",
1439
- onClick: ne
1440
- }, [...d[29] ||= [s("svg", {
1441
- viewBox: "0 0 24 24",
1442
- fill: "none",
1443
- stroke: "currentColor",
1444
- "stroke-width": "2"
1445
- }, [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
- class: "settings-btn cancel",
1447
- onClick: H
1448
- }, "取消"), s("button", {
1449
- class: "settings-btn confirm",
1450
- onClick: U
1451
- }, [...d[30] ||= [s("svg", {
1452
- viewBox: "0 0 24 24",
1453
- fill: "none",
1454
- stroke: "currentColor",
1455
- "stroke-width": "2.5"
1456
- }, [s("path", { d: "M20 6L9 17l-5-5" })], -1), c(" 确定 ", -1)]])])])
1457
- ])]),
1458
- _: 1
1459
- })])) : a("", !0)]),
1460
- _: 1
1461
- })], 8, ["to"]))], 64));
1595
+ ]), l(Er, {
1596
+ show: m.value,
1597
+ onClose: c[21] ||= (e) => m.value = !1,
1598
+ onConfirm: M
1599
+ }, null, 8, ["show"])], 64));
1462
1600
  }
1463
- }), [["__scopeId", "data-v-3e3ffb4f"]]), Sr = ["data-theme"], Cr = {
1601
+ }), [["__scopeId", "data-v-d0932502"]]), Lr = ["data-theme"], Rr = {
1464
1602
  class: "pane-separator-layer",
1465
1603
  "aria-hidden": "true"
1466
- }, wr = 4, Tr = /* @__PURE__ */ q(/* @__PURE__ */ u({
1604
+ }, zr = {
1605
+ class: "canvas-layer",
1606
+ ref: "canvasLayerRef"
1607
+ }, Br = {
1608
+ class: "x-axis-canvas",
1609
+ ref: "xAxisCanvasRef"
1610
+ }, Vr = 4, Hr = /* @__PURE__ */ q(/* @__PURE__ */ u({
1467
1611
  __name: "KLineChart",
1468
1612
  props: {
1469
1613
  semanticConfig: {},
@@ -1481,38 +1625,54 @@ var rr = {
1481
1625
  default: !1
1482
1626
  }
1483
1627
  },
1484
- emits: ["zoomLevelChange", "toggleFullscreen"],
1628
+ emits: [
1629
+ "zoomLevelChange",
1630
+ "toggleFullscreen",
1631
+ "themeChange"
1632
+ ],
1485
1633
  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, {
1634
+ let d = n, f = u, p = w(null), m = w(null), v = w(null), b = w(null), C = w(null);
1635
+ Te(v);
1636
+ let E = D(null), O = D(null), k = w(0), A = w(0), j = w(1), N = w(d.initialZoomLevel ?? 1), P = w(0), F = w(1), I = w(0), L = w({}), R = w(null), z = w([]), V = N.value;
1637
+ P.value = ue(V, {
1500
1638
  minKWidth: d.minKWidth,
1501
1639
  maxKWidth: d.maxKWidth,
1502
1640
  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);
1514
- }
1515
- function G() {
1641
+ dpr: j.value
1642
+ }), F.value = le(P.value, j.value);
1643
+ let U = w("light"), oe = w({}), se = r(() => {
1644
+ let e = oe.value.isAsiaMarket ?? !1, t = te(U.value, e);
1645
+ return {
1646
+ upColor: t.candleUpBody,
1647
+ downColor: t.candleDownBody
1648
+ };
1649
+ }), W = r(() => {
1650
+ let e = U.value === "dark" ? B : ee, t = oe.value.colorPresetSettings?.[U.value];
1651
+ return t && Object.keys(t).length > 0 ? H({
1652
+ ...e,
1653
+ colors: {
1654
+ ...e.colors,
1655
+ ...t
1656
+ }
1657
+ }) : H(e);
1658
+ }), G = null;
1659
+ function K(e) {
1660
+ E.value?.setTheme(e.matches ? "dark" : "light");
1661
+ }
1662
+ function pe(e, t) {
1663
+ if (!(!e || !t)) if (t === "auto") {
1664
+ let t = window.matchMedia("(prefers-color-scheme: dark)");
1665
+ e.setTheme(t.matches ? "dark" : "light"), G !== t && (G?.removeEventListener("change", K), G = t, t.addEventListener("change", K));
1666
+ } else G?.removeEventListener("change", K), G = null, e.setTheme(t);
1667
+ }
1668
+ function me() {}
1669
+ function he(e) {
1670
+ if (oe.value = e, pe(E.value, e.theme), E.value?.updateSettingsFacade(e), e.performanceTest10kKlines) {
1671
+ let e = ge();
1672
+ console.time("updateData-10k"), E.value?.updateData(e), console.timeEnd("updateData-10k"), k.value = e.length, A.value++;
1673
+ } else O.value && E.value?.getData()?.length === 1e4 && O.value.applyConfig(d.semanticConfig);
1674
+ }
1675
+ function ge() {
1516
1676
  let e = [], t = (/* @__PURE__ */ new Date("2020-01-01")).getTime(), n = 3e3;
1517
1677
  for (let r = 0; r < 1e4; r++) {
1518
1678
  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,36 +1687,36 @@ var rr = {
1527
1687
  }
1528
1688
  return e;
1529
1689
  }
1530
- function se(e, t, n) {
1690
+ function _e(e, t, n) {
1531
1691
  let r = e.getBoundingClientRect();
1532
1692
  return {
1533
1693
  width: Math.max(t, Math.round(r.width)),
1534
1694
  height: Math.max(n, Math.round(r.height))
1535
1695
  };
1536
1696
  }
1537
- function le(e) {
1697
+ function ve(e) {
1538
1698
  e && h(() => {
1539
1699
  if (!e.isConnected) return;
1540
- let t = se(e, 180, 80);
1541
- k.value?.interaction.setTooltipSize(t);
1700
+ let t = _e(e, 180, 80);
1701
+ E.value?.setTooltipSize(t);
1542
1702
  });
1543
1703
  }
1544
- function ue(e) {
1704
+ function ye(e) {
1545
1705
  e && h(() => {
1546
- e.isConnected && (_e.value = se(e, 120, 60));
1706
+ e.isConnected && (Oe.value = _e(e, 120, 60));
1547
1707
  });
1548
1708
  }
1549
- let de = C({
1709
+ let q = w({
1550
1710
  x: 0,
1551
1711
  y: 0
1552
- }), K = C(!1), fe = null;
1553
- function q() {
1554
- fe = null;
1712
+ }), be = w(!1), xe = null;
1713
+ function Se() {
1714
+ xe = null;
1555
1715
  }
1556
- function me(e) {
1557
- return fe ||= e.getBoundingClientRect(), fe;
1716
+ function Ce(e) {
1717
+ return xe ||= e.getBoundingClientRect(), xe;
1558
1718
  }
1559
- let J = E({
1719
+ let J = D({
1560
1720
  crosshairPos: null,
1561
1721
  crosshairIndex: null,
1562
1722
  crosshairPrice: null,
@@ -1574,14 +1734,14 @@ var rr = {
1574
1734
  isHoveringPaneBoundary: !1,
1575
1735
  hoveredPaneBoundaryId: null,
1576
1736
  isHoveringRightAxis: !1
1577
- }), Y = E(null), he = r(() => {
1737
+ }), Y = D(null), Ee = r(() => {
1578
1738
  let e = R.value;
1579
- return e ? M.state.drawings.find((t) => t.id === e) ?? null : null;
1580
- }), ge = C([]), _e = C({
1739
+ return e ? z.value.find((t) => t.id === e) ?? null : null;
1740
+ }), De = w([]), Oe = w({
1581
1741
  width: 220,
1582
1742
  height: 120
1583
- }), ve = r(() => {
1584
- let e = v.value, t = b.value;
1743
+ }), ke = r(() => {
1744
+ let e = p.value, t = m.value;
1585
1745
  return !e || !t ? {
1586
1746
  x: 0,
1587
1747
  y: 0
@@ -1589,80 +1749,82 @@ var rr = {
1589
1749
  x: e.offsetLeft,
1590
1750
  y: e.offsetTop
1591
1751
  };
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(() => {
1752
+ }), Ae = r(() => J.value.hoveredMarkerData), je = r(() => J.value.hoveredCustomMarker), Me = r(() => J.value.isDragging), Ne = r(() => J.value.isResizingPaneBoundary), Pe = r(() => J.value.isHoveringPaneBoundary), Fe = r(() => J.value.hoveredPaneBoundaryId), Ie = r(() => J.value.isHoveringRightAxis), Le = r(() => J.value.hoveredIndex);
1753
+ r(() => J.value.crosshairIndex);
1754
+ let Re = r(() => Me.value ? "grabbing" : Ne.value || Pe.value ? "ns-resize" : Le.value === null ? "crosshair" : "pointer"), ze = r(() => {
1593
1755
  let e = J.value.hoveredIndex;
1594
1756
  if (typeof e != "number") return null;
1595
- z.value;
1596
- let t = k.value?.getData();
1757
+ A.value;
1758
+ let t = E.value?.getData();
1597
1759
  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
1601
- })), Ne = r(() => ({
1602
- left: `${Me.value.x}px`,
1603
- top: `${Me.value.y}px`
1604
- })), 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) {
1760
+ }), Be = r(() => J.value.hoveredIndex), Ve = r(() => J.value.tooltipPos), He = r(() => ({
1761
+ x: Ve.value.x + ke.value.x,
1762
+ y: Ve.value.y + ke.value.y
1763
+ })), Ue = r(() => ({
1764
+ left: `${He.value.x}px`,
1765
+ top: `${He.value.y}px`
1766
+ })), We = r(() => ({
1767
+ x: q.value.x + ke.value.x,
1768
+ y: q.value.y + ke.value.y
1769
+ })), Ge = r(() => ({
1770
+ left: `${We.value.x}px`,
1771
+ top: `${We.value.y}px`
1772
+ })), Ke = r(() => J.value.tooltipAnchorPlacement), qe = r(() => {
1773
+ let e = E.value?.viewport.peek(), t = p.value, n = e?.plotWidth ?? (t ? t.clientWidth : 0);
1774
+ return q.value.x + 12 + Oe.value.width + 12 > n ? "left-bottom" : "right-bottom";
1775
+ }), Je = r(() => (A.value, E.value?.getData() ?? []));
1776
+ function Ye(e) {
1615
1777
  Y.value?.setTool(e);
1616
1778
  }
1617
- function Be(e) {
1618
- let t = he.value;
1619
- !t || !Y.value || (Y.value.updateDrawingStyle(t.id, e), M.actions.bumpDrawingVersion());
1779
+ function Xe(e) {
1780
+ let t = Ee.value;
1781
+ !t || !Y.value || Y.value.updateDrawingStyle(t.id, e);
1620
1782
  }
1621
- function Ve() {
1622
- 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()));
1783
+ function Ze() {
1784
+ let e = Ee.value;
1785
+ !e || !Y.value || (Y.value.removeDrawing(e.id), R.value = null, z.value = Y.value.getDrawings());
1624
1786
  }
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 });
1787
+ function Qe(e) {
1788
+ E.value?.handlePointerEvent(e, { onPointerDown: (e, t) => Y.value?.onPointerDown(e, t) ? (z.value = Y.value.getDrawings(), !0) : !1 });
1627
1789
  }
1628
- function Ue(e) {
1629
- let t = v.value;
1790
+ function $e(e) {
1791
+ let t = p.value;
1630
1792
  if (t) {
1631
- let n = me(t);
1632
- de.value = {
1793
+ let n = Ce(t);
1794
+ q.value = {
1633
1795
  x: e.clientX - n.left,
1634
1796
  y: e.clientY - n.top
1635
1797
  };
1636
1798
  }
1637
- k.value?.handlePointerEvent(e, { onPointerMove: (e, t) => Y.value?.onPointerMove(e, t) ? (M.actions.setDrawings(Y.value.getDrawings()), !0) : !1 });
1799
+ E.value?.handlePointerEvent(e, { onPointerMove: (e, t) => Y.value?.onPointerMove(e, t) ? (z.value = Y.value.getDrawings(), !0) : !1 });
1638
1800
  }
1639
- function We(e) {
1640
- k.value?.handlePointerEvent(e, { onPointerUp: (e, t) => Y.value?.onPointerUp(e, t) ? (M.actions.setDrawings(Y.value.getDrawings()), !0) : !1 });
1801
+ function et(e) {
1802
+ E.value?.handlePointerEvent(e, { onPointerUp: (e, t) => Y.value?.onPointerUp(e, t) ? (z.value = Y.value.getDrawings(), !0) : !1 });
1641
1803
  }
1642
- function Ge(e) {
1643
- k.value?.handlePointerEvent(e);
1804
+ function tt(e) {
1805
+ E.value?.handlePointerEvent(e);
1644
1806
  }
1645
- function Ke(e) {
1646
- k.value?.handlePointerEvent(e);
1807
+ function nt(e) {
1808
+ E.value?.handlePointerEvent(e);
1647
1809
  }
1648
- function qe(e) {
1649
- k.value?.handlePointerEvent(e);
1810
+ function rt(e) {
1811
+ E.value?.handlePointerEvent(e);
1650
1812
  }
1651
- function Je(e) {
1652
- k.value?.handlePointerEvent(e);
1813
+ function it(e) {
1814
+ E.value?.handlePointerEvent(e);
1653
1815
  }
1654
- function Ye(e) {
1655
- k.value?.handlePointerEvent(e);
1816
+ function at(e) {
1817
+ E.value?.handlePointerEvent(e);
1656
1818
  }
1657
- function Xe() {
1658
- k.value?.handleScrollEvent();
1819
+ function ot() {
1820
+ E.value?.handleScrollEvent();
1659
1821
  }
1660
- let Ze = C([]), Qe = r(() => {
1822
+ let st = w([]), ct = r(() => {
1661
1823
  let e = [], t = /* @__PURE__ */ new Set();
1662
1824
  for (let n of Z.value) t.has(n.indicatorId) || (t.add(n.indicatorId), e.push(n.indicatorId));
1663
1825
  return e;
1664
- }), $e = r(() => [...Ze.value, ...Qe.value]), X = C({}), Z = C([]);
1665
- function et() {
1826
+ }), lt = r(() => [...st.value, ...ct.value]), X = w({}), Z = w([]);
1827
+ function ut() {
1666
1828
  let e = L.value.main ?? 3;
1667
1829
  return Z.value.length === 0 ? [{
1668
1830
  id: "main",
@@ -1681,73 +1843,44 @@ var rr = {
1681
1843
  role: "indicator"
1682
1844
  }))];
1683
1845
  }
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);
1846
+ function dt(e) {
1847
+ return { ...ie[e].defaultParams };
1695
1848
  }
1696
- function at(e) {
1697
- let t = rt.get(e);
1698
- t && (k.value?.removeRenderer(t), rt.delete(e));
1699
- }
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;
1849
+ let ft = /* @__PURE__ */ new Map();
1850
+ function pt(e = "VOLUME", t) {
1851
+ if (Z.value.length >= Vr) return !1;
1852
+ let n = t ?? dt(e);
1853
+ return !!E.value?.addIndicator(e, "sub", n);
1704
1854
  }
1705
- function st(e) {
1706
- at(e), k.value?.removeIndicator(e);
1855
+ function mt(e) {
1856
+ E.value?.removeIndicator(e);
1707
1857
  }
1708
- function ct() {
1709
- for (let e of Z.value) k.value?.removeIndicator(e.id), at(e.id);
1710
- nt.clear(), rt.clear();
1858
+ function ht() {
1859
+ for (let e of Z.value) E.value?.removeIndicator(e.id);
1860
+ ft.clear();
1711
1861
  }
1712
- function lt() {
1713
- let e = d.semanticConfig, t = k.value;
1862
+ function gt() {
1863
+ let e = d.semanticConfig, t = E.value;
1714
1864
  if (!t) return;
1715
1865
  let n = e.indicators?.main;
1716
- if (n) for (let e of n) e.enabled && t.enableMainIndicator(e.type, e.params);
1866
+ if (n) for (let e of n) e.enabled && t.addIndicator(e.type, "main", e.params);
1717
1867
  }
1718
- function ut() {
1719
- let e = k.value?.getSubPaneEntries() ?? [];
1720
- rt.clear();
1868
+ function _t() {
1869
+ let e = E.value?.subPanes.peek() ?? [];
1721
1870
  for (let t of e) {
1722
1871
  let { paneId: e, indicatorId: n, params: r } = t, i = e.match(/^(.+)_(\d+)$/);
1723
1872
  if (i) {
1724
1873
  let [, e, t] = i, n = parseInt(t, 10);
1725
- n >= (nt.get(e) ?? 0) && nt.set(e, n + 1);
1874
+ n >= (ft.get(e) ?? 0) && ft.set(e, n + 1);
1726
1875
  }
1727
- it(e, n);
1728
1876
  }
1729
1877
  }
1730
- function dt(e, t) {
1731
- let n = tt(t);
1732
- at(e), k.value?.replaceSubPaneIndicator(e, t, n), it(e, t);
1878
+ function vt(e, t) {
1879
+ let n = dt(t);
1880
+ E.value?.replaceSubPaneIndicator(e, t, n);
1733
1881
  }
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;
1748
- }
1749
- function mt(e, t) {
1750
- let n = k.value;
1882
+ function yt(e, t) {
1883
+ let n = E.value;
1751
1884
  if (n) {
1752
1885
  if ([
1753
1886
  "MA",
@@ -1769,42 +1902,33 @@ var rr = {
1769
1902
  "STRUCTURE",
1770
1903
  "ZONES"
1771
1904
  ].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
- }
1905
+ let r = st.value.find((t) => t === e);
1906
+ t && !r ? n.addIndicator(e, "main", X.value[e]) : !t && r && n.removeIndicator(e.toUpperCase());
1778
1907
  return;
1779
1908
  }
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) {
1909
+ if (re.includes(e)) if (t) {
1910
+ if (Z.value.find((t) => t.indicatorId === e) || Z.value.length >= Vr) return;
1911
+ if (!n.addIndicator(e, "sub", X.value[e]) && Z.value.length > 0) {
1785
1912
  let t = Z.value[Z.value.length - 1];
1786
- dt(t.id, e);
1913
+ vt(t.id, e);
1787
1914
  }
1788
1915
  } else Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
1789
- n.removeIndicator(e.id), at(e.id);
1916
+ n.removeIndicator(e.id);
1790
1917
  });
1791
1918
  }
1792
1919
  }
1793
- function ht(e, t) {
1920
+ function bt(e, t) {
1794
1921
  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
- });
1922
+ E.value?.updateIndicatorParams(e, t);
1802
1923
  return;
1803
1924
  }
1925
+ re.includes(e) && Z.value.filter((t) => t.indicatorId === e).forEach((e) => {
1926
+ E.value?.updateIndicatorParams(e.id, t);
1927
+ });
1804
1928
  }
1805
- function gt(e) {
1929
+ function xt(e) {
1806
1930
  if (!e.length || Z.value.length <= 1) return;
1807
- let t = e.filter((e) => ie.includes(e));
1931
+ let t = e.filter((e) => re.includes(e));
1808
1932
  if (!t.length) return;
1809
1933
  let n = new Map(Z.value.map((e) => [e.indicatorId, e])), r = [];
1810
1934
  for (let e of t) {
@@ -1816,101 +1940,87 @@ var rr = {
1816
1940
  let i = Z.value.map((e) => e.id), a = r.map((e) => e.id);
1817
1941
  if (i.join("|") === a.join("|")) return;
1818
1942
  Z.value = r;
1819
- let o = k.value;
1820
- o && o.updatePaneLayout(et());
1943
+ let o = E.value;
1944
+ o && o.updatePaneLayout(ut());
1821
1945
  }
1822
- let _t = r(() => d.rightAxisWidth + d.priceLabelWidth), vt = M.computed.totalWidth;
1823
- function yt() {
1824
- let e = v.value, t = k.value;
1946
+ let St = r(() => d.rightAxisWidth + d.priceLabelWidth), Ct = r(() => (A.value, I.value, P.value, F.value, j.value, E.value?.getContentWidth() ?? 0));
1947
+ function wt() {
1948
+ let e = p.value, t = E.value;
1825
1949
  if (!e || !t) return;
1826
1950
  let n = t.getData()?.length ?? 0;
1827
1951
  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();
1952
+ let r = t.viewport.peek().dpr, { unitPx: i, startXPx: a } = ce(P.value, F.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));
1953
+ e.scrollLeft = Math.round(c * r) / r;
1830
1954
  }
1831
- function bt(e, t) {
1832
- let n = k.value;
1833
- n && n.zoomToLevel(e, t);
1955
+ function Tt(e, t) {
1956
+ E.value?.zoomToLevel(e, t);
1834
1957
  }
1835
1958
  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
1959
+ scheduleRender: me,
1960
+ scrollToRight: wt,
1961
+ addSubPane: pt,
1962
+ removeSubPane: mt,
1963
+ switchSubIndicator: vt,
1964
+ clearAllSubPanes: ht,
1965
+ zoomToLevel: Tt,
1966
+ zoomIn: (e) => Tt(N.value + 1, e),
1967
+ zoomOut: (e) => Tt(N.value - 1, e),
1968
+ getZoomLevel: () => N.value,
1969
+ getZoomLevelCount: () => E.value?.getZoomLevelCount() ?? 10
1850
1970
  });
1851
- function xt(e) {
1852
- let t = (e) => {
1853
- e.preventDefault();
1854
- let t = k.value;
1855
- t && t.handleWheelEvent(e);
1971
+ function Et() {
1972
+ return (e) => {
1973
+ e.preventDefault(), E.value?.handleWheelEvent(e);
1856
1974
  };
1857
- return e.addEventListener("wheel", t, { passive: !1 }), t;
1858
1975
  }
1859
- function St(e, t, n, r) {
1860
- return new H({
1976
+ function Dt(e, t, n, r) {
1977
+ return ae({
1861
1978
  container: e,
1979
+ data: [],
1862
1980
  canvasLayer: t,
1863
1981
  rightAxisLayer: n,
1864
- xAxisCanvas: r
1865
- }, {
1982
+ xAxisCanvas: r,
1983
+ initialZoomLevel: d.initialZoomLevel,
1984
+ zoomLevels: d.zoomLevels,
1866
1985
  yPaddingPx: d.yPaddingPx,
1867
1986
  rightAxisWidth: d.rightAxisWidth,
1868
1987
  bottomAxisHeight: d.bottomAxisHeight,
1869
1988
  priceLabelWidth: d.priceLabelWidth,
1870
1989
  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
1990
+ maxKWidth: d.maxKWidth
1879
1991
  });
1880
1992
  }
1881
- function Ct(e) {
1882
- e.setOnPaneLayoutChange(() => {
1883
- 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();
1993
+ function Ot(e) {
1994
+ let t = e.paneLayout.subscribe(() => {
1995
+ Se();
1996
+ let t = p.value && parseInt(getComputedStyle(p.value).borderTopWidth) || 0;
1997
+ De.value = e.paneLayout.peek().slice(0, -1).map((n) => {
1998
+ let r = e.getPaneInfo(n.id), i = (r?.top ?? 0) + (r?.height ?? 0);
1887
1999
  return {
1888
- id: t.id,
1889
- top: t.top + t.height + n
2000
+ id: n.id,
2001
+ top: i + t
1890
2002
  };
1891
2003
  });
1892
- });
1893
- let t = e.paneRatios.subscribe(() => {
1894
- let t = e.paneRatios.peek();
1895
- M.actions.setPaneRatios({ ...t });
1896
- }), n = e.viewport.subscribe(() => {
2004
+ }), n = e.paneRatios.subscribe(() => {
2005
+ L.value = { ...e.paneRatios.peek() };
2006
+ }), r = e.viewport.subscribe(() => {
1897
2007
  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);
2008
+ j.value !== t.dpr && (j.value = t.dpr), I.value !== t.plotWidth && (I.value = t.plotWidth), (N.value !== t.zoomLevel || P.value !== t.kWidth || F.value !== t.kGap) && (N.value = t.zoomLevel, P.value = t.kWidth, F.value = t.kGap);
1899
2009
  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;
2010
+ n !== void 0 && n !== p.value?.scrollLeft && (Se(), h(() => {
2011
+ let e = p.value;
2012
+ if (!e) return;
2013
+ let r = Math.max(0, e.scrollWidth - e.clientWidth), i = Math.min(Math.max(0, n), r), a = t.dpr;
2014
+ e.scrollLeft = Math.round(i * a) / a;
1905
2015
  }));
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(() => {
2016
+ }), i = e.data.subscribe(() => {
2017
+ k.value = e.data.peek().length, A.value++;
2018
+ }), a = e.theme.subscribe(() => {
2019
+ let t = e.theme.peek();
2020
+ U.value = t, f("themeChange", t);
2021
+ }), o = e.indicators.subscribe(() => {
1912
2022
  let t = e.indicators.peek(), n = t.filter((e) => e.role === "main").map((e) => e.definitionId);
1913
- Ze.value = n;
2023
+ st.value = n;
1914
2024
  let r = { ...X.value };
1915
2025
  for (let e of t) e.role === "main" && e.params && Object.keys(e.params).length > 0 && (r[e.definitionId] = { ...e.params });
1916
2026
  e.updateRendererConfig("mainIndicatorLegend", { indicators: {
@@ -1931,7 +2041,7 @@ var rr = {
1931
2041
  params: r.ENE || {}
1932
2042
  }
1933
2043
  } }), X.value = r;
1934
- }), o = e.subPanes.subscribe(() => {
2044
+ }), s = e.subPanes.subscribe(() => {
1935
2045
  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
2046
  for (let e of t) i.has(e.paneId) || r.push({
1937
2047
  id: e.paneId,
@@ -1944,165 +2054,156 @@ var rr = {
1944
2054
  X.value = a;
1945
2055
  });
1946
2056
  x(() => {
1947
- n(), r(), t(), i(), a(), o();
2057
+ r(), i(), n(), t(), a(), o(), s(), G?.removeEventListener("change", K);
1948
2058
  });
1949
2059
  }
1950
- function wt(e) {
1951
- let t = D.value?.getSettings() ?? { showVolumePriceMarkers: !0 };
1952
- if (e.updateSettings(t), t.performanceTest10kKlines) {
1953
- let t = G();
2060
+ function kt(e) {
2061
+ let t = C.value?.getSettings() ?? { showVolumePriceMarkers: !0 };
2062
+ if (oe.value = t, pe(e, t.theme), e.updateSettingsFacade(t), t.performanceTest10kKlines) {
2063
+ let t = ge();
1954
2064
  console.time("updateData-10k"), e.updateData(t), console.timeEnd("updateData-10k");
1955
2065
  }
1956
2066
  }
1957
- function Et(e) {
1958
- Y.value = new ce(e), Y.value.setCallbacks({
2067
+ function At(e) {
2068
+ Y.value = new ne(e), Y.value.setCallbacks({
1959
2069
  onDrawingCreated: (e) => {
1960
- M.actions.setDrawings([...M.state.drawings, e]), M.actions.setSelectedDrawingId(e.id);
2070
+ z.value = [...z.value, e], R.value = e.id;
1961
2071
  },
1962
2072
  onToolChange: () => {},
1963
2073
  onDrawingSelected: (e) => {
1964
- M.actions.setSelectedDrawingId(e?.id ?? null);
2074
+ R.value = e?.id ?? null;
1965
2075
  }
1966
2076
  });
1967
2077
  }
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();
2078
+ function jt(e) {
2079
+ e.setTooltipAnchorPositioning(be.value), e.interactionState.subscribe(() => {
2080
+ J.value = e.interactionState.peek();
2081
+ }), J.value = e.interactionState.peek(), j.value = e.viewport.peek().dpr;
1978
2082
  }
1979
- function Ot(e) {
1980
- te(d.dataFetcher), A.value = new V(e), A.value.on("config:error", (e) => {
2083
+ function Mt(e) {
2084
+ fe(d.dataFetcher), O.value = new de(e), O.value.on("config:error", (e) => {
1981
2085
  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) => {
2086
+ }), O.value.on("config:ready", () => {
2087
+ gt(), _t(), h(() => wt());
2088
+ }), O.value.applyConfig(d.semanticConfig).then((e) => {
1985
2089
  e && !e.success && console.error("Semantic config apply failed:", e.errors);
1986
2090
  });
1987
2091
  }
1988
2092
  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;
2093
+ be.value = !1;
2094
+ let e = p.value, t = m.value;
2095
+ if (!e || !t) return;
2096
+ let n = Et();
2097
+ e.addEventListener("wheel", n, { passive: !1 });
2098
+ let r = e.querySelector(".canvas-layer"), i = e.querySelector(".x-axis-canvas"), a = Dt(e, r, t.querySelector(".right-axis-host"), i);
2099
+ E.value = a, Ot(a), kt(a), At(a), jt(a), Mt(a);
1994
2100
  }), 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;
2001
- }), j(() => d.yPaddingPx, (e) => {
2002
- k.value?.updateOptions({ yPaddingPx: e });
2003
- }), j(() => d.semanticConfig, async (e, t) => {
2101
+ let e = E.value;
2102
+ e && (E.value = null, e.dispose()), Y.value = null;
2103
+ }), M(() => d.yPaddingPx, (e) => {
2104
+ E.value?.updateOptionsFacade({ yPaddingPx: e });
2105
+ }), M(() => d.semanticConfig, async (e, t) => {
2004
2106
  if (e && e !== t) {
2005
- let t = await A.value?.applyConfig(e);
2107
+ let t = await O.value?.applyConfig(e);
2006
2108
  t && !t.success && console.error("Semantic config apply failed:", t.errors);
2007
2109
  }
2008
2110
  }, { deep: !0 }), (r, c) => (S(), o("div", {
2111
+ ref_key: "chartWrapperRef",
2112
+ ref: v,
2009
2113
  class: "chart-wrapper",
2010
- "data-theme": N.value
2114
+ "data-theme": U.value,
2115
+ style: _(W.value)
2011
2116
  }, [s("div", { class: g(["chart-stage", {
2012
- "is-dragging": xe.value,
2013
- "is-resizing-pane": Se.value,
2014
- "is-hovering-pane-separator": Ce.value,
2015
- "is-hovering-right-axis": Te.value,
2016
- "is-hovering-kline": Ee.value !== null
2017
- }]) }, [l(xr, {
2117
+ "is-dragging": Me.value,
2118
+ "is-resizing-pane": Ne.value,
2119
+ "is-hovering-pane-separator": Pe.value,
2120
+ "is-hovering-right-axis": Ie.value,
2121
+ "is-hovering-kline": Le.value !== null
2122
+ }]) }, [l(Ir, {
2018
2123
  ref_key: "toolbarRef",
2019
- ref: D,
2124
+ ref: C,
2020
2125
  "is-fullscreen": n.isFullscreen,
2021
- onSelectTool: ze,
2126
+ onSelectTool: Ye,
2022
2127
  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
2128
+ onZoomIn: c[1] ||= (e) => Tt(N.value + 1),
2129
+ onZoomOut: c[2] ||= (e) => Tt(N.value - 1),
2130
+ onSettingsChange: he
2026
2131
  }, null, 8, ["is-fullscreen"]), s("div", {
2027
2132
  class: "chart-main",
2028
2133
  ref_key: "chartMainRef",
2029
- ref: b
2134
+ ref: m
2030
2135
  }, [
2031
- s("div", Cr, [(S(!0), o(e, null, w(ge.value, (e) => (S(), o("div", {
2136
+ s("div", Rr, [(S(!0), o(e, null, T(De.value, (e) => (S(), o("div", {
2032
2137
  key: e.id,
2033
- class: g(["pane-separator-line", { "is-active": we.value === e.id }]),
2138
+ class: g(["pane-separator-line", { "is-active": Fe.value === e.id }]),
2034
2139
  style: _({ top: `${e.top}px` })
2035
2140
  }, null, 6))), 128))]),
2036
2141
  s("div", {
2037
2142
  ref_key: "tooltipLayerRef",
2038
- ref: T,
2143
+ ref: b,
2039
2144
  class: "tooltip-layer"
2040
2145
  }, null, 512),
2041
2146
  s("div", {
2042
2147
  class: "chart-container",
2043
- style: _({ cursor: Oe.value }),
2148
+ style: _({ cursor: Re.value }),
2044
2149
  ref_key: "containerRef",
2045
- ref: v,
2046
- onScrollPassive: Xe,
2047
- onPointerdown: He,
2048
- onPointermove: Ue,
2049
- onPointerup: We,
2050
- onPointerleave: Ge
2150
+ ref: p,
2151
+ onScrollPassive: ot,
2152
+ onPointerdown: Qe,
2153
+ onPointermove: $e,
2154
+ onPointerup: et,
2155
+ onPointerleave: tt
2051
2156
  }, [s("div", {
2052
2157
  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, {
2158
+ style: _({ width: Ct.value + "px" })
2159
+ }, [s("div", zr, [s("canvas", Br, null, 512), Ee.value ? (S(), i(we, {
2063
2160
  key: 0,
2064
- drawing: he.value,
2065
- onUpdateStyle: Be,
2066
- onDelete: Ve
2161
+ drawing: Ee.value,
2162
+ onUpdateStyle: Xe,
2163
+ onDelete: Ze
2067
2164
  }, null, 8, ["drawing"])) : a("", !0)], 512)], 4)], 36),
2068
- T.value ? (S(), i(t, {
2165
+ b.value ? (S(), i(t, {
2069
2166
  key: 0,
2070
- to: T.value
2167
+ to: b.value
2071
2168
  }, [
2072
- ke.value ? (S(), o("div", {
2169
+ ze.value ? (S(), o("div", {
2073
2170
  key: 0,
2074
- class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": K.value }]),
2075
- style: _(Ne.value)
2171
+ class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": be.value }]),
2172
+ style: _(Ue.value)
2076
2173
  }, null, 6)) : a("", !0),
2077
- ye.value || be.value ? (S(), o("div", {
2174
+ Ae.value || je.value ? (S(), o("div", {
2078
2175
  key: 1,
2079
- class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": K.value }]),
2080
- style: _(Fe.value)
2176
+ class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": be.value }]),
2177
+ style: _(Ge.value)
2081
2178
  }, null, 6)) : a("", !0),
2082
- ke.value ? (S(), i(Ht, {
2179
+ ze.value ? (S(), i($t, {
2083
2180
  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
2181
+ k: ze.value,
2182
+ index: Be.value,
2183
+ data: Je.value,
2184
+ pos: He.value,
2185
+ "set-el": ve,
2186
+ "use-anchor": be.value,
2187
+ "anchor-placement": Ke.value,
2188
+ "up-color": se.value.upColor,
2189
+ "down-color": se.value.downColor
2091
2190
  }, null, 8, [
2092
2191
  "k",
2093
2192
  "index",
2094
2193
  "data",
2095
2194
  "pos",
2096
2195
  "use-anchor",
2097
- "anchor-placement"
2196
+ "anchor-placement",
2197
+ "up-color",
2198
+ "down-color"
2098
2199
  ])) : a("", !0),
2099
- ye.value || be.value ? (S(), i(Gt, {
2200
+ Ae.value || je.value ? (S(), i(nn, {
2100
2201
  key: 3,
2101
- marker: ye.value || be.value,
2102
- pos: Pe.value,
2103
- "use-anchor": K.value,
2104
- "anchor-placement": Le.value,
2105
- "set-el": ue
2202
+ marker: Ae.value || je.value,
2203
+ pos: We.value,
2204
+ "use-anchor": be.value,
2205
+ "anchor-placement": qe.value,
2206
+ "set-el": ye
2106
2207
  }, null, 8, [
2107
2208
  "marker",
2108
2209
  "pos",
@@ -2112,25 +2213,24 @@ var rr = {
2112
2213
  ], 8, ["to"])) : a("", !0),
2113
2214
  s("div", {
2114
2215
  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
2216
+ ref: "rightAxisLayerRef",
2217
+ style: _({ width: St.value + "px" }),
2218
+ onPointerdown: nt,
2219
+ onPointermove: rt,
2220
+ onPointerup: it,
2221
+ onPointerleave: at
2122
2222
  }, null, 36)
2123
- ], 512)], 2), l(Tt, {
2124
- "active-indicators": $e.value,
2223
+ ], 512)], 2), l(Rt, {
2224
+ "active-indicators": lt.value,
2125
2225
  "indicator-params": X.value,
2126
- onToggle: mt,
2127
- onUpdateParams: ht,
2128
- onReorderSubIndicators: gt
2129
- }, null, 8, ["active-indicators", "indicator-params"])], 8, Sr));
2226
+ onToggle: yt,
2227
+ onUpdateParams: bt,
2228
+ onReorderSubIndicators: xt
2229
+ }, null, 8, ["active-indicators", "indicator-params"])], 12, Lr));
2130
2230
  }
2131
- }), [["__scopeId", "data-v-b0cae9be"]]), Er = {
2231
+ }), [["__scopeId", "data-v-f9c42035"]]), Ur = {
2132
2232
  name: "@363045841yyt/klinechart",
2133
- version: "0.7.5",
2233
+ version: "0.7.7",
2134
2234
  description: "Vue 3 bindings for @363045841yyt/klinechart-core. Idiomatic composables, SFC components.",
2135
2235
  license: "MIT",
2136
2236
  repository: {
@@ -2156,13 +2256,15 @@ var rr = {
2156
2256
  default: "./dist/index.cjs"
2157
2257
  }
2158
2258
  },
2259
+ "./web-component": { import: { default: "./dist/kline-chart.js" } },
2159
2260
  "./style.css": "./dist/klinechart.css"
2160
2261
  },
2161
2262
  files: ["dist", "src"],
2162
2263
  publishConfig: { access: "public" },
2163
2264
  scripts: {
2164
2265
  dev: "vite --config preview/vite.config.ts",
2165
- build: "vite build && node -e \"require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')\"",
2266
+ build: "vite build",
2267
+ "build:wc": "cross-env BUILD_TARGET=web-component vite build",
2166
2268
  postbuild: "node -e \"require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')\"",
2167
2269
  test: "vitest run",
2168
2270
  "test:watch": "vitest",
@@ -2187,6 +2289,7 @@ var rr = {
2187
2289
  "@size-limit/preset-small-lib": "^12.1.0",
2188
2290
  "@vitejs/plugin-vue": "^6.0.0",
2189
2291
  "@vue/test-utils": "^2.4.10",
2292
+ "cross-env": "^7.0.3",
2190
2293
  jsdom: "^29.1.1",
2191
2294
  publint: "^0.3.0",
2192
2295
  "size-limit": "^12.1.0",
@@ -2194,34 +2297,35 @@ var rr = {
2194
2297
  "unplugin-icons": "^23.0.1",
2195
2298
  vite: "^8.0.14",
2196
2299
  "vite-plugin-babel": "^1.3.2",
2300
+ "vite-plugin-css-injected-by-js": "^5.0.1",
2197
2301
  "vite-plugin-dts": "^5.0.1",
2198
2302
  vitest: "^4.1.5",
2199
2303
  vue: "^3.5.0"
2200
2304
  }
2201
- }.version, Dr = null;
2202
- function Or(e) {
2203
- Dr = e;
2305
+ }.version, Wr = null;
2306
+ function Gr(e) {
2307
+ Wr = e;
2204
2308
  }
2205
- function kr(e) {
2309
+ function Kr(e) {
2206
2310
  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);
2311
+ if (Wr === null) throw Error("[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).");
2312
+ return Wr(e);
2209
2313
  }
2210
2314
  function $(e) {
2211
- let t = E(e.peek());
2315
+ let t = D(e.peek());
2212
2316
  return b(e.subscribe(() => {
2213
2317
  t.value = e.peek();
2214
2318
  })), t;
2215
2319
  }
2216
- function Ar(e, t) {
2217
- let n = E(null), r = (e) => {
2218
- e == null || n.value != null || (n.value = kr({
2320
+ function qr(e, t) {
2321
+ let n = D(null), r = (e) => {
2322
+ e == null || n.value != null || (n.value = Kr({
2219
2323
  ...t,
2220
2324
  container: e
2221
2325
  }));
2222
2326
  };
2223
2327
  r(e.value);
2224
- let i = j(e, (e) => {
2328
+ let i = M(e, (e) => {
2225
2329
  r(e);
2226
2330
  }, {
2227
2331
  immediate: !0,
@@ -2233,8 +2337,8 @@ function Ar(e, t) {
2233
2337
  };
2234
2338
  return b(a), v(a), { chart: n };
2235
2339
  }
2236
- function jr(e) {
2237
- let t = E(e.indicators.peek());
2340
+ function Jr(e) {
2341
+ let t = D(e.indicators.peek());
2238
2342
  return b(e.indicators.subscribe(() => {
2239
2343
  t.value = e.indicators.peek();
2240
2344
  })), {
@@ -2244,26 +2348,26 @@ function jr(e) {
2244
2348
  updateParams: e.updateIndicatorParams.bind(e)
2245
2349
  };
2246
2350
  }
2247
- function Mr(e) {
2248
- let t = E(e.interactionState.peek());
2351
+ function Yr(e) {
2352
+ let t = D(e.interactionState.peek());
2249
2353
  return b(e.interactionState.subscribe(() => {
2250
2354
  t.value = e.interactionState.peek();
2251
2355
  })), t;
2252
2356
  }
2253
- function Nr(e) {
2254
- let t = E(e.paneRatios.peek());
2357
+ function Xr(e) {
2358
+ let t = D(e.paneRatios.peek());
2255
2359
  return b(e.paneRatios.subscribe(() => {
2256
2360
  t.value = e.paneRatios.peek();
2257
2361
  })), t;
2258
2362
  }
2259
- function Pr(e) {
2260
- let t = E(e.viewport.peek());
2363
+ function Zr(e) {
2364
+ let t = D(e.viewport.peek());
2261
2365
  return b(e.viewport.subscribe(() => {
2262
2366
  t.value = e.viewport.peek();
2263
2367
  })), t;
2264
2368
  }
2265
- function Fr(e) {
2266
- let t = L({ catalog: e.catalog });
2369
+ function Qr(e) {
2370
+ let t = z({ catalog: e.catalog });
2267
2371
  b(() => t.dispose());
2268
2372
  let n = $(t.filteredMain), r = $(t.filteredSub), i = $(t.menuOpen), a = $(t.searchQuery);
2269
2373
  function o(t) {
@@ -2291,7 +2395,7 @@ function Fr(e) {
2291
2395
  isActive: c
2292
2396
  };
2293
2397
  }
2294
- var Ir = u({
2398
+ var $r = u({
2295
2399
  name: "KLineChart",
2296
2400
  props: {
2297
2401
  data: {
@@ -2320,11 +2424,11 @@ var Ir = u({
2320
2424
  zoomLevelChange: (e, t) => !0
2321
2425
  },
2322
2426
  setup(e, { emit: t, expose: n }) {
2323
- let r = E(null), i = d(), a = E(null);
2427
+ let r = D(null), i = d(), a = D(null);
2324
2428
  y(() => {
2325
2429
  let n = r.value;
2326
2430
  n != null && (i.run(() => {
2327
- if (a.value = kr({
2431
+ if (a.value = Kr({
2328
2432
  container: n,
2329
2433
  data: e.data,
2330
2434
  initialZoomLevel: e.initialZoomLevel,
@@ -2338,9 +2442,9 @@ var Ir = u({
2338
2442
  };
2339
2443
  n(), b(e.viewport.subscribe(n));
2340
2444
  }
2341
- }), j(() => e.data, (e) => {
2445
+ }), M(() => e.data, (e) => {
2342
2446
  a.value?.setData(e);
2343
- }), j(() => e.theme, (e) => {
2447
+ }), M(() => e.theme, (e) => {
2344
2448
  a.value?.setTheme(e);
2345
2449
  }));
2346
2450
  }), x(() => {
@@ -2370,9 +2474,9 @@ var Ir = u({
2370
2474
  }
2371
2475
  });
2372
2476
  }
2373
- }), Lr = { install(e) {
2374
- e.component("KLineChart", Ir);
2477
+ }), ei = { install(e) {
2478
+ e.component("KLineChart", $r);
2375
2479
  } };
2376
- Or(I);
2480
+ Gr(R);
2377
2481
  //#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 };
2482
+ export { L as CORE_VERSION, we as DrawingStyleToolbar, We as IndicatorParams, Rt as IndicatorSelector, $r as KLineChart, Hr as KLineChartVue, $t as KLineTooltip, ei as KMapPlugin, Ir as LeftToolbar, nn as MarkerTooltip, Ur as VERSION, Gr as __setControllerFactory, $ as coreSignalToVueRef, Kr as createChart, qr as useChart, Qr as useIndicatorSelector, Jr as useIndicators, Yr as useInteractionState, Xr as usePaneRatios, Zr as useViewport };