kline-orderbook-chart 0.1.0
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/LICENSE +86 -0
- package/README.md +73 -0
- package/dist/chart_engine.js +1 -0
- package/dist/chart_engine_bg.wasm +0 -0
- package/dist/index.d.ts +49 -0
- package/dist/mrd-chart-engine.mjs +1 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
MRD CHART ENGINE — COMMERCIAL SOFTWARE LICENSE AGREEMENT
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MRD Technologies. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are proprietary
|
|
6
|
+
and confidential. The Software is licensed, not sold.
|
|
7
|
+
|
|
8
|
+
1. GRANT OF LICENSE
|
|
9
|
+
|
|
10
|
+
Subject to the terms of this agreement and payment of applicable fees,
|
|
11
|
+
MRD Technologies grants you a non-exclusive, non-transferable, limited
|
|
12
|
+
license to use the Software in accordance with your purchased license tier
|
|
13
|
+
(Standard, Professional, or Enterprise).
|
|
14
|
+
|
|
15
|
+
2. PERMITTED USE
|
|
16
|
+
|
|
17
|
+
a. You may integrate the Software into your own applications and products.
|
|
18
|
+
b. You may use the Software on the number of domains/projects specified
|
|
19
|
+
by your license tier.
|
|
20
|
+
c. You may make backup copies of the Software for archival purposes.
|
|
21
|
+
|
|
22
|
+
3. RESTRICTIONS
|
|
23
|
+
|
|
24
|
+
You may NOT:
|
|
25
|
+
a. Redistribute, sublicense, sell, rent, lease, or share the Software
|
|
26
|
+
or any portion thereof to third parties.
|
|
27
|
+
b. Reverse engineer, decompile, disassemble, or otherwise attempt to
|
|
28
|
+
derive the source code of the Software.
|
|
29
|
+
c. Remove, alter, or obscure any proprietary notices, labels, or marks
|
|
30
|
+
on the Software.
|
|
31
|
+
d. Use the Software in any way that violates applicable laws.
|
|
32
|
+
e. Share your license key with unauthorized parties.
|
|
33
|
+
f. Use the Software after your license has expired without renewal.
|
|
34
|
+
|
|
35
|
+
4. LICENSE TIERS
|
|
36
|
+
|
|
37
|
+
- Standard: Up to 1 production domain, core features only.
|
|
38
|
+
- Professional: Up to 3 production domains, full feature set.
|
|
39
|
+
- Enterprise: Unlimited domains, white-label rights, priority support.
|
|
40
|
+
|
|
41
|
+
5. EVALUATION LICENSE
|
|
42
|
+
|
|
43
|
+
A free evaluation license may be provided for testing purposes.
|
|
44
|
+
Evaluation licenses include a visible watermark and may not be used
|
|
45
|
+
in production environments.
|
|
46
|
+
|
|
47
|
+
6. INTELLECTUAL PROPERTY
|
|
48
|
+
|
|
49
|
+
The Software is the intellectual property of MRD Technologies. This
|
|
50
|
+
license does not grant you ownership of the Software. All rights not
|
|
51
|
+
expressly granted are reserved.
|
|
52
|
+
|
|
53
|
+
7. WARRANTY DISCLAIMER
|
|
54
|
+
|
|
55
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
56
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
57
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
58
|
+
|
|
59
|
+
8. LIMITATION OF LIABILITY
|
|
60
|
+
|
|
61
|
+
IN NO EVENT SHALL MRD TECHNOLOGIES BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
|
|
62
|
+
SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES ARISING OUT OF OR RELATED TO
|
|
63
|
+
YOUR USE OF THE SOFTWARE.
|
|
64
|
+
|
|
65
|
+
9. TERMINATION
|
|
66
|
+
|
|
67
|
+
This license is effective until terminated. It will terminate automatically
|
|
68
|
+
if you fail to comply with any term of this agreement or if your license
|
|
69
|
+
key expires without renewal. Upon termination, you must destroy all copies
|
|
70
|
+
of the Software.
|
|
71
|
+
|
|
72
|
+
10. GOVERNING LAW
|
|
73
|
+
|
|
74
|
+
This agreement shall be governed by and construed in accordance with the
|
|
75
|
+
laws of the jurisdiction of MRD Technologies' principal place of business.
|
|
76
|
+
|
|
77
|
+
11. CONTACT
|
|
78
|
+
|
|
79
|
+
For licensing inquiries: support@mrd-indicators.com
|
|
80
|
+
For technical support: support@mrd-indicators.com
|
|
81
|
+
Website: https://app.mrd-indicators.com
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
By using this Software, you acknowledge that you have read this agreement,
|
|
86
|
+
understand it, and agree to be bound by its terms and conditions.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# kline-orderbook-chart
|
|
2
|
+
|
|
3
|
+
The only chart library with built-in **orderbook heatmap**, **footprint chart**, and **liquidation heatmap** — all in one `<canvas>`, powered by a native high-performance engine.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install kline-orderbook-chart
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import { createChartBridge, prefetchEngine } from 'kline-orderbook-chart'
|
|
15
|
+
|
|
16
|
+
// Pre-load engine (optional, speeds up first render)
|
|
17
|
+
prefetchEngine()
|
|
18
|
+
|
|
19
|
+
// Create chart
|
|
20
|
+
const canvas = document.getElementById('chart')
|
|
21
|
+
const chart = await createChartBridge(canvas, {
|
|
22
|
+
licenseKey: 'YOUR_LICENSE_KEY', // omit for 14-day free trial
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
// Load candlestick data
|
|
26
|
+
chart.setKlines([
|
|
27
|
+
{ t: 1710000000, o: 65200, h: 65800, l: 65100, c: 65600, v: 1234.5 },
|
|
28
|
+
// ...
|
|
29
|
+
])
|
|
30
|
+
chart.setCandleInterval(3600)
|
|
31
|
+
chart.setPrecision(1)
|
|
32
|
+
|
|
33
|
+
// Enable indicators
|
|
34
|
+
chart.enableVolume(true)
|
|
35
|
+
chart.enableRsi(true, 14)
|
|
36
|
+
chart.enableFootprint(true)
|
|
37
|
+
|
|
38
|
+
// Start rendering
|
|
39
|
+
chart.start()
|
|
40
|
+
|
|
41
|
+
// Real-time update
|
|
42
|
+
chart.updateLastKline(t, o, h, l, c, v)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Enable Orderbook Heatmap
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
chart.setHeatmap(depthMatrix, rows, cols, priceMin, priceMax, timeStart, timeEnd)
|
|
49
|
+
chart.enableHeatmap(true)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Features
|
|
53
|
+
|
|
54
|
+
- **Orderbook Heatmap** — real-time depth matrix behind candles
|
|
55
|
+
- **Footprint Chart** — bid/ask volume, delta, imbalance, POC
|
|
56
|
+
- **Liquidation Heatmap** — leveraged position cluster overlay
|
|
57
|
+
- **12+ Indicators** — RSI, OI, CVD, EMA, VRVP, TPO, Funding Rate...
|
|
58
|
+
- **10+ Drawing Tools** — Trendline, Fibonacci, Channel, Pitchfork...
|
|
59
|
+
- **60 fps** at 100K+ candles
|
|
60
|
+
- **380 KB gzip** total bundle
|
|
61
|
+
- **Zero dependencies**
|
|
62
|
+
- **Framework agnostic** — React, Vue, Svelte, Angular, vanilla JS
|
|
63
|
+
|
|
64
|
+
## Links
|
|
65
|
+
|
|
66
|
+
- [Live Demo](https://app.mrd-indicators.com/trading/chart-terminal)
|
|
67
|
+
- [Documentation](https://github.com/PhamNhinh/kline-orderbook-chart#documentation)
|
|
68
|
+
- [GitHub](https://github.com/PhamNhinh/kline-orderbook-chart)
|
|
69
|
+
- [Discord](https://discord.gg/buX2h5ZZm)
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
Commercial software. Free 14-day trial with watermark. [See LICENSE](https://github.com/PhamNhinh/kline-orderbook-chart/blob/main/LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class E{__destroy_into_raw(){const _=this.__wbg_ptr;return this.__wbg_ptr=0,L.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__wbg_chartengine_free(_,0)}add_anchored_vwap(_,e,r,n,i,s,a){return t.chartengine_add_anchored_vwap(this.__wbg_ptr,_,e,r,n,i,s,a)>>>0}add_arrow(_,e,r,n,i,s,a,o,c,p){return t.chartengine_add_arrow(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p)>>>0}add_arrow_marker_down(_,e,r,n,i,s,a){return t.chartengine_add_arrow_marker_down(this.__wbg_ptr,_,e,r,n,i,s,a)>>>0}add_arrow_marker_up(_,e,r,n,i,s,a){return t.chartengine_add_arrow_marker_up(this.__wbg_ptr,_,e,r,n,i,s,a)>>>0}add_brush_point(_,e){t.chartengine_add_brush_point(this.__wbg_ptr,_,e)}add_circle(_,e,r,n,i,s,a,o,c,p){return t.chartengine_add_circle(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p)>>>0}add_elliott_impulse(_,e,r,n,i,s,a){return t.chartengine_add_elliott_impulse(this.__wbg_ptr,_,e,r,n,i,s,a)>>>0}add_elliott_manual_point(_,e){return t.chartengine_add_elliott_manual_point(this.__wbg_ptr,_,e)!==0}add_fib_extension(_,e,r,n,i,s,a,o,c,p,d,b){return t.chartengine_add_fib_extension(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p,d,b)>>>0}add_fib_retracement(_,e,r,n,i,s,a,o,c,p){return t.chartengine_add_fib_retracement(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p)>>>0}add_horizontal_line(_,e,r,n,i,s,a,o){return t.chartengine_add_horizontal_line(this.__wbg_ptr,_,e,r,n,i,s,a,o)>>>0}add_long_position(_,e,r,n,i,s,a,o,c,p){return t.chartengine_add_long_position(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p)>>>0}add_marker(_,e,r){t.chartengine_add_marker(this.__wbg_ptr,_,e,r)}add_parallel_channel(_,e,r,n,i,s,a,o,c,p,d,b){return t.chartengine_add_parallel_channel(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p,d,b)>>>0}add_path_point(_,e){t.chartengine_add_path_point(this.__wbg_ptr,_,e)}add_price_label(_,e,r,n,i,s,a){return t.chartengine_add_price_label(this.__wbg_ptr,_,e,r,n,i,s,a)>>>0}add_price_range(_,e,r,n,i,s,a,o,c,p){return t.chartengine_add_price_range(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p)>>>0}add_short_position(_,e,r,n,i,s,a,o,c,p){return t.chartengine_add_short_position(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p)>>>0}add_text_note(_,e,r,n,i,s,a){return t.chartengine_add_text_note(this.__wbg_ptr,_,e,r,n,i,s,a)>>>0}add_trendline(_,e,r,n,i,s,a,o,c,p){return t.chartengine_add_trendline(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p)>>>0}append_heatmap_column(_,e,r,n){const i=l(_,t.__wbindgen_export),s=h;t.chartengine_append_heatmap_column(this.__wbg_ptr,i,s,e,r,n)}append_kline(_,e,r,n,i,s){t.chartengine_append_kline(this.__wbg_ptr,_,e,r,n,i,s)}append_real_timestamp(_){t.chartengine_append_real_timestamp(this.__wbg_ptr,_)}cancel_brush(){t.chartengine_cancel_brush(this.__wbg_ptr)}cancel_elliott_manual(){t.chartengine_cancel_elliott_manual(this.__wbg_ptr)}cancel_path(){t.chartengine_cancel_path(this.__wbg_ptr)}chart_area_h(){return t.chartengine_chart_area_h(this.__wbg_ptr)}chart_area_w(){return t.chartengine_chart_area_w(this.__wbg_ptr)}chart_area_x(){return t.chartengine_chart_area_x(this.__wbg_ptr)}chart_area_y(){return t.chartengine_chart_area_y(this.__wbg_ptr)}clear_channel_preview(){t.chartengine_clear_channel_preview(this.__wbg_ptr)}clear_drawing_preview(){t.chartengine_clear_drawing_preview(this.__wbg_ptr)}clear_drawings(){t.chartengine_clear_drawings(this.__wbg_ptr)}clear_elliott_preview(){t.chartengine_clear_elliott_preview(this.__wbg_ptr)}clear_fib_ext_preview(){t.chartengine_clear_fib_ext_preview(this.__wbg_ptr)}clear_heatmap_prefetch_range(){t.chartengine_clear_heatmap_prefetch_range(this.__wbg_ptr)}clear_hover_price(){t.chartengine_clear_hover_price(this.__wbg_ptr)}clear_large_trades(){t.chartengine_clear_large_trades(this.__wbg_ptr)}clear_live_signals(){t.chartengine_clear_live_signals(this.__wbg_ptr)}clear_markers(){t.chartengine_clear_markers(this.__wbg_ptr)}custom_band(_,e,r,n,i,s){const a=l(_,t.__wbindgen_export),o=h,c=l(e,t.__wbindgen_export),p=h;t.chartengine_custom_band(this.__wbg_ptr,a,o,c,p,r,n,i,s)}custom_begin(){t.chartengine_custom_begin(this.__wbg_ptr)}custom_circle_px(_,e,r,n,i,s,a,o,c,p,d,b){t.chartengine_custom_circle_px(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p,d,b)}custom_clip_rect(_,e,r,n){t.chartengine_custom_clip_rect(this.__wbg_ptr,_,e,r,n)}custom_command_count(){return t.chartengine_custom_command_count(this.__wbg_ptr)>>>0}custom_dashed_hline(_,e,r,n,i,s,a,o){t.chartengine_custom_dashed_hline(this.__wbg_ptr,_,e,r,n,i,s,a,o)}custom_end(){t.chartengine_custom_end(this.__wbg_ptr)}custom_fill_rect_px(_,e,r,n,i,s,a,o){t.chartengine_custom_fill_rect_px(this.__wbg_ptr,_,e,r,n,i,s,a,o)}custom_hline(_,e,r,n,i,s){t.chartengine_custom_hline(this.__wbg_ptr,_,e,r,n,i,s)}custom_line_px(_,e,r,n,i,s,a,o,c){t.chartengine_custom_line_px(this.__wbg_ptr,_,e,r,n,i,s,a,o,c)}custom_marker(_,e,r,n,i,s,a){t.chartengine_custom_marker(this.__wbg_ptr,_,e,r,n,i,s,a)}custom_marker_down(_,e,r,n,i,s,a){t.chartengine_custom_marker_down(this.__wbg_ptr,_,e,r,n,i,s,a)}custom_marker_up(_,e,r,n,i,s,a){t.chartengine_custom_marker_up(this.__wbg_ptr,_,e,r,n,i,s,a)}custom_price_label(_,e,r,n,i,s,a){const o=z(e,t.__wbindgen_export,t.__wbindgen_export2),c=h;t.chartengine_custom_price_label(this.__wbg_ptr,_,o,c,r,n,i,s,a)}custom_restore(){t.chartengine_custom_restore(this.__wbg_ptr)}custom_save(){t.chartengine_custom_save(this.__wbg_ptr)}custom_series_dashed_line(_,e,r,n,i,s,a,o){const c=l(_,t.__wbindgen_export),p=h;t.chartengine_custom_series_dashed_line(this.__wbg_ptr,c,p,e,r,n,i,s,a,o)}custom_series_line(_,e,r,n,i,s){const a=l(_,t.__wbindgen_export),o=h;t.chartengine_custom_series_line(this.__wbg_ptr,a,o,e,r,n,i,s)}custom_stroke_rect_px(_,e,r,n,i,s,a,o,c){t.chartengine_custom_stroke_rect_px(this.__wbg_ptr,_,e,r,n,i,s,a,o,c)}custom_text(_,e,r,n,i,s,a,o,c){const p=z(r,t.__wbindgen_export,t.__wbindgen_export2),d=h;t.chartengine_custom_text(this.__wbg_ptr,_,e,p,d,n,i,s,a,o,c)}custom_text_px(_,e,r,n,i,s,a,o,c){const p=z(r,t.__wbindgen_export,t.__wbindgen_export2),d=h;t.chartengine_custom_text_px(this.__wbg_ptr,_,e,p,d,n,i,s,a,o,c)}deselect_drawing(){t.chartengine_deselect_drawing(this.__wbg_ptr)}deselect_marker(){t.chartengine_deselect_marker(this.__wbg_ptr)}disable_cvd(){t.chartengine_disable_cvd(this.__wbg_ptr)}disable_ema_structure(){t.chartengine_disable_ema_structure(this.__wbg_ptr)}disable_forex_signals(){t.chartengine_disable_forex_signals(this.__wbg_ptr)}disable_funding_rate(){t.chartengine_disable_funding_rate(this.__wbg_ptr)}disable_large_trades(){t.chartengine_disable_large_trades(this.__wbg_ptr)}disable_liq_heatmap(){t.chartengine_disable_liq_heatmap(this.__wbg_ptr)}disable_live_signals(){t.chartengine_disable_live_signals(this.__wbg_ptr)}disable_oi(){t.chartengine_disable_oi(this.__wbg_ptr)}disable_rsi(){t.chartengine_disable_rsi(this.__wbg_ptr)}disable_smart_ranges(){t.chartengine_disable_smart_ranges(this.__wbg_ptr)}disable_tpo(){t.chartengine_disable_tpo(this.__wbg_ptr)}disable_volume(){t.chartengine_disable_volume(this.__wbg_ptr)}disable_vrvp(){t.chartengine_disable_vrvp(this.__wbg_ptr)}drawing_count(){return t.chartengine_drawing_count(this.__wbg_ptr)>>>0}enable_cvd(){t.chartengine_enable_cvd(this.__wbg_ptr)}enable_ema_structure(){t.chartengine_enable_ema_structure(this.__wbg_ptr)}enable_forex_signals(){t.chartengine_enable_forex_signals(this.__wbg_ptr)}enable_funding_rate(){t.chartengine_enable_funding_rate(this.__wbg_ptr)}enable_large_trades(){t.chartengine_enable_large_trades(this.__wbg_ptr)}enable_liq_heatmap(){t.chartengine_enable_liq_heatmap(this.__wbg_ptr)}enable_live_signals(){t.chartengine_enable_live_signals(this.__wbg_ptr)}enable_oi(){t.chartengine_enable_oi(this.__wbg_ptr)}enable_rsi(){t.chartengine_enable_rsi(this.__wbg_ptr)}enable_smart_ranges(){t.chartengine_enable_smart_ranges(this.__wbg_ptr)}enable_tpo(){t.chartengine_enable_tpo(this.__wbg_ptr)}enable_volume(){t.chartengine_enable_volume(this.__wbg_ptr)}enable_vrvp(){t.chartengine_enable_vrvp(this.__wbg_ptr)}export_drawings_json(){let _,e;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_export_drawings_json(i,this.__wbg_ptr);var r=w().getInt32(i+4*0,!0),n=w().getInt32(i+4*1,!0);return _=r,e=n,u(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(_,e,1)}}finish_brush(){return t.chartengine_finish_brush(this.__wbg_ptr)>>>0}finish_elliott_manual(){return t.chartengine_finish_elliott_manual(this.__wbg_ptr)>>>0}finish_path(){return t.chartengine_finish_path(this.__wbg_ptr)>>>0}fit_content(){t.chartengine_fit_content(this.__wbg_ptr)}footprint_add_trade(_,e,r,n){t.chartengine_footprint_add_trade(this.__wbg_ptr,_,e,r,n)}footprint_add_trade_batch(_){const e=l(_,t.__wbindgen_export),r=h;t.chartengine_footprint_add_trade_batch(this.__wbg_ptr,e,r)}footprint_clear(){t.chartengine_footprint_clear(this.__wbg_ptr)}footprint_clear_bar(_){t.chartengine_footprint_clear_bar(this.__wbg_ptr,_)}footprint_ensure_len(_){t.chartengine_footprint_ensure_len(this.__wbg_ptr,_)}footprint_get_show_profile(){return t.chartengine_footprint_get_show_profile(this.__wbg_ptr)!==0}footprint_get_show_signals(){return t.chartengine_footprint_get_show_signals(this.__wbg_ptr)!==0}footprint_prepend_empty(_){t.chartengine_footprint_prepend_empty(this.__wbg_ptr,_)}footprint_profile_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_footprint_profile_hit_test(a,this.__wbg_ptr,_,e);var i=w().getInt32(a+4*0,!0),s=w().getInt32(a+4*1,!0);return r=i,n=s,u(i,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}footprint_set_bar(_,e,r,n,i){const s=l(r,t.__wbindgen_export),a=h,o=l(n,t.__wbindgen_export),c=h,p=l(i,t.__wbindgen_export),d=h;t.chartengine_footprint_set_bar(this.__wbg_ptr,_,e,s,a,o,c,p,d)}footprint_set_show_profile(_){t.chartengine_footprint_set_show_profile(this.__wbg_ptr,_)}footprint_set_show_signals(_){t.chartengine_footprint_set_show_signals(this.__wbg_ptr,_)}footprint_signal_count(){return t.chartengine_footprint_signal_count(this.__wbg_ptr)>>>0}get_chart_type(){return t.chartengine_get_chart_type(this.__wbg_ptr)}get_command_buffer_len(){return t.chartengine_get_command_buffer_len(this.__wbg_ptr)>>>0}get_command_buffer_ptr(){return t.chartengine_get_command_buffer_ptr(this.__wbg_ptr)>>>0}get_custom_buffer_len(){return t.chartengine_get_custom_buffer_len(this.__wbg_ptr)>>>0}get_custom_buffer_ptr(){return t.chartengine_get_custom_buffer_ptr(this.__wbg_ptr)>>>0}get_cvd_mode(){return t.chartengine_get_cvd_mode(this.__wbg_ptr)}get_cvd_ratio(){return t.chartengine_get_cvd_ratio(this.__wbg_ptr)}get_cvd_show_delta(){return t.chartengine_get_cvd_show_delta(this.__wbg_ptr)!==0}get_drawing_color(_){return t.chartengine_get_drawing_color(this.__wbg_ptr,_)>>>0}get_drawing_dashed(_){return t.chartengine_get_drawing_dashed(this.__wbg_ptr,_)!==0}get_drawing_font_size(_){return t.chartengine_get_drawing_font_size(this.__wbg_ptr,_)}get_drawing_hide_label(_){return t.chartengine_get_drawing_hide_label(this.__wbg_ptr,_)!==0}get_drawing_kind_id(_){return t.chartengine_get_drawing_kind_id(this.__wbg_ptr,_)}get_drawing_text(_){let e,r;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_drawing_text(s,this.__wbg_ptr,_);var n=w().getInt32(s+4*0,!0),i=w().getInt32(s+4*1,!0);return e=n,r=i,u(n,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,r,1)}}get_forex_signals_count(){return t.chartengine_get_forex_signals_count(this.__wbg_ptr)>>>0}get_fr_ratio(){return t.chartengine_get_fr_ratio(this.__wbg_ptr)}get_heatmap_data_max(){return t.chartengine_get_heatmap_data_max(this.__wbg_ptr)}get_heatmap_data_min(){return t.chartengine_get_heatmap_data_min(this.__wbg_ptr)}get_heatmap_last_timestamp(){return t.chartengine_get_heatmap_last_timestamp(this.__wbg_ptr)}get_heatmap_prefetch_max(){return t.chartengine_get_heatmap_prefetch_max(this.__wbg_ptr)}get_heatmap_x_step(){return t.chartengine_get_heatmap_x_step(this.__wbg_ptr)}get_last_candle_json(){let _,e;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_last_candle_json(i,this.__wbg_ptr);var r=w().getInt32(i+4*0,!0),n=w().getInt32(i+4*1,!0);return _=r,e=n,u(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(_,e,1)}}get_last_close(){return t.chartengine_get_last_close(this.__wbg_ptr)}get_liq_heatmap_cell_height(){return t.chartengine_get_liq_heatmap_cell_height(this.__wbg_ptr)}get_liq_heatmap_filled_pct(){return t.chartengine_get_liq_heatmap_filled_pct(this.__wbg_ptr)}get_liq_heatmap_max(){return t.chartengine_get_liq_heatmap_max(this.__wbg_ptr)}get_liq_heatmap_min(){return t.chartengine_get_liq_heatmap_min(this.__wbg_ptr)}get_liq_heatmap_seg_max(){return t.chartengine_get_liq_heatmap_seg_max(this.__wbg_ptr)}get_live_signals_count(){return t.chartengine_get_live_signals_count(this.__wbg_ptr)>>>0}get_live_signals_leverage(){return t.chartengine_get_live_signals_leverage(this.__wbg_ptr)}get_lt_data_max_vol(){return t.chartengine_get_lt_data_max_vol(this.__wbg_ptr)}get_lt_data_min_vol(){return t.chartengine_get_lt_data_min_vol(this.__wbg_ptr)}get_oi_ratio(){return t.chartengine_get_oi_ratio(this.__wbg_ptr)}get_rsi_ratio(){return t.chartengine_get_rsi_ratio(this.__wbg_ptr)}get_selected_drawing(){return t.chartengine_get_selected_drawing(this.__wbg_ptr)>>>0}get_selected_marker(){return t.chartengine_get_selected_marker(this.__wbg_ptr)>>>0}get_sr_signals_count(){return t.chartengine_get_sr_signals_count(this.__wbg_ptr)>>>0}get_theme(){return t.chartengine_get_theme(this.__wbg_ptr)}get_tooltip_data(){let _,e;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_tooltip_data(i,this.__wbg_ptr);var r=w().getInt32(i+4*0,!0),n=w().getInt32(i+4*1,!0);return _=r,e=n,u(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(_,e,1)}}get_tpo_period(){return t.chartengine_get_tpo_period(this.__wbg_ptr)>>>0}get_volume_color_mode(){return t.chartengine_get_volume_color_mode(this.__wbg_ptr)}get_volume_ma_period(){return t.chartengine_get_volume_ma_period(this.__wbg_ptr)>>>0}get_volume_show_ma(){return t.chartengine_get_volume_show_ma(this.__wbg_ptr)!==0}get_volume_show_signals(){return t.chartengine_get_volume_show_signals(this.__wbg_ptr)!==0}hide_crosshair(){t.chartengine_hide_crosshair(this.__wbg_ptr)}hit_test_drawing(_,e){return t.chartengine_hit_test_drawing(this.__wbg_ptr,_,e)>>>0}hit_test_drawing_anchor(_,e){return t.chartengine_hit_test_drawing_anchor(this.__wbg_ptr,_,e)}hit_test_marker(_,e){return t.chartengine_hit_test_marker(this.__wbg_ptr,_,e)>>>0}hit_zone(_,e){return t.chartengine_hit_zone(this.__wbg_ptr,_,e)}hover_hit_test(_,e){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_hover_hit_test(s,this.__wbg_ptr,_,e);var r=w().getInt32(s+4*0,!0),n=w().getInt32(s+4*1,!0),i=P(r,n).slice();return t.__wbindgen_export3(r,n*4,4),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}import_drawings_json(_){const e=z(_,t.__wbindgen_export,t.__wbindgen_export2),r=h;t.chartengine_import_drawings_json(this.__wbg_ptr,e,r)}is_cvd_enabled(){return t.chartengine_is_cvd_enabled(this.__wbg_ptr)!==0}is_dirty(){return t.chartengine_is_dirty(this.__wbg_ptr)!==0}is_ema_structure_enabled(){return t.chartengine_is_ema_structure_enabled(this.__wbg_ptr)!==0}is_forex_signals_enabled(){return t.chartengine_is_forex_signals_enabled(this.__wbg_ptr)!==0}is_funding_rate_enabled(){return t.chartengine_is_funding_rate_enabled(this.__wbg_ptr)!==0}is_large_trades_enabled(){return t.chartengine_is_large_trades_enabled(this.__wbg_ptr)!==0}is_liq_heatmap_enabled(){return t.chartengine_is_liq_heatmap_enabled(this.__wbg_ptr)!==0}is_liq_heatmap_filled_zones(){return t.chartengine_is_liq_heatmap_filled_zones(this.__wbg_ptr)!==0}is_liq_heatmap_predictions(){return t.chartengine_is_liq_heatmap_predictions(this.__wbg_ptr)!==0}is_liq_heatmap_profile(){return t.chartengine_is_liq_heatmap_profile(this.__wbg_ptr)!==0}is_live_signals_enabled(){return t.chartengine_is_live_signals_enabled(this.__wbg_ptr)!==0}is_oi_enabled(){return t.chartengine_is_oi_enabled(this.__wbg_ptr)!==0}is_rsi_enabled(){return t.chartengine_is_rsi_enabled(this.__wbg_ptr)!==0}is_rsi_show_traps(){return t.chartengine_is_rsi_show_traps(this.__wbg_ptr)!==0}is_smart_ranges_enabled(){return t.chartengine_is_smart_ranges_enabled(this.__wbg_ptr)!==0}is_tpo_enabled(){return t.chartengine_is_tpo_enabled(this.__wbg_ptr)!==0}is_tpo_signals(){return t.chartengine_is_tpo_signals(this.__wbg_ptr)!==0}is_volume_enabled(){return t.chartengine_is_volume_enabled(this.__wbg_ptr)!==0}is_vrvp_enabled(){return t.chartengine_is_vrvp_enabled(this.__wbg_ptr)!==0}kline_closes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_closes(n,this.__wbg_ptr);var _=w().getInt32(n+4*0,!0),e=w().getInt32(n+4*1,!0),r=v(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_count(){return t.chartengine_kline_count(this.__wbg_ptr)>>>0}kline_highs(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_highs(n,this.__wbg_ptr);var _=w().getInt32(n+4*0,!0),e=w().getInt32(n+4*1,!0),r=v(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_lows(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_lows(n,this.__wbg_ptr);var _=w().getInt32(n+4*0,!0),e=w().getInt32(n+4*1,!0),r=v(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_opens(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_opens(n,this.__wbg_ptr);var _=w().getInt32(n+4*0,!0),e=w().getInt32(n+4*1,!0),r=v(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_timestamps(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_timestamps(n,this.__wbg_ptr);var _=w().getInt32(n+4*0,!0),e=w().getInt32(n+4*1,!0),r=v(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_volumes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_volumes(n,this.__wbg_ptr);var _=w().getInt32(n+4*0,!0),e=w().getInt32(n+4*1,!0),r=v(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}liq_filled_zone_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_filled_zone_hit_test(a,this.__wbg_ptr,_,e);var i=w().getInt32(a+4*0,!0),s=w().getInt32(a+4*1,!0);return r=i,n=s,u(i,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}liq_heatmap_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_heatmap_hit_test(a,this.__wbg_ptr,_,e);var i=w().getInt32(a+4*0,!0),s=w().getInt32(a+4*1,!0);return r=i,n=s,u(i,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}liq_predict_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_predict_hit_test(a,this.__wbg_ptr,_,e);var i=w().getInt32(a+4*0,!0),s=w().getInt32(a+4*1,!0);return r=i,n=s,u(i,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}liq_zone_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_zone_hit_test(a,this.__wbg_ptr,_,e);var i=w().getInt32(a+4*0,!0),s=w().getInt32(a+4*1,!0);return r=i,n=s,u(i,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}lt_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_lt_hit_test(a,this.__wbg_ptr,_,e);var i=w().getInt32(a+4*0,!0),s=w().getInt32(a+4*1,!0);return r=i,n=s,u(i,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}move_drawing(_,e){t.chartengine_move_drawing(this.__wbg_ptr,_,e)}constructor(_,e){const r=t.chartengine_new(_,e);return this.__wbg_ptr=r>>>0,L.register(this,this.__wbg_ptr,this),this}oi_to_screen_y(_){return t.chartengine_oi_to_screen_y(this.__wbg_ptr,_)}pan(_,e){t.chartengine_pan(this.__wbg_ptr,_,e)}pan_x(_){t.chartengine_pan_x(this.__wbg_ptr,_)}pan_y(_){t.chartengine_pan_y(this.__wbg_ptr,_)}pop_last_kline(){return t.chartengine_pop_last_kline(this.__wbg_ptr)!==0}prepend_klines(_,e,r,n,i,s){const a=l(_,t.__wbindgen_export),o=h,c=l(e,t.__wbindgen_export),p=h,d=l(r,t.__wbindgen_export),b=h,y=l(n,t.__wbindgen_export),W=h,O=l(i,t.__wbindgen_export),F=h,R=l(s,t.__wbindgen_export),S=h;t.chartengine_prepend_klines(this.__wbg_ptr,a,o,c,p,d,b,y,W,O,F,R,S)}push_large_trade(_,e,r,n){t.chartengine_push_large_trade(this.__wbg_ptr,_,e,r,n)}remove_drawing(_){t.chartengine_remove_drawing(this.__wbg_ptr,_)}remove_marker(_){t.chartengine_remove_marker(this.__wbg_ptr,_)}render(){return t.chartengine_render(this.__wbg_ptr)>>>0}resize(_,e){t.chartengine_resize(this.__wbg_ptr,_,e)}rsi_to_screen_y(_){return t.chartengine_rsi_to_screen_y(this.__wbg_ptr,_)}screen_to_cvd_y(_){return t.chartengine_screen_to_cvd_y(this.__wbg_ptr,_)}screen_to_fr_y(_){return t.chartengine_screen_to_fr_y(this.__wbg_ptr,_)}screen_to_oi_y(_){return t.chartengine_screen_to_oi_y(this.__wbg_ptr,_)}screen_to_rsi_y(_){return t.chartengine_screen_to_rsi_y(this.__wbg_ptr,_)}screen_to_world_x(_){return t.chartengine_screen_to_world_x(this.__wbg_ptr,_)}screen_to_world_y(_){return t.chartengine_screen_to_world_y(this.__wbg_ptr,_)}select_drawing(_){t.chartengine_select_drawing(this.__wbg_ptr,_)}select_marker(_){t.chartengine_select_marker(this.__wbg_ptr,_)}set_candle_interval(_){t.chartengine_set_candle_interval(this.__wbg_ptr,_)}set_channel_preview(_,e,r,n,i,s,a,o,c,p,d,b){t.chartengine_set_channel_preview(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p,d,b)}set_chart_type(_){t.chartengine_set_chart_type(this.__wbg_ptr,_)}set_crosshair(_,e){t.chartengine_set_crosshair(this.__wbg_ptr,_,e)}set_cvd_data(_,e){const r=l(_,t.__wbindgen_export),n=h,i=l(e,t.__wbindgen_export),s=h;t.chartengine_set_cvd_data(this.__wbg_ptr,r,n,i,s)}set_cvd_mode(_){t.chartengine_set_cvd_mode(this.__wbg_ptr,_)}set_cvd_ratio(_){t.chartengine_set_cvd_ratio(this.__wbg_ptr,_)}set_cvd_show_delta(_){t.chartengine_set_cvd_show_delta(this.__wbg_ptr,_)}set_drawing_dashed(_,e){t.chartengine_set_drawing_dashed(this.__wbg_ptr,_,e)}set_drawing_font_size(_,e){t.chartengine_set_drawing_font_size(this.__wbg_ptr,_,e)}set_drawing_hide_label(_,e){t.chartengine_set_drawing_hide_label(this.__wbg_ptr,_,e)}set_drawing_preview(_,e,r,n,i,s,a,o,c,p,d){t.chartengine_set_drawing_preview(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p,d)}set_drawing_style(_,e,r,n,i){t.chartengine_set_drawing_style(this.__wbg_ptr,_,e,r,n,i)}set_drawing_text(_,e){const r=z(e,t.__wbindgen_export,t.__wbindgen_export2),n=h;t.chartengine_set_drawing_text(this.__wbg_ptr,_,r,n)}set_elliott_manual_cursor(_,e){t.chartengine_set_elliott_manual_cursor(this.__wbg_ptr,_,e)}set_elliott_preview(_,e,r,n,i,s,a){t.chartengine_set_elliott_preview(this.__wbg_ptr,_,e,r,n,i,s,a)}set_es_ema1_len(_){t.chartengine_set_es_ema1_len(this.__wbg_ptr,_)}set_es_ema2_len(_){t.chartengine_set_es_ema2_len(this.__wbg_ptr,_)}set_es_show_bos(_){t.chartengine_set_es_show_bos(this.__wbg_ptr,_)}set_es_show_ema1(_){t.chartengine_set_es_show_ema1(this.__wbg_ptr,_)}set_es_show_ema2(_){t.chartengine_set_es_show_ema2(this.__wbg_ptr,_)}set_es_show_wma(_){t.chartengine_set_es_show_wma(this.__wbg_ptr,_)}set_es_swing_len(_){t.chartengine_set_es_swing_len(this.__wbg_ptr,_)}set_es_wma_len(_){t.chartengine_set_es_wma_len(this.__wbg_ptr,_)}set_fib_ext_preview(_,e,r,n,i,s,a,o,c,p,d,b){t.chartengine_set_fib_ext_preview(this.__wbg_ptr,_,e,r,n,i,s,a,o,c,p,d,b)}set_footprint_tick_size(_){t.chartengine_set_footprint_tick_size(this.__wbg_ptr,_)}set_forex_signals_mode(_){t.chartengine_set_forex_signals_mode(this.__wbg_ptr,_)}set_forex_signals_setup(_){t.chartengine_set_forex_signals_setup(this.__wbg_ptr,_)}set_forex_signals_show_stats(_){t.chartengine_set_forex_signals_show_stats(this.__wbg_ptr,_)}set_fr_agg_data(_,e){const r=l(_,t.__wbindgen_export),n=h,i=l(e,t.__wbindgen_export),s=h;t.chartengine_set_fr_agg_data(this.__wbg_ptr,r,n,i,s)}set_fr_binance_data(_,e){const r=l(_,t.__wbindgen_export),n=h,i=l(e,t.__wbindgen_export),s=h;t.chartengine_set_fr_binance_data(this.__wbg_ptr,r,n,i,s)}set_fr_ratio(_){t.chartengine_set_fr_ratio(this.__wbg_ptr,_)}set_fr_show_agg(_){t.chartengine_set_fr_show_agg(this.__wbg_ptr,_)}set_fr_show_sma(_){t.chartengine_set_fr_show_sma(this.__wbg_ptr,_)}set_heatmap(_,e,r,n,i,s,a){const o=l(_,t.__wbindgen_export),c=h;t.chartengine_set_heatmap(this.__wbg_ptr,o,c,e,r,n,i,s,a)}set_heatmap_prefetch_range(_){t.chartengine_set_heatmap_prefetch_range(this.__wbg_ptr,_)}set_heatmap_range(_,e){t.chartengine_set_heatmap_range(this.__wbg_ptr,_,e)}set_hover_price(_){t.chartengine_set_hover_price(this.__wbg_ptr,_)}set_klines(_,e,r,n,i,s){const a=l(_,t.__wbindgen_export),o=h,c=l(e,t.__wbindgen_export),p=h,d=l(r,t.__wbindgen_export),b=h,y=l(n,t.__wbindgen_export),W=h,O=l(i,t.__wbindgen_export),F=h,R=l(s,t.__wbindgen_export),S=h;t.chartengine_set_klines(this.__wbg_ptr,a,o,c,p,d,b,y,W,O,F,R,S)}set_large_trades_data(_){const e=l(_,t.__wbindgen_export),r=h;t.chartengine_set_large_trades_data(this.__wbg_ptr,e,r)}set_liq_heatmap_cell_height(_){t.chartengine_set_liq_heatmap_cell_height(this.__wbg_ptr,_)}set_liq_heatmap_filled_pct(_){t.chartengine_set_liq_heatmap_filled_pct(this.__wbg_ptr,_)}set_liq_heatmap_filled_zones(_){t.chartengine_set_liq_heatmap_filled_zones(this.__wbg_ptr,_)}set_liq_heatmap_predictions(_){t.chartengine_set_liq_heatmap_predictions(this.__wbg_ptr,_)}set_liq_heatmap_profile(_){t.chartengine_set_liq_heatmap_profile(this.__wbg_ptr,_)}set_liq_heatmap_range(_,e){t.chartengine_set_liq_heatmap_range(this.__wbg_ptr,_,e)}set_live_signals_data(_){const e=l(_,t.__wbindgen_export),r=h;t.chartengine_set_live_signals_data(this.__wbg_ptr,e,r)}set_live_signals_leverage(_){t.chartengine_set_live_signals_leverage(this.__wbg_ptr,_)}set_live_signals_loading(_){t.chartengine_set_live_signals_loading(this.__wbg_ptr,_)}set_live_signals_pip_value(_){t.chartengine_set_live_signals_pip_value(this.__wbg_ptr,_)}set_live_signals_show_entry(_){t.chartengine_set_live_signals_show_entry(this.__wbg_ptr,_)}set_live_signals_show_labels(_){t.chartengine_set_live_signals_show_labels(this.__wbg_ptr,_)}set_live_signals_show_max_profit(_){t.chartengine_set_live_signals_show_max_profit(this.__wbg_ptr,_)}set_live_signals_show_tp_sl(_){t.chartengine_set_live_signals_show_tp_sl(this.__wbg_ptr,_)}set_live_signals_show_zones(_){t.chartengine_set_live_signals_show_zones(this.__wbg_ptr,_)}set_live_signals_text_size(_){t.chartengine_set_live_signals_text_size(this.__wbg_ptr,_)}set_live_signals_trial(_){t.chartengine_set_live_signals_trial(this.__wbg_ptr,_)}set_lt_bubble_scale(_){t.chartengine_set_lt_bubble_scale(this.__wbg_ptr,_)}set_lt_volume_filter(_,e){t.chartengine_set_lt_volume_filter(this.__wbg_ptr,_,e)}set_oi_data(_){const e=l(_,t.__wbindgen_export),r=h;t.chartengine_set_oi_data(this.__wbg_ptr,e,r)}set_oi_data_ts(_,e){const r=l(_,t.__wbindgen_export),n=h,i=l(e,t.__wbindgen_export),s=h;t.chartengine_set_oi_data_ts(this.__wbg_ptr,r,n,i,s)}set_oi_display_mode(_){t.chartengine_set_oi_display_mode(this.__wbg_ptr,_)}set_oi_ratio(_){t.chartengine_set_oi_ratio(this.__wbg_ptr,_)}set_oi_show_on_chart(_){t.chartengine_set_oi_show_on_chart(this.__wbg_ptr,_)}set_path_cursor(_,e){t.chartengine_set_path_cursor(this.__wbg_ptr,_,e)}set_price_precision(_){t.chartengine_set_price_precision(this.__wbg_ptr,_)}set_real_timestamps(_){const e=l(_,t.__wbindgen_export),r=h;t.chartengine_set_real_timestamps(this.__wbg_ptr,e,r)}set_replay_hovered(_){t.chartengine_set_replay_hovered(this.__wbg_ptr,_)}set_replay_preview(_){t.chartengine_set_replay_preview(this.__wbg_ptr,_)}set_replay_state(_,e,r){t.chartengine_set_replay_state(this.__wbg_ptr,_,e,r)}set_rsi_period(_){t.chartengine_set_rsi_period(this.__wbg_ptr,_)}set_rsi_ratio(_){t.chartengine_set_rsi_ratio(this.__wbg_ptr,_)}set_rsi_show_divergence(_){t.chartengine_set_rsi_show_divergence(this.__wbg_ptr,_)}set_rsi_show_ema(_){t.chartengine_set_rsi_show_ema(this.__wbg_ptr,_)}set_rsi_show_signals(_){t.chartengine_set_rsi_show_signals(this.__wbg_ptr,_)}set_rsi_show_traps(_){t.chartengine_set_rsi_show_traps(this.__wbg_ptr,_)}set_rsi_show_wma(_){t.chartengine_set_rsi_show_wma(this.__wbg_ptr,_)}set_rsi_smoothing(_){t.chartengine_set_rsi_smoothing(this.__wbg_ptr,_)}set_sr_fvg_extend(_){t.chartengine_set_sr_fvg_extend(this.__wbg_ptr,_)}set_sr_fvg_htf(_){t.chartengine_set_sr_fvg_htf(this.__wbg_ptr,_)}set_sr_fvg_mitigation(_){t.chartengine_set_sr_fvg_mitigation(this.__wbg_ptr,_)}set_sr_fvg_theme(_){t.chartengine_set_sr_fvg_theme(this.__wbg_ptr,_)}set_sr_htf_minutes(_){t.chartengine_set_sr_htf_minutes(this.__wbg_ptr,_)}set_sr_mitigation(_){t.chartengine_set_sr_mitigation(this.__wbg_ptr,_)}set_sr_ob_last(_){t.chartengine_set_sr_ob_last(this.__wbg_ptr,_)}set_sr_show_breakers(_){t.chartengine_set_sr_show_breakers(this.__wbg_ptr,_)}set_sr_show_fvg(_){t.chartengine_set_sr_show_fvg(this.__wbg_ptr,_)}set_sr_show_fvg_signals(_){t.chartengine_set_sr_show_fvg_signals(this.__wbg_ptr,_)}set_sr_show_htf_ob(_){t.chartengine_set_sr_show_htf_ob(this.__wbg_ptr,_)}set_sr_show_metrics(_){t.chartengine_set_sr_show_metrics(this.__wbg_ptr,_)}set_sr_show_ob(_){t.chartengine_set_sr_show_ob(this.__wbg_ptr,_)}set_sr_show_ob_activity(_){t.chartengine_set_sr_show_ob_activity(this.__wbg_ptr,_)}set_sr_show_ob_signals(_){t.chartengine_set_sr_show_ob_signals(this.__wbg_ptr,_)}set_sr_show_predict(_){t.chartengine_set_sr_show_predict(this.__wbg_ptr,_)}set_sr_show_smart_rev(_){t.chartengine_set_sr_show_smart_rev(this.__wbg_ptr,_)}set_sr_smart_rev_htf(_){t.chartengine_set_sr_smart_rev_htf(this.__wbg_ptr,_)}set_sr_stats_position(_){t.chartengine_set_sr_stats_position(this.__wbg_ptr,_)}set_sr_stats_type(_){t.chartengine_set_sr_stats_type(this.__wbg_ptr,_)}set_sr_text_size(_){t.chartengine_set_sr_text_size(this.__wbg_ptr,_)}set_theme(_){t.chartengine_set_theme(this.__wbg_ptr,_)}set_tpo_ib(_){t.chartengine_set_tpo_ib(this.__wbg_ptr,_)}set_tpo_ib_minutes(_){t.chartengine_set_tpo_ib_minutes(this.__wbg_ptr,_)}set_tpo_letter_minutes(_){t.chartengine_set_tpo_letter_minutes(this.__wbg_ptr,_)}set_tpo_naked_poc(_){t.chartengine_set_tpo_naked_poc(this.__wbg_ptr,_)}set_tpo_period(_){t.chartengine_set_tpo_period(this.__wbg_ptr,_)}set_tpo_poc_line(_){t.chartengine_set_tpo_poc_line(this.__wbg_ptr,_)}set_tpo_profile_shape(_){t.chartengine_set_tpo_profile_shape(this.__wbg_ptr,_)}set_tpo_signals(_){t.chartengine_set_tpo_signals(this.__wbg_ptr,_)}set_tpo_single_prints(_){t.chartengine_set_tpo_single_prints(this.__wbg_ptr,_)}set_tpo_va_lines(_){t.chartengine_set_tpo_va_lines(this.__wbg_ptr,_)}set_volume_color_mode(_){t.chartengine_set_volume_color_mode(this.__wbg_ptr,_)}set_volume_ma_period(_){t.chartengine_set_volume_ma_period(this.__wbg_ptr,_)}set_volume_show_ma(_){t.chartengine_set_volume_show_ma(this.__wbg_ptr,_)}set_volume_show_signals(_){t.chartengine_set_volume_show_signals(this.__wbg_ptr,_)}set_vrvp_poc_line(_){t.chartengine_set_vrvp_poc_line(this.__wbg_ptr,_)}show_latest(_){t.chartengine_show_latest(this.__wbg_ptr,_)}start_brush(_,e,r,n,i){t.chartengine_start_brush(this.__wbg_ptr,_,e,r,n,i)}start_elliott_manual(_,e,r,n,i){t.chartengine_start_elliott_manual(this.__wbg_ptr,_,e,r,n,i)}start_path(_,e,r,n,i,s){t.chartengine_start_path(this.__wbg_ptr,_,e,r,n,i,s)}update_drawing_anchor(_,e,r){t.chartengine_update_drawing_anchor(this.__wbg_ptr,_,e,r)}update_heatmap_column(_,e){const r=l(e,t.__wbindgen_export),n=h;t.chartengine_update_heatmap_column(this.__wbg_ptr,_,r,n)}update_heatmap_column_at(_,e,r,n){const i=l(_,t.__wbindgen_export),s=h;t.chartengine_update_heatmap_column_at(this.__wbg_ptr,i,s,e,r,n)}update_last_heatmap_column(_,e,r){const n=l(_,t.__wbindgen_export),i=h;t.chartengine_update_last_heatmap_column(this.__wbg_ptr,n,i,e,r)}update_last_kline(_,e,r,n,i,s){t.chartengine_update_last_kline(this.__wbg_ptr,_,e,r,n,i,s)}vrvp_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_vrvp_hit_test(a,this.__wbg_ptr,_,e);var i=w().getInt32(a+4*0,!0),s=w().getInt32(a+4*1,!0);return r=i,n=s,u(i,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}world_to_screen_x(_){return t.chartengine_world_to_screen_x(this.__wbg_ptr,_)}world_to_screen_y(_){return t.chartengine_world_to_screen_y(this.__wbg_ptr,_)}zoom(_,e,r){t.chartengine_zoom(this.__wbg_ptr,_,e,r)}zoom_x(_,e){t.chartengine_zoom_x(this.__wbg_ptr,_,e)}zoom_y(_,e){t.chartengine_zoom_y(this.__wbg_ptr,_,e)}}Symbol.dispose&&(E.prototype[Symbol.dispose]=E.prototype.free);function $(){const g=t.wasm_memory();return X(g)}function D(){return{__proto__:null,"./chart_engine_bg.js":{__proto__:null,__wbg___wbindgen_memory_edb3f01e3930bbf6:function(){const _=t.memory;return B(_)},__wbg___wbindgen_throw_6ddd609b62940d55:function(_,e){throw new Error(u(_,e))}}}}const L=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(g=>t.__wbg_chartengine_free(g>>>0,1));function B(g){q===m.length&&m.push(m.length+1);const _=q;return q=m[_],m[_]=g,_}function V(g){g<1028||(m[g]=q,q=g)}function v(g,_){return g=g>>>0,C().subarray(g/8,g/8+_)}function P(g,_){return g=g>>>0,H().subarray(g/4,g/4+_)}let f=null;function w(){return(f===null||f.buffer.detached===!0||f.buffer.detached===void 0&&f.buffer!==t.memory.buffer)&&(f=new DataView(t.memory.buffer)),f}let x=null;function C(){return(x===null||x.byteLength===0)&&(x=new Float64Array(t.memory.buffer)),x}let k=null;function H(){return(k===null||k.byteLength===0)&&(k=new Int32Array(t.memory.buffer)),k}function u(g,_){return g=g>>>0,G(g,_)}let I=null;function j(){return(I===null||I.byteLength===0)&&(I=new Uint8Array(t.memory.buffer)),I}function N(g){return m[g]}let m=new Array(1024).fill(void 0);m.push(void 0,null,!0,!1);let q=m.length;function l(g,_){const e=_(g.length*8,8)>>>0;return C().set(g,e/8),h=g.length,e}function z(g,_,e){if(e===void 0){const a=A.encode(g),o=_(a.length,1)>>>0;return j().subarray(o,o+a.length).set(a),h=a.length,o}let r=g.length,n=_(r,1)>>>0;const i=j();let s=0;for(;s<r;s++){const a=g.charCodeAt(s);if(a>127)break;i[n+s]=a}if(s!==r){s!==0&&(g=g.slice(s)),n=e(n,r,r=s+g.length*3,1)>>>0;const a=j().subarray(n+s,n+r),o=A.encodeInto(g,a);s+=o.written,n=e(n,r,s,1)>>>0}return h=s,n}function X(g){const _=N(g);return V(g),_}let M=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});M.decode();const Y=2146435072;let T=0;function G(g,_){return T+=_,T>=Y&&(M=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),M.decode(),T=_),M.decode(j().subarray(g,g+_))}const A=new TextEncoder;"encodeInto"in A||(A.encodeInto=function(g,_){const e=A.encode(g);return _.set(e),{read:g.length,written:e.length}});let h=0,J,t;function U(g,_){return t=g.exports,J=_,f=null,x=null,k=null,I=null,t}async function K(g,_){if(typeof Response=="function"&&g instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(g,_)}catch(n){if(g.ok&&e(g.type)&&g.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}const r=await g.arrayBuffer();return await WebAssembly.instantiate(r,_)}else{const r=await WebAssembly.instantiate(g,_);return r instanceof WebAssembly.Instance?{instance:r,module:g}:r}function e(r){switch(r){case"basic":case"cors":case"default":return!0}return!1}}function Q(g){if(t!==void 0)return t;g!==void 0&&(Object.getPrototypeOf(g)===Object.prototype?{module:g}=g:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const _=D();g instanceof WebAssembly.Module||(g=new WebAssembly.Module(g));const e=new WebAssembly.Instance(g,_);return U(e,g)}async function Z(g){if(t!==void 0)return t;g!==void 0&&(Object.getPrototypeOf(g)===Object.prototype?{module_or_path:g}=g:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),g===void 0&&(g=new URL("chart_engine_bg.wasm",import.meta.url));const _=D();(typeof g=="string"||typeof Request=="function"&&g instanceof Request||typeof URL=="function"&&g instanceof URL)&&(g=fetch(g));const{instance:e,module:r}=await K(await g,_);return U(e,r)}export{E as ChartEngine,Z as default,Q as initSync,$ as wasm_memory};
|
|
Binary file
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare function createChartBridge(canvas: HTMLCanvasElement): Promise<MrdChart>;
|
|
2
|
+
export declare function prefetchWasm(): void;
|
|
3
|
+
export declare function dispatchCommands(ctx: CanvasRenderingContext2D, memory: WebAssembly.Memory, ptr: number, len: number): void;
|
|
4
|
+
export declare function setupEvents(canvas: HTMLCanvasElement, engine: any, callbacks: any): () => void;
|
|
5
|
+
export declare function createCustomIndicatorManager(engine: any, memory: WebAssembly.Memory, dispatch: any): any;
|
|
6
|
+
|
|
7
|
+
export interface MrdChart {
|
|
8
|
+
engine: any;
|
|
9
|
+
start(): void;
|
|
10
|
+
stop(): void;
|
|
11
|
+
resize(retries?: number): void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
pause(): void;
|
|
14
|
+
resume(): void;
|
|
15
|
+
readonly isPaused: boolean;
|
|
16
|
+
|
|
17
|
+
// Data
|
|
18
|
+
setKlines(klines: any[]): void;
|
|
19
|
+
updateLastKline(t: number, o: number, h: number, l: number, c: number, v: number): void;
|
|
20
|
+
appendKline(t: number, o: number, h: number, l: number, c: number, v: number): void;
|
|
21
|
+
setHeatmap(data: Float32Array, rows: number, cols: number, priceMin: number, priceMax: number, timeStart: number, timeEnd: number): void;
|
|
22
|
+
|
|
23
|
+
// Indicators
|
|
24
|
+
enableVolume(on: boolean): void;
|
|
25
|
+
enableRsi(on: boolean, period?: number): void;
|
|
26
|
+
enableOi(on: boolean): void;
|
|
27
|
+
enableFootprint(on: boolean): void;
|
|
28
|
+
enableHeatmap(on: boolean): void;
|
|
29
|
+
|
|
30
|
+
// Drawing
|
|
31
|
+
startDrawing(tool: string, style?: any): void;
|
|
32
|
+
cancelDrawing(): void;
|
|
33
|
+
|
|
34
|
+
// Settings
|
|
35
|
+
setPrecision(decimals: number): void;
|
|
36
|
+
setCandleInterval(seconds: number): void;
|
|
37
|
+
setTheme(name: 'dark' | 'light'): void;
|
|
38
|
+
getTheme(): 'dark' | 'light';
|
|
39
|
+
|
|
40
|
+
// Events
|
|
41
|
+
onTooltip(cb: (json: string | null, sx: number, sy: number) => void): void;
|
|
42
|
+
|
|
43
|
+
// Custom Indicators
|
|
44
|
+
addIndicator(config: any): string;
|
|
45
|
+
removeIndicator(id: string): void;
|
|
46
|
+
updateIndicatorParams(id: string, params: any): void;
|
|
47
|
+
setIndicatorEnabled(id: string, enabled: boolean): void;
|
|
48
|
+
listIndicators(): any[];
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var P={FILL_RECT:1,STROKE_RECT:2,LINE:3,DASHED_LINE:4,POLYLINE:5,TEXT:6,CIRCLE:7,TRIANGLE:8,SAVE:9,RESTORE:10,CLIP_RECT:11,ROTATED_TEXT:12,BUBBLE_3D:13,FILL_POLYGON:14,DASHED_POLYLINE:15,END_FRAME:255},$t=["left","center","right"],nt=new Map,Kt=4096;function Dt(e,o,s,t){return e<<24|o<<16|s<<8|t}function I(e,o,s,t){let l=Dt(e,o,s,t),a=nt.get(l);return a||(a=`rgba(${e},${o},${s},${(t/255).toFixed(3)})`,nt.size>=Kt&&nt.clear(),nt.set(l,a),a)}var Tt=new TextDecoder;function lt(e,o,s,t){let l=o.buffer;if(s+t>l.byteLength)return;let a=new DataView(l,s,t),n=new Uint8Array(l,s,t),r=0,i="",f="",_=-1,m="";for(;r<t;){let u=n[r];if(r+=1,u===P.END_FRAME)break;switch(u){case P.FILL_RECT:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=a.getFloat32(r,!0);r+=4;let p=a.getFloat32(r,!0);r+=4;let w=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4,w!==i&&(e.fillStyle=w,i=w),e.fillRect(d,h,c,p);break}case P.STROKE_RECT:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=a.getFloat32(r,!0);r+=4;let p=a.getFloat32(r,!0);r+=4;let w=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4;let S=a.getFloat32(r,!0);r+=4,w!==f&&(e.strokeStyle=w,f=w),S!==_&&(e.lineWidth=S,_=S),e.strokeRect(d,h,c,p);break}case P.LINE:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=a.getFloat32(r,!0);r+=4;let p=a.getFloat32(r,!0);r+=4;let w=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4;let S=a.getFloat32(r,!0);r+=4,e.beginPath(),w!==f&&(e.strokeStyle=w,f=w),S!==_&&(e.lineWidth=S,_=S),e.setLineDash([]),e.moveTo(d,h),e.lineTo(c,p),e.stroke();break}case P.DASHED_LINE:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=a.getFloat32(r,!0);r+=4;let p=a.getFloat32(r,!0);r+=4;let w=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4;let S=a.getFloat32(r,!0);r+=4;let T=a.getFloat32(r,!0);r+=4;let E=a.getFloat32(r,!0);r+=4,e.beginPath(),w!==f&&(e.strokeStyle=w,f=w),S!==_&&(e.lineWidth=S,_=S),e.setLineDash([T,E]),e.moveTo(d,h),e.lineTo(c,p),e.stroke(),e.setLineDash([]);break}case P.POLYLINE:{let d=a.getUint16(r,!0);r+=2;let h=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4;let c=a.getFloat32(r,!0);if(r+=4,d>0){let p=new Float32Array(d*2);for(let w=0;w<d;w++)p[w*2]=a.getFloat32(r,!0),r+=4,p[w*2+1]=a.getFloat32(r,!0),r+=4;if(e.beginPath(),h!==f&&(e.strokeStyle=h,f=h),c!==_&&(e.lineWidth=c,_=c),e.setLineDash([]),e.lineJoin="round",e.lineCap="round",d<=3){e.moveTo(p[0],p[1]);for(let w=1;w<d;w++)e.lineTo(p[w*2],p[w*2+1])}else{e.moveTo(p[0],p[1]),e.lineTo((p[0]+p[2])*.5,(p[1]+p[3])*.5);for(let w=1;w<d-1;w++){let S=p[w*2],T=p[w*2+1],E=p[(w+1)*2],Y=p[(w+1)*2+1];e.quadraticCurveTo(S,T,(S+E)*.5,(T+Y)*.5)}e.lineTo(p[(d-1)*2],p[(d-1)*2+1])}e.stroke()}break}case P.TEXT:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4;let p=a.getFloat32(r,!0);r+=4;let w=n[r];r+=1;let S=a.getUint16(r,!0);r+=2;let T=Tt.decode(new Uint8Array(o.buffer,s+r,S));r+=S,c!==i&&(e.fillStyle=c,i=c);let E=`${p}px "IBM Plex Mono",monospace`;E!==m&&(e.font=E,m=E),e.textAlign=$t[w]||"left",e.textBaseline="middle",e.fillText(T,d,h);break}case P.CIRCLE:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=a.getFloat32(r,!0);r+=4;let p=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4;let w=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4;let S=a.getFloat32(r,!0);r+=4,e.beginPath(),e.arc(d,h,c,0,Math.PI*2),p!==i&&(e.fillStyle=p,i=p),e.fill(),S>0&&(w!==f&&(e.strokeStyle=w,f=w),S!==_&&(e.lineWidth=S,_=S),e.stroke());break}case P.TRIANGLE:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=a.getFloat32(r,!0);r+=4;let p=a.getFloat32(r,!0);r+=4;let w=a.getFloat32(r,!0);r+=4;let S=a.getFloat32(r,!0);r+=4;let T=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4,e.beginPath(),e.moveTo(d,h),e.lineTo(c,p),e.lineTo(w,S),e.closePath(),T!==i&&(e.fillStyle=T,i=T),e.fill();break}case P.SAVE:{e.save();break}case P.RESTORE:{e.restore(),i="",f="",_=-1,m="";break}case P.CLIP_RECT:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=a.getFloat32(r,!0);r+=4;let p=a.getFloat32(r,!0);r+=4,e.beginPath(),e.rect(d,h,c,p),e.clip();break}case P.ROTATED_TEXT:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4;let p=a.getFloat32(r,!0);r+=4;let w=a.getFloat32(r,!0);r+=4;let S=a.getUint16(r,!0);r+=2;let T=Tt.decode(n.subarray(r,r+S));r+=S;let E=`${p}px sans-serif`;E!==m&&(e.font=E,m=E),c!==i&&(e.fillStyle=c,i=c),e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(d,h),e.rotate(w),e.fillText(T,0,0),e.restore();break}case P.BUBBLE_3D:{let d=a.getFloat32(r,!0);r+=4;let h=a.getFloat32(r,!0);r+=4;let c=a.getFloat32(r,!0);r+=4;let p=n[r],w=n[r+1],S=n[r+2],T=n[r+3];r+=4;let E=n[r],Y=n[r+1],b=n[r+2],D=n[r+3];r+=4;let U=n[r],x=n[r+1],k=n[r+2],st=n[r+3];r+=4;let ht=a.getFloat32(r,!0);r+=4;let L=c;if(L<10){let z=`rgba(${p},${w},${S},${(T/255).toFixed(3)})`;e.beginPath(),e.arc(d,h,L,0,Math.PI*2),e.fillStyle=z,e.fill(),i=""}else if(L<18){let z=d-L*.25,C=h-L*.25,N=e.createRadialGradient(z,C,L*.08,d,h,L);N.addColorStop(0,`rgba(${E},${Y},${b},${(D/255).toFixed(3)})`),N.addColorStop(1,`rgba(${p},${w},${S},${(T/255).toFixed(3)})`),e.beginPath(),e.arc(d,h,L,0,Math.PI*2),e.fillStyle=N,e.fill(),i=""}else{let z=d-L*.25,C=h-L*.25,N=e.createRadialGradient(d,h,L*.85,d,h,L*1.2);N.addColorStop(0,`rgba(${U},${x},${k},${(st/255*.5).toFixed(3)})`),N.addColorStop(1,`rgba(${U},${x},${k},0)`),e.beginPath(),e.arc(d,h,L*1.2,0,Math.PI*2),e.fillStyle=N,e.fill();let G=e.createRadialGradient(z,C,L*.08,d,h,L);G.addColorStop(0,`rgba(${E},${Y},${b},${(D/255).toFixed(3)})`),G.addColorStop(1,`rgba(${p},${w},${S},${(T/255).toFixed(3)})`),e.beginPath(),e.arc(d,h,L,0,Math.PI*2),e.fillStyle=G,e.fill();let tt=L*.2,$=e.createRadialGradient(z,C,0,z,C,tt);$.addColorStop(0,"rgba(255,255,255,0.22)"),$.addColorStop(1,"rgba(255,255,255,0)"),e.beginPath(),e.arc(z,C,tt,0,Math.PI*2),e.fillStyle=$,e.fill(),i=""}break}case P.FILL_POLYGON:{let d=a.getUint16(r,!0);r+=2;let h=I(n[r],n[r+1],n[r+2],n[r+3]);if(r+=4,d>2){e.beginPath();let c=a.getFloat32(r,!0);r+=4;let p=a.getFloat32(r,!0);r+=4,e.moveTo(c,p);for(let w=1;w<d;w++)e.lineTo(a.getFloat32(r,!0),a.getFloat32(r+4,!0)),r+=8;e.closePath(),h!==i&&(e.fillStyle=h,i=h),e.fill()}else r+=d*8;break}case P.DASHED_POLYLINE:{let d=a.getUint16(r,!0);r+=2;let h=I(n[r],n[r+1],n[r+2],n[r+3]);r+=4;let c=a.getFloat32(r,!0);r+=4;let p=a.getFloat32(r,!0);r+=4;let w=a.getFloat32(r,!0);if(r+=4,d>1){e.beginPath(),h!==f&&(e.strokeStyle=h,f=h),c!==_&&(e.lineWidth=c,_=c),e.setLineDash([p,w]),e.lineJoin="round";let S=a.getFloat32(r,!0);r+=4;let T=a.getFloat32(r,!0);r+=4,e.moveTo(S,T);for(let E=1;E<d;E++)e.lineTo(a.getFloat32(r,!0),a.getFloat32(r+4,!0)),r+=8;e.stroke(),e.setLineDash([])}else r+=d*8;break}default:return}}}var X={trendline:{type:"2point",previewKind:0,addFn:"add_trendline"},arrow:{type:"2point",previewKind:4,addFn:"add_arrow"},measure:{type:"2point",previewKind:2,addFn:"add_price_range"},fib:{type:"2point",previewKind:3,addFn:"add_fib_retracement"},long:{type:"2point",previewKind:5,addFn:"add_long_position"},short:{type:"2point",previewKind:5,addFn:"add_short_position"},hline:{type:"1point_xp",previewKind:1,addFn:"add_horizontal_line"},vwap:{type:"1point_x",previewKind:6,addFn:"add_anchored_vwap"},pricelabel:{type:"1point_xy",previewKind:7,addFn:"add_price_label"},circle:{type:"2point",previewKind:8,addFn:"add_circle"},arrowup:{type:"1point_xy",previewKind:9,addFn:"add_arrow_marker_up"},arrowdown:{type:"1point_xy",previewKind:10,addFn:"add_arrow_marker_down"},textnote:{type:"1point_xy",previewKind:11,addFn:"add_text_note"},channel:{type:"3point",previewKind:0,addFn:"add_parallel_channel"},fibext:{type:"3point",previewKind:0,addFn:"add_fib_extension",previewFn:"fib_ext"},brush:{type:"freehand"},path:{type:"npoint"},elliott:{type:"elliott_manual"},elliottauto:{type:"1point_xy",previewKind:12,addFn:"add_elliott_impulse",previewFn:"elliott"}};function et(e){return X[e]?.type==="2point"}function rt(e){return X[e]?.type==="3point"}function j(e){let o=X[e]?.type;return o==="1point"||o==="1point_x"||o==="1point_xy"||o==="1point_xp"}function _t(e){return X[e]?.type==="freehand"}function q(e){return X[e]?.type==="npoint"}function W(e){return X[e]?.type==="elliott_manual"}function V(e,o,s,t,l,a){let n=X[o];if(!n)return 0;let r=0;return n.type==="3point"?r=e[n.addFn](s.x1,s.y1,s.x2,s.y2,t,l,a.r,a.g,a.b,a.lineWidth,a.dashed,s.pane):n.type==="2point"?r=e[n.addFn](s.x1,s.y1,t,l,a.r,a.g,a.b,a.lineWidth,a.dashed,s.pane):n.type==="1point_x"?r=e[n.addFn](t,a.r,a.g,a.b,a.lineWidth,a.dashed,s.pane):n.type==="1point_xp"?r=e[n.addFn](t,l,a.r,a.g,a.b,a.lineWidth,a.dashed,s.pane):n.type==="1point_xy"?r=e[n.addFn](t,l,a.r,a.g,a.b,a.fontSize||12,s.pane):r=e[n.addFn](l,a.r,a.g,a.b,a.lineWidth,a.dashed,s.pane),r||0}function O(e,o,s,t,l,a,n){let r=X[o];if(r){if(r.previewFn==="elliott"){e.set_elliott_preview(t,l,a.r,a.g,a.b,a.lineWidth,n);return}r.type==="3point"?s.step===1?e.set_drawing_preview(r.previewKind,s.x1,s.y1,t,l,a.r,a.g,a.b,a.lineWidth,a.dashed,n):s.step===2&&(r.previewFn==="fib_ext"?e.set_fib_ext_preview(s.x1,s.y1,s.x2,s.y2,t,l,a.r,a.g,a.b,a.lineWidth,a.dashed,n):e.set_channel_preview(s.x1,s.y1,s.x2,s.y2,t,l,a.r,a.g,a.b,a.lineWidth,a.dashed,n)):r.type==="2point"?e.set_drawing_preview(r.previewKind,s.x1,s.y1,t,l,a.r,a.g,a.b,a.lineWidth,a.dashed,n):r.type==="1point_x"?e.set_drawing_preview(r.previewKind,t,0,0,0,a.r,a.g,a.b,a.lineWidth,a.dashed,n):r.type==="1point_xp"||r.type==="1point_xy"?e.set_drawing_preview(r.previewKind,t,l,0,0,a.r,a.g,a.b,a.lineWidth,a.dashed,n):e.set_drawing_preview(r.previewKind,0,l,0,0,a.r,a.g,a.b,a.lineWidth,a.dashed,n)}}function M(e,o,s,t){let l=e.screen_to_world_x(o),a;switch(t){case 1:a=e.screen_to_rsi_y(s);break;case 2:a=e.screen_to_oi_y(s);break;case 3:a=e.screen_to_fr_y(s);break;case 4:a=e.screen_to_cvd_y(s);break;default:a=e.screen_to_world_y(s);break}return{wx:l,wy:a}}function H(e){return e===4?1:e===6?2:e===8?3:e===10?4:0}function A(e){return e===0||e===4||e===6||e===8||e===10}function Ft(e,o,s,t){e.addEventListener("wheel",r=>{if(t.disposed)return;r.preventDefault(),t.cancelMomentum();let i=r.deltaY>0?1.1:.9,f=o.hit_zone(r.offsetX,r.offsetY);r.ctrlKey?o.zoom_y(r.offsetY,i):r.shiftKey||f===2?o.zoom_x(r.offsetX,i):f===3?o.zoom_y(r.offsetY,i):o.zoom(r.offsetX,r.offsetY,i),s.onDirty()},{passive:!1}),e.addEventListener("mousedown",r=>{if(t.disposed||r.button!==0)return;t.cancelMomentum(),a();let i=performance.now();if(i-t.lastClickTime<300){t.lastClickTime=i;return}t.lastClickTime=i;let f=t.drawingMode;if(f){let m=o.hit_zone(r.offsetX,r.offsetY);if(!A(m))return;let u=H(m),{wx:d,wy:h}=M(o,r.offsetX,r.offsetY,u),c=f.style,p=f.tool;if(W(p)){if(!f.pathStarted)f.pane=u,o.start_elliott_manual(c.r,c.g,c.b,c.lineWidth,u),o.add_elliott_manual_point(d,h),f.pathStarted=!0,f.step=1;else if(o.add_elliott_manual_point(d,h)){t.finishDrawing(),s.onDirty();return}}else if(q(p))f.pathStarted?o.add_path_point(d,h):(f.pane=u,o.start_path(c.r,c.g,c.b,c.lineWidth,c.dashed,u),o.add_path_point(d,h),f.pathStarted=!0,f.step=1);else if(_t(p))f.pane=u,o.start_brush(c.r,c.g,c.b,c.lineWidth,u),o.add_brush_point(d,h),t.isBrushing=!0;else if(rt(p))if(f.step===0)f.x1=d,f.y1=h,f.pane=u,f.step=1;else if(f.step===1)f.x2=d,f.y2=h,f.step=2,o.clear_drawing_preview();else{let w=X[p];w&&w.previewFn==="fib_ext"?o.clear_fib_ext_preview():o.clear_channel_preview(),V(o,p,f,d,h,c),t.finishDrawing()}else if(et(p))f.step===0?(f.x1=d,f.y1=h,f.pane=u,f.step=1):(V(o,p,f,d,h,c),t.finishDrawing());else{f.pane=u;let w=V(o,p,f,d,h,c);t.finishDrawing(),p==="textnote"&&w>0&&(o.select_drawing(w),s.onDrawingSelected?.(w),s.onDrawingDblClick?.(w,r.offsetX,r.offsetY,r.clientX,r.clientY))}s.onDirty();return}let _=o.hit_zone(r.offsetX,r.offsetY);if(_===5){t.isResizingRsi=!0,t.resizeStartY=r.offsetY,t.resizeStartRatio=o.get_rsi_ratio(),e.style.cursor="ns-resize";return}if(_===7){t.isResizingOi=!0,t.resizeStartY=r.offsetY,t.resizeStartRatio=o.get_oi_ratio(),e.style.cursor="ns-resize";return}if(_===9){t.isResizingFr=!0,t.resizeStartY=r.offsetY,t.resizeStartRatio=o.get_fr_ratio(),e.style.cursor="ns-resize";return}if(_===11){t.isResizingCvd=!0,t.resizeStartY=r.offsetY,t.resizeStartRatio=o.get_cvd_ratio(),e.style.cursor="ns-resize";return}if(A(_)){let m=o.get_selected_drawing();if(m>0){let p=o.hit_test_drawing_anchor(r.offsetX,r.offsetY);if(p>=0){t.isDraggingAnchor=!0,t.dragAnchorIdx=p,t.dragAnchorPane=H(_),e.style.cursor="grabbing";return}if(o.hit_test_drawing(r.offsetX,r.offsetY)===m){t.isDraggingDrawing=!0,t.dragDrawingPane=H(_);let{wx:S,wy:T}=M(o,r.offsetX,r.offsetY,t.dragDrawingPane);t.dragDrawingLastWx=S,t.dragDrawingLastWy=T,e.style.cursor="move";return}}let u=o.hit_test_drawing(r.offsetX,r.offsetY);if(u>0){o.deselect_marker(),s.onMarkerSelected?.(0),o.select_drawing(u),s.onDrawingSelected?.(u),s.onDirty();return}let d=o.hit_test_marker(r.offsetX,r.offsetY);if(d>0){o.deselect_drawing(),s.onDrawingSelected?.(0),o.select_marker(d),s.onMarkerSelected?.(d),s.onDirty();return}let h=o.get_selected_drawing(),c=o.get_selected_marker();h>0&&(o.deselect_drawing(),s.onDrawingSelected?.(0),s.onDirty()),c>0&&(o.deselect_marker(),s.onMarkerSelected?.(0),s.onDirty())}A(_)&&(t.liqPinSx=r.offsetX,t.liqPinSy=r.offsetY,t.liqPinTimer&&clearTimeout(t.liqPinTimer),t.liqPinTimer=setTimeout(()=>{t.liqPinTimer=null,s.onLiqAnnotationPin?.(t.liqPinSx,t.liqPinSy)},700)),t.isDragging=!0,t.dragZone=_,t.lastX=r.offsetX,t.lastY=r.offsetY,_===2?e.style.cursor="ew-resize":_===3?e.style.cursor="ns-resize":e.style.cursor="grabbing"});let l=null;function a(){l&&(cancelAnimationFrame(l),l=null)}function n(r,i){let f=o.hover_hit_test(r,i),_=f[0],m=f[1],u=f[2],d=f[3],h=f[4],c=t.drawingMode;_===2?(e.style.cursor="ew-resize",o.hide_crosshair()):_===3?(e.style.cursor="ns-resize",o.hide_crosshair()):(o.set_crosshair(r,i),_===5||_===7||_===9||_===11?e.style.cursor="ns-resize":!c&&A(_)&&m>0&&u>=0?e.style.cursor="grab":!c&&A(_)&&m>0&&d===m?e.style.cursor="move":!c&&A(_)&&(d>0||h>0)?e.style.cursor="pointer":e.style.cursor="crosshair"),s.onDirty(),s.onCrosshairMove?.(r,i,_),s.onVrvpHover?.(r,i)}e.addEventListener("mousemove",r=>{if(t.disposed)return;if(t.liqPinTimer){let f=Math.abs(r.offsetX-t.liqPinSx),_=Math.abs(r.offsetY-t.liqPinSy);(f>6||_>6)&&(clearTimeout(t.liqPinTimer),t.liqPinTimer=null)}if(t.isResizingRsi){let _=e.getBoundingClientRect().height-28,u=(t.resizeStartY-r.offsetY)/_,d=Math.max(.05,Math.min(.5,t.resizeStartRatio+u));o.set_rsi_ratio(d),s.onDirty();return}if(t.isResizingOi){let _=e.getBoundingClientRect().height-28,u=(t.resizeStartY-r.offsetY)/_,d=Math.max(.05,Math.min(.5,t.resizeStartRatio+u));o.set_oi_ratio(d),s.onDirty();return}if(t.isResizingFr){let _=e.getBoundingClientRect().height-28,u=(t.resizeStartY-r.offsetY)/_,d=Math.max(.05,Math.min(.5,t.resizeStartRatio+u));o.set_fr_ratio(d),s.onDirty();return}if(t.isResizingCvd){let _=e.getBoundingClientRect().height-28,u=(t.resizeStartY-r.offsetY)/_,d=Math.max(.05,Math.min(.5,t.resizeStartRatio+u));o.set_cvd_ratio(d),s.onDirty();return}if(t.isDraggingAnchor){let{wx:f,wy:_}=M(o,r.offsetX,r.offsetY,t.dragAnchorPane);o.update_drawing_anchor(t.dragAnchorIdx,f,_),o.set_crosshair(r.offsetX,r.offsetY),s.onDirty(),s.onCrosshairMove?.(r.offsetX,r.offsetY,o.hit_zone(r.offsetX,r.offsetY));return}if(t.isDraggingDrawing){let{wx:f,wy:_}=M(o,r.offsetX,r.offsetY,t.dragDrawingPane),m=f-t.dragDrawingLastWx,u=_-t.dragDrawingLastWy;o.move_drawing(m,u),t.dragDrawingLastWx=f,t.dragDrawingLastWy=_,o.set_crosshair(r.offsetX,r.offsetY),s.onDirty(),s.onCrosshairMove?.(r.offsetX,r.offsetY,o.hit_zone(r.offsetX,r.offsetY));return}let i=t.drawingMode;if(t.isBrushing&&i){let f=i.pane||0,{wx:_,wy:m}=M(o,r.offsetX,r.offsetY,f);o.add_brush_point(_,m),o.set_crosshair(r.offsetX,r.offsetY),s.onDirty();return}if(i&&W(i.tool)&&i.pathStarted){let f=i.pane||0,{wx:_,wy:m}=M(o,r.offsetX,r.offsetY,f);o.set_elliott_manual_cursor(_,m),o.set_crosshair(r.offsetX,r.offsetY);let u=o.hit_zone(r.offsetX,r.offsetY);s.onDirty(),s.onCrosshairMove?.(r.offsetX,r.offsetY,u);return}if(i&&q(i.tool)&&i.pathStarted){let f=i.pane||0,{wx:_,wy:m}=M(o,r.offsetX,r.offsetY,f);o.set_path_cursor(_,m),o.set_crosshair(r.offsetX,r.offsetY);let u=o.hit_zone(r.offsetX,r.offsetY);s.onDirty(),s.onCrosshairMove?.(r.offsetX,r.offsetY,u);return}if(i&&i.step>0){let f=i.pane||0,{wx:_,wy:m}=M(o,r.offsetX,r.offsetY,f);O(o,i.tool,i,_,m,i.style,f),o.set_crosshair(r.offsetX,r.offsetY);let u=o.hit_zone(r.offsetX,r.offsetY);s.onDirty(),s.onCrosshairMove?.(r.offsetX,r.offsetY,u);return}if(i&&j(i.tool)){let f=o.hit_zone(r.offsetX,r.offsetY),_=H(f),{wx:m,wy:u}=M(o,r.offsetX,r.offsetY,_);O(o,i.tool,i,m,u,i.style,_),o.set_crosshair(r.offsetX,r.offsetY),s.onDirty(),s.onCrosshairMove?.(r.offsetX,r.offsetY,f);return}if(t.isDragging){let f=r.offsetX-t.lastX,_=r.offsetY-t.lastY;t.lastX=r.offsetX,t.lastY=r.offsetY,t.dragZone===2?o.pan_x(f):t.dragZone===3?o.pan_y(_):o.pan(f,_),s.onDirty(),s.onCrosshairMove?.(r.offsetX,r.offsetY,t.dragZone),s.onVrvpHover?.(r.offsetX,r.offsetY);return}t._pendingHoverX=r.offsetX,t._pendingHoverY=r.offsetY,l||(l=requestAnimationFrame(()=>{l=null,t.disposed||n(t._pendingHoverX,t._pendingHoverY)}))}),e.addEventListener("mouseup",()=>{t.disposed||(t.liqPinTimer&&(clearTimeout(t.liqPinTimer),t.liqPinTimer=null),t.isBrushing&&(t.isBrushing=!1,o.finish_brush(),t.finishDrawing(),s.onDirty()),t.isDragging=!1,t.isResizingRsi=!1,t.isResizingOi=!1,t.isResizingFr=!1,t.isResizingCvd=!1,t.isDraggingAnchor=!1,t.isDraggingDrawing=!1,t.dragAnchorIdx=-1,e.style.cursor="crosshair")}),e.addEventListener("mouseleave",()=>{t.disposed||(a(),t.liqPinTimer&&(clearTimeout(t.liqPinTimer),t.liqPinTimer=null),t.isBrushing&&(t.isBrushing=!1,o.finish_brush(),t.finishDrawing()),t.isDragging=!1,t.isResizingRsi=!1,t.isResizingOi=!1,t.isResizingFr=!1,t.isResizingCvd=!1,t.isDraggingAnchor=!1,t.isDraggingDrawing=!1,t.dragAnchorIdx=-1,o.hide_crosshair(),e.style.cursor="crosshair",s.onDirty(),s.onCrosshairHide?.(),s.onVrvpHover?.(null,null))}),e.addEventListener("dblclick",r=>{if(t.disposed)return;r.preventDefault(),r.stopPropagation();let i=t.drawingMode;if(i&&W(i.tool)&&i.pathStarted){o.finish_elliott_manual(),t.finishDrawing(),s.onDirty();return}if(i&&q(i.tool)&&i.pathStarted){o.finish_path(),t.finishDrawing(),s.onDirty();return}if(i)return;let f=o.hit_test_drawing(r.offsetX,r.offsetY);f>0&&(o.select_drawing(f),s.onDirty(),s.onDrawingDblClick?.(f,r.offsetX,r.offsetY,r.clientX,r.clientY))}),e.addEventListener("contextmenu",r=>{if(t.disposed)return;let i=t.drawingMode;if(i&&W(i.tool)&&i.pathStarted){r.preventDefault(),r.stopPropagation(),o.finish_elliott_manual(),t.finishDrawing(),s.onDirty();return}if(i&&q(i.tool)&&i.pathStarted){r.preventDefault(),r.stopPropagation(),o.finish_path(),t.finishDrawing(),s.onDirty();return}})}function Rt(e,o,s,t){e.addEventListener("touchstart",l=>{if(!t.disposed){if(l.preventDefault(),t.cancelMomentum(),l.touches.length===2){clearTimeout(t.longPressTimer),t.isCrosshairMode=!1;let a=e.getBoundingClientRect(),n=l.touches[1].clientX-l.touches[0].clientX,r=l.touches[1].clientY-l.touches[0].clientY;t.lastTouchDist=Math.sqrt(n*n+r*r),t.lastX=(l.touches[0].clientX+l.touches[1].clientX)/2-a.left,t.lastY=(l.touches[0].clientY+l.touches[1].clientY)/2-a.top,t.dragZone=o.hit_zone(t.lastX,t.lastY)}else if(l.touches.length===1){let a=e.getBoundingClientRect(),n=l.touches[0].clientX-a.left,r=l.touches[0].clientY-a.top;t.touchStartX=n,t.touchStartY=r,t.touchMoved=!1;let i=t.drawingMode;if(i){let d=o.hit_zone(n,r);if(A(d)){let h=H(d),{wx:c,wy:p}=M(o,n,r,h),w=i.tool;if(W(w)){if(!i.pathStarted)i.pane=h,o.start_elliott_manual(i.style.r,i.style.g,i.style.b,i.style.lineWidth,h),o.add_elliott_manual_point(c,p),i.pathStarted=!0,i.step=1;else if(o.add_elliott_manual_point(c,p)){t.finishDrawing(),s.onDirty();return}}else q(w)?i.pathStarted?o.add_path_point(c,p):(i.pane=h,o.start_path(i.style.r,i.style.g,i.style.b,i.style.lineWidth,i.style.dashed,h),o.add_path_point(c,p),i.pathStarted=!0,i.step=1):_t(w)?(i.pane=h,o.start_brush(i.style.r,i.style.g,i.style.b,i.style.lineWidth,h),o.add_brush_point(c,p),t.isBrushing=!0):rt(w)?i.step===0?(i.x1=c,i.y1=p,i.pane=h,i.step=1,i._stepAtTouchStart=0,O(o,w,i,c,p,i.style,h)):i.step===1?(i._stepAtTouchStart=1,O(o,w,i,c,p,i.style,i.pane)):(i._stepAtTouchStart=2,O(o,w,i,c,p,i.style,i.pane)):et(w)?i.step===0?(i.x1=c,i.y1=p,i.pane=h,i.step=1,i._stepAtTouchStart=0,O(o,w,i,c,p,i.style,h)):(i._stepAtTouchStart=1,O(o,w,i,c,p,i.style,i.pane)):j(w)?(i.pane=h,O(o,w,i,c,p,i.style,h)):(i.pane=h,V(o,w,i,c,p,i.style),t.finishDrawing());o.set_crosshair(n,r),s.onDirty(),s.onCrosshairMove?.(n,r,d)}return}let f=o.hover_hit_test(n,r),_=f[0],m=f[1],u=f[2];if(A(_)&&!t.drawingMode&&m>0){if(u>=0){t.isDraggingAnchor=!0,t.dragAnchorIdx=u,t.dragAnchorPane=H(_);return}if(f[3]===m){t.isDraggingDrawing=!0,t.dragDrawingPane=H(_);let{wx:h,wy:c}=M(o,n,r,t.dragDrawingPane);t.dragDrawingLastWx=h,t.dragDrawingLastWy=c;return}}t.isDragging=!0,t.isCrosshairMode=!1,t.lastX=n,t.lastY=r,t.dragZone=_,clearTimeout(t.longPressTimer),t.longPressTimer=setTimeout(()=>{t.isDragging&&!t.touchMoved&&(t.isCrosshairMode=!0,o.set_crosshair(n,r),s.onDirty(),s.onCrosshairMove?.(n,r,t.dragZone),s.onVrvpHover?.(n,r))},300),A(t.dragZone)&&(t.liqPinSx=n,t.liqPinSy=r,t.liqPinTimer&&clearTimeout(t.liqPinTimer),t.liqPinTimer=setTimeout(()=>{t.liqPinTimer=null,t.touchMoved||s.onLiqAnnotationPin?.(t.liqPinSx,t.liqPinSy)},700))}}},{passive:!1}),e.addEventListener("touchmove",l=>{if(t.disposed)return;l.preventDefault();let a=e.getBoundingClientRect();if(t.isDraggingAnchor&&l.touches.length===1){let r=l.touches[0].clientX-a.left,i=l.touches[0].clientY-a.top,{wx:f,wy:_}=M(o,r,i,t.dragAnchorPane);o.update_drawing_anchor(t.dragAnchorIdx,f,_),o.set_crosshair(r,i),s.onDirty();return}if(t.isDraggingDrawing&&l.touches.length===1){let r=l.touches[0].clientX-a.left,i=l.touches[0].clientY-a.top;t.touchMoved=!0;let{wx:f,wy:_}=M(o,r,i,t.dragDrawingPane),m=f-t.dragDrawingLastWx,u=_-t.dragDrawingLastWy;o.move_drawing(m,u),t.dragDrawingLastWx=f,t.dragDrawingLastWy=_,o.set_crosshair(r,i),s.onDirty();return}let n=t.drawingMode;if(t.isBrushing&&n&&l.touches.length===1){let r=l.touches[0].clientX-a.left,i=l.touches[0].clientY-a.top,f=n.pane||0,{wx:_,wy:m}=M(o,r,i,f);o.add_brush_point(_,m),o.set_crosshair(r,i),s.onDirty(),t.touchMoved=!0;return}if(n&&W(n.tool)&&n.pathStarted&&l.touches.length===1){let r=l.touches[0].clientX-a.left,i=l.touches[0].clientY-a.top,f=n.pane||0,{wx:_,wy:m}=M(o,r,i,f);o.set_elliott_manual_cursor(_,m),o.set_crosshair(r,i),s.onDirty(),t.touchMoved=!0;return}if(n&&q(n.tool)&&n.pathStarted&&l.touches.length===1){let r=l.touches[0].clientX-a.left,i=l.touches[0].clientY-a.top,f=n.pane||0,{wx:_,wy:m}=M(o,r,i,f);o.set_path_cursor(_,m),o.set_crosshair(r,i),s.onDirty(),t.touchMoved=!0;return}if(n&&n.step>0&&l.touches.length===1){let r=l.touches[0].clientX-a.left,i=l.touches[0].clientY-a.top;!t.touchMoved&&(Math.abs(r-t.touchStartX)>10||Math.abs(i-t.touchStartY)>10)&&(t.touchMoved=!0);let f=n.pane||0,{wx:_,wy:m}=M(o,r,i,f);O(o,n.tool,n,_,m,n.style,f),o.set_crosshair(r,i);let u=o.hit_zone(r,i);s.onDirty(),s.onCrosshairMove?.(r,i,u);return}if(n&&j(n.tool)&&l.touches.length===1){let r=l.touches[0].clientX-a.left,i=l.touches[0].clientY-a.top,f=o.hit_zone(r,i),_=H(f),{wx:m,wy:u}=M(o,r,i,_);O(o,n.tool,n,m,u,n.style,_),o.set_crosshair(r,i),s.onDirty(),s.onCrosshairMove?.(r,i,f);return}if(l.touches.length===2){t.velSamples=[];let r=l.touches[1].clientX-l.touches[0].clientX,i=l.touches[1].clientY-l.touches[0].clientY,f=Math.sqrt(r*r+i*i),_=t.lastTouchDist/f,m=(l.touches[0].clientX+l.touches[1].clientX)/2-a.left,u=(l.touches[0].clientY+l.touches[1].clientY)/2-a.top;t.dragZone===3?o.zoom_y(u,_):t.dragZone===2?o.zoom_x(m,_):(o.zoom(m,u,_),o.pan(m-t.lastX,u-t.lastY)),t.lastTouchDist=f,t.lastX=m,t.lastY=u,s.onDirty()}else if(l.touches.length===1&&t.isDragging){let r=l.touches[0].clientX-a.left,i=l.touches[0].clientY-a.top,f=r-t.lastX,_=i-t.lastY;!t.touchMoved&&(Math.abs(r-t.touchStartX)>10||Math.abs(i-t.touchStartY)>10)&&(t.touchMoved=!0,t.isCrosshairMode||clearTimeout(t.longPressTimer),t.liqPinTimer&&(clearTimeout(t.liqPinTimer),t.liqPinTimer=null)),t.isCrosshairMode?(o.set_crosshair(r,i),s.onDirty(),s.onCrosshairMove?.(r,i,t.dragZone),s.onVrvpHover?.(r,i)):(t.lastX=r,t.lastY=i,t.recordVelocity(f,_),t.dragZone===2?o.pan_x(f):t.dragZone===3?o.pan_y(_):o.pan(f,_),s.onDirty())}},{passive:!1}),e.addEventListener("touchend",l=>{if(t.disposed)return;if(clearTimeout(t.longPressTimer),t.liqPinTimer&&(clearTimeout(t.liqPinTimer),t.liqPinTimer=null),t.isDraggingAnchor){t.isDraggingAnchor=!1,t.dragAnchorIdx=-1,o.hide_crosshair(),s.onDirty(),s.onCrosshairHide?.();return}if(t.isDraggingDrawing){if(t.isDraggingDrawing=!1,o.hide_crosshair(),s.onDirty(),s.onCrosshairHide?.(),!t.touchMoved){let n=o.get_selected_drawing();if(n>0){let r=e.getBoundingClientRect();s.onDrawingDblClick?.(n,t.touchStartX,t.touchStartY,t.touchStartX+r.left,t.touchStartY+r.top)}}return}if(t.isBrushing){t.isBrushing=!1,o.finish_brush(),t.finishDrawing(),s.onDirty(),s.onCrosshairHide?.();return}let a=t.drawingMode;if(a&&W(a.tool)&&a.pathStarted){let n=Date.now(),r=t.touchStartX-(t._pathLastTapX||0),i=t.touchStartY-(t._pathLastTapY||0),f=Math.sqrt(r*r+i*i);n-(t._pathLastTapTime||0)<350&&f<30?(o.finish_elliott_manual(),t.finishDrawing(),t._pathLastTapTime=0):(t._pathLastTapTime=n,t._pathLastTapX=t.touchStartX,t._pathLastTapY=t.touchStartY),t.isDragging=!1,t.lastTouchDist=0,s.onDirty();return}if(a&&q(a.tool)&&a.pathStarted){let n=Date.now(),r=t.touchStartX-(t._pathLastTapX||0),i=t.touchStartY-(t._pathLastTapY||0),f=Math.sqrt(r*r+i*i);n-(t._pathLastTapTime||0)<350&&f<30?(o.finish_path(),t.finishDrawing(),t._pathLastTapTime=0):(t._pathLastTapTime=n,t._pathLastTapX=t.touchStartX,t._pathLastTapY=t.touchStartY),t.isDragging=!1,t.lastTouchDist=0,s.onDirty();return}if(a&&rt(a.tool)){let n=a._stepAtTouchStart;if(a.step===1&&(n===1||t.touchMoved)){let r=e.getBoundingClientRect(),i=l.changedTouches?.[0];if(i){let f=i.clientX-r.left,_=i.clientY-r.top,m=a.pane||0,{wx:u,wy:d}=M(o,f,_,m);a.x2=u,a.y2=d,a.step=2,o.clear_drawing_preview()}}else if(a.step===2&&(n===2||t.touchMoved)){let r=e.getBoundingClientRect(),i=l.changedTouches?.[0];if(i){let f=i.clientX-r.left,_=i.clientY-r.top,m=a.pane||0,{wx:u,wy:d}=M(o,f,_,m),h=X[a.tool];h&&h.previewFn==="fib_ext"?o.clear_fib_ext_preview():o.clear_channel_preview(),V(o,a.tool,a,u,d,a.style),t.finishDrawing()}}t.isDragging=!1,t.lastTouchDist=0,t.drawingMode||(o.hide_crosshair(),s.onCrosshairHide?.()),s.onDirty();return}if(a&&a.step===1&&et(a.tool)){if(a._stepAtTouchStart===1||t.touchMoved){let r=e.getBoundingClientRect(),i=l.changedTouches?.[0];if(i){let f=i.clientX-r.left,_=i.clientY-r.top,m=a.pane||0,{wx:u,wy:d}=M(o,f,_,m);V(o,a.tool,a,u,d,a.style),t.finishDrawing()}}t.isDragging=!1,t.lastTouchDist=0,t.drawingMode||(o.hide_crosshair(),s.onCrosshairHide?.()),s.onDirty();return}if(a&&j(a.tool)){let n=e.getBoundingClientRect(),r=l.changedTouches?.[0];if(r){let i=r.clientX-n.left,f=r.clientY-n.top,_=o.hit_zone(i,f),m=A(_)?H(_):a.pane||0,{wx:u,wy:d}=M(o,i,f,m),h=a.tool;o.clear_drawing_preview();let c=V(o,h,a,u,d,a.style);t.finishDrawing(),h==="textnote"&&c>0&&(o.select_drawing(c),s.onDrawingSelected?.(c),s.onDrawingDblClick?.(c,i,f,i+n.left,f+n.top))}t.isDragging=!1,t.lastTouchDist=0,o.hide_crosshair(),s.onCrosshairHide?.(),s.onDirty();return}if(!t.touchMoved&&!t.drawingMode&&t.isDragging){let n=Date.now(),r=t.touchStartX-t.lastTapX,i=t.touchStartY-t.lastTapY,f=Math.sqrt(r*r+i*i),_=n-t.lastTapTime<350&&f<30,m=o.hover_hit_test(t.touchStartX,t.touchStartY),u=m[0],d=m[1],h=m[3],c=m[4];if(A(u))if(h>0){o.deselect_marker(),s.onMarkerSelected?.(0),o.select_drawing(h);let p=e.getBoundingClientRect(),w=t.touchStartX+p.left,S=t.touchStartY+p.top;s.onDrawingSelected?.(h,w,S),(d<=0||d===h)&&s.onDrawingDblClick?.(h,t.touchStartX,t.touchStartY,w,S),s.onDirty()}else c>0?(o.deselect_drawing(),s.onDrawingSelected?.(0),o.select_marker(c),s.onMarkerSelected?.(c),s.onDirty()):(d>0&&(o.deselect_drawing(),s.onDrawingSelected?.(0),s.onDirty()),o.get_selected_marker()>0&&(o.deselect_marker(),s.onMarkerSelected?.(0),s.onDirty()));t.lastTapTime=n,t.lastTapX=t.touchStartX,t.lastTapY=t.touchStartY}t.touchMoved&&!t.isCrosshairMode&&!t.drawingMode&&t.startMomentum(t.dragZone),t.isDragging=!1,t.isCrosshairMode=!1,t.lastTouchDist=0,(!t.drawingMode||t.drawingMode.step===0)&&(o.hide_crosshair(),s.onCrosshairHide?.()),s.onDirty(),s.onVrvpHover?.(null,null)})}function gt(e,o,s){let t={disposed:!1,isDragging:!1,dragZone:0,lastX:0,lastY:0,lastTouchDist:0,isResizingRsi:!1,isResizingOi:!1,isResizingFr:!1,isResizingCvd:!1,resizeStartY:0,resizeStartRatio:0,lastClickTime:0,isDraggingAnchor:!1,dragAnchorIdx:-1,dragAnchorPane:0,isBrushing:!1,isDraggingDrawing:!1,dragDrawingPane:0,dragDrawingLastWx:0,dragDrawingLastWy:0,touchStartX:0,touchStartY:0,touchMoved:!1,longPressTimer:null,isCrosshairMode:!1,liqPinTimer:null,liqPinSx:0,liqPinSy:0,velSamples:[],momentumRaf:null,momentumVx:0,momentumVy:0,momentumZone:0,lastTapTime:0,lastTapX:0,lastTapY:0,drawingMode:null},l=.92,a=.5,n=80;t.recordVelocity=function(_,m){let u=performance.now();for(t.velSamples.push({dx:_,dy:m,t:u});t.velSamples.length>0&&u-t.velSamples[0].t>n;)t.velSamples.shift()};function r(){if(t.velSamples.length<2)return{vx:0,vy:0};let _=t.velSamples[0],u=t.velSamples[t.velSamples.length-1].t-_.t;if(u<5)return{vx:0,vy:0};let d=0,h=0;for(let p of t.velSamples)d+=p.dx,h+=p.dy;let c=16.67;return{vx:d/u*c,vy:h/u*c}}t.cancelMomentum=function(){t.momentumRaf&&(cancelAnimationFrame(t.momentumRaf),t.momentumRaf=null),t.velSamples=[]},t.startMomentum=function(_){let{vx:m,vy:u}=r();if(t.velSamples=[],Math.abs(m)<a&&Math.abs(u)<a)return;t.momentumVx=m,t.momentumVy=u,t.momentumZone=_;function d(){if(t.momentumVx*=l,t.momentumVy*=l,Math.abs(t.momentumVx)<a&&Math.abs(t.momentumVy)<a){t.momentumRaf=null;return}t.momentumZone===2?o.pan_x(t.momentumVx):t.momentumZone===3?o.pan_y(t.momentumVy):o.pan(t.momentumVx,t.momentumVy),s.onDirty(),t.momentumRaf=requestAnimationFrame(d)}t.momentumRaf=requestAnimationFrame(d)};let i={setMode(_,m){_?(t.drawingMode={tool:_,style:m,step:0,x1:0,y1:0},e.style.cursor="crosshair"):(t.drawingMode?.pathStarted&&o.finish_path(),t.drawingMode=null,o.clear_drawing_preview(),e.style.cursor="crosshair"),s.onDirty()},getMode(){return t.drawingMode}};s.drawingApi?.(i),t.finishDrawing=function(){o.clear_drawing_preview(),s.onDrawingComplete?.(),t.drawingMode=null,e.style.cursor="crosshair"},Ft(e,o,s,t),Rt(e,o,s,t);let f=_=>{let m=document.activeElement?.tagName,u=m==="INPUT"||m==="TEXTAREA"||document.activeElement?.isContentEditable;if((_.key==="Delete"||_.key==="Backspace")&&!t.drawingMode&&!u){let h=o.get_selected_drawing();if(h>0){o.remove_drawing(h),s.onDrawingSelected?.(0),s.onDirty();return}let c=o.get_selected_marker();if(c>0){o.remove_marker(c),s.onMarkerSelected?.(0),s.onDirty();return}}if(_.key==="Escape"&&!t.drawingMode){if(o.get_selected_drawing()>0){o.deselect_drawing(),s.onDrawingSelected?.(0),s.onDirty();return}if(o.get_selected_marker()>0){o.deselect_marker(),s.onMarkerSelected?.(0),s.onDirty();return}}if(_.key==="Escape"&&t.drawingMode){if(t.drawingMode.pathStarted){t.drawingMode.tool==="elliott"?o.finish_elliott_manual():o.finish_path(),t.finishDrawing(),s.onDirty();return}o.clear_drawing_preview(),t.drawingMode=null,e.style.cursor="crosshair",s.onDrawingCancel?.(),s.onDirty();return}let d=20;switch(_.key){case"+":case"=":o.zoom(e.width/2,e.height/2,.9);break;case"-":o.zoom(e.width/2,e.height/2,1.1);break;case"ArrowLeft":o.pan_x(d);break;case"ArrowRight":o.pan_x(-d);break;case"ArrowUp":o.pan_y(-d);break;case"ArrowDown":o.pan_y(d);break;case"r":case"R":o.auto_scale_y();break;default:return}s.onDirty()};return window.addEventListener("keydown",f),()=>{t.disposed=!0,t.cancelMomentum(),window.removeEventListener("keydown",f)}}function yt(e,o,s){return{enableRsi(){e.enable_rsi(),o()},disableRsi(){e.disable_rsi(),o()},setRsiPeriod(t){e.set_rsi_period(t),o()},isRsiEnabled(){return e.is_rsi_enabled()},setRsiShowEma(t){e.set_rsi_show_ema(t),o()},setRsiShowWma(t){e.set_rsi_show_wma(t),o()},setRsiShowSignals(t){e.set_rsi_show_signals(t),o()},setRsiShowDivergence(t){e.set_rsi_show_divergence(t),o()},setRsiShowTraps(t){e.set_rsi_show_traps(t),o()},setRsiSmoothing(t){e.set_rsi_smoothing(t),o()},setRsiRatio(t){e.set_rsi_ratio(t),o()},getRsiRatio(){return e.get_rsi_ratio()},enableForexSignals(){e.enable_forex_signals(),o()},disableForexSignals(){e.disable_forex_signals(),o()},isForexSignalsEnabled(){return e.is_forex_signals_enabled()},setForexSignalsSetup(t){e.set_forex_signals_setup(t),o()},setForexSignalsMode(t){e.set_forex_signals_mode(t),o()},setForexSignalsShowStats(t){e.set_forex_signals_show_stats(t),o()},getForexSignalsCount(){return e.get_forex_signals_count()},enableOi(){s()||(e.enable_oi(),o())},disableOi(){s()||(e.disable_oi(),o())},isOiEnabled(){if(s())return!1;try{return e.is_oi_enabled()}catch{return!1}},setOiData(t){s()||(e.set_oi_data(t),o())},setOiDataTs(t,l){s()||(e.set_oi_data_ts(t,l),o())},setOiShowOnChart(t){s()||(e.set_oi_show_on_chart(t),o())},setOiDisplayMode(t){s()||(e.set_oi_display_mode(t),o())},setOiRatio(t){s()||(e.set_oi_ratio(t),o())},getOiRatio(){if(s())return .2;try{return e.get_oi_ratio()}catch{return .2}},enableFundingRate(){s()||(e.enable_funding_rate(),o())},disableFundingRate(){s()||(e.disable_funding_rate(),o())},isFundingRateEnabled(){if(s())return!1;try{return e.is_funding_rate_enabled()}catch{return!1}},setFrBinanceData(t,l){s()||(e.set_fr_binance_data(t,l),o())},setFrAggData(t,l){s()||(e.set_fr_agg_data(t,l),o())},setFrShowAgg(t){s()||(e.set_fr_show_agg(t),o())},setFrShowSma(t){s()||(e.set_fr_show_sma(t),o())},enableCvd(){s()||(e.enable_cvd(),o())},disableCvd(){s()||(e.disable_cvd(),o())},isCvdEnabled(){if(s())return!1;try{return e.is_cvd_enabled()}catch{return!1}},setCvdData(t,l){s()||(e.set_cvd_data(t,l),o())},setCvdMode(t){s()||(e.set_cvd_mode(t),o())},getCvdMode(){if(s())return 0;try{return e.get_cvd_mode()}catch{return 0}},setCvdShowDelta(t){s()||(e.set_cvd_show_delta(t),o())},getCvdShowDelta(){if(s())return!0;try{return e.get_cvd_show_delta()}catch{return!0}},enableLargeTrades(){s()||(e.enable_large_trades(),o())},disableLargeTrades(){s()||(e.disable_large_trades(),o())},isLargeTradesEnabled(){if(s())return!1;try{return e.is_large_trades_enabled()}catch{return!1}},setLargeTradesData(t){s()||(e.set_large_trades_data(t),o())},pushLargeTrade(t,l,a,n){s()||(e.push_large_trade(t,l,a,n),o())},clearLargeTrades(){s()||(e.clear_large_trades(),o())},setLtVolumeFilter(t,l){s()||(e.set_lt_volume_filter(t,l),o())},setLtBubbleScale(t){s()||(e.set_lt_bubble_scale(t),o())},getLtDataMinVol(){return s()?0:e.get_lt_data_min_vol()},getLtDataMaxVol(){return s()?0:e.get_lt_data_max_vol()},ltHitTest(t,l){if(s())return"";try{return e.lt_hit_test(t,l)}catch{return""}},enableVrvp(){s()||(e.enable_vrvp(),o())},disableVrvp(){s()||(e.disable_vrvp(),o())},isVrvpEnabled(){if(s())return!1;try{return e.is_vrvp_enabled()}catch{return!1}},setVrvpPocLine(t){s()||(e.set_vrvp_poc_line(t),o())},vrvpHitTest(t,l){if(s())return"";try{return e.vrvp_hit_test(t,l)}catch{return""}},enableTpo(){s()||(e.enable_tpo(),o())},disableTpo(){s()||(e.disable_tpo(),o())},isTpoEnabled(){if(s())return!1;try{return e.is_tpo_enabled()}catch{return!1}},setTpoPocLine(t){s()||(e.set_tpo_poc_line(t),o())},setTpoVaLines(t){s()||(e.set_tpo_va_lines(t),o())},setTpoIb(t){s()||(e.set_tpo_ib(t),o())},setTpoSinglePrints(t){s()||(e.set_tpo_single_prints(t),o())},setTpoPeriod(t){s()||(e.set_tpo_period(t),o())},getTpoPeriod(){if(s())return 1440;try{return e.get_tpo_period()}catch{return 1440}},setTpoNakedPoc(t){s()||(e.set_tpo_naked_poc(t),o())},setTpoProfileShape(t){s()||(e.set_tpo_profile_shape(t),o())},setTpoIbMinutes(t){s()||(e.set_tpo_ib_minutes(t),o())},setTpoLetterMinutes(t){s()||(e.set_tpo_letter_minutes(t),o())},setTpoSignals(t){s()||(e.set_tpo_signals(t),o())},isTpoSignals(){if(s())return!1;try{return e.is_tpo_signals()}catch{return!1}},enableLiqHeatmap(){s()||(e.enable_liq_heatmap(),o())},disableLiqHeatmap(){s()||(e.disable_liq_heatmap(),o())},isLiqHeatmapEnabled(){if(s())return!1;try{return e.is_liq_heatmap_enabled()}catch{return!1}},setLiqHeatmapRange(t,l){s()||(e.set_liq_heatmap_range(t,l),o())},getLiqHeatmapMin(){if(s())return 0;try{return e.get_liq_heatmap_min()}catch{return 0}},getLiqHeatmapMax(){if(s())return 1;try{return e.get_liq_heatmap_max()}catch{return 1}},getLiqHeatmapSegMax(){if(s())return 0;try{return e.get_liq_heatmap_seg_max()}catch{return 0}},setLiqHeatmapProfile(t){s()||(e.set_liq_heatmap_profile(t),o())},isLiqHeatmapProfile(){if(s())return!0;try{return e.is_liq_heatmap_profile()}catch{return!0}},setLiqHeatmapCellHeight(t){s()||(e.set_liq_heatmap_cell_height(t),o())},getLiqHeatmapCellHeight(){if(s())return 1;try{return e.get_liq_heatmap_cell_height()}catch{return 1}},setLiqHeatmapPredictions(t){s()||(e.set_liq_heatmap_predictions(t),o())},setLiqHeatmapFilledPct(t){s()||(e.set_liq_heatmap_filled_pct(t),o())},getLiqHeatmapFilledPct(){if(s())return .85;try{return e.get_liq_heatmap_filled_pct()}catch{return .85}},liqHeatmapHitTest(t,l){if(s())return"";try{return e.liq_heatmap_hit_test(t,l)}catch{return""}},liqZoneHitTest(t,l){if(s())return"";try{return e.liq_zone_hit_test(t,l)}catch{return""}},enableSmartRanges(){s()||(e.enable_smart_ranges(),o())},disableSmartRanges(){s()||(e.disable_smart_ranges(),o())},isSmartRangesEnabled(){if(s())return!1;try{return e.is_smart_ranges_enabled()}catch{return!1}},setSrTextSize(t){s()||(e.set_sr_text_size(t),o())},setSrShowOb(t){s()||(e.set_sr_show_ob(t),o())},setSrObLast(t){s()||(e.set_sr_ob_last(t),o())},setSrShowObActivity(t){s()||(e.set_sr_show_ob_activity(t),o())},setSrShowBreakers(t){s()||(e.set_sr_show_breakers(t),o())},setSrMitigation(t){s()||(e.set_sr_mitigation(t),o())},setSrShowMetrics(t){s()||(e.set_sr_show_metrics(t),o())},setSrShowHtfOb(t){s()||(e.set_sr_show_htf_ob(t),o())},setSrHtfMinutes(t){s()||(e.set_sr_htf_minutes(t),o())},setSrShowFvg(t){s()||(e.set_sr_show_fvg(t),o())},setSrFvgTheme(t){s()||(e.set_sr_fvg_theme(t),o())},setSrFvgMitigation(t){s()||(e.set_sr_fvg_mitigation(t),o())},setSrFvgHtf(t){s()||(e.set_sr_fvg_htf(t),o())},setSrFvgExtend(t){s()||(e.set_sr_fvg_extend(t),o())},setSrShowObSignals(t){s()||(e.set_sr_show_ob_signals(t),o())},setSrShowPredict(t){s()||(e.set_sr_show_predict(t),o())},setSrShowFvgSignals(t){s()||(e.set_sr_show_fvg_signals(t),o())},setSrShowSmartRev(t){s()||(e.set_sr_show_smart_rev(t),o())},setSrSmartRevHtf(t){s()||(e.set_sr_smart_rev_htf(t),o())},setSrStatsType(t){s()||(e.set_sr_stats_type(t),o())},setSrStatsPosition(t){s()||(e.set_sr_stats_position(t),o())},getSrSignalsCount(){if(s())return 0;try{return e.get_sr_signals_count()}catch{return 0}},enableEmaStructure(){s()||(e.enable_ema_structure(),o())},disableEmaStructure(){s()||(e.disable_ema_structure(),o())},isEmaStructureEnabled(){if(s())return!1;try{return e.is_ema_structure_enabled()}catch{return!1}},setEsEma1Len(t){s()||(e.set_es_ema1_len(t),o())},setEsEma2Len(t){s()||(e.set_es_ema2_len(t),o())},setEsWmaLen(t){s()||(e.set_es_wma_len(t),o())},setEsShowEma1(t){s()||(e.set_es_show_ema1(t),o())},setEsShowEma2(t){s()||(e.set_es_show_ema2(t),o())},setEsShowWma(t){s()||(e.set_es_show_wma(t),o())},setEsSwingLen(t){s()||(e.set_es_swing_len(t),o())},setEsShowBos(t){s()||(e.set_es_show_bos(t),o())},enableLiveSignals(){s()||(e.enable_live_signals(),o())},disableLiveSignals(){s()||(e.disable_live_signals(),o())},isLiveSignalsEnabled(){if(s())return!1;try{return e.is_live_signals_enabled()}catch{return!1}},setLiveSignalsData(t){s()||(e.set_live_signals_data(new Float64Array(t)),o())},clearLiveSignals(){s()||(e.clear_live_signals(),o())},setLiveSignalsLeverage(t){s()||(e.set_live_signals_leverage(t),o())},getLiveSignalsLeverage(){if(s())return 10;try{return e.get_live_signals_leverage()}catch{return 10}},setLiveSignalsTrial(t){s()||(e.set_live_signals_trial(t),o())},setLiveSignalsShowEntry(t){s()||(e.set_live_signals_show_entry(t),o())},setLiveSignalsShowTpSl(t){s()||(e.set_live_signals_show_tp_sl(t),o())},setLiveSignalsShowMaxProfit(t){s()||(e.set_live_signals_show_max_profit(t),o())},setLiveSignalsShowLabels(t){s()||(e.set_live_signals_show_labels(t),o())},setLiveSignalsShowZones(t){s()||(e.set_live_signals_show_zones(t),o())},setLiveSignalsTextSize(t){s()||(e.set_live_signals_text_size(t),o())},setLiveSignalsPipValue(t){s()||(e.set_live_signals_pip_value(t),o())},setLiveSignalsLoading(t){s()||(e.set_live_signals_loading(t),o())},getLiveSignalsCount(){if(s())return 0;try{return e.get_live_signals_count()}catch{return 0}},enableVolume(){e.enable_volume(),o()},disableVolume(){e.disable_volume(),o()},isVolumeEnabled(){return e.is_volume_enabled()},setVolumeMaPeriod(t){e.set_volume_ma_period(t),o()},setVolumeShowMa(t){e.set_volume_show_ma(t),o()},setVolumeShowSignals(t){e.set_volume_show_signals(t),o()},setVolumeColorMode(t){e.set_volume_color_mode(t),o()},getVolumeMaPeriod(){return e.get_volume_ma_period()},getVolumeShowMa(){return e.get_volume_show_ma()},getVolumeShowSignals(){return e.get_volume_show_signals()},getVolumeColorMode(){return e.get_volume_color_mode()}}}function At(e,o,s){return{addMarker(t,l,a){e.add_marker(t,l,a),o()},clearMarkers(){e.clear_markers(),o()},hitTestMarker(t,l){return e.hit_test_marker(t,l)},selectMarker(t){e.select_marker(t),o()},deselectMarker(){e.deselect_marker(),o()},getSelectedMarker(){return e.get_selected_marker()},removeMarker(t){e.remove_marker(t),o()},deleteSelectedMarker(){let t=e.get_selected_marker();return t>0&&(e.remove_marker(t),o()),t},addTrendline(t,l,a,n,r,i,f,_,m,u=0){let d=e.add_trendline(t,l,a,n,r,i,f,_,m,u);return o(),d},addHorizontalLine(t,l,a,n,r,i,f,_=0){let m=e.add_horizontal_line(t,l,a,n,r,i,f,_);return o(),m},addArrow(t,l,a,n,r,i,f,_,m,u=0){let d=e.add_arrow(t,l,a,n,r,i,f,_,m,u);return o(),d},addFibRetracement(t,l,a,n,r,i,f,_,m,u=0){let d=e.add_fib_retracement(t,l,a,n,r,i,f,_,m,u);return o(),d},addFibExtension(t,l,a,n,r,i,f,_,m,u,d,h=0){let c=e.add_fib_extension(t,l,a,n,r,i,f,_,m,u,d,h);return o(),c},addLongPosition(t,l,a,n,r,i,f,_,m,u=0){let d=e.add_long_position(t,l,a,n,r,i,f,_,m,u);return o(),d},addShortPosition(t,l,a,n,r,i,f,_,m,u=0){let d=e.add_short_position(t,l,a,n,r,i,f,_,m,u);return o(),d},addAnchoredVwap(t,l,a,n,r,i,f=0){let _=e.add_anchored_vwap(t,l,a,n,r,i,f);return o(),_},addPriceLabel(t,l,a,n,r,i,f=0){let _=e.add_price_label(t,l,a,n,r,i,f);return o(),_},addElliottImpulse(t,l,a,n,r,i,f=0){let _=e.add_elliott_impulse(t,l,a,n,r,i,f);return o(),_},setDrawingFontSize(t,l){e.set_drawing_font_size(t,l),o()},getDrawingFontSize(t){return e.get_drawing_font_size(t)},setDrawingText(t,l){e.set_drawing_text(t,l),o()},getDrawingText(t){return e.get_drawing_text(t)},setDrawingStyle(t,l,a,n,r){e.set_drawing_style(t,l,a,n,r),o()},getDrawingColor(t){let l=e.get_drawing_color(t);return l?{r:l>>>24&255,g:l>>>16&255,b:l>>>8&255,lineWidth:(l&255)/10}:null},getDrawingDashed(t){try{return e.get_drawing_dashed(t)}catch{return!1}},setDrawingDashed(t,l){e.set_drawing_dashed(t,l),o()},getDrawingHideLabel(t){try{return e.get_drawing_hide_label(t)}catch{return!1}},setDrawingHideLabel(t,l){e.set_drawing_hide_label(t,l),o()},getDrawingKindId(t){try{return e.get_drawing_kind_id(t)}catch{return 255}},removeDrawing(t){e.remove_drawing(t),o()},clearDrawings(){e.clear_drawings(),o()},drawingCount(){return e.drawing_count()},setDrawingPreview(t,l,a,n,r,i,f,_,m,u,d=0){e.set_drawing_preview(t,l,a,n,r,i,f,_,m,u,d),o()},clearDrawingPreview(){e.clear_drawing_preview(),o()},cancelBrush(){e.cancel_brush(),o()},selectDrawing(t){e.select_drawing(t),o()},deselectDrawing(){e.deselect_drawing(),o()},getSelectedDrawing(){return e.get_selected_drawing()},deleteSelectedDrawing(){let t=e.get_selected_drawing();return t>0&&(e.remove_drawing(t),o()),t},exportDrawingsJson(){try{return e.export_drawings_json()}catch{return"[]"}},importDrawingsJson(t){try{e.import_drawings_json(t),o()}catch(l){console.warn("[bridge] importDrawingsJson failed",l)}},screenToWorld(t,l){return{x:e.screen_to_world_x(t),y:e.screen_to_world_y(l)}},worldToScreen(t,l){try{return{x:e.world_to_screen_x(t),y:e.world_to_screen_y(l)}}catch{return null}}}}function Yt(e,o,s){return{setKlines(t,l,a,n,r,i){e.set_klines(new Float64Array(t),new Float64Array(l),new Float64Array(a),new Float64Array(n),new Float64Array(r),new Float64Array(i)),o()},setRealTimestamps(t){e.set_real_timestamps(new Float64Array(t)),o()},appendRealTimestamp(t){e.append_real_timestamp(t)},prependKlines(t,l,a,n,r,i){e.prepend_klines(new Float64Array(t),new Float64Array(l),new Float64Array(a),new Float64Array(n),new Float64Array(r),new Float64Array(i)),o()},appendKline(t,l,a,n,r,i){e.append_kline(t,l,a,n,r,i),o()},updateLastKline(t,l,a,n,r,i){e.update_last_kline(t,l,a,n,r,i),o()},popLastKline(){let t=e.pop_last_kline();return t&&o(),t},getLastClose(){try{return e.get_last_close()}catch{return 0}},getKlineCount(){if(s())return 0;try{return e.kline_count()}catch{return 0}},getKlineTimestamps(){if(s())return null;try{return e.kline_timestamps()}catch{return null}},getKlineOpens(){if(s())return null;try{return e.kline_opens()}catch{return null}},getKlineHighs(){if(s())return null;try{return e.kline_highs()}catch{return null}},getKlineLows(){if(s())return null;try{return e.kline_lows()}catch{return null}},getKlineCloses(){if(s())return null;try{return e.kline_closes()}catch{return null}},getKlineVolumes(){if(s())return null;try{return e.kline_volumes()}catch{return null}},setHeatmap(t,l,a,n,r,i,f){e.set_heatmap(new Float64Array(t),l,a,n,r,i,f),o()},appendHeatmapColumn(t,l,a,n){e.append_heatmap_column(new Float64Array(t),l,a,n),o()},updateLastHeatmapColumn(t,l,a){e.update_last_heatmap_column(new Float64Array(t),l,a),o()},getHeatmapLastTimestamp(){try{return e.get_heatmap_last_timestamp()}catch{return 0}},getHeatmapXStep(){try{return e.get_heatmap_x_step()}catch{return 0}},updateHeatmapColumnAt(t,l,a,n){e.update_heatmap_column_at(new Float64Array(t),l,a,n),o()},setHeatmapRange(t,l){e.set_heatmap_range(t,l),o()},getHeatmapDataRange(){try{return{min:e.get_heatmap_data_min(),max:e.get_heatmap_data_max()}}catch{return{min:0,max:0}}},setHeatmapPrefetchRange(t){try{e.set_heatmap_prefetch_range(t)}catch{}},clearHeatmapPrefetchRange(){try{e.clear_heatmap_prefetch_range()}catch{}},getHeatmapPrefetchMax(){try{return e.get_heatmap_prefetch_max()}catch{return 0}},setChartType(t){s()||(e.set_chart_type(t),o())},getChartType(){if(s())return 0;try{return e.get_chart_type()}catch{return 0}},setFootprintTickSize(t){s()||(e.set_footprint_tick_size(t),o())},footprintEnsureLen(t){s()||e.footprint_ensure_len(t)},footprintAddTrade(t,l,a,n){s()||e.footprint_add_trade(t,l,a,n)},footprintAddTradeBatch(t){s()||!t||t.length===0||e.footprint_add_trade_batch(t instanceof Float64Array?t:new Float64Array(t))},footprintSetBar(t,l,a,n,r){s()||(e.footprint_set_bar(t,l,a,n,r),o())},footprintClear(){s()||(e.footprint_clear(),o())},footprintClearBar(t){s()||e.footprint_clear_bar(t)},footprintPrependEmpty(t){s()||e.footprint_prepend_empty(t)},footprintSetShowSignals(t){s()||(e.footprint_set_show_signals(t),o())},footprintGetShowSignals(){if(s())return!0;try{return e.footprint_get_show_signals()}catch{return!0}},footprintSignalCount(){if(s())return 0;try{return e.footprint_signal_count()}catch{return 0}},footprintSetShowProfile(t){s()||(e.footprint_set_show_profile(t),o())},footprintGetShowProfile(){if(s())return!1;try{return e.footprint_get_show_profile()}catch{return!1}},footprintProfileHitTest(t,l){if(s())return"";try{return e.footprint_profile_hit_test(t,l)}catch{return""}}}}var Gt=1;function R(e){if(typeof e!="string")return{r:255,g:255,b:255,a:153};if(e.startsWith("#")){let s=e.slice(1);if(s.length===8)return{r:parseInt(s.slice(0,2),16),g:parseInt(s.slice(2,4),16),b:parseInt(s.slice(4,6),16),a:parseInt(s.slice(6,8),16)};let t=parseInt(s.slice(0,2),16),l=parseInt(s.slice(2,4),16),a=parseInt(s.slice(4,6),16);return{r:t,g:l,b:a,a:255}}let o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\)/);return o?{r:+o[1],g:+o[2],b:+o[3],a:o[4]!==void 0?Math.round(+o[4]*255):255}:{r:255,g:255,b:255,a:153}}function St(e,o,s){let t=new Map,l=null,a=0,n=NaN;function r(){let u;try{u=e.kline_count()}catch{return l}if(u===0)return null;let d=e.kline_closes(),h=d?.[u-1]??NaN;if(l&&!(u!==a||h!==n))return l;try{let p=e.kline_timestamps(),w=e.kline_opens(),S=e.kline_highs(),T=e.kline_lows(),E=e.kline_volumes();if(!p||!d)return l;l={timestamps:Array.from(p),open:Array.from(w),high:Array.from(S),low:Array.from(T),close:Array.from(d),volume:Array.from(E),length:u},a=u,n=h;for(let Y of t.values())Y._needsCompute=!0}catch{}return l}function i(){return{seriesLine(u,d="#ffffff99",h=1.5){let c=R(d);e.custom_series_line(new Float64Array(u),c.r,c.g,c.b,c.a,h)},seriesDashedLine(u,d="#ffffff66",h=1,c=4,p=4){let w=R(d);e.custom_series_dashed_line(new Float64Array(u),w.r,w.g,w.b,w.a,h,c,p)},band(u,d,h="rgba(100,149,237,0.08)"){let c=R(h);e.custom_band(new Float64Array(u),new Float64Array(d),c.r,c.g,c.b,c.a)},hline(u,d="#ffffff66",h=1){let c=R(d);e.custom_hline(u,c.r,c.g,c.b,c.a,h)},dashedHline(u,d="#ffffff66",h=1,c=6,p=4){let w=R(d);e.custom_dashed_hline(u,w.r,w.g,w.b,w.a,h,c,p)},marker(u,d,h="#e8a04a",c=3){let p=R(h);e.custom_marker(u,d,p.r,p.g,p.b,p.a,c)},markerUp(u,d,h="#26a69a",c=5){let p=R(h);e.custom_marker_up(u,d,p.r,p.g,p.b,p.a,c)},markerDown(u,d,h="#ef5350",c=5){let p=R(h);e.custom_marker_down(u,d,p.r,p.g,p.b,p.a,c)},text(u,d,h,c="#ffffffaa",p=10,w="center"){let S=R(c),T=w==="center"?1:w==="right"?2:0;e.custom_text(u,d,h,S.r,S.g,S.b,S.a,p,T)},priceLabel(u,d,h="#ffffffaa",c=10){let p=R(h);e.custom_price_label(u,d,p.r,p.g,p.b,p.a,c)},linePx(u,d,h,c,p,w=1){let S=R(p);e.custom_line_px(u,d,h,c,S.r,S.g,S.b,S.a,w)},fillRectPx(u,d,h,c,p){let w=R(p);e.custom_fill_rect_px(u,d,h,c,w.r,w.g,w.b,w.a)},strokeRectPx(u,d,h,c,p,w=1){let S=R(p);e.custom_stroke_rect_px(u,d,h,c,S.r,S.g,S.b,S.a,w)},textPx(u,d,h,c,p=10,w="left"){let S=R(c),T=w==="center"?1:w==="right"?2:0;e.custom_text_px(u,d,h,S.r,S.g,S.b,S.a,p,T)},worldToScreenX:u=>e.world_to_screen_x(u),worldToScreenY:u=>e.world_to_screen_y(u),screenToWorldX:u=>e.screen_to_world_x(u),screenToWorldY:u=>e.screen_to_world_y(u),chartArea:()=>({x:e.chart_area_x(),y:e.chart_area_y(),w:e.chart_area_w(),h:e.chart_area_h()})}}function f(u){if(!u.compute)return;let d=r();if(d)try{u._computed=u.compute(d,u.params)||{}}catch(h){console.warn(`[CustomIndicator "${u.name}"] compute error:`,h),u._computed={}}}function _(u){if(t.size===0)return;let d=r();if(!d)return;e.custom_begin();let h=i();for(let p of t.values())if(p.enabled){p._needsCompute&&(f(p),p._needsCompute=!1);try{p.render.call(p,h,p._computed||{},d)}catch(w){console.warn(`[CustomIndicator "${p.name}"] render error:`,w)}}if(e.custom_end(),e.custom_command_count()>0){let p=e.get_custom_buffer_ptr(),w=e.get_custom_buffer_len();s(u,o,p,w)}}function m(){l=null,a=0,n=NaN;for(let u of t.values())u._needsCompute=!0}return{add(u){let d=Gt++,h={id:d,name:u.name||`Custom ${d}`,params:{...u.params},compute:u.compute||null,render:u.render,enabled:!0,_computed:{},_needsCompute:!0};return t.set(d,h),d},remove(u){t.delete(u)},updateParams(u,d){let h=t.get(u);h&&(Object.assign(h.params,d),h._needsCompute=!0)},setEnabled(u,d){let h=t.get(u);h&&(h.enabled=d)},list(){return[...t.values()].map(u=>({id:u.id,name:u.name,params:{...u.params},enabled:u.enabled}))},invalidateCompute:m,renderAll:_}}var It="trial",Jt="MRD Chart Engine \u2014 Trial",Qt="License Expired \u2014 mrd-chart.dev/pricing",Xt="__mrd_ce_t";function ut(e){if(!e||e==="trial")return jt();try{let o=JSON.parse(atob(e)),{p:s,d:t,e:l,s:a}=o;if(!s||!a)return{valid:!1,error:"Invalid license key format"};if(l>0&&Date.now()/1e3>l)return{valid:!1,expired:!0,plan:s,error:`License expired on ${new Date(l*1e3).toLocaleDateString()}`};if(t&&t!=="*"&&typeof window<"u"){let n=window.location.hostname;if(!xt(t,n))return{valid:!1,error:`License not valid for domain: ${n}`}}return{valid:!0,plan:s,domain:t,expiry:l,watermark:!1}}catch{return{valid:!1,error:"Invalid license key"}}}function jt(){let e=kt();e||(e=Math.floor(Date.now()/1e3),te(e));let o=e+14*86400,s=Date.now()/1e3,t=Math.max(0,Math.ceil((o-s)/86400));return s>o?{valid:!1,expired:!0,plan:It,error:"14-day trial has expired",daysLeft:0}:{valid:!0,plan:It,watermark:!0,daysLeft:t,trialEnd:o}}function xt(e,o){if(e==="*"||e===o)return!0;if(e.startsWith("*.")){let s=e.slice(1);return o.endsWith(s)||o===e.slice(2)}return!1}function kt(){try{let e=localStorage.getItem(Xt);return e?parseInt(e,10):null}catch{return null}}function te(e){try{localStorage.setItem(Xt,String(e))}catch{}}function Ot(e,o,s){let t=o.width,l=o.height;if(e.save(),e.setTransform(1,0,0,1,0,0),s.expired)e.fillStyle="rgba(0, 0, 0, 0.65)",e.fillRect(0,0,t,l),e.font="bold 20px Inter, system-ui, sans-serif",e.textAlign="center",e.textBaseline="middle",e.fillStyle="#ff4757",e.fillText(Qt,t/2,l/2-14),e.font="14px Inter, system-ui, sans-serif",e.fillStyle="#8b92a5",e.fillText("Purchase a license to continue using MRD Chart Engine",t/2,l/2+16);else{e.globalAlpha=.08,e.font="bold 16px Inter, system-ui, sans-serif",e.fillStyle="#ffffff",e.textAlign="center";let a=Jt,n=220;e.rotate(-.35);for(let d=-l;d<l*2;d+=n)for(let h=-t;h<t*2;h+=n)e.fillText(a,h,d);e.setTransform(1,0,0,1,0,0),e.globalAlpha=.75;let r=`TRIAL \u2014 ${s.daysLeft} day${s.daysLeft!==1?"s":""} left`;e.font="11px Inter, system-ui, sans-serif";let f=e.measureText(r).width+16,_=22,m=t-f-10,u=l-_-10;e.fillStyle="rgba(10, 124, 255, 0.85)",e.beginPath(),e.roundRect(m,u,f,_,4),e.fill(),e.fillStyle="#ffffff",e.textAlign="center",e.textBaseline="middle",e.fillText(r,m+f/2,u+_/2)}e.restore()}function ee({plan:e,domain:o="*",expiryDays:s=365}){let t=s>0?Math.floor(Date.now()/1e3)+s*86400:0,l={p:e,d:o,e:t,s:re(e,o,t)};return btoa(JSON.stringify(l))}function re(e,o,s){let t=`${e}:${o}:${s}:mrd-secret-2024`,l=0;for(let a=0;a<t.length;a++)l=(l<<5)-l+t.charCodeAt(a)|0;return l.toString(36)}var dt=null,vt=null,ot=null;async function zt(){return dt||ot||(ot=(async()=>{let e=await import("./chart_engine.js");return await e.default(),vt=e.wasm_memory(),dt=e,e})(),ot)}function oe(){!dt&&!ot&&zt().catch(()=>{})}async function se(e,o={}){let s=o.licenseKey||o.key||null,t=ut(s);if(!t.valid)if(t.expired)console.warn(`[MRD Chart Engine] ${t.error}. Get a license at https://mrd-chart.dev/pricing`);else throw new Error(`[MRD Chart Engine] ${t.error}`);t.plan==="trial"&&console.info(`[MRD Chart Engine] Trial mode \u2014 ${t.daysLeft} days remaining. Purchase: https://mrd-chart.dev/pricing`);let l=await zt(),a=window.devicePixelRatio||1,n=e.getBoundingClientRect();(n.width<1||n.height<1)&&(await new Promise(g=>{let v=new ResizeObserver(y=>{for(let Q of y)if(Q.contentRect.width>0&&Q.contentRect.height>0){v.disconnect(),g();return}});v.observe(e.parentElement||e),setTimeout(()=>{v.disconnect(),g()},2e3)}),n=e.getBoundingClientRect());let r=Math.max(n.width,100),i=Math.max(n.height,100);e.width=r*a,e.height=i*a;let f=e.getContext("2d");f.scale(a,a);let _=new l.ChartEngine(r,i),m=!0,u=null,d=!1,h=!1,c=!1,p=null,w=null,S=0,E=("ontouchstart"in window||navigator.maxTouchPoints>0)&&window.innerWidth<=1399?33:0;function Y(){if(!(!d||h||u)){if(E>0){let g=performance.now()-S;if(g<E){w||(w=setTimeout(()=>{w=null,Y()},E-g));return}}u=requestAnimationFrame(qt)}}let b=()=>{m=!0,Y()},D=()=>c,U=null,x=null,k=null,st=null,ht=null,L=null,z=null,C=null,N=0,G=null,tt=null,$=0,pt=0,J=-1,at=!1,it=!1,Ht=gt(e,_,{onDirty:b,onCrosshairMove:(g,v,y)=>{$=g,pt=v,J=y,at=!0,it=!0},onCrosshairHide:()=>{it&&(it=!1,at=!0,J=-1)},drawingApi:g=>{U=g},onDrawingComplete:()=>{x?.()},onDrawingCancel:()=>{k?.()},onDrawingSelected:(g,v,y)=>{st?.(g,v,y)},onMarkerSelected:g=>{ht?.(g)},onDrawingDblClick:(g,v,y,Q,Bt)=>{L?.(g,v,y,Q,Bt)},onVrvpHover:(g,v)=>{z?.(g,v)},onLiqAnnotationPin:(g,v)=>{tt?.(g,v)}});function Nt(){if(at){if(at=!1,!it){p&&p(null,0,0),C&&C("");return}if(p)if(J===0||J===1){let g=_.get_tooltip_data();p(g,$,pt)}else p(null,0,0);if(C){let g=performance.now();if(J===0||J===1){if(g-N>=80){N=g;try{C(_.lt_hit_test($,pt))}catch{}}}else C("")}}}function qt(){if(u=null,!(!d||h)&&(m||_.is_dirty())){m=!1,S=performance.now();let g=!1;try{if(_.render()>0){let y=_.get_command_buffer_ptr(),Q=_.get_command_buffer_len();f.save(),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,e.width,e.height),f.restore(),lt(f,vt,y,Q),g=!0}try{K.renderAll(f)}catch{}(t.watermark||t.expired)&&Ot(f,e,t)}catch{g||(m=!0)}Nt();try{G?.()}catch{}(m||_.is_dirty())&&Y()}}let Wt=yt(_,b,D),Vt=At(_,b,D),Zt=Yt(_,b,D),K=St(_,vt,lt);return{engine:_,start(){d=!0,h=!1,m=!0,Y()},stop(){d=!1,u&&(cancelAnimationFrame(u),u=null),w&&(clearTimeout(w),w=null)},resize(g){if(n=e.getBoundingClientRect(),n.width<1||n.height<1){(g||0)<8&&setTimeout(()=>this.resize((g||0)+1),250);return}a=window.devicePixelRatio||1;let v=n.width*a,y=n.height*a;e.width=v,e.height=y,f.setTransform(1,0,0,1,0,0),f.scale(a,a),_.resize(n.width,n.height),b()},setHoverPrice(g){_.set_hover_price(g),b()},clearHoverPrice(){_.clear_hover_price(),b()},hitZone(g,v){return _.hit_zone(g,v)},startDrawing(g,v){U?.setMode(g,v)},cancelDrawing(){U?.setMode(null)},onDrawingComplete(g){x=g},onDrawingCancel(g){k=g},onDrawingSelected(g){st=g},onMarkerSelected(g){ht=g},onDrawingDblClick(g){L=g},setReplayState(g,v,y){_.set_replay_state(g,v,y),b()},setReplayHovered(g){_.set_replay_hovered(g)},setReplayPreview(g){_.set_replay_preview(g),b()},setPrecision(g){_.set_price_precision(g),b()},setCandleInterval(g){_.set_candle_interval(g)},setTheme(g){let v=g==="light"?1:0;typeof _.set_theme=="function"?(_.set_theme(v),b()):console.warn("[ChartEngine] set_theme not available \u2014 reload page to load updated WASM")},getTheme(){return _.get_theme()===1?"light":"dark"},onTooltip(g){p=g},onVrvpHover(g){z=g},onLtHover(g){C=g},onPostRender(g){G=g},onLiqAnnotationPin(g){tt=g},pause(){h||(h=!0,u&&(cancelAnimationFrame(u),u=null),w&&(clearTimeout(w),w=null))},resume(){h&&(h=!1,d&&(m=!0,Y()))},get isPaused(){return h},destroy(){c=!0,d=!1,h=!1,u&&(cancelAnimationFrame(u),u=null),w&&(clearTimeout(w),w=null),Ht();try{_.free()}catch{}},addIndicator(g){let v=K.add(g);return b(),v},removeIndicator(g){K.remove(g),b()},updateIndicatorParams(g,v){K.updateParams(g,v),b()},setIndicatorEnabled(g,v){K.setEnabled(g,v),b()},listIndicators(){return K.list()},invalidateCustomIndicators(){K.invalidateCompute(),b()},get license(){return{plan:t.plan,valid:t.valid,expired:!!t.expired,watermark:!!t.watermark,daysLeft:t.daysLeft}},setLicenseKey(g){return t=ut(g),!t.valid&&!t.expired&&console.error(`[MRD Chart Engine] ${t.error}`),b(),t.valid},...Zt,...Wt,...Vt}}export{se as createChartBridge,St as createCustomIndicatorManager,lt as dispatchCommands,ee as generateLicenseKey,oe as prefetchWasm,gt as setupEvents,ut as validateLicense};
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kline-orderbook-chart",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Candlestick chart with built-in orderbook heatmap, footprint chart, and liquidation heatmap. Native high-performance engine. 60 fps, zero dependencies.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/mrd-chart-engine.mjs",
|
|
7
|
+
"module": "dist/mrd-chart-engine.mjs",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/mrd-chart-engine.mjs",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"orderbook-heatmap",
|
|
22
|
+
"kline-heatmap",
|
|
23
|
+
"candlestick-orderbook",
|
|
24
|
+
"footprint-chart",
|
|
25
|
+
"crypto-chart",
|
|
26
|
+
"trading-chart",
|
|
27
|
+
"liquidation-heatmap",
|
|
28
|
+
"volume-profile",
|
|
29
|
+
"market-depth",
|
|
30
|
+
"orderbook-depth-chart",
|
|
31
|
+
"canvas",
|
|
32
|
+
"chart",
|
|
33
|
+
"heatmap",
|
|
34
|
+
"kline-orderbook-chart",
|
|
35
|
+
"orderbook",
|
|
36
|
+
"kline",
|
|
37
|
+
"trading",
|
|
38
|
+
"crypto"
|
|
39
|
+
],
|
|
40
|
+
"author": "MRD Technologies <support@mrd-indicators.com>",
|
|
41
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
42
|
+
"homepage": "https://github.com/PhamNhinh/kline-orderbook-chart",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/PhamNhinh/kline-orderbook-chart.git"
|
|
46
|
+
},
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/PhamNhinh/kline-orderbook-chart/issues"
|
|
49
|
+
}
|
|
50
|
+
}
|