@363045841yyt/klinechart 0.7.3-alpha.2 → 0.7.3-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/KLineChart.vue.d.ts +8 -8
- package/dist/index.cjs +2 -2
- package/dist/index.js +45 -44
- package/dist/klinechart.css +1 -1
- package/package.json +76 -75
- package/src/components/IndicatorSelector.vue +1 -1
- package/src/components/LeftToolbar.vue +44 -44
- package/LICENSE +0 -21
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { SemanticChartConfig, DataFetcher } from '../../../core/src/semantic/index.ts';
|
|
2
2
|
import { SubIndicatorType } from '../../../core/src/engine/renderers/Indicator/index.ts';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
/**
|
|
4
|
+
/** 语义化配置(必需,唯一控制源) */
|
|
5
5
|
semanticConfig: SemanticChartConfig;
|
|
6
|
-
/**
|
|
6
|
+
/** 数据获取函数(必需)。框架不绑定数据源,由使用者注入。 */
|
|
7
7
|
dataFetcher: DataFetcher;
|
|
8
8
|
yPaddingPx?: number;
|
|
9
9
|
minKWidth?: number;
|
|
10
10
|
maxKWidth?: number;
|
|
11
|
-
/**
|
|
11
|
+
/** 右侧价格轴宽度 */
|
|
12
12
|
rightAxisWidth?: number;
|
|
13
|
-
/**
|
|
13
|
+
/** 底部时间轴高度 */
|
|
14
14
|
bottomAxisHeight?: number;
|
|
15
|
-
/**
|
|
15
|
+
/** 价格标签额外宽度(用于显示涨跌幅,默认 60px) */
|
|
16
16
|
priceLabelWidth?: number;
|
|
17
|
-
/**
|
|
17
|
+
/** 缩放级别数量(默认 10) */
|
|
18
18
|
zoomLevels?: number;
|
|
19
|
-
/**
|
|
19
|
+
/** 初始缩放级别(1 ~ zoomLevels,默认居中) */
|
|
20
20
|
initialZoomLevel?: number;
|
|
21
|
-
/**
|
|
21
|
+
/** 是否全屏 */
|
|
22
22
|
isFullscreen?: boolean;
|
|
23
23
|
};
|
|
24
24
|
declare function scheduleRender(): void;
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("vue"),t=require("@363045841yyt/klinechart-core/engine/renderers/Indicator/indicatorData"),n=require("@363045841yyt/klinechart-core/semantic"),r=require("@363045841yyt/klinechart-core/engine/chart"),i=require("@363045841yyt/klinechart-core/engine/chart-store"),a=require("@363045841yyt/klinechart-core/engine/utils/zoom"),o=require("@363045841yyt/klinechart-core/engine/utils/klineConfig"),s=require("@363045841yyt/klinechart-core/engine/renderers/Indicator/subPaneConfig"),c=require("@363045841yyt/klinechart-core/engine/renderers/paneTitle"),l=require("@363045841yyt/klinechart-core/config"),u=require("@363045841yyt/klinechart-core/engine/drawing"),d=require("@363045841yyt/klinechart-core");var f={class:`toolbar-item color-item`,title:`颜色`},p=[`value`],m=[`value`],h=[`value`],g=(0,e.defineComponent)({__name:`DrawingStyleToolbar`,props:{drawing:{}},emits:[`updateStyle`,`delete`],setup(t,{emit:n}){let r=n;function i(e){e.key===`Delete`&&(e.preventDefault(),r(`delete`))}(0,e.onMounted)(()=>document.addEventListener(`keydown`,i)),(0,e.onUnmounted)(()=>document.removeEventListener(`keydown`,i));function a(e){r(`updateStyle`,{stroke:e})}function o(e){r(`updateStyle`,{strokeWidth:e})}function s(e){r(`updateStyle`,{strokeStyle:e})}return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`drawing-style-toolbar`,onPointerdown:r[4]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[5]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[6]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createElementVNode)(`div`,f,[(0,e.createElementVNode)(`span`,{class:`color-swatch`,style:(0,e.normalizeStyle)({background:t.drawing.style.stroke??`#2962ff`})},null,4),(0,e.createElementVNode)(`input`,{type:`color`,class:`color-input`,value:t.drawing.style.stroke??`#2962ff`,onInput:r[0]||=e=>a(e.target.value)},null,40,p)]),(0,e.createElementVNode)(`select`,{class:`toolbar-select`,value:t.drawing.style.strokeWidth??1,onChange:r[1]||=e=>o(Number(e.target.value)),title:`线宽`},[...r[7]||=[(0,e.createElementVNode)(`option`,{value:1},`1px`,-1),(0,e.createElementVNode)(`option`,{value:2},`2px`,-1),(0,e.createElementVNode)(`option`,{value:3},`3px`,-1),(0,e.createElementVNode)(`option`,{value:4},`4px`,-1)]],40,m),(0,e.createElementVNode)(`select`,{class:`toolbar-select`,value:t.drawing.style.strokeStyle??`solid`,onChange:r[2]||=e=>s(e.target.value),title:`线型`},[...r[8]||=[(0,e.createElementVNode)(`option`,{value:`solid`},`实线`,-1),(0,e.createElementVNode)(`option`,{value:`dashed`},`虚线`,-1),(0,e.createElementVNode)(`option`,{value:`dotted`},`点线`,-1)]],40,h),(0,e.createElementVNode)(`button`,{type:`button`,class:`toolbar-btn delete-btn`,title:`删除`,onClick:r[3]||=e=>n.$emit(`delete`)},[...r[9]||=[(0,e.createElementVNode)(`svg`,{class:`delete-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[(0,e.createElementVNode)(`path`,{d:`M3 6h18`}),(0,e.createElementVNode)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,e.createElementVNode)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`})],-1)]])],32))}}),_=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},v=_(g,[[`__scopeId`,`data-v-87e91714`]]),y={class:`params-header`},b={class:`header-left`},x={class:`params-title`},S={class:`header-right`},C={key:0,class:`indicator-description`},w={class:`params-body`},T={class:`param-header`},E={class:`param-label`},ee={class:`param-label-text`},te={key:0,class:`param-range`},ne={class:`input-wrapper`},D=[`disabled`,`onClick`],O=[`value`,`min`,`max`,`step`,`onInput`],re=[`disabled`,`onClick`],k={key:0,class:`param-description`},ie={class:`params-footer`},ae={class:`footer-right`},oe=_((0,e.defineComponent)({__name:`IndicatorParams`,props:{visible:{type:Boolean},indicatorId:{},indicatorName:{},indicatorDescription:{},params:{},values:{}},emits:[`close`,`confirm`],setup(t,{emit:n}){let r=t,i=n,a=(0,e.ref)({...r.values}),o=(0,e.ref)(!0),s=(0,e.computed)(()=>`body`);(0,e.watch)(()=>r.values,e=>{a.value={...e}},{deep:!0,immediate:!0}),(0,e.watch)(()=>r.visible,e=>{e&&(a.value={...r.values})});function c(e,t){let n=t.target,r=parseFloat(n.value);isNaN(r)||(a.value[e]=r)}function l(e,t){let n=e.step||1,r=(a.value[e.key]||0)+t*n;e.min!==void 0&&(r=Math.max(e.min,r)),e.max!==void 0&&(r=Math.min(e.max,r)),a.value[e.key]=parseFloat(r.toFixed(10))}function u(){let e={};r.params.forEach(t=>{e[t.key]=t.default??r.values[t.key]??0}),a.value=e}function d(){i(`confirm`,{...a.value})}return(n,r)=>((0,e.openBlock)(),(0,e.createBlock)(e.Teleport,{to:s.value},[(0,e.createVNode)(e.Transition,{name:`overlay`},{default:(0,e.withCtx)(()=>[t.visible?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`params-overlay`,onClick:r[4]||=e=>n.$emit(`close`)},[(0,e.createVNode)(e.Transition,{name:`modal`},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,{class:`indicator-params`,onClick:r[3]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createElementVNode)(`div`,y,[(0,e.createElementVNode)(`div`,b,[(0,e.createElementVNode)(`span`,x,(0,e.toDisplayString)(t.indicatorName),1),r[5]||=(0,e.createElementVNode)(`span`,{class:`params-subtitle`},`参数设置`,-1)]),(0,e.createElementVNode)(`div`,S,[(0,e.createElementVNode)(`button`,{class:(0,e.normalizeClass)([`toggle-desc-btn`,{active:o.value}]),onClick:r[0]||=e=>o.value=!o.value,title:`显示/隐藏说明`},[...r[6]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 1024 1024`},[(0,e.createElementVNode)(`path`,{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`,fill:`currentColor`})],-1)]],2),(0,e.createElementVNode)(`button`,{class:`params-close`,onClick:r[1]||=e=>n.$emit(`close`)},[...r[7]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M18 6L6 18M6 6l12 12`})],-1)]])])]),(0,e.createVNode)(e.Transition,{name:`slide`},{default:(0,e.withCtx)(()=>[o.value&&t.indicatorDescription?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,C,[(0,e.createElementVNode)(`p`,null,(0,e.toDisplayString)(t.indicatorDescription),1)])):(0,e.createCommentVNode)(``,!0)]),_:1}),(0,e.createElementVNode)(`div`,w,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.params,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.key,class:(0,e.normalizeClass)([`param-item`,{"has-desc":o.value&&t.description}])},[(0,e.createElementVNode)(`div`,T,[(0,e.createElementVNode)(`label`,E,[(0,e.createElementVNode)(`span`,ee,(0,e.toDisplayString)(t.label),1),t.min!==void 0||t.max!==void 0?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,te,(0,e.toDisplayString)(t.min??`-∞`)+` ~ `+(0,e.toDisplayString)(t.max??`+∞`),1)):(0,e.createCommentVNode)(``,!0)]),(0,e.createElementVNode)(`div`,ne,[(0,e.createElementVNode)(`button`,{class:`stepper-btn`,disabled:t.min!==void 0&&(a.value[t.key]??0)<=t.min,onClick:e=>l(t,-1)},` − `,8,D),t.type===`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`input`,{key:0,type:`number`,class:`param-input`,value:a.value[t.key],min:t.min,max:t.max,step:t.step||1,onInput:e=>c(t.key,e)},null,40,O)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`button`,{class:`stepper-btn`,disabled:t.max!==void 0&&(a.value[t.key]??0)>=t.max,onClick:e=>l(t,1)},` + `,8,re)])]),(0,e.createVNode)(e.Transition,{name:`slide`},{default:(0,e.withCtx)(()=>[o.value&&t.description?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,k,(0,e.toDisplayString)(t.description),1)):(0,e.createCommentVNode)(``,!0)]),_:2},1024)],2))),128))]),(0,e.createElementVNode)(`div`,ie,[(0,e.createElementVNode)(`button`,{class:`params-btn reset`,onClick:u},[...r[8]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,e.createElementVNode)(`path`,{d:`M3 3v5h5`})],-1),(0,e.createTextVNode)(` 重置 `,-1)]]),(0,e.createElementVNode)(`div`,ae,[(0,e.createElementVNode)(`button`,{class:`params-btn cancel`,onClick:r[2]||=e=>n.$emit(`close`)},`取消`),(0,e.createElementVNode)(`button`,{class:`params-btn confirm`,onClick:d},[...r[9]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`},[(0,e.createElementVNode)(`path`,{d:`M20 6L9 17l-5-5`})],-1),(0,e.createTextVNode)(` 确定 `,-1)]])])])])]),_:1})])):(0,e.createCommentVNode)(``,!0)]),_:1})],8,[`to`]))}}),[[`__scopeId`,`data-v-2ffc8f4d`]]),A=Symbol(`fullscreen-teleport-target`);function j(){let t=(0,e.inject)(A,null);return(0,e.computed)(()=>t?.value??`body`)}var M={class:`indicator-selector`},se={class:`indicator-scroll-container`},ce={class:`indicator-list`},N={key:0,class:`indicator-divider`,"aria-hidden":`true`},P=[`draggable`,`onDragstart`,`onDragover`,`onDrop`],F=[`onMouseenter`],le={class:`btn-content`},ue={key:0,class:`param-hint`},I={key:0,class:`hover-overlay`},de=[`onClick`],L={key:1,class:`divider`},fe=[`onClick`],pe={class:`indicator-item`},me={class:`modal-header`},he={class:`header-title`},ge={class:`title-sub`},_e={class:`header-actions`},ve={key:0,viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`},ye={key:1,viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`},R={class:`modal-body`},be={class:`indicator-section`},xe={class:`section-header`},z={class:`section-count`},Se=[`onClick`],B={class:`card-label`},Ce={class:`card-tooltip`},we={class:`card-header`},Te={class:`card-label`},Ee={class:`card-header-actions`},De=[`onClick`],Oe={class:`card-name`},ke={class:`indicator-section`},Ae={class:`section-header`},je={class:`section-count`},Me=[`onClick`],Ne={class:`card-label`},Pe={class:`card-tooltip`},Fe={class:`card-header`},Ie={class:`card-label`},Le={class:`card-header-actions`},Re=[`onClick`],V={class:`card-name`},ze={class:`modal-footer`},Be={class:`footer-info`},H={class:`info-text`},Ve=_((0,e.defineComponent)({__name:`IndicatorSelector`,props:{activeIndicators:{},indicatorParams:{}},emits:[`toggle`,`updateParams`,`reorderSubIndicators`],setup(n,{emit:r}){let i=n,a=r,o=(0,e.ref)(null),s=(0,e.ref)(!1),c=(0,e.ref)(null),l=(0,e.ref)(null),u=(0,e.ref)(!1),d=(0,e.ref)(null),f=(0,e.ref)(null),p=(0,e.ref)(!1),m=j(),h=(0,e.computed)(()=>i.activeIndicators?.length?i.activeIndicators.map(e=>(0,t.findIndicator)(e)).filter(e=>e!==void 0).sort((e,t)=>e.pane===t.pane?0:e.pane===`main`?-1:1):[]),g=(0,e.computed)(()=>h.value.some(e=>e.pane===`main`)?h.value.find(e=>e.pane===`sub`)?.id??null:null),_=(0,e.computed)(()=>c.value?(0,t.findIndicator)(c.value):null),v=(0,e.computed)(()=>t.mainIndicators.length+t.subIndicators.length),y=(0,e.computed)(()=>i.activeIndicators?.length??0);function b(e){return i.activeIndicators?.includes(e)??!1}function x(e){if(b(e))return;let n=(0,t.findIndicator)(e);n&&(n.pane===`main`&&t.mainIndicators.filter(t=>t.id!==e&&b(t.id)).forEach(e=>a(`toggle`,e.id,!1)),a(`toggle`,e,!0))}function S(e){a(`toggle`,e,!1)}function C(e){c.value=e,s.value=!0}function w(){u.value=!1}function T(e){let n=(0,t.findIndicator)(e);if(!n?.params)return{};let r={};for(let e of n.params)r[e.key]=e.default??e.min??1;let a=i.indicatorParams?.[e]||{},o={...r};for(let[e,t]of Object.entries(a))typeof t==`number`&&(o[e]=t);return o}function E(e){let t=T(e.id);return e.params?e.params.map(e=>t[e.key]??``).join(`,`):``}function ee(e){c.value&&a(`updateParams`,c.value,e),s.value=!1}function te(e,n){if(!(0,t.isSubIndicatorId)(n)){e.preventDefault();return}f.value=n,d.value=null,e.dataTransfer?.setData(`text/plain`,n),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`)}function ne(e,n){!f.value||!(0,t.isSubIndicatorId)(n)||f.value===n||(d.value=n,e.dataTransfer&&(e.dataTransfer.dropEffect=`move`))}function D(e,n){let r=f.value||e.dataTransfer?.getData(`text/plain`)||``;if(!r||r===n){O();return}if(!(0,t.isSubIndicatorId)(r)||!(0,t.isSubIndicatorId)(n)){O();return}let i=h.value.findIndex(e=>e.id===r),o=h.value.findIndex(e=>e.id===n);if(i<0||o<0){O();return}let s=[...h.value.map(e=>e.id)],[c]=s.splice(i,1);if(!c){O();return}s.splice(o,0,c),a(`reorderSubIndicators`,s.filter(e=>(0,t.isSubIndicatorId)(e))),O()}function O(){d.value=null,f.value=null}function re(){u.value=!u.value}function k(e){e.key===`Escape`&&u.value&&(u.value=!1)}return(0,e.onMounted)(()=>{document.addEventListener(`keydown`,k)}),(0,e.onUnmounted)(()=>{document.removeEventListener(`keydown`,k)}),(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,M,[(0,e.createElementVNode)(`div`,se,[(0,e.createElementVNode)(`div`,ce,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(h.value,n=>((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:n.id},[n.id===g.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,N)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`indicator-item`,{draggable:(0,e.unref)(t.isSubIndicatorId)(n.id),"drag-over":d.value===n.id,"is-dragging":f.value===n.id}]),draggable:(0,e.unref)(t.isSubIndicatorId)(n.id),onDragstart:e=>te(e,n.id),onDragover:(0,e.withModifiers)(e=>ne(e,n.id),[`prevent`]),onDrop:(0,e.withModifiers)(e=>D(e,n.id),[`prevent`]),onDragend:O},[(0,e.createElementVNode)(`div`,{class:`indicator-btn-wrapper`,onMouseenter:e=>l.value=n.id,onMouseleave:r[0]||=e=>l.value=null},[(0,e.createElementVNode)(`button`,{class:(0,e.normalizeClass)([`indicator-btn`,{active:!0,hovering:l.value===n.id}])},[(0,e.createElementVNode)(`span`,le,[(0,e.createTextVNode)((0,e.toDisplayString)(n.label)+` `,1),n.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,ue,` (`+(0,e.toDisplayString)(E(n))+`) `,1)):(0,e.createCommentVNode)(``,!0)]),(0,e.createVNode)(e.Transition,{name:`fade`},{default:(0,e.withCtx)(()=>[l.value===n.id?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,I,[n.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:0,class:`action-btn settings-btn`,onClick:(0,e.withModifiers)(e=>C(n.id),[`stop`]),title:`????`},[...r[4]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`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,de)):(0,e.createCommentVNode)(``,!0),n.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,L)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`button`,{class:`action-btn remove-btn`,onClick:(0,e.withModifiers)(e=>S(n.id),[`stop`]),title:`????`},[...r[5]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`})],-1)]],8,fe)])):(0,e.createCommentVNode)(``,!0)]),_:2},1024)],2)],40,F)],42,P)],64))),128)),(0,e.createElementVNode)(`div`,pe,[(0,e.createElementVNode)(`button`,{ref_key:`addBtnRef`,ref:o,class:`add-btn`,onClick:re,title:`????`},[...r[6]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`},[(0,e.createElementVNode)(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],512)])])]),((0,e.openBlock)(),(0,e.createBlock)(e.Teleport,{to:(0,e.unref)(m)},[(0,e.createVNode)(e.Transition,{name:`overlay`},{default:(0,e.withCtx)(()=>[u.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`selector-overlay`,onClick:w},[(0,e.createVNode)(e.Transition,{name:`modal`},{default:(0,e.withCtx)(()=>[u.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`selector-modal`,onClick:r[2]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createElementVNode)(`div`,me,[(0,e.createElementVNode)(`div`,he,[r[7]||=(0,e.createElementVNode)(`span`,{class:`title-text`},`????`,-1),(0,e.createElementVNode)(`span`,ge,(0,e.toDisplayString)(v.value)+` ?????`,1)]),(0,e.createElementVNode)(`div`,_e,[(0,e.createElementVNode)(`button`,{class:(0,e.normalizeClass)([`view-toggle-btn`,{active:p.value}]),onClick:r[1]||=e=>p.value=!p.value,title:`????`},[p.value?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,ye,[...r[9]||=[(0,e.createElementVNode)(`path`,{d:`M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z`},null,-1)]])):((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,ve,[...r[8]||=[(0,e.createElementVNode)(`path`,{d:`M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z`},null,-1)]]))],2),(0,e.createElementVNode)(`button`,{class:`modal-close`,onClick:w,title:`??`},[...r[10]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`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)]])])]),(0,e.createElementVNode)(`div`,R,[(0,e.createElementVNode)(`div`,be,[(0,e.createElementVNode)(`div`,xe,[r[11]||=(0,e.createElementVNode)(`span`,{class:`section-title`},`????`,-1),(0,e.createElementVNode)(`span`,z,(0,e.toDisplayString)((0,e.unref)(t.mainIndicators).length),1)]),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`indicator-grid`,{compact:p.value}])},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)((0,e.unref)(t.mainIndicators),t=>((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:t.id,class:(0,e.normalizeClass)([`indicator-card`,{active:b(t.id),compact:p.value}]),onClick:e=>b(t.id)?S(t.id):x(t.id)},[p.value?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[(0,e.createElementVNode)(`span`,B,(0,e.toDisplayString)(t.label),1),(0,e.createElementVNode)(`span`,Ce,(0,e.toDisplayString)(t.name),1)],64)):((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[(0,e.createElementVNode)(`div`,we,[(0,e.createElementVNode)(`span`,Te,(0,e.toDisplayString)(t.label),1),(0,e.createElementVNode)(`div`,Ee,[t.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:0,class:`card-settings-btn`,onClick:(0,e.withModifiers)(e=>C(t.id),[`stop`]),title:`????`},[...r[12]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`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,De)):(0,e.createCommentVNode)(``,!0)])]),(0,e.createElementVNode)(`div`,Oe,(0,e.toDisplayString)(t.name),1)],64))],10,Se))),128))],2)]),r[15]||=(0,e.createElementVNode)(`div`,{class:`section-divider`},null,-1),(0,e.createElementVNode)(`div`,ke,[(0,e.createElementVNode)(`div`,Ae,[r[13]||=(0,e.createElementVNode)(`span`,{class:`section-title`},`????`,-1),(0,e.createElementVNode)(`span`,je,(0,e.toDisplayString)((0,e.unref)(t.subIndicators).length),1)]),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`indicator-grid`,{compact:p.value}])},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)((0,e.unref)(t.subIndicators),t=>((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:t.id,class:(0,e.normalizeClass)([`indicator-card`,{active:b(t.id),compact:p.value}]),onClick:e=>b(t.id)?S(t.id):x(t.id)},[p.value?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[(0,e.createElementVNode)(`span`,Ne,(0,e.toDisplayString)(t.label),1),(0,e.createElementVNode)(`span`,Pe,(0,e.toDisplayString)(t.name),1)],64)):((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[(0,e.createElementVNode)(`div`,Fe,[(0,e.createElementVNode)(`span`,Ie,(0,e.toDisplayString)(t.label),1),(0,e.createElementVNode)(`div`,Le,[t.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:0,class:`card-settings-btn`,onClick:(0,e.withModifiers)(e=>C(t.id),[`stop`]),title:`????`},[...r[14]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`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,Re)):(0,e.createCommentVNode)(``,!0)])]),(0,e.createElementVNode)(`div`,V,(0,e.toDisplayString)(t.name),1)],64))],10,Me))),128))],2)])]),(0,e.createElementVNode)(`div`,ze,[(0,e.createElementVNode)(`div`,Be,[(0,e.createElementVNode)(`span`,H,`??? `+(0,e.toDisplayString)(y.value)+` ???`,1)]),(0,e.createElementVNode)(`button`,{class:`btn btn-confirm`,onClick:w},`??`)])])):(0,e.createCommentVNode)(``,!0)]),_:1})])):(0,e.createCommentVNode)(``,!0)]),_:1})],8,[`to`])),_.value?((0,e.openBlock)(),(0,e.createBlock)(oe,{key:0,visible:s.value,"indicator-id":_.value.id,"indicator-name":_.value.name,"indicator-description":_.value.description,params:_.value.params||[],values:T(_.value.id),onClose:r[3]||=e=>s.value=!1,onConfirm:ee},null,8,[`visible`,`indicator-id`,`indicator-name`,`indicator-description`,`params`,`values`])):(0,e.createCommentVNode)(``,!0)]))}}),[[`__scopeId`,`data-v-09f65e18`]]),U={class:`kline-tooltip__title`},He={key:0},Ue={class:`kline-tooltip__grid`},W={class:`row`},G={class:`row`},K={class:`row`},q={class:`row`},We={key:0,class:`row`},Ge={key:1,class:`row`},Ke={key:2,class:`row`},qe={key:3,class:`row`},Je={key:4,class:`row`},Ye={key:5,class:`row`},J=`#ef4444`,Y=`#22c55e`,X=`#6b7280`,Xe=_((0,e.defineComponent)({__name:`KLineTooltip`,props:{k:{},index:{},data:{},pos:{},useAnchor:{type:Boolean},anchorPlacement:{},setEl:{type:Function}},setup(t){let n=t,r=(0,e.computed)(()=>n.useAnchor===!0),i=(0,e.computed)(()=>n.anchorPlacement===`left-bottom`?`anchor-left-bottom`:`anchor-right-bottom`);function a(e){n.setEl?.(e)}function o(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function s(e){return e>=1e8?(e/1e8).toFixed(2)+`亿`:e>=1e4?(e/1e4).toFixed(2)+`万`:e.toFixed(2)}function c(e,t){return`${e>=0?`+`:``}${e.toFixed(2)}${t}`}function l(e,t,n){if(e.close>=e.open)return 1;let r=typeof n==`number`&&n>0?t[n-1]:void 0;return r&&e.close>r.close?1:r&&e.close<r.close?-1:0}let u=(0,e.computed)(()=>{let e=n.k;if(!e)return X;let t=l(e,n.data,n.index);return t>0?J:t<0?Y:X}),d=(0,e.computed)(()=>{let e=n.k;if(!e)return X;let t=e.close-e.open;return t>0?J:t<0?Y:X}),f=(0,e.computed)(()=>{let e=n.k;if(!e)return X;let t=e.changePercent??(e.close-e.open)/e.open*100;return t>0?J:t<0?Y:X});return(n,l)=>t.k?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,ref:a,class:(0,e.normalizeClass)([`kline-tooltip`,[{"use-anchor":r.value},i.value]]),style:(0,e.normalizeStyle)(r.value?void 0:{left:`${t.pos.x}px`,top:`${t.pos.y}px`})},[(0,e.createElementVNode)(`div`,U,[t.k.stockCode?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,He,(0,e.toDisplayString)(t.k.stockCode),1)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(o(t.k.timestamp)),1)]),(0,e.createElementVNode)(`div`,Ue,[(0,e.createElementVNode)(`div`,W,[l[0]||=(0,e.createElementVNode)(`span`,null,`开`,-1),(0,e.createElementVNode)(`span`,{style:(0,e.normalizeStyle)({color:u.value})},(0,e.toDisplayString)(t.k.open.toFixed(2)),5)]),(0,e.createElementVNode)(`div`,G,[l[1]||=(0,e.createElementVNode)(`span`,null,`高`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.k.high.toFixed(2)),1)]),(0,e.createElementVNode)(`div`,K,[l[2]||=(0,e.createElementVNode)(`span`,null,`低`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.k.low.toFixed(2)),1)]),(0,e.createElementVNode)(`div`,q,[l[3]||=(0,e.createElementVNode)(`span`,null,`收`,-1),(0,e.createElementVNode)(`span`,{style:(0,e.normalizeStyle)({color:d.value})},(0,e.toDisplayString)(t.k.close.toFixed(2)),5)]),typeof t.k.volume==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,We,[l[4]||=(0,e.createElementVNode)(`span`,null,`成交量`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(s(t.k.volume)),1)])):(0,e.createCommentVNode)(``,!0),typeof t.k.turnover==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ge,[l[5]||=(0,e.createElementVNode)(`span`,null,`成交额`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(s(t.k.turnover)),1)])):(0,e.createCommentVNode)(``,!0),typeof t.k.amplitude==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ke,[l[6]||=(0,e.createElementVNode)(`span`,null,`振幅`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.k.amplitude)+`%`,1)])):(0,e.createCommentVNode)(``,!0),typeof t.k.changePercent==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,qe,[l[7]||=(0,e.createElementVNode)(`span`,null,`涨跌幅`,-1),(0,e.createElementVNode)(`span`,{style:(0,e.normalizeStyle)({color:f.value})},(0,e.toDisplayString)(c(t.k.changePercent,`%`)),5)])):(0,e.createCommentVNode)(``,!0),typeof t.k.changeAmount==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Je,[l[8]||=(0,e.createElementVNode)(`span`,null,`涨跌额`,-1),(0,e.createElementVNode)(`span`,{style:(0,e.normalizeStyle)({color:f.value})},(0,e.toDisplayString)(c(t.k.changeAmount,``)),5)])):(0,e.createCommentVNode)(``,!0),typeof t.k.turnoverRate==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ye,[l[9]||=(0,e.createElementVNode)(`span`,null,`换手率`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.k.turnoverRate.toFixed(2))+`%`,1)])):(0,e.createCommentVNode)(``,!0)])],6)):(0,e.createCommentVNode)(``,!0)}}),[[`__scopeId`,`data-v-90b1aa6d`]]),Ze={class:`marker-tooltip__title`},Qe={key:0,class:`marker-tooltip__content`},$e=_((0,e.defineComponent)({__name:`MarkerTooltip`,props:{marker:{},pos:{},useAnchor:{type:Boolean},anchorPlacement:{},setEl:{type:Function}},setup(t){let n={support:`支撑位`,resistance:`阻力位`,top:`顶部`,bottom:`底部`},r=t,i=(0,e.computed)(()=>r.useAnchor===!0),a=(0,e.computed)(()=>r.anchorPlacement===`left-bottom`?`anchor-left-bottom`:`anchor-right-bottom`);function o(e){r.setEl?.(e)}let s=(0,e.computed)(()=>r.marker&&`date`in r.marker),c=(0,e.computed)(()=>{if(!r.marker)return``;if(s.value){let e=r.marker;return e.label?.text||e.shape}let e=r.marker;return n[e.markerType]||e.markerType}),l=(0,e.computed)(()=>{if(!r.marker)return{};if(s.value){let e=r.marker;return{日期:e.date,...e.metadata}}return r.marker.metadata}),u=(0,e.computed)(()=>Object.keys(l.value).length>0);function d(e){return typeof e==`number`?e.toFixed(2):String(e)}return(n,r)=>t.marker?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,ref:o,class:(0,e.normalizeClass)([`marker-tooltip`,[{"use-anchor":i.value},a.value]]),style:(0,e.normalizeStyle)(i.value?void 0:{left:`${t.pos.x+12}px`,top:`${t.pos.y+12}px`})},[(0,e.createElementVNode)(`div`,Ze,(0,e.toDisplayString)(c.value),1),u.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Qe,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(l.value,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n,class:`row`},[(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(n),1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(d(t)),1)]))),128))])):(0,e.createCommentVNode)(``,!0)],6)):(0,e.createCommentVNode)(``,!0)}}),[[`__scopeId`,`data-v-057b55c9`]]),et={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function tt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,et,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var nt=(0,e.markRaw)({name:`tabler-pointer`,render:tt}),Z={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Z,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 19h16M4 15l4-6l4 2l4-5l4 4`},null,-1)]])}var it=(0,e.markRaw)({name:`tabler-chart-line`,render:rt}),at={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ot(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,at,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17 7L7 17M8 7h9v9`},null,-1)]])}var st=(0,e.markRaw)({name:`tabler-arrow-up-right`,render:ot}),ct={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function lt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,ct,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14m-6 6l6-6m-6-6l6 6`},null,-1)]])}var ut=(0,e.markRaw)({name:`tabler-arrow-right`,render:lt}),dt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ft(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,dt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14`},null,-1)]])}var pt=(0,e.markRaw)({name:`tabler-minus`,render:ft}),mt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ht(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,mt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 12v.01M7 12h10m4 0v.01`},null,-1)]])}var gt=(0,e.markRaw)({name:`tabler-separator`,render:ht}),_t={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function vt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,_t,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var yt=(0,e.markRaw)({name:`tabler-crosshair`,render:vt}),bt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function xt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,bt,[...n[0]||=[(0,e.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01`}),(0,e.createElementVNode)(`path`,{d:`M11 12h1v4h1`})],-1)]])}var St=(0,e.markRaw)({name:`tabler-info-circle`,render:xt}),Ct={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function wt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Ct,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m-3-3v6m11 8l-6-6`},null,-1)]])}var Tt=(0,e.markRaw)({name:`tabler-zoom-in`,render:wt}),Et={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Dt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Et,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m8 11l-6-6`},null,-1)]])}var Ot=(0,e.markRaw)({name:`tabler-zoom-out`,render:Dt}),kt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function At(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,kt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var jt=(0,e.markRaw)({name:`tabler-maximize`,render:At}),Mt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Nt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Mt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var Pt=(0,e.markRaw)({name:`tabler-minimize`,render:Nt}),Ft={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function It(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Ft,[...n[0]||=[(0,e.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,e.createElementVNode)(`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`}),(0,e.createElementVNode)(`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0`})],-1)]])}var Lt=(0,e.markRaw)({name:`tabler-settings`,render:It}),Rt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function zt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Rt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var Bt=(0,e.markRaw)({name:`tabler-shape`,render:zt}),Vt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ht(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Vt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var Ut=(0,e.markRaw)({name:`tabler-chart-dots-3`,render:Ht}),Wt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Gt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Wt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m18 10l-6-6l-6 6zm0 4l-6 6l-6-6z`},null,-1)]])}var Kt=(0,e.markRaw)({name:`tabler-caret-up-down`,render:Gt}),qt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Jt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,qt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 4H5v16h3m8-16h3v16h-3`},null,-1)]])}var Yt=(0,e.markRaw)({name:`tabler-brackets`,render:Jt});function Xt(){return Object.create(null)}function Zt(){return{ctxMethods:Xt(),ctxProps:Xt(),canvasProps:Xt(),ctxMethodSources:Object.create(null)}}function Qt(e,t,n){let r=e[t]??={count:0,totalTime:0};r.count+=1,r.totalTime+=n}function $t(e,t,n,r){Qt(e.ctxMethodSources[t]??=Xt(),n,r)}function en(e){return Object.entries(e).filter(([,e])=>e.count>0).map(([e,t])=>({name:e,count:t.count,totalTime:t.totalTime.toFixed(2),averageTime:(t.totalTime/t.count).toFixed(4)})).sort((e,t)=>Number(t.totalTime)-Number(e.totalTime))}var tn=!1,nn=new Map,rn=new Map;function an(e){tn=e,e?typeof window<`u`&&!window.__KMAP_CANVAS_PROFILER_INSTALLED__&&sn():cn()}function on(){if(!tn)return`disabled`;let e=Error().stack;if(!e)return`unknown`;let t=e.split(`
|
|
2
|
-
`).map(e=>e.trim()).filter(Boolean);for(let e of t){if(e.includes(`canvasProfiler`)||e.includes(`CanvasRenderingContext2D`)||e===`Error`)continue;let t=e.replace(/^at\s+/,``),n=t.match(/((?:src|node_modules)[^\s)]+):(\d+):(\d+)/);if(n)return`${n[1]}:${n[2]}`;let r=t.match(/\(([^)]+):(\d+):(\d+)\)$/);return r?`${r[1]}:${r[2]}`:t}return`unknown`}function Q(e,t,n,r){let i=`${e.constructor?.name??`proto`}:${t}`;if(nn.has(i))return;let a=Reflect.get(e,t);typeof a==`function`&&(nn.set(i,a),Reflect.set(e,t,function(...e){if(!tn)return a.apply(this,e);let i=r?.captureSource?on():null,o=performance.now(),s=a.apply(this,e),c=performance.now()-o;return Qt(n.ctxMethods,t,c),i&&$t(n,t,i,c),s}))}function $(e,t,n){let r=Object.getOwnPropertyDescriptor(e,t);if(!r?.set||!r.configurable)return;let i=`${e.constructor?.name??`proto`}:${t}`;rn.has(i)||(rn.set(i,r),Object.defineProperty(e,t,{configurable:!0,enumerable:r.enumerable??!1,get:r.get,set(e){if(!tn){r.set.call(this,e);return}let i=performance.now();r.set.call(this,e),Qt(n,t,performance.now()-i)}}))}function sn(){if(typeof window>`u`||window.__KMAP_CANVAS_PROFILER_INSTALLED__)return;let e=CanvasRenderingContext2D?.prototype,t=HTMLCanvasElement?.prototype;if(!e||!t)return;let n=Zt();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),$(e,`font`,n.ctxProps),$(e,`filter`,n.ctxProps),$(e,`shadowBlur`,n.ctxProps),$(e,`lineWidth`,n.ctxProps),$(t,`width`,n.canvasProps),$(t,`height`,n.canvasProps),window.__KMAP_CANVAS_PROFILER_METRICS__=n,window.__KMAP_CANVAS_PROFILER_INSTALLED__=!0,window.showCanvasReport=()=>{let e=window.__KMAP_CANVAS_PROFILER_METRICS__;if(e){console.group(`[kmap] Canvas profiler report`),console.log(`ctx methods`),console.table(en(e.ctxMethods)),console.log(`ctx props`),console.table(en(e.ctxProps)),console.log(`canvas props`),console.table(en(e.canvasProps));for(let t of[`fillText`,`measureText`]){let n=e.ctxMethodSources[t];n&&(console.log(`${t} sources`),console.table(en(n).slice(0,20)))}console.groupEnd()}},window.resetCanvasReport=()=>{window.__KMAP_CANVAS_PROFILER_METRICS__=Zt()},console.info(`[kmap] Canvas profiler enabled. Use window.showCanvasReport() and window.resetCanvasReport().`)}function cn(){if(typeof window>`u`||!window.__KMAP_CANVAS_PROFILER_INSTALLED__)return;let e=CanvasRenderingContext2D?.prototype,t=HTMLCanvasElement?.prototype;nn.forEach((n,r)=>{let i=r.match(/^(.+):(.+)$/);if(!i)return;let[,a,o]=i,s=null;a===`CanvasRenderingContext2D`?s=e:a===`HTMLCanvasElement`&&(s=t),s&&Reflect.set(s,o,n)}),nn.clear(),rn.forEach((n,r)=>{let i=r.match(/^(.+):(.+)$/);if(!i)return;let[,a,o]=i,s=null;a===`CanvasRenderingContext2D`?s=e:a===`HTMLCanvasElement`&&(s=t),s&&n.configurable&&Object.defineProperty(s,o,n)}),rn.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.`)}var ln={class:`left-toolbar`,"aria-label":`?????`},un={class:`left-toolbar__group`},dn=[`title`,`aria-label`,`onClick`],fn=[`onClick`],pn=[`title`,`aria-label`,`onClick`],mn={class:`left-toolbar__group`},hn={class:`left-toolbar__group`},gn=[`title`,`aria-label`],_n={class:`left-toolbar__group`},vn={class:`settings-body`},yn={class:`settings-label`},bn=[`onUpdate:modelValue`],xn=[`onUpdate:modelValue`],Sn=[`value`],Cn={class:`settings-label`},wn=[`onUpdate:modelValue`],Tn=[`onUpdate:modelValue`],En=[`value`],Dn=_((0,e.defineComponent)({__name:`LeftToolbar`,props:{isFullscreen:{type:Boolean}},emits:[`selectTool`,`toggleFullscreen`,`zoomIn`,`zoomOut`,`settingsChange`],setup(t,{expose:n,emit:r}){let i=[{id:`cursor`,title:`??`,icon:nt},{id:`lines`,title:`??`,icon:it,children:[{id:`trend-line`,title:`??`,icon:it},{id:`ray`,title:`??`,icon:st},{id:`h-line`,title:`???`,icon:pt},{id:`h-ray`,title:`????`,icon:ut},{id:`v-line`,title:`???`,icon:gt},{id:`crosshair-line`,title:`???`,icon:yt},{id:`info-line`,title:`???`,icon:St}]},{id:`channels`,title:`??`,icon:Bt,children:[{id:`parallel-channel`,title:`????`,icon:Bt},{id:`regression-channel`,title:`????`,icon:Ut},{id:`flat-line`,title:`????`,icon:Kt},{id:`disjoint-channel`,title:`?????`,icon:Yt}]}],a=r,o=(0,e.ref)(`cursor`),s=(0,e.ref)(null),c=(0,e.ref)(!1),u=j(),d=(0,e.computed)(()=>l.DEFAULT_SETTINGS.filter(e=>e.group===`main`)),f=(0,e.computed)(()=>l.DEFAULT_SETTINGS.filter(e=>e.group===`experimental`));function p(){try{let e=localStorage.getItem(l.SETTINGS_STORAGE_KEY);if(e){let t=JSON.parse(e),n={};return l.DEFAULT_SETTINGS.forEach(e=>{n[e.key]=t[e.key]??e.default}),n}}catch{}let e={};return l.DEFAULT_SETTINGS.forEach(t=>{e[t.key]=t.default}),e}function m(e){try{localStorage.setItem(l.SETTINGS_STORAGE_KEY,JSON.stringify(e))}catch{}}let h=(0,e.ref)(p()),g=(0,e.ref)({...h.value});function _(e){return o.value===e.id?!0:e.children?e.children.some(e=>e.id===o.value):!1}function v(e){if(e.children?.length){if(!e.children.some(e=>e.id===o.value)){let t=e.children[0];o.value=t.id,a(`selectTool`,t.id)}b(e.id);return}o.value=e.id,a(`selectTool`,e.id),s.value=null}function y(e){o.value=e.id,a(`selectTool`,e.id),s.value=null}function b(e){s.value=s.value===e?null:e}function x(){g.value={...h.value},c.value=!0}function S(){c.value=!1}function C(){let e={};l.DEFAULT_SETTINGS.forEach(t=>{e[t.key]=t.default}),g.value=e}function w(){h.value={...g.value},m(h.value),an(!!h.value.enableCanvasProfiler),a(`settingsChange`,{...h.value}),S()}function T(){return{...h.value}}n({getSettings:T});function E(e){e.target.closest(`.tool-item`)||(s.value=null)}return(0,e.onMounted)(()=>{document.addEventListener(`click`,E,!0),a(`settingsChange`,{...h.value}),an(!!h.value.enableCanvasProfiler)}),(0,e.onUnmounted)(()=>{document.removeEventListener(`click`,E,!0)}),(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,[(0,e.createElementVNode)(`nav`,ln,[(0,e.createElementVNode)(`div`,un,[((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(i,t=>(0,e.createElementVNode)(`div`,{key:t.id,class:`tool-item`},[(0,e.createElementVNode)(`button`,{type:`button`,class:(0,e.normalizeClass)([`left-toolbar__button`,{active:_(t)}]),title:t.title,"aria-label":t.title,onClick:e=>v(t),onPointerdown:r[0]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[1]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[2]||=(0,e.withModifiers)(()=>{},[`stop`])},[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.icon),{class:`tool-icon`,"aria-hidden":`true`})),t.children&&t.children.length?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:0,class:(0,e.normalizeClass)([`corner-indicator`,{open:s.value===t.id}]),onClick:(0,e.withModifiers)(e=>b(t.id),[`stop`]),"aria-label":`?????`},null,10,fn)):(0,e.createCommentVNode)(``,!0)],42,dn),(0,e.createVNode)(e.Transition,{name:`dropdown`},{default:(0,e.withCtx)(()=>[s.value===t.id&&t.children&&t.children.length?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`tool-dropdown`,onPointerdown:r[3]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[4]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[5]||=(0,e.withModifiers)(()=>{},[`stop`])},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.children,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:t.id,type:`button`,class:(0,e.normalizeClass)([`left-toolbar__button`,{active:o.value===t.id}]),title:t.title,"aria-label":t.title,onClick:e=>y(t)},[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.icon),{class:`tool-icon`,"aria-hidden":`true`}))],10,pn))),128))],32)):(0,e.createCommentVNode)(``,!0)]),_:2},1024)])),64))]),r[22]||=(0,e.createElementVNode)(`span`,{class:`left-toolbar__divider`},null,-1),(0,e.createElementVNode)(`div`,mn,[(0,e.createElementVNode)(`button`,{type:`button`,class:`left-toolbar__button`,title:`??`,"aria-label":`??`,onClick:r[6]||=e=>n.$emit(`zoomIn`),onPointerdown:r[7]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[8]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[9]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createVNode)((0,e.unref)(Tt),{class:`tool-icon`,"aria-hidden":`true`})],32),(0,e.createElementVNode)(`button`,{type:`button`,class:`left-toolbar__button`,title:`??`,"aria-label":`??`,onClick:r[10]||=e=>n.$emit(`zoomOut`),onPointerdown:r[11]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[12]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[13]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createVNode)((0,e.unref)(Ot),{class:`tool-icon`,"aria-hidden":`true`})],32)]),r[23]||=(0,e.createElementVNode)(`span`,{class:`left-toolbar__divider`},null,-1),(0,e.createElementVNode)(`div`,hn,[(0,e.createElementVNode)(`button`,{type:`button`,class:`left-toolbar__button`,title:(t.isFullscreen,`????`),"aria-label":(t.isFullscreen,`????`),onClick:r[14]||=e=>n.$emit(`toggleFullscreen`),onPointerdown:r[15]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[16]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[17]||=(0,e.withModifiers)(()=>{},[`stop`])},[t.isFullscreen?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(Pt),{key:0,class:`tool-icon`,"aria-hidden":`true`})):((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(jt),{key:1,class:`tool-icon`,"aria-hidden":`true`}))],40,gn)]),r[24]||=(0,e.createElementVNode)(`span`,{class:`left-toolbar__divider`},null,-1),(0,e.createElementVNode)(`div`,_n,[(0,e.createElementVNode)(`button`,{type:`button`,class:`left-toolbar__button`,title:`??`,"aria-label":`??`,onClick:x,onPointerdown:r[18]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[19]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[20]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createVNode)((0,e.unref)(Lt),{class:`tool-icon`,"aria-hidden":`true`})],32)])]),((0,e.openBlock)(),(0,e.createBlock)(e.Teleport,{to:(0,e.unref)(u)},[(0,e.createVNode)(e.Transition,{name:`overlay`},{default:(0,e.withCtx)(()=>[c.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`settings-overlay`,onClick:S},[(0,e.createVNode)(e.Transition,{name:`modal`},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,{class:`settings-modal`,onClick:r[21]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createElementVNode)(`div`,{class:`settings-header`},[r[26]||=(0,e.createElementVNode)(`div`,{class:`header-left`},[(0,e.createElementVNode)(`span`,{class:`settings-title`},`????`),(0,e.createElementVNode)(`span`,{class:`settings-subtitle`},`?????`)],-1),(0,e.createElementVNode)(`div`,{class:`header-right`},[(0,e.createElementVNode)(`button`,{class:`settings-close`,onClick:S},[...r[25]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M18 6L6 18M6 6l12 12`})],-1)]])])]),(0,e.createElementVNode)(`div`,vn,[d.value.length>0?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[r[27]||=(0,e.createElementVNode)(`div`,{class:`settings-section-divider`},[(0,e.createElementVNode)(`span`,{class:`settings-section-label`},`????`)],-1),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(d.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.key,class:`settings-item`},[(0,e.createElementVNode)(`label`,yn,[(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.label),1),t.type===`boolean`?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`input`,{key:0,type:`checkbox`,class:`settings-checkbox`,"onUpdate:modelValue":e=>g.value[t.key]=e},null,8,bn)),[[e.vModelCheckbox,g.value[t.key]]]):t.type===`select`&&t.options?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`select`,{key:1,class:`settings-select`,"onUpdate:modelValue":e=>g.value[t.key]=e},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.options,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`option`,{key:t.value,value:t.value},(0,e.toDisplayString)(t.label),9,Sn))),128))],8,xn)),[[e.vModelSelect,g.value[t.key]]]):(0,e.createCommentVNode)(``,!0)])]))),128))],64)):(0,e.createCommentVNode)(``,!0),f.value.length>0?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[r[28]||=(0,e.createElementVNode)(`div`,{class:`settings-section-divider`},[(0,e.createElementVNode)(`span`,{class:`settings-section-label`},`??? / ????`)],-1),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(f.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.key,class:`settings-item experimental`},[(0,e.createElementVNode)(`label`,Cn,[(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.label),1),t.type===`boolean`?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`input`,{key:0,type:`checkbox`,class:`settings-checkbox`,"onUpdate:modelValue":e=>g.value[t.key]=e},null,8,wn)),[[e.vModelCheckbox,g.value[t.key]]]):t.type===`select`&&t.options?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`select`,{key:1,class:`settings-select`,"onUpdate:modelValue":e=>g.value[t.key]=e},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.options,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`option`,{key:t.value,value:t.value},(0,e.toDisplayString)(t.label),9,En))),128))],8,Tn)),[[e.vModelSelect,g.value[t.key]]]):(0,e.createCommentVNode)(``,!0)])]))),128))],64)):(0,e.createCommentVNode)(``,!0)]),(0,e.createElementVNode)(`div`,{class:`settings-footer`},[(0,e.createElementVNode)(`button`,{class:`settings-btn reset`,onClick:C},[...r[29]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,e.createElementVNode)(`path`,{d:`M3 3v5h5`})],-1),(0,e.createTextVNode)(` ?? `,-1)]]),(0,e.createElementVNode)(`div`,{class:`footer-right`},[(0,e.createElementVNode)(`button`,{class:`settings-btn cancel`,onClick:S},`??`),(0,e.createElementVNode)(`button`,{class:`settings-btn confirm`,onClick:w},[...r[30]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`},[(0,e.createElementVNode)(`path`,{d:`M20 6L9 17l-5-5`})],-1),(0,e.createTextVNode)(` ?? `,-1)]])])])])]),_:1})])):(0,e.createCommentVNode)(``,!0)]),_:1})],8,[`to`]))],64))}}),[[`__scopeId`,`data-v-c0526cfb`]]),On=[`data-theme`],kn={class:`pane-separator-layer`,"aria-hidden":`true`},An=4,jn=_((0,e.defineComponent)({__name:`KLineChart`,props:{semanticConfig:{},dataFetcher:{},yPaddingPx:{default:20},minKWidth:{default:1},maxKWidth:{default:50},rightAxisWidth:{default:0},bottomAxisHeight:{default:24},priceLabelWidth:{default:60},zoomLevels:{default:20},initialZoomLevel:{default:3},isFullscreen:{type:Boolean,default:!1}},emits:[`zoomLevelChange`,`toggleFullscreen`],setup(t,{expose:l,emit:d}){let f=t,p=(0,e.ref)(null),m=(0,e.ref)(null),h=(0,e.ref)(null),g=(0,e.ref)(null),_=(0,e.ref)(null),y=(0,e.ref)(null),b=(0,e.ref)(null),x=(0,e.shallowRef)(null),S=(0,e.shallowRef)(null),C=(0,i.createChartStore)({initialZoomLevel:f.initialZoomLevel??1,minKWidth:f.minKWidth,maxKWidth:f.maxKWidth,zoomLevels:f.zoomLevels,rightAxisWidth:f.rightAxisWidth,priceLabelWidth:f.priceLabelWidth}),w=(0,e.ref)(`light`);C.actions.setZoomState(C.state.zoomLevel,(0,a.zoomLevelToKWidth)(C.state.zoomLevel,{minKWidth:f.minKWidth,maxKWidth:f.maxKWidth,zoomLevelCount:f.zoomLevels,dpr:C.state.viewportDpr}),(0,a.kGapFromKWidth)((0,a.zoomLevelToKWidth)(C.state.zoomLevel,{minKWidth:f.minKWidth,maxKWidth:f.maxKWidth,zoomLevelCount:f.zoomLevels,dpr:C.state.viewportDpr}),C.state.viewportDpr)),(0,e.computed)(()=>C.state.dataLength),(0,e.computed)(()=>C.state.viewportDpr);let T=(0,e.computed)(()=>C.state.zoomLevel),E=(0,e.computed)(()=>C.state.kWidth),ee=(0,e.computed)(()=>C.state.kGap),te=(0,e.computed)(()=>C.state.paneRatios),ne=(0,e.computed)(()=>C.state.selectedDrawingId),D=(0,e.computed)(()=>C.state.dataVersion);function O(){x.value?.scheduleDraw()}function re(e){if(x.value?.updateSettings(e),e.performanceTest10kKlines){let e=k();console.time(`updateData-10k`),x.value?.updateData(e),console.timeEnd(`updateData-10k`),C.actions.setDataLength(e.length),C.actions.bumpDataVersion()}else S.value&&x.value?.getData()?.length===1e4&&S.value.applyConfig(f.semanticConfig)}function k(){let e=[],t=new Date(`2020-01-01`).getTime(),n=3e3;for(let r=0;r<1e4;r++){let i=t+r*864e5,a=(Math.random()-.5)*2*.02+1e-4,o=n,s=o*(1+a),c=Math.max(o,s)*(1+Math.random()*.01),l=Math.min(o,s)*(1-Math.random()*.01),u=Math.floor(1e6+Math.random()*5e6);e.push({timestamp:i,open:parseFloat(o.toFixed(2)),high:parseFloat(c.toFixed(2)),low:parseFloat(l.toFixed(2)),close:parseFloat(s.toFixed(2)),volume:u}),n=s}return e}function ie(e,t,n){let r=e.getBoundingClientRect();return{width:Math.max(t,Math.round(r.width)),height:Math.max(n,Math.round(r.height))}}function ae(t){t&&(0,e.nextTick)(()=>{if(!t.isConnected)return;let e=ie(t,180,80);x.value?.interaction.setTooltipSize(e)})}function oe(t){t&&(0,e.nextTick)(()=>{t.isConnected&&(ue.value=ie(t,120,60))})}let A=(0,e.ref)({x:0,y:0}),j=(0,e.ref)(!1),M=null;function se(){M=null}function ce(e){return M||=e.getBoundingClientRect(),M}let N=(0,e.shallowRef)({crosshairPos:null,crosshairIndex:null,crosshairPrice:null,hoveredIndex:null,activePaneId:null,tooltipPos:{x:0,y:0},tooltipAnchorPlacement:`right-bottom`,hoveredMarkerData:null,hoveredCustomMarker:null,isDragging:!1,isResizingPaneBoundary:!1,isHoveringPaneBoundary:!1,hoveredPaneBoundaryId:null,isHoveringRightAxis:!1}),P=(0,e.shallowRef)(null),F=(0,e.computed)(()=>{let e=ne.value;return e?C.state.drawings.find(t=>t.id===e)??null:null}),le=(0,e.ref)([]),ue=(0,e.ref)({width:220,height:120}),I=(0,e.computed)(()=>{let e=g.value,t=_.value;return!e||!t?{x:0,y:0}:{x:e.offsetLeft,y:e.offsetTop}}),de=(0,e.computed)(()=>N.value.hoveredMarkerData),L=(0,e.computed)(()=>N.value.hoveredCustomMarker),fe=(0,e.computed)(()=>N.value.isDragging),pe=(0,e.computed)(()=>N.value.isResizingPaneBoundary),me=(0,e.computed)(()=>N.value.isHoveringPaneBoundary),he=(0,e.computed)(()=>N.value.hoveredPaneBoundaryId),ge=(0,e.computed)(()=>N.value.isHoveringRightAxis),_e=(0,e.computed)(()=>N.value.hoveredIndex),ve=(0,e.computed)(()=>N.value.crosshairIndex),ye=(0,e.computed)(()=>fe.value?`grabbing`:pe.value||me.value?`ns-resize`:_e.value===null?`crosshair`:`pointer`),R=(0,e.computed)(()=>{let e=N.value.hoveredIndex;if(typeof e!=`number`)return null;D.value;let t=x.value?.getData();return t&&e>=0&&e<t.length?t[e]:null}),be=(0,e.computed)(()=>N.value.hoveredIndex),xe=(0,e.computed)(()=>N.value.tooltipPos),z=(0,e.computed)(()=>({x:xe.value.x+I.value.x,y:xe.value.y+I.value.y})),Se=(0,e.computed)(()=>({left:`${z.value.x}px`,top:`${z.value.y}px`})),B=(0,e.computed)(()=>({x:A.value.x+I.value.x,y:A.value.y+I.value.y})),Ce=(0,e.computed)(()=>({left:`${B.value.x}px`,top:`${B.value.y}px`})),we=(0,e.computed)(()=>N.value.tooltipAnchorPlacement),Te=(0,e.computed)(()=>{let e=x.value?.getViewport(),t=g.value,n=e?.plotWidth??(t?t.clientWidth:0);return A.value.x+12+ue.value.width+12>n?`left-bottom`:`right-bottom`}),Ee=(0,e.computed)(()=>(D.value,x.value?.getData()??[]));function De(e){P.value?.setTool(e)}function Oe(e){let t=F.value;!t||!P.value||(P.value.updateDrawingStyle(t.id,e),C.actions.bumpDrawingVersion())}function ke(){let e=F.value;!e||!P.value||(P.value.removeDrawing(e.id),C.actions.setSelectedDrawingId(null),C.actions.bumpDrawingVersion(),C.actions.setDrawings(P.value.getDrawings()))}function Ae(e){x.value?.handlePointerEvent(e,{onPointerDown:(e,t)=>P.value?.onPointerDown(e,t)?(C.actions.setDrawings(P.value.getDrawings()),C.actions.bumpDrawingVersion(),!0):!1})}function je(e){let t=g.value;if(t){let n=ce(t);A.value={x:e.clientX-n.left,y:e.clientY-n.top}}x.value?.handlePointerEvent(e,{onPointerMove:(e,t)=>P.value?.onPointerMove(e,t)?(C.actions.setDrawings(P.value.getDrawings()),!0):!1})}function Me(e){x.value?.handlePointerEvent(e,{onPointerUp:(e,t)=>P.value?.onPointerUp(e,t)?(C.actions.setDrawings(P.value.getDrawings()),!0):!1})}function Ne(e){x.value?.handlePointerEvent(e)}function Pe(e){x.value?.handlePointerEvent(e)}function Fe(e){x.value?.handlePointerEvent(e)}function Ie(e){x.value?.handlePointerEvent(e)}function Le(e){x.value?.handlePointerEvent(e)}function Re(){x.value?.handleScrollEvent()}let V=(0,e.ref)([]),ze=(0,e.computed)(()=>{let e=[],t=new Set;for(let n of U.value)t.has(n.indicatorId)||(t.add(n.indicatorId),e.push(n.indicatorId));return e}),Be=(0,e.computed)(()=>[...V.value,...ze.value]),H=(0,e.ref)({}),U=(0,e.ref)([]);function He(){let e=te.value.main??3;return U.value.length===0?[{id:`main`,ratio:e,visible:!0,role:`price`}]:[{id:`main`,ratio:e,visible:!0,role:`price`},...U.value.map(e=>({id:e.id,ratio:te.value[e.id]??1,visible:!0,role:`indicator`}))]}function Ue(e){return{...s.SUB_PANE_INDICATOR_CONFIGS[e].defaultParams}}let W=new Map,G=new Map;function K(e,t){let n=(0,c.createPaneTitleRendererPlugin)({paneId:e,title:t,getTitleInfo:()=>Y(e)});x.value?.useRenderer(n),G.set(e,n.name)}function q(e){let t=G.get(e);t&&(x.value?.removeRenderer(t),G.delete(e))}function We(e=`VOLUME`,t){if(U.value.length>=An)return!1;let n=t??Ue(e),r=x.value?.addIndicator(e,`sub`,n);return r?(K(r,e),U.value.push({id:r,indicatorId:e,params:n}),O(),!0):!1}function Ge(e){let t=U.value.findIndex(t=>t.id===e);t!==-1&&U.value[t]&&(q(e),x.value?.removeIndicator(e),U.value.splice(t,1))}function Ke(){for(let e of U.value)x.value?.removeIndicator(e.id),q(e.id);U.value=[],W.clear(),G.clear()}function qe(){let e=f.semanticConfig,t=x.value;if(!t)return;let n=e.indicators?.main;if(n)for(let e of n)e.enabled&&(V.value.includes(e.type)||V.value.push(e.type),e.params&&(H.value[e.type]=e.params),t.enableMainIndicator(e.type,e.params))}(0,e.watch)([Be,H],([e])=>{let t=x.value;t&&(t.updateRendererConfig(`mainIndicatorLegend`,{indicators:{MA:{enabled:e.includes(`MA`),params:H.value.MA||{}},BOLL:{enabled:e.includes(`BOLL`),params:H.value.BOLL||{}},EXPMA:{enabled:e.includes(`EXPMA`),params:H.value.EXPMA||{}},ENE:{enabled:e.includes(`ENE`),params:H.value.ENE||{}}}}),O())},{deep:!0});function Je(){let e=x.value?.getSubPaneEntries()??[];U.value=[],G.clear();for(let t of e){let{paneId:e,indicatorId:n,params:r}=t,i=e.match(/^(.+)_(\d+)$/);if(i){let[,e,t]=i,n=parseInt(t,10);n>=(W.get(e)??0)&&W.set(e,n+1)}K(e,n),U.value.push({id:e,indicatorId:n,params:{...r}})}O()}function Ye(e,t){if(!U.value.find(t=>t.id===e))return;let n=Ue(t);q(e),x.value?.replaceSubPaneIndicator(e,t,n),K(e,t);let r=U.value.findIndex(t=>t.id===e);r!==-1&&(U.value[r]={id:e,indicatorId:t,params:n})}let J=new Map;function Y(e){let t=U.value.find(t=>t.id===e);if(!t)return null;let n=x.value?.getData();if(!n||n.length===0)return null;let r=ve.value,i=n.length,a=J.get(e);if(a&&a.idx===r&&a.dataLen===i)return a.result;let o=s.SUB_PANE_INDICATOR_CONFIGS[t.indicatorId],c=t.params,l=x.value?.plugin,u=l?o.getTitleInfo(n,r,c,l,e):null;return J.set(e,{idx:r,dataLen:i,result:u}),u}function X(e,t){let n=x.value;if(n){if([`MA`,`BOLL`,`EXPMA`,`ENE`,`WMA`,`DEMA`,`TEMA`,`HMA`,`KAMA`,`SAR`,`SUPERTREND`,`KELTNER`,`DONCHIAN`,`ICHIMOKU`,`PIVOT`,`FIB`,`STRUCTURE`,`ZONES`].includes(e)){let r=V.value.find(t=>t===e);if(t&&!r)n.addIndicator(e,`main`,H.value[e]),V.value.push(e);else if(!t&&r){let t=e.toUpperCase();n.removeIndicator(t),V.value=V.value.filter(t=>t!==e)}return}if(s.SUB_PANE_INDICATORS.includes(e)){if(t){if(U.value.find(t=>t.indicatorId===e)||U.value.length>=An)return;let t=n.addIndicator(e,`sub`,H.value[e]);if(t)K(t,e),U.value.push({id:t,indicatorId:e,params:{...H.value[e]}});else if(U.value.length>0){let t=U.value[U.value.length-1];Ye(t.id,e)}}else U.value.filter(t=>t.indicatorId===e).forEach(e=>{n.removeIndicator(e.id),q(e.id)}),U.value=U.value.filter(t=>t.indicatorId!==e);O()}}}function Ze(e,t){if(H.value[e]=t,e===`MA`||e===`BOLL`||e===`EXPMA`||e===`ENE`){x.value?.updateMainIndicatorParams(e,t),O();return}if(s.SUB_PANE_INDICATORS.includes(e)){U.value.filter(t=>t.indicatorId===e).forEach(e=>{x.value?.updateSubPaneParams(e.id,t),e.params={...t}}),O();return}O()}function Qe(e){if(!e.length||U.value.length<=1)return;let t=e.filter(e=>s.SUB_PANE_INDICATORS.includes(e));if(!t.length)return;let n=new Map(U.value.map(e=>[e.indicatorId,e])),r=[];for(let e of t){let t=n.get(e);t&&(r.push(t),n.delete(e))}if(r.length===0)return;for(let e of U.value)n.has(e.indicatorId)&&(r.push(e),n.delete(e.indicatorId));let i=U.value.map(e=>e.id),a=r.map(e=>e.id);if(i.join(`|`)===a.join(`|`))return;U.value=r;let o=x.value;o&&o.updatePaneLayout(He())}let et=(0,e.computed)(()=>f.rightAxisWidth+f.priceLabelWidth),tt=C.computed.totalWidth;function nt(){let e=g.value,t=x.value;if(!e||!t)return;let n=t.getData()?.length??0;if(n===0)return;let r=t.getCurrentDpr(),{unitPx:i,startXPx:a}=(0,o.getPhysicalKLineConfig)(E.value,ee.value,r),s=(a+n*i)/r,c=Math.max(0,e.scrollWidth-e.clientWidth),l=Math.min(c,Math.max(0,s-e.clientWidth));e.scrollLeft=Math.round(l*r)/r,O()}function Z(e,t){let n=x.value;n&&n.zoomToLevel(e,t)}l({scheduleRender:O,scrollToRight:nt,addSubPane:We,removeSubPane:Ge,switchSubIndicator:Ye,clearAllSubPanes:Ke,get plugin(){return x.value?.plugin},zoomToLevel:Z,zoomIn:e=>Z(T.value+1,e),zoomOut:e=>Z(T.value-1,e),getZoomLevel:()=>T.value,getZoomLevelCount:()=>x.value?.getZoomLevelCount()??10});function rt(e){let t=e=>{e.preventDefault();let t=x.value;t&&t.handleWheelEvent(e)};return e.addEventListener(`wheel`,t,{passive:!1}),t}function it(e,t,n,i){return new r.Chart({container:e,canvasLayer:t,rightAxisLayer:n,xAxisCanvas:i},{yPaddingPx:f.yPaddingPx,rightAxisWidth:f.rightAxisWidth,bottomAxisHeight:f.bottomAxisHeight,priceLabelWidth:f.priceLabelWidth,minKWidth:f.minKWidth,maxKWidth:f.maxKWidth,panes:[{id:`main`,ratio:1}],paneGap:0,zoomLevels:f.zoomLevels,initialZoomLevel:f.initialZoomLevel})}function at(t){t.setOnPaneLayoutChange(()=>{se();let e=t.getPaneRenderers(),n=g.value&&parseInt(getComputedStyle(g.value).borderTopWidth)||0;le.value=e.slice(0,-1).map(e=>{let t=e.getPane();return{id:t.id,top:t.top+t.height+n}})});let n=t.paneRatios.subscribe(()=>{let e=t.paneRatios.peek();C.actions.setPaneRatios({...e})}),r=t.viewport.subscribe(()=>{let n=t.viewport.peek();C.state.viewportDpr!==n.dpr&&C.actions.setViewportDpr(n.dpr),C.state.viewWidth!==n.plotWidth&&C.actions.setViewWidth(n.plotWidth),(C.state.zoomLevel!==n.zoomLevel||C.state.kWidth!==n.kWidth||C.state.kGap!==n.kGap)&&C.actions.setZoomState(n.zoomLevel,n.kWidth,n.kGap);let r=n.desiredScrollLeft;r!==void 0&&r!==g.value?.scrollLeft&&(se(),(0,e.nextTick)(()=>{let e=g.value;if(!e)return;let n=Math.max(0,e.scrollWidth-e.clientWidth),i=Math.min(Math.max(0,r),n),a=t.getCurrentDpr();e.scrollLeft=Math.round(i*a)/a}))}),i=t.data.subscribe(()=>{let e=t.data.peek();C.actions.setDataLength(e.length),C.actions.bumpDataVersion()}),a=t.theme.subscribe(()=>{w.value=t.theme.peek()});(0,e.onUnmounted)(()=>{r(),i(),n(),a()})}function ot(e){let t=b.value?.getSettings()??{showVolumePriceMarkers:!0};if(e.updateSettings(t),t.performanceTest10kKlines){let t=k();console.time(`updateData-10k`),e.updateData(t),console.timeEnd(`updateData-10k`)}}function st(e){P.value=new u.DrawingInteractionController(e),P.value.setCallbacks({onDrawingCreated:e=>{C.actions.setDrawings([...C.state.drawings,e]),C.actions.setSelectedDrawingId(e.id)},onToolChange:()=>{},onDrawingSelected:e=>{C.actions.setSelectedDrawingId(e?.id??null)}})}function ct(e){e.interaction.setTooltipAnchorPositioning(j.value),e.interaction.setOnInteractionChange(e=>{N.value=e}),e.interaction.setOnPinchZoom((t,n)=>{if(!e)return;let r=g.value;if(!r)return;let i=n-r.getBoundingClientRect().left;e.handlePinchZoom(t,i)}),N.value=e.interaction.getInteractionSnapshot(),C.actions.setViewportDpr(e.getCurrentDpr()),e.resize()}function lt(t){(0,n.__setDataFetcher)(f.dataFetcher),S.value=new n.SemanticChartController(t),S.value.on(`config:error`,e=>{console.error(`Semantic config error:`,e)}),S.value.on(`config:ready`,()=>{qe(),Je(),(0,e.nextTick)(()=>nt())}),S.value.applyConfig(f.semanticConfig).then(e=>{e&&!e.success&&console.error(`Semantic config apply failed:`,e.errors)})}return(0,e.onMounted)(()=>{j.value=!1;let e=g.value,t=m.value,n=h.value,r=p.value;if(!e||!t||!n||!r)return;let i=rt(e),a=it(e,t,n,r);x.value=a,at(a),a.applyRenderState(C.state.kWidth,C.state.kGap,C.state.zoomLevel),ot(a),st(a),ct(a),lt(a),a.__onWheel=i}),(0,e.onUnmounted)(()=>{let e=x.value;if(e){let t=e.__onWheel,n=g.value;t&&n&&n.removeEventListener(`wheel`,t),e.destroy()}x.value=null,P.value=null}),(0,e.watch)(()=>f.yPaddingPx,e=>{x.value?.updateOptions({yPaddingPx:e})}),(0,e.watch)(()=>f.semanticConfig,async(e,t)=>{if(e&&e!==t){let t=await S.value?.applyConfig(e);t&&!t.success&&console.error(`Semantic config apply failed:`,t.errors)}},{deep:!0}),(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`chart-wrapper`,"data-theme":w.value},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`chart-stage`,{"is-dragging":fe.value,"is-resizing-pane":pe.value,"is-hovering-pane-separator":me.value,"is-hovering-right-axis":ge.value,"is-hovering-kline":_e.value!==null}])},[(0,e.createVNode)(Dn,{ref_key:`toolbarRef`,ref:b,"is-fullscreen":t.isFullscreen,onSelectTool:De,onToggleFullscreen:r[0]||=e=>n.$emit(`toggleFullscreen`),onZoomIn:r[1]||=e=>Z(T.value+1),onZoomOut:r[2]||=e=>Z(T.value-1),onSettingsChange:re},null,8,[`is-fullscreen`]),(0,e.createElementVNode)(`div`,{class:`chart-main`,ref_key:`chartMainRef`,ref:_},[(0,e.createElementVNode)(`div`,kn,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(le.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.id,class:(0,e.normalizeClass)([`pane-separator-line`,{"is-active":he.value===t.id}]),style:(0,e.normalizeStyle)({top:`${t.top}px`})},null,6))),128))]),(0,e.createElementVNode)(`div`,{ref_key:`tooltipLayerRef`,ref:y,class:`tooltip-layer`},null,512),(0,e.createElementVNode)(`div`,{class:`chart-container`,style:(0,e.normalizeStyle)({cursor:ye.value}),ref_key:`containerRef`,ref:g,onScrollPassive:Re,onPointerdown:Ae,onPointermove:je,onPointerup:Me,onPointerleave:Ne},[(0,e.createElementVNode)(`div`,{class:`scroll-content`,style:(0,e.normalizeStyle)({width:(0,e.unref)(tt)+`px`})},[(0,e.createElementVNode)(`div`,{class:`canvas-layer`,ref_key:`canvasLayerRef`,ref:m},[(0,e.createElementVNode)(`canvas`,{class:`x-axis-canvas`,ref_key:`xAxisCanvasRef`,ref:p},null,512),F.value?((0,e.openBlock)(),(0,e.createBlock)(v,{key:0,drawing:F.value,onUpdateStyle:Oe,onDelete:ke},null,8,[`drawing`])):(0,e.createCommentVNode)(``,!0)],512)],4)],36),y.value?((0,e.openBlock)(),(0,e.createBlock)(e.Teleport,{key:0,to:y.value},[R.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:(0,e.normalizeClass)([`tooltip-anchor kline-tooltip-anchor`,{"use-anchor":j.value}]),style:(0,e.normalizeStyle)(Se.value)},null,6)):(0,e.createCommentVNode)(``,!0),de.value||L.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:1,class:(0,e.normalizeClass)([`tooltip-anchor marker-tooltip-anchor`,{"use-anchor":j.value}]),style:(0,e.normalizeStyle)(Ce.value)},null,6)):(0,e.createCommentVNode)(``,!0),R.value?((0,e.openBlock)(),(0,e.createBlock)(Xe,{key:2,k:R.value,index:be.value,data:Ee.value,pos:z.value,"set-el":ae,"use-anchor":j.value,"anchor-placement":we.value},null,8,[`k`,`index`,`data`,`pos`,`use-anchor`,`anchor-placement`])):(0,e.createCommentVNode)(``,!0),de.value||L.value?((0,e.openBlock)(),(0,e.createBlock)($e,{key:3,marker:de.value||L.value,pos:B.value,"use-anchor":j.value,"anchor-placement":Te.value,"set-el":oe},null,8,[`marker`,`pos`,`use-anchor`,`anchor-placement`])):(0,e.createCommentVNode)(``,!0)],8,[`to`])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,{class:`right-axis-host`,ref_key:`rightAxisLayerRef`,ref:h,style:(0,e.normalizeStyle)({width:et.value+`px`}),onPointerdown:Pe,onPointermove:Fe,onPointerup:Ie,onPointerleave:Le},null,36)],512)],2),(0,e.createVNode)(Ve,{"active-indicators":Be.value,"indicator-params":H.value,onToggle:X,onUpdateParams:Ze,onReorderSubIndicators:Qe},null,8,[`active-indicators`,`indicator-params`])],8,On))}}),[[`__scopeId`,`data-v-28c25ee4`]]),Mn={name:`@363045841yyt/klinechart`,version:`0.7.3-alpha.1`,description:`Vue 3 bindings for @363045841yyt/klinechart-core. Idiomatic composables, SFC components.`,license:`MIT`,type:`module`,engines:{node:`^20.19.0 || >=22.12.0`},sideEffects:!1,main:`./dist/index.js`,module:`./dist/index.js`,types:`./dist/index.d.ts`,exports:{".":{import:{types:`./dist/index.d.ts`,default:`./dist/index.js`},require:{types:`./dist/index.d.cts`,default:`./dist/index.cjs`}},"./style.css":`./dist/klinechart.css`},files:[`dist`,`src`],publishConfig:{access:`public`},scripts:{dev:`vite --config preview/vite.config.ts`,build:`vite build && node -e "require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')"`,postbuild:`node -e "require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')"`,test:`vitest run`,"test:watch":`vitest`,size:`size-limit`,"lint:publish":`publint --strict .`,"lint:types":`attw --pack .`},"size-limit":[{name:`vue (entry, pre-build src measurement)`,path:`src/index.ts`,limit:`8 KB`,gzip:!0,ignore:[`vue`,`@363045841yyt/klinechart-core`]}],peerDependencies:{"@363045841yyt/klinechart-core":`workspace:^`,vue:`^3.4.0`},devDependencies:{"@arethetypeswrong/cli":`^0.18.3`,"@size-limit/preset-small-lib":`^12.1.0`,"@vitejs/plugin-vue":`^6.0.0`,"@vue/test-utils":`^2.4.10`,jsdom:`^29.1.1`,publint:`^0.3.0`,"size-limit":`^12.1.0`,typescript:`~6.0.3`,"unplugin-icons":`^23.0.1`,vite:`^8.0.14`,"vite-plugin-babel":`^1.3.2`,"vite-plugin-dts":`^5.0.1`,vitest:`^4.1.5`,vue:`^3.5.0`}}.version,Nn=null;function Pn(e){Nn=e}function Fn(e){if(e.container==null)throw Error("[@363045841yyt/klinechart] createChart: `container` is required and must be a non-null HTMLElement");if(Nn===null)throw Error(`[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).`);return Nn(e)}function In(t){let n=(0,e.shallowRef)(t.peek());return(0,e.onScopeDispose)(t.subscribe(()=>{n.value=t.peek()})),n}function Ln(t,n){let r=(0,e.shallowRef)(null),i=e=>{e==null||r.value!=null||(r.value=Fn({...n,container:e}))};i(t.value);let a=(0,e.watch)(t,e=>{i(e)},{immediate:!0,flush:`post`}),o=()=>{a();let e=r.value;e!=null&&(e.dispose(),r.value=null)};return(0,e.onScopeDispose)(o),(0,e.onBeforeUnmount)(o),{chart:r}}function Rn(t){let n=(0,e.shallowRef)(t.indicators.peek());return(0,e.onScopeDispose)(t.indicators.subscribe(()=>{n.value=t.indicators.peek()})),{indicators:n,add:t.addIndicator.bind(t),remove:t.removeIndicator.bind(t),updateParams:t.updateIndicatorParams.bind(t)}}function zn(t){let n=(0,e.shallowRef)(t.interactionState.peek());return(0,e.onScopeDispose)(t.interactionState.subscribe(()=>{n.value=t.interactionState.peek()})),n}function Bn(t){let n=(0,e.shallowRef)(t.paneRatios.peek());return(0,e.onScopeDispose)(t.paneRatios.subscribe(()=>{n.value=t.paneRatios.peek()})),n}function Vn(t){let n=(0,e.shallowRef)(t.viewport.peek());return(0,e.onScopeDispose)(t.viewport.subscribe(()=>{n.value=t.viewport.peek()})),n}var Hn=(0,e.defineComponent)({name:`KLineChart`,props:{data:{type:Array,required:!0},initialZoomLevel:{type:Number,default:3},zoomLevels:{type:Number,default:20},theme:{type:String,default:`light`},containerClass:{type:String,default:``}},emits:{ready:e=>!0,zoomLevelChange:(e,t)=>!0},setup(t,{emit:n,expose:r}){let i=(0,e.shallowRef)(null),a=(0,e.effectScope)(),o=(0,e.shallowRef)(null);(0,e.onMounted)(()=>{let r=i.value;r!=null&&(a.run(()=>{if(o.value=Fn({container:r,data:t.data,initialZoomLevel:t.initialZoomLevel,zoomLevels:t.zoomLevels,theme:t.theme}),o.value!=null){n(`ready`,o.value);let t=o.value,r=()=>{let e=t.viewport.peek();n(`zoomLevelChange`,e.zoomLevel,e.kWidth)};r(),(0,e.onScopeDispose)(t.viewport.subscribe(r))}}),(0,e.watch)(()=>t.data,e=>{o.value?.setData(e)}),(0,e.watch)(()=>t.theme,e=>{o.value?.setTheme(e)}))}),(0,e.onUnmounted)(()=>{o.value?.dispose(),o.value=null,a.stop()}),r({getController:()=>o.value,handlePointerEvent:(e,t)=>o.value?.handlePointerEvent(e,t)??!1,handleWheelEvent:e=>o.value?.handleWheelEvent(e),handleScrollEvent:()=>o.value?.handleScrollEvent(),zoomToLevel:(e,t)=>o.value?.zoomToLevel(e,t),zoomIn:e=>o.value?.zoomIn(e),zoomOut:e=>o.value?.zoomOut(e),addIndicator:(e,t,n)=>o.value?.addIndicator(e,t,n)??null,removeIndicator:e=>o.value?.removeIndicator(e)??!1,setTheme:e=>o.value?.setTheme(e),setData:e=>o.value?.setData(e)});let s=e=>{i.value=e??null};return()=>(0,e.h)(`div`,{ref:s,class:[`klinechart-quant-root`,t.containerClass].filter(Boolean).join(` `),style:{width:`100%`,height:`100%`}})}}),Un={install(e){e.component(`KLineChart`,Hn)}};Pn(d.createChartController),Object.defineProperty(exports,"CORE_VERSION",{enumerable:!0,get:function(){return d.VERSION}}),exports.DrawingStyleToolbar=v,exports.IndicatorParams=oe,exports.IndicatorSelector=Ve,exports.KLineChart=Hn,exports.KLineChartVue=jn,exports.KLineTooltip=Xe,exports.KMapPlugin=Un,exports.LeftToolbar=Dn,exports.MarkerTooltip=$e,exports.VERSION=Mn,exports.__setControllerFactory=Pn,exports.coreSignalToVueRef=In,exports.createChart=Fn,exports.useChart=Ln,exports.useIndicators=Rn,exports.useInteractionState=zn,exports.usePaneRatios=Bn,exports.useViewport=Vn;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("vue"),t=require("@363045841yyt/klinechart-core/engine/renderers/Indicator/indicatorData"),n=require("@363045841yyt/klinechart-core/semantic"),r=require("@363045841yyt/klinechart-core/engine/chart"),i=require("@363045841yyt/klinechart-core/engine/chart-store"),a=require("@363045841yyt/klinechart-core/engine/utils/zoom"),o=require("@363045841yyt/klinechart-core/engine/utils/klineConfig"),s=require("@363045841yyt/klinechart-core/engine/renderers/Indicator/subPaneConfig"),c=require("@363045841yyt/klinechart-core/engine/renderers/paneTitle"),l=require("@363045841yyt/klinechart-core/config"),u=require("@363045841yyt/klinechart-core/engine/drawing"),d=require("@363045841yyt/klinechart-core");var f={class:`toolbar-item color-item`,title:`颜色`},p=[`value`],m=[`value`],h=[`value`],g=(0,e.defineComponent)({__name:`DrawingStyleToolbar`,props:{drawing:{}},emits:[`updateStyle`,`delete`],setup(t,{emit:n}){let r=n;function i(e){e.key===`Delete`&&(e.preventDefault(),r(`delete`))}(0,e.onMounted)(()=>document.addEventListener(`keydown`,i)),(0,e.onUnmounted)(()=>document.removeEventListener(`keydown`,i));function a(e){r(`updateStyle`,{stroke:e})}function o(e){r(`updateStyle`,{strokeWidth:e})}function s(e){r(`updateStyle`,{strokeStyle:e})}return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`drawing-style-toolbar`,onPointerdown:r[4]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[5]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[6]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createElementVNode)(`div`,f,[(0,e.createElementVNode)(`span`,{class:`color-swatch`,style:(0,e.normalizeStyle)({background:t.drawing.style.stroke??`#2962ff`})},null,4),(0,e.createElementVNode)(`input`,{type:`color`,class:`color-input`,value:t.drawing.style.stroke??`#2962ff`,onInput:r[0]||=e=>a(e.target.value)},null,40,p)]),(0,e.createElementVNode)(`select`,{class:`toolbar-select`,value:t.drawing.style.strokeWidth??1,onChange:r[1]||=e=>o(Number(e.target.value)),title:`线宽`},[...r[7]||=[(0,e.createElementVNode)(`option`,{value:1},`1px`,-1),(0,e.createElementVNode)(`option`,{value:2},`2px`,-1),(0,e.createElementVNode)(`option`,{value:3},`3px`,-1),(0,e.createElementVNode)(`option`,{value:4},`4px`,-1)]],40,m),(0,e.createElementVNode)(`select`,{class:`toolbar-select`,value:t.drawing.style.strokeStyle??`solid`,onChange:r[2]||=e=>s(e.target.value),title:`线型`},[...r[8]||=[(0,e.createElementVNode)(`option`,{value:`solid`},`实线`,-1),(0,e.createElementVNode)(`option`,{value:`dashed`},`虚线`,-1),(0,e.createElementVNode)(`option`,{value:`dotted`},`点线`,-1)]],40,h),(0,e.createElementVNode)(`button`,{type:`button`,class:`toolbar-btn delete-btn`,title:`删除`,onClick:r[3]||=e=>n.$emit(`delete`)},[...r[9]||=[(0,e.createElementVNode)(`svg`,{class:`delete-icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[(0,e.createElementVNode)(`path`,{d:`M3 6h18`}),(0,e.createElementVNode)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,e.createElementVNode)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`})],-1)]])],32))}}),_=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},v=_(g,[[`__scopeId`,`data-v-87e91714`]]),y={class:`params-header`},b={class:`header-left`},x={class:`params-title`},S={class:`header-right`},C={key:0,class:`indicator-description`},w={class:`params-body`},T={class:`param-header`},E={class:`param-label`},ee={class:`param-label-text`},te={key:0,class:`param-range`},ne={class:`input-wrapper`},D=[`disabled`,`onClick`],O=[`value`,`min`,`max`,`step`,`onInput`],re=[`disabled`,`onClick`],k={key:0,class:`param-description`},ie={class:`params-footer`},ae={class:`footer-right`},oe=_((0,e.defineComponent)({__name:`IndicatorParams`,props:{visible:{type:Boolean},indicatorId:{},indicatorName:{},indicatorDescription:{},params:{},values:{}},emits:[`close`,`confirm`],setup(t,{emit:n}){let r=t,i=n,a=(0,e.ref)({...r.values}),o=(0,e.ref)(!0),s=(0,e.computed)(()=>`body`);(0,e.watch)(()=>r.values,e=>{a.value={...e}},{deep:!0,immediate:!0}),(0,e.watch)(()=>r.visible,e=>{e&&(a.value={...r.values})});function c(e,t){let n=t.target,r=parseFloat(n.value);isNaN(r)||(a.value[e]=r)}function l(e,t){let n=e.step||1,r=(a.value[e.key]||0)+t*n;e.min!==void 0&&(r=Math.max(e.min,r)),e.max!==void 0&&(r=Math.min(e.max,r)),a.value[e.key]=parseFloat(r.toFixed(10))}function u(){let e={};r.params.forEach(t=>{e[t.key]=t.default??r.values[t.key]??0}),a.value=e}function d(){i(`confirm`,{...a.value})}return(n,r)=>((0,e.openBlock)(),(0,e.createBlock)(e.Teleport,{to:s.value},[(0,e.createVNode)(e.Transition,{name:`overlay`},{default:(0,e.withCtx)(()=>[t.visible?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`params-overlay`,onClick:r[4]||=e=>n.$emit(`close`)},[(0,e.createVNode)(e.Transition,{name:`modal`},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,{class:`indicator-params`,onClick:r[3]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createElementVNode)(`div`,y,[(0,e.createElementVNode)(`div`,b,[(0,e.createElementVNode)(`span`,x,(0,e.toDisplayString)(t.indicatorName),1),r[5]||=(0,e.createElementVNode)(`span`,{class:`params-subtitle`},`参数设置`,-1)]),(0,e.createElementVNode)(`div`,S,[(0,e.createElementVNode)(`button`,{class:(0,e.normalizeClass)([`toggle-desc-btn`,{active:o.value}]),onClick:r[0]||=e=>o.value=!o.value,title:`显示/隐藏说明`},[...r[6]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 1024 1024`},[(0,e.createElementVNode)(`path`,{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`,fill:`currentColor`})],-1)]],2),(0,e.createElementVNode)(`button`,{class:`params-close`,onClick:r[1]||=e=>n.$emit(`close`)},[...r[7]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M18 6L6 18M6 6l12 12`})],-1)]])])]),(0,e.createVNode)(e.Transition,{name:`slide`},{default:(0,e.withCtx)(()=>[o.value&&t.indicatorDescription?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,C,[(0,e.createElementVNode)(`p`,null,(0,e.toDisplayString)(t.indicatorDescription),1)])):(0,e.createCommentVNode)(``,!0)]),_:1}),(0,e.createElementVNode)(`div`,w,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.params,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.key,class:(0,e.normalizeClass)([`param-item`,{"has-desc":o.value&&t.description}])},[(0,e.createElementVNode)(`div`,T,[(0,e.createElementVNode)(`label`,E,[(0,e.createElementVNode)(`span`,ee,(0,e.toDisplayString)(t.label),1),t.min!==void 0||t.max!==void 0?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,te,(0,e.toDisplayString)(t.min??`-∞`)+` ~ `+(0,e.toDisplayString)(t.max??`+∞`),1)):(0,e.createCommentVNode)(``,!0)]),(0,e.createElementVNode)(`div`,ne,[(0,e.createElementVNode)(`button`,{class:`stepper-btn`,disabled:t.min!==void 0&&(a.value[t.key]??0)<=t.min,onClick:e=>l(t,-1)},` − `,8,D),t.type===`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`input`,{key:0,type:`number`,class:`param-input`,value:a.value[t.key],min:t.min,max:t.max,step:t.step||1,onInput:e=>c(t.key,e)},null,40,O)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`button`,{class:`stepper-btn`,disabled:t.max!==void 0&&(a.value[t.key]??0)>=t.max,onClick:e=>l(t,1)},` + `,8,re)])]),(0,e.createVNode)(e.Transition,{name:`slide`},{default:(0,e.withCtx)(()=>[o.value&&t.description?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,k,(0,e.toDisplayString)(t.description),1)):(0,e.createCommentVNode)(``,!0)]),_:2},1024)],2))),128))]),(0,e.createElementVNode)(`div`,ie,[(0,e.createElementVNode)(`button`,{class:`params-btn reset`,onClick:u},[...r[8]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,e.createElementVNode)(`path`,{d:`M3 3v5h5`})],-1),(0,e.createTextVNode)(` 重置 `,-1)]]),(0,e.createElementVNode)(`div`,ae,[(0,e.createElementVNode)(`button`,{class:`params-btn cancel`,onClick:r[2]||=e=>n.$emit(`close`)},`取消`),(0,e.createElementVNode)(`button`,{class:`params-btn confirm`,onClick:d},[...r[9]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`},[(0,e.createElementVNode)(`path`,{d:`M20 6L9 17l-5-5`})],-1),(0,e.createTextVNode)(` 确定 `,-1)]])])])])]),_:1})])):(0,e.createCommentVNode)(``,!0)]),_:1})],8,[`to`]))}}),[[`__scopeId`,`data-v-2ffc8f4d`]]),A=Symbol(`fullscreen-teleport-target`);function j(){let t=(0,e.inject)(A,null);return(0,e.computed)(()=>t?.value??`body`)}var M={class:`indicator-selector`},se={class:`indicator-scroll-container`},ce={class:`indicator-list`},N={key:0,class:`indicator-divider`,"aria-hidden":`true`},P=[`draggable`,`onDragstart`,`onDragover`,`onDrop`],F=[`onMouseenter`],le={class:`btn-content`},ue={key:0,class:`param-hint`},I={key:0,class:`hover-overlay`},de=[`onClick`],L={key:1,class:`divider`},fe=[`onClick`],pe={class:`indicator-item`},me={class:`modal-header`},he={class:`header-title`},ge={class:`title-sub`},_e={class:`header-actions`},ve={key:0,viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`},ye={key:1,viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`},R={class:`modal-body`},be={class:`indicator-section`},xe={class:`section-header`},z={class:`section-count`},Se=[`onClick`],B={class:`card-label`},Ce={class:`card-tooltip`},we={class:`card-header`},Te={class:`card-label`},Ee={class:`card-header-actions`},De=[`onClick`],Oe={class:`card-name`},ke={class:`indicator-section`},Ae={class:`section-header`},je={class:`section-count`},Me=[`onClick`],Ne={class:`card-label`},Pe={class:`card-tooltip`},Fe={class:`card-header`},Ie={class:`card-label`},Le={class:`card-header-actions`},Re=[`onClick`],V={class:`card-name`},ze={class:`modal-footer`},Be={class:`footer-info`},H={class:`info-text`},Ve=_((0,e.defineComponent)({__name:`IndicatorSelector`,props:{activeIndicators:{},indicatorParams:{}},emits:[`toggle`,`updateParams`,`reorderSubIndicators`],setup(n,{emit:r}){let i=n,a=r,o=(0,e.ref)(null),s=(0,e.ref)(!1),c=(0,e.ref)(null),l=(0,e.ref)(null),u=(0,e.ref)(!1),d=(0,e.ref)(null),f=(0,e.ref)(null),p=(0,e.ref)(!1),m=j(),h=(0,e.computed)(()=>i.activeIndicators?.length?i.activeIndicators.map(e=>(0,t.findIndicator)(e)).filter(e=>e!==void 0).sort((e,t)=>e.pane===t.pane?0:e.pane===`main`?-1:1):[]),g=(0,e.computed)(()=>h.value.some(e=>e.pane===`main`)?h.value.find(e=>e.pane===`sub`)?.id??null:null),_=(0,e.computed)(()=>c.value?(0,t.findIndicator)(c.value):null),v=(0,e.computed)(()=>t.mainIndicators.length+t.subIndicators.length),y=(0,e.computed)(()=>i.activeIndicators?.length??0);function b(e){return i.activeIndicators?.includes(e)??!1}function x(e){if(b(e))return;let n=(0,t.findIndicator)(e);n&&(n.pane===`main`&&t.mainIndicators.filter(t=>t.id!==e&&b(t.id)).forEach(e=>a(`toggle`,e.id,!1)),a(`toggle`,e,!0))}function S(e){a(`toggle`,e,!1)}function C(e){c.value=e,s.value=!0}function w(){u.value=!1}function T(e){let n=(0,t.findIndicator)(e);if(!n?.params)return{};let r={};for(let e of n.params)r[e.key]=e.default??e.min??1;let a=i.indicatorParams?.[e]||{},o={...r};for(let[e,t]of Object.entries(a))typeof t==`number`&&(o[e]=t);return o}function E(e){let t=T(e.id);return e.params?e.params.map(e=>t[e.key]??``).join(`,`):``}function ee(e){c.value&&a(`updateParams`,c.value,e),s.value=!1}function te(e,n){if(!(0,t.isSubIndicatorId)(n)){e.preventDefault();return}f.value=n,d.value=null,e.dataTransfer?.setData(`text/plain`,n),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`)}function ne(e,n){!f.value||!(0,t.isSubIndicatorId)(n)||f.value===n||(d.value=n,e.dataTransfer&&(e.dataTransfer.dropEffect=`move`))}function D(e,n){let r=f.value||e.dataTransfer?.getData(`text/plain`)||``;if(!r||r===n){O();return}if(!(0,t.isSubIndicatorId)(r)||!(0,t.isSubIndicatorId)(n)){O();return}let i=h.value.findIndex(e=>e.id===r),o=h.value.findIndex(e=>e.id===n);if(i<0||o<0){O();return}let s=[...h.value.map(e=>e.id)],[c]=s.splice(i,1);if(!c){O();return}s.splice(o,0,c),a(`reorderSubIndicators`,s.filter(e=>(0,t.isSubIndicatorId)(e))),O()}function O(){d.value=null,f.value=null}function re(){u.value=!u.value}function k(e){e.key===`Escape`&&u.value&&(u.value=!1)}return(0,e.onMounted)(()=>{document.addEventListener(`keydown`,k)}),(0,e.onUnmounted)(()=>{document.removeEventListener(`keydown`,k)}),(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,M,[(0,e.createElementVNode)(`div`,se,[(0,e.createElementVNode)(`div`,ce,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(h.value,n=>((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:n.id},[n.id===g.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,N)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`indicator-item`,{draggable:(0,e.unref)(t.isSubIndicatorId)(n.id),"drag-over":d.value===n.id,"is-dragging":f.value===n.id}]),draggable:(0,e.unref)(t.isSubIndicatorId)(n.id),onDragstart:e=>te(e,n.id),onDragover:(0,e.withModifiers)(e=>ne(e,n.id),[`prevent`]),onDrop:(0,e.withModifiers)(e=>D(e,n.id),[`prevent`]),onDragend:O},[(0,e.createElementVNode)(`div`,{class:`indicator-btn-wrapper`,onMouseenter:e=>l.value=n.id,onMouseleave:r[0]||=e=>l.value=null},[(0,e.createElementVNode)(`button`,{class:(0,e.normalizeClass)([`indicator-btn`,{active:!0,hovering:l.value===n.id}])},[(0,e.createElementVNode)(`span`,le,[(0,e.createTextVNode)((0,e.toDisplayString)(n.label)+` `,1),n.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,ue,` (`+(0,e.toDisplayString)(E(n))+`) `,1)):(0,e.createCommentVNode)(``,!0)]),(0,e.createVNode)(e.Transition,{name:`fade`},{default:(0,e.withCtx)(()=>[l.value===n.id?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,I,[n.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:0,class:`action-btn settings-btn`,onClick:(0,e.withModifiers)(e=>C(n.id),[`stop`]),title:`编辑参数`},[...r[4]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`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,de)):(0,e.createCommentVNode)(``,!0),n.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,L)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`button`,{class:`action-btn remove-btn`,onClick:(0,e.withModifiers)(e=>S(n.id),[`stop`]),title:`移除指标`},[...r[5]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`})],-1)]],8,fe)])):(0,e.createCommentVNode)(``,!0)]),_:2},1024)],2)],40,F)],42,P)],64))),128)),(0,e.createElementVNode)(`div`,pe,[(0,e.createElementVNode)(`button`,{ref_key:`addBtnRef`,ref:o,class:`add-btn`,onClick:re,title:`添加指标`},[...r[6]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`currentColor`},[(0,e.createElementVNode)(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],512)])])]),((0,e.openBlock)(),(0,e.createBlock)(e.Teleport,{to:(0,e.unref)(m)},[(0,e.createVNode)(e.Transition,{name:`overlay`},{default:(0,e.withCtx)(()=>[u.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`selector-overlay`,onClick:w},[(0,e.createVNode)(e.Transition,{name:`modal`},{default:(0,e.withCtx)(()=>[u.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`selector-modal`,onClick:r[2]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createElementVNode)(`div`,me,[(0,e.createElementVNode)(`div`,he,[r[7]||=(0,e.createElementVNode)(`span`,{class:`title-text`},`添加指标`,-1),(0,e.createElementVNode)(`span`,ge,(0,e.toDisplayString)(v.value)+` 个可用指标`,1)]),(0,e.createElementVNode)(`div`,_e,[(0,e.createElementVNode)(`button`,{class:(0,e.normalizeClass)([`view-toggle-btn`,{active:p.value}]),onClick:r[1]||=e=>p.value=!p.value,title:`简洁模式`},[p.value?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,ye,[...r[9]||=[(0,e.createElementVNode)(`path`,{d:`M3 3h18v18H3V3zm16 16V5H5v14h14zM7 7h4v4H7V7zm0 6h4v4H7v-4zm6-6h4v4h-4V7zm0 6h4v4h-4v-4z`},null,-1)]])):((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,ve,[...r[8]||=[(0,e.createElementVNode)(`path`,{d:`M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z`},null,-1)]]))],2),(0,e.createElementVNode)(`button`,{class:`modal-close`,onClick:w,title:`??`},[...r[10]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`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)]])])]),(0,e.createElementVNode)(`div`,R,[(0,e.createElementVNode)(`div`,be,[(0,e.createElementVNode)(`div`,xe,[r[11]||=(0,e.createElementVNode)(`span`,{class:`section-title`},`主图指标`,-1),(0,e.createElementVNode)(`span`,z,(0,e.toDisplayString)((0,e.unref)(t.mainIndicators).length),1)]),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`indicator-grid`,{compact:p.value}])},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)((0,e.unref)(t.mainIndicators),t=>((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:t.id,class:(0,e.normalizeClass)([`indicator-card`,{active:b(t.id),compact:p.value}]),onClick:e=>b(t.id)?S(t.id):x(t.id)},[p.value?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[(0,e.createElementVNode)(`span`,B,(0,e.toDisplayString)(t.label),1),(0,e.createElementVNode)(`span`,Ce,(0,e.toDisplayString)(t.name),1)],64)):((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[(0,e.createElementVNode)(`div`,we,[(0,e.createElementVNode)(`span`,Te,(0,e.toDisplayString)(t.label),1),(0,e.createElementVNode)(`div`,Ee,[t.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:0,class:`card-settings-btn`,onClick:(0,e.withModifiers)(e=>C(t.id),[`stop`]),title:`编辑参数`},[...r[12]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`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,De)):(0,e.createCommentVNode)(``,!0)])]),(0,e.createElementVNode)(`div`,Oe,(0,e.toDisplayString)(t.name),1)],64))],10,Se))),128))],2)]),r[15]||=(0,e.createElementVNode)(`div`,{class:`section-divider`},null,-1),(0,e.createElementVNode)(`div`,ke,[(0,e.createElementVNode)(`div`,Ae,[r[13]||=(0,e.createElementVNode)(`span`,{class:`section-title`},`副图指标`,-1),(0,e.createElementVNode)(`span`,je,(0,e.toDisplayString)((0,e.unref)(t.subIndicators).length),1)]),(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`indicator-grid`,{compact:p.value}])},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)((0,e.unref)(t.subIndicators),t=>((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:t.id,class:(0,e.normalizeClass)([`indicator-card`,{active:b(t.id),compact:p.value}]),onClick:e=>b(t.id)?S(t.id):x(t.id)},[p.value?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[(0,e.createElementVNode)(`span`,Ne,(0,e.toDisplayString)(t.label),1),(0,e.createElementVNode)(`span`,Pe,(0,e.toDisplayString)(t.name),1)],64)):((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[(0,e.createElementVNode)(`div`,Fe,[(0,e.createElementVNode)(`span`,Ie,(0,e.toDisplayString)(t.label),1),(0,e.createElementVNode)(`div`,Le,[t.params?.length?((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:0,class:`card-settings-btn`,onClick:(0,e.withModifiers)(e=>C(t.id),[`stop`]),title:`编辑参数`},[...r[14]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`currentColor`},[(0,e.createElementVNode)(`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,Re)):(0,e.createCommentVNode)(``,!0)])]),(0,e.createElementVNode)(`div`,V,(0,e.toDisplayString)(t.name),1)],64))],10,Me))),128))],2)])]),(0,e.createElementVNode)(`div`,ze,[(0,e.createElementVNode)(`div`,Be,[(0,e.createElementVNode)(`span`,H,`已激活 `+(0,e.toDisplayString)(y.value)+` 个指标`,1)]),(0,e.createElementVNode)(`button`,{class:`btn btn-confirm`,onClick:w},`??`)])])):(0,e.createCommentVNode)(``,!0)]),_:1})])):(0,e.createCommentVNode)(``,!0)]),_:1})],8,[`to`])),_.value?((0,e.openBlock)(),(0,e.createBlock)(oe,{key:0,visible:s.value,"indicator-id":_.value.id,"indicator-name":_.value.name,"indicator-description":_.value.description,params:_.value.params||[],values:T(_.value.id),onClose:r[3]||=e=>s.value=!1,onConfirm:ee},null,8,[`visible`,`indicator-id`,`indicator-name`,`indicator-description`,`params`,`values`])):(0,e.createCommentVNode)(``,!0)]))}}),[[`__scopeId`,`data-v-4dc6bc90`]]),U={class:`kline-tooltip__title`},He={key:0},Ue={class:`kline-tooltip__grid`},W={class:`row`},G={class:`row`},K={class:`row`},q={class:`row`},We={key:0,class:`row`},Ge={key:1,class:`row`},Ke={key:2,class:`row`},qe={key:3,class:`row`},Je={key:4,class:`row`},Ye={key:5,class:`row`},J=`#ef4444`,Y=`#22c55e`,X=`#6b7280`,Xe=_((0,e.defineComponent)({__name:`KLineTooltip`,props:{k:{},index:{},data:{},pos:{},useAnchor:{type:Boolean},anchorPlacement:{},setEl:{type:Function}},setup(t){let n=t,r=(0,e.computed)(()=>n.useAnchor===!0),i=(0,e.computed)(()=>n.anchorPlacement===`left-bottom`?`anchor-left-bottom`:`anchor-right-bottom`);function a(e){n.setEl?.(e)}function o(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function s(e){return e>=1e8?(e/1e8).toFixed(2)+`亿`:e>=1e4?(e/1e4).toFixed(2)+`万`:e.toFixed(2)}function c(e,t){return`${e>=0?`+`:``}${e.toFixed(2)}${t}`}function l(e,t,n){if(e.close>=e.open)return 1;let r=typeof n==`number`&&n>0?t[n-1]:void 0;return r&&e.close>r.close?1:r&&e.close<r.close?-1:0}let u=(0,e.computed)(()=>{let e=n.k;if(!e)return X;let t=l(e,n.data,n.index);return t>0?J:t<0?Y:X}),d=(0,e.computed)(()=>{let e=n.k;if(!e)return X;let t=e.close-e.open;return t>0?J:t<0?Y:X}),f=(0,e.computed)(()=>{let e=n.k;if(!e)return X;let t=e.changePercent??(e.close-e.open)/e.open*100;return t>0?J:t<0?Y:X});return(n,l)=>t.k?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,ref:a,class:(0,e.normalizeClass)([`kline-tooltip`,[{"use-anchor":r.value},i.value]]),style:(0,e.normalizeStyle)(r.value?void 0:{left:`${t.pos.x}px`,top:`${t.pos.y}px`})},[(0,e.createElementVNode)(`div`,U,[t.k.stockCode?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,He,(0,e.toDisplayString)(t.k.stockCode),1)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(o(t.k.timestamp)),1)]),(0,e.createElementVNode)(`div`,Ue,[(0,e.createElementVNode)(`div`,W,[l[0]||=(0,e.createElementVNode)(`span`,null,`开`,-1),(0,e.createElementVNode)(`span`,{style:(0,e.normalizeStyle)({color:u.value})},(0,e.toDisplayString)(t.k.open.toFixed(2)),5)]),(0,e.createElementVNode)(`div`,G,[l[1]||=(0,e.createElementVNode)(`span`,null,`高`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.k.high.toFixed(2)),1)]),(0,e.createElementVNode)(`div`,K,[l[2]||=(0,e.createElementVNode)(`span`,null,`低`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.k.low.toFixed(2)),1)]),(0,e.createElementVNode)(`div`,q,[l[3]||=(0,e.createElementVNode)(`span`,null,`收`,-1),(0,e.createElementVNode)(`span`,{style:(0,e.normalizeStyle)({color:d.value})},(0,e.toDisplayString)(t.k.close.toFixed(2)),5)]),typeof t.k.volume==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,We,[l[4]||=(0,e.createElementVNode)(`span`,null,`成交量`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(s(t.k.volume)),1)])):(0,e.createCommentVNode)(``,!0),typeof t.k.turnover==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ge,[l[5]||=(0,e.createElementVNode)(`span`,null,`成交额`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(s(t.k.turnover)),1)])):(0,e.createCommentVNode)(``,!0),typeof t.k.amplitude==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ke,[l[6]||=(0,e.createElementVNode)(`span`,null,`振幅`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.k.amplitude)+`%`,1)])):(0,e.createCommentVNode)(``,!0),typeof t.k.changePercent==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,qe,[l[7]||=(0,e.createElementVNode)(`span`,null,`涨跌幅`,-1),(0,e.createElementVNode)(`span`,{style:(0,e.normalizeStyle)({color:f.value})},(0,e.toDisplayString)(c(t.k.changePercent,`%`)),5)])):(0,e.createCommentVNode)(``,!0),typeof t.k.changeAmount==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Je,[l[8]||=(0,e.createElementVNode)(`span`,null,`涨跌额`,-1),(0,e.createElementVNode)(`span`,{style:(0,e.normalizeStyle)({color:f.value})},(0,e.toDisplayString)(c(t.k.changeAmount,``)),5)])):(0,e.createCommentVNode)(``,!0),typeof t.k.turnoverRate==`number`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ye,[l[9]||=(0,e.createElementVNode)(`span`,null,`换手率`,-1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.k.turnoverRate.toFixed(2))+`%`,1)])):(0,e.createCommentVNode)(``,!0)])],6)):(0,e.createCommentVNode)(``,!0)}}),[[`__scopeId`,`data-v-90b1aa6d`]]),Ze={class:`marker-tooltip__title`},Qe={key:0,class:`marker-tooltip__content`},$e=_((0,e.defineComponent)({__name:`MarkerTooltip`,props:{marker:{},pos:{},useAnchor:{type:Boolean},anchorPlacement:{},setEl:{type:Function}},setup(t){let n={support:`支撑位`,resistance:`阻力位`,top:`顶部`,bottom:`底部`},r=t,i=(0,e.computed)(()=>r.useAnchor===!0),a=(0,e.computed)(()=>r.anchorPlacement===`left-bottom`?`anchor-left-bottom`:`anchor-right-bottom`);function o(e){r.setEl?.(e)}let s=(0,e.computed)(()=>r.marker&&`date`in r.marker),c=(0,e.computed)(()=>{if(!r.marker)return``;if(s.value){let e=r.marker;return e.label?.text||e.shape}let e=r.marker;return n[e.markerType]||e.markerType}),l=(0,e.computed)(()=>{if(!r.marker)return{};if(s.value){let e=r.marker;return{日期:e.date,...e.metadata}}return r.marker.metadata}),u=(0,e.computed)(()=>Object.keys(l.value).length>0);function d(e){return typeof e==`number`?e.toFixed(2):String(e)}return(n,r)=>t.marker?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,ref:o,class:(0,e.normalizeClass)([`marker-tooltip`,[{"use-anchor":i.value},a.value]]),style:(0,e.normalizeStyle)(i.value?void 0:{left:`${t.pos.x+12}px`,top:`${t.pos.y+12}px`})},[(0,e.createElementVNode)(`div`,Ze,(0,e.toDisplayString)(c.value),1),u.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Qe,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(l.value,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n,class:`row`},[(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(n),1),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(d(t)),1)]))),128))])):(0,e.createCommentVNode)(``,!0)],6)):(0,e.createCommentVNode)(``,!0)}}),[[`__scopeId`,`data-v-057b55c9`]]),et={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function tt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,et,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var nt=(0,e.markRaw)({name:`tabler-pointer`,render:tt}),Z={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Z,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 19h16M4 15l4-6l4 2l4-5l4 4`},null,-1)]])}var it=(0,e.markRaw)({name:`tabler-chart-line`,render:rt}),at={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ot(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,at,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17 7L7 17M8 7h9v9`},null,-1)]])}var st=(0,e.markRaw)({name:`tabler-arrow-up-right`,render:ot}),ct={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function lt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,ct,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14m-6 6l6-6m-6-6l6 6`},null,-1)]])}var ut=(0,e.markRaw)({name:`tabler-arrow-right`,render:lt}),dt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ft(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,dt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14`},null,-1)]])}var pt=(0,e.markRaw)({name:`tabler-minus`,render:ft}),mt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ht(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,mt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 12v.01M7 12h10m4 0v.01`},null,-1)]])}var gt=(0,e.markRaw)({name:`tabler-separator`,render:ht}),_t={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function vt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,_t,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var yt=(0,e.markRaw)({name:`tabler-crosshair`,render:vt}),bt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function xt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,bt,[...n[0]||=[(0,e.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01`}),(0,e.createElementVNode)(`path`,{d:`M11 12h1v4h1`})],-1)]])}var St=(0,e.markRaw)({name:`tabler-info-circle`,render:xt}),Ct={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function wt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Ct,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m-3-3v6m11 8l-6-6`},null,-1)]])}var Tt=(0,e.markRaw)({name:`tabler-zoom-in`,render:wt}),Et={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Dt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Et,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 10a7 7 0 1 0 14 0a7 7 0 1 0-14 0m4 0h6m8 11l-6-6`},null,-1)]])}var Ot=(0,e.markRaw)({name:`tabler-zoom-out`,render:Dt}),kt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function At(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,kt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var jt=(0,e.markRaw)({name:`tabler-maximize`,render:At}),Mt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Nt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Mt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var Pt=(0,e.markRaw)({name:`tabler-minimize`,render:Nt}),Ft={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function It(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Ft,[...n[0]||=[(0,e.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,e.createElementVNode)(`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`}),(0,e.createElementVNode)(`path`,{d:`M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0`})],-1)]])}var Lt=(0,e.markRaw)({name:`tabler-settings`,render:It}),Rt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function zt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Rt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var Bt=(0,e.markRaw)({name:`tabler-shape`,render:zt}),Vt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ht(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Vt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,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`},null,-1)]])}var Ut=(0,e.markRaw)({name:`tabler-chart-dots-3`,render:Ht}),Wt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Gt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Wt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m18 10l-6-6l-6 6zm0 4l-6 6l-6-6z`},null,-1)]])}var Kt=(0,e.markRaw)({name:`tabler-caret-up-down`,render:Gt}),qt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Jt(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`svg`,qt,[...n[0]||=[(0,e.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 4H5v16h3m8-16h3v16h-3`},null,-1)]])}var Yt=(0,e.markRaw)({name:`tabler-brackets`,render:Jt});function Xt(){return Object.create(null)}function Zt(){return{ctxMethods:Xt(),ctxProps:Xt(),canvasProps:Xt(),ctxMethodSources:Object.create(null)}}function Qt(e,t,n){let r=e[t]??={count:0,totalTime:0};r.count+=1,r.totalTime+=n}function $t(e,t,n,r){Qt(e.ctxMethodSources[t]??=Xt(),n,r)}function en(e){return Object.entries(e).filter(([,e])=>e.count>0).map(([e,t])=>({name:e,count:t.count,totalTime:t.totalTime.toFixed(2),averageTime:(t.totalTime/t.count).toFixed(4)})).sort((e,t)=>Number(t.totalTime)-Number(e.totalTime))}var tn=!1,nn=new Map,rn=new Map;function an(e){tn=e,e?typeof window<`u`&&!window.__KMAP_CANVAS_PROFILER_INSTALLED__&&sn():cn()}function on(){if(!tn)return`disabled`;let e=Error().stack;if(!e)return`unknown`;let t=e.split(`
|
|
2
|
+
`).map(e=>e.trim()).filter(Boolean);for(let e of t){if(e.includes(`canvasProfiler`)||e.includes(`CanvasRenderingContext2D`)||e===`Error`)continue;let t=e.replace(/^at\s+/,``),n=t.match(/((?:src|node_modules)[^\s)]+):(\d+):(\d+)/);if(n)return`${n[1]}:${n[2]}`;let r=t.match(/\(([^)]+):(\d+):(\d+)\)$/);return r?`${r[1]}:${r[2]}`:t}return`unknown`}function Q(e,t,n,r){let i=`${e.constructor?.name??`proto`}:${t}`;if(nn.has(i))return;let a=Reflect.get(e,t);typeof a==`function`&&(nn.set(i,a),Reflect.set(e,t,function(...e){if(!tn)return a.apply(this,e);let i=r?.captureSource?on():null,o=performance.now(),s=a.apply(this,e),c=performance.now()-o;return Qt(n.ctxMethods,t,c),i&&$t(n,t,i,c),s}))}function $(e,t,n){let r=Object.getOwnPropertyDescriptor(e,t);if(!r?.set||!r.configurable)return;let i=`${e.constructor?.name??`proto`}:${t}`;rn.has(i)||(rn.set(i,r),Object.defineProperty(e,t,{configurable:!0,enumerable:r.enumerable??!1,get:r.get,set(e){if(!tn){r.set.call(this,e);return}let i=performance.now();r.set.call(this,e),Qt(n,t,performance.now()-i)}}))}function sn(){if(typeof window>`u`||window.__KMAP_CANVAS_PROFILER_INSTALLED__)return;let e=CanvasRenderingContext2D?.prototype,t=HTMLCanvasElement?.prototype;if(!e||!t)return;let n=Zt();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),$(e,`font`,n.ctxProps),$(e,`filter`,n.ctxProps),$(e,`shadowBlur`,n.ctxProps),$(e,`lineWidth`,n.ctxProps),$(t,`width`,n.canvasProps),$(t,`height`,n.canvasProps),window.__KMAP_CANVAS_PROFILER_METRICS__=n,window.__KMAP_CANVAS_PROFILER_INSTALLED__=!0,window.showCanvasReport=()=>{let e=window.__KMAP_CANVAS_PROFILER_METRICS__;if(e){console.group(`[kmap] Canvas profiler report`),console.log(`ctx methods`),console.table(en(e.ctxMethods)),console.log(`ctx props`),console.table(en(e.ctxProps)),console.log(`canvas props`),console.table(en(e.canvasProps));for(let t of[`fillText`,`measureText`]){let n=e.ctxMethodSources[t];n&&(console.log(`${t} sources`),console.table(en(n).slice(0,20)))}console.groupEnd()}},window.resetCanvasReport=()=>{window.__KMAP_CANVAS_PROFILER_METRICS__=Zt()},console.info(`[kmap] Canvas profiler enabled. Use window.showCanvasReport() and window.resetCanvasReport().`)}function cn(){if(typeof window>`u`||!window.__KMAP_CANVAS_PROFILER_INSTALLED__)return;let e=CanvasRenderingContext2D?.prototype,t=HTMLCanvasElement?.prototype;nn.forEach((n,r)=>{let i=r.match(/^(.+):(.+)$/);if(!i)return;let[,a,o]=i,s=null;a===`CanvasRenderingContext2D`?s=e:a===`HTMLCanvasElement`&&(s=t),s&&Reflect.set(s,o,n)}),nn.clear(),rn.forEach((n,r)=>{let i=r.match(/^(.+):(.+)$/);if(!i)return;let[,a,o]=i,s=null;a===`CanvasRenderingContext2D`?s=e:a===`HTMLCanvasElement`&&(s=t),s&&n.configurable&&Object.defineProperty(s,o,n)}),rn.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.`)}var ln={class:`left-toolbar`,"aria-label":`图表工具栏`},un={class:`left-toolbar__group`},dn=[`title`,`aria-label`,`onClick`],fn=[`onClick`],pn=[`title`,`aria-label`,`onClick`],mn={class:`left-toolbar__group`},hn={class:`left-toolbar__group`},gn=[`title`,`aria-label`],_n={class:`left-toolbar__group`},vn={class:`settings-body`},yn={class:`settings-label`},bn=[`onUpdate:modelValue`],xn=[`onUpdate:modelValue`],Sn=[`value`],Cn={class:`settings-label`},wn=[`onUpdate:modelValue`],Tn=[`onUpdate:modelValue`],En=[`value`],Dn=_((0,e.defineComponent)({__name:`LeftToolbar`,props:{isFullscreen:{type:Boolean}},emits:[`selectTool`,`toggleFullscreen`,`zoomIn`,`zoomOut`,`settingsChange`],setup(t,{expose:n,emit:r}){let i=[{id:`cursor`,title:`光标`,icon:nt},{id:`lines`,title:`线条`,icon:it,children:[{id:`trend-line`,title:`线段`,icon:it},{id:`ray`,title:`射线`,icon:st},{id:`h-line`,title:`水平线`,icon:pt},{id:`h-ray`,title:`水平射线`,icon:ut},{id:`v-line`,title:`垂直线`,icon:gt},{id:`crosshair-line`,title:`十字线`,icon:yt},{id:`info-line`,title:`信息线`,icon:St}]},{id:`channels`,title:`通道`,icon:Bt,children:[{id:`parallel-channel`,title:`平行通道`,icon:Bt},{id:`regression-channel`,title:`回归趋势`,icon:Ut},{id:`flat-line`,title:`平滑顶底`,icon:Kt},{id:`disjoint-channel`,title:`不相交通道`,icon:Yt}]}],a=r,o=(0,e.ref)(`cursor`),s=(0,e.ref)(null),c=(0,e.ref)(!1),u=j(),d=(0,e.computed)(()=>l.DEFAULT_SETTINGS.filter(e=>e.group===`main`)),f=(0,e.computed)(()=>l.DEFAULT_SETTINGS.filter(e=>e.group===`experimental`));function p(){try{let e=localStorage.getItem(l.SETTINGS_STORAGE_KEY);if(e){let t=JSON.parse(e),n={};return l.DEFAULT_SETTINGS.forEach(e=>{n[e.key]=t[e.key]??e.default}),n}}catch{}let e={};return l.DEFAULT_SETTINGS.forEach(t=>{e[t.key]=t.default}),e}function m(e){try{localStorage.setItem(l.SETTINGS_STORAGE_KEY,JSON.stringify(e))}catch{}}let h=(0,e.ref)(p()),g=(0,e.ref)({...h.value});function _(e){return o.value===e.id?!0:e.children?e.children.some(e=>e.id===o.value):!1}function v(e){if(e.children?.length){if(!e.children.some(e=>e.id===o.value)){let t=e.children[0];o.value=t.id,a(`selectTool`,t.id)}b(e.id);return}o.value=e.id,a(`selectTool`,e.id),s.value=null}function y(e){o.value=e.id,a(`selectTool`,e.id),s.value=null}function b(e){s.value=s.value===e?null:e}function x(){g.value={...h.value},c.value=!0}function S(){c.value=!1}function C(){let e={};l.DEFAULT_SETTINGS.forEach(t=>{e[t.key]=t.default}),g.value=e}function w(){h.value={...g.value},m(h.value),an(!!h.value.enableCanvasProfiler),a(`settingsChange`,{...h.value}),S()}function T(){return{...h.value}}n({getSettings:T});function E(e){e.target.closest(`.tool-item`)||(s.value=null)}return(0,e.onMounted)(()=>{document.addEventListener(`click`,E,!0),a(`settingsChange`,{...h.value}),an(!!h.value.enableCanvasProfiler)}),(0,e.onUnmounted)(()=>{document.removeEventListener(`click`,E,!0)}),(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,[(0,e.createElementVNode)(`nav`,ln,[(0,e.createElementVNode)(`div`,un,[((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(i,t=>(0,e.createElementVNode)(`div`,{key:t.id,class:`tool-item`},[(0,e.createElementVNode)(`button`,{type:`button`,class:(0,e.normalizeClass)([`left-toolbar__button`,{active:_(t)}]),title:t.title,"aria-label":t.title,onClick:e=>v(t),onPointerdown:r[0]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[1]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[2]||=(0,e.withModifiers)(()=>{},[`stop`])},[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.icon),{class:`tool-icon`,"aria-hidden":`true`})),t.children&&t.children.length?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:0,class:(0,e.normalizeClass)([`corner-indicator`,{open:s.value===t.id}]),onClick:(0,e.withModifiers)(e=>b(t.id),[`stop`]),"aria-label":`展开子菜单`},null,10,fn)):(0,e.createCommentVNode)(``,!0)],42,dn),(0,e.createVNode)(e.Transition,{name:`dropdown`},{default:(0,e.withCtx)(()=>[s.value===t.id&&t.children&&t.children.length?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`tool-dropdown`,onPointerdown:r[3]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[4]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[5]||=(0,e.withModifiers)(()=>{},[`stop`])},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.children,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`button`,{key:t.id,type:`button`,class:(0,e.normalizeClass)([`left-toolbar__button`,{active:o.value===t.id}]),title:t.title,"aria-label":t.title,onClick:e=>y(t)},[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.icon),{class:`tool-icon`,"aria-hidden":`true`}))],10,pn))),128))],32)):(0,e.createCommentVNode)(``,!0)]),_:2},1024)])),64))]),r[22]||=(0,e.createElementVNode)(`span`,{class:`left-toolbar__divider`},null,-1),(0,e.createElementVNode)(`div`,mn,[(0,e.createElementVNode)(`button`,{type:`button`,class:`left-toolbar__button`,title:`放大`,"aria-label":`放大`,onClick:r[6]||=e=>n.$emit(`zoomIn`),onPointerdown:r[7]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[8]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[9]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createVNode)((0,e.unref)(Tt),{class:`tool-icon`,"aria-hidden":`true`})],32),(0,e.createElementVNode)(`button`,{type:`button`,class:`left-toolbar__button`,title:`缩小`,"aria-label":`缩小`,onClick:r[10]||=e=>n.$emit(`zoomOut`),onPointerdown:r[11]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[12]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[13]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createVNode)((0,e.unref)(Ot),{class:`tool-icon`,"aria-hidden":`true`})],32)]),r[23]||=(0,e.createElementVNode)(`span`,{class:`left-toolbar__divider`},null,-1),(0,e.createElementVNode)(`div`,hn,[(0,e.createElementVNode)(`button`,{type:`button`,class:`left-toolbar__button`,title:t.isFullscreen?`退出全屏`:`全屏显示`,"aria-label":t.isFullscreen?`退出全屏`:`全屏显示`,onClick:r[14]||=e=>n.$emit(`toggleFullscreen`),onPointerdown:r[15]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[16]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[17]||=(0,e.withModifiers)(()=>{},[`stop`])},[t.isFullscreen?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(Pt),{key:0,class:`tool-icon`,"aria-hidden":`true`})):((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(jt),{key:1,class:`tool-icon`,"aria-hidden":`true`}))],40,gn)]),r[24]||=(0,e.createElementVNode)(`span`,{class:`left-toolbar__divider`},null,-1),(0,e.createElementVNode)(`div`,_n,[(0,e.createElementVNode)(`button`,{type:`button`,class:`left-toolbar__button`,title:`设置`,"aria-label":`设置`,onClick:x,onPointerdown:r[18]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointermove:r[19]||=(0,e.withModifiers)(()=>{},[`stop`]),onPointerup:r[20]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createVNode)((0,e.unref)(Lt),{class:`tool-icon`,"aria-hidden":`true`})],32)])]),((0,e.openBlock)(),(0,e.createBlock)(e.Teleport,{to:(0,e.unref)(u)},[(0,e.createVNode)(e.Transition,{name:`overlay`},{default:(0,e.withCtx)(()=>[c.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`settings-overlay`,onClick:S},[(0,e.createVNode)(e.Transition,{name:`modal`},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,{class:`settings-modal`,onClick:r[21]||=(0,e.withModifiers)(()=>{},[`stop`])},[(0,e.createElementVNode)(`div`,{class:`settings-header`},[r[26]||=(0,e.createElementVNode)(`div`,{class:`header-left`},[(0,e.createElementVNode)(`span`,{class:`settings-title`},`图表设置`),(0,e.createElementVNode)(`span`,{class:`settings-subtitle`},`个性化配置`)],-1),(0,e.createElementVNode)(`div`,{class:`header-right`},[(0,e.createElementVNode)(`button`,{class:`settings-close`,onClick:S},[...r[25]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M18 6L6 18M6 6l12 12`})],-1)]])])]),(0,e.createElementVNode)(`div`,vn,[d.value.length>0?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[r[27]||=(0,e.createElementVNode)(`div`,{class:`settings-section-divider`},[(0,e.createElementVNode)(`span`,{class:`settings-section-label`},`主图设置`)],-1),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(d.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.key,class:`settings-item`},[(0,e.createElementVNode)(`label`,yn,[(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.label),1),t.type===`boolean`?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`input`,{key:0,type:`checkbox`,class:`settings-checkbox`,"onUpdate:modelValue":e=>g.value[t.key]=e},null,8,bn)),[[e.vModelCheckbox,g.value[t.key]]]):t.type===`select`&&t.options?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`select`,{key:1,class:`settings-select`,"onUpdate:modelValue":e=>g.value[t.key]=e},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.options,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`option`,{key:t.value,value:t.value},(0,e.toDisplayString)(t.label),9,Sn))),128))],8,xn)),[[e.vModelSelect,g.value[t.key]]]):(0,e.createCommentVNode)(``,!0)])]))),128))],64)):(0,e.createCommentVNode)(``,!0),f.value.length>0?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[r[28]||=(0,e.createElementVNode)(`div`,{class:`settings-section-divider`},[(0,e.createElementVNode)(`span`,{class:`settings-section-label`},`实验性 / 调试设置`)],-1),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(f.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.key,class:`settings-item experimental`},[(0,e.createElementVNode)(`label`,Cn,[(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.label),1),t.type===`boolean`?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`input`,{key:0,type:`checkbox`,class:`settings-checkbox`,"onUpdate:modelValue":e=>g.value[t.key]=e},null,8,wn)),[[e.vModelCheckbox,g.value[t.key]]]):t.type===`select`&&t.options?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`select`,{key:1,class:`settings-select`,"onUpdate:modelValue":e=>g.value[t.key]=e},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.options,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`option`,{key:t.value,value:t.value},(0,e.toDisplayString)(t.label),9,En))),128))],8,Tn)),[[e.vModelSelect,g.value[t.key]]]):(0,e.createCommentVNode)(``,!0)])]))),128))],64)):(0,e.createCommentVNode)(``,!0)]),(0,e.createElementVNode)(`div`,{class:`settings-footer`},[(0,e.createElementVNode)(`button`,{class:`settings-btn reset`,onClick:C},[...r[29]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,e.createElementVNode)(`path`,{d:`M3 3v5h5`})],-1),(0,e.createTextVNode)(` 重置 `,-1)]]),(0,e.createElementVNode)(`div`,{class:`footer-right`},[(0,e.createElementVNode)(`button`,{class:`settings-btn cancel`,onClick:S},`取消`),(0,e.createElementVNode)(`button`,{class:`settings-btn confirm`,onClick:w},[...r[30]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`},[(0,e.createElementVNode)(`path`,{d:`M20 6L9 17l-5-5`})],-1),(0,e.createTextVNode)(` 确定 `,-1)]])])])])]),_:1})])):(0,e.createCommentVNode)(``,!0)]),_:1})],8,[`to`]))],64))}}),[[`__scopeId`,`data-v-35cfe78e`]]),On=[`data-theme`],kn={class:`pane-separator-layer`,"aria-hidden":`true`},An=4,jn=_((0,e.defineComponent)({__name:`KLineChart`,props:{semanticConfig:{},dataFetcher:{},yPaddingPx:{default:20},minKWidth:{default:1},maxKWidth:{default:50},rightAxisWidth:{default:0},bottomAxisHeight:{default:24},priceLabelWidth:{default:60},zoomLevels:{default:20},initialZoomLevel:{default:3},isFullscreen:{type:Boolean,default:!1}},emits:[`zoomLevelChange`,`toggleFullscreen`],setup(t,{expose:l,emit:d}){let f=t,p=(0,e.ref)(null),m=(0,e.ref)(null),h=(0,e.ref)(null),g=(0,e.ref)(null),_=(0,e.ref)(null),y=(0,e.ref)(null),b=(0,e.ref)(null),x=(0,e.shallowRef)(null),S=(0,e.shallowRef)(null),C=(0,i.createChartStore)({initialZoomLevel:f.initialZoomLevel??1,minKWidth:f.minKWidth,maxKWidth:f.maxKWidth,zoomLevels:f.zoomLevels,rightAxisWidth:f.rightAxisWidth,priceLabelWidth:f.priceLabelWidth}),w=(0,e.ref)(`light`);C.actions.setZoomState(C.state.zoomLevel,(0,a.zoomLevelToKWidth)(C.state.zoomLevel,{minKWidth:f.minKWidth,maxKWidth:f.maxKWidth,zoomLevelCount:f.zoomLevels,dpr:C.state.viewportDpr}),(0,a.kGapFromKWidth)((0,a.zoomLevelToKWidth)(C.state.zoomLevel,{minKWidth:f.minKWidth,maxKWidth:f.maxKWidth,zoomLevelCount:f.zoomLevels,dpr:C.state.viewportDpr}),C.state.viewportDpr)),(0,e.computed)(()=>C.state.dataLength),(0,e.computed)(()=>C.state.viewportDpr);let T=(0,e.computed)(()=>C.state.zoomLevel),E=(0,e.computed)(()=>C.state.kWidth),ee=(0,e.computed)(()=>C.state.kGap),te=(0,e.computed)(()=>C.state.paneRatios),ne=(0,e.computed)(()=>C.state.selectedDrawingId),D=(0,e.computed)(()=>C.state.dataVersion);function O(){x.value?.scheduleDraw()}function re(e){if(x.value?.updateSettings(e),e.performanceTest10kKlines){let e=k();console.time(`updateData-10k`),x.value?.updateData(e),console.timeEnd(`updateData-10k`),C.actions.setDataLength(e.length),C.actions.bumpDataVersion()}else S.value&&x.value?.getData()?.length===1e4&&S.value.applyConfig(f.semanticConfig)}function k(){let e=[],t=new Date(`2020-01-01`).getTime(),n=3e3;for(let r=0;r<1e4;r++){let i=t+r*864e5,a=(Math.random()-.5)*2*.02+1e-4,o=n,s=o*(1+a),c=Math.max(o,s)*(1+Math.random()*.01),l=Math.min(o,s)*(1-Math.random()*.01),u=Math.floor(1e6+Math.random()*5e6);e.push({timestamp:i,open:parseFloat(o.toFixed(2)),high:parseFloat(c.toFixed(2)),low:parseFloat(l.toFixed(2)),close:parseFloat(s.toFixed(2)),volume:u}),n=s}return e}function ie(e,t,n){let r=e.getBoundingClientRect();return{width:Math.max(t,Math.round(r.width)),height:Math.max(n,Math.round(r.height))}}function ae(t){t&&(0,e.nextTick)(()=>{if(!t.isConnected)return;let e=ie(t,180,80);x.value?.interaction.setTooltipSize(e)})}function oe(t){t&&(0,e.nextTick)(()=>{t.isConnected&&(ue.value=ie(t,120,60))})}let A=(0,e.ref)({x:0,y:0}),j=(0,e.ref)(!1),M=null;function se(){M=null}function ce(e){return M||=e.getBoundingClientRect(),M}let N=(0,e.shallowRef)({crosshairPos:null,crosshairIndex:null,crosshairPrice:null,hoveredIndex:null,activePaneId:null,tooltipPos:{x:0,y:0},tooltipAnchorPlacement:`right-bottom`,hoveredMarkerData:null,hoveredCustomMarker:null,isDragging:!1,isResizingPaneBoundary:!1,isHoveringPaneBoundary:!1,hoveredPaneBoundaryId:null,isHoveringRightAxis:!1}),P=(0,e.shallowRef)(null),F=(0,e.computed)(()=>{let e=ne.value;return e?C.state.drawings.find(t=>t.id===e)??null:null}),le=(0,e.ref)([]),ue=(0,e.ref)({width:220,height:120}),I=(0,e.computed)(()=>{let e=g.value,t=_.value;return!e||!t?{x:0,y:0}:{x:e.offsetLeft,y:e.offsetTop}}),de=(0,e.computed)(()=>N.value.hoveredMarkerData),L=(0,e.computed)(()=>N.value.hoveredCustomMarker),fe=(0,e.computed)(()=>N.value.isDragging),pe=(0,e.computed)(()=>N.value.isResizingPaneBoundary),me=(0,e.computed)(()=>N.value.isHoveringPaneBoundary),he=(0,e.computed)(()=>N.value.hoveredPaneBoundaryId),ge=(0,e.computed)(()=>N.value.isHoveringRightAxis),_e=(0,e.computed)(()=>N.value.hoveredIndex),ve=(0,e.computed)(()=>N.value.crosshairIndex),ye=(0,e.computed)(()=>fe.value?`grabbing`:pe.value||me.value?`ns-resize`:_e.value===null?`crosshair`:`pointer`),R=(0,e.computed)(()=>{let e=N.value.hoveredIndex;if(typeof e!=`number`)return null;D.value;let t=x.value?.getData();return t&&e>=0&&e<t.length?t[e]:null}),be=(0,e.computed)(()=>N.value.hoveredIndex),xe=(0,e.computed)(()=>N.value.tooltipPos),z=(0,e.computed)(()=>({x:xe.value.x+I.value.x,y:xe.value.y+I.value.y})),Se=(0,e.computed)(()=>({left:`${z.value.x}px`,top:`${z.value.y}px`})),B=(0,e.computed)(()=>({x:A.value.x+I.value.x,y:A.value.y+I.value.y})),Ce=(0,e.computed)(()=>({left:`${B.value.x}px`,top:`${B.value.y}px`})),we=(0,e.computed)(()=>N.value.tooltipAnchorPlacement),Te=(0,e.computed)(()=>{let e=x.value?.getViewport(),t=g.value,n=e?.plotWidth??(t?t.clientWidth:0);return A.value.x+12+ue.value.width+12>n?`left-bottom`:`right-bottom`}),Ee=(0,e.computed)(()=>(D.value,x.value?.getData()??[]));function De(e){P.value?.setTool(e)}function Oe(e){let t=F.value;!t||!P.value||(P.value.updateDrawingStyle(t.id,e),C.actions.bumpDrawingVersion())}function ke(){let e=F.value;!e||!P.value||(P.value.removeDrawing(e.id),C.actions.setSelectedDrawingId(null),C.actions.bumpDrawingVersion(),C.actions.setDrawings(P.value.getDrawings()))}function Ae(e){x.value?.handlePointerEvent(e,{onPointerDown:(e,t)=>P.value?.onPointerDown(e,t)?(C.actions.setDrawings(P.value.getDrawings()),C.actions.bumpDrawingVersion(),!0):!1})}function je(e){let t=g.value;if(t){let n=ce(t);A.value={x:e.clientX-n.left,y:e.clientY-n.top}}x.value?.handlePointerEvent(e,{onPointerMove:(e,t)=>P.value?.onPointerMove(e,t)?(C.actions.setDrawings(P.value.getDrawings()),!0):!1})}function Me(e){x.value?.handlePointerEvent(e,{onPointerUp:(e,t)=>P.value?.onPointerUp(e,t)?(C.actions.setDrawings(P.value.getDrawings()),!0):!1})}function Ne(e){x.value?.handlePointerEvent(e)}function Pe(e){x.value?.handlePointerEvent(e)}function Fe(e){x.value?.handlePointerEvent(e)}function Ie(e){x.value?.handlePointerEvent(e)}function Le(e){x.value?.handlePointerEvent(e)}function Re(){x.value?.handleScrollEvent()}let V=(0,e.ref)([]),ze=(0,e.computed)(()=>{let e=[],t=new Set;for(let n of U.value)t.has(n.indicatorId)||(t.add(n.indicatorId),e.push(n.indicatorId));return e}),Be=(0,e.computed)(()=>[...V.value,...ze.value]),H=(0,e.ref)({}),U=(0,e.ref)([]);function He(){let e=te.value.main??3;return U.value.length===0?[{id:`main`,ratio:e,visible:!0,role:`price`}]:[{id:`main`,ratio:e,visible:!0,role:`price`},...U.value.map(e=>({id:e.id,ratio:te.value[e.id]??1,visible:!0,role:`indicator`}))]}function Ue(e){return{...s.SUB_PANE_INDICATOR_CONFIGS[e].defaultParams}}let W=new Map,G=new Map;function K(e,t){let n=(0,c.createPaneTitleRendererPlugin)({paneId:e,title:t,getTitleInfo:()=>Y(e)});x.value?.useRenderer(n),G.set(e,n.name)}function q(e){let t=G.get(e);t&&(x.value?.removeRenderer(t),G.delete(e))}function We(e=`VOLUME`,t){if(U.value.length>=An)return!1;let n=t??Ue(e),r=x.value?.addIndicator(e,`sub`,n);return r?(K(r,e),U.value.push({id:r,indicatorId:e,params:n}),O(),!0):!1}function Ge(e){let t=U.value.findIndex(t=>t.id===e);t!==-1&&U.value[t]&&(q(e),x.value?.removeIndicator(e),U.value.splice(t,1))}function Ke(){for(let e of U.value)x.value?.removeIndicator(e.id),q(e.id);U.value=[],W.clear(),G.clear()}function qe(){let e=f.semanticConfig,t=x.value;if(!t)return;let n=e.indicators?.main;if(n)for(let e of n)e.enabled&&(V.value.includes(e.type)||V.value.push(e.type),e.params&&(H.value[e.type]=e.params),t.enableMainIndicator(e.type,e.params))}(0,e.watch)([Be,H],([e])=>{let t=x.value;t&&(t.updateRendererConfig(`mainIndicatorLegend`,{indicators:{MA:{enabled:e.includes(`MA`),params:H.value.MA||{}},BOLL:{enabled:e.includes(`BOLL`),params:H.value.BOLL||{}},EXPMA:{enabled:e.includes(`EXPMA`),params:H.value.EXPMA||{}},ENE:{enabled:e.includes(`ENE`),params:H.value.ENE||{}}}}),O())},{deep:!0});function Je(){let e=x.value?.getSubPaneEntries()??[];U.value=[],G.clear();for(let t of e){let{paneId:e,indicatorId:n,params:r}=t,i=e.match(/^(.+)_(\d+)$/);if(i){let[,e,t]=i,n=parseInt(t,10);n>=(W.get(e)??0)&&W.set(e,n+1)}K(e,n),U.value.push({id:e,indicatorId:n,params:{...r}})}O()}function Ye(e,t){if(!U.value.find(t=>t.id===e))return;let n=Ue(t);q(e),x.value?.replaceSubPaneIndicator(e,t,n),K(e,t);let r=U.value.findIndex(t=>t.id===e);r!==-1&&(U.value[r]={id:e,indicatorId:t,params:n})}let J=new Map;function Y(e){let t=U.value.find(t=>t.id===e);if(!t)return null;let n=x.value?.getData();if(!n||n.length===0)return null;let r=ve.value,i=n.length,a=J.get(e);if(a&&a.idx===r&&a.dataLen===i)return a.result;let o=s.SUB_PANE_INDICATOR_CONFIGS[t.indicatorId],c=t.params,l=x.value?.plugin,u=l?o.getTitleInfo(n,r,c,l,e):null;return J.set(e,{idx:r,dataLen:i,result:u}),u}function X(e,t){let n=x.value;if(n){if([`MA`,`BOLL`,`EXPMA`,`ENE`,`WMA`,`DEMA`,`TEMA`,`HMA`,`KAMA`,`SAR`,`SUPERTREND`,`KELTNER`,`DONCHIAN`,`ICHIMOKU`,`PIVOT`,`FIB`,`STRUCTURE`,`ZONES`].includes(e)){let r=V.value.find(t=>t===e);if(t&&!r)n.addIndicator(e,`main`,H.value[e]),V.value.push(e);else if(!t&&r){let t=e.toUpperCase();n.removeIndicator(t),V.value=V.value.filter(t=>t!==e)}return}if(s.SUB_PANE_INDICATORS.includes(e)){if(t){if(U.value.find(t=>t.indicatorId===e)||U.value.length>=An)return;let t=n.addIndicator(e,`sub`,H.value[e]);if(t)K(t,e),U.value.push({id:t,indicatorId:e,params:{...H.value[e]}});else if(U.value.length>0){let t=U.value[U.value.length-1];Ye(t.id,e)}}else U.value.filter(t=>t.indicatorId===e).forEach(e=>{n.removeIndicator(e.id),q(e.id)}),U.value=U.value.filter(t=>t.indicatorId!==e);O()}}}function Ze(e,t){if(H.value[e]=t,e===`MA`||e===`BOLL`||e===`EXPMA`||e===`ENE`){x.value?.updateMainIndicatorParams(e,t),O();return}if(s.SUB_PANE_INDICATORS.includes(e)){U.value.filter(t=>t.indicatorId===e).forEach(e=>{x.value?.updateSubPaneParams(e.id,t),e.params={...t}}),O();return}O()}function Qe(e){if(!e.length||U.value.length<=1)return;let t=e.filter(e=>s.SUB_PANE_INDICATORS.includes(e));if(!t.length)return;let n=new Map(U.value.map(e=>[e.indicatorId,e])),r=[];for(let e of t){let t=n.get(e);t&&(r.push(t),n.delete(e))}if(r.length===0)return;for(let e of U.value)n.has(e.indicatorId)&&(r.push(e),n.delete(e.indicatorId));let i=U.value.map(e=>e.id),a=r.map(e=>e.id);if(i.join(`|`)===a.join(`|`))return;U.value=r;let o=x.value;o&&o.updatePaneLayout(He())}let et=(0,e.computed)(()=>f.rightAxisWidth+f.priceLabelWidth),tt=C.computed.totalWidth;function nt(){let e=g.value,t=x.value;if(!e||!t)return;let n=t.getData()?.length??0;if(n===0)return;let r=t.getCurrentDpr(),{unitPx:i,startXPx:a}=(0,o.getPhysicalKLineConfig)(E.value,ee.value,r),s=(a+n*i)/r,c=Math.max(0,e.scrollWidth-e.clientWidth),l=Math.min(c,Math.max(0,s-e.clientWidth));e.scrollLeft=Math.round(l*r)/r,O()}function Z(e,t){let n=x.value;n&&n.zoomToLevel(e,t)}l({scheduleRender:O,scrollToRight:nt,addSubPane:We,removeSubPane:Ge,switchSubIndicator:Ye,clearAllSubPanes:Ke,get plugin(){return x.value?.plugin},zoomToLevel:Z,zoomIn:e=>Z(T.value+1,e),zoomOut:e=>Z(T.value-1,e),getZoomLevel:()=>T.value,getZoomLevelCount:()=>x.value?.getZoomLevelCount()??10});function rt(e){let t=e=>{e.preventDefault();let t=x.value;t&&t.handleWheelEvent(e)};return e.addEventListener(`wheel`,t,{passive:!1}),t}function it(e,t,n,i){return new r.Chart({container:e,canvasLayer:t,rightAxisLayer:n,xAxisCanvas:i},{yPaddingPx:f.yPaddingPx,rightAxisWidth:f.rightAxisWidth,bottomAxisHeight:f.bottomAxisHeight,priceLabelWidth:f.priceLabelWidth,minKWidth:f.minKWidth,maxKWidth:f.maxKWidth,panes:[{id:`main`,ratio:1}],paneGap:0,zoomLevels:f.zoomLevels,initialZoomLevel:f.initialZoomLevel})}function at(t){t.setOnPaneLayoutChange(()=>{se();let e=t.getPaneRenderers(),n=g.value&&parseInt(getComputedStyle(g.value).borderTopWidth)||0;le.value=e.slice(0,-1).map(e=>{let t=e.getPane();return{id:t.id,top:t.top+t.height+n}})});let n=t.paneRatios.subscribe(()=>{let e=t.paneRatios.peek();C.actions.setPaneRatios({...e})}),r=t.viewport.subscribe(()=>{let n=t.viewport.peek();C.state.viewportDpr!==n.dpr&&C.actions.setViewportDpr(n.dpr),C.state.viewWidth!==n.plotWidth&&C.actions.setViewWidth(n.plotWidth),(C.state.zoomLevel!==n.zoomLevel||C.state.kWidth!==n.kWidth||C.state.kGap!==n.kGap)&&C.actions.setZoomState(n.zoomLevel,n.kWidth,n.kGap);let r=n.desiredScrollLeft;r!==void 0&&r!==g.value?.scrollLeft&&(se(),(0,e.nextTick)(()=>{let e=g.value;if(!e)return;let n=Math.max(0,e.scrollWidth-e.clientWidth),i=Math.min(Math.max(0,r),n),a=t.getCurrentDpr();e.scrollLeft=Math.round(i*a)/a}))}),i=t.data.subscribe(()=>{let e=t.data.peek();C.actions.setDataLength(e.length),C.actions.bumpDataVersion()}),a=t.theme.subscribe(()=>{w.value=t.theme.peek()});(0,e.onUnmounted)(()=>{r(),i(),n(),a()})}function ot(e){let t=b.value?.getSettings()??{showVolumePriceMarkers:!0};if(e.updateSettings(t),t.performanceTest10kKlines){let t=k();console.time(`updateData-10k`),e.updateData(t),console.timeEnd(`updateData-10k`)}}function st(e){P.value=new u.DrawingInteractionController(e),P.value.setCallbacks({onDrawingCreated:e=>{C.actions.setDrawings([...C.state.drawings,e]),C.actions.setSelectedDrawingId(e.id)},onToolChange:()=>{},onDrawingSelected:e=>{C.actions.setSelectedDrawingId(e?.id??null)}})}function ct(e){e.interaction.setTooltipAnchorPositioning(j.value),e.interaction.setOnInteractionChange(e=>{N.value=e}),e.interaction.setOnPinchZoom((t,n)=>{if(!e)return;let r=g.value;if(!r)return;let i=n-r.getBoundingClientRect().left;e.handlePinchZoom(t,i)}),N.value=e.interaction.getInteractionSnapshot(),C.actions.setViewportDpr(e.getCurrentDpr()),e.resize()}function lt(t){(0,n.__setDataFetcher)(f.dataFetcher),S.value=new n.SemanticChartController(t),S.value.on(`config:error`,e=>{console.error(`Semantic config error:`,e)}),S.value.on(`config:ready`,()=>{qe(),Je(),(0,e.nextTick)(()=>nt())}),S.value.applyConfig(f.semanticConfig).then(e=>{e&&!e.success&&console.error(`Semantic config apply failed:`,e.errors)})}return(0,e.onMounted)(()=>{j.value=!1;let e=g.value,t=m.value,n=h.value,r=p.value;if(!e||!t||!n||!r)return;let i=rt(e),a=it(e,t,n,r);x.value=a,at(a),a.applyRenderState(C.state.kWidth,C.state.kGap,C.state.zoomLevel),ot(a),st(a),ct(a),lt(a),a.__onWheel=i}),(0,e.onUnmounted)(()=>{let e=x.value;if(e){let t=e.__onWheel,n=g.value;t&&n&&n.removeEventListener(`wheel`,t),e.destroy()}x.value=null,P.value=null}),(0,e.watch)(()=>f.yPaddingPx,e=>{x.value?.updateOptions({yPaddingPx:e})}),(0,e.watch)(()=>f.semanticConfig,async(e,t)=>{if(e&&e!==t){let t=await S.value?.applyConfig(e);t&&!t.success&&console.error(`Semantic config apply failed:`,t.errors)}},{deep:!0}),(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`chart-wrapper`,"data-theme":w.value},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`chart-stage`,{"is-dragging":fe.value,"is-resizing-pane":pe.value,"is-hovering-pane-separator":me.value,"is-hovering-right-axis":ge.value,"is-hovering-kline":_e.value!==null}])},[(0,e.createVNode)(Dn,{ref_key:`toolbarRef`,ref:b,"is-fullscreen":t.isFullscreen,onSelectTool:De,onToggleFullscreen:r[0]||=e=>n.$emit(`toggleFullscreen`),onZoomIn:r[1]||=e=>Z(T.value+1),onZoomOut:r[2]||=e=>Z(T.value-1),onSettingsChange:re},null,8,[`is-fullscreen`]),(0,e.createElementVNode)(`div`,{class:`chart-main`,ref_key:`chartMainRef`,ref:_},[(0,e.createElementVNode)(`div`,kn,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(le.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.id,class:(0,e.normalizeClass)([`pane-separator-line`,{"is-active":he.value===t.id}]),style:(0,e.normalizeStyle)({top:`${t.top}px`})},null,6))),128))]),(0,e.createElementVNode)(`div`,{ref_key:`tooltipLayerRef`,ref:y,class:`tooltip-layer`},null,512),(0,e.createElementVNode)(`div`,{class:`chart-container`,style:(0,e.normalizeStyle)({cursor:ye.value}),ref_key:`containerRef`,ref:g,onScrollPassive:Re,onPointerdown:Ae,onPointermove:je,onPointerup:Me,onPointerleave:Ne},[(0,e.createElementVNode)(`div`,{class:`scroll-content`,style:(0,e.normalizeStyle)({width:(0,e.unref)(tt)+`px`})},[(0,e.createElementVNode)(`div`,{class:`canvas-layer`,ref_key:`canvasLayerRef`,ref:m},[(0,e.createElementVNode)(`canvas`,{class:`x-axis-canvas`,ref_key:`xAxisCanvasRef`,ref:p},null,512),F.value?((0,e.openBlock)(),(0,e.createBlock)(v,{key:0,drawing:F.value,onUpdateStyle:Oe,onDelete:ke},null,8,[`drawing`])):(0,e.createCommentVNode)(``,!0)],512)],4)],36),y.value?((0,e.openBlock)(),(0,e.createBlock)(e.Teleport,{key:0,to:y.value},[R.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:(0,e.normalizeClass)([`tooltip-anchor kline-tooltip-anchor`,{"use-anchor":j.value}]),style:(0,e.normalizeStyle)(Se.value)},null,6)):(0,e.createCommentVNode)(``,!0),de.value||L.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:1,class:(0,e.normalizeClass)([`tooltip-anchor marker-tooltip-anchor`,{"use-anchor":j.value}]),style:(0,e.normalizeStyle)(Ce.value)},null,6)):(0,e.createCommentVNode)(``,!0),R.value?((0,e.openBlock)(),(0,e.createBlock)(Xe,{key:2,k:R.value,index:be.value,data:Ee.value,pos:z.value,"set-el":ae,"use-anchor":j.value,"anchor-placement":we.value},null,8,[`k`,`index`,`data`,`pos`,`use-anchor`,`anchor-placement`])):(0,e.createCommentVNode)(``,!0),de.value||L.value?((0,e.openBlock)(),(0,e.createBlock)($e,{key:3,marker:de.value||L.value,pos:B.value,"use-anchor":j.value,"anchor-placement":Te.value,"set-el":oe},null,8,[`marker`,`pos`,`use-anchor`,`anchor-placement`])):(0,e.createCommentVNode)(``,!0)],8,[`to`])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,{class:`right-axis-host`,ref_key:`rightAxisLayerRef`,ref:h,style:(0,e.normalizeStyle)({width:et.value+`px`}),onPointerdown:Pe,onPointermove:Fe,onPointerup:Ie,onPointerleave:Le},null,36)],512)],2),(0,e.createVNode)(Ve,{"active-indicators":Be.value,"indicator-params":H.value,onToggle:X,onUpdateParams:Ze,onReorderSubIndicators:Qe},null,8,[`active-indicators`,`indicator-params`])],8,On))}}),[[`__scopeId`,`data-v-c50302da`]]),Mn={name:`@363045841yyt/klinechart`,version:`0.7.3-alpha.4`,description:`Vue 3 bindings for @363045841yyt/klinechart-core. Idiomatic composables, SFC components.`,license:`MIT`,type:`module`,engines:{node:`^20.19.0 || >=22.12.0`},sideEffects:!1,main:`./dist/index.js`,module:`./dist/index.js`,types:`./dist/index.d.ts`,exports:{".":{import:{types:`./dist/index.d.ts`,default:`./dist/index.js`},require:{types:`./dist/index.d.cts`,default:`./dist/index.cjs`}},"./style.css":`./dist/klinechart.css`},files:[`dist`,`src`],publishConfig:{access:`public`},scripts:{dev:`vite --config preview/vite.config.ts`,build:`vite build && node -e "require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')"`,postbuild:`node -e "require('fs').copyFileSync('dist/index.d.ts','dist/index.d.cts')"`,test:`vitest run`,"test:watch":`vitest`,size:`size-limit`,"lint:publish":`publint --strict .`,prepublishOnly:`npm run build`,"lint:types":`attw --pack .`},"size-limit":[{name:`vue (entry, pre-build src measurement)`,path:`src/index.ts`,limit:`8 KB`,gzip:!0,ignore:[`vue`,`@363045841yyt/klinechart-core`]}],peerDependencies:{"@363045841yyt/klinechart-core":`workspace:^`,vue:`^3.4.0`},devDependencies:{"@arethetypeswrong/cli":`^0.18.3`,"@size-limit/preset-small-lib":`^12.1.0`,"@vitejs/plugin-vue":`^6.0.0`,"@vue/test-utils":`^2.4.10`,jsdom:`^29.1.1`,publint:`^0.3.0`,"size-limit":`^12.1.0`,typescript:`~6.0.3`,"unplugin-icons":`^23.0.1`,vite:`^8.0.14`,"vite-plugin-babel":`^1.3.2`,"vite-plugin-dts":`^5.0.1`,vitest:`^4.1.5`,vue:`^3.5.0`}}.version,Nn=null;function Pn(e){Nn=e}function Fn(e){if(e.container==null)throw Error("[@363045841yyt/klinechart] createChart: `container` is required and must be a non-null HTMLElement");if(Nn===null)throw Error(`[@363045841yyt/klinechart] createChart: no ChartController factory registered. Call __setControllerFactory(...) before mounting (the core package wires this in production).`);return Nn(e)}function In(t){let n=(0,e.shallowRef)(t.peek());return(0,e.onScopeDispose)(t.subscribe(()=>{n.value=t.peek()})),n}function Ln(t,n){let r=(0,e.shallowRef)(null),i=e=>{e==null||r.value!=null||(r.value=Fn({...n,container:e}))};i(t.value);let a=(0,e.watch)(t,e=>{i(e)},{immediate:!0,flush:`post`}),o=()=>{a();let e=r.value;e!=null&&(e.dispose(),r.value=null)};return(0,e.onScopeDispose)(o),(0,e.onBeforeUnmount)(o),{chart:r}}function Rn(t){let n=(0,e.shallowRef)(t.indicators.peek());return(0,e.onScopeDispose)(t.indicators.subscribe(()=>{n.value=t.indicators.peek()})),{indicators:n,add:t.addIndicator.bind(t),remove:t.removeIndicator.bind(t),updateParams:t.updateIndicatorParams.bind(t)}}function zn(t){let n=(0,e.shallowRef)(t.interactionState.peek());return(0,e.onScopeDispose)(t.interactionState.subscribe(()=>{n.value=t.interactionState.peek()})),n}function Bn(t){let n=(0,e.shallowRef)(t.paneRatios.peek());return(0,e.onScopeDispose)(t.paneRatios.subscribe(()=>{n.value=t.paneRatios.peek()})),n}function Vn(t){let n=(0,e.shallowRef)(t.viewport.peek());return(0,e.onScopeDispose)(t.viewport.subscribe(()=>{n.value=t.viewport.peek()})),n}var Hn=(0,e.defineComponent)({name:`KLineChart`,props:{data:{type:Array,required:!0},initialZoomLevel:{type:Number,default:3},zoomLevels:{type:Number,default:20},theme:{type:String,default:`light`},containerClass:{type:String,default:``}},emits:{ready:e=>!0,zoomLevelChange:(e,t)=>!0},setup(t,{emit:n,expose:r}){let i=(0,e.shallowRef)(null),a=(0,e.effectScope)(),o=(0,e.shallowRef)(null);(0,e.onMounted)(()=>{let r=i.value;r!=null&&(a.run(()=>{if(o.value=Fn({container:r,data:t.data,initialZoomLevel:t.initialZoomLevel,zoomLevels:t.zoomLevels,theme:t.theme}),o.value!=null){n(`ready`,o.value);let t=o.value,r=()=>{let e=t.viewport.peek();n(`zoomLevelChange`,e.zoomLevel,e.kWidth)};r(),(0,e.onScopeDispose)(t.viewport.subscribe(r))}}),(0,e.watch)(()=>t.data,e=>{o.value?.setData(e)}),(0,e.watch)(()=>t.theme,e=>{o.value?.setTheme(e)}))}),(0,e.onUnmounted)(()=>{o.value?.dispose(),o.value=null,a.stop()}),r({getController:()=>o.value,handlePointerEvent:(e,t)=>o.value?.handlePointerEvent(e,t)??!1,handleWheelEvent:e=>o.value?.handleWheelEvent(e),handleScrollEvent:()=>o.value?.handleScrollEvent(),zoomToLevel:(e,t)=>o.value?.zoomToLevel(e,t),zoomIn:e=>o.value?.zoomIn(e),zoomOut:e=>o.value?.zoomOut(e),addIndicator:(e,t,n)=>o.value?.addIndicator(e,t,n)??null,removeIndicator:e=>o.value?.removeIndicator(e)??!1,setTheme:e=>o.value?.setTheme(e),setData:e=>o.value?.setData(e)});let s=e=>{i.value=e??null};return()=>(0,e.h)(`div`,{ref:s,class:[`klinechart-quant-root`,t.containerClass].filter(Boolean).join(` `),style:{width:`100%`,height:`100%`}})}}),Un={install(e){e.component(`KLineChart`,Hn)}};Pn(d.createChartController),Object.defineProperty(exports,"CORE_VERSION",{enumerable:!0,get:function(){return d.VERSION}}),exports.DrawingStyleToolbar=v,exports.IndicatorParams=oe,exports.IndicatorSelector=Ve,exports.KLineChart=Hn,exports.KLineChartVue=jn,exports.KLineTooltip=Xe,exports.KMapPlugin=Un,exports.LeftToolbar=Dn,exports.MarkerTooltip=$e,exports.VERSION=Mn,exports.__setControllerFactory=Pn,exports.coreSignalToVueRef=In,exports.createChart=Fn,exports.useChart=Ln,exports.useIndicators=Rn,exports.useInteractionState=zn,exports.usePaneRatios=Bn,exports.useViewport=Vn;
|