@363045841yyt/klinechart 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +6 -1
  2. package/dist/components/BaseModal.vue.d.ts +54 -0
  3. package/dist/components/BaseModal.vue.d.ts.map +1 -0
  4. package/dist/components/BatchStockDialog.vue.d.ts +13 -0
  5. package/dist/components/BatchStockDialog.vue.d.ts.map +1 -0
  6. package/dist/components/ChartSettingsDialog.vue.d.ts.map +1 -1
  7. package/dist/components/ColorPresetPanel.vue.d.ts +4 -1
  8. package/dist/components/ColorPresetPanel.vue.d.ts.map +1 -1
  9. package/dist/components/CompareSymbolSelector.vue.d.ts.map +1 -1
  10. package/dist/components/DrawingStyleToolbar.vue.d.ts.map +1 -1
  11. package/dist/components/Dropdown.vue.d.ts.map +1 -1
  12. package/dist/components/ExportProgressDialog.vue.d.ts +15 -0
  13. package/dist/components/ExportProgressDialog.vue.d.ts.map +1 -0
  14. package/dist/components/IndicatorParams.vue.d.ts.map +1 -1
  15. package/dist/components/IndicatorSelector.vue.d.ts.map +1 -1
  16. package/dist/components/KLineChart.vue.d.ts +5 -9
  17. package/dist/components/KLineChart.vue.d.ts.map +1 -1
  18. package/dist/components/LeftToolbar.vue.d.ts.map +1 -1
  19. package/dist/components/RangeSelectionExport.vue.d.ts +23 -0
  20. package/dist/components/RangeSelectionExport.vue.d.ts.map +1 -0
  21. package/dist/components/SymbolSelector.vue.d.ts.map +1 -1
  22. package/dist/components/TopToolbar.vue.d.ts.map +1 -1
  23. package/dist/components/common/CanvasToolbar.vue.d.ts +14 -0
  24. package/dist/components/common/CanvasToolbar.vue.d.ts.map +1 -0
  25. package/dist/components/common/CanvasToolbarStack.vue.d.ts +14 -0
  26. package/dist/components/common/CanvasToolbarStack.vue.d.ts.map +1 -0
  27. package/dist/composables/chart/useChartTheme.d.ts +329 -0
  28. package/dist/composables/chart/useChartTheme.d.ts.map +1 -0
  29. package/dist/composables/chart/useDrawingManager.d.ts +86 -0
  30. package/dist/composables/chart/useDrawingManager.d.ts.map +1 -0
  31. package/dist/composables/chart/useIndicatorManager.d.ts +38 -0
  32. package/dist/composables/chart/useIndicatorManager.d.ts.map +1 -0
  33. package/dist/composables/chart/useRangeSelection.d.ts +66 -0
  34. package/dist/composables/chart/useRangeSelection.d.ts.map +1 -0
  35. package/dist/composables/useTeleportedPopup.d.ts +8 -0
  36. package/dist/composables/useTeleportedPopup.d.ts.map +1 -0
  37. package/dist/index.cjs +9 -2
  38. package/dist/index.css +1 -1
  39. package/dist/index.js +2149 -1409
  40. package/dist/tools/calcRangeOverlayPixel.d.ts +15 -0
  41. package/dist/tools/calcRangeOverlayPixel.d.ts.map +1 -0
  42. package/dist/tools/getKLineIndexByTimestamp.d.ts +4 -0
  43. package/dist/tools/getKLineIndexByTimestamp.d.ts.map +1 -0
  44. package/dist/web-component.d.ts.map +1 -1
  45. package/package.json +1 -1
  46. package/src/components/BaseModal.vue +292 -0
  47. package/src/components/BatchStockDialog.vue +128 -0
  48. package/src/components/ChartSettingsDialog.vue +248 -405
  49. package/src/components/ColorPresetPanel.vue +58 -106
  50. package/src/components/CompareSymbolSelector.vue +37 -10
  51. package/src/components/DrawingStyleToolbar.vue +33 -72
  52. package/src/components/Dropdown.vue +42 -19
  53. package/src/components/ExportProgressDialog.vue +118 -0
  54. package/src/components/IndicatorParams.vue +194 -321
  55. package/src/components/IndicatorSelector.vue +188 -405
  56. package/src/components/KLineChart.vue +228 -403
  57. package/src/components/LeftToolbar.vue +3 -2
  58. package/src/components/RangeSelectionExport.vue +117 -0
  59. package/src/components/SymbolSelector.vue +37 -10
  60. package/src/components/TopToolbar.vue +55 -2
  61. package/src/components/common/CanvasToolbar.vue +70 -0
  62. package/src/components/common/CanvasToolbarStack.vue +32 -0
  63. package/src/composables/chart/useChartTheme.ts +86 -0
  64. package/src/composables/chart/useDrawingManager.ts +67 -0
  65. package/src/composables/chart/useIndicatorManager.ts +307 -0
  66. package/src/composables/chart/useRangeSelection.ts +424 -0
  67. package/src/composables/useTeleportedPopup.ts +46 -0
  68. package/src/tools/calcRangeOverlayPixel.ts +28 -0
  69. package/src/tools/getKLineIndexByTimestamp.ts +40 -0
package/dist/index.js CHANGED
@@ -1,86 +1,129 @@
1
- import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, effectScope as d, h as f, inject as p, markRaw as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, onScopeDispose as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, resolveDynamicComponent as E, shallowRef as D, toDisplayString as O, unref as k, vModelCheckbox as A, vModelText as j, watch as M, withCtx as N, withDirectives as P, withKeys as F, withModifiers as I } from "vue";
2
- import { COLOR_PRESET_ITEMS as L, VERSION as ee, createChartController as te, createIndicatorSelectorController as R, darkTheme as ne, formatTimestamp as z, lightTheme as re, normalizeColorPresetSettings as ie, resolveThemeColors as ae, themeToCssVars as oe } from "@363045841yyt/klinechart-core";
3
- import { DrawingInteractionController as se, allIndicators as ce, createChartController as le, createIndicatorSelectorController as ue, findIndicator as de, isBuiltinIndicatorsLoaded as B, kGapFromKWidth as fe, loadBuiltinIndicators as pe, zoomLevelToKWidth as me } from "@363045841yyt/klinechart-core/controllers";
4
- import { SemanticChartController as he } from "@363045841yyt/klinechart-core/semantic";
5
- import { getRegisteredIndicatorDefinition as ge } from "@363045841yyt/klinechart-core/indicators";
6
- import { DEFAULT_SETTINGS as V, SETTINGS_STORAGE_KEY as _e } from "@363045841yyt/klinechart-core/config";
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, isRef as m, markRaw as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onScopeDispose as x, onUnmounted as S, openBlock as C, provide as w, ref as T, renderList as E, renderSlot as D, resolveDynamicComponent as O, shallowRef as k, toDisplayString as A, unref as j, vModelCheckbox as M, vModelText as N, watch as P, withCtx as F, withDirectives as I, withKeys as L, withModifiers as R } from "vue";
2
+ import { COLOR_PRESET_ITEMS as z, VERSION as ee, createChartController as te, createIndicatorSelectorController as B, darkTheme as ne, formatTimestamp as V, lightTheme as re, normalizeColorPresetSettings as ie, resolveThemeColors as ae, themeToCssVars as oe } from "@363045841yyt/klinechart-core";
3
+ import { DrawingInteractionController as se, allIndicators as H, createChartController as ce, createIndicatorSelectorController as le, findIndicator as U, isBuiltinIndicatorsLoaded as ue, kGapFromKWidth as de, loadBuiltinIndicators as fe, zoomLevelToKWidth as pe } from "@363045841yyt/klinechart-core/controllers";
4
+ import { SemanticChartController as me } from "@363045841yyt/klinechart-core/semantic";
5
+ import { getRegisteredIndicatorDefinition as he } from "@363045841yyt/klinechart-core/indicators";
6
+ import { DEFAULT_SETTINGS as W, SETTINGS_STORAGE_KEY as ge } from "@363045841yyt/klinechart-core/config";
7
7
  //#region src/components/ColorPresetPanel.vue?vue&type=script&setup=true&lang.ts
8
- var ve = { class: "color-preset-tools" }, ye = {
8
+ var _e = { class: "color-preset-container" }, ve = {
9
9
  class: "theme-tabs",
10
10
  role: "tablist",
11
11
  "aria-label": "颜色主题"
12
- }, H = ["onClick"], be = { class: "color-group-label" }, xe = { class: "color-grid" }, Se = ["value", "onInput"], Ce = /*@__PURE__*/ u({
12
+ }, ye = ["onClick"], be = { class: "color-group-label" }, xe = { class: "color-grid" }, Se = { class: "color-item-text" }, G = ["value", "onInput"], K = /*@__PURE__*/ u({
13
13
  __name: "ColorPresetPanel",
14
14
  props: { colorPresetSettings: {} },
15
15
  emits: ["update:colorPresetSettings"],
16
- setup(t, { emit: n }) {
17
- let i = t, a = n, c = [{
16
+ setup(t, { expose: n, emit: i }) {
17
+ let a = t, c = i, l = [{
18
18
  value: "light",
19
19
  label: "浅色"
20
20
  }, {
21
21
  value: "dark",
22
22
  label: "深色"
23
- }], l = {
23
+ }], u = {
24
24
  canvas: "画布",
25
25
  candle: "K线 / 成交量",
26
26
  axis: "坐标轴",
27
27
  interaction: "交互 / 标记"
28
- }, u = r(() => Object.keys(l).map((e) => ({
28
+ }, d = r(() => Object.keys(u).map((e) => ({
29
29
  group: e,
30
- label: l[e],
31
- items: L.filter((t) => t.group === e)
32
- })).filter((e) => e.items.length > 0)), d = w("light");
33
- function f(e, t) {
30
+ label: u[e],
31
+ items: z.filter((t) => t.group === e)
32
+ })).filter((e) => e.items.length > 0)), f = T("light");
33
+ function p(e, t) {
34
34
  return (e === "dark" ? ne : re).colors[t];
35
35
  }
36
- function p(e) {
37
- return ie(i.colorPresetSettings)[d.value]?.[e] ?? f(d.value, e);
36
+ function m(e) {
37
+ return ie(a.colorPresetSettings)[f.value]?.[e] ?? p(f.value, e);
38
38
  }
39
- function m(e, t) {
40
- let n = ie(i.colorPresetSettings);
41
- a("update:colorPresetSettings", {
39
+ function h(e, t) {
40
+ let n = ie(a.colorPresetSettings);
41
+ c("update:colorPresetSettings", {
42
42
  ...n,
43
- [d.value]: {
44
- ...n[d.value],
43
+ [f.value]: {
44
+ ...n[f.value],
45
45
  [e]: t
46
46
  }
47
47
  });
48
48
  }
49
- function h() {
50
- let e = { ...ie(i.colorPresetSettings) };
51
- delete e[d.value], a("update:colorPresetSettings", e);
49
+ function g() {
50
+ let e = { ...ie(a.colorPresetSettings) };
51
+ delete e[f.value], c("update:colorPresetSettings", e);
52
52
  }
53
- return (t, n) => (S(), o("div", null, [s("div", ve, [s("div", ye, [(S(), o(e, null, T(c, (e) => s("button", {
53
+ return n({ resetCurrentThemeColors: g }), (t, n) => (C(), o("div", _e, [s("div", ve, [(C(), o(e, null, E(l, (e) => s("button", {
54
54
  key: e.value,
55
55
  type: "button",
56
- class: g(["theme-tab", { active: d.value === e.value }]),
57
- onClick: (t) => d.value = e.value
58
- }, O(e.label), 11, H)), 64))]), s("button", {
59
- type: "button",
60
- class: "color-reset-btn",
61
- onClick: h
62
- }, " 重置颜色 ")]), (S(!0), o(e, null, T(u.value, (t) => (S(), o(e, { key: t.group }, [s("div", be, O(t.label), 1), s("div", xe, [(S(!0), o(e, null, T(t.items, (e) => (S(), o("label", {
56
+ class: _(["theme-tab", { active: f.value === e.value }]),
57
+ onClick: (t) => f.value = e.value
58
+ }, A(e.label), 11, ye)), 64))]), (C(!0), o(e, null, E(d.value, (t) => (C(), o(e, { key: t.group }, [s("div", be, A(t.label), 1), s("div", xe, [(C(!0), o(e, null, E(t.items, (e) => (C(), o("label", {
63
59
  key: e.key,
64
60
  class: "color-item"
65
- }, [s("span", null, O(e.label), 1), s("input", {
61
+ }, [s("span", Se, A(e.label), 1), s("input", {
66
62
  type: "color",
67
63
  class: "color-input",
68
- value: p(e.key),
69
- onInput: (t) => m(e.key, t.target.value)
70
- }, null, 40, Se)]))), 128))])], 64))), 128))]));
64
+ value: m(e.key),
65
+ onInput: (t) => h(e.key, t.target.value)
66
+ }, null, 40, G)]))), 128))])], 64))), 128))]));
71
67
  }
72
- }), U = (e, t) => {
68
+ }), q = (e, t) => {
73
69
  let n = e.__vccOpts || e;
74
70
  for (let [e, r] of t) n[e] = r;
75
71
  return n;
76
- }, W = /*#__PURE__*/ U(Ce, [["__scopeId", "data-v-a52947a4"]]), we = [
72
+ }, Ce = /*#__PURE__*/ q(K, [["__scopeId", "data-v-14ed826d"]]);
73
+ //#endregion
74
+ //#region src/composables/useTeleportedPopup.ts
75
+ function we(e, t, n = 4) {
76
+ let r = T({});
77
+ function i() {
78
+ let i = e.value;
79
+ if (!i) return;
80
+ let a = i.getBoundingClientRect(), o = t.value, s = a.left;
81
+ if (o) {
82
+ let e = o.offsetWidth, t = window.innerWidth;
83
+ s + e > t - 8 && (s = Math.max(8, t - e - 8));
84
+ }
85
+ r.value = {
86
+ position: "fixed",
87
+ top: `${a.bottom + n}px`,
88
+ left: `${s}px`
89
+ };
90
+ }
91
+ function a() {
92
+ i(), g(() => i()), document.addEventListener("scroll", i, {
93
+ capture: !0,
94
+ passive: !0
95
+ }), window.addEventListener("resize", i, { passive: !0 });
96
+ }
97
+ function o() {
98
+ document.removeEventListener("scroll", i, { capture: !0 }), window.removeEventListener("resize", i);
99
+ }
100
+ return {
101
+ popupStyle: r,
102
+ updatePosition: i,
103
+ startPositionSync: a,
104
+ stopPositionSync: o
105
+ };
106
+ }
107
+ //#endregion
108
+ //#region src/composables/useFullscreenTeleportTarget.ts
109
+ var Te = Symbol("fullscreen-teleport-target");
110
+ function Ee(e) {
111
+ w(Te, e);
112
+ }
113
+ function De() {
114
+ let e = p(Te, null);
115
+ return r(() => e?.value ?? "body");
116
+ }
117
+ //#endregion
118
+ //#region src/components/Dropdown.vue?vue&type=script&setup=true&lang.ts
119
+ var Oe = [
77
120
  "title",
78
121
  "aria-expanded",
79
122
  "onKeydown"
80
- ], Te = {
123
+ ], ke = {
81
124
  key: 0,
82
125
  class: "dropdown__label"
83
- }, Ee = { class: "dropdown__value" }, De = ["aria-selected", "onClick"], G = 0, Oe = null, ke = 0, K = /*#__PURE__*/ U(/* @__PURE__ */ u({
126
+ }, Ae = { class: "dropdown__value" }, je = ["aria-selected", "onClick"], Me = 0, Ne = null, Pe = 0, J = /*#__PURE__*/ q(/* @__PURE__ */ u({
84
127
  __name: "Dropdown",
85
128
  props: {
86
129
  modelValue: {},
@@ -91,77 +134,92 @@ var ve = { class: "color-preset-tools" }, ye = {
91
134
  title: { default: "" }
92
135
  },
93
136
  emits: ["update:modelValue"],
94
- setup(t, { emit: n }) {
95
- let i = t, c = n, l = w(null), u = w(null), d = w(!1), f = w(0), p = ++ke, m = r(() => i.minWidth ? { minWidth: i.minWidth } : {}), h = r(() => {
96
- if (!d.value) return;
97
- let e = f.value || (i.minWidth ? parseInt(i.minWidth) : 0);
98
- return { width: e ? `${e}px` : void 0 };
99
- }), y = r(() => {
100
- let e = i.modelValue?.trim();
101
- return e && i.options.some((t) => t.value === e) ? e : i.options[0]?.value ?? "";
102
- }), b = r(() => i.options.find((e) => e.value === y.value) ?? i.options[0]);
103
- function x() {
104
- G !== p && Oe && Oe(), !d.value && (G = p, Oe = C, f.value = u.value?.offsetWidth ?? 0, d.value = !0, document.addEventListener("pointerdown", k));
137
+ setup(n, { emit: c }) {
138
+ let l = n, u = c, d = T(null), f = T(null), p = T(null), m = T(!1), h = T(0), g = ++Pe, b = De(), { popupStyle: x, startPositionSync: S, stopPositionSync: w } = we(f, p, 4), D = r(() => l.minWidth ? { minWidth: l.minWidth } : {}), O = r(() => {
139
+ if (!m.value) return;
140
+ let e = h.value || (l.minWidth ? parseInt(l.minWidth) : 0);
141
+ return {
142
+ width: e ? `${e}px` : void 0,
143
+ zIndex: 1010,
144
+ ...x.value
145
+ };
146
+ }), k = r(() => {
147
+ let e = l.modelValue?.trim();
148
+ return e && l.options.some((t) => t.value === e) ? e : l.options[0]?.value ?? "";
149
+ }), M = r(() => l.options.find((e) => e.value === k.value) ?? l.options[0]);
150
+ function N() {
151
+ Me !== g && Ne && Ne(), !m.value && (Me = g, Ne = P, h.value = f.value?.offsetWidth ?? 0, m.value = !0, S(), document.addEventListener("pointerdown", z));
105
152
  }
106
- function C() {
107
- d.value && (d.value = !1, G === p && (G = 0, Oe = null), document.removeEventListener("pointerdown", k));
153
+ function P() {
154
+ m.value && (m.value = !1, Me === g && (Me = 0, Ne = null), w(), document.removeEventListener("pointerdown", z));
108
155
  }
109
- function E() {
110
- d.value ? C() : x();
156
+ function F() {
157
+ m.value ? P() : N();
111
158
  }
112
- function D(e) {
113
- c("update:modelValue", e), C();
159
+ function I(e) {
160
+ u("update:modelValue", e), P();
114
161
  }
115
- function k(e) {
116
- let t = l.value;
117
- t && !t.contains(e.target) && C();
162
+ function z(e) {
163
+ let t = d.value, n = p.value;
164
+ t && !t.contains(e.target) && !n?.contains(e.target) && P();
118
165
  }
119
- return v(C), (n, r) => (S(), o("div", {
166
+ return y(P), (r, c) => (C(), o("div", {
120
167
  ref_key: "rootRef",
121
- ref: l,
122
- class: g(["dropdown", [`dropdown--${t.size}`, { "is-open": d.value }]])
168
+ ref: d,
169
+ class: _(["dropdown", [`dropdown--${n.size}`, { "is-open": m.value }]])
123
170
  }, [s("button", {
124
171
  ref_key: "triggerRef",
125
- ref: u,
172
+ ref: f,
126
173
  type: "button",
127
174
  class: "dropdown__trigger",
128
- title: t.title,
129
- style: _(m.value),
175
+ title: n.title,
176
+ style: v(D.value),
130
177
  "aria-haspopup": "listbox",
131
- "aria-expanded": d.value,
132
- onClick: E,
178
+ "aria-expanded": m.value,
179
+ onClick: F,
133
180
  onKeydown: [
134
- F(I(C, ["stop"]), ["escape"]),
135
- F(I(x, ["prevent"]), ["down"]),
136
- F(I(E, ["prevent"]), ["enter"]),
137
- F(I(E, ["prevent"]), ["space"])
181
+ L(R(P, ["stop"]), ["escape"]),
182
+ L(R(N, ["prevent"]), ["down"]),
183
+ L(R(F, ["prevent"]), ["enter"]),
184
+ L(R(F, ["prevent"]), ["space"])
138
185
  ]
139
186
  }, [
140
- t.label ? (S(), o("span", Te, O(t.label), 1)) : a("", !0),
141
- s("span", Ee, O(b.value.label), 1),
142
- r[0] ||= s("span", {
187
+ n.label ? (C(), o("span", ke, A(n.label), 1)) : a("", !0),
188
+ s("span", Ae, A(M.value.label), 1),
189
+ c[0] ||= s("span", {
143
190
  class: "dropdown__chevron",
144
191
  "aria-hidden": "true"
145
192
  }, null, -1)
146
- ], 44, we), d.value ? (S(), o("div", {
193
+ ], 44, Oe), (C(), i(t, { to: j(b) }, [m.value ? (C(), o("div", {
147
194
  key: 0,
195
+ ref_key: "menuRef",
196
+ ref: p,
148
197
  class: "dropdown__menu",
149
- style: _(h.value),
198
+ style: v(O.value),
150
199
  role: "listbox",
151
200
  tabindex: "-1"
152
- }, [(S(!0), o(e, null, T(t.options, (e) => (S(), o("button", {
201
+ }, [(C(!0), o(e, null, E(n.options, (e) => (C(), o("button", {
153
202
  key: e.value,
154
203
  type: "button",
155
- class: g(["dropdown__option", { "is-selected": e.value === y.value }]),
204
+ class: _(["dropdown__option", { "is-selected": e.value === k.value }]),
156
205
  role: "option",
157
- "aria-selected": e.value === y.value,
158
- onClick: (t) => D(e.value)
159
- }, O(e.label), 11, De))), 128))], 4)) : a("", !0)], 2));
206
+ "aria-selected": e.value === k.value,
207
+ onClick: (t) => I(e.value)
208
+ }, A(e.label), 11, je))), 128))], 4)) : a("", !0)], 8, ["to"]))], 2));
160
209
  }
161
- }), [["__scopeId", "data-v-126e11f2"]]), Ae = {
162
- class: "toolbar-item color-item",
210
+ }), [["__scopeId", "data-v-bab778b8"]]), Fe = {};
211
+ function Ie(e, t) {
212
+ return C(), o("div", {
213
+ class: "canvas-toolbar",
214
+ onPointerdown: t[0] ||= R(() => {}, ["stop"]),
215
+ onPointermove: t[1] ||= R(() => {}, ["stop"]),
216
+ onPointerup: t[2] ||= R(() => {}, ["stop"])
217
+ }, [D(e.$slots, "default", {}, void 0, !0)], 32);
218
+ }
219
+ var Le = /*#__PURE__*/ q(Fe, [["render", Ie], ["__scopeId", "data-v-4f016899"]]), Re = {
220
+ class: "color-item",
163
221
  title: "颜色"
164
- }, je = ["value"], Me = /*#__PURE__*/ U(/* @__PURE__ */ u({
222
+ }, ze = ["value"], Be = /*#__PURE__*/ q(/* @__PURE__ */ u({
165
223
  __name: "DrawingStyleToolbar",
166
224
  props: { drawing: {} },
167
225
  emits: ["updateStyle", "delete"],
@@ -196,96 +254,166 @@ var ve = { class: "color-preset-tools" }, ye = {
196
254
  label: "点线",
197
255
  value: "dotted"
198
256
  }
199
- ], i = t;
200
- function a(e) {
201
- e.key === "Delete" && (e.preventDefault(), i("delete"));
257
+ ], a = t;
258
+ function o(e) {
259
+ e.key === "Delete" && (e.preventDefault(), a("delete"));
202
260
  }
203
- y(() => document.addEventListener("keydown", a)), x(() => document.removeEventListener("keydown", a));
261
+ b(() => document.addEventListener("keydown", o)), S(() => document.removeEventListener("keydown", o));
204
262
  function c(e) {
205
- i("updateStyle", { stroke: e });
263
+ a("updateStyle", { stroke: e });
206
264
  }
207
265
  function u(e) {
208
- i("updateStyle", { strokeWidth: e });
266
+ a("updateStyle", { strokeWidth: e });
209
267
  }
210
268
  function d(e) {
211
- i("updateStyle", { strokeStyle: e });
212
- }
213
- return (t, i) => (S(), o("div", {
214
- class: "drawing-style-toolbar",
215
- onPointerdown: i[4] ||= I(() => {}, ["stop"]),
216
- onPointermove: i[5] ||= I(() => {}, ["stop"]),
217
- onPointerup: i[6] ||= I(() => {}, ["stop"])
218
- }, [
219
- s("div", Ae, [s("span", {
220
- class: "color-swatch",
221
- style: _({ background: e.drawing.style.stroke ?? "#2962ff" })
222
- }, null, 4), s("input", {
223
- type: "color",
224
- class: "color-input",
225
- value: e.drawing.style.stroke ?? "#2962ff",
226
- onInput: i[0] ||= (e) => c(e.target.value)
227
- }, null, 40, je)]),
228
- l(K, {
229
- "model-value": String(e.drawing.style.strokeWidth ?? 1),
230
- options: n,
231
- size: "sm",
232
- title: "线宽",
233
- "onUpdate:modelValue": i[1] ||= (e) => u(Number(e))
234
- }, null, 8, ["model-value"]),
235
- l(K, {
236
- "model-value": e.drawing.style.strokeStyle ?? "solid",
237
- options: r,
238
- size: "sm",
239
- title: "线型",
240
- "onUpdate:modelValue": i[2] ||= (e) => d(e)
241
- }, null, 8, ["model-value"]),
242
- s("button", {
243
- type: "button",
244
- class: "toolbar-btn delete-btn",
245
- title: "删除",
246
- onClick: i[3] ||= (e) => t.$emit("delete")
247
- }, [...i[7] ||= [s("svg", {
248
- class: "delete-icon",
249
- viewBox: "0 0 24 24",
250
- fill: "none",
251
- stroke: "currentColor",
252
- "stroke-width": "2",
253
- "stroke-linecap": "round",
254
- "stroke-linejoin": "round",
255
- "aria-hidden": "true"
256
- }, [
257
- s("path", { d: "M3 6h18" }),
258
- s("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
259
- s("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
260
- ], -1)]])
261
- ], 32));
269
+ a("updateStyle", { strokeStyle: e });
270
+ }
271
+ return (t, a) => (C(), i(Le, null, {
272
+ default: F(() => [
273
+ s("div", Re, [s("span", {
274
+ class: "color-swatch",
275
+ style: v({ background: e.drawing.style.stroke ?? "#2962ff" })
276
+ }, null, 4), s("input", {
277
+ type: "color",
278
+ class: "color-input",
279
+ value: e.drawing.style.stroke ?? "#2962ff",
280
+ onInput: a[0] ||= (e) => c(e.target.value)
281
+ }, null, 40, ze)]),
282
+ l(J, {
283
+ "model-value": String(e.drawing.style.strokeWidth ?? 1),
284
+ options: n,
285
+ size: "sm",
286
+ title: "线宽",
287
+ "onUpdate:modelValue": a[1] ||= (e) => u(Number(e))
288
+ }, null, 8, ["model-value"]),
289
+ l(J, {
290
+ "model-value": e.drawing.style.strokeStyle ?? "solid",
291
+ options: r,
292
+ size: "sm",
293
+ title: "线型",
294
+ "onUpdate:modelValue": a[2] ||= (e) => d(e)
295
+ }, null, 8, ["model-value"]),
296
+ s("button", {
297
+ type: "button",
298
+ class: "toolbar-btn toolbar-btn--delete",
299
+ title: "删除",
300
+ onClick: a[3] ||= (e) => t.$emit("delete")
301
+ }, [...a[4] ||= [s("svg", {
302
+ class: "delete-icon",
303
+ viewBox: "0 0 24 24",
304
+ fill: "none",
305
+ stroke: "currentColor",
306
+ "stroke-width": "2",
307
+ "stroke-linecap": "round",
308
+ "stroke-linejoin": "round",
309
+ "aria-hidden": "true"
310
+ }, [
311
+ s("path", { d: "M3 6h18" }),
312
+ s("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
313
+ s("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
314
+ ], -1)]])
315
+ ]),
316
+ _: 1
317
+ }));
262
318
  }
263
- }), [["__scopeId", "data-v-e9b6a8a9"]]), Ne = Symbol("fullscreen-teleport-target");
264
- function Pe(e) {
265
- C(Ne, e);
266
- }
267
- function Fe() {
268
- let e = p(Ne, null);
269
- return r(() => e?.value ?? "body");
270
- }
271
- //#endregion
272
- //#region src/components/IndicatorParams.vue?vue&type=script&setup=true&lang.ts
273
- var Ie = { class: "params-header" }, Le = { class: "header-left" }, Re = { class: "params-title" }, ze = { class: "header-right" }, Be = {
319
+ }), [["__scopeId", "data-v-619a545d"]]), Ve = {
320
+ key: 0,
321
+ class: "base-header"
322
+ }, He = { class: "base-header-left" }, Ue = { class: "base-title" }, We = {
323
+ key: 0,
324
+ class: "base-subtitle"
325
+ }, Ge = {
326
+ key: 0,
327
+ class: "base-header-right"
328
+ }, Ke = {
329
+ key: 1,
330
+ class: "base-subheader"
331
+ }, Y = /*#__PURE__*/ q(/* @__PURE__ */ u({
332
+ __name: "BaseModal",
333
+ props: {
334
+ show: { type: Boolean },
335
+ title: { default: "" },
336
+ subtitle: { default: "" },
337
+ zIndex: { default: 1e3 },
338
+ width: { default: "min(92vw, 400px)" },
339
+ maxWidth: { default: "" },
340
+ maxHeight: { default: "min(600px, calc(100vh - 48px))" },
341
+ overlayPadding: { default: "24px" },
342
+ bodyPadding: { default: "16px 20px" },
343
+ footerAlign: { default: "flex-end" },
344
+ closeOnOverlay: {
345
+ type: Boolean,
346
+ default: !0
347
+ },
348
+ showClose: {
349
+ type: Boolean,
350
+ default: !0
351
+ },
352
+ transitionVariant: { default: "default" }
353
+ },
354
+ emits: ["close"],
355
+ setup(e, { emit: c }) {
356
+ let u = e, d = c, f = De(), p = r(() => u.transitionVariant === "compact" ? "modal-compact" : "modal"), m = r(() => ({
357
+ width: u.width,
358
+ maxWidth: u.maxWidth || void 0,
359
+ maxHeight: u.maxHeight
360
+ }));
361
+ return (r, c) => (C(), i(t, { to: j(f) }, [l(n, { name: "overlay" }, {
362
+ default: F(() => [e.show ? (C(), o("div", {
363
+ key: 0,
364
+ class: "base-overlay",
365
+ style: v({
366
+ zIndex: e.zIndex,
367
+ padding: e.overlayPadding
368
+ }),
369
+ onClick: c[2] ||= (t) => e.closeOnOverlay ? d("close") : void 0
370
+ }, [l(n, { name: p.value }, {
371
+ default: F(() => [s("div", {
372
+ class: "base-modal",
373
+ style: v(m.value),
374
+ onClick: c[1] ||= R(() => {}, ["stop"])
375
+ }, [
376
+ r.$slots.header || e.title ? (C(), o("div", Ve, [D(r.$slots, "header", {}, () => [s("div", He, [s("span", Ue, A(e.title), 1), e.subtitle ? (C(), o("span", We, A(e.subtitle), 1)) : a("", !0)])], !0), e.showClose ? (C(), o("div", Ge, [D(r.$slots, "header-extra", {}, void 0, !0), s("button", {
377
+ class: "base-close-btn",
378
+ onClick: c[0] ||= (e) => d("close")
379
+ }, [...c[3] ||= [s("svg", {
380
+ viewBox: "0 0 24 24",
381
+ fill: "none",
382
+ stroke: "currentColor",
383
+ "stroke-width": "2"
384
+ }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])) : a("", !0)])) : a("", !0),
385
+ r.$slots.subheader ? (C(), o("div", Ke, [D(r.$slots, "subheader", {}, void 0, !0)])) : a("", !0),
386
+ s("div", {
387
+ class: "base-body",
388
+ style: v({ padding: e.bodyPadding })
389
+ }, [D(r.$slots, "default", {}, void 0, !0)], 4),
390
+ r.$slots.footer ? (C(), o("div", {
391
+ key: 2,
392
+ class: "base-footer",
393
+ style: v({ justifyContent: e.footerAlign })
394
+ }, [D(r.$slots, "footer", {}, void 0, !0)], 4)) : a("", !0)
395
+ ], 4)]),
396
+ _: 3
397
+ }, 8, ["name"])], 4)) : a("", !0)]),
398
+ _: 3
399
+ })], 8, ["to"]));
400
+ }
401
+ }), [["__scopeId", "data-v-38747c12"]]), qe = {
274
402
  key: 0,
275
403
  class: "indicator-description"
276
- }, Ve = { class: "params-body" }, He = { class: "param-header" }, Ue = { class: "param-label" }, q = { class: "param-label-text" }, J = {
404
+ }, Je = { class: "params-body" }, Ye = { class: "param-header" }, Xe = { class: "param-label" }, Ze = { class: "param-label-text" }, Qe = {
277
405
  key: 0,
278
406
  class: "param-range"
279
- }, We = { class: "input-wrapper" }, Ge = ["disabled", "onClick"], Ke = [
407
+ }, $e = { class: "input-wrapper" }, et = ["disabled", "onClick"], tt = [
280
408
  "value",
281
409
  "min",
282
410
  "max",
283
411
  "step",
284
412
  "onInput"
285
- ], qe = ["disabled", "onClick"], Je = {
413
+ ], nt = ["disabled", "onClick"], rt = {
286
414
  key: 0,
287
415
  class: "param-description"
288
- }, Ye = { class: "params-footer" }, Xe = { class: "footer-right" }, Ze = /*#__PURE__*/ U(/* @__PURE__ */ u({
416
+ }, it = { class: "footer-right" }, at = /*#__PURE__*/ q(/* @__PURE__ */ u({
289
417
  __name: "IndicatorParams",
290
418
  props: {
291
419
  visible: { type: Boolean },
@@ -296,142 +424,128 @@ var Ie = { class: "params-header" }, Le = { class: "header-left" }, Re = { class
296
424
  values: {}
297
425
  },
298
426
  emits: ["close", "confirm"],
299
- setup(r, { emit: u }) {
300
- let d = r, f = u, p = w({ ...d.values }), m = w(!0), h = Fe();
301
- M(() => d.values, (e) => {
302
- p.value = { ...e };
427
+ setup(t, { emit: r }) {
428
+ let u = t, d = r, f = T({ ...u.values }), p = T(!0);
429
+ P(() => u.values, (e) => {
430
+ f.value = { ...e };
303
431
  }, {
304
432
  deep: !0,
305
433
  immediate: !0
306
- }), M(() => d.visible, (e) => {
307
- e && (p.value = { ...d.values });
434
+ }), P(() => u.visible, (e) => {
435
+ e && (f.value = { ...u.values });
308
436
  });
309
- function _(e, t) {
437
+ function m(e, t) {
310
438
  let n = t.target, r = parseFloat(n.value);
311
- isNaN(r) || (p.value[e] = r);
439
+ isNaN(r) || (f.value[e] = r);
312
440
  }
313
- function v(e, t) {
314
- let n = e.step || 1, r = (p.value[e.key] || 0) + t * n;
315
- 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));
441
+ function h(e, t) {
442
+ let n = e.step || 1, r = (f.value[e.key] || 0) + t * n;
443
+ e.min !== void 0 && (r = Math.max(e.min, r)), e.max !== void 0 && (r = Math.min(e.max, r)), f.value[e.key] = parseFloat(r.toFixed(10));
316
444
  }
317
- function y() {
445
+ function g() {
318
446
  let e = {};
319
- d.params.forEach((t) => {
320
- e[t.key] = t.default ?? d.values[t.key] ?? 0;
321
- }), p.value = e;
322
- }
323
- function b() {
324
- f("confirm", { ...p.value });
325
- }
326
- return (u, d) => (S(), i(t, { to: k(h) }, [l(n, { name: "overlay" }, {
327
- default: N(() => [r.visible ? (S(), o("div", {
328
- key: 0,
329
- class: "params-overlay",
330
- onClick: d[4] ||= (e) => u.$emit("close")
331
- }, [l(n, { name: "modal" }, {
332
- default: N(() => [s("div", {
333
- class: "indicator-params",
334
- onClick: d[3] ||= I(() => {}, ["stop"])
335
- }, [
336
- s("div", Ie, [s("div", Le, [s("span", Re, O(r.indicatorName), 1), d[5] ||= s("span", { class: "params-subtitle" }, "参数设置", -1)]), s("div", ze, [s("button", {
337
- class: g(["toggle-desc-btn", { active: m.value }]),
338
- onClick: d[0] ||= (e) => m.value = !m.value,
339
- title: "显示/隐藏说明"
340
- }, [...d[6] ||= [s("svg", { viewBox: "0 0 1024 1024" }, [s("path", {
341
- 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",
342
- fill: "currentColor"
343
- })], -1)]], 2), s("button", {
344
- class: "params-close",
345
- onClick: d[1] ||= (e) => u.$emit("close")
346
- }, [...d[7] ||= [s("svg", {
347
- viewBox: "0 0 24 24",
348
- fill: "none",
349
- stroke: "currentColor",
350
- "stroke-width": "2"
351
- }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
352
- l(n, { name: "slide" }, {
353
- default: N(() => [m.value && r.indicatorDescription ? (S(), o("div", Be, [s("p", null, O(r.indicatorDescription), 1)])) : a("", !0)]),
354
- _: 1
355
- }),
356
- s("div", Ve, [(S(!0), o(e, null, T(r.params, (e) => (S(), o("div", {
357
- key: e.key,
358
- class: g(["param-item", { "has-desc": m.value && e.description }])
359
- }, [s("div", He, [s("label", Ue, [s("span", q, O(e.label), 1), e.min !== void 0 || e.max !== void 0 ? (S(), o("span", J, O(e.min ?? "-∞") + " ~ " + O(e.max ?? "+∞"), 1)) : a("", !0)]), s("div", We, [
360
- s("button", {
361
- class: "stepper-btn",
362
- disabled: e.min !== void 0 && (p.value[e.key] ?? 0) <= e.min,
363
- onClick: (t) => v(e, -1)
364
- }, " ", 8, Ge),
365
- e.type === "number" ? (S(), o("input", {
366
- key: 0,
367
- type: "number",
368
- class: "param-input",
369
- value: p.value[e.key],
370
- min: e.min,
371
- max: e.max,
372
- step: e.step || 1,
373
- onInput: (t) => _(e.key, t)
374
- }, null, 40, Ke)) : a("", !0),
375
- s("button", {
376
- class: "stepper-btn",
377
- disabled: e.max !== void 0 && (p.value[e.key] ?? 0) >= e.max,
378
- onClick: (t) => v(e, 1)
379
- }, " + ", 8, qe)
380
- ])]), l(n, { name: "slide" }, {
381
- default: N(() => [m.value && e.description ? (S(), o("div", Je, O(e.description), 1)) : a("", !0)]),
382
- _: 2
383
- }, 1024)], 2))), 128))]),
384
- s("div", Ye, [s("button", {
385
- class: "params-btn reset",
386
- onClick: y
387
- }, [...d[8] ||= [s("svg", {
388
- viewBox: "0 0 24 24",
389
- fill: "none",
390
- stroke: "currentColor",
391
- "stroke-width": "2"
392
- }, [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", Xe, [s("button", {
393
- class: "params-btn cancel",
394
- onClick: d[2] ||= (e) => u.$emit("close")
395
- }, "取消"), s("button", {
396
- class: "params-btn confirm",
397
- onClick: b
398
- }, [...d[9] ||= [s("svg", {
399
- viewBox: "0 0 24 24",
400
- fill: "none",
401
- stroke: "currentColor",
402
- "stroke-width": "2.5"
403
- }, [s("path", { d: "M20 6L9 17l-5-5" })], -1), c(" 确定 ", -1)]])])])
404
- ])]),
447
+ u.params.forEach((t) => {
448
+ e[t.key] = t.default ?? u.values[t.key] ?? 0;
449
+ }), f.value = e;
450
+ }
451
+ function v() {
452
+ d("confirm", { ...f.value });
453
+ }
454
+ return (r, u) => (C(), i(Y, {
455
+ show: t.visible,
456
+ title: t.indicatorName,
457
+ subtitle: "参数设置",
458
+ width: "90vw",
459
+ "max-width": "420px",
460
+ "transition-variant": "compact",
461
+ "overlay-padding": "0",
462
+ "footer-align": "space-between",
463
+ onClose: u[2] ||= (e) => r.$emit("close")
464
+ }, {
465
+ "header-extra": F(() => [s("button", {
466
+ class: _(["toggle-desc-btn", { active: p.value }]),
467
+ onClick: u[0] ||= (e) => p.value = !p.value,
468
+ title: "显示/隐藏说明"
469
+ }, [...u[3] ||= [s("svg", { viewBox: "0 0 1024 1024" }, [s("path", {
470
+ 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",
471
+ fill: "currentColor"
472
+ })], -1)]], 2)]),
473
+ footer: F(() => [s("button", {
474
+ class: "params-btn reset",
475
+ onClick: g
476
+ }, [...u[4] ||= [s("svg", {
477
+ viewBox: "0 0 24 24",
478
+ fill: "none",
479
+ stroke: "currentColor",
480
+ "stroke-width": "2"
481
+ }, [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", it, [s("button", {
482
+ class: "params-btn cancel",
483
+ onClick: u[1] ||= (e) => r.$emit("close")
484
+ }, "取消"), s("button", {
485
+ class: "params-btn confirm",
486
+ onClick: v
487
+ }, [...u[5] ||= [s("svg", {
488
+ viewBox: "0 0 24 24",
489
+ fill: "none",
490
+ stroke: "currentColor",
491
+ "stroke-width": "2.5"
492
+ }, [s("path", { d: "M20 6L9 17l-5-5" })], -1), c(" 确定 ", -1)]])])]),
493
+ default: F(() => [l(n, { name: "slide" }, {
494
+ default: F(() => [p.value && t.indicatorDescription ? (C(), o("div", qe, [s("p", null, A(t.indicatorDescription), 1)])) : a("", !0)]),
405
495
  _: 1
406
- })])) : a("", !0)]),
496
+ }), s("div", Je, [(C(!0), o(e, null, E(t.params, (e) => (C(), o("div", {
497
+ key: e.key,
498
+ class: _(["param-item", { "has-desc": p.value && e.description }])
499
+ }, [s("div", Ye, [s("label", Xe, [s("span", Ze, A(e.label), 1), e.min !== void 0 || e.max !== void 0 ? (C(), o("span", Qe, A(e.min ?? "-∞") + " ~ " + A(e.max ?? "+∞"), 1)) : a("", !0)]), s("div", $e, [
500
+ s("button", {
501
+ class: "stepper-btn",
502
+ disabled: e.min !== void 0 && (f.value[e.key] ?? 0) <= e.min,
503
+ onClick: (t) => h(e, -1)
504
+ }, " − ", 8, et),
505
+ e.type === "number" ? (C(), o("input", {
506
+ key: 0,
507
+ type: "number",
508
+ class: "param-input",
509
+ value: f.value[e.key],
510
+ min: e.min,
511
+ max: e.max,
512
+ step: e.step || 1,
513
+ onInput: (t) => m(e.key, t)
514
+ }, null, 40, tt)) : a("", !0),
515
+ s("button", {
516
+ class: "stepper-btn",
517
+ disabled: e.max !== void 0 && (f.value[e.key] ?? 0) >= e.max,
518
+ onClick: (t) => h(e, 1)
519
+ }, " + ", 8, nt)
520
+ ])]), l(n, { name: "slide" }, {
521
+ default: F(() => [p.value && e.description ? (C(), o("div", rt, A(e.description), 1)) : a("", !0)]),
522
+ _: 2
523
+ }, 1024)], 2))), 128))])]),
407
524
  _: 1
408
- })], 8, ["to"]));
525
+ }, 8, ["show", "title"]));
409
526
  }
410
- }), [["__scopeId", "data-v-30f2f611"]]), Qe = { class: "indicator-selector" }, $e = { class: "modal-header" }, et = { class: "header-title" }, tt = { class: "title-sub" }, nt = { class: "header-actions" }, rt = {
527
+ }), [["__scopeId", "data-v-5689c2c8"]]), ot = { class: "indicator-selector" }, st = { class: "header-title" }, ct = { class: "title-sub" }, lt = {
411
528
  key: 0,
412
529
  viewBox: "0 0 24 24",
413
530
  width: "16",
414
531
  height: "16",
415
532
  fill: "currentColor"
416
- }, it = {
533
+ }, ut = {
417
534
  key: 1,
418
535
  viewBox: "0 0 24 24",
419
536
  width: "16",
420
537
  height: "16",
421
538
  fill: "currentColor"
422
- }, at = { class: "modal-search-area" }, ot = { class: "search-box" }, st = ["value"], ct = { class: "modal-body" }, lt = {
539
+ }, dt = { class: "search-box" }, ft = ["value"], pt = {
423
540
  key: 0,
424
541
  class: "indicator-section"
425
- }, ut = { class: "section-header" }, dt = { class: "section-count" }, ft = ["onClick"], pt = { class: "card-label" }, mt = { class: "card-tooltip" }, ht = { class: "card-header" }, gt = { class: "card-label" }, _t = { class: "card-header-actions" }, vt = ["onClick"], yt = { class: "card-name" }, bt = {
542
+ }, mt = { class: "section-header" }, ht = { class: "section-count" }, gt = ["onClick"], _t = { class: "card-label" }, vt = { class: "card-tooltip" }, yt = { class: "card-header" }, bt = { class: "card-label" }, xt = { class: "card-header-actions" }, St = ["onClick"], Ct = { class: "card-name" }, wt = {
426
543
  key: 1,
427
- class: "section-divider"
428
- }, xt = {
429
- key: 2,
430
544
  class: "no-results"
431
- }, St = {
432
- key: 3,
545
+ }, Tt = {
546
+ key: 2,
433
547
  class: "indicator-section"
434
- }, Ct = { class: "section-header" }, wt = { class: "section-count" }, Tt = ["onClick"], Et = { class: "card-label" }, Dt = { class: "card-tooltip" }, Ot = { class: "card-header" }, Y = { class: "card-label" }, X = { class: "card-header-actions" }, kt = ["onClick"], At = { class: "card-name" }, jt = { class: "modal-footer" }, Mt = { class: "footer-info" }, Nt = { class: "info-text" }, Pt = /*#__PURE__*/ U(/* @__PURE__ */ u({
548
+ }, Et = { class: "section-header" }, Dt = { class: "section-count" }, Ot = ["onClick"], kt = { class: "card-label" }, At = { class: "card-tooltip" }, jt = { class: "card-header" }, X = { class: "card-label" }, Mt = { class: "card-header-actions" }, Nt = ["onClick"], Pt = { class: "card-name" }, Ft = { class: "footer-info" }, It = { class: "info-text" }, Lt = /*#__PURE__*/ q(/* @__PURE__ */ u({
435
549
  __name: "IndicatorSelector",
436
550
  props: {
437
551
  activeIndicators: {},
@@ -442,9 +556,9 @@ var Ie = { class: "params-header" }, Le = { class: "header-left" }, Re = { class
442
556
  "updateParams",
443
557
  "reorderSubIndicators"
444
558
  ],
445
- setup(c, { expose: u, emit: d }) {
446
- let f = c, p = d;
447
- function m(e) {
559
+ setup(t, { expose: n, emit: c }) {
560
+ let u = t, d = c;
561
+ function f(e) {
448
562
  return e.map((e) => ({
449
563
  id: e.id,
450
564
  label: e.label,
@@ -462,151 +576,139 @@ var Ie = { class: "params-header" }, Le = { class: "header-left" }, Re = { class
462
576
  }))
463
577
  }));
464
578
  }
465
- let h = ue(), _ = $(h.menuOpen), v = $(h.searchQuery), b = $(h.filteredMain), C = $(h.filteredSub), E = r(() => b.value.length > 0 || C.value.length > 0), D = $(h.catalog), A = r(() => D.value.length);
466
- y(async () => {
467
- B() || await pe(), h.catalog.set(m(ce()));
579
+ let p = le(), m = $(p.menuOpen), h = $(p.searchQuery), g = $(p.filteredMain), v = $(p.filteredSub), y = r(() => g.value.length > 0 || v.value.length > 0), x = $(p.catalog), w = r(() => x.value.length);
580
+ b(async () => {
581
+ ue() || await fe(), p.catalog.set(f(H()));
468
582
  });
469
- let j = w(!1), M = w(null), P = w(!1), F = Fe(), L = r(() => M.value ? de(M.value) : null), ee = r(() => f.activeIndicators?.length ?? 0);
470
- function te(e) {
471
- return f.activeIndicators?.includes(e) ?? !1;
583
+ let D = T(!1), O = T(null), k = T(!1), M = r(() => O.value ? U(O.value) : null), N = r(() => u.activeIndicators?.length ?? 0);
584
+ function P(e) {
585
+ return u.activeIndicators?.includes(e) ?? !1;
472
586
  }
473
- function R(e) {
474
- te(e) || de(e) && p("toggle", e, !0);
587
+ function I(e) {
588
+ P(e) || U(e) && d("toggle", e, !0);
475
589
  }
476
- function ne(e) {
477
- p("toggle", e, !1);
590
+ function L(e) {
591
+ d("toggle", e, !1);
478
592
  }
479
593
  function z(e) {
480
- M.value = e, j.value = !0;
594
+ O.value = e, D.value = !0;
481
595
  }
482
- function re(e) {
483
- let t = de(e);
596
+ function ee(e) {
597
+ let t = U(e);
484
598
  if (!t?.params) return {};
485
599
  let n = {};
486
600
  for (let e of t.params) n[e.key] = e.default ?? e.min ?? 1;
487
- let r = f.indicatorParams?.[e] || {}, i = { ...n };
601
+ let r = u.indicatorParams?.[e] || {}, i = { ...n };
488
602
  for (let [e, t] of Object.entries(r)) typeof t == "number" && (i[e] = t);
489
603
  return i;
490
604
  }
491
- function ie(e) {
492
- M.value && p("updateParams", M.value, e), j.value = !1;
493
- }
494
- function ae(e) {
495
- e.key === "Escape" && h.menuOpen.peek() && h.closeMenu();
496
- }
497
- return y(() => {
498
- document.addEventListener("keydown", ae);
499
- }), x(() => {
500
- document.removeEventListener("keydown", ae);
501
- }), u({
502
- openMenu: () => h.openMenu(),
503
- closeMenu: () => h.closeMenu(),
504
- toggleMenu: () => h.toggleMenu()
505
- }), (r, c) => (S(), o("div", Qe, [(S(), i(t, { to: k(F) }, [l(n, { name: "overlay" }, {
506
- default: N(() => [k(_) ? (S(), o("div", {
507
- key: 0,
508
- class: "selector-overlay",
509
- onClick: c[5] ||= (e) => k(h).closeMenu()
510
- }, [l(n, { name: "modal" }, {
511
- default: N(() => [k(_) ? (S(), o("div", {
605
+ function te(e) {
606
+ O.value && d("updateParams", O.value, e), D.value = !1;
607
+ }
608
+ function B(e) {
609
+ e.key === "Escape" && p.menuOpen.peek() && p.closeMenu();
610
+ }
611
+ return b(() => {
612
+ document.addEventListener("keydown", B);
613
+ }), S(() => {
614
+ document.removeEventListener("keydown", B);
615
+ }), n({
616
+ openMenu: () => p.openMenu(),
617
+ closeMenu: () => p.closeMenu(),
618
+ toggleMenu: () => p.toggleMenu()
619
+ }), (t, n) => (C(), o("div", ot, [l(Y, {
620
+ show: j(m),
621
+ title: "添加指标",
622
+ subtitle: "",
623
+ width: "90vw",
624
+ "max-width": "860px",
625
+ "max-height": "85vh",
626
+ "transition-variant": "compact",
627
+ "footer-align": "space-between",
628
+ onClose: n[3] ||= (e) => j(p).closeMenu()
629
+ }, {
630
+ header: F(() => [s("div", st, [n[5] ||= s("span", { class: "title-text" }, "添加指标", -1), s("span", ct, A(w.value) + " 个可用指标", 1)])]),
631
+ "header-extra": F(() => [s("button", {
632
+ class: _(["view-toggle-btn", { active: k.value }]),
633
+ onClick: n[0] ||= (e) => k.value = !k.value,
634
+ title: "简洁模式"
635
+ }, [k.value ? (C(), o("svg", ut, [...n[7] ||= [s("path", { d: "M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z" }, null, -1)]])) : (C(), o("svg", lt, [...n[6] ||= [s("path", { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, null, -1)]]))], 2)]),
636
+ subheader: F(() => [s("div", dt, [n[8] ||= s("svg", {
637
+ class: "search-icon",
638
+ viewBox: "0 0 24 24",
639
+ width: "16",
640
+ height: "16",
641
+ fill: "currentColor"
642
+ }, [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", {
643
+ value: j(h),
644
+ onInput: n[1] ||= (e) => j(p).setSearchQuery(e.target.value),
645
+ type: "text",
646
+ class: "search-input",
647
+ placeholder: "搜索指标名称..."
648
+ }, null, 40, ft)])]),
649
+ footer: F(() => [s("div", Ft, [s("span", It, "已激活 " + A(N.value) + " 个指标", 1)]), s("button", {
650
+ class: "btn btn-confirm",
651
+ onClick: n[2] ||= (e) => j(p).closeMenu()
652
+ }, "确认")]),
653
+ default: F(() => [
654
+ j(g).length > 0 ? (C(), o("div", pt, [s("div", mt, [n[9] ||= s("span", { class: "section-title" }, "主图指标", -1), s("span", ht, A(j(g).length), 1)]), s("div", { class: _(["indicator-grid", { compact: k.value }]) }, [(C(!0), o(e, null, E(j(g), (t) => (C(), o("button", {
655
+ key: t.id,
656
+ class: _(["indicator-card", {
657
+ active: P(t.id),
658
+ compact: k.value
659
+ }]),
660
+ onClick: (e) => P(t.id) ? L(t.id) : I(t.id)
661
+ }, [k.value ? (C(), o(e, { key: 0 }, [s("span", _t, A(t.label), 1), s("span", vt, A(t.name), 1)], 64)) : (C(), o(e, { key: 1 }, [s("div", yt, [s("span", bt, A(t.label), 1), s("div", xt, [t.params?.length ? (C(), o("button", {
512
662
  key: 0,
513
- class: "selector-modal",
514
- onClick: c[4] ||= I(() => {}, ["stop"])
515
- }, [
516
- s("div", $e, [s("div", et, [c[7] ||= s("span", { class: "title-text" }, "添加指标", -1), s("span", tt, O(A.value) + " 个可用指标", 1)]), s("div", nt, [s("button", {
517
- class: g(["view-toggle-btn", { active: P.value }]),
518
- onClick: c[0] ||= (e) => P.value = !P.value,
519
- title: "简洁模式"
520
- }, [P.value ? (S(), o("svg", it, [...c[9] ||= [s("path", { d: "M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z" }, null, -1)]])) : (S(), o("svg", rt, [...c[8] ||= [s("path", { d: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z" }, null, -1)]]))], 2), s("button", {
521
- class: "modal-close",
522
- onClick: c[1] ||= (e) => k(h).closeMenu(),
523
- title: "关闭"
524
- }, [...c[10] ||= [s("svg", {
525
- viewBox: "0 0 24 24",
526
- width: "14",
527
- height: "14",
528
- fill: "currentColor"
529
- }, [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)]])])]),
530
- s("div", at, [s("div", ot, [c[11] ||= s("svg", {
531
- class: "search-icon",
663
+ class: "card-settings-btn",
664
+ onClick: R((e) => z(t.id), ["stop"]),
665
+ title: "编辑参数"
666
+ }, [...n[10] ||= [s("svg", {
667
+ viewBox: "0 0 24 24",
668
+ width: "14",
669
+ height: "14",
670
+ fill: "currentColor"
671
+ }, [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, A(t.name), 1)], 64))], 10, gt))), 128))], 2)])) : a("", !0),
672
+ !y.value && j(h).trim() ? (C(), o("div", wt, [...n[11] ||= [
673
+ s("svg", {
532
674
  viewBox: "0 0 24 24",
533
- width: "16",
534
- height: "16",
675
+ width: "40",
676
+ height: "40",
535
677
  fill: "currentColor"
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", {
537
- value: k(v),
538
- onInput: c[2] ||= (e) => k(h).setSearchQuery(e.target.value),
539
- type: "text",
540
- class: "search-input",
541
- placeholder: "搜索指标名称..."
542
- }, null, 40, st)])]),
543
- s("div", ct, [
544
- k(b).length > 0 ? (S(), o("div", lt, [s("div", ut, [c[12] ||= s("span", { class: "section-title" }, "主图指标", -1), s("span", dt, O(k(b).length), 1)]), s("div", { class: g(["indicator-grid", { compact: P.value }]) }, [(S(!0), o(e, null, T(k(b), (t) => (S(), o("button", {
545
- key: t.id,
546
- class: g(["indicator-card", {
547
- active: te(t.id),
548
- compact: P.value
549
- }]),
550
- onClick: (e) => te(t.id) ? ne(t.id) : R(t.id)
551
- }, [P.value ? (S(), o(e, { key: 0 }, [s("span", pt, O(t.label), 1), s("span", mt, O(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", ht, [s("span", gt, O(t.label), 1), s("div", _t, [t.params?.length ? (S(), o("button", {
552
- key: 0,
553
- class: "card-settings-btn",
554
- onClick: I((e) => z(t.id), ["stop"]),
555
- title: "编辑参数"
556
- }, [...c[13] ||= [s("svg", {
557
- viewBox: "0 0 24 24",
558
- width: "14",
559
- height: "14",
560
- fill: "currentColor"
561
- }, [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, vt)) : a("", !0)])]), s("div", yt, O(t.name), 1)], 64))], 10, ft))), 128))], 2)])) : a("", !0),
562
- k(b).length > 0 && k(C).length > 0 ? (S(), o("div", bt)) : a("", !0),
563
- !E.value && k(v).trim() ? (S(), o("div", xt, [...c[14] ||= [
564
- s("svg", {
565
- viewBox: "0 0 24 24",
566
- width: "48",
567
- height: "48",
568
- fill: "currentColor"
569
- }, [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),
570
- s("p", null, "未找到匹配的指标", -1),
571
- s("span", { class: "no-results-hint" }, "请尝试其他关键词", -1)
572
- ]])) : a("", !0),
573
- k(C).length > 0 ? (S(), o("div", St, [s("div", Ct, [c[15] ||= s("span", { class: "section-title" }, "副图指标", -1), s("span", wt, O(k(C).length), 1)]), s("div", { class: g(["indicator-grid", { compact: P.value }]) }, [(S(!0), o(e, null, T(k(C), (t) => (S(), o("button", {
574
- key: t.id,
575
- class: g(["indicator-card", {
576
- active: te(t.id),
577
- compact: P.value
578
- }]),
579
- onClick: (e) => te(t.id) ? ne(t.id) : R(t.id)
580
- }, [P.value ? (S(), o(e, { key: 0 }, [s("span", Et, O(t.label), 1), s("span", Dt, O(t.name), 1)], 64)) : (S(), o(e, { key: 1 }, [s("div", Ot, [s("span", Y, O(t.label), 1), s("div", X, [t.params?.length ? (S(), o("button", {
581
- key: 0,
582
- class: "card-settings-btn",
583
- onClick: I((e) => z(t.id), ["stop"]),
584
- title: "编辑参数"
585
- }, [...c[16] ||= [s("svg", {
586
- viewBox: "0 0 24 24",
587
- width: "14",
588
- height: "14",
589
- fill: "currentColor"
590
- }, [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, kt)) : a("", !0)])]), s("div", At, O(t.name), 1)], 64))], 10, Tt))), 128))], 2)])) : a("", !0)
591
- ]),
592
- s("div", jt, [s("div", Mt, [s("span", Nt, "已激活 " + O(ee.value) + " 个指标", 1)]), s("button", {
593
- class: "btn btn-confirm",
594
- onClick: c[3] ||= (e) => k(h).closeMenu()
595
- }, "确认")])
596
- ])) : a("", !0)]),
597
- _: 1
598
- })])) : a("", !0)]),
678
+ }, [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),
679
+ s("p", null, "未找到匹配的指标", -1),
680
+ s("span", { class: "no-results-hint" }, "请尝试其他关键词", -1)
681
+ ]])) : a("", !0),
682
+ j(v).length > 0 ? (C(), o("div", Tt, [s("div", Et, [n[12] ||= s("span", { class: "section-title" }, "副图指标", -1), s("span", Dt, A(j(v).length), 1)]), s("div", { class: _(["indicator-grid", { compact: k.value }]) }, [(C(!0), o(e, null, E(j(v), (t) => (C(), o("button", {
683
+ key: t.id,
684
+ class: _(["indicator-card", {
685
+ active: P(t.id),
686
+ compact: k.value
687
+ }]),
688
+ onClick: (e) => P(t.id) ? L(t.id) : I(t.id)
689
+ }, [k.value ? (C(), o(e, { key: 0 }, [s("span", kt, A(t.label), 1), s("span", At, A(t.name), 1)], 64)) : (C(), o(e, { key: 1 }, [s("div", jt, [s("span", X, A(t.label), 1), s("div", Mt, [t.params?.length ? (C(), o("button", {
690
+ key: 0,
691
+ class: "card-settings-btn",
692
+ onClick: R((e) => z(t.id), ["stop"]),
693
+ title: "编辑参数"
694
+ }, [...n[13] ||= [s("svg", {
695
+ viewBox: "0 0 24 24",
696
+ width: "14",
697
+ height: "14",
698
+ fill: "currentColor"
699
+ }, [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, A(t.name), 1)], 64))], 10, Ot))), 128))], 2)])) : a("", !0)
700
+ ]),
599
701
  _: 1
600
- })], 8, ["to"])), L.value ? (S(), i(Ze, {
702
+ }, 8, ["show"]), M.value ? (C(), i(at, {
601
703
  key: 0,
602
- visible: j.value,
603
- "indicator-id": L.value.id,
604
- "indicator-name": L.value.name,
605
- "indicator-description": L.value.description,
606
- params: L.value.params || [],
607
- values: re(L.value.id),
608
- onClose: c[6] ||= (e) => j.value = !1,
609
- onConfirm: ie
704
+ visible: D.value,
705
+ "indicator-id": M.value.id,
706
+ "indicator-name": M.value.name,
707
+ "indicator-description": M.value.description,
708
+ params: M.value.params || [],
709
+ values: ee(M.value.id),
710
+ onClose: n[4] ||= (e) => D.value = !1,
711
+ onConfirm: te
610
712
  }, null, 8, [
611
713
  "visible",
612
714
  "indicator-id",
@@ -616,25 +718,25 @@ var Ie = { class: "params-header" }, Le = { class: "header-left" }, Re = { class
616
718
  "values"
617
719
  ])) : a("", !0)]));
618
720
  }
619
- }), [["__scopeId", "data-v-fe4a5a7b"]]), Ft = { class: "kline-tooltip__title" }, It = { key: 0 }, Lt = { class: "kline-tooltip__grid" }, Rt = { class: "row" }, zt = { class: "row" }, Bt = { class: "row" }, Vt = { class: "row" }, Ht = {
721
+ }), [["__scopeId", "data-v-b418736f"]]), Rt = { class: "kline-tooltip__title" }, zt = { key: 0 }, Bt = { class: "kline-tooltip__grid" }, Vt = { class: "row" }, Ht = { class: "row" }, Ut = { class: "row" }, Wt = { class: "row" }, Gt = {
620
722
  key: 0,
621
723
  class: "row"
622
- }, Ut = {
724
+ }, Kt = {
623
725
  key: 1,
624
726
  class: "row"
625
- }, Wt = {
727
+ }, qt = {
626
728
  key: 2,
627
729
  class: "row"
628
- }, Gt = {
730
+ }, Jt = {
629
731
  key: 3,
630
732
  class: "row"
631
- }, Kt = {
733
+ }, Yt = {
632
734
  key: 4,
633
735
  class: "row"
634
- }, qt = {
736
+ }, Xt = {
635
737
  key: 5,
636
738
  class: "row"
637
- }, Z = "#6b7280", Jt = /*#__PURE__*/ U(/* @__PURE__ */ u({
739
+ }, Z = "#6b7280", Zt = /*#__PURE__*/ q(/* @__PURE__ */ u({
638
740
  __name: "KLineTooltip",
639
741
  props: {
640
742
  k: {},
@@ -653,7 +755,7 @@ var Ie = { class: "params-header" }, Le = { class: "header-left" }, Re = { class
653
755
  }
654
756
  },
655
757
  setup(e) {
656
- let t = e, n = r(() => t.k ? z(t.k.timestamp, {
758
+ let t = e, n = r(() => t.k ? V(t.k.timestamp, {
657
759
  timeZone: t.timezone,
658
760
  showTime: t.showTime
659
761
  }) : ""), i = r(() => t.useAnchor === !0), c = r(() => t.anchorPlacement === "left-bottom" ? "anchor-left-bottom" : "anchor-right-bottom");
@@ -687,31 +789,31 @@ var Ie = { class: "params-header" }, Le = { class: "header-left" }, Re = { class
687
789
  let n = e.changePercent ?? (e.close - e.open) / e.open * 100;
688
790
  return n > 0 ? t.upColor : n < 0 ? t.downColor : Z;
689
791
  });
690
- return (t, r) => e.k ? (S(), o("div", {
792
+ return (t, r) => e.k ? (C(), o("div", {
691
793
  key: 0,
692
794
  ref: l,
693
- class: g(["kline-tooltip", [{ "use-anchor": i.value }, c.value]]),
694
- style: _(i.value ? void 0 : {
795
+ class: _(["kline-tooltip", [{ "use-anchor": i.value }, c.value]]),
796
+ style: v(i.value ? void 0 : {
695
797
  left: `${e.pos.x}px`,
696
798
  top: `${e.pos.y}px`
697
799
  })
698
- }, [s("div", Ft, [e.k.stockCode ? (S(), o("span", It, O(e.k.stockCode), 1)) : a("", !0), s("span", null, O(n.value), 1)]), s("div", Lt, [
699
- s("div", Rt, [r[0] ||= s("span", null, "开", -1), s("span", { style: _({ color: p.value }) }, O(e.k.open.toFixed(2)), 5)]),
700
- s("div", zt, [r[1] ||= s("span", null, "高", -1), s("span", null, O(e.k.high.toFixed(2)), 1)]),
701
- s("div", Bt, [r[2] ||= s("span", null, "低", -1), s("span", null, O(e.k.low.toFixed(2)), 1)]),
702
- s("div", Vt, [r[3] ||= s("span", null, "收", -1), s("span", { style: _({ color: m.value }) }, O(e.k.close.toFixed(2)), 5)]),
703
- typeof e.k.volume == "number" ? (S(), o("div", Ht, [r[4] ||= s("span", null, "成交量", -1), s("span", null, O(u(e.k.volume)), 1)])) : a("", !0),
704
- typeof e.k.turnover == "number" ? (S(), o("div", Ut, [r[5] ||= s("span", null, "成交额", -1), s("span", null, O(u(e.k.turnover)), 1)])) : a("", !0),
705
- typeof e.k.amplitude == "number" ? (S(), o("div", Wt, [r[6] ||= s("span", null, "振幅", -1), s("span", null, O(e.k.amplitude) + "%", 1)])) : a("", !0),
706
- typeof e.k.changePercent == "number" ? (S(), o("div", Gt, [r[7] ||= s("span", null, "涨跌幅", -1), s("span", { style: _({ color: h.value }) }, O(d(e.k.changePercent, "%")), 5)])) : a("", !0),
707
- typeof e.k.changeAmount == "number" ? (S(), o("div", Kt, [r[8] ||= s("span", null, "涨跌额", -1), s("span", { style: _({ color: h.value }) }, O(d(e.k.changeAmount, "")), 5)])) : a("", !0),
708
- typeof e.k.turnoverRate == "number" ? (S(), o("div", qt, [r[9] ||= s("span", null, "换手率", -1), s("span", null, O(e.k.turnoverRate.toFixed(2)) + "%", 1)])) : a("", !0)
800
+ }, [s("div", Rt, [e.k.stockCode ? (C(), o("span", zt, A(e.k.stockCode), 1)) : a("", !0), s("span", null, A(n.value), 1)]), s("div", Bt, [
801
+ s("div", Vt, [r[0] ||= s("span", null, "开", -1), s("span", { style: v({ color: p.value }) }, A(e.k.open.toFixed(2)), 5)]),
802
+ s("div", Ht, [r[1] ||= s("span", null, "高", -1), s("span", null, A(e.k.high.toFixed(2)), 1)]),
803
+ s("div", Ut, [r[2] ||= s("span", null, "低", -1), s("span", null, A(e.k.low.toFixed(2)), 1)]),
804
+ s("div", Wt, [r[3] ||= s("span", null, "收", -1), s("span", { style: v({ color: m.value }) }, A(e.k.close.toFixed(2)), 5)]),
805
+ typeof e.k.volume == "number" ? (C(), o("div", Gt, [r[4] ||= s("span", null, "成交量", -1), s("span", null, A(u(e.k.volume)), 1)])) : a("", !0),
806
+ typeof e.k.turnover == "number" ? (C(), o("div", Kt, [r[5] ||= s("span", null, "成交额", -1), s("span", null, A(u(e.k.turnover)), 1)])) : a("", !0),
807
+ typeof e.k.amplitude == "number" ? (C(), o("div", qt, [r[6] ||= s("span", null, "振幅", -1), s("span", null, A(e.k.amplitude) + "%", 1)])) : a("", !0),
808
+ typeof e.k.changePercent == "number" ? (C(), o("div", Jt, [r[7] ||= s("span", null, "涨跌幅", -1), s("span", { style: v({ color: h.value }) }, A(d(e.k.changePercent, "%")), 5)])) : a("", !0),
809
+ typeof e.k.changeAmount == "number" ? (C(), o("div", Yt, [r[8] ||= s("span", null, "涨跌额", -1), s("span", { style: v({ color: h.value }) }, A(d(e.k.changeAmount, "")), 5)])) : a("", !0),
810
+ typeof e.k.turnoverRate == "number" ? (C(), o("div", Xt, [r[9] ||= s("span", null, "换手率", -1), s("span", null, A(e.k.turnoverRate.toFixed(2)) + "%", 1)])) : a("", !0)
709
811
  ])], 6)) : a("", !0);
710
812
  }
711
- }), [["__scopeId", "data-v-80fa3a7d"]]), Yt = { class: "marker-tooltip__title" }, Xt = {
813
+ }), [["__scopeId", "data-v-80fa3a7d"]]), Qt = { class: "marker-tooltip__title" }, $t = {
712
814
  key: 0,
713
815
  class: "marker-tooltip__content"
714
- }, Zt = /*#__PURE__*/ U(/* @__PURE__ */ u({
816
+ }, en = /*#__PURE__*/ q(/* @__PURE__ */ u({
715
817
  __name: "MarkerTooltip",
716
818
  props: {
717
819
  marker: {},
@@ -752,26 +854,649 @@ var Ie = { class: "params-header" }, Le = { class: "header-left" }, Re = { class
752
854
  function h(e) {
753
855
  return typeof e == "number" ? e.toFixed(2) : String(e);
754
856
  }
755
- return (n, r) => t.marker ? (S(), o("div", {
857
+ return (n, r) => t.marker ? (C(), o("div", {
756
858
  key: 0,
757
859
  ref: u,
758
- class: g(["marker-tooltip", [{ "use-anchor": c.value }, l.value]]),
759
- style: _(c.value ? void 0 : {
860
+ class: _(["marker-tooltip", [{ "use-anchor": c.value }, l.value]]),
861
+ style: v(c.value ? void 0 : {
760
862
  left: `${t.pos.x + 12}px`,
761
863
  top: `${t.pos.y + 12}px`
762
864
  })
763
- }, [s("div", Yt, O(f.value), 1), m.value ? (S(), o("div", Xt, [(S(!0), o(e, null, T(p.value, (e, t) => (S(), o("div", {
865
+ }, [s("div", Qt, A(f.value), 1), m.value ? (C(), o("div", $t, [(C(!0), o(e, null, E(p.value, (e, t) => (C(), o("div", {
764
866
  key: t,
765
867
  class: "row"
766
- }, [s("span", null, O(t), 1), s("span", null, O(h(e)), 1)]))), 128))])) : a("", !0)], 6)) : a("", !0);
868
+ }, [s("span", null, A(t), 1), s("span", null, A(h(e)), 1)]))), 128))])) : a("", !0)], 6)) : a("", !0);
869
+ }
870
+ }), [["__scopeId", "data-v-f2a21012"]]), tn = ["value", "placeholder"], nn = ["value", "placeholder"], rn = { class: "range-count" }, an = /*#__PURE__*/ q(/* @__PURE__ */ u({
871
+ __name: "RangeSelectionExport",
872
+ props: {
873
+ startDate: {},
874
+ endDate: {},
875
+ startLabel: {},
876
+ endLabel: {},
877
+ count: {}
878
+ },
879
+ emits: [
880
+ "update:startDate",
881
+ "update:endDate",
882
+ "export",
883
+ "clear",
884
+ "batchSetting"
885
+ ],
886
+ setup(e) {
887
+ return (t, n) => (C(), i(Le, null, {
888
+ default: F(() => [
889
+ s("input", {
890
+ class: "range-input",
891
+ value: e.startDate,
892
+ onInput: n[0] ||= (e) => t.$emit("update:startDate", e.target.value),
893
+ placeholder: e.startLabel
894
+ }, null, 40, tn),
895
+ n[6] ||= s("span", { class: "range-sep" }, "~", -1),
896
+ s("input", {
897
+ class: "range-input",
898
+ value: e.endDate,
899
+ onInput: n[1] ||= (e) => t.$emit("update:endDate", e.target.value),
900
+ placeholder: e.endLabel
901
+ }, null, 40, nn),
902
+ s("span", rn, "共 " + A(e.count) + " 条", 1),
903
+ s("button", {
904
+ type: "button",
905
+ class: "toolbar-btn",
906
+ title: "批量设置",
907
+ onClick: n[2] ||= (e) => t.$emit("batchSetting")
908
+ }, " 批量设置 "),
909
+ s("button", {
910
+ type: "button",
911
+ class: "toolbar-btn",
912
+ title: "导出",
913
+ onClick: n[3] ||= (e) => t.$emit("export")
914
+ }, "导出"),
915
+ s("button", {
916
+ type: "button",
917
+ class: "toolbar-btn toolbar-btn--delete",
918
+ title: "取消选区",
919
+ onClick: n[4] ||= (e) => t.$emit("clear")
920
+ }, [...n[5] ||= [s("svg", {
921
+ class: "delete-icon",
922
+ viewBox: "0 0 24 24",
923
+ fill: "none",
924
+ stroke: "currentColor",
925
+ "stroke-width": "2",
926
+ "stroke-linecap": "round",
927
+ "stroke-linejoin": "round",
928
+ "aria-hidden": "true"
929
+ }, [
930
+ s("path", { d: "M3 6h18" }),
931
+ s("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
932
+ s("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
933
+ ], -1)]])
934
+ ]),
935
+ _: 1
936
+ }));
937
+ }
938
+ }), [["__scopeId", "data-v-6e5ee3f6"]]), on = {};
939
+ function sn(e, t) {
940
+ return C(), o("div", {
941
+ class: "canvas-toolbar-stack",
942
+ onPointerdown: t[0] ||= R(() => {}, ["stop"]),
943
+ onPointermove: t[1] ||= R(() => {}, ["stop"]),
944
+ onPointerup: t[2] ||= R(() => {}, ["stop"])
945
+ }, [D(e.$slots, "default", {}, void 0, !0)], 32);
946
+ }
947
+ var cn = /*#__PURE__*/ q(on, [["render", sn], ["__scopeId", "data-v-82232270"]]);
948
+ //#endregion
949
+ //#region src/composables/chart/useChartTheme.ts
950
+ function ln(e) {
951
+ let t = T("light"), n = T({}), i = r(() => {
952
+ let e = n.value.isAsiaMarket ?? !1, r = ae(t.value, e);
953
+ return {
954
+ upColor: r.candleUpBody,
955
+ downColor: r.candleDownBody
956
+ };
957
+ }), a = r(() => {
958
+ let e = t.value === "dark" ? ne : re, r = n.value.colorPresetSettings?.[t.value];
959
+ return r && Object.keys(r).length > 0 ? oe({
960
+ ...e,
961
+ colors: {
962
+ ...e.colors,
963
+ ...r
964
+ }
965
+ }) : oe(e);
966
+ }), o = null;
967
+ function s(t) {
968
+ e.value?.setTheme(t.matches ? "dark" : "light");
969
+ }
970
+ function c(t) {
971
+ let n = e.value;
972
+ if (!(!n || !t)) if (t === "auto") {
973
+ let e = window.matchMedia("(prefers-color-scheme: dark)");
974
+ n.setTheme(e.matches ? "dark" : "light"), o !== e && (o?.removeEventListener("change", s), o = e, e.addEventListener("change", s));
975
+ } else o?.removeEventListener("change", s), o = null, n.setTheme(t);
976
+ }
977
+ function l(t) {
978
+ n.value = t, c(t.theme), e.value?.updateSettingsFacade(t);
979
+ }
980
+ return S(() => {
981
+ o?.removeEventListener("change", s), o = null;
982
+ }), {
983
+ chartTheme: t,
984
+ chartSettings: n,
985
+ tooltipColors: i,
986
+ themeCssVars: a,
987
+ handleSettingsChange: l,
988
+ applyThemeFromSettings: c
989
+ };
990
+ }
991
+ //#endregion
992
+ //#region src/composables/chart/useIndicatorManager.ts
993
+ function un(e, t) {
994
+ let n = T([]), i = T([]), a = r(() => {
995
+ let e = [], t = /* @__PURE__ */ new Set();
996
+ for (let n of i.value) t.has(n.indicatorId) || (t.add(n.indicatorId), e.push(n.indicatorId));
997
+ return e;
998
+ }), o = r(() => [...n.value, ...a.value]), s = T({});
999
+ function c() {
1000
+ let e = t.value.main ?? 3;
1001
+ return i.value.length === 0 ? [{
1002
+ id: "main",
1003
+ ratio: e,
1004
+ visible: !0,
1005
+ role: "price"
1006
+ }] : [{
1007
+ id: "main",
1008
+ ratio: e,
1009
+ visible: !0,
1010
+ role: "price"
1011
+ }, ...i.value.map((e) => ({
1012
+ id: e.id,
1013
+ ratio: t.value[e.id] ?? 1,
1014
+ visible: !0,
1015
+ role: "indicator"
1016
+ }))];
1017
+ }
1018
+ function l(e) {
1019
+ if (e === "VOLUME") return {};
1020
+ let t = he(e);
1021
+ return t?.runtime?.defaultConfig ? { ...t.runtime.defaultConfig } : {};
1022
+ }
1023
+ function u(e) {
1024
+ if (e === "VOLUME") return !0;
1025
+ let t = he(e);
1026
+ return !!t && t.category !== "main";
1027
+ }
1028
+ function d(t = "VOLUME", n) {
1029
+ if (i.value.length >= 4) return !1;
1030
+ let r = n ?? l(t);
1031
+ return !!e.value?.addIndicator(t, "sub", r);
1032
+ }
1033
+ function f(t) {
1034
+ e.value?.removeIndicator(t);
1035
+ }
1036
+ function p() {
1037
+ for (let t of i.value) e.value?.removeIndicator(t.id);
1038
+ }
1039
+ function m(t) {
1040
+ let n = t, r = e.value;
1041
+ if (!n || !r) return;
1042
+ let i = n.indicators?.main;
1043
+ if (i) for (let e of i) e.enabled && r.addIndicator(e.type, "main", e.params);
1044
+ }
1045
+ function h(t, n) {
1046
+ let r = l(n);
1047
+ e.value?.replaceSubPaneIndicator(t, n, r);
1048
+ }
1049
+ function g(t, r) {
1050
+ let a = e.value;
1051
+ if (!a) return;
1052
+ let o = he(t);
1053
+ if (o && (o.category === "main" || o.allowMainPane)) {
1054
+ let e = n.value.find((e) => e === t);
1055
+ r && !e ? a.addIndicator(t, "main", s.value[t]) : !r && e && a.removeIndicator(t.toUpperCase());
1056
+ return;
1057
+ }
1058
+ if (u(t)) if (r) {
1059
+ if (i.value.find((e) => e.indicatorId === t) || i.value.length >= 4) return;
1060
+ if (!a.addIndicator(t, "sub", s.value[t]) && i.value.length > 0) {
1061
+ let e = i.value[i.value.length - 1];
1062
+ h(e.id, t);
1063
+ }
1064
+ } else i.value.filter((e) => e.indicatorId === t).forEach((e) => {
1065
+ a.removeIndicator(e.id);
1066
+ });
1067
+ }
1068
+ function _(t, n) {
1069
+ if (t === "MA" || t === "BOLL" || t === "EXPMA" || t === "ENE") {
1070
+ e.value?.updateIndicatorParams(t, n);
1071
+ return;
1072
+ }
1073
+ u(t) && i.value.filter((e) => e.indicatorId === t).forEach((t) => {
1074
+ e.value?.updateIndicatorParams(t.id, n);
1075
+ });
1076
+ }
1077
+ function v(t) {
1078
+ if (!t.length || i.value.length <= 1) return;
1079
+ let n = t.filter((e) => u(e));
1080
+ if (!n.length) return;
1081
+ let r = new Map(i.value.map((e) => [e.indicatorId, e])), a = [];
1082
+ for (let e of n) {
1083
+ let t = r.get(e);
1084
+ t && (a.push(t), r.delete(e));
1085
+ }
1086
+ if (a.length === 0) return;
1087
+ for (let e of i.value) r.has(e.indicatorId) && (a.push(e), r.delete(e.indicatorId));
1088
+ let o = i.value.map((e) => e.id), s = a.map((e) => e.id);
1089
+ if (o.join("|") === s.join("|")) return;
1090
+ i.value = a;
1091
+ let l = e.value;
1092
+ l && l.updatePaneLayout(c());
767
1093
  }
768
- }), [["__scopeId", "data-v-f2a21012"]]), Qt = {
1094
+ function y(e) {
1095
+ let t = e.indicators.subscribe(() => {
1096
+ let t = e.indicators.peek(), r = t.filter((e) => e.role === "main").map((e) => e.definitionId);
1097
+ n.value = r;
1098
+ let i = { ...s.value };
1099
+ for (let e of t) e.role === "main" && e.params && Object.keys(e.params).length > 0 && (i[e.definitionId] = { ...e.params });
1100
+ e.updateRendererConfig("mainIndicatorLegend", { indicators: {
1101
+ MA: {
1102
+ enabled: r.includes("MA"),
1103
+ params: i.MA || {}
1104
+ },
1105
+ BOLL: {
1106
+ enabled: r.includes("BOLL"),
1107
+ params: i.BOLL || {}
1108
+ },
1109
+ EXPMA: {
1110
+ enabled: r.includes("EXPMA"),
1111
+ params: i.EXPMA || {}
1112
+ },
1113
+ ENE: {
1114
+ enabled: r.includes("ENE"),
1115
+ params: i.ENE || {}
1116
+ }
1117
+ } }), s.value = i;
1118
+ }), r = e.subPanes.subscribe(() => {
1119
+ let t = e.subPanes.peek(), n = new Set(t.map((e) => e.paneId)), r = i.value.filter((e) => n.has(e.id)), a = new Set(r.map((e) => e.id));
1120
+ for (let e of t) a.has(e.paneId) || r.push({
1121
+ id: e.paneId,
1122
+ indicatorId: e.indicatorId,
1123
+ params: e.params
1124
+ });
1125
+ i.value = r;
1126
+ let o = { ...s.value };
1127
+ for (let e of t) e.params && Object.keys(e.params).length > 0 && (o[e.indicatorId] = { ...e.params });
1128
+ s.value = o;
1129
+ });
1130
+ return () => {
1131
+ t(), r();
1132
+ };
1133
+ }
1134
+ return {
1135
+ mainActiveIndicators: n,
1136
+ subActiveIndicators: a,
1137
+ activeIndicators: o,
1138
+ indicatorParams: s,
1139
+ subPanes: i,
1140
+ maxSubPanes: 4,
1141
+ buildPaneLayoutIntent: c,
1142
+ getDefaultParams: l,
1143
+ isSubPaneIndicator: u,
1144
+ addSubPane: d,
1145
+ removeSubPane: f,
1146
+ clearAllSubPanes: p,
1147
+ initIndicatorsFromConfig: m,
1148
+ switchSubIndicator: h,
1149
+ handleIndicatorToggle: g,
1150
+ handleUpdateParams: _,
1151
+ handleReorderSubIndicators: v,
1152
+ setupIndicatorSubscriptions: y
1153
+ };
1154
+ }
1155
+ //#endregion
1156
+ //#region src/composables/chart/useDrawingManager.ts
1157
+ function dn(e) {
1158
+ let t = k(null), n = T(null), i = T([]), a = r(() => {
1159
+ let e = n.value;
1160
+ return e ? i.value.find((t) => t.id === e) ?? null : null;
1161
+ });
1162
+ function o(e) {
1163
+ t.value?.setTool(e);
1164
+ }
1165
+ function s(e) {
1166
+ let n = a.value;
1167
+ !n || !t.value || (t.value.updateDrawingStyle(n.id, e), i.value = t.value.getDrawings());
1168
+ }
1169
+ function c() {
1170
+ let e = a.value;
1171
+ !e || !t.value || (t.value.removeDrawing(e.id), i.value = t.value.getDrawings());
1172
+ }
1173
+ function l(e) {
1174
+ t.value = new se(e), t.value.setCallbacks({
1175
+ onDrawingCreated: (e) => {
1176
+ i.value = [...i.value, e], n.value = e.id;
1177
+ },
1178
+ onToolChange: () => {},
1179
+ onDrawingSelected: (e) => {
1180
+ n.value = e?.id ?? null;
1181
+ }
1182
+ });
1183
+ }
1184
+ return {
1185
+ drawingController: t,
1186
+ selectedDrawingId: n,
1187
+ selectedDrawing: a,
1188
+ drawings: i,
1189
+ handleSelectTool: o,
1190
+ onUpdateDrawingStyle: s,
1191
+ onDeleteDrawing: c,
1192
+ setupDrawing: l
1193
+ };
1194
+ }
1195
+ //#endregion
1196
+ //#region src/tools/calcRangeOverlayPixel.ts
1197
+ function fn(e, t, n, r) {
1198
+ let { kWidth: i, kGap: a } = t.getKWidthKGap(), o = t.getCurrentDpr(), s = Math.max(1, Math.round(i * o) + +(Math.round(i * o) % 2 == 0)), c = Math.round(a * o), l = s + c, u = c, d = n.scrollLeft - r.scrollLeft, f = d + (u + e.start * l) / o;
1199
+ return {
1200
+ left: f,
1201
+ width: d + (u + e.end * l + s) / o - f,
1202
+ height: r.plotHeight
1203
+ };
1204
+ }
1205
+ //#endregion
1206
+ //#region src/tools/getKLineIndexByTimestamp.ts
1207
+ function pn(e, t) {
1208
+ let n = 0, r = e.length - 1;
1209
+ for (; n <= r;) {
1210
+ let i = n + r >>> 1, a = e[i].timestamp;
1211
+ if (a === t) return {
1212
+ low: i,
1213
+ high: i
1214
+ };
1215
+ a < t ? n = i + 1 : r = i - 1;
1216
+ }
1217
+ return {
1218
+ low: n,
1219
+ high: r
1220
+ };
1221
+ }
1222
+ function mn(e, t, n) {
1223
+ if (e.length === 0) return null;
1224
+ let { low: r, high: i } = pn(e, t);
1225
+ return r === i ? r : n === "left" ? i >= 0 ? i : r < e.length ? r : null : r < e.length ? r : i;
1226
+ }
1227
+ //#endregion
1228
+ //#region src/composables/chart/useRangeSelection.ts
1229
+ function hn(e) {
1230
+ return e ? e.date ? e.date : new Date(e.timestamp).toISOString().slice(0, 10) : "?";
1231
+ }
1232
+ function gn(e) {
1233
+ let t = new Date(e);
1234
+ return `${t.getFullYear()}${String(t.getMonth() + 1).padStart(2, "0")}${String(t.getDate()).padStart(2, "0")}`;
1235
+ }
1236
+ function _n(e) {
1237
+ let t = e.trim().split(/[-/]/);
1238
+ return t.length === 3 ? `${t[0].padStart(4, "0")}-${t[1].padStart(2, "0")}-${t[2].padStart(2, "0")}` : null;
1239
+ }
1240
+ function vn(e) {
1241
+ if (e == null) return "";
1242
+ let t = String(e);
1243
+ return /[",\r\n]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
1244
+ }
1245
+ function yn(e) {
1246
+ let t = _n(e);
1247
+ if (!t) return null;
1248
+ let n = new Date(t);
1249
+ return isNaN(n.getTime()) ? null : n.getTime();
1250
+ }
1251
+ function bn(e) {
1252
+ let { controller: t, activeToolId: n, containerRef: i, dataVersion: a, viewportVersion: o, dataFetcher: s, batchStockCodes: c } = e, l = T(0), u = T(""), d = T(""), f = T(null), p = T(null), m = T({
1253
+ startTimestamp: null,
1254
+ endTimestamp: null,
1255
+ isDragging: !1
1256
+ }), h = r(() => n.value === "range-select"), g = r(() => m.value.startTimestamp !== null && m.value.endTimestamp !== null), _ = r(() => {
1257
+ a.value;
1258
+ let e = t.value?.getData() ?? [], { startTimestamp: n, endTimestamp: r } = m.value;
1259
+ if (n === null || r === null || e.length === 0) return null;
1260
+ let i = mn(e, n, "left"), o = mn(e, r, "right");
1261
+ return i === null || o === null ? null : {
1262
+ start: Math.min(i, o),
1263
+ end: Math.max(i, o)
1264
+ };
1265
+ }), v = r(() => {
1266
+ let e = _.value, n = t.value?.getData() ?? [];
1267
+ return !e || n.length === 0 ? "" : hn(n[e.start]);
1268
+ }), y = r(() => {
1269
+ let e = _.value, n = t.value?.getData() ?? [];
1270
+ return !e || n.length === 0 ? "" : hn(n[e.end]);
1271
+ }), b = r(() => {
1272
+ let e = _.value;
1273
+ return e ? e.end - e.start + 1 : 0;
1274
+ }), x = r(() => {
1275
+ let e = _.value;
1276
+ if (!e) return null;
1277
+ l.value, o.value;
1278
+ let n = t.value, r = n?.getViewport(), a = i.value;
1279
+ if (!n || !r || !a) return null;
1280
+ let s = fn(e, n, a, r);
1281
+ return {
1282
+ left: `${s.left}px`,
1283
+ width: `${s.width}px`,
1284
+ height: `${s.height}px`
1285
+ };
1286
+ });
1287
+ function S() {
1288
+ m.value = {
1289
+ startTimestamp: null,
1290
+ endTimestamp: null,
1291
+ isDragging: !1
1292
+ }, u.value = "", d.value = "";
1293
+ }
1294
+ P(u, (e) => {
1295
+ let n = t.value?.getData() ?? [], r = yn(e);
1296
+ r === null || n.length === 0 || (m.value = {
1297
+ ...m.value,
1298
+ startTimestamp: r,
1299
+ isDragging: !1
1300
+ }, r < n[0].timestamp && t.value?.ensureDataRange(r));
1301
+ }), P(d, (e) => {
1302
+ let n = t.value?.getData() ?? [], r = yn(e);
1303
+ r === null || n.length === 0 || (m.value = {
1304
+ ...m.value,
1305
+ endTimestamp: r,
1306
+ isDragging: !1
1307
+ }, r < n[0].timestamp && t.value?.ensureDataRange(r));
1308
+ });
1309
+ function C(e, n) {
1310
+ let r = t.value?.getData() ?? [];
1311
+ if (r.length === 0) return null;
1312
+ let i = n.getBoundingClientRect(), a = t.value?.getLogicalIndexAtX(e.clientX - i.left);
1313
+ return a == null ? null : Math.max(0, Math.min(a, r.length - 1));
1314
+ }
1315
+ function w(e, n) {
1316
+ if (!h.value || m.value.startTimestamp !== null && m.value.endTimestamp !== null && !m.value.isDragging) return !1;
1317
+ let r = C(e, n);
1318
+ if (r === null) return !0;
1319
+ let i = (t.value?.getData() ?? [])[r]?.timestamp;
1320
+ return i === void 0 ? !0 : (m.value = {
1321
+ startTimestamp: i,
1322
+ endTimestamp: i,
1323
+ isDragging: !0
1324
+ }, u.value = "", d.value = "", n.setPointerCapture?.(e.pointerId), e.preventDefault(), !0);
1325
+ }
1326
+ function E(e, n) {
1327
+ if (!h.value || !m.value.isDragging) return !1;
1328
+ let r = C(e, n);
1329
+ if (r !== null) {
1330
+ let e = (t.value?.getData() ?? [])[r]?.timestamp;
1331
+ e !== void 0 && (m.value = {
1332
+ ...m.value,
1333
+ endTimestamp: e
1334
+ });
1335
+ }
1336
+ return e.preventDefault(), !0;
1337
+ }
1338
+ function D(e, n) {
1339
+ if (!h.value || !m.value.isDragging) return !1;
1340
+ let r = C(e, n);
1341
+ if (r !== null) {
1342
+ let e = (t.value?.getData() ?? [])[r]?.timestamp;
1343
+ e === void 0 ? m.value = {
1344
+ ...m.value,
1345
+ isDragging: !1
1346
+ } : m.value = {
1347
+ ...m.value,
1348
+ endTimestamp: e,
1349
+ isDragging: !1
1350
+ };
1351
+ } else m.value = {
1352
+ ...m.value,
1353
+ isDragging: !1
1354
+ };
1355
+ return n.releasePointerCapture?.(e.pointerId), e.preventDefault(), !0;
1356
+ }
1357
+ function O(e, t) {
1358
+ h.value && (f.value = e, t.currentTarget.setPointerCapture?.(t.pointerId), t.preventDefault());
1359
+ }
1360
+ function k(e) {
1361
+ if (!f.value || m.value.startTimestamp === null || m.value.endTimestamp === null) return;
1362
+ let n = i.value?.getBoundingClientRect();
1363
+ if (!n) return;
1364
+ let r = t.value?.getData() ?? [];
1365
+ if (!r.length) return;
1366
+ let a = t.value?.getLogicalIndexAtX(e.clientX - n.left);
1367
+ if (a == null) return;
1368
+ let o = r[Math.max(0, Math.min(a, r.length - 1))]?.timestamp;
1369
+ o !== void 0 && (f.value === "left" ? o > m.value.endTimestamp ? (m.value = {
1370
+ startTimestamp: m.value.endTimestamp,
1371
+ endTimestamp: o,
1372
+ isDragging: !1
1373
+ }, f.value = "right") : m.value = {
1374
+ ...m.value,
1375
+ startTimestamp: o
1376
+ } : o < m.value.startTimestamp ? (m.value = {
1377
+ startTimestamp: o,
1378
+ endTimestamp: m.value.startTimestamp,
1379
+ isDragging: !1
1380
+ }, f.value = "left") : m.value = {
1381
+ ...m.value,
1382
+ endTimestamp: o
1383
+ });
1384
+ }
1385
+ function A(e) {
1386
+ f.value &&= (e.currentTarget.releasePointerCapture?.(e.pointerId), null);
1387
+ }
1388
+ let j = [
1389
+ "timestamp",
1390
+ "open",
1391
+ "high",
1392
+ "low",
1393
+ "close",
1394
+ "volume",
1395
+ "turnover",
1396
+ "turnoverRate",
1397
+ "amplitude",
1398
+ "changePercent",
1399
+ "changeAmount"
1400
+ ];
1401
+ function M(e, t, n, r) {
1402
+ let i = [`stockCode,time,${j.join(",")}`, ...e.map((e) => {
1403
+ let n = vn(V(e.timestamp, { showTime: !0 }));
1404
+ return `${vn(e.stockCode ?? t)},${n},${j.map((t) => vn(e[t])).join(",")}`;
1405
+ })], a = new Blob([`\uFEFF${i.join("\n")}`], { type: "text/csv;charset=utf-8" }), o = URL.createObjectURL(a), s = document.createElement("a");
1406
+ s.href = o, s.download = `${t}-${gn(n)}-${gn(r)}.csv`, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(o);
1407
+ }
1408
+ async function N() {
1409
+ let e = _.value, n = t.value?.getData() ?? [];
1410
+ if (!e || n.length === 0) return;
1411
+ let r = n[e.start].timestamp, i = n[e.end].timestamp, a = t.value?.symbols.peek()?.[0]?.symbol ?? "unknown", o = c.value, l = 1 + o.length, u = o.length > 0 ? `batch${l}` : a, d = [];
1412
+ p.value = {
1413
+ current: 0,
1414
+ total: l,
1415
+ label: "正在准备主品种数据..."
1416
+ };
1417
+ for (let t of n.slice(e.start, e.end + 1)) d.push(t);
1418
+ p.value = {
1419
+ current: 1,
1420
+ total: l,
1421
+ label: "主品种数据已就绪"
1422
+ };
1423
+ let f = s.value;
1424
+ if (f && o.length > 0) {
1425
+ let e = t.value?.symbols.peek()?.[0], n = V(r), a = V(i), s = e?.period ?? "daily", c = e?.adjust ?? "none", u = e?.exchange, m = e?.source ?? "gotdx";
1426
+ for (let e = 0; e < o.length; e++) {
1427
+ let t = o[e];
1428
+ p.value = {
1429
+ current: 1 + e,
1430
+ total: l,
1431
+ label: `正在获取 ${t}...`
1432
+ };
1433
+ try {
1434
+ let e = await f(m, {
1435
+ symbol: t,
1436
+ startDate: n,
1437
+ endDate: a,
1438
+ period: s,
1439
+ adjust: c,
1440
+ exchange: u
1441
+ });
1442
+ for (let t of e) d.push(t);
1443
+ } catch {
1444
+ continue;
1445
+ }
1446
+ }
1447
+ }
1448
+ p.value = {
1449
+ current: l,
1450
+ total: l,
1451
+ label: "正在生成文件..."
1452
+ }, M(d, u, r, i), p.value = {
1453
+ current: l,
1454
+ total: l,
1455
+ label: "导出完成"
1456
+ };
1457
+ }
1458
+ function F() {
1459
+ let e = i.value;
1460
+ e && (l.value = e.scrollLeft);
1461
+ }
1462
+ function I() {
1463
+ let e = i.value;
1464
+ e && (l.value = e.scrollLeft);
1465
+ }
1466
+ return {
1467
+ rangeSelection: m,
1468
+ customStartDate: u,
1469
+ customEndDate: d,
1470
+ containerScrollLeft: l,
1471
+ isRangeSelectActive: h,
1472
+ rangeSelectionReady: g,
1473
+ rangeSelectionBounds: _,
1474
+ rangeSelectionCount: b,
1475
+ rangeSelectionStartLabel: v,
1476
+ rangeSelectionEndLabel: y,
1477
+ rangeSelectionOverlayStyle: x,
1478
+ clearRangeSelection: S,
1479
+ handleRangePointerDown: w,
1480
+ handleRangePointerMove: E,
1481
+ handleRangePointerUp: D,
1482
+ exportRangeToCsv: N,
1483
+ exportingProgress: p,
1484
+ onEdgePointerDown: O,
1485
+ onEdgePointerMove: k,
1486
+ onEdgePointerUp: A,
1487
+ onScroll: F,
1488
+ syncScrollLeft: I
1489
+ };
1490
+ }
1491
+ //#endregion
1492
+ //#region ~icons/tabler/pointer
1493
+ var xn = {
769
1494
  viewBox: "0 0 24 24",
770
1495
  width: "1.2em",
771
1496
  height: "1.2em"
772
1497
  };
773
- function $t(e, t) {
774
- return S(), o("svg", Qt, [...t[0] ||= [s("path", {
1498
+ function Sn(e, t) {
1499
+ return C(), o("svg", xn, [...t[0] ||= [s("path", {
775
1500
  fill: "none",
776
1501
  stroke: "currentColor",
777
1502
  "stroke-linecap": "round",
@@ -780,16 +1505,16 @@ function $t(e, t) {
780
1505
  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"
781
1506
  }, null, -1)]]);
782
1507
  }
783
- var en = m({
1508
+ var Cn = h({
784
1509
  name: "tabler-pointer",
785
- render: $t
786
- }), tn = {
1510
+ render: Sn
1511
+ }), wn = {
787
1512
  viewBox: "0 0 24 24",
788
1513
  width: "1.2em",
789
1514
  height: "1.2em"
790
1515
  };
791
- function nn(e, t) {
792
- return S(), o("svg", tn, [...t[0] ||= [s("path", {
1516
+ function Tn(e, t) {
1517
+ return C(), o("svg", wn, [...t[0] ||= [s("path", {
793
1518
  fill: "none",
794
1519
  stroke: "currentColor",
795
1520
  "stroke-linecap": "round",
@@ -798,16 +1523,16 @@ function nn(e, t) {
798
1523
  d: "M4 19h16M4 15l4-6l4 2l4-5l4 4"
799
1524
  }, null, -1)]]);
800
1525
  }
801
- var rn = m({
1526
+ var En = h({
802
1527
  name: "tabler-chart-line",
803
- render: nn
804
- }), an = {
1528
+ render: Tn
1529
+ }), Dn = {
805
1530
  viewBox: "0 0 24 24",
806
1531
  width: "1.2em",
807
1532
  height: "1.2em"
808
1533
  };
809
- function on(e, t) {
810
- return S(), o("svg", an, [...t[0] ||= [s("path", {
1534
+ function On(e, t) {
1535
+ return C(), o("svg", Dn, [...t[0] ||= [s("path", {
811
1536
  fill: "none",
812
1537
  stroke: "currentColor",
813
1538
  "stroke-linecap": "round",
@@ -816,16 +1541,16 @@ function on(e, t) {
816
1541
  d: "M17 7L7 17M8 7h9v9"
817
1542
  }, null, -1)]]);
818
1543
  }
819
- var sn = m({
1544
+ var kn = h({
820
1545
  name: "tabler-arrow-up-right",
821
- render: on
822
- }), cn = {
1546
+ render: On
1547
+ }), An = {
823
1548
  viewBox: "0 0 24 24",
824
1549
  width: "1.2em",
825
1550
  height: "1.2em"
826
1551
  };
827
- function ln(e, t) {
828
- return S(), o("svg", cn, [...t[0] ||= [s("path", {
1552
+ function jn(e, t) {
1553
+ return C(), o("svg", An, [...t[0] ||= [s("path", {
829
1554
  fill: "none",
830
1555
  stroke: "currentColor",
831
1556
  "stroke-linecap": "round",
@@ -834,16 +1559,16 @@ function ln(e, t) {
834
1559
  d: "M5 12h14m-6 6l6-6m-6-6l6 6"
835
1560
  }, null, -1)]]);
836
1561
  }
837
- var un = m({
1562
+ var Mn = h({
838
1563
  name: "tabler-arrow-right",
839
- render: ln
840
- }), dn = {
1564
+ render: jn
1565
+ }), Nn = {
841
1566
  viewBox: "0 0 24 24",
842
1567
  width: "1.2em",
843
1568
  height: "1.2em"
844
1569
  };
845
- function fn(e, t) {
846
- return S(), o("svg", dn, [...t[0] ||= [s("path", {
1570
+ function Pn(e, t) {
1571
+ return C(), o("svg", Nn, [...t[0] ||= [s("path", {
847
1572
  fill: "none",
848
1573
  stroke: "currentColor",
849
1574
  "stroke-linecap": "round",
@@ -852,16 +1577,16 @@ function fn(e, t) {
852
1577
  d: "M5 12h14"
853
1578
  }, null, -1)]]);
854
1579
  }
855
- var pn = m({
1580
+ var Fn = h({
856
1581
  name: "tabler-minus",
857
- render: fn
858
- }), mn = {
1582
+ render: Pn
1583
+ }), In = {
859
1584
  viewBox: "0 0 24 24",
860
1585
  width: "1.2em",
861
1586
  height: "1.2em"
862
1587
  };
863
- function hn(e, t) {
864
- return S(), o("svg", mn, [...t[0] ||= [s("path", {
1588
+ function Ln(e, t) {
1589
+ return C(), o("svg", In, [...t[0] ||= [s("path", {
865
1590
  fill: "none",
866
1591
  stroke: "currentColor",
867
1592
  "stroke-linecap": "round",
@@ -870,16 +1595,16 @@ function hn(e, t) {
870
1595
  d: "M3 12v.01M7 12h10m4 0v.01"
871
1596
  }, null, -1)]]);
872
1597
  }
873
- var gn = m({
1598
+ var Rn = h({
874
1599
  name: "tabler-separator",
875
- render: hn
876
- }), _n = {
1600
+ render: Ln
1601
+ }), zn = {
877
1602
  viewBox: "0 0 24 24",
878
1603
  width: "1.2em",
879
1604
  height: "1.2em"
880
1605
  };
881
- function vn(e, t) {
882
- return S(), o("svg", _n, [...t[0] ||= [s("path", {
1606
+ function Bn(e, t) {
1607
+ return C(), o("svg", zn, [...t[0] ||= [s("path", {
883
1608
  fill: "none",
884
1609
  stroke: "currentColor",
885
1610
  "stroke-linecap": "round",
@@ -888,16 +1613,16 @@ function vn(e, t) {
888
1613
  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"
889
1614
  }, null, -1)]]);
890
1615
  }
891
- var yn = m({
1616
+ var Vn = h({
892
1617
  name: "tabler-crosshair",
893
- render: vn
894
- }), bn = {
1618
+ render: Bn
1619
+ }), Hn = {
895
1620
  viewBox: "0 0 24 24",
896
1621
  width: "1.2em",
897
1622
  height: "1.2em"
898
1623
  };
899
- function xn(e, t) {
900
- return S(), o("svg", bn, [...t[0] ||= [s("g", {
1624
+ function Un(e, t) {
1625
+ return C(), o("svg", Hn, [...t[0] ||= [s("g", {
901
1626
  fill: "none",
902
1627
  stroke: "currentColor",
903
1628
  "stroke-linecap": "round",
@@ -905,16 +1630,16 @@ function xn(e, t) {
905
1630
  "stroke-width": "2"
906
1631
  }, [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)]]);
907
1632
  }
908
- var Sn = m({
1633
+ var Wn = h({
909
1634
  name: "tabler-info-circle",
910
- render: xn
911
- }), Cn = {
1635
+ render: Un
1636
+ }), Gn = {
912
1637
  viewBox: "0 0 24 24",
913
1638
  width: "1.2em",
914
1639
  height: "1.2em"
915
1640
  };
916
- function wn(e, t) {
917
- return S(), o("svg", Cn, [...t[0] ||= [s("path", {
1641
+ function Kn(e, t) {
1642
+ return C(), o("svg", Gn, [...t[0] ||= [s("path", {
918
1643
  fill: "none",
919
1644
  stroke: "currentColor",
920
1645
  "stroke-linecap": "round",
@@ -923,16 +1648,16 @@ function wn(e, t) {
923
1648
  d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m-3-3v6m11 8l-6-6"
924
1649
  }, null, -1)]]);
925
1650
  }
926
- var Tn = m({
1651
+ var qn = h({
927
1652
  name: "tabler-zoom-in",
928
- render: wn
929
- }), En = {
1653
+ render: Kn
1654
+ }), Jn = {
930
1655
  viewBox: "0 0 24 24",
931
1656
  width: "1.2em",
932
1657
  height: "1.2em"
933
1658
  };
934
- function Dn(e, t) {
935
- return S(), o("svg", En, [...t[0] ||= [s("path", {
1659
+ function Yn(e, t) {
1660
+ return C(), o("svg", Jn, [...t[0] ||= [s("path", {
936
1661
  fill: "none",
937
1662
  stroke: "currentColor",
938
1663
  "stroke-linecap": "round",
@@ -941,16 +1666,16 @@ function Dn(e, t) {
941
1666
  d: "M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m8 11l-6-6"
942
1667
  }, null, -1)]]);
943
1668
  }
944
- var On = m({
1669
+ var Xn = h({
945
1670
  name: "tabler-zoom-out",
946
- render: Dn
947
- }), kn = {
1671
+ render: Yn
1672
+ }), Zn = {
948
1673
  viewBox: "0 0 24 24",
949
1674
  width: "1.2em",
950
1675
  height: "1.2em"
951
1676
  };
952
- function An(e, t) {
953
- return S(), o("svg", kn, [...t[0] ||= [s("path", {
1677
+ function Qn(e, t) {
1678
+ return C(), o("svg", Zn, [...t[0] ||= [s("path", {
954
1679
  fill: "none",
955
1680
  stroke: "currentColor",
956
1681
  "stroke-linecap": "round",
@@ -959,16 +1684,16 @@ function An(e, t) {
959
1684
  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"
960
1685
  }, null, -1)]]);
961
1686
  }
962
- var jn = m({
1687
+ var $n = h({
963
1688
  name: "tabler-maximize",
964
- render: An
965
- }), Mn = {
1689
+ render: Qn
1690
+ }), er = {
966
1691
  viewBox: "0 0 24 24",
967
1692
  width: "1.2em",
968
1693
  height: "1.2em"
969
1694
  };
970
- function Nn(e, t) {
971
- return S(), o("svg", Mn, [...t[0] ||= [s("path", {
1695
+ function tr(e, t) {
1696
+ return C(), o("svg", er, [...t[0] ||= [s("path", {
972
1697
  fill: "none",
973
1698
  stroke: "currentColor",
974
1699
  "stroke-linecap": "round",
@@ -977,16 +1702,16 @@ function Nn(e, t) {
977
1702
  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"
978
1703
  }, null, -1)]]);
979
1704
  }
980
- var Pn = m({
1705
+ var nr = h({
981
1706
  name: "tabler-minimize",
982
- render: Nn
983
- }), Fn = {
1707
+ render: tr
1708
+ }), rr = {
984
1709
  viewBox: "0 0 24 24",
985
1710
  width: "1.2em",
986
1711
  height: "1.2em"
987
1712
  };
988
- function In(e, t) {
989
- return S(), o("svg", Fn, [...t[0] ||= [s("g", {
1713
+ function ir(e, t) {
1714
+ return C(), o("svg", rr, [...t[0] ||= [s("g", {
990
1715
  fill: "none",
991
1716
  stroke: "currentColor",
992
1717
  "stroke-linecap": "round",
@@ -994,16 +1719,16 @@ function In(e, t) {
994
1719
  "stroke-width": "2"
995
1720
  }, [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)]]);
996
1721
  }
997
- var Ln = m({
1722
+ var ar = h({
998
1723
  name: "tabler-settings",
999
- render: In
1000
- }), Rn = {
1724
+ render: ir
1725
+ }), or = {
1001
1726
  viewBox: "0 0 24 24",
1002
1727
  width: "1.2em",
1003
1728
  height: "1.2em"
1004
1729
  };
1005
- function zn(e, t) {
1006
- return S(), o("svg", Rn, [...t[0] ||= [s("path", {
1730
+ function sr(e, t) {
1731
+ return C(), o("svg", or, [...t[0] ||= [s("path", {
1007
1732
  fill: "none",
1008
1733
  stroke: "currentColor",
1009
1734
  "stroke-linecap": "round",
@@ -1012,16 +1737,16 @@ function zn(e, t) {
1012
1737
  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"
1013
1738
  }, null, -1)]]);
1014
1739
  }
1015
- var Bn = m({
1740
+ var cr = h({
1016
1741
  name: "tabler-shape",
1017
- render: zn
1018
- }), Vn = {
1742
+ render: sr
1743
+ }), lr = {
1019
1744
  viewBox: "0 0 24 24",
1020
1745
  width: "1.2em",
1021
1746
  height: "1.2em"
1022
1747
  };
1023
- function Hn(e, t) {
1024
- return S(), o("svg", Vn, [...t[0] ||= [s("path", {
1748
+ function ur(e, t) {
1749
+ return C(), o("svg", lr, [...t[0] ||= [s("path", {
1025
1750
  fill: "none",
1026
1751
  stroke: "currentColor",
1027
1752
  "stroke-linecap": "round",
@@ -1030,16 +1755,16 @@ function Hn(e, t) {
1030
1755
  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"
1031
1756
  }, null, -1)]]);
1032
1757
  }
1033
- var Un = m({
1758
+ var dr = h({
1034
1759
  name: "tabler-chart-dots-3",
1035
- render: Hn
1036
- }), Wn = {
1760
+ render: ur
1761
+ }), fr = {
1037
1762
  viewBox: "0 0 24 24",
1038
1763
  width: "1.2em",
1039
1764
  height: "1.2em"
1040
1765
  };
1041
- function Gn(e, t) {
1042
- return S(), o("svg", Wn, [...t[0] ||= [s("path", {
1766
+ function pr(e, t) {
1767
+ return C(), o("svg", fr, [...t[0] ||= [s("path", {
1043
1768
  fill: "none",
1044
1769
  stroke: "currentColor",
1045
1770
  "stroke-linecap": "round",
@@ -1048,16 +1773,16 @@ function Gn(e, t) {
1048
1773
  d: "m18 10l-6-6l-6 6zm0 4l-6 6l-6-6z"
1049
1774
  }, null, -1)]]);
1050
1775
  }
1051
- var Kn = m({
1776
+ var mr = h({
1052
1777
  name: "tabler-caret-up-down",
1053
- render: Gn
1054
- }), qn = {
1778
+ render: pr
1779
+ }), hr = {
1055
1780
  viewBox: "0 0 24 24",
1056
1781
  width: "1.2em",
1057
1782
  height: "1.2em"
1058
1783
  };
1059
- function Jn(e, t) {
1060
- return S(), o("svg", qn, [...t[0] ||= [s("path", {
1784
+ function gr(e, t) {
1785
+ return C(), o("svg", hr, [...t[0] ||= [s("path", {
1061
1786
  fill: "none",
1062
1787
  stroke: "currentColor",
1063
1788
  "stroke-linecap": "round",
@@ -1066,34 +1791,52 @@ function Jn(e, t) {
1066
1791
  d: "M8 4H5v16h3m8-16h3v16h-3"
1067
1792
  }, null, -1)]]);
1068
1793
  }
1069
- var Yn = m({
1794
+ var _r = h({
1070
1795
  name: "tabler-brackets",
1071
- render: Jn
1796
+ render: gr
1797
+ }), vr = {
1798
+ viewBox: "0 0 24 24",
1799
+ width: "1.2em",
1800
+ height: "1.2em"
1801
+ };
1802
+ function yr(e, t) {
1803
+ return C(), o("svg", vr, [...t[0] ||= [s("path", {
1804
+ fill: "none",
1805
+ stroke: "currentColor",
1806
+ "stroke-linecap": "round",
1807
+ "stroke-linejoin": "round",
1808
+ "stroke-width": "2",
1809
+ d: "m7 8l-4 4l4 4m10-8l4 4l-4 4M3 12h18"
1810
+ }, null, -1)]]);
1811
+ }
1812
+ var br = h({
1813
+ name: "tabler-arrows-horizontal",
1814
+ render: yr
1072
1815
  });
1073
1816
  //#endregion
1074
1817
  //#region src/debug/canvasProfiler.ts
1075
- function Xn() {
1818
+ function xr() {
1076
1819
  return Object.create(null);
1077
1820
  }
1078
- function Zn() {
1821
+ function Sr() {
1079
1822
  return {
1080
- ctxMethods: Xn(),
1081
- ctxProps: Xn(),
1082
- canvasProps: Xn(),
1823
+ ctxMethods: xr(),
1824
+ ctxProps: xr(),
1825
+ canvasProps: xr(),
1083
1826
  ctxMethodSources: Object.create(null)
1084
1827
  };
1085
1828
  }
1086
- function Qn(e, t, n) {
1829
+ function Cr(e, t, n) {
1087
1830
  let r = e[t] ??= {
1088
1831
  count: 0,
1089
1832
  totalTime: 0
1090
1833
  };
1091
1834
  r.count += 1, r.totalTime += n;
1092
1835
  }
1093
- function $n(e, t, n, r) {
1094
- Qn(e.ctxMethodSources[t] ??= Xn(), n, r);
1836
+ function wr(e, t, n, r) {
1837
+ Cr(e.ctxMethodSources[t] ??= xr(), n, r);
1095
1838
  }
1096
- function er(e) {
1839
+ function Tr(e) {
1097
1840
  return Object.entries(e).filter(([, e]) => e.count > 0).map(([e, t]) => ({
1098
1841
  name: e,
1099
1842
  count: t.count,
@@ -1101,12 +1844,12 @@ function er(e) {
1101
1844
  averageTime: (t.totalTime / t.count).toFixed(4)
1102
1845
  })).sort((e, t) => Number(t.totalTime) - Number(e.totalTime));
1103
1846
  }
1104
- var tr = !1, nr = /* @__PURE__ */ new Map(), rr = /* @__PURE__ */ new Map();
1105
- function ir(e) {
1106
- tr = e, e ? typeof window < "u" && !window.__KMAP_CANVAS_PROFILER_INSTALLED__ && sr() : cr();
1847
+ var Er = !1, Dr = /* @__PURE__ */ new Map(), Or = /* @__PURE__ */ new Map();
1848
+ function kr(e) {
1849
+ Er = e, e ? typeof window < "u" && !window.__KMAP_CANVAS_PROFILER_INSTALLED__ && Mr() : Nr();
1107
1850
  }
1108
- function ar() {
1109
- if (!tr) return "disabled";
1851
+ function Ar() {
1852
+ if (!Er) return "disabled";
1110
1853
  let e = (/* @__PURE__ */ Error()).stack;
1111
1854
  if (!e) return "unknown";
1112
1855
  let t = e.split("\n").map((e) => e.trim()).filter(Boolean);
@@ -1121,264 +1864,255 @@ function ar() {
1121
1864
  }
1122
1865
  function Q(e, t, n, r) {
1123
1866
  let i = `${e.constructor?.name ?? "proto"}:${t}`;
1124
- if (nr.has(i)) return;
1867
+ if (Dr.has(i)) return;
1125
1868
  let a = Reflect.get(e, t);
1126
- typeof a == "function" && (nr.set(i, a), Reflect.set(e, t, function(...e) {
1127
- if (!tr) return a.apply(this, e);
1128
- let i = r?.captureSource ? ar() : null, o = performance.now(), s = a.apply(this, e), c = performance.now() - o;
1129
- return Qn(n.ctxMethods, t, c), i && $n(n, t, i, c), s;
1869
+ typeof a == "function" && (Dr.set(i, a), Reflect.set(e, t, function(...e) {
1870
+ if (!Er) return a.apply(this, e);
1871
+ let i = r?.captureSource ? Ar() : null, o = performance.now(), s = a.apply(this, e), c = performance.now() - o;
1872
+ return Cr(n.ctxMethods, t, c), i && wr(n, t, i, c), s;
1130
1873
  }));
1131
1874
  }
1132
- function or(e, t, n) {
1875
+ function jr(e, t, n) {
1133
1876
  let r = Object.getOwnPropertyDescriptor(e, t);
1134
1877
  if (!r?.set || !r.configurable) return;
1135
1878
  let i = `${e.constructor?.name ?? "proto"}:${t}`;
1136
- rr.has(i) || (rr.set(i, r), Object.defineProperty(e, t, {
1879
+ Or.has(i) || (Or.set(i, r), Object.defineProperty(e, t, {
1137
1880
  configurable: !0,
1138
1881
  enumerable: r.enumerable ?? !1,
1139
1882
  get: r.get,
1140
1883
  set(e) {
1141
- if (!tr) {
1884
+ if (!Er) {
1142
1885
  r.set.call(this, e);
1143
1886
  return;
1144
1887
  }
1145
1888
  let i = performance.now();
1146
- r.set.call(this, e), Qn(n, t, performance.now() - i);
1889
+ r.set.call(this, e), Cr(n, t, performance.now() - i);
1147
1890
  }
1148
1891
  }));
1149
1892
  }
1150
- function sr() {
1893
+ function Mr() {
1151
1894
  if (typeof window > "u" || window.__KMAP_CANVAS_PROFILER_INSTALLED__) return;
1152
1895
  let e = CanvasRenderingContext2D?.prototype, t = HTMLCanvasElement?.prototype;
1153
1896
  if (!e || !t) return;
1154
- let n = Zn();
1155
- 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), or(e, "font", n.ctxProps), or(e, "filter", n.ctxProps), or(e, "shadowBlur", n.ctxProps), or(e, "lineWidth", n.ctxProps), or(t, "width", n.canvasProps), or(t, "height", n.canvasProps), window.__KMAP_CANVAS_PROFILER_METRICS__ = n, window.__KMAP_CANVAS_PROFILER_INSTALLED__ = !0, window.showCanvasReport = () => {
1897
+ let n = Sr();
1898
+ 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), jr(e, "font", n.ctxProps), jr(e, "filter", n.ctxProps), jr(e, "shadowBlur", n.ctxProps), jr(e, "lineWidth", n.ctxProps), jr(t, "width", n.canvasProps), jr(t, "height", n.canvasProps), window.__KMAP_CANVAS_PROFILER_METRICS__ = n, window.__KMAP_CANVAS_PROFILER_INSTALLED__ = !0, window.showCanvasReport = () => {
1156
1899
  let e = window.__KMAP_CANVAS_PROFILER_METRICS__;
1157
1900
  if (e) {
1158
- console.group("[kmap] Canvas profiler report"), console.log("ctx methods"), console.table(er(e.ctxMethods)), console.log("ctx props"), console.table(er(e.ctxProps)), console.log("canvas props"), console.table(er(e.canvasProps));
1901
+ console.group("[kmap] Canvas profiler report"), console.log("ctx methods"), console.table(Tr(e.ctxMethods)), console.log("ctx props"), console.table(Tr(e.ctxProps)), console.log("canvas props"), console.table(Tr(e.canvasProps));
1159
1902
  for (let t of ["fillText", "measureText"]) {
1160
1903
  let n = e.ctxMethodSources[t];
1161
- n && (console.log(`${t} sources`), console.table(er(n).slice(0, 20)));
1904
+ n && (console.log(`${t} sources`), console.table(Tr(n).slice(0, 20)));
1162
1905
  }
1163
1906
  console.groupEnd();
1164
1907
  }
1165
1908
  }, window.resetCanvasReport = () => {
1166
- window.__KMAP_CANVAS_PROFILER_METRICS__ = Zn();
1909
+ window.__KMAP_CANVAS_PROFILER_METRICS__ = Sr();
1167
1910
  }, console.info("[kmap] Canvas profiler enabled. Use window.showCanvasReport() and window.resetCanvasReport().");
1168
1911
  }
1169
- function cr() {
1912
+ function Nr() {
1170
1913
  if (typeof window > "u" || !window.__KMAP_CANVAS_PROFILER_INSTALLED__) return;
1171
1914
  let e = CanvasRenderingContext2D?.prototype, t = HTMLCanvasElement?.prototype;
1172
- nr.forEach((n, r) => {
1915
+ Dr.forEach((n, r) => {
1173
1916
  let i = r.match(/^(.+):(.+)$/);
1174
1917
  if (!i) return;
1175
1918
  let [, a, o] = i, s = null;
1176
1919
  a === "CanvasRenderingContext2D" ? s = e : a === "HTMLCanvasElement" && (s = t), s && Reflect.set(s, o, n);
1177
- }), nr.clear(), rr.forEach((n, r) => {
1920
+ }), Dr.clear(), Or.forEach((n, r) => {
1178
1921
  let i = r.match(/^(.+):(.+)$/);
1179
1922
  if (!i) return;
1180
1923
  let [, a, o] = i, s = null;
1181
1924
  a === "CanvasRenderingContext2D" ? s = e : a === "HTMLCanvasElement" && (s = t), s && n.configurable && Object.defineProperty(s, o, n);
1182
- }), rr.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.");
1925
+ }), Or.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.");
1183
1926
  }
1184
1927
  //#endregion
1185
1928
  //#region src/components/ChartSettingsDialog.vue?vue&type=script&setup=true&lang.ts
1186
- var lr = { class: "settings-body" }, ur = { class: "settings-label" }, dr = ["onUpdate:modelValue"], fr = { class: "settings-label" }, pr = ["onUpdate:modelValue"], mr = { class: "settings-label" }, hr = ["onUpdate:modelValue"], gr = { class: "settings-header" }, _r = { class: "header-right" }, vr = { class: "settings-body" }, yr = /*#__PURE__*/ U(/* @__PURE__ */ u({
1929
+ var Pr = { class: "settings-body" }, Fr = {
1930
+ key: 0,
1931
+ class: "md-switch"
1932
+ }, Ir = ["onUpdate:modelValue"], Lr = {
1933
+ key: 0,
1934
+ class: "md-switch"
1935
+ }, Rr = ["onUpdate:modelValue"], zr = {
1936
+ key: 0,
1937
+ class: "md-switch"
1938
+ }, Br = ["onUpdate:modelValue"], Vr = /*#__PURE__*/ q(/* @__PURE__ */ u({
1187
1939
  __name: "ChartSettingsDialog",
1188
1940
  props: { show: { type: Boolean } },
1189
1941
  emits: ["close", "confirm"],
1190
- setup(u, { emit: d }) {
1191
- let f = u, p = d, m = Fe(), h = r(() => V.filter((e) => e.group === "main")), g = r(() => V.filter((e) => e.group === "experimental")), _ = r(() => V.filter((e) => e.group === "style")), v = w(!1);
1192
- function y() {
1942
+ setup(t, { emit: n }) {
1943
+ let u = t, d = n, f = r(() => W.filter((e) => e.group === "main")), p = r(() => W.filter((e) => e.group === "experimental")), m = r(() => W.filter((e) => e.group === "style")), h = T(!1), g = T(null);
1944
+ function _() {
1193
1945
  try {
1194
- let e = localStorage.getItem(_e);
1946
+ let e = localStorage.getItem(ge);
1195
1947
  if (e) {
1196
1948
  let t = JSON.parse(e), n = {};
1197
- return V.forEach((e) => {
1949
+ return W.forEach((e) => {
1198
1950
  n[e.key] = t[e.key] ?? e.default;
1199
1951
  }), n.colorPresetSettings = ie(t.colorPresetSettings), n;
1200
1952
  }
1201
1953
  } catch {}
1202
1954
  let e = {};
1203
- return V.forEach((t) => {
1955
+ return W.forEach((t) => {
1204
1956
  e[t.key] = t.default;
1205
1957
  }), e.colorPresetSettings = {}, e;
1206
1958
  }
1207
- let b = w(y());
1208
- M(() => f.show, (e) => {
1209
- e && (b.value = y());
1959
+ let v = T(_());
1960
+ P(() => u.show, (e) => {
1961
+ e && (v.value = _());
1210
1962
  });
1211
- function x() {
1212
- p("close");
1963
+ function y() {
1964
+ d("close");
1213
1965
  }
1214
- function C() {
1966
+ function b() {
1215
1967
  let e = {};
1216
- V.forEach((t) => {
1968
+ W.forEach((t) => {
1217
1969
  e[t.key] = t.default;
1218
- }), e.colorPresetSettings = {}, b.value = e;
1970
+ }), e.colorPresetSettings = {}, v.value = e;
1219
1971
  }
1220
- function E() {
1221
- p("confirm", { ...b.value });
1222
- }
1223
- return (r, d) => (S(), i(t, { to: k(m) }, [l(n, { name: "overlay" }, {
1224
- default: N(() => [u.show ? (S(), o("div", {
1225
- key: 0,
1226
- class: "settings-overlay",
1972
+ function x() {
1973
+ d("confirm", { ...v.value });
1974
+ }
1975
+ return (n, r) => (C(), o(e, null, [l(Y, {
1976
+ show: t.show,
1977
+ width: "min(92vw, 460px)",
1978
+ "max-height": "min(720px, calc(100vh - 48px))",
1979
+ "footer-align": "space-between",
1980
+ onClose: y
1981
+ }, {
1982
+ header: F(() => [...r[5] ||= [s("div", { class: "header-left" }, [s("span", { class: "settings-title" }, "图表设置"), s("span", { class: "settings-subtitle" }, "个性化配置")], -1)]]),
1983
+ footer: F(() => [s("button", {
1984
+ class: "settings-btn reset",
1985
+ onClick: b
1986
+ }, [...r[13] ||= [s("svg", {
1987
+ viewBox: "0 0 24 24",
1988
+ fill: "none",
1989
+ stroke: "currentColor",
1990
+ "stroke-width": "2"
1991
+ }, [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", {
1992
+ class: "settings-btn cancel",
1993
+ onClick: y
1994
+ }, "取消"), s("button", {
1995
+ class: "settings-btn confirm",
1227
1996
  onClick: x
1228
- }, [l(n, { name: "modal" }, {
1229
- default: N(() => [s("div", {
1230
- class: "settings-modal",
1231
- onClick: d[1] ||= I(() => {}, ["stop"])
1232
- }, [
1233
- 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", {
1234
- class: "settings-close",
1235
- onClick: x
1236
- }, [...d[6] ||= [s("svg", {
1237
- viewBox: "0 0 24 24",
1238
- fill: "none",
1239
- stroke: "currentColor",
1240
- "stroke-width": "2"
1241
- }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]),
1242
- s("div", lr, [
1243
- h.value.length > 0 ? (S(), o(e, { key: 0 }, [d[8] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "主图设置")], -1), (S(!0), o(e, null, T(h.value, (e) => (S(), o("div", {
1244
- key: e.key,
1245
- class: "settings-item"
1246
- }, [s("label", ur, [s("span", null, O(e.label), 1), e.type === "boolean" ? P((S(), o("input", {
1247
- key: 0,
1248
- type: "checkbox",
1249
- class: "settings-checkbox",
1250
- "onUpdate:modelValue": (t) => b.value[e.key] = t
1251
- }, null, 8, dr)), [[A, b.value[e.key]]]) : e.type === "select" && e.options ? (S(), i(K, {
1252
- key: 1,
1253
- "model-value": String(b.value[e.key]),
1254
- options: e.options,
1255
- size: "sm",
1256
- "min-width": "100px",
1257
- "onUpdate:modelValue": (t) => b.value[e.key] = t
1258
- }, null, 8, [
1259
- "model-value",
1260
- "options",
1261
- "onUpdate:modelValue"
1262
- ])) : a("", !0)])]))), 128))], 64)) : a("", !0),
1263
- d[11] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "样式 / 颜色")], -1),
1264
- (S(!0), o(e, null, T(_.value, (e) => (S(), o("div", {
1265
- key: e.key,
1266
- class: "settings-item"
1267
- }, [s("label", fr, [s("span", null, O(e.label), 1), e.type === "boolean" ? P((S(), o("input", {
1268
- key: 0,
1269
- type: "checkbox",
1270
- class: "settings-checkbox",
1271
- "onUpdate:modelValue": (t) => b.value[e.key] = t
1272
- }, null, 8, pr)), [[A, b.value[e.key]]]) : e.type === "select" && e.options ? (S(), i(K, {
1273
- key: 1,
1274
- "model-value": String(b.value[e.key]),
1275
- options: e.options,
1276
- size: "sm",
1277
- "min-width": "100px",
1278
- "onUpdate:modelValue": (t) => b.value[e.key] = t
1279
- }, null, 8, [
1280
- "model-value",
1281
- "options",
1282
- "onUpdate:modelValue"
1283
- ])) : a("", !0)])]))), 128)),
1284
- s("div", {
1285
- class: "settings-item nav-item",
1286
- onClick: d[0] ||= (e) => v.value = !0
1287
- }, [...d[9] ||= [s("label", { class: "settings-label" }, [s("span", null, "颜色配置"), s("svg", {
1288
- viewBox: "0 0 24 24",
1289
- fill: "none",
1290
- stroke: "currentColor",
1291
- "stroke-width": "2",
1292
- width: "16",
1293
- height: "16",
1294
- class: "nav-arrow"
1295
- }, [s("path", { d: "M9 18l6-6-6-6" })])], -1)]]),
1296
- g.value.length > 0 ? (S(), o(e, { key: 1 }, [d[10] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "实验性 / 调试设置")], -1), (S(!0), o(e, null, T(g.value, (e) => (S(), o("div", {
1297
- key: e.key,
1298
- class: "settings-item experimental"
1299
- }, [s("label", mr, [s("span", null, O(e.label), 1), e.type === "boolean" ? P((S(), o("input", {
1300
- key: 0,
1301
- type: "checkbox",
1302
- class: "settings-checkbox",
1303
- "onUpdate:modelValue": (t) => b.value[e.key] = t
1304
- }, null, 8, hr)), [[A, b.value[e.key]]]) : e.type === "select" && e.options ? (S(), i(K, {
1305
- key: 1,
1306
- "model-value": String(b.value[e.key]),
1307
- options: e.options,
1308
- size: "sm",
1309
- "min-width": "100px",
1310
- "onUpdate:modelValue": (t) => b.value[e.key] = t
1311
- }, null, 8, [
1312
- "model-value",
1313
- "options",
1314
- "onUpdate:modelValue"
1315
- ])) : a("", !0)])]))), 128))], 64)) : a("", !0)
1316
- ]),
1317
- s("div", { class: "settings-footer" }, [s("button", {
1318
- class: "settings-btn reset",
1319
- onClick: C
1320
- }, [...d[12] ||= [s("svg", {
1321
- viewBox: "0 0 24 24",
1322
- fill: "none",
1323
- stroke: "currentColor",
1324
- "stroke-width": "2"
1325
- }, [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", {
1326
- class: "settings-btn cancel",
1327
- onClick: x
1328
- }, "取消"), s("button", {
1329
- class: "settings-btn confirm",
1330
- onClick: E
1331
- }, [...d[13] ||= [s("svg", {
1332
- viewBox: "0 0 24 24",
1333
- fill: "none",
1334
- stroke: "currentColor",
1335
- "stroke-width": "2.5"
1336
- }, [s("path", { d: "M20 6L9 17l-5-5" })], -1), c(" 确定 ", -1)]])])])
1337
- ])]),
1338
- _: 1
1339
- })])) : a("", !0)]),
1340
- _: 1
1341
- }), l(n, { name: "overlay" }, {
1342
- default: N(() => [v.value ? (S(), o("div", {
1343
- key: 0,
1344
- class: "settings-overlay nested-overlay",
1345
- onClick: d[5] ||= (e) => v.value = !1
1346
- }, [l(n, { name: "modal" }, {
1347
- default: N(() => [s("div", {
1348
- class: "settings-modal",
1349
- onClick: d[4] ||= I(() => {}, ["stop"])
1350
- }, [s("div", gr, [d[15] ||= s("div", { class: "header-left" }, [s("span", { class: "settings-title" }, "颜色预设"), s("span", { class: "settings-subtitle" }, "自定义图表颜色")], -1), s("div", _r, [s("button", {
1351
- class: "settings-close",
1352
- onClick: d[2] ||= (e) => v.value = !1
1353
- }, [...d[14] ||= [s("svg", {
1997
+ }, [...r[14] ||= [s("svg", {
1998
+ viewBox: "0 0 24 24",
1999
+ fill: "none",
2000
+ stroke: "currentColor",
2001
+ "stroke-width": "2.5"
2002
+ }, [s("path", { d: "M20 6L9 17l-5-5" })], -1), c(" 确定 ", -1)]])])]),
2003
+ default: F(() => [s("div", Pr, [
2004
+ f.value.length > 0 ? (C(), o(e, { key: 0 }, [r[7] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "主图设置")], -1), (C(!0), o(e, null, E(f.value, (e) => (C(), o("div", {
2005
+ key: e.key,
2006
+ class: "settings-item"
2007
+ }, [s("span", null, A(e.label), 1), e.type === "boolean" ? (C(), o("label", Fr, [I(s("input", {
2008
+ type: "checkbox",
2009
+ "onUpdate:modelValue": (t) => v.value[e.key] = t
2010
+ }, null, 8, Ir), [[M, v.value[e.key]]]), r[6] ||= s("span", { class: "md-switch-slider" }, null, -1)])) : e.type === "select" && e.options ? (C(), i(J, {
2011
+ key: 1,
2012
+ "model-value": String(v.value[e.key]),
2013
+ options: e.options,
2014
+ size: "sm",
2015
+ "min-width": "100px",
2016
+ "onUpdate:modelValue": (t) => v.value[e.key] = t
2017
+ }, null, 8, [
2018
+ "model-value",
2019
+ "options",
2020
+ "onUpdate:modelValue"
2021
+ ])) : a("", !0)]))), 128))], 64)) : a("", !0),
2022
+ r[12] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "样式 / 颜色")], -1),
2023
+ (C(!0), o(e, null, E(m.value, (e) => (C(), o("div", {
2024
+ key: e.key,
2025
+ class: "settings-item"
2026
+ }, [s("span", null, A(e.label), 1), e.type === "boolean" ? (C(), o("label", Lr, [I(s("input", {
2027
+ type: "checkbox",
2028
+ "onUpdate:modelValue": (t) => v.value[e.key] = t
2029
+ }, null, 8, Rr), [[M, v.value[e.key]]]), r[8] ||= s("span", { class: "md-switch-slider" }, null, -1)])) : e.type === "select" && e.options ? (C(), i(J, {
2030
+ key: 1,
2031
+ "model-value": String(v.value[e.key]),
2032
+ options: e.options,
2033
+ size: "sm",
2034
+ "min-width": "100px",
2035
+ "onUpdate:modelValue": (t) => v.value[e.key] = t
2036
+ }, null, 8, [
2037
+ "model-value",
2038
+ "options",
2039
+ "onUpdate:modelValue"
2040
+ ])) : a("", !0)]))), 128)),
2041
+ s("div", {
2042
+ class: "settings-item nav-item",
2043
+ onClick: r[0] ||= (e) => h.value = !0
2044
+ }, [...r[9] ||= [s("span", null, "颜色配置", -1), s("svg", {
1354
2045
  viewBox: "0 0 24 24",
1355
2046
  fill: "none",
1356
2047
  stroke: "currentColor",
1357
- "stroke-width": "2"
1358
- }, [s("path", { d: "M18 6L6 18M6 6l12 12" })], -1)]])])]), s("div", vr, [l(W, {
1359
- "color-preset-settings": b.value.colorPresetSettings,
1360
- "onUpdate:colorPresetSettings": d[3] ||= (e) => b.value = {
1361
- ...b.value,
1362
- colorPresetSettings: e
1363
- }
1364
- }, null, 8, ["color-preset-settings"])])])]),
1365
- _: 1
1366
- })])) : a("", !0)]),
2048
+ "stroke-width": "2",
2049
+ width: "16",
2050
+ height: "16",
2051
+ class: "nav-arrow"
2052
+ }, [s("path", { d: "M9 18l6-6-6-6" })], -1)]]),
2053
+ p.value.length > 0 ? (C(), o(e, { key: 1 }, [r[11] ||= s("div", { class: "settings-section-divider" }, [s("span", { class: "settings-section-label" }, "实验性 / 调试设置")], -1), (C(!0), o(e, null, E(p.value, (e) => (C(), o("div", {
2054
+ key: e.key,
2055
+ class: "settings-item experimental"
2056
+ }, [s("span", null, A(e.label), 1), e.type === "boolean" ? (C(), o("label", zr, [I(s("input", {
2057
+ type: "checkbox",
2058
+ "onUpdate:modelValue": (t) => v.value[e.key] = t
2059
+ }, null, 8, Br), [[M, v.value[e.key]]]), r[10] ||= s("span", { class: "md-switch-slider" }, null, -1)])) : e.type === "select" && e.options ? (C(), i(J, {
2060
+ key: 1,
2061
+ "model-value": String(v.value[e.key]),
2062
+ options: e.options,
2063
+ size: "sm",
2064
+ "min-width": "100px",
2065
+ "onUpdate:modelValue": (t) => v.value[e.key] = t
2066
+ }, null, 8, [
2067
+ "model-value",
2068
+ "options",
2069
+ "onUpdate:modelValue"
2070
+ ])) : a("", !0)]))), 128))], 64)) : a("", !0)
2071
+ ])]),
1367
2072
  _: 1
1368
- })], 8, ["to"]));
2073
+ }, 8, ["show"]), l(Y, {
2074
+ show: h.value,
2075
+ title: "颜色预设",
2076
+ subtitle: "自定义图表颜色",
2077
+ width: "min(92vw, 460px)",
2078
+ "max-height": "min(720px, calc(100vh - 48px))",
2079
+ "z-index": 1100,
2080
+ "footer-align": "space-between",
2081
+ onClose: r[4] ||= (e) => h.value = !1
2082
+ }, {
2083
+ footer: F(() => [s("button", {
2084
+ type: "button",
2085
+ class: "settings-btn reset",
2086
+ onClick: r[2] ||= (e) => g.value?.resetCurrentThemeColors()
2087
+ }, " 重置颜色 "), s("button", {
2088
+ type: "button",
2089
+ class: "settings-btn confirm",
2090
+ onClick: r[3] ||= (e) => h.value = !1
2091
+ }, " 确认 ")]),
2092
+ default: F(() => [l(Ce, {
2093
+ ref_key: "colorPresetPanelRef",
2094
+ ref: g,
2095
+ "color-preset-settings": v.value.colorPresetSettings,
2096
+ "onUpdate:colorPresetSettings": r[1] ||= (e) => v.value = {
2097
+ ...v.value,
2098
+ colorPresetSettings: e
2099
+ }
2100
+ }, null, 8, ["color-preset-settings"])]),
2101
+ _: 1
2102
+ }, 8, ["show"])], 64));
1369
2103
  }
1370
- }), [["__scopeId", "data-v-e04604ac"]]), br = {
2104
+ }), [["__scopeId", "data-v-54c84784"]]), Hr = {
1371
2105
  class: "left-toolbar",
1372
2106
  "aria-label": "图表工具栏"
1373
- }, xr = { class: "left-toolbar__group" }, Sr = [
2107
+ }, Ur = { class: "left-toolbar__group" }, Wr = [
1374
2108
  "title",
1375
2109
  "aria-label",
1376
2110
  "onClick"
1377
- ], Cr = ["onClick"], wr = [
2111
+ ], Gr = ["onClick"], Kr = [
1378
2112
  "title",
1379
2113
  "aria-label",
1380
2114
  "onClick"
1381
- ], Tr = { class: "left-toolbar__group" }, Er = { class: "left-toolbar__group" }, Dr = ["title", "aria-label"], Or = { class: "left-toolbar__group" }, kr = /*#__PURE__*/ U(/* @__PURE__ */ u({
2115
+ ], qr = { class: "left-toolbar__group" }, Jr = { class: "left-toolbar__group" }, Yr = ["title", "aria-label"], Xr = { class: "left-toolbar__group" }, Zr = /*#__PURE__*/ q(/* @__PURE__ */ u({
1382
2116
  __name: "LeftToolbar",
1383
2117
  props: { isFullscreen: { type: Boolean } },
1384
2118
  emits: [
@@ -1393,188 +2127,193 @@ var lr = { class: "settings-body" }, ur = { class: "settings-label" }, dr = ["on
1393
2127
  {
1394
2128
  id: "cursor",
1395
2129
  title: "光标",
1396
- icon: en
2130
+ icon: Cn
1397
2131
  },
1398
2132
  {
1399
2133
  id: "lines",
1400
2134
  title: "线条",
1401
- icon: rn,
2135
+ icon: En,
1402
2136
  children: [
1403
2137
  {
1404
2138
  id: "trend-line",
1405
2139
  title: "线段",
1406
- icon: rn
2140
+ icon: En
1407
2141
  },
1408
2142
  {
1409
2143
  id: "ray",
1410
2144
  title: "射线",
1411
- icon: sn
2145
+ icon: kn
1412
2146
  },
1413
2147
  {
1414
2148
  id: "h-line",
1415
2149
  title: "水平线",
1416
- icon: pn
2150
+ icon: Fn
1417
2151
  },
1418
2152
  {
1419
2153
  id: "h-ray",
1420
2154
  title: "水平射线",
1421
- icon: un
2155
+ icon: Mn
1422
2156
  },
1423
2157
  {
1424
2158
  id: "v-line",
1425
2159
  title: "垂直线",
1426
- icon: gn
2160
+ icon: Rn
1427
2161
  },
1428
2162
  {
1429
2163
  id: "crosshair-line",
1430
2164
  title: "十字线",
1431
- icon: yn
2165
+ icon: Vn
1432
2166
  },
1433
2167
  {
1434
2168
  id: "info-line",
1435
2169
  title: "信息线",
1436
- icon: Sn
2170
+ icon: Wn
1437
2171
  }
1438
2172
  ]
1439
2173
  },
1440
2174
  {
1441
2175
  id: "channels",
1442
2176
  title: "通道",
1443
- icon: Bn,
2177
+ icon: cr,
1444
2178
  children: [
1445
2179
  {
1446
2180
  id: "parallel-channel",
1447
2181
  title: "平行通道",
1448
- icon: Bn
2182
+ icon: cr
1449
2183
  },
1450
2184
  {
1451
2185
  id: "regression-channel",
1452
2186
  title: "回归趋势",
1453
- icon: Un
2187
+ icon: dr
1454
2188
  },
1455
2189
  {
1456
2190
  id: "flat-line",
1457
2191
  title: "平滑顶底",
1458
- icon: Kn
2192
+ icon: mr
1459
2193
  },
1460
2194
  {
1461
2195
  id: "disjoint-channel",
1462
2196
  title: "不相交通道",
1463
- icon: Yn
2197
+ icon: _r
1464
2198
  }
1465
2199
  ]
2200
+ },
2201
+ {
2202
+ id: "range-select",
2203
+ title: "导出区间数据",
2204
+ icon: br
1466
2205
  }
1467
- ], d = c, f = w("cursor"), p = w(null), m = w(!1);
2206
+ ], d = c, f = T("cursor"), p = T(null), m = T(!1);
1468
2207
  function h() {
1469
2208
  try {
1470
- let e = localStorage.getItem(_e);
2209
+ let e = localStorage.getItem(ge);
1471
2210
  if (e) {
1472
2211
  let t = JSON.parse(e), n = { ...t };
1473
- return V.forEach((e) => {
2212
+ return W.forEach((e) => {
1474
2213
  n[e.key] = t[e.key] ?? e.default;
1475
2214
  }), n;
1476
2215
  }
1477
2216
  } catch {}
1478
2217
  let e = {};
1479
- return V.forEach((t) => {
2218
+ return W.forEach((t) => {
1480
2219
  e[t.key] = t.default;
1481
2220
  }), e;
1482
2221
  }
1483
- function _(e) {
2222
+ function g(e) {
1484
2223
  try {
1485
- localStorage.setItem(_e, JSON.stringify(e));
2224
+ localStorage.setItem(ge, JSON.stringify(e));
1486
2225
  } catch {}
1487
2226
  }
1488
- let v = w(h());
1489
- function b(e) {
2227
+ let v = T(h());
2228
+ function y(e) {
1490
2229
  return f.value === e.id ? !0 : e.children ? e.children.some((e) => e.id === f.value) : !1;
1491
2230
  }
1492
- function C(e) {
2231
+ function x(e) {
1493
2232
  if (e.children?.length) {
1494
2233
  if (!e.children.some((e) => e.id === f.value)) {
1495
2234
  let t = e.children[0];
1496
2235
  f.value = t.id, d("selectTool", t.id);
1497
2236
  }
1498
- O(e.id);
2237
+ D(e.id);
1499
2238
  return;
1500
2239
  }
1501
2240
  f.value = e.id, d("selectTool", e.id), p.value = null;
1502
2241
  }
1503
- function D(e) {
2242
+ function w(e) {
1504
2243
  f.value = e.id, d("selectTool", e.id), p.value = null;
1505
2244
  }
1506
- function O(e) {
2245
+ function D(e) {
1507
2246
  p.value = p.value === e ? null : e;
1508
2247
  }
1509
- function A() {
2248
+ function k() {
1510
2249
  m.value = !0;
1511
2250
  }
1512
- function j() {
2251
+ function A() {
1513
2252
  return { ...v.value };
1514
2253
  }
1515
- r({ getSettings: j });
2254
+ r({ getSettings: A });
1516
2255
  function M(e) {
1517
- v.value = { ...e }, _(v.value), ir(!!v.value.enableCanvasProfiler), d("settingsChange", { ...v.value }), m.value = !1;
2256
+ v.value = { ...e }, g(v.value), kr(!!v.value.enableCanvasProfiler), d("settingsChange", { ...v.value }), m.value = !1;
1518
2257
  }
1519
- function P(e) {
2258
+ function N(e) {
1520
2259
  e.target.closest(".tool-item") || (p.value = null);
1521
2260
  }
1522
- return y(() => {
1523
- document.addEventListener("click", P, !0), d("settingsChange", { ...v.value }), ir(!!v.value.enableCanvasProfiler);
1524
- }), x(() => {
1525
- document.removeEventListener("click", P, !0);
1526
- }), (r, c) => (S(), o(e, null, [s("nav", br, [
1527
- s("div", xr, [(S(), o(e, null, T(u, (t) => s("div", {
2261
+ return b(() => {
2262
+ document.addEventListener("click", N, !0), d("settingsChange", { ...v.value }), kr(!!v.value.enableCanvasProfiler);
2263
+ }), S(() => {
2264
+ document.removeEventListener("click", N, !0);
2265
+ }), (r, c) => (C(), o(e, null, [s("nav", Hr, [
2266
+ s("div", Ur, [(C(), o(e, null, E(u, (t) => s("div", {
1528
2267
  key: t.id,
1529
2268
  class: "tool-item"
1530
2269
  }, [s("button", {
1531
2270
  type: "button",
1532
- class: g(["left-toolbar__button", { active: b(t) }]),
2271
+ class: _(["left-toolbar__button", { active: y(t) }]),
1533
2272
  title: t.title,
1534
2273
  "aria-label": t.title,
1535
- onClick: (e) => C(t),
1536
- onPointerdown: c[0] ||= I(() => {}, ["stop"]),
1537
- onPointermove: c[1] ||= I(() => {}, ["stop"]),
1538
- onPointerup: c[2] ||= I(() => {}, ["stop"])
1539
- }, [(S(), i(E(t.icon), {
2274
+ onClick: (e) => x(t),
2275
+ onPointerdown: c[0] ||= R(() => {}, ["stop"]),
2276
+ onPointermove: c[1] ||= R(() => {}, ["stop"]),
2277
+ onPointerup: c[2] ||= R(() => {}, ["stop"])
2278
+ }, [(C(), i(O(t.icon), {
1540
2279
  class: "tool-icon",
1541
2280
  "aria-hidden": "true"
1542
- })), t.children && t.children.length ? (S(), o("span", {
2281
+ })), t.children && t.children.length ? (C(), o("span", {
1543
2282
  key: 0,
1544
- class: g(["corner-indicator", { open: p.value === t.id }]),
1545
- onClick: I((e) => O(t.id), ["stop"]),
2283
+ class: _(["corner-indicator", { open: p.value === t.id }]),
2284
+ onClick: R((e) => D(t.id), ["stop"]),
1546
2285
  "aria-label": "展开子菜单"
1547
- }, null, 10, Cr)) : a("", !0)], 42, Sr), l(n, { name: "dropdown" }, {
1548
- default: N(() => [p.value === t.id && t.children && t.children.length ? (S(), o("div", {
2286
+ }, null, 10, Gr)) : a("", !0)], 42, Wr), l(n, { name: "dropdown" }, {
2287
+ default: F(() => [p.value === t.id && t.children && t.children.length ? (C(), o("div", {
1549
2288
  key: 0,
1550
2289
  class: "tool-dropdown",
1551
- onPointerdown: c[3] ||= I(() => {}, ["stop"]),
1552
- onPointermove: c[4] ||= I(() => {}, ["stop"]),
1553
- onPointerup: c[5] ||= I(() => {}, ["stop"])
1554
- }, [(S(!0), o(e, null, T(t.children, (e) => (S(), o("button", {
2290
+ onPointerdown: c[3] ||= R(() => {}, ["stop"]),
2291
+ onPointermove: c[4] ||= R(() => {}, ["stop"]),
2292
+ onPointerup: c[5] ||= R(() => {}, ["stop"])
2293
+ }, [(C(!0), o(e, null, E(t.children, (e) => (C(), o("button", {
1555
2294
  key: e.id,
1556
2295
  type: "button",
1557
- class: g(["left-toolbar__button", { active: f.value === e.id }]),
2296
+ class: _(["left-toolbar__button", { active: f.value === e.id }]),
1558
2297
  title: e.title,
1559
2298
  "aria-label": e.title,
1560
- onClick: (t) => D(e)
1561
- }, [(S(), i(E(e.icon), {
2299
+ onClick: (t) => w(e)
2300
+ }, [(C(), i(O(e.icon), {
1562
2301
  class: "tool-icon",
1563
2302
  "aria-hidden": "true"
1564
- }))], 10, wr))), 128))], 32)) : a("", !0)]),
2303
+ }))], 10, Kr))), 128))], 32)) : a("", !0)]),
1565
2304
  _: 2
1566
2305
  }, 1024)])), 64))]),
1567
2306
  c[22] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
1568
- s("div", Tr, [s("button", {
2307
+ s("div", qr, [s("button", {
1569
2308
  type: "button",
1570
2309
  class: "left-toolbar__button",
1571
2310
  title: "放大",
1572
2311
  "aria-label": "放大",
1573
2312
  onClick: c[6] ||= (e) => r.$emit("zoomIn"),
1574
- onPointerdown: c[7] ||= I(() => {}, ["stop"]),
1575
- onPointermove: c[8] ||= I(() => {}, ["stop"]),
1576
- onPointerup: c[9] ||= I(() => {}, ["stop"])
1577
- }, [l(k(Tn), {
2313
+ onPointerdown: c[7] ||= R(() => {}, ["stop"]),
2314
+ onPointermove: c[8] ||= R(() => {}, ["stop"]),
2315
+ onPointerup: c[9] ||= R(() => {}, ["stop"])
2316
+ }, [l(j(qn), {
1578
2317
  class: "tool-icon",
1579
2318
  "aria-hidden": "true"
1580
2319
  })], 32), s("button", {
@@ -1583,53 +2322,53 @@ var lr = { class: "settings-body" }, ur = { class: "settings-label" }, dr = ["on
1583
2322
  title: "缩小",
1584
2323
  "aria-label": "缩小",
1585
2324
  onClick: c[10] ||= (e) => r.$emit("zoomOut"),
1586
- onPointerdown: c[11] ||= I(() => {}, ["stop"]),
1587
- onPointermove: c[12] ||= I(() => {}, ["stop"]),
1588
- onPointerup: c[13] ||= I(() => {}, ["stop"])
1589
- }, [l(k(On), {
2325
+ onPointerdown: c[11] ||= R(() => {}, ["stop"]),
2326
+ onPointermove: c[12] ||= R(() => {}, ["stop"]),
2327
+ onPointerup: c[13] ||= R(() => {}, ["stop"])
2328
+ }, [l(j(Xn), {
1590
2329
  class: "tool-icon",
1591
2330
  "aria-hidden": "true"
1592
2331
  })], 32)]),
1593
2332
  c[23] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
1594
- s("div", Er, [s("button", {
2333
+ s("div", Jr, [s("button", {
1595
2334
  type: "button",
1596
2335
  class: "left-toolbar__button",
1597
2336
  title: t.isFullscreen ? "退出全屏" : "全屏显示",
1598
2337
  "aria-label": t.isFullscreen ? "退出全屏" : "全屏显示",
1599
2338
  onClick: c[14] ||= (e) => r.$emit("toggleFullscreen"),
1600
- onPointerdown: c[15] ||= I(() => {}, ["stop"]),
1601
- onPointermove: c[16] ||= I(() => {}, ["stop"]),
1602
- onPointerup: c[17] ||= I(() => {}, ["stop"])
1603
- }, [t.isFullscreen ? (S(), i(k(Pn), {
2339
+ onPointerdown: c[15] ||= R(() => {}, ["stop"]),
2340
+ onPointermove: c[16] ||= R(() => {}, ["stop"]),
2341
+ onPointerup: c[17] ||= R(() => {}, ["stop"])
2342
+ }, [t.isFullscreen ? (C(), i(j(nr), {
1604
2343
  key: 0,
1605
2344
  class: "tool-icon",
1606
2345
  "aria-hidden": "true"
1607
- })) : (S(), i(k(jn), {
2346
+ })) : (C(), i(j($n), {
1608
2347
  key: 1,
1609
2348
  class: "tool-icon",
1610
2349
  "aria-hidden": "true"
1611
- }))], 40, Dr)]),
2350
+ }))], 40, Yr)]),
1612
2351
  c[24] ||= s("span", { class: "left-toolbar__divider" }, null, -1),
1613
- s("div", Or, [s("button", {
2352
+ s("div", Xr, [s("button", {
1614
2353
  type: "button",
1615
2354
  class: "left-toolbar__button",
1616
2355
  title: "设置",
1617
2356
  "aria-label": "设置",
1618
- onClick: A,
1619
- onPointerdown: c[18] ||= I(() => {}, ["stop"]),
1620
- onPointermove: c[19] ||= I(() => {}, ["stop"]),
1621
- onPointerup: c[20] ||= I(() => {}, ["stop"])
1622
- }, [l(k(Ln), {
2357
+ onClick: k,
2358
+ onPointerdown: c[18] ||= R(() => {}, ["stop"]),
2359
+ onPointermove: c[19] ||= R(() => {}, ["stop"]),
2360
+ onPointerup: c[20] ||= R(() => {}, ["stop"])
2361
+ }, [l(j(ar), {
1623
2362
  class: "tool-icon",
1624
2363
  "aria-hidden": "true"
1625
2364
  })], 32)])
1626
- ]), l(yr, {
2365
+ ]), l(Vr, {
1627
2366
  show: m.value,
1628
2367
  onClose: c[21] ||= (e) => m.value = !1,
1629
2368
  onConfirm: M
1630
2369
  }, null, 8, ["show"])], 64));
1631
2370
  }
1632
- }), [["__scopeId", "data-v-66411b58"]]), Ar = /* @__PURE__ */ u({
2371
+ }), [["__scopeId", "data-v-b7aa8ccf"]]), Qr = /* @__PURE__ */ u({
1633
2372
  __name: "KLineLevelDropdown",
1634
2373
  props: { modelValue: {} },
1635
2374
  emits: ["update:modelValue"],
@@ -1676,7 +2415,7 @@ var lr = { class: "settings-body" }, ur = { class: "settings-label" }, dr = ["on
1676
2415
  value: "yearly"
1677
2416
  }
1678
2417
  ], r = t;
1679
- return (t, a) => (S(), i(K, {
2418
+ return (t, a) => (C(), i(J, {
1680
2419
  "model-value": e.modelValue,
1681
2420
  options: n,
1682
2421
  label: "级别",
@@ -1685,7 +2424,7 @@ var lr = { class: "settings-body" }, ur = { class: "settings-label" }, dr = ["on
1685
2424
  "onUpdate:modelValue": a[0] ||= (e) => r("update:modelValue", e)
1686
2425
  }, null, 8, ["model-value"]));
1687
2426
  }
1688
- }), jr = /* @__PURE__ */ u({
2427
+ }), $r = /* @__PURE__ */ u({
1689
2428
  __name: "KLineAdjustmentDropdown",
1690
2429
  props: { modelValue: {} },
1691
2430
  emits: ["update:modelValue"],
@@ -1708,7 +2447,7 @@ var lr = { class: "settings-body" }, ur = { class: "settings-label" }, dr = ["on
1708
2447
  value: "none"
1709
2448
  }
1710
2449
  ], r = t;
1711
- return (t, a) => (S(), i(K, {
2450
+ return (t, a) => (C(), i(J, {
1712
2451
  "model-value": e.modelValue,
1713
2452
  options: n,
1714
2453
  label: "复权",
@@ -1717,13 +2456,13 @@ var lr = { class: "settings-body" }, ur = { class: "settings-label" }, dr = ["on
1717
2456
  "onUpdate:modelValue": a[0] ||= (e) => r("update:modelValue", e)
1718
2457
  }, null, 8, ["model-value"]));
1719
2458
  }
1720
- }), Mr = {
2459
+ }), ei = {
1721
2460
  viewBox: "0 0 24 24",
1722
2461
  width: "1.2em",
1723
2462
  height: "1.2em"
1724
2463
  };
1725
- function Nr(e, t) {
1726
- return S(), o("svg", Mr, [...t[0] ||= [s("path", {
2464
+ function ti(e, t) {
2465
+ return C(), o("svg", ei, [...t[0] ||= [s("path", {
1727
2466
  fill: "none",
1728
2467
  stroke: "currentColor",
1729
2468
  "stroke-linecap": "round",
@@ -1732,26 +2471,21 @@ function Nr(e, t) {
1732
2471
  d: "M12 9v4m-1.637-9.409L2.257 17.125a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636-2.87L13.637 3.59a1.914 1.914 0 0 0-3.274 0M12 16h.01"
1733
2472
  }, null, -1)]]);
1734
2473
  }
1735
- var Pr = m({
2474
+ var ni = h({
1736
2475
  name: "tabler-alert-triangle",
1737
- render: Nr
1738
- }), Fr = ["title", "aria-expanded"], Ir = { class: "symbol-chip__code" }, Lr = {
2476
+ render: ti
2477
+ }), ri = ["title", "aria-expanded"], ii = { class: "symbol-chip__code" }, ai = {
1739
2478
  key: 0,
1740
2479
  class: "symbol-chip__spinner",
1741
2480
  "aria-hidden": "true"
1742
- }, Rr = {
1743
- key: 0,
1744
- class: "symbol-popover",
1745
- role: "dialog",
1746
- "aria-label": "切换合约"
1747
- }, zr = { class: "symbol-search" }, Br = {
2481
+ }, oi = { class: "symbol-search" }, si = {
1748
2482
  class: "symbol-list",
1749
2483
  role: "listbox",
1750
2484
  "aria-label": "商品列表"
1751
- }, Vr = {
2485
+ }, ci = {
1752
2486
  key: 0,
1753
2487
  class: "symbol-list__empty"
1754
- }, Hr = {
2488
+ }, li = {
1755
2489
  width: "32",
1756
2490
  height: "32",
1757
2491
  viewBox: "0 0 32 32",
@@ -1760,7 +2494,7 @@ var Pr = m({
1760
2494
  "margin-bottom": "8px",
1761
2495
  opacity: "0.35"
1762
2496
  }
1763
- }, Ur = ["aria-selected", "onClick"], Wr = { class: "symbol-list__left" }, Gr = { class: "symbol-list__code" }, Kr = { class: "symbol-list__desc" }, qr = { class: "symbol-list__exchange" }, Jr = /*#__PURE__*/ U(/* @__PURE__ */ u({
2497
+ }, ui = ["aria-selected", "onClick"], di = { class: "symbol-list__left" }, fi = { class: "symbol-list__code" }, pi = { class: "symbol-list__desc" }, mi = { class: "symbol-list__exchange" }, hi = /*#__PURE__*/ q(/* @__PURE__ */ u({
1764
2498
  __name: "SymbolSelector",
1765
2499
  props: {
1766
2500
  symbol: {},
@@ -1769,47 +2503,59 @@ var Pr = m({
1769
2503
  error: { type: Boolean }
1770
2504
  },
1771
2505
  emits: ["change"],
1772
- setup(t, { emit: c }) {
1773
- let u = t, d = c, f = w(!1), p = w(""), m = w(null), _ = w(null), b = r(() => u.symbols.find((e) => e.code === u.symbol)), x = r(() => {
1774
- let e = b.value;
1775
- return e ? `${e.code} - ${e.description}` : u.symbol;
1776
- }), C = r(() => {
1777
- let e = p.value.trim().toLowerCase();
1778
- return e ? u.symbols.filter((t) => t.code.toLowerCase().includes(e) || t.description.toLowerCase().includes(e) || t.exchange.toLowerCase().includes(e)) : u.symbols;
2506
+ setup(c, { emit: u }) {
2507
+ let d = c, f = u, p = T(!1), m = T(""), h = T(null), x = T(null), S = T(null), w = De(), { popupStyle: D, startPositionSync: O, stopPositionSync: k } = we(x, S, 8), M = r(() => d.symbols.find((e) => e.code === d.symbol)), L = r(() => {
2508
+ let e = M.value;
2509
+ return e ? `${e.code} - ${e.description}` : d.symbol;
2510
+ }), R = r(() => {
2511
+ let e = m.value.trim().toLowerCase();
2512
+ return e ? d.symbols.filter((t) => t.code.toLowerCase().includes(e) || t.description.toLowerCase().includes(e) || t.exchange.toLowerCase().includes(e)) : d.symbols;
1779
2513
  });
1780
- function E() {
1781
- f.value = !f.value, f.value && h(() => m.value?.focus());
2514
+ function z() {
2515
+ p.value = !p.value, p.value && g(() => h.value?.focus());
1782
2516
  }
1783
- function D() {
1784
- p.value = "", m.value?.focus();
2517
+ P(p, (e) => {
2518
+ e ? O() : k();
2519
+ });
2520
+ function ee() {
2521
+ m.value = "", h.value?.focus();
1785
2522
  }
1786
- function A() {}
1787
- function F(e) {
1788
- d("change", e), f.value = !1, p.value = "";
2523
+ function te() {}
2524
+ function B(e) {
2525
+ f("change", e), p.value = !1, m.value = "";
1789
2526
  }
1790
- function I(e) {
1791
- _.value && !_.value.contains(e.target) && (f.value = !1);
2527
+ function ne(e) {
2528
+ let t = x.value, n = S.value;
2529
+ t && !t.contains(e.target) && !n?.contains(e.target) && (p.value = !1);
1792
2530
  }
1793
- return y(() => document.addEventListener("mousedown", I)), v(() => document.removeEventListener("mousedown", I)), M(() => u.symbol, () => {
1794
- f.value = !1, p.value = "";
1795
- }), (r, c) => (S(), o("div", {
2531
+ return b(() => document.addEventListener("mousedown", ne)), y(() => document.removeEventListener("mousedown", ne)), P(() => d.symbol, () => {
2532
+ p.value = !1, m.value = "";
2533
+ }), (r, u) => (C(), o("div", {
1796
2534
  ref_key: "chipWrapRef",
1797
- ref: _,
2535
+ ref: x,
1798
2536
  class: "symbol-chip-wrap"
1799
2537
  }, [s("button", {
1800
2538
  type: "button",
1801
- class: g(["symbol-chip", { "is-open": f.value }]),
1802
- title: x.value,
1803
- "aria-expanded": f.value,
2539
+ class: _(["symbol-chip", { "is-open": p.value }]),
2540
+ title: L.value,
2541
+ "aria-expanded": p.value,
1804
2542
  "aria-haspopup": "dialog",
1805
- onClick: E
1806
- }, [s("span", Ir, O(x.value), 1), t.loading ? (S(), o("span", Lr)) : t.error ? (S(), i(k(Pr), {
2543
+ onClick: z
2544
+ }, [s("span", ii, A(L.value), 1), c.loading ? (C(), o("span", ai)) : c.error ? (C(), i(j(ni), {
1807
2545
  key: 1,
1808
2546
  class: "symbol-chip__warn",
1809
2547
  "aria-hidden": "true"
1810
- })) : a("", !0)], 10, Fr), l(n, { name: "symbol-popover" }, {
1811
- default: N(() => [f.value ? (S(), o("div", Rr, [s("div", zr, [
1812
- c[2] ||= s("span", {
2548
+ })) : a("", !0)], 10, ri), (C(), i(t, { to: j(w) }, [l(n, { name: "symbol-popover" }, {
2549
+ default: F(() => [p.value ? (C(), o("div", {
2550
+ key: 0,
2551
+ ref_key: "popupRef",
2552
+ ref: S,
2553
+ class: "symbol-popover",
2554
+ style: v(j(D)),
2555
+ role: "dialog",
2556
+ "aria-label": "切换合约"
2557
+ }, [s("div", oi, [
2558
+ u[2] ||= s("span", {
1813
2559
  class: "symbol-search__icon",
1814
2560
  "aria-hidden": "true"
1815
2561
  }, [s("svg", {
@@ -1832,25 +2578,25 @@ var Pr = m({
1832
2578
  "stroke-width": "1.6",
1833
2579
  "stroke-linecap": "round"
1834
2580
  })])], -1),
1835
- P(s("input", {
2581
+ I(s("input", {
1836
2582
  ref_key: "searchInputRef",
1837
- ref: m,
1838
- "onUpdate:modelValue": c[0] ||= (e) => p.value = e,
2583
+ ref: h,
2584
+ "onUpdate:modelValue": u[0] ||= (e) => m.value = e,
1839
2585
  class: "symbol-search__input",
1840
2586
  type: "text",
1841
2587
  placeholder: "搜索代码或名称…",
1842
2588
  autocomplete: "off",
1843
2589
  spellcheck: "false",
1844
2590
  "aria-label": "搜索商品",
1845
- onInput: A
1846
- }, null, 544), [[j, p.value]]),
1847
- p.value ? (S(), o("button", {
2591
+ onInput: te
2592
+ }, null, 544), [[N, m.value]]),
2593
+ m.value ? (C(), o("button", {
1848
2594
  key: 0,
1849
2595
  type: "button",
1850
2596
  class: "symbol-search__clear",
1851
2597
  "aria-label": "清空搜索",
1852
- onClick: D
1853
- }, [...c[1] ||= [s("svg", {
2598
+ onClick: ee
2599
+ }, [...u[1] ||= [s("svg", {
1854
2600
  class: "delete-icon",
1855
2601
  viewBox: "0 0 24 24",
1856
2602
  fill: "none",
@@ -1864,7 +2610,7 @@ var Pr = m({
1864
2610
  s("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }),
1865
2611
  s("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
1866
2612
  ], -1)]])) : a("", !0)
1867
- ]), s("div", Br, [C.value.length === 0 ? (S(), o("div", Vr, [(S(), o("svg", Hr, [...c[3] ||= [s("circle", {
2613
+ ]), s("div", si, [R.value.length === 0 ? (C(), o("div", ci, [(C(), o("svg", li, [...u[3] ||= [s("circle", {
1868
2614
  cx: "13",
1869
2615
  cy: "13",
1870
2616
  r: "10",
@@ -1878,39 +2624,34 @@ var Pr = m({
1878
2624
  stroke: "currentColor",
1879
2625
  "stroke-width": "2",
1880
2626
  "stroke-linecap": "round"
1881
- }, null, -1)]])), c[4] ||= s("span", null, "未找到相关商品", -1)])) : a("", !0), (S(!0), o(e, null, T(C.value, (e) => (S(), o("button", {
2627
+ }, null, -1)]])), u[4] ||= s("span", null, "未找到相关商品", -1)])) : a("", !0), (C(!0), o(e, null, E(R.value, (e) => (C(), o("button", {
1882
2628
  key: e.code,
1883
2629
  type: "button",
1884
- class: g(["symbol-list__item", { "is-active": e.code === t.symbol }]),
2630
+ class: _(["symbol-list__item", { "is-active": e.code === c.symbol }]),
1885
2631
  role: "option",
1886
- "aria-selected": e.code === t.symbol,
1887
- onClick: (t) => F(e)
1888
- }, [s("span", Wr, [s("span", Gr, O(e.code), 1), s("span", Kr, O(e.description), 1)]), s("span", qr, O(e.exchange), 1)], 10, Ur))), 128))])])) : a("", !0)]),
2632
+ "aria-selected": e.code === c.symbol,
2633
+ onClick: (t) => B(e)
2634
+ }, [s("span", di, [s("span", fi, A(e.code), 1), s("span", pi, A(e.description), 1)]), s("span", mi, A(e.exchange), 1)], 10, ui))), 128))])], 4)) : a("", !0)]),
1889
2635
  _: 1
1890
- })], 512));
2636
+ })], 8, ["to"]))], 512));
1891
2637
  }
1892
- }), [["__scopeId", "data-v-864e9451"]]), Yr = ["aria-expanded"], Xr = {
2638
+ }), [["__scopeId", "data-v-3d5a580d"]]), gi = ["aria-expanded"], _i = {
1893
2639
  key: 0,
1894
2640
  class: "compare-chip__spinner"
1895
- }, Zr = {
2641
+ }, vi = {
1896
2642
  key: 1,
1897
2643
  class: "compare-chip__badge"
1898
- }, Qr = {
1899
- key: 0,
1900
- class: "compare-popover",
1901
- role: "dialog",
1902
- "aria-label": "比较商品"
1903
- }, $r = { class: "compare-search" }, ei = {
2644
+ }, yi = { class: "compare-search" }, bi = {
1904
2645
  key: 0,
1905
2646
  class: "compare-selected"
1906
- }, ti = { class: "compare-selected__list" }, ni = { class: "compare-selected__code" }, ri = { class: "compare-selected__desc" }, ii = ["aria-label", "onClick"], ai = {
2647
+ }, xi = { class: "compare-selected__list" }, Si = { class: "compare-selected__code" }, Ci = { class: "compare-selected__desc" }, wi = ["aria-label", "onClick"], Ti = {
1907
2648
  class: "compare-list",
1908
2649
  role: "listbox",
1909
2650
  "aria-label": "商品列表"
1910
- }, oi = {
2651
+ }, Ei = {
1911
2652
  key: 0,
1912
2653
  class: "compare-list__empty"
1913
- }, si = {
2654
+ }, Di = {
1914
2655
  width: "32",
1915
2656
  height: "32",
1916
2657
  viewBox: "0 0 32 32",
@@ -1919,11 +2660,11 @@ var Pr = m({
1919
2660
  "margin-bottom": "8px",
1920
2661
  opacity: "0.35"
1921
2662
  }
1922
- }, ci = ["aria-selected", "onClick"], li = { class: "compare-list__left" }, ui = { class: "compare-list__code" }, di = { class: "compare-list__desc" }, fi = { class: "compare-list__right" }, pi = { class: "compare-list__exchange" }, mi = {
2663
+ }, Oi = ["aria-selected", "onClick"], ki = { class: "compare-list__left" }, Ai = { class: "compare-list__code" }, ji = { class: "compare-list__desc" }, Mi = { class: "compare-list__right" }, Ni = { class: "compare-list__exchange" }, Pi = {
1923
2664
  key: 0,
1924
2665
  class: "compare-list__check",
1925
2666
  "aria-hidden": "true"
1926
- }, hi = /*#__PURE__*/ U(/* @__PURE__ */ u({
2667
+ }, Fi = /*#__PURE__*/ q(/* @__PURE__ */ u({
1927
2668
  __name: "CompareSymbolSelector",
1928
2669
  props: {
1929
2670
  symbols: {},
@@ -1932,55 +2673,67 @@ var Pr = m({
1932
2673
  comparisonLoading: { type: Boolean }
1933
2674
  },
1934
2675
  emits: ["add", "remove"],
1935
- setup(t, { emit: i }) {
1936
- let c = t, u = i, d = w(!1), f = w(""), p = w(null), m = w(null), b = r(() => new Set(c.selected ?? [])), x = r(() => {
1937
- let e = b.value;
1938
- return c.symbols.filter((t) => e.has(t.code));
1939
- }), C = r(() => {
1940
- let e = f.value.trim().toLowerCase();
1941
- return e ? c.symbols.filter((t) => t.code.toLowerCase().includes(e) || t.description.toLowerCase().includes(e) || t.exchange.toLowerCase().includes(e)) : c.symbols;
2676
+ setup(c, { emit: u }) {
2677
+ let d = c, f = u, p = T(!1), m = T(""), h = T(null), x = T(null), S = T(null), w = De(), { popupStyle: D, startPositionSync: O, stopPositionSync: k } = we(x, S, 8), M = r(() => new Set(d.selected ?? [])), L = r(() => {
2678
+ let e = M.value;
2679
+ return d.symbols.filter((t) => e.has(t.code));
2680
+ }), R = r(() => {
2681
+ let e = m.value.trim().toLowerCase();
2682
+ return e ? d.symbols.filter((t) => t.code.toLowerCase().includes(e) || t.description.toLowerCase().includes(e) || t.exchange.toLowerCase().includes(e)) : d.symbols;
1942
2683
  });
1943
- function E(e) {
1944
- return b.value.has(e);
2684
+ function z(e) {
2685
+ return M.value.has(e);
1945
2686
  }
1946
- function D(e) {
1947
- E(e.code) ? u("remove", e.code) : u("add", e);
2687
+ function ee(e) {
2688
+ z(e.code) ? f("remove", e.code) : f("add", e);
1948
2689
  }
1949
- function k(e) {
1950
- u("remove", e);
2690
+ function te(e) {
2691
+ f("remove", e);
1951
2692
  }
1952
- function A() {
1953
- d.value = !d.value, d.value && h(() => p.value?.focus());
2693
+ function B() {
2694
+ p.value = !p.value, p.value && g(() => h.value?.focus());
1954
2695
  }
1955
- function M() {
1956
- f.value = "", p.value?.focus();
2696
+ P(p, (e) => {
2697
+ e ? O() : k();
2698
+ });
2699
+ function ne() {
2700
+ m.value = "", h.value?.focus();
1957
2701
  }
1958
- function F(e) {
1959
- m.value && !m.value.contains(e.target) && (d.value = !1, f.value = "");
2702
+ function V(e) {
2703
+ let t = x.value, n = S.value;
2704
+ t && !t.contains(e.target) && !n?.contains(e.target) && (p.value = !1, m.value = "");
1960
2705
  }
1961
- return y(() => document.addEventListener("mousedown", F)), v(() => document.removeEventListener("mousedown", F)), (r, i) => (S(), o("div", {
2706
+ return b(() => document.addEventListener("mousedown", V)), y(() => document.removeEventListener("mousedown", V)), (r, u) => (C(), o("div", {
1962
2707
  ref_key: "rootRef",
1963
- ref: m,
2708
+ ref: x,
1964
2709
  class: "compare-chip-wrap"
1965
2710
  }, [s("button", {
1966
2711
  type: "button",
1967
- class: g(["compare-chip", { "is-open": d.value }]),
2712
+ class: _(["compare-chip", { "is-open": p.value }]),
1968
2713
  title: "比较商品",
1969
- "aria-expanded": d.value,
2714
+ "aria-expanded": p.value,
1970
2715
  "aria-haspopup": "dialog",
1971
- onClick: A
2716
+ onClick: B
1972
2717
  }, [
1973
- i[1] ||= s("span", {
2718
+ u[1] ||= s("span", {
1974
2719
  class: "compare-chip__icon",
1975
2720
  "aria-hidden": "true"
1976
2721
  }, "+", -1),
1977
- i[2] ||= s("span", { class: "compare-chip__text" }, "比较商品", -1),
1978
- t.comparisonLoading ? (S(), o("span", Xr)) : a("", !0),
1979
- t.selected.length > 0 ? (S(), o("span", Zr, O(t.selected.length), 1)) : a("", !0)
1980
- ], 10, Yr), l(n, { name: "symbol-popover" }, {
1981
- default: N(() => [d.value ? (S(), o("div", Qr, [
1982
- s("div", $r, [
1983
- i[4] ||= s("span", {
2722
+ u[2] ||= s("span", { class: "compare-chip__text" }, "比较商品", -1),
2723
+ c.comparisonLoading ? (C(), o("span", _i)) : a("", !0),
2724
+ c.selected.length > 0 ? (C(), o("span", vi, A(c.selected.length), 1)) : a("", !0)
2725
+ ], 10, gi), (C(), i(t, { to: j(w) }, [l(n, { name: "symbol-popover" }, {
2726
+ default: F(() => [p.value ? (C(), o("div", {
2727
+ key: 0,
2728
+ ref_key: "popupRef",
2729
+ ref: S,
2730
+ class: "compare-popover",
2731
+ style: v(j(D)),
2732
+ role: "dialog",
2733
+ "aria-label": "比较商品"
2734
+ }, [
2735
+ s("div", yi, [
2736
+ u[4] ||= s("span", {
1984
2737
  class: "compare-search__icon",
1985
2738
  "aria-hidden": "true"
1986
2739
  }, [s("svg", {
@@ -2003,24 +2756,24 @@ var Pr = m({
2003
2756
  "stroke-width": "1.6",
2004
2757
  "stroke-linecap": "round"
2005
2758
  })])], -1),
2006
- P(s("input", {
2759
+ I(s("input", {
2007
2760
  ref_key: "searchInputRef",
2008
- ref: p,
2009
- "onUpdate:modelValue": i[0] ||= (e) => f.value = e,
2761
+ ref: h,
2762
+ "onUpdate:modelValue": u[0] ||= (e) => m.value = e,
2010
2763
  class: "compare-search__input",
2011
2764
  type: "text",
2012
2765
  placeholder: "搜索代码或名称…",
2013
2766
  autocomplete: "off",
2014
2767
  spellcheck: "false",
2015
2768
  "aria-label": "搜索比较商品"
2016
- }, null, 512), [[j, f.value]]),
2017
- f.value ? (S(), o("button", {
2769
+ }, null, 512), [[N, m.value]]),
2770
+ m.value ? (C(), o("button", {
2018
2771
  key: 0,
2019
2772
  type: "button",
2020
2773
  class: "compare-search__clear",
2021
2774
  "aria-label": "清空搜索",
2022
- onClick: M
2023
- }, [...i[3] ||= [s("svg", {
2775
+ onClick: ne
2776
+ }, [...u[3] ||= [s("svg", {
2024
2777
  class: "delete-icon",
2025
2778
  viewBox: "0 0 24 24",
2026
2779
  fill: "none",
@@ -2035,22 +2788,22 @@ var Pr = m({
2035
2788
  s("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" })
2036
2789
  ], -1)]])) : a("", !0)
2037
2790
  ]),
2038
- t.selected.length > 0 ? (S(), o("div", ei, [i[6] ||= s("div", { class: "compare-selected__header" }, [s("span", { class: "compare-selected__title" }, "已添加商品")], -1), s("div", ti, [(S(!0), o(e, null, T(x.value, (e) => (S(), o("div", {
2791
+ c.selected.length > 0 ? (C(), o("div", bi, [u[6] ||= s("div", { class: "compare-selected__header" }, [s("span", { class: "compare-selected__title" }, "已添加商品")], -1), s("div", xi, [(C(!0), o(e, null, E(L.value, (e) => (C(), o("div", {
2039
2792
  key: e.code,
2040
2793
  class: "compare-selected__item"
2041
2794
  }, [
2042
2795
  s("span", {
2043
2796
  class: "compare-selected__color",
2044
- style: _({ background: t.comparisonColors?.get(e.code) ?? "#888" })
2797
+ style: v({ background: c.comparisonColors?.get(e.code) ?? "#888" })
2045
2798
  }, null, 4),
2046
- s("span", ni, O(e.code), 1),
2047
- s("span", ri, O(e.description), 1),
2799
+ s("span", Si, A(e.code), 1),
2800
+ s("span", Ci, A(e.description), 1),
2048
2801
  s("button", {
2049
2802
  type: "button",
2050
2803
  class: "compare-selected__remove",
2051
2804
  "aria-label": "移除 " + e.code,
2052
- onClick: (t) => k(e.code)
2053
- }, [...i[5] ||= [s("svg", {
2805
+ onClick: (t) => te(e.code)
2806
+ }, [...u[5] ||= [s("svg", {
2054
2807
  viewBox: "0 0 24 24",
2055
2808
  width: "12",
2056
2809
  height: "12",
@@ -2059,9 +2812,9 @@ var Pr = m({
2059
2812
  "stroke-width": "2",
2060
2813
  "stroke-linecap": "round",
2061
2814
  "stroke-linejoin": "round"
2062
- }, [s("path", { d: "M18 6L6 18" }), s("path", { d: "M6 6l12 12" })], -1)]], 8, ii)
2815
+ }, [s("path", { d: "M18 6L6 18" }), s("path", { d: "M6 6l12 12" })], -1)]], 8, wi)
2063
2816
  ]))), 128))])])) : a("", !0),
2064
- s("div", ai, [C.value.length === 0 ? (S(), o("div", oi, [(S(), o("svg", si, [...i[7] ||= [s("circle", {
2817
+ s("div", Ti, [R.value.length === 0 ? (C(), o("div", Ei, [(C(), o("svg", Di, [...u[7] ||= [s("circle", {
2065
2818
  cx: "13",
2066
2819
  cy: "13",
2067
2820
  r: "10",
@@ -2075,14 +2828,14 @@ var Pr = m({
2075
2828
  stroke: "currentColor",
2076
2829
  "stroke-width": "2",
2077
2830
  "stroke-linecap": "round"
2078
- }, null, -1)]])), i[8] ||= s("span", null, "未找到相关商品", -1)])) : a("", !0), (S(!0), o(e, null, T(C.value, (e) => (S(), o("button", {
2831
+ }, null, -1)]])), u[8] ||= s("span", null, "未找到相关商品", -1)])) : a("", !0), (C(!0), o(e, null, E(R.value, (e) => (C(), o("button", {
2079
2832
  key: e.code,
2080
2833
  type: "button",
2081
- class: g(["compare-list__item", { "is-selected": E(e.code) }]),
2834
+ class: _(["compare-list__item", { "is-selected": z(e.code) }]),
2082
2835
  role: "option",
2083
- "aria-selected": E(e.code),
2084
- onClick: (t) => D(e)
2085
- }, [s("span", li, [s("span", ui, O(e.code), 1), s("span", di, O(e.description), 1)]), s("span", fi, [s("span", pi, O(e.exchange), 1), E(e.code) ? (S(), o("span", mi, [...i[9] ||= [s("svg", {
2836
+ "aria-selected": z(e.code),
2837
+ onClick: (t) => ee(e)
2838
+ }, [s("span", ki, [s("span", Ai, A(e.code), 1), s("span", ji, A(e.description), 1)]), s("span", Mi, [s("span", Ni, A(e.exchange), 1), z(e.code) ? (C(), o("span", Pi, [...u[9] ||= [s("svg", {
2086
2839
  viewBox: "0 0 24 24",
2087
2840
  width: "16",
2088
2841
  height: "16",
@@ -2091,12 +2844,12 @@ var Pr = m({
2091
2844
  "stroke-width": "2.5",
2092
2845
  "stroke-linecap": "round",
2093
2846
  "stroke-linejoin": "round"
2094
- }, [s("polyline", { points: "20 6 9 17 4 12" })], -1)]])) : a("", !0)])], 10, ci))), 128))])
2095
- ])) : a("", !0)]),
2847
+ }, [s("polyline", { points: "20 6 9 17 4 12" })], -1)]])) : a("", !0)])], 10, Oi))), 128))])
2848
+ ], 4)) : a("", !0)]),
2096
2849
  _: 1
2097
- })], 512));
2850
+ })], 8, ["to"]))], 512));
2098
2851
  }
2099
- }), [["__scopeId", "data-v-9513ad09"]]), gi = { class: "top-toolbar" }, _i = /*#__PURE__*/ U(/* @__PURE__ */ u({
2852
+ }), [["__scopeId", "data-v-8a5646b4"]]), Ii = /*#__PURE__*/ q(/* @__PURE__ */ u({
2100
2853
  __name: "TopToolbar",
2101
2854
  props: {
2102
2855
  symbol: {},
@@ -2118,7 +2871,26 @@ var Pr = m({
2118
2871
  "symbolChange"
2119
2872
  ],
2120
2873
  setup(e, { emit: t }) {
2121
- let n = e, c = t, u = [
2874
+ let n = T(null), c = !1, u = 0, d = 0;
2875
+ function f(e) {
2876
+ let t = n.value;
2877
+ t && (c = !0, u = e.pageX - t.getBoundingClientRect().left, d = t.scrollLeft, t.style.cursor = "grabbing", t.style.userSelect = "none");
2878
+ }
2879
+ function p(e) {
2880
+ if (!c) return;
2881
+ let t = n.value;
2882
+ if (!t) return;
2883
+ e.preventDefault();
2884
+ let r = e.pageX - t.getBoundingClientRect().left - u;
2885
+ t.scrollLeft = d - r;
2886
+ }
2887
+ function m() {
2888
+ if (!c) return;
2889
+ c = !1;
2890
+ let e = n.value;
2891
+ e && (e.style.cursor = "", e.style.userSelect = "");
2892
+ }
2893
+ let h = e, g = t, _ = [
2122
2894
  {
2123
2895
  code: "XAUUSD",
2124
2896
  description: "现货黄金",
@@ -2203,67 +2975,141 @@ var Pr = m({
2203
2975
  exchange: "MOCK",
2204
2976
  source: "mock-10000"
2205
2977
  }
2206
- ], d = r(() => n.symbol?.trim() ?? ""), f = r(() => n.symbols && n.symbols.length ? n.symbols : u);
2207
- function p(e) {
2208
- c("symbolChange", e);
2209
- }
2210
- return (t, n) => (S(), o("div", gi, [
2211
- d.value ? (S(), i(Jr, {
2978
+ ], v = r(() => h.symbol?.trim() ?? ""), y = r(() => h.symbols && h.symbols.length ? h.symbols : _);
2979
+ function b(e) {
2980
+ g("symbolChange", e);
2981
+ }
2982
+ return (t, r) => (C(), o("div", {
2983
+ ref_key: "toolbarRef",
2984
+ ref: n,
2985
+ class: "top-toolbar",
2986
+ onMousedown: f,
2987
+ onMousemove: p,
2988
+ onMouseup: m,
2989
+ onMouseleave: m
2990
+ }, [
2991
+ v.value ? (C(), i(hi, {
2212
2992
  key: 0,
2213
- symbol: d.value,
2214
- symbols: f.value,
2993
+ symbol: v.value,
2994
+ symbols: y.value,
2215
2995
  loading: e.symbolLoading,
2216
2996
  error: e.symbolError,
2217
- onChange: p
2997
+ onChange: b
2218
2998
  }, null, 8, [
2219
2999
  "symbol",
2220
3000
  "symbols",
2221
3001
  "loading",
2222
3002
  "error"
2223
3003
  ])) : a("", !0),
2224
- l(hi, {
2225
- symbols: f.value,
3004
+ l(Fi, {
3005
+ symbols: y.value,
2226
3006
  selected: e.overlaySymbols,
2227
3007
  "comparison-colors": e.comparisonColors,
2228
3008
  "comparison-loading": e.comparisonLoading,
2229
- onAdd: n[0] ||= (e) => c("addOverlaySymbol", e),
2230
- onRemove: n[1] ||= (e) => c("removeOverlaySymbol", e)
3009
+ onAdd: r[0] ||= (e) => g("addOverlaySymbol", e),
3010
+ onRemove: r[1] ||= (e) => g("removeOverlaySymbol", e)
2231
3011
  }, null, 8, [
2232
3012
  "symbols",
2233
3013
  "selected",
2234
3014
  "comparison-colors",
2235
3015
  "comparison-loading"
2236
3016
  ]),
2237
- l(Ar, {
3017
+ l(Qr, {
2238
3018
  "model-value": e.kLineLevel,
2239
- "onUpdate:modelValue": n[2] ||= (e) => c("kLineLevelChange", e)
3019
+ "onUpdate:modelValue": r[2] ||= (e) => g("kLineLevelChange", e)
2240
3020
  }, null, 8, ["model-value"]),
2241
- l(jr, {
3021
+ l($r, {
2242
3022
  "model-value": e.kLineAdjust,
2243
- "onUpdate:modelValue": n[3] ||= (e) => c("kLineAdjustChange", e)
3023
+ "onUpdate:modelValue": r[3] ||= (e) => g("kLineAdjustChange", e)
2244
3024
  }, null, 8, ["model-value"]),
2245
3025
  s("button", {
2246
3026
  type: "button",
2247
3027
  class: "indicator-button",
2248
3028
  title: "指标",
2249
3029
  "aria-label": "指标",
2250
- onClick: n[4] ||= (e) => c("toggleIndicator")
2251
- }, [...n[5] ||= [s("span", {
3030
+ onClick: r[4] ||= (e) => g("toggleIndicator")
3031
+ }, [...r[5] ||= [s("span", {
2252
3032
  class: "indicator-button__icon",
2253
3033
  "aria-hidden": "true"
2254
3034
  }, "fx", -1), s("span", { class: "indicator-button__text" }, "指标", -1)]])
2255
- ]));
3035
+ ], 544));
2256
3036
  }
2257
- }), [["__scopeId", "data-v-c612b21d"]]), vi = ["data-theme"], yi = {
3037
+ }), [["__scopeId", "data-v-8ecedbff"]]), Li = /*#__PURE__*/ q(/* @__PURE__ */ u({
3038
+ __name: "BatchStockDialog",
3039
+ props: { show: { type: Boolean } },
3040
+ emits: ["close", "apply"],
3041
+ setup(e, { emit: t }) {
3042
+ let n = t, a = T([]), o = r({
3043
+ get: () => a.value.join("\n"),
3044
+ set: (e) => {
3045
+ a.value = e.split("\n").map((e) => e.trim()).filter(Boolean);
3046
+ }
3047
+ });
3048
+ function c() {
3049
+ a.value.length !== 0 && (n("apply", a.value), n("close"));
3050
+ }
3051
+ return (t, r) => (C(), i(Y, {
3052
+ title: "批量设置股票代码",
3053
+ show: e.show,
3054
+ onClose: r[2] ||= (e) => n("close")
3055
+ }, {
3056
+ footer: F(() => [s("button", {
3057
+ class: "batch-btn batch-btn--cancel",
3058
+ onClick: r[1] ||= (e) => n("close")
3059
+ }, "取消"), s("button", {
3060
+ class: "batch-btn batch-btn--confirm",
3061
+ onClick: c
3062
+ }, "应用")]),
3063
+ default: F(() => [I(s("textarea", {
3064
+ "onUpdate:modelValue": r[0] ||= (e) => o.value = e,
3065
+ class: "batch-textarea",
3066
+ placeholder: "每行一个股票代码,导出时会将所选区间内这些品种的数据一并导出\n例如:\n000001\n600036\n002415",
3067
+ rows: "8",
3068
+ spellcheck: "false"
3069
+ }, null, 512), [[N, o.value]])]),
3070
+ _: 1
3071
+ }, 8, ["show"]));
3072
+ }
3073
+ }), [["__scopeId", "data-v-2311afd3"]]), Ri = { class: "export-body" }, zi = { class: "export-label" }, Bi = { class: "export-bar-track" }, Vi = { class: "export-counter" }, Hi = /*#__PURE__*/ q(/* @__PURE__ */ u({
3074
+ __name: "ExportProgressDialog",
3075
+ props: { progress: {} },
3076
+ emits: ["close"],
3077
+ setup(e, { emit: t }) {
3078
+ let n = e, c = t, l = r(() => !n.progress || n.progress.total <= 0 ? 0 : Math.min(100, Math.round(n.progress.current / n.progress.total * 100)));
3079
+ return (t, n) => (C(), i(Y, {
3080
+ title: "导出数据",
3081
+ show: !!e.progress,
3082
+ "z-index": 1100,
3083
+ "close-on-overlay": !1,
3084
+ "footer-align": "center",
3085
+ onClose: n[1] ||= (e) => c("close")
3086
+ }, {
3087
+ footer: F(() => [e.progress && e.progress.current === e.progress.total ? (C(), o("button", {
3088
+ key: 0,
3089
+ class: "export-done-btn",
3090
+ onClick: n[0] ||= (e) => c("close")
3091
+ }, " 完成 ")) : a("", !0)]),
3092
+ default: F(() => [s("div", Ri, [
3093
+ s("div", zi, A(e.progress?.label), 1),
3094
+ s("div", Bi, [s("div", {
3095
+ class: "export-bar-fill",
3096
+ style: v({ width: l.value + "%" })
3097
+ }, null, 4)]),
3098
+ s("div", Vi, A(e.progress?.current ?? 0) + " / " + A(e.progress?.total ?? 0), 1)
3099
+ ])]),
3100
+ _: 1
3101
+ }, 8, ["show"]));
3102
+ }
3103
+ }), [["__scopeId", "data-v-63b609dd"]]), Ui = ["data-theme"], Wi = {
2258
3104
  class: "pane-separator-layer",
2259
3105
  "aria-hidden": "true"
2260
- }, bi = {
3106
+ }, Gi = {
2261
3107
  class: "canvas-layer",
2262
3108
  ref: "canvasLayerRef"
2263
- }, xi = {
3109
+ }, Ki = {
2264
3110
  class: "x-axis-canvas",
2265
3111
  ref: "xAxisCanvasRef"
2266
- }, Si = 4, Ci = /*#__PURE__*/ U(/* @__PURE__ */ u({
3112
+ }, qi = /*#__PURE__*/ q(/* @__PURE__ */ u({
2267
3113
  __name: "KLineChart",
2268
3114
  props: {
2269
3115
  semanticConfig: {},
@@ -2291,23 +3137,23 @@ var Pr = m({
2291
3137
  "kLineAdjustChange"
2292
3138
  ],
2293
3139
  setup(n, { expose: c, emit: u }) {
2294
- let d = n, f = u, p = w(d.semanticConfig?.data?.period ?? "daily"), m = w(d.semanticConfig?.data?.adjust ?? "none"), v = r(() => p.value.includes("min")), b = w("选择商品"), C = w(null), E = w(!1), O = w(!1), k = w([]), A = w([]);
2295
- function j(e) {
2296
- p.value = e, f("kLineLevelChange", e), ee();
2297
- }
3140
+ let d = n, f = u, p = T(d.semanticConfig?.data?.period ?? "daily"), h = T(d.semanticConfig?.data?.adjust ?? "none"), y = r(() => p.value.includes("min")), x = T("选择商品"), w = T(null), D = T(!1), O = T(!1), A = T([]), M = T([]);
2298
3141
  function N(e) {
2299
- m.value = e, f("kLineAdjustChange", e), ee();
2300
- }
2301
- function P(e) {
2302
- O.value = !1, b.value = e.code, C.value = e, ee();
2303
- }
2304
- function F(e) {
2305
- C.value?.code !== e.code && (k.value.includes(e.code) || (A.value = [...A.value, e], k.value = A.value.map((e) => e.code), te(), B.value?.addComparisonSymbol(L(e))));
3142
+ p.value = e, f("kLineLevelChange", e), B();
2306
3143
  }
2307
3144
  function I(e) {
2308
- A.value = A.value.filter((t) => t.code !== e), k.value = A.value.map((e) => e.code), B.value?.removeComparisonSymbol(e);
3145
+ h.value = e, f("kLineAdjustChange", e), B();
2309
3146
  }
2310
3147
  function L(e) {
3148
+ O.value = !1, x.value = e.code, w.value = e, B();
3149
+ }
3150
+ function z(e) {
3151
+ w.value?.code !== e.code && (A.value.includes(e.code) || (M.value = [...M.value, e], A.value = M.value.map((e) => e.code), ne(), H.value?.addComparisonSymbol(te(e))));
3152
+ }
3153
+ function ee(e) {
3154
+ M.value = M.value.filter((t) => t.code !== e), A.value = M.value.map((e) => e.code), H.value?.removeComparisonSymbol(e);
3155
+ }
3156
+ function te(e) {
2311
3157
  return {
2312
3158
  symbol: e.code,
2313
3159
  exchange: e.exchange,
@@ -2315,91 +3161,71 @@ var Pr = m({
2315
3161
  source: e.source,
2316
3162
  startDate: d.semanticConfig?.data?.startDate ?? "",
2317
3163
  endDate: d.semanticConfig?.data?.endDate ?? "",
2318
- adjust: m.value
3164
+ adjust: h.value
2319
3165
  };
2320
3166
  }
2321
- function ee() {
2322
- C.value && B.value?.setSymbols([L(C.value), ...A.value.map(L)]);
3167
+ function B() {
3168
+ w.value && H.value?.setSymbols([te(w.value), ...M.value.map(te)]);
2323
3169
  }
2324
- function te() {
2325
- if (G.value.axisType === "percent") return;
3170
+ function ne() {
3171
+ if (U.value.axisType === "percent") return;
2326
3172
  let e = {
2327
- ...G.value,
3173
+ ...U.value,
2328
3174
  axisType: "percent"
2329
3175
  };
2330
- G.value = e, B.value?.updateSettingsFacade(e);
3176
+ U.value = e, H.value?.updateSettingsFacade(e);
2331
3177
  try {
2332
- localStorage.setItem(_e, JSON.stringify(e));
3178
+ localStorage.setItem(ge, JSON.stringify(e));
2333
3179
  } catch {}
2334
3180
  }
2335
- let R = w(null), z = w(null), ie = w(null), ce = w(null), ue = w(null), de = w(null);
2336
- Pe(ie);
2337
- let B = D(null), pe = D(null), V = w(0), ve = w(0), ye = w(1), H = w(d.initialZoomLevel ?? 1), be = w(0), xe = w(1), Se = w(0), Ce = w({}), U = w(null), W = w([]), we = w(/* @__PURE__ */ new Map()), Te = w(!1), Ee = H.value;
2338
- be.value = me(Ee, {
3181
+ let V = T(null), re = T(null), ie = T(null), ae = T(null), oe = T(null), se = T(null);
3182
+ Ee(ie);
3183
+ let H = k(null), { chartTheme: le, chartSettings: U, tooltipColors: ue, themeCssVars: fe, handleSettingsChange: he, applyThemeFromSettings: W } = ln(H), _e = k(null), ve = T(0), ye = T(0), be = T(!1), xe = T([]), Se = T(0), G = T(1), K = T(d.initialZoomLevel ?? 1), q = T(0), Ce = T(1), we = T(0), Te = T({}), De = T(/* @__PURE__ */ new Map()), Oe = T(!1), ke = T("cursor"), { mainActiveIndicators: Ae, subActiveIndicators: je, activeIndicators: Me, indicatorParams: Ne, subPanes: Pe, buildPaneLayoutIntent: J, getDefaultParams: Fe, isSubPaneIndicator: Ie, addSubPane: Le, removeSubPane: Re, clearAllSubPanes: ze, initIndicatorsFromConfig: Ve, switchSubIndicator: He, handleIndicatorToggle: Ue, handleUpdateParams: We, handleReorderSubIndicators: Ge, setupIndicatorSubscriptions: Ke } = un(H, Te), { drawingController: Y, selectedDrawingId: qe, selectedDrawing: Je, drawings: Ye, handleSelectTool: Xe, onUpdateDrawingStyle: Ze, onDeleteDrawing: Qe, setupDrawing: $e } = dn(H), { rangeSelection: et, customStartDate: tt, customEndDate: nt, containerScrollLeft: rt, isRangeSelectActive: it, rangeSelectionReady: at, rangeSelectionBounds: ot, rangeSelectionCount: st, rangeSelectionStartLabel: ct, rangeSelectionEndLabel: lt, rangeSelectionOverlayStyle: ut, clearRangeSelection: dt, handleRangePointerDown: ft, handleRangePointerMove: pt, handleRangePointerUp: mt, exportRangeToCsv: ht, exportingProgress: gt, onEdgePointerDown: _t, onEdgePointerMove: vt, onEdgePointerUp: yt, onScroll: bt, syncScrollLeft: xt } = bn({
3184
+ controller: H,
3185
+ activeToolId: ke,
3186
+ containerRef: V,
3187
+ dataVersion: ye,
3188
+ viewportVersion: Se,
3189
+ dataFetcher: r(() => d.dataFetcher),
3190
+ batchStockCodes: xe
3191
+ }), St = K.value;
3192
+ q.value = pe(St, {
2339
3193
  minKWidth: d.minKWidth,
2340
3194
  maxKWidth: d.maxKWidth,
2341
3195
  zoomLevelCount: d.zoomLevels,
2342
- dpr: ye.value
2343
- }), xe.value = fe(be.value, ye.value);
2344
- let De = w("light"), G = w({}), Oe = r(() => {
2345
- let e = G.value.isAsiaMarket ?? !1, t = ae(De.value, e);
2346
- return {
2347
- upColor: t.candleUpBody,
2348
- downColor: t.candleDownBody
2349
- };
2350
- }), ke = r(() => {
2351
- let e = De.value === "dark" ? ne : re, t = G.value.colorPresetSettings?.[De.value];
2352
- return t && Object.keys(t).length > 0 ? oe({
2353
- ...e,
2354
- colors: {
2355
- ...e.colors,
2356
- ...t
2357
- }
2358
- }) : oe(e);
2359
- }), K = null;
2360
- function Ae(e) {
2361
- B.value?.setTheme(e.matches ? "dark" : "light");
2362
- }
2363
- function je(e, t) {
2364
- if (!(!e || !t)) if (t === "auto") {
2365
- let t = window.matchMedia("(prefers-color-scheme: dark)");
2366
- e.setTheme(t.matches ? "dark" : "light"), K !== t && (K?.removeEventListener("change", Ae), K = t, t.addEventListener("change", Ae));
2367
- } else K?.removeEventListener("change", Ae), K = null, e.setTheme(t);
2368
- }
2369
- function Ne() {}
2370
- function Fe(e) {
2371
- G.value = e, je(B.value, e.theme), B.value?.updateSettingsFacade(e);
2372
- }
2373
- function Ie(e, t, n) {
3196
+ dpr: G.value
3197
+ }), Ce.value = de(q.value, G.value);
3198
+ function Ct() {}
3199
+ function wt(e, t, n) {
2374
3200
  let r = e.getBoundingClientRect();
2375
3201
  return {
2376
3202
  width: Math.max(t, Math.round(r.width)),
2377
3203
  height: Math.max(n, Math.round(r.height))
2378
3204
  };
2379
3205
  }
2380
- function Le(e) {
2381
- e && h(() => {
3206
+ function Tt(e) {
3207
+ e && g(() => {
2382
3208
  if (!e.isConnected) return;
2383
- let t = Ie(e, 180, 80);
2384
- B.value?.setTooltipSize(t);
3209
+ let t = wt(e, 180, 80);
3210
+ H.value?.setTooltipSize(t);
2385
3211
  });
2386
3212
  }
2387
- function Re(e) {
2388
- e && h(() => {
2389
- e.isConnected && (Ke.value = Ie(e, 120, 60));
3213
+ function Et(e) {
3214
+ e && g(() => {
3215
+ e.isConnected && (Nt.value = wt(e, 120, 60));
2390
3216
  });
2391
3217
  }
2392
- let ze = w({
3218
+ let Dt = T({
2393
3219
  x: 0,
2394
3220
  y: 0
2395
- }), Be = w(!1), Ve = null;
2396
- function He() {
2397
- Ve = null;
3221
+ }), Ot = T(!1), kt = null;
3222
+ function At() {
3223
+ kt = null;
2398
3224
  }
2399
- function Ue(e) {
2400
- return Ve ||= e.getBoundingClientRect(), Ve;
3225
+ function jt(e) {
3226
+ return kt ||= e.getBoundingClientRect(), kt;
2401
3227
  }
2402
- let q = D({
3228
+ let X = k({
2403
3229
  crosshairPos: null,
2404
3230
  crosshairIndex: null,
2405
3231
  crosshairPrice: null,
@@ -2417,14 +3243,11 @@ var Pr = m({
2417
3243
  isHoveringPaneBoundary: !1,
2418
3244
  hoveredPaneBoundaryId: null,
2419
3245
  isHoveringRightAxis: !1
2420
- }), J = D(null), We = r(() => {
2421
- let e = U.value;
2422
- return e ? W.value.find((t) => t.id === e) ?? null : null;
2423
- }), Ge = w([]), Ke = w({
3246
+ }), Mt = T([]), Nt = T({
2424
3247
  width: 220,
2425
3248
  height: 120
2426
- }), qe = r(() => {
2427
- let e = R.value, t = z.value;
3249
+ }), Pt = r(() => {
3250
+ let e = V.value, t = re.value;
2428
3251
  return !e || !t ? {
2429
3252
  x: 0,
2430
3253
  y: 0
@@ -2432,203 +3255,102 @@ var Pr = m({
2432
3255
  x: e.offsetLeft,
2433
3256
  y: e.offsetTop
2434
3257
  };
2435
- }), Je = r(() => q.value.hoveredMarkerData), Ye = r(() => q.value.hoveredCustomMarker), Xe = r(() => q.value.isDragging), Ze = r(() => q.value.isResizingPaneBoundary), Qe = r(() => q.value.isHoveringPaneBoundary), $e = r(() => q.value.hoveredPaneBoundaryId), et = r(() => q.value.isHoveringRightAxis), tt = r(() => q.value.hoveredIndex);
2436
- r(() => q.value.crosshairIndex);
2437
- let nt = r(() => Xe.value ? "grabbing" : Ze.value || Qe.value ? "ns-resize" : tt.value === null ? "crosshair" : "pointer"), rt = r(() => {
2438
- let e = q.value.hoveredIndex;
3258
+ }), Ft = r(() => X.value.hoveredMarkerData), It = r(() => X.value.hoveredCustomMarker), Rt = r(() => X.value.isDragging), zt = r(() => X.value.isResizingPaneBoundary), Bt = r(() => X.value.isHoveringPaneBoundary), Vt = r(() => X.value.hoveredPaneBoundaryId), Ht = r(() => X.value.isHoveringRightAxis), Ut = window.matchMedia("(pointer: coarse)").matches, Wt = r(() => X.value.hoveredIndex);
3259
+ r(() => X.value.crosshairIndex);
3260
+ let Gt = r(() => Rt.value ? "grabbing" : zt.value || Bt.value ? "ns-resize" : Wt.value === null ? "crosshair" : "pointer"), Kt = r(() => {
3261
+ let e = X.value.hoveredIndex;
2439
3262
  if (typeof e != "number") return null;
2440
- ve.value;
2441
- let t = B.value?.getData();
3263
+ ye.value;
3264
+ let t = H.value?.getData();
2442
3265
  return t && e >= 0 && e < t.length ? t[e] : null;
2443
- }), it = r(() => q.value.hoveredIndex), at = r(() => q.value.tooltipPos), ot = r(() => ({
2444
- x: at.value.x + qe.value.x,
2445
- y: at.value.y + qe.value.y
2446
- })), st = r(() => ({
2447
- left: `${ot.value.x}px`,
2448
- top: `${ot.value.y}px`
2449
- })), ct = r(() => ({
2450
- x: ze.value.x + qe.value.x,
2451
- y: ze.value.y + qe.value.y
2452
- })), lt = r(() => ({
2453
- left: `${ct.value.x}px`,
2454
- top: `${ct.value.y}px`
2455
- })), ut = r(() => q.value.tooltipAnchorPlacement), dt = r(() => {
2456
- let e = B.value?.viewport.peek(), t = R.value, n = e?.plotWidth ?? (t ? t.clientWidth : 0);
2457
- return ze.value.x + 12 + Ke.value.width + 12 > n ? "left-bottom" : "right-bottom";
2458
- }), ft = r(() => (ve.value, B.value?.getData() ?? []));
2459
- function pt(e) {
2460
- J.value?.setTool(e);
2461
- }
2462
- function mt() {
2463
- de.value?.toggleMenu();
2464
- }
2465
- function ht(e) {
2466
- let t = We.value;
2467
- !t || !J.value || (J.value.updateDrawingStyle(t.id, e), W.value = J.value.getDrawings());
2468
- }
2469
- function gt() {
2470
- let e = We.value;
2471
- !e || !J.value || (J.value.removeDrawing(e.id), W.value = J.value.getDrawings());
2472
- }
2473
- function _t(e) {
2474
- B.value?.handlePointerEvent(e, { onPointerDown: (e, t) => !!J.value?.onPointerDown(e, t) });
2475
- }
2476
- function vt(e) {
2477
- let t = R.value;
3266
+ }), qt = r(() => X.value.hoveredIndex), Jt = r(() => X.value.tooltipPos), Yt = r(() => ({
3267
+ x: Jt.value.x + Pt.value.x,
3268
+ y: Jt.value.y + Pt.value.y
3269
+ })), Xt = r(() => ({
3270
+ left: `${Yt.value.x}px`,
3271
+ top: `${Yt.value.y}px`
3272
+ })), Z = r(() => ({
3273
+ x: Dt.value.x + Pt.value.x,
3274
+ y: Dt.value.y + Pt.value.y
3275
+ })), Qt = r(() => ({
3276
+ left: `${Z.value.x}px`,
3277
+ top: `${Z.value.y}px`
3278
+ })), $t = r(() => X.value.tooltipAnchorPlacement), tn = r(() => {
3279
+ let e = H.value?.viewport.peek(), t = V.value, n = e?.plotWidth ?? (t ? t.clientWidth : 0);
3280
+ return Dt.value.x + 12 + Nt.value.width + 12 > n ? "left-bottom" : "right-bottom";
3281
+ }), nn = r(() => (ye.value, H.value?.getData() ?? []));
3282
+ function rn() {
3283
+ se.value?.toggleMenu();
3284
+ }
3285
+ function on(e) {
3286
+ xe.value = e;
3287
+ }
3288
+ function sn(e) {
3289
+ if (ke.value = e, e === "range-select") {
3290
+ Y.value?.setTool("cursor"), qe.value = null;
3291
+ return;
3292
+ }
3293
+ dt(), Xe(e);
3294
+ }
3295
+ function fn(e) {
3296
+ H.value?.handlePointerEvent(e, { onPointerDown: (e, t) => !!(ft(e, t) || Y.value?.onPointerDown(e, t)) });
3297
+ }
3298
+ function pn(e) {
3299
+ let t = V.value;
2478
3300
  if (t) {
2479
- let n = Ue(t);
2480
- ze.value = {
3301
+ let n = jt(t);
3302
+ Dt.value = {
2481
3303
  x: e.clientX - n.left,
2482
3304
  y: e.clientY - n.top
2483
3305
  };
2484
3306
  }
2485
- B.value?.handlePointerEvent(e, { onPointerMove: (e, t) => J.value?.onPointerMove(e, t) ? (W.value = J.value.getDrawings(), !0) : !1 });
2486
- }
2487
- function yt(e) {
2488
- B.value?.handlePointerEvent(e, { onPointerUp: (e, t) => !!J.value?.onPointerUp(e, t) });
2489
- }
2490
- function bt(e) {
2491
- B.value?.handlePointerEvent(e);
2492
- }
2493
- function xt(e) {
2494
- B.value?.handlePointerEvent(e);
2495
- }
2496
- function St(e) {
2497
- B.value?.handlePointerEvent(e);
2498
- }
2499
- function Ct(e) {
2500
- B.value?.handlePointerEvent(e);
2501
- }
2502
- function wt(e) {
2503
- B.value?.handlePointerEvent(e);
2504
- }
2505
- function Tt() {
2506
- B.value?.handleScrollEvent();
2507
- }
2508
- let Et = w([]), Dt = r(() => {
2509
- let e = [], t = /* @__PURE__ */ new Set();
2510
- for (let n of X.value) t.has(n.indicatorId) || (t.add(n.indicatorId), e.push(n.indicatorId));
2511
- return e;
2512
- }), Ot = r(() => [...Et.value, ...Dt.value]), Y = w({}), X = w([]);
2513
- function kt() {
2514
- let e = Ce.value.main ?? 3;
2515
- return X.value.length === 0 ? [{
2516
- id: "main",
2517
- ratio: e,
2518
- visible: !0,
2519
- role: "price"
2520
- }] : [{
2521
- id: "main",
2522
- ratio: e,
2523
- visible: !0,
2524
- role: "price"
2525
- }, ...X.value.map((e) => ({
2526
- id: e.id,
2527
- ratio: Ce.value[e.id] ?? 1,
2528
- visible: !0,
2529
- role: "indicator"
2530
- }))];
3307
+ H.value?.handlePointerEvent(e, { onPointerMove: (e, t) => pt(e, t) ? !0 : Y.value?.onPointerMove(e, t) ? (Ye.value = Y.value.getDrawings(), !0) : !1 });
2531
3308
  }
2532
- function At(e) {
2533
- if (e === "VOLUME") return {};
2534
- let t = ge(e);
2535
- return t?.runtime?.defaultConfig ? { ...t.runtime.defaultConfig } : {};
3309
+ function mn(e) {
3310
+ H.value?.handlePointerEvent(e, { onPointerUp: (e, t) => !!(mt(e, t) || Y.value?.onPointerUp(e, t)) });
2536
3311
  }
2537
- function jt(e) {
2538
- if (e === "VOLUME") return !0;
2539
- let t = ge(e);
2540
- return !!t && t.category !== "main";
3312
+ function hn(e) {
3313
+ H.value?.handlePointerEvent(e);
2541
3314
  }
2542
- function Mt(e = "VOLUME", t) {
2543
- if (X.value.length >= Si) return !1;
2544
- let n = t ?? At(e);
2545
- return !!B.value?.addIndicator(e, "sub", n);
3315
+ function gn(e) {
3316
+ H.value?.handlePointerEvent(e);
2546
3317
  }
2547
- function Nt(e) {
2548
- B.value?.removeIndicator(e);
3318
+ function _n(e) {
3319
+ H.value?.handlePointerEvent(e);
2549
3320
  }
2550
- function Ft() {
2551
- for (let e of X.value) B.value?.removeIndicator(e.id);
3321
+ function vn(e) {
3322
+ H.value?.handlePointerEvent(e);
2552
3323
  }
2553
- function It() {
2554
- let e = d.semanticConfig, t = B.value;
2555
- if (!e || !t) return;
2556
- let n = e.indicators?.main;
2557
- if (n) for (let e of n) e.enabled && t.addIndicator(e.type, "main", e.params);
2558
- }
2559
- function Lt(e, t) {
2560
- let n = At(t);
2561
- B.value?.replaceSubPaneIndicator(e, t, n);
2562
- }
2563
- function Rt(e, t) {
2564
- let n = B.value;
2565
- if (!n) return;
2566
- let r = ge(e);
2567
- if (r && (r.category === "main" || r.allowMainPane)) {
2568
- let r = Et.value.find((t) => t === e);
2569
- t && !r ? n.addIndicator(e, "main", Y.value[e]) : !t && r && n.removeIndicator(e.toUpperCase());
2570
- return;
2571
- }
2572
- if (jt(e)) if (t) {
2573
- if (X.value.find((t) => t.indicatorId === e) || X.value.length >= Si) return;
2574
- if (!n.addIndicator(e, "sub", Y.value[e]) && X.value.length > 0) {
2575
- let t = X.value[X.value.length - 1];
2576
- Lt(t.id, e);
2577
- }
2578
- } else X.value.filter((t) => t.indicatorId === e).forEach((e) => {
2579
- n.removeIndicator(e.id);
2580
- });
3324
+ function yn(e) {
3325
+ H.value?.handlePointerEvent(e);
2581
3326
  }
2582
- function zt(e, t) {
2583
- if (e === "MA" || e === "BOLL" || e === "EXPMA" || e === "ENE") {
2584
- B.value?.updateIndicatorParams(e, t);
2585
- return;
2586
- }
2587
- jt(e) && X.value.filter((t) => t.indicatorId === e).forEach((e) => {
2588
- B.value?.updateIndicatorParams(e.id, t);
2589
- });
3327
+ function xn() {
3328
+ bt(), H.value?.handleScrollEvent();
2590
3329
  }
2591
- function Bt(e) {
2592
- if (!e.length || X.value.length <= 1) return;
2593
- let t = e.filter((e) => jt(e));
2594
- if (!t.length) return;
2595
- let n = new Map(X.value.map((e) => [e.indicatorId, e])), r = [];
2596
- for (let e of t) {
2597
- let t = n.get(e);
2598
- t && (r.push(t), n.delete(e));
2599
- }
2600
- if (r.length === 0) return;
2601
- for (let e of X.value) n.has(e.indicatorId) && (r.push(e), n.delete(e.indicatorId));
2602
- let i = X.value.map((e) => e.id), a = r.map((e) => e.id);
2603
- if (i.join("|") === a.join("|")) return;
2604
- X.value = r;
2605
- let o = B.value;
2606
- o && o.updatePaneLayout(kt());
2607
- }
2608
- let Vt = r(() => d.rightAxisWidth + d.priceLabelWidth), Ht = r(() => (ve.value, Se.value, be.value, xe.value, ye.value, B.value?.getContentWidth() ?? 0));
2609
- function Ut(e, t) {
2610
- B.value?.zoomToLevel(e, t);
3330
+ let Sn = r(() => d.rightAxisWidth + d.priceLabelWidth), Cn = r(() => (ye.value, we.value, q.value, Ce.value, G.value, H.value?.getContentWidth() ?? 0));
3331
+ function wn(e, t) {
3332
+ H.value?.zoomToLevel(e, t);
2611
3333
  }
2612
3334
  c({
2613
- scheduleRender: Ne,
2614
- addSubPane: Mt,
2615
- removeSubPane: Nt,
2616
- switchSubIndicator: Lt,
2617
- clearAllSubPanes: Ft,
2618
- zoomToLevel: Ut,
2619
- zoomIn: (e) => Ut(H.value + 1, e),
2620
- zoomOut: (e) => Ut(H.value - 1, e),
2621
- getZoomLevel: () => H.value,
2622
- getZoomLevelCount: () => B.value?.getZoomLevelCount() ?? 10,
2623
- getController: () => B.value
3335
+ scheduleRender: Ct,
3336
+ addSubPane: Le,
3337
+ removeSubPane: Re,
3338
+ switchSubIndicator: He,
3339
+ clearAllSubPanes: ze,
3340
+ zoomToLevel: wn,
3341
+ zoomIn: (e) => wn(K.value + 1, e),
3342
+ zoomOut: (e) => wn(K.value - 1, e),
3343
+ getZoomLevel: () => K.value,
3344
+ getZoomLevelCount: () => H.value?.getZoomLevelCount() ?? 10,
3345
+ getController: () => H.value
2624
3346
  });
2625
- function Wt() {
3347
+ function Tn() {
2626
3348
  return (e) => {
2627
- e.preventDefault(), B.value?.handleWheelEvent(e);
3349
+ e.preventDefault(), H.value?.handleWheelEvent(e);
2628
3350
  };
2629
3351
  }
2630
- function Gt(e, t, n, r) {
2631
- return le({
3352
+ function En(e, t, n, r) {
3353
+ return ce({
2632
3354
  container: e,
2633
3355
  data: [],
2634
3356
  canvasLayer: t,
@@ -2645,11 +3367,11 @@ var Pr = m({
2645
3367
  mcp: d.mcp
2646
3368
  });
2647
3369
  }
2648
- function Kt(e) {
3370
+ function Dn(e) {
2649
3371
  let t = e.paneLayout.subscribe(() => {
2650
- He();
2651
- let t = R.value && parseInt(getComputedStyle(R.value).borderTopWidth) || 0;
2652
- Ge.value = e.paneLayout.peek().slice(0, -1).map((n) => {
3372
+ At();
3373
+ let t = V.value && parseInt(getComputedStyle(V.value).borderTopWidth) || 0;
3374
+ Mt.value = e.paneLayout.peek().slice(0, -1).map((n) => {
2653
3375
  let r = e.getPaneInfo(n.id), i = (r?.top ?? 0) + (r?.height ?? 0);
2654
3376
  return {
2655
3377
  id: n.id,
@@ -2657,128 +3379,87 @@ var Pr = m({
2657
3379
  };
2658
3380
  });
2659
3381
  }), n = e.paneRatios.subscribe(() => {
2660
- Ce.value = { ...e.paneRatios.peek() };
3382
+ Te.value = { ...e.paneRatios.peek() };
2661
3383
  }), r = e.viewport.subscribe(() => {
2662
3384
  let t = e.viewport.peek();
2663
- ye.value !== t.dpr && (ye.value = t.dpr), Se.value !== t.plotWidth && (Se.value = t.plotWidth), (H.value !== t.zoomLevel || be.value !== t.kWidth || xe.value !== t.kGap) && (H.value = t.zoomLevel, be.value = t.kWidth, xe.value = t.kGap);
3385
+ Se.value++, G.value !== t.dpr && (G.value = t.dpr), we.value !== t.plotWidth && (we.value = t.plotWidth), (K.value !== t.zoomLevel || q.value !== t.kWidth || Ce.value !== t.kGap) && (K.value = t.zoomLevel, q.value = t.kWidth, Ce.value = t.kGap), g(() => {
3386
+ requestAnimationFrame(() => {
3387
+ xt();
3388
+ });
3389
+ });
2664
3390
  }), i = e.data.subscribe(() => {
2665
3391
  let t = e.data.peek();
2666
- V.value = t.length, ve.value++, O.value = t.length === 0;
3392
+ ve.value = t.length, ye.value++, O.value = t.length === 0;
2667
3393
  }), a = e.dataLoading.subscribe(() => {
2668
- E.value = e.dataLoading.peek();
3394
+ D.value = e.dataLoading.peek();
2669
3395
  }), o = e.theme.subscribe(() => {
2670
3396
  let t = e.theme.peek();
2671
- De.value = t, f("themeChange", t);
2672
- }), s = e.indicators.subscribe(() => {
2673
- let t = e.indicators.peek(), n = t.filter((e) => e.role === "main").map((e) => e.definitionId);
2674
- Et.value = n;
2675
- let r = { ...Y.value };
2676
- for (let e of t) e.role === "main" && e.params && Object.keys(e.params).length > 0 && (r[e.definitionId] = { ...e.params });
2677
- e.updateRendererConfig("mainIndicatorLegend", { indicators: {
2678
- MA: {
2679
- enabled: n.includes("MA"),
2680
- params: r.MA || {}
2681
- },
2682
- BOLL: {
2683
- enabled: n.includes("BOLL"),
2684
- params: r.BOLL || {}
2685
- },
2686
- EXPMA: {
2687
- enabled: n.includes("EXPMA"),
2688
- params: r.EXPMA || {}
2689
- },
2690
- ENE: {
2691
- enabled: n.includes("ENE"),
2692
- params: r.ENE || {}
2693
- }
2694
- } }), Y.value = r;
2695
- }), c = e.subPanes.subscribe(() => {
2696
- let t = e.subPanes.peek(), n = new Set(t.map((e) => e.paneId)), r = X.value.filter((e) => n.has(e.id)), i = new Set(r.map((e) => e.id));
2697
- for (let e of t) i.has(e.paneId) || r.push({
2698
- id: e.paneId,
2699
- indicatorId: e.indicatorId,
2700
- params: e.params
2701
- });
2702
- X.value = r;
2703
- let a = { ...Y.value };
2704
- for (let e of t) e.params && Object.keys(e.params).length > 0 && (a[e.indicatorId] = { ...e.params });
2705
- Y.value = a;
2706
- }), l = e.comparisonColors.subscribe(() => {
2707
- we.value = new Map(e.comparisonColors.peek());
2708
- }), u = e.comparisonLoading.subscribe(() => {
2709
- Te.value = e.comparisonLoading.peek();
3397
+ le.value = t, f("themeChange", t);
3398
+ }), s = Ke(e), c = e.comparisonColors.subscribe(() => {
3399
+ De.value = new Map(e.comparisonColors.peek());
3400
+ }), l = e.comparisonLoading.subscribe(() => {
3401
+ Oe.value = e.comparisonLoading.peek();
2710
3402
  });
2711
- x(() => {
2712
- r(), i(), a(), n(), t(), o(), s(), c(), l(), u(), K?.removeEventListener("change", Ae);
3403
+ S(() => {
3404
+ r(), i(), a(), n(), t(), o(), s(), c(), l();
2713
3405
  });
2714
3406
  }
2715
- function qt(e) {
2716
- let t = ue.value?.getSettings() ?? { showVolumePriceMarkers: !0 };
2717
- G.value = t, je(e, t.theme), e.updateSettingsFacade(t);
2718
- }
2719
- function Z(e) {
2720
- J.value = new se(e), J.value.setCallbacks({
2721
- onDrawingCreated: (e) => {
2722
- W.value = [...W.value, e], U.value = e.id;
2723
- },
2724
- onToolChange: () => {},
2725
- onDrawingSelected: (e) => {
2726
- U.value = e?.id ?? null;
2727
- }
2728
- });
3407
+ function On(e) {
3408
+ let t = oe.value?.getSettings() ?? { showVolumePriceMarkers: !0 };
3409
+ U.value = t, W(t.theme), e.updateSettingsFacade(t);
2729
3410
  }
2730
- function Yt(e) {
2731
- e.setTooltipAnchorPositioning(Be.value), e.interactionState.subscribe(() => {
2732
- q.value = e.interactionState.peek();
2733
- }), q.value = e.interactionState.peek(), ye.value = e.viewport.peek().dpr;
3411
+ function kn(e) {
3412
+ e.setTooltipAnchorPositioning(Ot.value), e.interactionState.subscribe(() => {
3413
+ X.value = e.interactionState.peek();
3414
+ }), X.value = e.interactionState.peek(), G.value = e.viewport.peek().dpr;
2734
3415
  }
2735
- function Xt(e) {
2736
- e.setDataFetcher(d.dataFetcher), pe.value = new he(e), pe.value.on("config:error", (e) => {
3416
+ function An(e) {
3417
+ e.setDataFetcher(d.dataFetcher), _e.value = new me(e), _e.value.on("config:error", (e) => {
2737
3418
  console.error("Semantic config error:", e);
2738
- }), pe.value.on("config:ready", () => {
2739
- It(), h(() => B.value?.scrollToRight());
3419
+ }), _e.value.on("config:ready", () => {
3420
+ Ve(d.semanticConfig), g(() => H.value?.scrollToRight());
2740
3421
  });
2741
3422
  }
2742
- return y(async () => {
2743
- Be.value = !1;
2744
- let e = R.value, t = z.value;
3423
+ return b(async () => {
3424
+ Ot.value = !1;
3425
+ let e = V.value, t = re.value;
2745
3426
  if (!e || !t) return;
2746
- let n = Wt();
3427
+ let n = Tn();
2747
3428
  e.addEventListener("wheel", n, { passive: !1 });
2748
- let r = e.querySelector(".canvas-layer"), i = e.querySelector(".x-axis-canvas"), a = await Gt(e, r, t.querySelector(".right-axis-host"), i);
2749
- !R.value || !z.value || (B.value = a, Kt(a), It(), qt(a), Z(a), Yt(a), Xt(a));
2750
- }), x(() => {
2751
- let e = B.value;
2752
- e && (B.value = null, e.dispose()), J.value = null;
2753
- }), M(() => d.yPaddingPx, (e) => {
2754
- B.value?.updateOptionsFacade({ yPaddingPx: e });
2755
- }), M(() => d.semanticConfig, async (e, t) => {
3429
+ let r = e.querySelector(".canvas-layer"), i = e.querySelector(".x-axis-canvas"), a = await En(e, r, t.querySelector(".right-axis-host"), i);
3430
+ !V.value || !re.value || (H.value = a, Dn(a), Ve(d.semanticConfig), On(a), $e(a), kn(a), An(a));
3431
+ }), S(() => {
3432
+ let e = H.value;
3433
+ e && (H.value = null, e.dispose()), Y.value = null;
3434
+ }), P(() => d.yPaddingPx, (e) => {
3435
+ H.value?.updateOptionsFacade({ yPaddingPx: e });
3436
+ }), P(() => d.semanticConfig, async (e, t) => {
2756
3437
  if (e && e !== t) {
2757
- let t = await pe.value?.applyConfig(e);
3438
+ let t = await _e.value?.applyConfig(e);
2758
3439
  t && !t.success && console.error("Semantic config apply failed:", t.errors);
2759
3440
  }
2760
- }, { deep: !0 }), (r, c) => (S(), o("div", {
3441
+ }, { deep: !0 }), (r, c) => (C(), o("div", {
2761
3442
  ref_key: "chartWrapperRef",
2762
3443
  ref: ie,
2763
3444
  class: "chart-wrapper",
2764
- "data-theme": De.value,
2765
- style: _(ke.value)
3445
+ "data-theme": j(le),
3446
+ style: v(j(fe))
2766
3447
  }, [
2767
- l(_i, {
2768
- symbol: b.value,
3448
+ l(Ii, {
3449
+ symbol: x.value,
2769
3450
  "k-line-level": p.value,
2770
- "k-line-adjust": m.value,
2771
- "symbol-loading": E.value,
3451
+ "k-line-adjust": h.value,
3452
+ "symbol-loading": D.value,
2772
3453
  "symbol-error": O.value,
2773
- "overlay-symbols": k.value,
2774
- "comparison-colors": we.value,
2775
- "comparison-loading": Te.value,
2776
- onAddOverlaySymbol: F,
2777
- onRemoveOverlaySymbol: I,
2778
- onKLineLevelChange: j,
2779
- onKLineAdjustChange: N,
2780
- onToggleIndicator: mt,
2781
- onSymbolChange: P
3454
+ "overlay-symbols": A.value,
3455
+ "comparison-colors": De.value,
3456
+ "comparison-loading": Oe.value,
3457
+ onAddOverlaySymbol: z,
3458
+ onRemoveOverlaySymbol: ee,
3459
+ onKLineLevelChange: N,
3460
+ onKLineAdjustChange: I,
3461
+ onToggleIndicator: rn,
3462
+ onSymbolChange: L
2782
3463
  }, null, 8, [
2783
3464
  "symbol",
2784
3465
  "k-line-level",
@@ -2789,82 +3470,126 @@ var Pr = m({
2789
3470
  "comparison-colors",
2790
3471
  "comparison-loading"
2791
3472
  ]),
2792
- s("div", { class: g(["chart-stage", {
2793
- "is-dragging": Xe.value,
2794
- "is-resizing-pane": Ze.value,
2795
- "is-hovering-pane-separator": Qe.value,
2796
- "is-hovering-right-axis": et.value,
2797
- "is-hovering-kline": tt.value !== null
2798
- }]) }, [l(kr, {
3473
+ s("div", { class: _(["chart-stage", {
3474
+ "is-dragging": Rt.value,
3475
+ "is-resizing-pane": zt.value,
3476
+ "is-hovering-pane-separator": Bt.value,
3477
+ "is-hovering-right-axis": Ht.value,
3478
+ "is-hovering-kline": Wt.value !== null
3479
+ }]) }, [l(Zr, {
2799
3480
  ref_key: "toolbarRef",
2800
- ref: ue,
3481
+ ref: oe,
2801
3482
  "is-fullscreen": n.isFullscreen,
2802
- onSelectTool: pt,
3483
+ onSelectTool: sn,
2803
3484
  onToggleFullscreen: c[0] ||= (e) => r.$emit("toggleFullscreen"),
2804
- onZoomIn: c[1] ||= (e) => Ut(H.value + 1),
2805
- onZoomOut: c[2] ||= (e) => Ut(H.value - 1),
2806
- onSettingsChange: Fe
2807
- }, null, 8, ["is-fullscreen"]), s("div", {
3485
+ onZoomIn: c[1] ||= (e) => wn(K.value + 1),
3486
+ onZoomOut: c[2] ||= (e) => wn(K.value - 1),
3487
+ onSettingsChange: j(he)
3488
+ }, null, 8, ["is-fullscreen", "onSettingsChange"]), s("div", {
2808
3489
  class: "chart-main",
2809
3490
  ref_key: "chartMainRef",
2810
- ref: z
3491
+ ref: re
2811
3492
  }, [
2812
- s("div", yi, [(S(!0), o(e, null, T(Ge.value, (e) => (S(), o("div", {
3493
+ s("div", Wi, [(C(!0), o(e, null, E(Mt.value, (e) => (C(), o("div", {
2813
3494
  key: e.id,
2814
- class: g(["pane-separator-line", { "is-active": $e.value === e.id }]),
2815
- style: _({ top: `${e.top}px` })
3495
+ class: _(["pane-separator-line", { "is-active": Vt.value === e.id }]),
3496
+ style: v({ top: `${e.top}px` })
2816
3497
  }, null, 6))), 128))]),
2817
3498
  s("div", {
2818
3499
  ref_key: "tooltipLayerRef",
2819
- ref: ce,
3500
+ ref: ae,
2820
3501
  class: "tooltip-layer"
2821
3502
  }, null, 512),
2822
3503
  s("div", {
2823
3504
  class: "chart-container",
2824
- style: _({ cursor: nt.value }),
3505
+ style: v({ cursor: Gt.value }),
2825
3506
  ref_key: "containerRef",
2826
- ref: R,
2827
- onScrollPassive: Tt,
2828
- onPointerdown: _t,
2829
- onPointermove: vt,
2830
- onPointerup: yt,
2831
- onPointerleave: bt
3507
+ ref: V,
3508
+ onScrollPassive: xn,
3509
+ onPointerdown: fn,
3510
+ onPointermove: pn,
3511
+ onPointerup: mn,
3512
+ onPointerleave: hn
2832
3513
  }, [s("div", {
2833
3514
  class: "scroll-content",
2834
- style: _({ width: Ht.value + "px" })
2835
- }, [s("div", bi, [s("canvas", xi, null, 512), We.value ? (S(), i(Me, {
3515
+ style: v({ width: Cn.value + "px" })
3516
+ }, [s("div", Gi, [s("canvas", Ki, null, 512), l(cn, null, {
3517
+ default: F(() => [j(at) ? (C(), i(an, {
3518
+ key: 0,
3519
+ "start-date": j(tt),
3520
+ "onUpdate:startDate": c[3] ||= (e) => m(tt) ? tt.value = e : null,
3521
+ "end-date": j(nt),
3522
+ "onUpdate:endDate": c[4] ||= (e) => m(nt) ? nt.value = e : null,
3523
+ "start-label": j(ct),
3524
+ "end-label": j(lt),
3525
+ count: j(st),
3526
+ onExport: j(ht),
3527
+ onClear: j(dt),
3528
+ onBatchSetting: c[5] ||= (e) => be.value = !0
3529
+ }, null, 8, [
3530
+ "start-date",
3531
+ "end-date",
3532
+ "start-label",
3533
+ "end-label",
3534
+ "count",
3535
+ "onExport",
3536
+ "onClear"
3537
+ ])) : a("", !0), j(Je) ? (C(), i(Be, {
3538
+ key: 1,
3539
+ drawing: j(Je),
3540
+ onUpdateStyle: j(Ze),
3541
+ onDelete: j(Qe)
3542
+ }, null, 8, [
3543
+ "drawing",
3544
+ "onUpdateStyle",
3545
+ "onDelete"
3546
+ ])) : a("", !0)]),
3547
+ _: 1
3548
+ })], 512), j(ut) ? (C(), o("div", {
3549
+ key: 0,
3550
+ class: _(["range-selection-overlay", { "is-dragging": j(et).isDragging }]),
3551
+ style: v(j(ut)),
3552
+ "aria-label": "已选择的 K 线区间"
3553
+ }, [j(at) ? (C(), o("div", {
2836
3554
  key: 0,
2837
- drawing: We.value,
2838
- onUpdateStyle: ht,
2839
- onDelete: gt
2840
- }, null, 8, ["drawing"])) : a("", !0)], 512)], 4)], 36),
2841
- ce.value ? (S(), i(t, {
3555
+ class: "range-selection-handle range-selection-handle--left",
3556
+ onPointerdown: c[6] ||= R((e) => j(_t)("left", e), ["stop"]),
3557
+ onPointermove: c[7] ||= R((e) => j(vt)(e), ["stop"]),
3558
+ onPointerup: c[8] ||= R((e) => j(yt)(e), ["stop"])
3559
+ }, null, 32)) : a("", !0), j(at) ? (C(), o("div", {
3560
+ key: 1,
3561
+ class: "range-selection-handle range-selection-handle--right",
3562
+ onPointerdown: c[9] ||= R((e) => j(_t)("right", e), ["stop"]),
3563
+ onPointermove: c[10] ||= R((e) => j(vt)(e), ["stop"]),
3564
+ onPointerup: c[11] ||= R((e) => j(yt)(e), ["stop"])
3565
+ }, null, 32)) : a("", !0)], 6)) : a("", !0)], 4)], 36),
3566
+ ae.value ? (C(), i(t, {
2842
3567
  key: 0,
2843
- to: ce.value
3568
+ to: ae.value
2844
3569
  }, [
2845
- rt.value ? (S(), o("div", {
3570
+ Kt.value && !j(Ut) ? (C(), o("div", {
2846
3571
  key: 0,
2847
- class: g(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": Be.value }]),
2848
- style: _(st.value)
3572
+ class: _(["tooltip-anchor kline-tooltip-anchor", { "use-anchor": Ot.value }]),
3573
+ style: v(Xt.value)
2849
3574
  }, null, 6)) : a("", !0),
2850
- Je.value || Ye.value ? (S(), o("div", {
3575
+ Ft.value || It.value ? (C(), o("div", {
2851
3576
  key: 1,
2852
- class: g(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": Be.value }]),
2853
- style: _(lt.value)
3577
+ class: _(["tooltip-anchor marker-tooltip-anchor", { "use-anchor": Ot.value }]),
3578
+ style: v(Qt.value)
2854
3579
  }, null, 6)) : a("", !0),
2855
- rt.value ? (S(), i(Jt, {
3580
+ Kt.value && !j(Ut) ? (C(), i(Zt, {
2856
3581
  key: 2,
2857
- k: rt.value,
2858
- index: it.value,
2859
- data: ft.value,
2860
- pos: ot.value,
2861
- "set-el": Le,
2862
- "use-anchor": Be.value,
2863
- "anchor-placement": ut.value,
2864
- "up-color": Oe.value.upColor,
2865
- "down-color": Oe.value.downColor,
3582
+ k: Kt.value,
3583
+ index: qt.value,
3584
+ data: nn.value,
3585
+ pos: Yt.value,
3586
+ "set-el": Tt,
3587
+ "use-anchor": Ot.value,
3588
+ "anchor-placement": $t.value,
3589
+ "up-color": j(ue).upColor,
3590
+ "down-color": j(ue).downColor,
2866
3591
  timezone: d.timezone,
2867
- "show-time": v.value
3592
+ "show-time": y.value
2868
3593
  }, null, 8, [
2869
3594
  "k",
2870
3595
  "index",
@@ -2877,13 +3602,13 @@ var Pr = m({
2877
3602
  "timezone",
2878
3603
  "show-time"
2879
3604
  ])) : a("", !0),
2880
- Je.value || Ye.value ? (S(), i(Zt, {
3605
+ Ft.value || It.value ? (C(), i(en, {
2881
3606
  key: 3,
2882
- marker: Je.value || Ye.value,
2883
- pos: ct.value,
2884
- "use-anchor": Be.value,
2885
- "anchor-placement": dt.value,
2886
- "set-el": Re
3607
+ marker: Ft.value || It.value,
3608
+ pos: Z.value,
3609
+ "use-anchor": Ot.value,
3610
+ "anchor-placement": tn.value,
3611
+ "set-el": Et
2887
3612
  }, null, 8, [
2888
3613
  "marker",
2889
3614
  "pos",
@@ -2894,27 +3619,42 @@ var Pr = m({
2894
3619
  s("div", {
2895
3620
  class: "right-axis-host",
2896
3621
  ref: "rightAxisLayerRef",
2897
- style: _({ width: Vt.value + "px" }),
2898
- onPointerdown: xt,
2899
- onPointermove: St,
2900
- onPointerup: Ct,
2901
- onPointerleave: wt
3622
+ style: v({ width: Sn.value + "px" }),
3623
+ onPointerdown: gn,
3624
+ onPointermove: _n,
3625
+ onPointerup: vn,
3626
+ onPointerleave: yn
2902
3627
  }, null, 36)
2903
3628
  ], 512)], 2),
2904
- l(Pt, {
3629
+ l(Hi, {
3630
+ progress: j(gt),
3631
+ onClose: c[12] ||= (e) => gt.value = null
3632
+ }, null, 8, ["progress"]),
3633
+ l(Li, {
3634
+ show: be.value,
3635
+ onClose: c[13] ||= (e) => be.value = !1,
3636
+ onApply: on
3637
+ }, null, 8, ["show"]),
3638
+ l(Lt, {
2905
3639
  ref_key: "indicatorSelectorRef",
2906
- ref: de,
2907
- "active-indicators": Ot.value,
2908
- "indicator-params": Y.value,
2909
- onToggle: Rt,
2910
- onUpdateParams: zt,
2911
- onReorderSubIndicators: Bt
2912
- }, null, 8, ["active-indicators", "indicator-params"])
2913
- ], 12, vi));
3640
+ ref: se,
3641
+ "active-indicators": j(Me),
3642
+ "indicator-params": j(Ne),
3643
+ onToggle: j(Ue),
3644
+ onUpdateParams: j(We),
3645
+ onReorderSubIndicators: j(Ge)
3646
+ }, null, 8, [
3647
+ "active-indicators",
3648
+ "indicator-params",
3649
+ "onToggle",
3650
+ "onUpdateParams",
3651
+ "onReorderSubIndicators"
3652
+ ])
3653
+ ], 12, Ui));
2914
3654
  }
2915
- }), [["__scopeId", "data-v-62fe928b"]]), wi = {
3655
+ }), [["__scopeId", "data-v-44244ba7"]]), Ji = {
2916
3656
  name: "@363045841yyt/klinechart",
2917
- version: "0.8.4",
3657
+ version: "0.8.6",
2918
3658
  description: "Vue 3 bindings for @363045841yyt/klinechart-core. Idiomatic composables, SFC components.",
2919
3659
  license: "MIT",
2920
3660
  repository: {
@@ -2987,25 +3727,25 @@ var Pr = m({
2987
3727
  vitest: "^4.1.8",
2988
3728
  vue: "^3.5.35"
2989
3729
  }
2990
- }.version, Ti = null;
2991
- function Ei(e) {
2992
- Ti = e;
3730
+ }.version, Yi = null;
3731
+ function Xi(e) {
3732
+ Yi = e;
2993
3733
  }
2994
- function Di(e) {
3734
+ function Zi(e) {
2995
3735
  if (e.container == null) throw Error("[@363045841yyt/klinechart] createChart: `container` is required and must be a non-null HTMLElement");
2996
- if (Ti === null) throw Error("[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).");
2997
- return Ti(e);
3736
+ if (Yi === null) throw Error("[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).");
3737
+ return Yi(e);
2998
3738
  }
2999
3739
  function $(e) {
3000
- let t = D(e.peek());
3001
- return b(e.subscribe(() => {
3740
+ let t = k(e.peek());
3741
+ return x(e.subscribe(() => {
3002
3742
  t.value = e.peek();
3003
3743
  })), t;
3004
3744
  }
3005
- function Oi(e, t) {
3006
- let n = D(null), r = !1, i = (e) => {
3745
+ function Qi(e, t) {
3746
+ let n = k(null), r = !1, i = (e) => {
3007
3747
  if (e == null || n.value != null) return;
3008
- let i = Di({
3748
+ let i = Zi({
3009
3749
  ...t,
3010
3750
  container: e
3011
3751
  }), a = (e) => {
@@ -3018,7 +3758,7 @@ function Oi(e, t) {
3018
3758
  typeof i.then == "function" ? i.then(a) : a(i);
3019
3759
  };
3020
3760
  i(e.value);
3021
- let a = M(e, (e) => {
3761
+ let a = P(e, (e) => {
3022
3762
  i(e);
3023
3763
  }, {
3024
3764
  immediate: !0,
@@ -3028,11 +3768,11 @@ function Oi(e, t) {
3028
3768
  let e = n.value;
3029
3769
  e != null && (e.dispose(), n.value = null);
3030
3770
  };
3031
- return b(o), v(o), { chart: n };
3771
+ return x(o), y(o), { chart: n };
3032
3772
  }
3033
- function ki(e) {
3034
- let t = D(e.indicators.peek());
3035
- return b(e.indicators.subscribe(() => {
3773
+ function $i(e) {
3774
+ let t = k(e.indicators.peek());
3775
+ return x(e.indicators.subscribe(() => {
3036
3776
  t.value = e.indicators.peek();
3037
3777
  })), {
3038
3778
  indicators: t,
@@ -3041,27 +3781,27 @@ function ki(e) {
3041
3781
  updateParams: e.updateIndicatorParams.bind(e)
3042
3782
  };
3043
3783
  }
3044
- function Ai(e) {
3045
- let t = D(e.interactionState.peek());
3046
- return b(e.interactionState.subscribe(() => {
3784
+ function ea(e) {
3785
+ let t = k(e.interactionState.peek());
3786
+ return x(e.interactionState.subscribe(() => {
3047
3787
  t.value = e.interactionState.peek();
3048
3788
  })), t;
3049
3789
  }
3050
- function ji(e) {
3051
- let t = D(e.paneRatios.peek());
3052
- return b(e.paneRatios.subscribe(() => {
3790
+ function ta(e) {
3791
+ let t = k(e.paneRatios.peek());
3792
+ return x(e.paneRatios.subscribe(() => {
3053
3793
  t.value = e.paneRatios.peek();
3054
3794
  })), t;
3055
3795
  }
3056
- function Mi(e) {
3057
- let t = D(e.viewport.peek());
3058
- return b(e.viewport.subscribe(() => {
3796
+ function na(e) {
3797
+ let t = k(e.viewport.peek());
3798
+ return x(e.viewport.subscribe(() => {
3059
3799
  t.value = e.viewport.peek();
3060
3800
  })), t;
3061
3801
  }
3062
- function Ni(e) {
3063
- let t = R({ catalog: e.catalog });
3064
- b(() => t.dispose());
3802
+ function ra(e) {
3803
+ let t = B({ catalog: e.catalog });
3804
+ x(() => t.dispose());
3065
3805
  let n = $(t.filteredMain), r = $(t.filteredSub), i = $(t.menuOpen), a = $(t.searchQuery);
3066
3806
  function o(t) {
3067
3807
  let n = e.catalog.find((e) => e.id === t);
@@ -3088,7 +3828,7 @@ function Ni(e) {
3088
3828
  isActive: c
3089
3829
  };
3090
3830
  }
3091
- var Pi = u({
3831
+ var ia = u({
3092
3832
  name: "KLineChart",
3093
3833
  props: {
3094
3834
  data: {
@@ -3117,7 +3857,7 @@ var Pi = u({
3117
3857
  zoomLevelChange: (e, t) => !0
3118
3858
  },
3119
3859
  setup(e, { emit: t, expose: n }) {
3120
- let r = D(null), i = d(), a = D(null), o = !0, s = (e) => {
3860
+ let r = k(null), i = d(), a = k(null), o = !0, s = (e) => {
3121
3861
  if (!o) {
3122
3862
  e.dispose();
3123
3863
  return;
@@ -3127,12 +3867,12 @@ var Pi = u({
3127
3867
  let n = e.viewport.peek();
3128
3868
  t("zoomLevelChange", n.zoomLevel, n.kWidth);
3129
3869
  };
3130
- n(), b(e.viewport.subscribe(n));
3870
+ n(), x(e.viewport.subscribe(n));
3131
3871
  };
3132
- y(() => {
3872
+ b(() => {
3133
3873
  let t = r.value;
3134
3874
  t != null && (i.run(() => {
3135
- let n = Di({
3875
+ let n = Zi({
3136
3876
  container: t,
3137
3877
  data: e.data,
3138
3878
  initialZoomLevel: e.initialZoomLevel,
@@ -3140,12 +3880,12 @@ var Pi = u({
3140
3880
  theme: e.theme
3141
3881
  });
3142
3882
  typeof n.then == "function" ? n.then(s) : s(n);
3143
- }), M(() => e.data, (e) => {
3883
+ }), P(() => e.data, (e) => {
3144
3884
  a.value?.setData(e);
3145
- }), M(() => e.theme, (e) => {
3885
+ }), P(() => e.theme, (e) => {
3146
3886
  a.value?.setTheme(e);
3147
3887
  }));
3148
- }), x(() => {
3888
+ }), S(() => {
3149
3889
  o = !1, a.value?.dispose(), a.value = null, i.stop();
3150
3890
  }), n({
3151
3891
  getController: () => a.value,
@@ -3172,9 +3912,9 @@ var Pi = u({
3172
3912
  }
3173
3913
  });
3174
3914
  }
3175
- }), Fi = { install(e) {
3176
- e.component("KLineChart", Pi);
3915
+ }), aa = { install(e) {
3916
+ e.component("KLineChart", ia);
3177
3917
  } };
3178
- Ei(te);
3918
+ Xi(te);
3179
3919
  //#endregion
3180
- export { ee as CORE_VERSION, Me as DrawingStyleToolbar, Ze as IndicatorParams, Pt as IndicatorSelector, Pi as KLineChart, Ci as KLineChartVue, Jt as KLineTooltip, Fi as KMapPlugin, kr as LeftToolbar, Zt as MarkerTooltip, wi as VERSION, Ei as __setControllerFactory, $ as coreSignalToVueRef, Di as createChart, Oi as useChart, Ni as useIndicatorSelector, ki as useIndicators, Ai as useInteractionState, ji as usePaneRatios, Mi as useViewport };
3920
+ export { ee as CORE_VERSION, Be as DrawingStyleToolbar, at as IndicatorParams, Lt as IndicatorSelector, ia as KLineChart, qi as KLineChartVue, Zt as KLineTooltip, aa as KMapPlugin, Zr as LeftToolbar, en as MarkerTooltip, Ji as VERSION, Xi as __setControllerFactory, $ as coreSignalToVueRef, Zi as createChart, Qi as useChart, ra as useIndicatorSelector, $i as useIndicators, ea as useInteractionState, ta as usePaneRatios, na as useViewport };