kline-orderbook-chart 0.2.20 → 1.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/CHANGELOG.md ADDED
@@ -0,0 +1,85 @@
1
+ # Changelog
2
+
3
+ All notable changes to `kline-orderbook-chart` are documented here.
4
+ This project follows [Semantic Versioning](https://semver.org/).
5
+
6
+ ---
7
+
8
+ ## 1.0.0 — Security release (breaking change)
9
+
10
+ > **All `0.x` versions are deprecated and contain a critical license-validation flaw. Please upgrade.**
11
+
12
+ ### Why this release exists
13
+
14
+ Versions `0.x` shipped a license layer based on **HMAC**, a symmetric-key
15
+ algorithm. The signing secret had to be embedded in the published bundle so
16
+ that the browser could verify keys offline — meaning anyone who installed the
17
+ package could extract the secret and self-issue an unrestricted license.
18
+ This was a fundamental design flaw, not a bug in any single line of code.
19
+
20
+ `1.0.0` replaces the entire license layer with **Ed25519** (asymmetric):
21
+
22
+ - Private key lives only on our license server.
23
+ - Public key is embedded in the bundle (and is, by design, public).
24
+ - An attacker reading the bundle can verify tokens but cannot forge them.
25
+
26
+ If you have a valid `0.x` license key, **it will not validate against
27
+ `1.0.0`** — please contact us to receive a replacement Ed25519 token.
28
+
29
+ ### Breaking changes
30
+
31
+ - **Removed export `generateLicenseKey`.**
32
+ Tokens are now issued by our backend; client-side issuance is impossible by
33
+ design. Any code that called `generateLicenseKey(...)` must be removed.
34
+
35
+ - **`createChartBridge(canvas, opts)` is fully asynchronous.**
36
+ It already returned a `Promise`, but the internal `validateLicense` step
37
+ is now `async` (uses WebCrypto). No change is needed in code that already
38
+ used `await createChartBridge(...)`.
39
+
40
+ - **`chart.setLicenseKey(token)` is now async.**
41
+ It returns a `Promise<{ valid, plan, … }>`. Callers must `await` it.
42
+
43
+ - **License key format changed.** Old keys looked like
44
+ `eyJwIjoiZW50ZXJwcmlzZSIs…` (one base64 segment).
45
+ New keys are JWS-compact: `<headerB64>.<payloadB64>.<signatureB64>` —
46
+ three segments separated by dots. Any code that pattern-matches the old
47
+ format (e.g. for storage) needs updating.
48
+
49
+ - **WebCrypto requirement.** Verification uses
50
+ `crypto.subtle.verify('Ed25519', …)`. Supported on Chrome 114+, Firefox 130+,
51
+ Safari 17+, Edge 114+, and all modern Node 19+. Older targets are not
52
+ supported by `1.0.0`.
53
+
54
+ ### Non-breaking changes
55
+
56
+ - Trial mode (`licenseKey: 'trial'` or omitted) still works — 14 days,
57
+ watermarked, multi-store integrity-sealed; same UX as before.
58
+ - All chart APIs (`setKlines`, `enableVolume`, `start`, drawings, footprint,
59
+ heatmap, custom indicators) are byte-identical to `0.2.20`.
60
+ - WASM binary is unchanged from `0.2.20`.
61
+
62
+ ### Action for existing customers
63
+
64
+ 1. `npm uninstall kline-orderbook-chart`
65
+ 2. `npm install kline-orderbook-chart@1.0.0`
66
+ 3. Email <support@mrd-indicators.com> with your previous license key for
67
+ a free replacement Ed25519 token (same plan, same expiry).
68
+ 4. Update any `generateLicenseKey` calls — there should be none in
69
+ production code; they were only ever used during evaluation.
70
+ 5. If you call `chart.setLicenseKey(...)`, add `await`.
71
+
72
+ ### Security advisory
73
+
74
+ We strongly recommend treating any system that consumed `kline-orderbook-chart@0.x`
75
+ as having effectively no license enforcement: an attacker with that bundle
76
+ could have minted a valid-looking `enterprise` token offline. The new release
77
+ closes this loophole.
78
+
79
+ ---
80
+
81
+ ## 0.2.x
82
+
83
+ Frozen. No further releases. See `1.0.0` security advisory above for the
84
+ reason. Existing source-available demos in this repo continue to work in
85
+ trial mode.
package/README.md CHANGED
@@ -28,6 +28,14 @@
28
28
 
29
29
  ---
30
30
 
31
+ > **Upgrading from `0.x`?** `1.0.0` replaces the license layer with Ed25519
32
+ > for security reasons — old keys do not validate. See [CHANGELOG.md](./CHANGELOG.md)
33
+ > for the migration steps. If you are on a paid plan, email
34
+ > <support@mrd-indicators.com> with your previous key for a free replacement
35
+ > token (same plan, same expiry).
36
+
37
+ ---
38
+
31
39
  ## The problem
32
40
 
33
41
  You need a candlestick chart that also renders **real-time orderbook depth as a heatmap** behind the candles. You search for "orderbook heatmap chart library" or "kline heatmap javascript" — and find nothing. Every existing charting library gives you candles OR a heatmap, never both rendered together in a single performant canvas.
@@ -250,7 +258,9 @@ prefetchWasm()
250
258
  // Create chart
251
259
  const canvas = document.getElementById('chart')
252
260
  const chart = await createChartBridge(canvas, {
253
- licenseKey: 'YOUR_LICENSE_KEY', // omit for 14-day trial
261
+ // Ed25519-signed license token (JWS-compact: header.payload.signature).
262
+ // Omit, or pass 'trial', to run a 14-day watermarked trial.
263
+ licenseKey: 'YOUR_LICENSE_TOKEN',
254
264
  })
255
265
 
256
266
  // Load data (six separate arrays)
@@ -1 +1 @@
1
- class D{__destroy_into_raw(){const _=this.__mrd_ptr;return this.__mrd_ptr=0,C.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__mrd_chartengine_free(_,0)}add_anchored_vwap(_,e,r,n,s,i,a){return t.chartengine_add_anchored_vwap(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_arrow(_,e,r,n,s,i,a,d,p,g){return t.chartengine_add_arrow(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g)>>>0}add_arrow_marker_down(_,e,r,n,s,i,a){return t.chartengine_add_arrow_marker_down(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_arrow_marker_up(_,e,r,n,s,i,a){return t.chartengine_add_arrow_marker_up(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_brush_point(_,e){t.chartengine_add_brush_point(this.__mrd_ptr,_,e)}add_circle(_,e,r,n,s,i,a,d,p,g){return t.chartengine_add_circle(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g)>>>0}add_elliott_impulse(_,e,r,n,s,i,a){return t.chartengine_add_elliott_impulse(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_elliott_manual_point(_,e){return t.chartengine_add_elliott_manual_point(this.__mrd_ptr,_,e)!==0}add_fib_extension(_,e,r,n,s,i,a,d,p,g,m,b){return t.chartengine_add_fib_extension(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g,m,b)>>>0}add_fib_retracement(_,e,r,n,s,i,a,d,p,g){return t.chartengine_add_fib_retracement(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g)>>>0}add_horizontal_line(_,e,r,n,s,i,a,d){return t.chartengine_add_horizontal_line(this.__mrd_ptr,_,e,r,n,s,i,a,d)>>>0}add_long_position(_,e,r,n,s,i,a,d,p,g){return t.chartengine_add_long_position(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g)>>>0}add_marker(_,e,r){t.chartengine_add_marker(this.__mrd_ptr,_,e,r)}add_parallel_channel(_,e,r,n,s,i,a,d,p,g,m,b){return t.chartengine_add_parallel_channel(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g,m,b)>>>0}add_path_point(_,e){t.chartengine_add_path_point(this.__mrd_ptr,_,e)}add_price_label(_,e,r,n,s,i,a){return t.chartengine_add_price_label(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_price_range(_,e,r,n,s,i,a,d,p,g){return t.chartengine_add_price_range(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g)>>>0}add_short_position(_,e,r,n,s,i,a,d,p,g){return t.chartengine_add_short_position(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g)>>>0}add_text_note(_,e,r,n,s,i,a){return t.chartengine_add_text_note(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_trendline(_,e,r,n,s,i,a,d,p,g){return t.chartengine_add_trendline(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g)>>>0}append_heatmap_column(_,e,r,n){const s=h(_,t.__wbindgen_export2),i=c;t.chartengine_append_heatmap_column(this.__mrd_ptr,s,i,e,r,n)}append_kline(_,e,r,n,s,i){t.chartengine_append_kline(this.__mrd_ptr,_,e,r,n,s,i)}append_real_timestamp(_){t.chartengine_append_real_timestamp(this.__mrd_ptr,_)}cancel_brush(){t.chartengine_cancel_brush(this.__mrd_ptr)}cancel_elliott_manual(){t.chartengine_cancel_elliott_manual(this.__mrd_ptr)}cancel_path(){t.chartengine_cancel_path(this.__mrd_ptr)}chart_area_h(){return t.chartengine_chart_area_h(this.__mrd_ptr)}chart_area_w(){return t.chartengine_chart_area_w(this.__mrd_ptr)}chart_area_x(){return t.chartengine_chart_area_x(this.__mrd_ptr)}chart_area_y(){return t.chartengine_chart_area_y(this.__mrd_ptr)}clear_channel_preview(){t.chartengine_clear_channel_preview(this.__mrd_ptr)}clear_drawing_preview(){t.chartengine_clear_drawing_preview(this.__mrd_ptr)}clear_drawings(){t.chartengine_clear_drawings(this.__mrd_ptr)}clear_elliott_preview(){t.chartengine_clear_elliott_preview(this.__mrd_ptr)}clear_fib_ext_preview(){t.chartengine_clear_fib_ext_preview(this.__mrd_ptr)}clear_heatmap_prefetch_range(){t.chartengine_clear_heatmap_prefetch_range(this.__mrd_ptr)}clear_hover_price(){t.chartengine_clear_hover_price(this.__mrd_ptr)}clear_large_trades(){t.chartengine_clear_large_trades(this.__mrd_ptr)}clear_live_signals(){t.chartengine_clear_live_signals(this.__mrd_ptr)}clear_markers(){t.chartengine_clear_markers(this.__mrd_ptr)}clear_ob_flow(){t.chartengine_clear_ob_flow(this.__mrd_ptr)}clear_ob_micro(){t.chartengine_clear_ob_micro(this.__mrd_ptr)}clear_ob_signals(){t.chartengine_clear_ob_signals(this.__mrd_ptr)}custom_band(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),d=c,p=h(e,t.__wbindgen_export2),g=c;t.chartengine_custom_band(this.__mrd_ptr,a,d,p,g,r,n,s,i)}custom_begin(){t.chartengine_custom_begin(this.__mrd_ptr)}custom_circle_px(_,e,r,n,s,i,a,d,p,g,m,b){t.chartengine_custom_circle_px(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g,m,b)}custom_clip_rect(_,e,r,n){t.chartengine_custom_clip_rect(this.__mrd_ptr,_,e,r,n)}custom_command_count(){return t.chartengine_custom_command_count(this.__mrd_ptr)>>>0}custom_dashed_hline(_,e,r,n,s,i,a,d){t.chartengine_custom_dashed_hline(this.__mrd_ptr,_,e,r,n,s,i,a,d)}custom_end(){t.chartengine_custom_end(this.__mrd_ptr)}custom_fill_rect_px(_,e,r,n,s,i,a,d){t.chartengine_custom_fill_rect_px(this.__mrd_ptr,_,e,r,n,s,i,a,d)}custom_hline(_,e,r,n,s,i){t.chartengine_custom_hline(this.__mrd_ptr,_,e,r,n,s,i)}custom_line_px(_,e,r,n,s,i,a,d,p){t.chartengine_custom_line_px(this.__mrd_ptr,_,e,r,n,s,i,a,d,p)}custom_marker(_,e,r,n,s,i,a){t.chartengine_custom_marker(this.__mrd_ptr,_,e,r,n,s,i,a)}custom_marker_down(_,e,r,n,s,i,a){t.chartengine_custom_marker_down(this.__mrd_ptr,_,e,r,n,s,i,a)}custom_marker_up(_,e,r,n,s,i,a){t.chartengine_custom_marker_up(this.__mrd_ptr,_,e,r,n,s,i,a)}custom_price_label(_,e,r,n,s,i,a){const d=v(e,t.__wbindgen_export2,t.__wbindgen_export3),p=c;t.chartengine_custom_price_label(this.__mrd_ptr,_,d,p,r,n,s,i,a)}custom_restore(){t.chartengine_custom_restore(this.__mrd_ptr)}custom_save(){t.chartengine_custom_save(this.__mrd_ptr)}custom_series_dashed_line(_,e,r,n,s,i,a,d){const p=h(_,t.__wbindgen_export2),g=c;t.chartengine_custom_series_dashed_line(this.__mrd_ptr,p,g,e,r,n,s,i,a,d)}custom_series_line(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),d=c;t.chartengine_custom_series_line(this.__mrd_ptr,a,d,e,r,n,s,i)}custom_stroke_rect_px(_,e,r,n,s,i,a,d,p){t.chartengine_custom_stroke_rect_px(this.__mrd_ptr,_,e,r,n,s,i,a,d,p)}custom_text(_,e,r,n,s,i,a,d,p){const g=v(r,t.__wbindgen_export2,t.__wbindgen_export3),m=c;t.chartengine_custom_text(this.__mrd_ptr,_,e,g,m,n,s,i,a,d,p)}custom_text_px(_,e,r,n,s,i,a,d,p){const g=v(r,t.__wbindgen_export2,t.__wbindgen_export3),m=c;t.chartengine_custom_text_px(this.__mrd_ptr,_,e,g,m,n,s,i,a,d,p)}delta_histogram_enabled(){return t.chartengine_delta_histogram_enabled(this.__mrd_ptr)!==0}deselect_drawing(){t.chartengine_deselect_drawing(this.__mrd_ptr)}deselect_marker(){t.chartengine_deselect_marker(this.__mrd_ptr)}disable_cvd(){t.chartengine_disable_cvd(this.__mrd_ptr)}disable_delta_histogram(){t.chartengine_disable_delta_histogram(this.__mrd_ptr)}disable_ema_structure(){t.chartengine_disable_ema_structure(this.__mrd_ptr)}disable_forex_signals(){t.chartengine_disable_forex_signals(this.__mrd_ptr)}disable_funding_rate(){t.chartengine_disable_funding_rate(this.__mrd_ptr)}disable_large_trades(){t.chartengine_disable_large_trades(this.__mrd_ptr)}disable_liq_heatmap(){t.chartengine_disable_liq_heatmap(this.__mrd_ptr)}disable_live_signals(){t.chartengine_disable_live_signals(this.__mrd_ptr)}disable_ob_flow(){t.chartengine_disable_ob_flow(this.__mrd_ptr)}disable_ob_micro(){t.chartengine_disable_ob_micro(this.__mrd_ptr)}disable_ob_signals(){t.chartengine_disable_ob_signals(this.__mrd_ptr)}disable_oi(){t.chartengine_disable_oi(this.__mrd_ptr)}disable_rsi(){t.chartengine_disable_rsi(this.__mrd_ptr)}disable_smart_ranges(){t.chartengine_disable_smart_ranges(this.__mrd_ptr)}disable_stop_iceberg(){t.chartengine_disable_stop_iceberg(this.__mrd_ptr)}disable_tpo(){t.chartengine_disable_tpo(this.__mrd_ptr)}disable_volume(){t.chartengine_disable_volume(this.__mrd_ptr)}disable_vpin(){t.chartengine_disable_vpin(this.__mrd_ptr)}disable_vrvp(){t.chartengine_disable_vrvp(this.__mrd_ptr)}drawing_count(){return t.chartengine_drawing_count(this.__mrd_ptr)>>>0}enable_cvd(){t.chartengine_enable_cvd(this.__mrd_ptr)}enable_delta_histogram(){t.chartengine_enable_delta_histogram(this.__mrd_ptr)}enable_ema_structure(){t.chartengine_enable_ema_structure(this.__mrd_ptr)}enable_forex_signals(){t.chartengine_enable_forex_signals(this.__mrd_ptr)}enable_funding_rate(){t.chartengine_enable_funding_rate(this.__mrd_ptr)}enable_large_trades(){t.chartengine_enable_large_trades(this.__mrd_ptr)}enable_liq_heatmap(){t.chartengine_enable_liq_heatmap(this.__mrd_ptr)}enable_live_signals(){t.chartengine_enable_live_signals(this.__mrd_ptr)}enable_ob_flow(){t.chartengine_enable_ob_flow(this.__mrd_ptr)}enable_ob_micro(){t.chartengine_enable_ob_micro(this.__mrd_ptr)}enable_ob_signals(){t.chartengine_enable_ob_signals(this.__mrd_ptr)}enable_oi(){t.chartengine_enable_oi(this.__mrd_ptr)}enable_rsi(){t.chartengine_enable_rsi(this.__mrd_ptr)}enable_smart_ranges(){t.chartengine_enable_smart_ranges(this.__mrd_ptr)}enable_stop_iceberg(){t.chartengine_enable_stop_iceberg(this.__mrd_ptr)}enable_tpo(){t.chartengine_enable_tpo(this.__mrd_ptr)}enable_volume(){t.chartengine_enable_volume(this.__mrd_ptr)}enable_vpin(){t.chartengine_enable_vpin(this.__mrd_ptr)}enable_vrvp(){t.chartengine_enable_vrvp(this.__mrd_ptr)}export_drawings_json(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_export_drawings_json(s,this.__mrd_ptr);var r=l().getInt32(s+4*0,!0),n=l().getInt32(s+4*1,!0);return _=r,e=n,u(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}finish_brush(){return t.chartengine_finish_brush(this.__mrd_ptr)>>>0}finish_elliott_manual(){return t.chartengine_finish_elliott_manual(this.__mrd_ptr)>>>0}finish_path(){return t.chartengine_finish_path(this.__mrd_ptr)>>>0}fit_content(){t.chartengine_fit_content(this.__mrd_ptr)}footprint_add_trade(_,e,r,n){t.chartengine_footprint_add_trade(this.__mrd_ptr,_,e,r,n)}footprint_add_trade_batch(_){const e=h(_,t.__wbindgen_export2),r=c;t.chartengine_footprint_add_trade_batch(this.__mrd_ptr,e,r)}footprint_clear(){t.chartengine_footprint_clear(this.__mrd_ptr)}footprint_clear_bar(_){t.chartengine_footprint_clear_bar(this.__mrd_ptr,_)}footprint_ensure_len(_){t.chartengine_footprint_ensure_len(this.__mrd_ptr,_)}footprint_get_display_mode(){return t.chartengine_footprint_get_display_mode(this.__mrd_ptr)}footprint_get_show_profile(){return t.chartengine_footprint_get_show_profile(this.__mrd_ptr)!==0}footprint_get_show_signals(){return t.chartengine_footprint_get_show_signals(this.__mrd_ptr)!==0}footprint_prepend_empty(_){t.chartengine_footprint_prepend_empty(this.__mrd_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.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,u(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}footprint_set_bar(_,e,r,n,s){const i=h(r,t.__wbindgen_export2),a=c,d=h(n,t.__wbindgen_export2),p=c,g=h(s,t.__wbindgen_export2),m=c;t.chartengine_footprint_set_bar(this.__mrd_ptr,_,e,i,a,d,p,g,m)}footprint_set_display_mode(_){t.chartengine_footprint_set_display_mode(this.__mrd_ptr,_)}footprint_set_show_profile(_){t.chartengine_footprint_set_show_profile(this.__mrd_ptr,_)}footprint_set_show_signals(_){t.chartengine_footprint_set_show_signals(this.__mrd_ptr,_)}footprint_signal_count(){return t.chartengine_footprint_signal_count(this.__mrd_ptr)>>>0}get_chart_type(){return t.chartengine_get_chart_type(this.__mrd_ptr)}get_command_buffer_len(){return t.chartengine_get_command_buffer_len(this.__mrd_ptr)>>>0}get_command_buffer_ptr(){return t.chartengine_get_command_buffer_ptr(this.__mrd_ptr)>>>0}get_custom_buffer_len(){return t.chartengine_get_custom_buffer_len(this.__mrd_ptr)>>>0}get_custom_buffer_ptr(){return t.chartengine_get_custom_buffer_ptr(this.__mrd_ptr)>>>0}get_cvd_mode(){return t.chartengine_get_cvd_mode(this.__mrd_ptr)}get_cvd_ratio(){return t.chartengine_get_cvd_ratio(this.__mrd_ptr)}get_cvd_show_delta(){return t.chartengine_get_cvd_show_delta(this.__mrd_ptr)!==0}get_cvd_show_divergence(){return t.chartengine_get_cvd_show_divergence(this.__mrd_ptr)!==0}get_cvd_show_signals(){return t.chartengine_get_cvd_show_signals(this.__mrd_ptr)!==0}get_cvd_source(){return t.chartengine_get_cvd_source(this.__mrd_ptr)}get_drawing_color(_){return t.chartengine_get_drawing_color(this.__mrd_ptr,_)>>>0}get_drawing_dashed(_){return t.chartengine_get_drawing_dashed(this.__mrd_ptr,_)!==0}get_drawing_font_size(_){return t.chartengine_get_drawing_font_size(this.__mrd_ptr,_)}get_drawing_hide_label(_){return t.chartengine_get_drawing_hide_label(this.__mrd_ptr,_)!==0}get_drawing_kind_id(_){return t.chartengine_get_drawing_kind_id(this.__mrd_ptr,_)}get_drawing_text(_){let e,r;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_drawing_text(i,this.__mrd_ptr,_);var n=l().getInt32(i+4*0,!0),s=l().getInt32(i+4*1,!0);return e=n,r=s,u(n,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(e,r,1)}}get_font_size(){return t.chartengine_get_font_size(this.__mrd_ptr)}get_forex_signals_count(){return t.chartengine_get_forex_signals_count(this.__mrd_ptr)>>>0}get_fr_ratio(){return t.chartengine_get_fr_ratio(this.__mrd_ptr)}get_heatmap_data_max(){return t.chartengine_get_heatmap_data_max(this.__mrd_ptr)}get_heatmap_data_min(){return t.chartengine_get_heatmap_data_min(this.__mrd_ptr)}get_heatmap_last_timestamp(){return t.chartengine_get_heatmap_last_timestamp(this.__mrd_ptr)}get_heatmap_prefetch_max(){return t.chartengine_get_heatmap_prefetch_max(this.__mrd_ptr)}get_heatmap_x_step(){return t.chartengine_get_heatmap_x_step(this.__mrd_ptr)}get_iceberg_count(){return t.chartengine_get_iceberg_count(this.__mrd_ptr)>>>0}get_last_candle_json(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_last_candle_json(s,this.__mrd_ptr);var r=l().getInt32(s+4*0,!0),n=l().getInt32(s+4*1,!0);return _=r,e=n,u(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}get_last_close(){return t.chartengine_get_last_close(this.__mrd_ptr)}get_liq_heatmap_cell_height(){return t.chartengine_get_liq_heatmap_cell_height(this.__mrd_ptr)}get_liq_heatmap_filled_pct(){return t.chartengine_get_liq_heatmap_filled_pct(this.__mrd_ptr)}get_liq_heatmap_max(){return t.chartengine_get_liq_heatmap_max(this.__mrd_ptr)}get_liq_heatmap_min(){return t.chartengine_get_liq_heatmap_min(this.__mrd_ptr)}get_liq_heatmap_seg_max(){return t.chartengine_get_liq_heatmap_seg_max(this.__mrd_ptr)}get_live_signals_count(){return t.chartengine_get_live_signals_count(this.__mrd_ptr)>>>0}get_live_signals_leverage(){return t.chartengine_get_live_signals_leverage(this.__mrd_ptr)}get_lt_data_max_vol(){return t.chartengine_get_lt_data_max_vol(this.__mrd_ptr)}get_lt_data_min_vol(){return t.chartengine_get_lt_data_min_vol(this.__mrd_ptr)}get_obf_ratio(){return t.chartengine_get_obf_ratio(this.__mrd_ptr)}get_oi_ratio(){return t.chartengine_get_oi_ratio(this.__mrd_ptr)}get_rsi_ratio(){return t.chartengine_get_rsi_ratio(this.__mrd_ptr)}get_selected_drawing(){return t.chartengine_get_selected_drawing(this.__mrd_ptr)>>>0}get_selected_marker(){return t.chartengine_get_selected_marker(this.__mrd_ptr)>>>0}get_sr_signals_count(){return t.chartengine_get_sr_signals_count(this.__mrd_ptr)>>>0}get_stop_run_count(){return t.chartengine_get_stop_run_count(this.__mrd_ptr)>>>0}get_theme(){return t.chartengine_get_theme(this.__mrd_ptr)}get_tooltip_data(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_tooltip_data(s,this.__mrd_ptr);var r=l().getInt32(s+4*0,!0),n=l().getInt32(s+4*1,!0);return _=r,e=n,u(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}get_tpo_period(){return t.chartengine_get_tpo_period(this.__mrd_ptr)>>>0}get_volume_color_mode(){return t.chartengine_get_volume_color_mode(this.__mrd_ptr)}get_volume_ma_period(){return t.chartengine_get_volume_ma_period(this.__mrd_ptr)>>>0}get_volume_show_ma(){return t.chartengine_get_volume_show_ma(this.__mrd_ptr)!==0}get_volume_show_signals(){return t.chartengine_get_volume_show_signals(this.__mrd_ptr)!==0}get_vpin_bucket_size(){return t.chartengine_get_vpin_bucket_size(this.__mrd_ptr)>>>0}get_vpin_num_buckets(){return t.chartengine_get_vpin_num_buckets(this.__mrd_ptr)>>>0}get_vpin_ratio(){return t.chartengine_get_vpin_ratio(this.__mrd_ptr)}get_vpin_threshold(){return t.chartengine_get_vpin_threshold(this.__mrd_ptr)}hide_crosshair(){t.chartengine_hide_crosshair(this.__mrd_ptr)}hit_test_drawing(_,e){return t.chartengine_hit_test_drawing(this.__mrd_ptr,_,e)>>>0}hit_test_drawing_anchor(_,e){return t.chartengine_hit_test_drawing_anchor(this.__mrd_ptr,_,e)}hit_test_marker(_,e){return t.chartengine_hit_test_marker(this.__mrd_ptr,_,e)>>>0}hit_zone(_,e){return t.chartengine_hit_zone(this.__mrd_ptr,_,e)}hover_hit_test(_,e){try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_hover_hit_test(i,this.__mrd_ptr,_,e);var r=l().getInt32(i+4*0,!0),n=l().getInt32(i+4*1,!0),s=G(r,n).slice();return t.__wbindgen_export(r,n*4,4),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}import_drawings_json(_){const e=v(_,t.__wbindgen_export2,t.__wbindgen_export3),r=c;t.chartengine_import_drawings_json(this.__mrd_ptr,e,r)}is_cvd_enabled(){return t.chartengine_is_cvd_enabled(this.__mrd_ptr)!==0}is_dirty(){return t.chartengine_is_dirty(this.__mrd_ptr)!==0}is_ema_structure_enabled(){return t.chartengine_is_ema_structure_enabled(this.__mrd_ptr)!==0}is_forex_signals_enabled(){return t.chartengine_is_forex_signals_enabled(this.__mrd_ptr)!==0}is_funding_rate_enabled(){return t.chartengine_is_funding_rate_enabled(this.__mrd_ptr)!==0}is_large_trades_enabled(){return t.chartengine_is_large_trades_enabled(this.__mrd_ptr)!==0}is_liq_heatmap_enabled(){return t.chartengine_is_liq_heatmap_enabled(this.__mrd_ptr)!==0}is_liq_heatmap_filled_zones(){return t.chartengine_is_liq_heatmap_filled_zones(this.__mrd_ptr)!==0}is_liq_heatmap_predictions(){return t.chartengine_is_liq_heatmap_predictions(this.__mrd_ptr)!==0}is_liq_heatmap_profile(){return t.chartengine_is_liq_heatmap_profile(this.__mrd_ptr)!==0}is_live_signals_enabled(){return t.chartengine_is_live_signals_enabled(this.__mrd_ptr)!==0}is_ob_flow_enabled(){return t.chartengine_is_ob_flow_enabled(this.__mrd_ptr)!==0}is_ob_micro_enabled(){return t.chartengine_is_ob_micro_enabled(this.__mrd_ptr)!==0}is_ob_signals_enabled(){return t.chartengine_is_ob_signals_enabled(this.__mrd_ptr)!==0}is_oi_enabled(){return t.chartengine_is_oi_enabled(this.__mrd_ptr)!==0}is_rsi_enabled(){return t.chartengine_is_rsi_enabled(this.__mrd_ptr)!==0}is_rsi_show_traps(){return t.chartengine_is_rsi_show_traps(this.__mrd_ptr)!==0}is_smart_ranges_enabled(){return t.chartengine_is_smart_ranges_enabled(this.__mrd_ptr)!==0}is_stop_iceberg_enabled(){return t.chartengine_is_stop_iceberg_enabled(this.__mrd_ptr)!==0}is_tpo_enabled(){return t.chartengine_is_tpo_enabled(this.__mrd_ptr)!==0}is_tpo_signals(){return t.chartengine_is_tpo_signals(this.__mrd_ptr)!==0}is_volume_enabled(){return t.chartengine_is_volume_enabled(this.__mrd_ptr)!==0}is_vpin_enabled(){return t.chartengine_is_vpin_enabled(this.__mrd_ptr)!==0}is_vrvp_enabled(){return t.chartengine_is_vrvp_enabled(this.__mrd_ptr)!==0}kline_closes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_closes(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_count(){return t.chartengine_kline_count(this.__mrd_ptr)>>>0}kline_highs(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_highs(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,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.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,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.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,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.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,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.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,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.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,u(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(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.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,u(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(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.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,u(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(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.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,u(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(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.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,u(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}move_drawing(_,e){t.chartengine_move_drawing(this.__mrd_ptr,_,e)}constructor(_,e){const r=t.chartengine_new(_,e);return this.__mrd_ptr=r>>>0,C.register(this,this.__mrd_ptr,this),this}ob_flow_to_screen_y(_){return t.chartengine_ob_flow_to_screen_y(this.__mrd_ptr,_)}oi_to_screen_y(_){return t.chartengine_oi_to_screen_y(this.__mrd_ptr,_)}pan(_,e){t.chartengine_pan(this.__mrd_ptr,_,e)}pan_indicator_y(_,e){t.chartengine_pan_indicator_y(this.__mrd_ptr,_,e)}pan_x(_){t.chartengine_pan_x(this.__mrd_ptr,_)}pan_y(_){t.chartengine_pan_y(this.__mrd_ptr,_)}pop_last_kline(){return t.chartengine_pop_last_kline(this.__mrd_ptr)!==0}prepend_klines(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),d=c,p=h(e,t.__wbindgen_export2),g=c,m=h(r,t.__wbindgen_export2),b=c,w=h(n,t.__wbindgen_export2),k=c,z=h(s,t.__wbindgen_export2),I=c,q=h(i,t.__wbindgen_export2),A=c;t.chartengine_prepend_klines(this.__mrd_ptr,a,d,p,g,m,b,w,k,z,I,q,A)}push_large_trade(_,e,r,n){t.chartengine_push_large_trade(this.__mrd_ptr,_,e,r,n)}push_obf_sample(_,e,r,n){t.chartengine_push_obf_sample(this.__mrd_ptr,_,e,r,n)}push_obs_alert(_,e,r,n,s){t.chartengine_push_obs_alert(this.__mrd_ptr,_,e,r,n,s)}remove_drawing(_){t.chartengine_remove_drawing(this.__mrd_ptr,_)}remove_marker(_){t.chartengine_remove_marker(this.__mrd_ptr,_)}render(){return t.chartengine_render(this.__mrd_ptr)>>>0}reset_indicator_y_auto(_){t.chartengine_reset_indicator_y_auto(this.__mrd_ptr,_)}resize(_,e){t.chartengine_resize(this.__mrd_ptr,_,e)}rsi_to_screen_y(_){return t.chartengine_rsi_to_screen_y(this.__mrd_ptr,_)}screen_to_cvd_y(_){return t.chartengine_screen_to_cvd_y(this.__mrd_ptr,_)}screen_to_fr_y(_){return t.chartengine_screen_to_fr_y(this.__mrd_ptr,_)}screen_to_ob_flow_y(_){return t.chartengine_screen_to_ob_flow_y(this.__mrd_ptr,_)}screen_to_oi_y(_){return t.chartengine_screen_to_oi_y(this.__mrd_ptr,_)}screen_to_rsi_y(_){return t.chartengine_screen_to_rsi_y(this.__mrd_ptr,_)}screen_to_vpin_y(_){return t.chartengine_screen_to_vpin_y(this.__mrd_ptr,_)}screen_to_world_x(_){return t.chartengine_screen_to_world_x(this.__mrd_ptr,_)}screen_to_world_y(_){return t.chartengine_screen_to_world_y(this.__mrd_ptr,_)}select_drawing(_){t.chartengine_select_drawing(this.__mrd_ptr,_)}select_marker(_){t.chartengine_select_marker(this.__mrd_ptr,_)}set_background_color(_,e,r){t.chartengine_set_background_color(this.__mrd_ptr,_,e,r)}set_bg_gradient(_,e,r,n){t.chartengine_set_bg_gradient(this.__mrd_ptr,_,e,r,n)}set_candle_bear_border_color(_,e,r){t.chartengine_set_candle_bear_border_color(this.__mrd_ptr,_,e,r)}set_candle_bear_color(_,e,r){t.chartengine_set_candle_bear_color(this.__mrd_ptr,_,e,r)}set_candle_bear_wick_color(_,e,r){t.chartengine_set_candle_bear_wick_color(this.__mrd_ptr,_,e,r)}set_candle_bull_border_color(_,e,r){t.chartengine_set_candle_bull_border_color(this.__mrd_ptr,_,e,r)}set_candle_bull_color(_,e,r){t.chartengine_set_candle_bull_color(this.__mrd_ptr,_,e,r)}set_candle_bull_wick_color(_,e,r){t.chartengine_set_candle_bull_wick_color(this.__mrd_ptr,_,e,r)}set_candle_interval(_){t.chartengine_set_candle_interval(this.__mrd_ptr,_)}set_channel_preview(_,e,r,n,s,i,a,d,p,g,m,b){t.chartengine_set_channel_preview(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g,m,b)}set_chart_type(_){t.chartengine_set_chart_type(this.__mrd_ptr,_)}set_crosshair(_,e){t.chartengine_set_crosshair(this.__mrd_ptr,_,e)}set_crosshair_color(_,e,r,n){t.chartengine_set_crosshair_color(this.__mrd_ptr,_,e,r,n)}set_crosshair_style(_){t.chartengine_set_crosshair_style(this.__mrd_ptr,_)}set_crosshair_width(_){t.chartengine_set_crosshair_width(this.__mrd_ptr,_)}set_cvd_data(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.chartengine_set_cvd_data(this.__mrd_ptr,r,n,s,i)}set_cvd_mode(_){t.chartengine_set_cvd_mode(this.__mrd_ptr,_)}set_cvd_ratio(_){t.chartengine_set_cvd_ratio(this.__mrd_ptr,_)}set_cvd_show_delta(_){t.chartengine_set_cvd_show_delta(this.__mrd_ptr,_)}set_cvd_show_divergence(_){t.chartengine_set_cvd_show_divergence(this.__mrd_ptr,_)}set_cvd_show_signals(_){t.chartengine_set_cvd_show_signals(this.__mrd_ptr,_)}set_cvd_source(_){t.chartengine_set_cvd_source(this.__mrd_ptr,_)}set_cvd_spot_data(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.chartengine_set_cvd_spot_data(this.__mrd_ptr,r,n,s,i)}set_drawing_dashed(_,e){t.chartengine_set_drawing_dashed(this.__mrd_ptr,_,e)}set_drawing_font_size(_,e){t.chartengine_set_drawing_font_size(this.__mrd_ptr,_,e)}set_drawing_hide_label(_,e){t.chartengine_set_drawing_hide_label(this.__mrd_ptr,_,e)}set_drawing_preview(_,e,r,n,s,i,a,d,p,g,m){t.chartengine_set_drawing_preview(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g,m)}set_drawing_style(_,e,r,n,s){t.chartengine_set_drawing_style(this.__mrd_ptr,_,e,r,n,s)}set_drawing_text(_,e){const r=v(e,t.__wbindgen_export2,t.__wbindgen_export3),n=c;t.chartengine_set_drawing_text(this.__mrd_ptr,_,r,n)}set_elliott_manual_cursor(_,e){t.chartengine_set_elliott_manual_cursor(this.__mrd_ptr,_,e)}set_elliott_preview(_,e,r,n,s,i,a){t.chartengine_set_elliott_preview(this.__mrd_ptr,_,e,r,n,s,i,a)}set_es_ema1_len(_){t.chartengine_set_es_ema1_len(this.__mrd_ptr,_)}set_es_ema2_len(_){t.chartengine_set_es_ema2_len(this.__mrd_ptr,_)}set_es_show_bos(_){t.chartengine_set_es_show_bos(this.__mrd_ptr,_)}set_es_show_ema1(_){t.chartengine_set_es_show_ema1(this.__mrd_ptr,_)}set_es_show_ema2(_){t.chartengine_set_es_show_ema2(this.__mrd_ptr,_)}set_es_show_wma(_){t.chartengine_set_es_show_wma(this.__mrd_ptr,_)}set_es_swing_len(_){t.chartengine_set_es_swing_len(this.__mrd_ptr,_)}set_es_wma_len(_){t.chartengine_set_es_wma_len(this.__mrd_ptr,_)}set_fib_ext_preview(_,e,r,n,s,i,a,d,p,g,m,b){t.chartengine_set_fib_ext_preview(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g,m,b)}set_font_size(_){t.chartengine_set_font_size(this.__mrd_ptr,_)}set_footprint_tick_size(_){t.chartengine_set_footprint_tick_size(this.__mrd_ptr,_)}set_forex_signals_mode(_){t.chartengine_set_forex_signals_mode(this.__mrd_ptr,_)}set_forex_signals_setup(_){t.chartengine_set_forex_signals_setup(this.__mrd_ptr,_)}set_forex_signals_show_stats(_){t.chartengine_set_forex_signals_show_stats(this.__mrd_ptr,_)}set_fr_agg_data(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.chartengine_set_fr_agg_data(this.__mrd_ptr,r,n,s,i)}set_fr_binance_data(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.chartengine_set_fr_binance_data(this.__mrd_ptr,r,n,s,i)}set_fr_ratio(_){t.chartengine_set_fr_ratio(this.__mrd_ptr,_)}set_fr_show_agg(_){t.chartengine_set_fr_show_agg(this.__mrd_ptr,_)}set_fr_show_sma(_){t.chartengine_set_fr_show_sma(this.__mrd_ptr,_)}set_grid_color(_,e,r,n){t.chartengine_set_grid_color(this.__mrd_ptr,_,e,r,n)}set_grid_h_visible(_){t.chartengine_set_grid_h_visible(this.__mrd_ptr,_)}set_grid_v_visible(_){t.chartengine_set_grid_v_visible(this.__mrd_ptr,_)}set_heatmap(_,e,r,n,s,i,a){const d=h(_,t.__wbindgen_export2),p=c;t.chartengine_set_heatmap(this.__mrd_ptr,d,p,e,r,n,s,i,a)}set_heatmap_color_scheme(_){t.chartengine_set_heatmap_color_scheme(this.__mrd_ptr,_)}set_heatmap_prefetch_range(_){t.chartengine_set_heatmap_prefetch_range(this.__mrd_ptr,_)}set_heatmap_range(_,e){t.chartengine_set_heatmap_range(this.__mrd_ptr,_,e)}set_hover_price(_){t.chartengine_set_hover_price(this.__mrd_ptr,_)}set_iceberg_events(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),d=c,p=h(e,t.__wbindgen_export2),g=c,m=h(r,t.__wbindgen_export2),b=c,w=h(n,t.__wbindgen_export2),k=c,z=Z(s,t.__wbindgen_export2),I=c,q=Q(i,t.__wbindgen_export2),A=c;t.chartengine_set_iceberg_events(this.__mrd_ptr,a,d,p,g,m,b,w,k,z,I,q,A)}set_klines(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),d=c,p=h(e,t.__wbindgen_export2),g=c,m=h(r,t.__wbindgen_export2),b=c,w=h(n,t.__wbindgen_export2),k=c,z=h(s,t.__wbindgen_export2),I=c,q=h(i,t.__wbindgen_export2),A=c;t.chartengine_set_klines(this.__mrd_ptr,a,d,p,g,m,b,w,k,z,I,q,A)}set_large_trades_data(_){const e=h(_,t.__wbindgen_export2),r=c;t.chartengine_set_large_trades_data(this.__mrd_ptr,e,r)}set_license_state(_,e,r){t.chartengine_set_license_state(this.__mrd_ptr,_,e,r)}set_liq_heatmap_cell_height(_){t.chartengine_set_liq_heatmap_cell_height(this.__mrd_ptr,_)}set_liq_heatmap_filled_pct(_){t.chartengine_set_liq_heatmap_filled_pct(this.__mrd_ptr,_)}set_liq_heatmap_filled_zones(_){t.chartengine_set_liq_heatmap_filled_zones(this.__mrd_ptr,_)}set_liq_heatmap_predictions(_){t.chartengine_set_liq_heatmap_predictions(this.__mrd_ptr,_)}set_liq_heatmap_profile(_){t.chartengine_set_liq_heatmap_profile(this.__mrd_ptr,_)}set_liq_heatmap_range(_,e){t.chartengine_set_liq_heatmap_range(this.__mrd_ptr,_,e)}set_live_signals_data(_){const e=h(_,t.__wbindgen_export2),r=c;t.chartengine_set_live_signals_data(this.__mrd_ptr,e,r)}set_live_signals_leverage(_){t.chartengine_set_live_signals_leverage(this.__mrd_ptr,_)}set_live_signals_loading(_){t.chartengine_set_live_signals_loading(this.__mrd_ptr,_)}set_live_signals_pip_value(_){t.chartengine_set_live_signals_pip_value(this.__mrd_ptr,_)}set_live_signals_show_entry(_){t.chartengine_set_live_signals_show_entry(this.__mrd_ptr,_)}set_live_signals_show_labels(_){t.chartengine_set_live_signals_show_labels(this.__mrd_ptr,_)}set_live_signals_show_max_profit(_){t.chartengine_set_live_signals_show_max_profit(this.__mrd_ptr,_)}set_live_signals_show_tp_sl(_){t.chartengine_set_live_signals_show_tp_sl(this.__mrd_ptr,_)}set_live_signals_show_zones(_){t.chartengine_set_live_signals_show_zones(this.__mrd_ptr,_)}set_live_signals_text_size(_){t.chartengine_set_live_signals_text_size(this.__mrd_ptr,_)}set_live_signals_trial(_){t.chartengine_set_live_signals_trial(this.__mrd_ptr,_)}set_lt_bubble_scale(_){t.chartengine_set_lt_bubble_scale(this.__mrd_ptr,_)}set_lt_volume_filter(_,e){t.chartengine_set_lt_volume_filter(this.__mrd_ptr,_,e)}set_obf_data(_){const e=h(_,t.__wbindgen_export2),r=c;t.chartengine_set_obf_data(this.__mrd_ptr,e,r)}set_obf_ratio(_){t.chartengine_set_obf_ratio(this.__mrd_ptr,_)}set_obf_show_cum_delta(_){t.chartengine_set_obf_show_cum_delta(this.__mrd_ptr,_)}set_obf_show_net_flow(_){t.chartengine_set_obf_show_net_flow(this.__mrd_ptr,_)}set_obf_show_obi(_){t.chartengine_set_obf_show_obi(this.__mrd_ptr,_)}set_obm_anchor_top_right(_){t.chartengine_set_obm_anchor_top_right(this.__mrd_ptr,_)}set_obm_data(_,e,r,n,s,i,a,d,p,g,m,b,w){t.chartengine_set_obm_data(this.__mrd_ptr,_,e,r,n,s,i,a,d,p,g,m,b,w)}set_obs_com(_){t.chartengine_set_obs_com(this.__mrd_ptr,_)}set_obs_gaps(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.chartengine_set_obs_gaps(this.__mrd_ptr,r,n,s,i)}set_obs_show_alerts(_){t.chartengine_set_obs_show_alerts(this.__mrd_ptr,_)}set_obs_show_com(_){t.chartengine_set_obs_show_com(this.__mrd_ptr,_)}set_obs_show_gaps(_){t.chartengine_set_obs_show_gaps(this.__mrd_ptr,_)}set_obs_show_walls(_){t.chartengine_set_obs_show_walls(this.__mrd_ptr,_)}set_obs_walls(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.chartengine_set_obs_walls(this.__mrd_ptr,r,n,s,i)}set_oi_data(_){const e=h(_,t.__wbindgen_export2),r=c;t.chartengine_set_oi_data(this.__mrd_ptr,e,r)}set_oi_data_ts(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.chartengine_set_oi_data_ts(this.__mrd_ptr,r,n,s,i)}set_oi_display_mode(_){t.chartengine_set_oi_display_mode(this.__mrd_ptr,_)}set_oi_ratio(_){t.chartengine_set_oi_ratio(this.__mrd_ptr,_)}set_oi_show_on_chart(_){t.chartengine_set_oi_show_on_chart(this.__mrd_ptr,_)}set_path_cursor(_,e){t.chartengine_set_path_cursor(this.__mrd_ptr,_,e)}set_price_precision(_){t.chartengine_set_price_precision(this.__mrd_ptr,_)}set_real_timestamps(_){const e=h(_,t.__wbindgen_export2),r=c;t.chartengine_set_real_timestamps(this.__mrd_ptr,e,r)}set_replay_hovered(_){t.chartengine_set_replay_hovered(this.__mrd_ptr,_)}set_replay_preview(_){t.chartengine_set_replay_preview(this.__mrd_ptr,_)}set_replay_state(_,e,r){t.chartengine_set_replay_state(this.__mrd_ptr,_,e,r)}set_rsi_period(_){t.chartengine_set_rsi_period(this.__mrd_ptr,_)}set_rsi_ratio(_){t.chartengine_set_rsi_ratio(this.__mrd_ptr,_)}set_rsi_show_divergence(_){t.chartengine_set_rsi_show_divergence(this.__mrd_ptr,_)}set_rsi_show_ema(_){t.chartengine_set_rsi_show_ema(this.__mrd_ptr,_)}set_rsi_show_levels(_){t.chartengine_set_rsi_show_levels(this.__mrd_ptr,_)}set_rsi_show_signals(_){t.chartengine_set_rsi_show_signals(this.__mrd_ptr,_)}set_rsi_show_traps(_){t.chartengine_set_rsi_show_traps(this.__mrd_ptr,_)}set_rsi_show_wma(_){t.chartengine_set_rsi_show_wma(this.__mrd_ptr,_)}set_rsi_smoothing(_){t.chartengine_set_rsi_smoothing(this.__mrd_ptr,_)}set_si_show_icebergs(_){t.chartengine_set_si_show_icebergs(this.__mrd_ptr,_)}set_si_show_stops(_){t.chartengine_set_si_show_stops(this.__mrd_ptr,_)}set_si_show_zones(_){t.chartengine_set_si_show_zones(this.__mrd_ptr,_)}set_sr_fvg_extend(_){t.chartengine_set_sr_fvg_extend(this.__mrd_ptr,_)}set_sr_fvg_htf(_){t.chartengine_set_sr_fvg_htf(this.__mrd_ptr,_)}set_sr_fvg_mitigation(_){t.chartengine_set_sr_fvg_mitigation(this.__mrd_ptr,_)}set_sr_fvg_theme(_){t.chartengine_set_sr_fvg_theme(this.__mrd_ptr,_)}set_sr_htf_minutes(_){t.chartengine_set_sr_htf_minutes(this.__mrd_ptr,_)}set_sr_mitigation(_){t.chartengine_set_sr_mitigation(this.__mrd_ptr,_)}set_sr_ob_last(_){t.chartengine_set_sr_ob_last(this.__mrd_ptr,_)}set_sr_show_breakers(_){t.chartengine_set_sr_show_breakers(this.__mrd_ptr,_)}set_sr_show_fvg(_){t.chartengine_set_sr_show_fvg(this.__mrd_ptr,_)}set_sr_show_fvg_signals(_){t.chartengine_set_sr_show_fvg_signals(this.__mrd_ptr,_)}set_sr_show_htf_ob(_){t.chartengine_set_sr_show_htf_ob(this.__mrd_ptr,_)}set_sr_show_metrics(_){t.chartengine_set_sr_show_metrics(this.__mrd_ptr,_)}set_sr_show_ob(_){t.chartengine_set_sr_show_ob(this.__mrd_ptr,_)}set_sr_show_ob_activity(_){t.chartengine_set_sr_show_ob_activity(this.__mrd_ptr,_)}set_sr_show_ob_signals(_){t.chartengine_set_sr_show_ob_signals(this.__mrd_ptr,_)}set_sr_show_predict(_){t.chartengine_set_sr_show_predict(this.__mrd_ptr,_)}set_sr_show_smart_rev(_){t.chartengine_set_sr_show_smart_rev(this.__mrd_ptr,_)}set_sr_smart_rev_htf(_){t.chartengine_set_sr_smart_rev_htf(this.__mrd_ptr,_)}set_sr_stats_position(_){t.chartengine_set_sr_stats_position(this.__mrd_ptr,_)}set_sr_stats_type(_){t.chartengine_set_sr_stats_type(this.__mrd_ptr,_)}set_sr_text_size(_){t.chartengine_set_sr_text_size(this.__mrd_ptr,_)}set_theme(_){t.chartengine_set_theme(this.__mrd_ptr,_)}set_touch_mode(_){t.chartengine_set_touch_mode(this.__mrd_ptr,_)}set_tpo_ib(_){t.chartengine_set_tpo_ib(this.__mrd_ptr,_)}set_tpo_ib_minutes(_){t.chartengine_set_tpo_ib_minutes(this.__mrd_ptr,_)}set_tpo_letter_minutes(_){t.chartengine_set_tpo_letter_minutes(this.__mrd_ptr,_)}set_tpo_naked_poc(_){t.chartengine_set_tpo_naked_poc(this.__mrd_ptr,_)}set_tpo_period(_){t.chartengine_set_tpo_period(this.__mrd_ptr,_)}set_tpo_poc_line(_){t.chartengine_set_tpo_poc_line(this.__mrd_ptr,_)}set_tpo_profile_shape(_){t.chartengine_set_tpo_profile_shape(this.__mrd_ptr,_)}set_tpo_signals(_){t.chartengine_set_tpo_signals(this.__mrd_ptr,_)}set_tpo_single_prints(_){t.chartengine_set_tpo_single_prints(this.__mrd_ptr,_)}set_tpo_va_lines(_){t.chartengine_set_tpo_va_lines(this.__mrd_ptr,_)}set_volume_color_mode(_){t.chartengine_set_volume_color_mode(this.__mrd_ptr,_)}set_volume_ma_period(_){t.chartengine_set_volume_ma_period(this.__mrd_ptr,_)}set_volume_show_ma(_){t.chartengine_set_volume_show_ma(this.__mrd_ptr,_)}set_volume_show_signals(_){t.chartengine_set_volume_show_signals(this.__mrd_ptr,_)}set_vpin_bucket_size(_){t.chartengine_set_vpin_bucket_size(this.__mrd_ptr,_)}set_vpin_data(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.chartengine_set_vpin_data(this.__mrd_ptr,r,n,s,i)}set_vpin_num_buckets(_){t.chartengine_set_vpin_num_buckets(this.__mrd_ptr,_)}set_vpin_ratio(_){t.chartengine_set_vpin_ratio(this.__mrd_ptr,_)}set_vpin_show_sma(_){t.chartengine_set_vpin_show_sma(this.__mrd_ptr,_)}set_vpin_show_zones(_){t.chartengine_set_vpin_show_zones(this.__mrd_ptr,_)}set_vpin_threshold(_){t.chartengine_set_vpin_threshold(this.__mrd_ptr,_)}set_vrvp_poc_line(_){t.chartengine_set_vrvp_poc_line(this.__mrd_ptr,_)}show_latest(_){t.chartengine_show_latest(this.__mrd_ptr,_)}start_brush(_,e,r,n,s){t.chartengine_start_brush(this.__mrd_ptr,_,e,r,n,s)}start_elliott_manual(_,e,r,n,s){t.chartengine_start_elliott_manual(this.__mrd_ptr,_,e,r,n,s)}start_path(_,e,r,n,s,i){t.chartengine_start_path(this.__mrd_ptr,_,e,r,n,s,i)}update_drawing_anchor(_,e,r){t.chartengine_update_drawing_anchor(this.__mrd_ptr,_,e,r)}update_heatmap_column(_,e){const r=h(e,t.__wbindgen_export2),n=c;t.chartengine_update_heatmap_column(this.__mrd_ptr,_,r,n)}update_heatmap_column_at(_,e,r,n){const s=h(_,t.__wbindgen_export2),i=c;t.chartengine_update_heatmap_column_at(this.__mrd_ptr,s,i,e,r,n)}update_last_heatmap_column(_,e,r){const n=h(_,t.__wbindgen_export2),s=c;t.chartengine_update_last_heatmap_column(this.__mrd_ptr,n,s,e,r)}update_last_kline(_,e,r,n,s,i){t.chartengine_update_last_kline(this.__mrd_ptr,_,e,r,n,s,i)}vpin_to_screen_y(_){return t.chartengine_vpin_to_screen_y(this.__mrd_ptr,_)}vrvp_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_vrvp_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,u(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}world_to_screen_x(_){return t.chartengine_world_to_screen_x(this.__mrd_ptr,_)}world_to_screen_y(_){return t.chartengine_world_to_screen_y(this.__mrd_ptr,_)}zoom(_,e,r){t.chartengine_zoom(this.__mrd_ptr,_,e,r)}zoom_indicator_y(_,e,r){t.chartengine_zoom_indicator_y(this.__mrd_ptr,_,e,r)}zoom_x(_,e){t.chartengine_zoom_x(this.__mrd_ptr,_,e)}zoom_y(_,e){t.chartengine_zoom_y(this.__mrd_ptr,_,e)}}Symbol.dispose&&(D.prototype[Symbol.dispose]=D.prototype.free);class U{__destroy_into_raw(){const _=this.__mrd_ptr;return this.__mrd_ptr=0,B.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__mrd_orderbookengine_free(_,0)}center_on_mid(){t.orderbookengine_center_on_mid(this.__mrd_ptr)}clear(){t.orderbookengine_clear(this.__mrd_ptr)}clear_hover(){t.orderbookengine_clear_hover(this.__mrd_ptr)}get_command_buffer_len(){return t.orderbookengine_get_command_buffer_len(this.__mrd_ptr)>>>0}get_command_buffer_ptr(){return t.orderbookengine_get_command_buffer_ptr(this.__mrd_ptr)>>>0}get_hover_price(){return t.orderbookengine_get_hover_price(this.__mrd_ptr)}get_hover_qty(){return t.orderbookengine_get_hover_qty(this.__mrd_ptr)}get_hover_side(){return t.orderbookengine_get_hover_side(this.__mrd_ptr)}get_theme(){return t.orderbookengine_get_theme(this.__mrd_ptr)>>>0}is_dirty(){return t.orderbookengine_is_dirty(this.__mrd_ptr)!==0}constructor(_,e){const r=t.orderbookengine_new(_,e);return this.__mrd_ptr=r>>>0,B.register(this,this.__mrd_ptr,this),this}pan_y(_){t.orderbookengine_pan_y(this.__mrd_ptr,_)}push_heatmap_col(_,e,r){const n=h(_,t.__wbindgen_export2),s=c,i=h(e,t.__wbindgen_export2),a=c;t.orderbookengine_push_heatmap_col(this.__mrd_ptr,n,s,i,a,r)}push_snapshot(_,e,r){const n=h(_,t.__wbindgen_export2),s=c,i=h(e,t.__wbindgen_export2),a=c;t.orderbookengine_push_snapshot(this.__mrd_ptr,n,s,i,a,r)}render(){return t.orderbookengine_render(this.__mrd_ptr)>>>0}reset_ring(){t.orderbookengine_reset_ring(this.__mrd_ptr)}resize(_,e){t.orderbookengine_resize(this.__mrd_ptr,_,e)}set_auto_center(_){t.orderbookengine_set_auto_center(this.__mrd_ptr,_)}set_depth_book(_,e,r){const n=h(_,t.__wbindgen_export2),s=c,i=h(e,t.__wbindgen_export2),a=c;t.orderbookengine_set_depth_book(this.__mrd_ptr,n,s,i,a,r)}set_exchange_count(_){t.orderbookengine_set_exchange_count(this.__mrd_ptr,_)}set_exchange_labels(_){const e=v(_,t.__wbindgen_export2,t.__wbindgen_export3),r=c;t.orderbookengine_set_exchange_labels(this.__mrd_ptr,e,r)}set_heatmap_alpha_mul(_){t.orderbookengine_set_heatmap_alpha_mul(this.__mrd_ptr,_)}set_heatmap_cols(_){t.orderbookengine_set_heatmap_cols(this.__mrd_ptr,_)}set_hover(_,e){t.orderbookengine_set_hover(this.__mrd_ptr,_,e)}set_hover_y(_){t.orderbookengine_set_hover_y(this.__mrd_ptr,_)}set_price_precision(_){t.orderbookengine_set_price_precision(this.__mrd_ptr,_)}set_ring_capacity(_,e){t.orderbookengine_set_ring_capacity(this.__mrd_ptr,_,e)}set_show_cumulative(_){t.orderbookengine_set_show_cumulative(this.__mrd_ptr,_)}set_show_signal_overlays(_){t.orderbookengine_set_show_signal_overlays(this.__mrd_ptr,_)}set_signal_absorption(_,e){t.orderbookengine_set_signal_absorption(this.__mrd_ptr,_,e)}set_signal_flow(_,e){t.orderbookengine_set_signal_flow(this.__mrd_ptr,_,e)}set_signal_gaps(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.orderbookengine_set_signal_gaps(this.__mrd_ptr,r,n,s,i)}set_signal_obi(_,e,r){t.orderbookengine_set_signal_obi(this.__mrd_ptr,_,e,r)}set_signal_spoof(_){t.orderbookengine_set_signal_spoof(this.__mrd_ptr,_)}set_signal_walls(_,e){const r=h(_,t.__wbindgen_export2),n=c,s=h(e,t.__wbindgen_export2),i=c;t.orderbookengine_set_signal_walls(this.__mrd_ptr,r,n,s,i)}set_symbol(_){const e=v(_,t.__wbindgen_export2,t.__wbindgen_export3),r=c;t.orderbookengine_set_symbol(this.__mrd_ptr,e,r)}set_theme(_){t.orderbookengine_set_theme(this.__mrd_ptr,_)}set_tick_size(_){t.orderbookengine_set_tick_size(this.__mrd_ptr,_)}set_visible_ticks(_){t.orderbookengine_set_visible_ticks(this.__mrd_ptr,_)}zoom_y(_,e){t.orderbookengine_zoom_y(this.__mrd_ptr,_,e)}}Symbol.dispose&&(U.prototype[Symbol.dispose]=U.prototype.free);function s_(){t.wasm_init()}function i_(){const o=t.wasm_memory();return N(o)}function L(){return{__proto__:null,"./chart_engine_bg.js":{__proto__:null,__mrd___wbindgen_memory_edb3f01e3930bbf6:function(){const _=t.memory;return V(_)},__mrd___wbindgen_throw_6ddd609b62940d55:function(_,e){throw new Error(u(_,e))},__mrd_error_a6fa202b58aa1cd3:function(_,e){let r,n;try{r=_,n=e,console.error(u(_,e))}finally{t.__wbindgen_export(r,n,1)}},__mrd_new_227d7c05414eb861:function(){const _=new Error;return V(_)},__mrd_stack_3b0d974bbf31e44f:function(_,e){const r=H(e).stack,n=v(r,t.__wbindgen_export2,t.__wbindgen_export3),s=c;l().setInt32(_+4,s,!0),l().setInt32(_+0,n,!0)},__wbindgen_object_drop_ref:function(_){N(_)}}}}const C=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(o=>t.__mrd_chartengine_free(o>>>0,1)),B=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(o=>t.__mrd_orderbookengine_free(o>>>0,1));function V(o){R===f.length&&f.push(f.length+1);const _=R;return R=f[_],f[_]=o,_}function Y(o){o<1028||(f[o]=R,R=o)}function x(o,_){return o=o>>>0,P().subarray(o/8,o/8+_)}function G(o,_){return o=o>>>0,J().subarray(o/4,o/4+_)}let y=null;function l(){return(y===null||y.buffer.detached===!0||y.buffer.detached===void 0&&y.buffer!==t.memory.buffer)&&(y=new DataView(t.memory.buffer)),y}let M=null;function P(){return(M===null||M.byteLength===0)&&(M=new Float64Array(t.memory.buffer)),M}let W=null;function J(){return(W===null||W.byteLength===0)&&(W=new Int32Array(t.memory.buffer)),W}function u(o,_){return o=o>>>0,__(o,_)}let j=null;function K(){return(j===null||j.byteLength===0)&&(j=new Uint32Array(t.memory.buffer)),j}let F=null;function O(){return(F===null||F.byteLength===0)&&(F=new Uint8Array(t.memory.buffer)),F}function H(o){return f[o]}let f=new Array(1024).fill(void 0);f.push(void 0,null,!0,!1);let R=f.length;function Q(o,_){const e=_(o.length*4,4)>>>0;return K().set(o,e/4),c=o.length,e}function Z(o,_){const e=_(o.length*1,1)>>>0;return O().set(o,e/1),c=o.length,e}function h(o,_){const e=_(o.length*8,8)>>>0;return P().set(o,e/8),c=o.length,e}function v(o,_,e){if(e===void 0){const a=E.encode(o),d=_(a.length,1)>>>0;return O().subarray(d,d+a.length).set(a),c=a.length,d}let r=o.length,n=_(r,1)>>>0;const s=O();let i=0;for(;i<r;i++){const a=o.charCodeAt(i);if(a>127)break;s[n+i]=a}if(i!==r){i!==0&&(o=o.slice(i)),n=e(n,r,r=i+o.length*3,1)>>>0;const a=O().subarray(n+i,n+r),d=E.encodeInto(o,a);i+=d.written,n=e(n,r,i,1)>>>0}return c=i,n}function N(o){const _=H(o);return Y(o),_}let S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});S.decode();const $=2146435072;let T=0;function __(o,_){return T+=_,T>=$&&(S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),S.decode(),T=_),S.decode(O().subarray(o,o+_))}const E=new TextEncoder;"encodeInto"in E||(E.encodeInto=function(o,_){const e=E.encode(o);return _.set(e),{read:o.length,written:e.length}});let c=0,t_,t;function X(o,_){return t=o.exports,t_=_,y=null,M=null,W=null,j=null,F=null,t.__wbindgen_start(),t}async function e_(o,_){if(typeof Response=="function"&&o instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(o,_)}catch(n){if(o.ok&&e(o.type)&&o.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 o.arrayBuffer();return await WebAssembly.instantiate(r,_)}else{const r=await WebAssembly.instantiate(o,_);return r instanceof WebAssembly.Instance?{instance:r,module:o}:r}function e(r){switch(r){case"basic":case"cors":case"default":return!0}return!1}}function r_(o){if(t!==void 0)return t;o!==void 0&&(Object.getPrototypeOf(o)===Object.prototype?{module:o}=o:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const _=L();o instanceof WebAssembly.Module||(o=new WebAssembly.Module(o));const e=new WebAssembly.Instance(o,_);return X(e,o)}async function n_(o){if(t!==void 0)return t;o!==void 0&&(Object.getPrototypeOf(o)===Object.prototype?{module_or_path:o}=o:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),o===void 0&&(o=new URL("chart_engine_bg.wasm",import.meta.url));const _=L();(typeof o=="string"||typeof Request=="function"&&o instanceof Request||typeof URL=="function"&&o instanceof URL)&&(o=fetch(o));const{instance:e,module:r}=await e_(await o,_);return X(e,r)}export{D as ChartEngine,U as OrderbookEngine,n_ as default,r_ as initSync,s_ as wasm_init,i_ as wasm_memory};
1
+ class X{__destroy_into_raw(){const _=this.__mrd_ptr;return this.__mrd_ptr=0,Q.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__mrd_chartengine_free(_,0)}add_anchored_vwap(_,e,r,n,s,i,o){return t.chartengine_add_anchored_vwap(this.__mrd_ptr,_,e,r,n,s,i,o)>>>0}add_arrow(_,e,r,n,s,i,o,c,d,p){return t.chartengine_add_arrow(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p)>>>0}add_arrow_marker_down(_,e,r,n,s,i,o){return t.chartengine_add_arrow_marker_down(this.__mrd_ptr,_,e,r,n,s,i,o)>>>0}add_arrow_marker_up(_,e,r,n,s,i,o){return t.chartengine_add_arrow_marker_up(this.__mrd_ptr,_,e,r,n,s,i,o)>>>0}add_brush_point(_,e){t.chartengine_add_brush_point(this.__mrd_ptr,_,e)}add_circle(_,e,r,n,s,i,o,c,d,p){return t.chartengine_add_circle(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p)>>>0}add_elliott_impulse(_,e,r,n,s,i,o){return t.chartengine_add_elliott_impulse(this.__mrd_ptr,_,e,r,n,s,i,o)>>>0}add_elliott_manual_point(_,e){return t.chartengine_add_elliott_manual_point(this.__mrd_ptr,_,e)!==0}add_fib_extension(_,e,r,n,s,i,o,c,d,p,l,m){return t.chartengine_add_fib_extension(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m)>>>0}add_fib_retracement(_,e,r,n,s,i,o,c,d,p){return t.chartengine_add_fib_retracement(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p)>>>0}add_horizontal_line(_,e,r,n,s,i,o,c){return t.chartengine_add_horizontal_line(this.__mrd_ptr,_,e,r,n,s,i,o,c)>>>0}add_long_position(_,e,r,n,s,i,o,c,d,p){return t.chartengine_add_long_position(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p)>>>0}add_marker(_,e,r){t.chartengine_add_marker(this.__mrd_ptr,_,e,r)}add_parallel_channel(_,e,r,n,s,i,o,c,d,p,l,m){return t.chartengine_add_parallel_channel(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m)>>>0}add_path_point(_,e){t.chartengine_add_path_point(this.__mrd_ptr,_,e)}add_price_label(_,e,r,n,s,i,o){return t.chartengine_add_price_label(this.__mrd_ptr,_,e,r,n,s,i,o)>>>0}add_price_range(_,e,r,n,s,i,o,c,d,p){return t.chartengine_add_price_range(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p)>>>0}add_short_position(_,e,r,n,s,i,o,c,d,p){return t.chartengine_add_short_position(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p)>>>0}add_text_note(_,e,r,n,s,i,o){return t.chartengine_add_text_note(this.__mrd_ptr,_,e,r,n,s,i,o)>>>0}add_trendline(_,e,r,n,s,i,o,c,d,p){return t.chartengine_add_trendline(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p)>>>0}agg_liq_bar_json(_){let e,r;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_agg_liq_bar_json(i,this.__mrd_ptr,_);var n=u().getInt32(i+4*0,!0),s=u().getInt32(i+4*1,!0);return e=n,r=s,q(n,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(e,r,1)}}agg_liq_to_screen_y(_){return t.chartengine_agg_liq_to_screen_y(this.__mrd_ptr,_)}append_heatmap_column(_,e,r,n){const s=h(_,t.__wbindgen_export2),i=a;t.chartengine_append_heatmap_column(this.__mrd_ptr,s,i,e,r,n)}append_kline(_,e,r,n,s,i){t.chartengine_append_kline(this.__mrd_ptr,_,e,r,n,s,i)}append_real_timestamp(_){t.chartengine_append_real_timestamp(this.__mrd_ptr,_)}apply_cvd_profile_update(_,e,r,n){const s=h(n,t.__wbindgen_export2),i=a;t.chartengine_apply_cvd_profile_update(this.__mrd_ptr,_,e,r,s,i)}aux_pane_band(_,e,r,n,s,i,o){const c=w(_,t.__wbindgen_export2,t.__wbindgen_export3),d=a,p=h(e,t.__wbindgen_export2),l=a,m=h(r,t.__wbindgen_export2),b=a;t.chartengine_aux_pane_band(this.__mrd_ptr,c,d,p,l,m,b,n,s,i,o)}aux_pane_box(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f){const x=w(_,t.__wbindgen_export2,t.__wbindgen_export3),k=a;t.chartengine_aux_pane_box(this.__mrd_ptr,x,k,e,r,n,s,i,o,c,d,p,l,m,b,v,f)}aux_pane_h(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_aux_pane_h(this.__mrd_ptr,e,r)}aux_pane_hline(_,e,r,n,s,i,o){const c=w(_,t.__wbindgen_export2,t.__wbindgen_export3),d=a;t.chartengine_aux_pane_hline(this.__mrd_ptr,c,d,e,r,n,s,i,o)}aux_pane_label(_,e,r,n,s,i,o,c,d){const p=w(_,t.__wbindgen_export2,t.__wbindgen_export3),l=a,m=w(r,t.__wbindgen_export2,t.__wbindgen_export3),b=a;t.chartengine_aux_pane_label(this.__mrd_ptr,p,l,e,m,b,n,s,i,o,c,d)}aux_pane_label_xy(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I){const A=w(_,t.__wbindgen_export2,t.__wbindgen_export3),j=a,F=w(n,t.__wbindgen_export2,t.__wbindgen_export3),R=a;t.chartengine_aux_pane_label_xy(this.__mrd_ptr,A,j,e,r,F,R,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I)}aux_pane_line(_,e,r,n,s,i,o,c,d,p,l,m,b){const v=w(_,t.__wbindgen_export2,t.__wbindgen_export3),f=a;t.chartengine_aux_pane_line(this.__mrd_ptr,v,f,e,r,n,s,i,o,c,d,p,l,m,b)}aux_pane_series_line(_,e,r,n,s,i,o){const c=w(_,t.__wbindgen_export2,t.__wbindgen_export3),d=a,p=h(e,t.__wbindgen_export2),l=a;t.chartengine_aux_pane_series_line(this.__mrd_ptr,c,d,p,l,r,n,s,i,o)}aux_pane_to_screen_y(_,e){const r=w(_,t.__wbindgen_export2,t.__wbindgen_export3),n=a;return t.chartengine_aux_pane_to_screen_y(this.__mrd_ptr,r,n,e)}aux_pane_w(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_aux_pane_w(this.__mrd_ptr,e,r)}aux_pane_x(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_aux_pane_x(this.__mrd_ptr,e,r)}aux_pane_y(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_aux_pane_y(this.__mrd_ptr,e,r)}aux_pane_y_max_get(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_aux_pane_y_max_get(this.__mrd_ptr,e,r)}aux_pane_y_min_get(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_aux_pane_y_min_get(this.__mrd_ptr,e,r)}aux_pane_yaxis_w(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_aux_pane_yaxis_w(this.__mrd_ptr,e,r)}aux_pane_yaxis_x(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_aux_pane_yaxis_x(this.__mrd_ptr,e,r)}cancel_brush(){t.chartengine_cancel_brush(this.__mrd_ptr)}cancel_elliott_manual(){t.chartengine_cancel_elliott_manual(this.__mrd_ptr)}cancel_path(){t.chartengine_cancel_path(this.__mrd_ptr)}chart_area_h(){return t.chartengine_chart_area_h(this.__mrd_ptr)}chart_area_w(){return t.chartengine_chart_area_w(this.__mrd_ptr)}chart_area_x(){return t.chartengine_chart_area_x(this.__mrd_ptr)}chart_area_y(){return t.chartengine_chart_area_y(this.__mrd_ptr)}clear_agg_liq(){t.chartengine_clear_agg_liq(this.__mrd_ptr)}clear_agg_liq_signals(){t.chartengine_clear_agg_liq_signals(this.__mrd_ptr)}clear_channel_preview(){t.chartengine_clear_channel_preview(this.__mrd_ptr)}clear_cvd_divergence(){t.chartengine_clear_cvd_divergence(this.__mrd_ptr)}clear_cvd_orderblock_all(){t.chartengine_clear_cvd_orderblock_all(this.__mrd_ptr)}clear_cvd_orderblock_obs(){t.chartengine_clear_cvd_orderblock_obs(this.__mrd_ptr)}clear_cvd_profile(){t.chartengine_clear_cvd_profile(this.__mrd_ptr)}clear_cvd_regime(){t.chartengine_clear_cvd_regime(this.__mrd_ptr)}clear_cvd_trade_signals(){t.chartengine_clear_cvd_trade_signals(this.__mrd_ptr)}clear_drawing_preview(){t.chartengine_clear_drawing_preview(this.__mrd_ptr)}clear_drawings(){t.chartengine_clear_drawings(this.__mrd_ptr)}clear_elliott_preview(){t.chartengine_clear_elliott_preview(this.__mrd_ptr)}clear_fib_ext_preview(){t.chartengine_clear_fib_ext_preview(this.__mrd_ptr)}clear_fr_data(){t.chartengine_clear_fr_data(this.__mrd_ptr)}clear_heatmap_prefetch_range(){t.chartengine_clear_heatmap_prefetch_range(this.__mrd_ptr)}clear_heatmap_walls(){t.chartengine_clear_heatmap_walls(this.__mrd_ptr)}clear_hover_price(){t.chartengine_clear_hover_price(this.__mrd_ptr)}clear_large_trades(){t.chartengine_clear_large_trades(this.__mrd_ptr)}clear_live_signals(){t.chartengine_clear_live_signals(this.__mrd_ptr)}clear_markers(){t.chartengine_clear_markers(this.__mrd_ptr)}clear_mrd_pullback_htf_klines(){t.chartengine_clear_mrd_pullback_htf_klines(this.__mrd_ptr)}clear_ob_flow(){t.chartengine_clear_ob_flow(this.__mrd_ptr)}clear_ob_micro(){t.chartengine_clear_ob_micro(this.__mrd_ptr)}clear_ob_signals(){t.chartengine_clear_ob_signals(this.__mrd_ptr)}crosshair_world_y(){return t.chartengine_crosshair_world_y(this.__mrd_ptr)}custom_arrow(_,e,r,n,s,i,o,c,d,p){t.chartengine_custom_arrow(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p)}custom_band(_,e,r,n,s,i){const o=h(_,t.__wbindgen_export2),c=a,d=h(e,t.__wbindgen_export2),p=a;t.chartengine_custom_band(this.__mrd_ptr,o,c,d,p,r,n,s,i)}custom_begin(){t.chartengine_custom_begin(this.__mrd_ptr)}custom_bg_color_batch(_,e,r,n,s,i){const o=S(_,t.__wbindgen_export2),c=a,d=S(e,t.__wbindgen_export2),p=a;t.chartengine_custom_bg_color_batch(this.__mrd_ptr,o,c,d,p,r,n,s,i)}custom_box(_,e,r,n,s,i,o,c,d,p,l,m,b,v){t.chartengine_custom_box(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m,b,v)}custom_candles(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k){const y=h(_,t.__wbindgen_export2),z=a,I=h(e,t.__wbindgen_export2),A=a,j=h(r,t.__wbindgen_export2),F=a,R=h(n,t.__wbindgen_export2),W=a;t.chartengine_custom_candles(this.__mrd_ptr,y,z,I,A,j,F,R,W,s,i,o,c,d,p,l,m,b,v,f,x,k)}custom_circle_px(_,e,r,n,s,i,o,c,d,p,l,m){t.chartengine_custom_circle_px(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m)}custom_clip_rect(_,e,r,n){t.chartengine_custom_clip_rect(this.__mrd_ptr,_,e,r,n)}custom_command_count(){return t.chartengine_custom_command_count(this.__mrd_ptr)>>>0}custom_dashed_hline(_,e,r,n,s,i,o,c){t.chartengine_custom_dashed_hline(this.__mrd_ptr,_,e,r,n,s,i,o,c)}custom_end(){t.chartengine_custom_end(this.__mrd_ptr)}custom_fill_rect_px(_,e,r,n,s,i,o,c){t.chartengine_custom_fill_rect_px(this.__mrd_ptr,_,e,r,n,s,i,o,c)}custom_hline(_,e,r,n,s,i){t.chartengine_custom_hline(this.__mrd_ptr,_,e,r,n,s,i)}custom_label(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z){const I=w(r,t.__wbindgen_export2,t.__wbindgen_export3),A=a;t.chartengine_custom_label(this.__mrd_ptr,_,e,I,A,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z)}custom_line(_,e,r,n,s,i,o,c,d,p,l,m){t.chartengine_custom_line(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m)}custom_line_px(_,e,r,n,s,i,o,c,d){t.chartengine_custom_line_px(this.__mrd_ptr,_,e,r,n,s,i,o,c,d)}custom_marker(_,e,r,n,s,i,o){t.chartengine_custom_marker(this.__mrd_ptr,_,e,r,n,s,i,o)}custom_marker_down(_,e,r,n,s,i,o){t.chartengine_custom_marker_down(this.__mrd_ptr,_,e,r,n,s,i,o)}custom_marker_up(_,e,r,n,s,i,o){t.chartengine_custom_marker_up(this.__mrd_ptr,_,e,r,n,s,i,o)}custom_markers_batch(_,e,r,n,s,i,o,c){const d=S(_,t.__wbindgen_export2),p=a,l=h(e,t.__wbindgen_export2),m=a;t.chartengine_custom_markers_batch(this.__mrd_ptr,d,p,l,m,r,n,s,i,o,c)}custom_pane_band(_,e,r,n,s,i){const o=h(_,t.__wbindgen_export2),c=a,d=h(e,t.__wbindgen_export2),p=a;t.chartengine_custom_pane_band(this.__mrd_ptr,o,c,d,p,r,n,s,i)}custom_pane_box(_,e,r,n,s,i,o,c,d,p,l,m,b,v){t.chartengine_custom_pane_box(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m,b,v)}custom_pane_candles(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k){const y=h(_,t.__wbindgen_export2),z=a,I=h(e,t.__wbindgen_export2),A=a,j=h(r,t.__wbindgen_export2),F=a,R=h(n,t.__wbindgen_export2),W=a;t.chartengine_custom_pane_candles(this.__mrd_ptr,y,z,I,A,j,F,R,W,s,i,o,c,d,p,l,m,b,v,f,x,k)}custom_pane_dashed_hline(_,e,r,n,s,i,o,c){t.chartengine_custom_pane_dashed_hline(this.__mrd_ptr,_,e,r,n,s,i,o,c)}custom_pane_h(){return t.chartengine_custom_pane_h(this.__mrd_ptr)}custom_pane_hline(_,e,r,n,s,i){t.chartengine_custom_pane_hline(this.__mrd_ptr,_,e,r,n,s,i)}custom_pane_label(_,e,r,n,s,i,o,c){const d=w(e,t.__wbindgen_export2,t.__wbindgen_export3),p=a;t.chartengine_custom_pane_label(this.__mrd_ptr,_,d,p,r,n,s,i,o,c)}custom_pane_label_xy(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z){const I=w(r,t.__wbindgen_export2,t.__wbindgen_export3),A=a;t.chartengine_custom_pane_label_xy(this.__mrd_ptr,_,e,I,A,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z)}custom_pane_line(_,e,r,n,s,i,o,c,d,p,l,m){t.chartengine_custom_pane_line(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m)}custom_pane_series_dashed_line(_,e,r,n,s,i,o,c){const d=h(_,t.__wbindgen_export2),p=a;t.chartengine_custom_pane_series_dashed_line(this.__mrd_ptr,d,p,e,r,n,s,i,o,c)}custom_pane_series_line(_,e,r,n,s,i){const o=h(_,t.__wbindgen_export2),c=a;t.chartengine_custom_pane_series_line(this.__mrd_ptr,o,c,e,r,n,s,i)}custom_pane_to_screen_y(_){return t.chartengine_custom_pane_to_screen_y(this.__mrd_ptr,_)}custom_pane_vline(_,e,r,n,s,i,o,c){t.chartengine_custom_pane_vline(this.__mrd_ptr,_,e,r,n,s,i,o,c)}custom_pane_w(){return t.chartengine_custom_pane_w(this.__mrd_ptr)}custom_pane_x(){return t.chartengine_custom_pane_x(this.__mrd_ptr)}custom_pane_y(){return t.chartengine_custom_pane_y(this.__mrd_ptr)}custom_pane_y_max(){return t.chartengine_custom_pane_y_max(this.__mrd_ptr)}custom_pane_y_min(){return t.chartengine_custom_pane_y_min(this.__mrd_ptr)}custom_pane_yaxis_w(){return t.chartengine_custom_pane_yaxis_w(this.__mrd_ptr)}custom_pane_yaxis_x(){return t.chartengine_custom_pane_yaxis_x(this.__mrd_ptr)}custom_plotchar_batch(_,e,r,n,s,i,o,c){const d=S(_,t.__wbindgen_export2),p=a,l=h(e,t.__wbindgen_export2),m=a,b=w(r,t.__wbindgen_export2,t.__wbindgen_export3),v=a;t.chartengine_custom_plotchar_batch(this.__mrd_ptr,d,p,l,m,b,v,n,s,i,o,c)}custom_polygon_world(_,e,r,n,s,i,o,c,d,p,l){const m=h(_,t.__wbindgen_export2),b=a,v=h(e,t.__wbindgen_export2),f=a;t.chartengine_custom_polygon_world(this.__mrd_ptr,m,b,v,f,r,n,s,i,o,c,d,p,l)}custom_polyline_world(_,e,r,n,s,i,o,c,d,p){const l=h(_,t.__wbindgen_export2),m=a,b=h(e,t.__wbindgen_export2),v=a;t.chartengine_custom_polyline_world(this.__mrd_ptr,l,m,b,v,r,n,s,i,o,c,d,p)}custom_price_label(_,e,r,n,s,i,o){const c=w(e,t.__wbindgen_export2,t.__wbindgen_export3),d=a;t.chartengine_custom_price_label(this.__mrd_ptr,_,c,d,r,n,s,i,o)}custom_restore(){t.chartengine_custom_restore(this.__mrd_ptr)}custom_save(){t.chartengine_custom_save(this.__mrd_ptr)}custom_series_dashed_line(_,e,r,n,s,i,o,c){const d=h(_,t.__wbindgen_export2),p=a;t.chartengine_custom_series_dashed_line(this.__mrd_ptr,d,p,e,r,n,s,i,o,c)}custom_series_line(_,e,r,n,s,i){const o=h(_,t.__wbindgen_export2),c=a;t.chartengine_custom_series_line(this.__mrd_ptr,o,c,e,r,n,s,i)}custom_shape_batch(_,e,r,n,s,i,o,c){const d=S(_,t.__wbindgen_export2),p=a,l=h(e,t.__wbindgen_export2),m=a;t.chartengine_custom_shape_batch(this.__mrd_ptr,d,p,l,m,r,n,s,i,o,c)}custom_stroke_rect_px(_,e,r,n,s,i,o,c,d){t.chartengine_custom_stroke_rect_px(this.__mrd_ptr,_,e,r,n,s,i,o,c,d)}custom_text(_,e,r,n,s,i,o,c,d){const p=w(r,t.__wbindgen_export2,t.__wbindgen_export3),l=a;t.chartengine_custom_text(this.__mrd_ptr,_,e,p,l,n,s,i,o,c,d)}custom_text_px(_,e,r,n,s,i,o,c,d){const p=w(r,t.__wbindgen_export2,t.__wbindgen_export3),l=a;t.chartengine_custom_text_px(this.__mrd_ptr,_,e,p,l,n,s,i,o,c,d)}custom_texts_batch(_,e,r,n,s,i,o,c,d){const p=S(_,t.__wbindgen_export2),l=a,m=h(e,t.__wbindgen_export2),b=a,v=w(r,t.__wbindgen_export2,t.__wbindgen_export3),f=a;t.chartengine_custom_texts_batch(this.__mrd_ptr,p,l,m,b,v,f,n,s,i,o,c,d)}custom_vline(_,e,r,n,s,i,o,c){t.chartengine_custom_vline(this.__mrd_ptr,_,e,r,n,s,i,o,c)}cvd_divergence_count(){return t.chartengine_cvd_divergence_count(this.__mrd_ptr)>>>0}cvd_divergence_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_cvd_divergence_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}cvd_orderblock_gap_count(){return t.chartengine_cvd_orderblock_gap_count(this.__mrd_ptr)>>>0}cvd_orderblock_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_cvd_orderblock_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}cvd_orderblock_ob_count(){return t.chartengine_cvd_orderblock_ob_count(this.__mrd_ptr)>>>0}cvd_profile_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_cvd_profile_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}cvd_regime_flip_count(){return t.chartengine_cvd_regime_flip_count(this.__mrd_ptr)>>>0}cvd_regime_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_cvd_regime_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}cvd_trade_signal_count(){return t.chartengine_cvd_trade_signal_count(this.__mrd_ptr)>>>0}cvd_trade_signals_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_cvd_trade_signals_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}delta_histogram_enabled(){return t.chartengine_delta_histogram_enabled(this.__mrd_ptr)!==0}deselect_drawing(){t.chartengine_deselect_drawing(this.__mrd_ptr)}deselect_marker(){t.chartengine_deselect_marker(this.__mrd_ptr)}disable_agg_liq(){t.chartengine_disable_agg_liq(this.__mrd_ptr)}disable_aux_pane(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;t.chartengine_disable_aux_pane(this.__mrd_ptr,e,r)}disable_custom_pane(){t.chartengine_disable_custom_pane(this.__mrd_ptr)}disable_cvd(){t.chartengine_disable_cvd(this.__mrd_ptr)}disable_cvd_divergence(){t.chartengine_disable_cvd_divergence(this.__mrd_ptr)}disable_cvd_orderblock(){t.chartengine_disable_cvd_orderblock(this.__mrd_ptr)}disable_cvd_profile(){t.chartengine_disable_cvd_profile(this.__mrd_ptr)}disable_cvd_regime(){t.chartengine_disable_cvd_regime(this.__mrd_ptr)}disable_cvd_trade_signals(){t.chartengine_disable_cvd_trade_signals(this.__mrd_ptr)}disable_delta_histogram(){t.chartengine_disable_delta_histogram(this.__mrd_ptr)}disable_ema_structure(){t.chartengine_disable_ema_structure(this.__mrd_ptr)}disable_forex_signals(){t.chartengine_disable_forex_signals(this.__mrd_ptr)}disable_funding_rate(){t.chartengine_disable_funding_rate(this.__mrd_ptr)}disable_large_trades(){t.chartengine_disable_large_trades(this.__mrd_ptr)}disable_liq_heatmap(){t.chartengine_disable_liq_heatmap(this.__mrd_ptr)}disable_live_signals(){t.chartengine_disable_live_signals(this.__mrd_ptr)}disable_mrd_pullback(){t.chartengine_disable_mrd_pullback(this.__mrd_ptr)}disable_ob_flow(){t.chartengine_disable_ob_flow(this.__mrd_ptr)}disable_ob_micro(){t.chartengine_disable_ob_micro(this.__mrd_ptr)}disable_ob_signals(){t.chartengine_disable_ob_signals(this.__mrd_ptr)}disable_oi(){t.chartengine_disable_oi(this.__mrd_ptr)}disable_oi_cvd_pattern(){t.chartengine_disable_oi_cvd_pattern(this.__mrd_ptr)}disable_rsi(){t.chartengine_disable_rsi(this.__mrd_ptr)}disable_smart_ranges(){t.chartengine_disable_smart_ranges(this.__mrd_ptr)}disable_stop_iceberg(){t.chartengine_disable_stop_iceberg(this.__mrd_ptr)}disable_tpo(){t.chartengine_disable_tpo(this.__mrd_ptr)}disable_volume(){t.chartengine_disable_volume(this.__mrd_ptr)}disable_vpin(){t.chartengine_disable_vpin(this.__mrd_ptr)}disable_vrvp(){t.chartengine_disable_vrvp(this.__mrd_ptr)}drawing_count(){return t.chartengine_drawing_count(this.__mrd_ptr)>>>0}drawing_descriptor(_){let e,r;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_drawing_descriptor(i,this.__mrd_ptr,_);var n=u().getInt32(i+4*0,!0),s=u().getInt32(i+4*1,!0);return e=n,r=s,q(n,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(e,r,1)}}enable_agg_liq(){t.chartengine_enable_agg_liq(this.__mrd_ptr)}enable_aux_pane(_,e){const r=w(_,t.__wbindgen_export2,t.__wbindgen_export3),n=a;t.chartengine_enable_aux_pane(this.__mrd_ptr,r,n,e)}enable_custom_pane(){t.chartengine_enable_custom_pane(this.__mrd_ptr)}enable_cvd(){t.chartengine_enable_cvd(this.__mrd_ptr)}enable_cvd_divergence(){t.chartengine_enable_cvd_divergence(this.__mrd_ptr)}enable_cvd_orderblock(){t.chartengine_enable_cvd_orderblock(this.__mrd_ptr)}enable_cvd_profile(){t.chartengine_enable_cvd_profile(this.__mrd_ptr)}enable_cvd_regime(){t.chartengine_enable_cvd_regime(this.__mrd_ptr)}enable_cvd_trade_signals(){t.chartengine_enable_cvd_trade_signals(this.__mrd_ptr)}enable_delta_histogram(){t.chartengine_enable_delta_histogram(this.__mrd_ptr)}enable_ema_structure(){t.chartengine_enable_ema_structure(this.__mrd_ptr)}enable_forex_signals(){t.chartengine_enable_forex_signals(this.__mrd_ptr)}enable_funding_rate(){t.chartengine_enable_funding_rate(this.__mrd_ptr)}enable_large_trades(){t.chartengine_enable_large_trades(this.__mrd_ptr)}enable_liq_heatmap(){t.chartengine_enable_liq_heatmap(this.__mrd_ptr)}enable_live_signals(){t.chartengine_enable_live_signals(this.__mrd_ptr)}enable_mrd_pullback(){t.chartengine_enable_mrd_pullback(this.__mrd_ptr)}enable_ob_flow(){t.chartengine_enable_ob_flow(this.__mrd_ptr)}enable_ob_micro(){t.chartengine_enable_ob_micro(this.__mrd_ptr)}enable_ob_signals(){t.chartengine_enable_ob_signals(this.__mrd_ptr)}enable_oi(){t.chartengine_enable_oi(this.__mrd_ptr)}enable_oi_cvd_pattern(){t.chartengine_enable_oi_cvd_pattern(this.__mrd_ptr)}enable_rsi(){t.chartengine_enable_rsi(this.__mrd_ptr)}enable_smart_ranges(){t.chartengine_enable_smart_ranges(this.__mrd_ptr)}enable_stop_iceberg(){t.chartengine_enable_stop_iceberg(this.__mrd_ptr)}enable_tpo(){t.chartengine_enable_tpo(this.__mrd_ptr)}enable_volume(){t.chartengine_enable_volume(this.__mrd_ptr)}enable_vpin(){t.chartengine_enable_vpin(this.__mrd_ptr)}enable_vrvp(){t.chartengine_enable_vrvp(this.__mrd_ptr)}export_drawings_json(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_export_drawings_json(s,this.__mrd_ptr);var r=u().getInt32(s+4*0,!0),n=u().getInt32(s+4*1,!0);return _=r,e=n,q(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}finish_brush(){return t.chartengine_finish_brush(this.__mrd_ptr)>>>0}finish_elliott_manual(){return t.chartengine_finish_elliott_manual(this.__mrd_ptr)>>>0}finish_path(){return t.chartengine_finish_path(this.__mrd_ptr)>>>0}fit_content(){t.chartengine_fit_content(this.__mrd_ptr)}footprint_add_trade(_,e,r,n){t.chartengine_footprint_add_trade(this.__mrd_ptr,_,e,r,n)}footprint_add_trade_batch(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_footprint_add_trade_batch(this.__mrd_ptr,e,r)}footprint_clear(){t.chartengine_footprint_clear(this.__mrd_ptr)}footprint_clear_bar(_){t.chartengine_footprint_clear_bar(this.__mrd_ptr,_)}footprint_ensure_len(_){t.chartengine_footprint_ensure_len(this.__mrd_ptr,_)}footprint_get_cell_text_format(){return t.chartengine_footprint_get_cell_text_format(this.__mrd_ptr)}footprint_get_display_mode(){return t.chartengine_footprint_get_display_mode(this.__mrd_ptr)}footprint_get_min_cell_volume_pct(){return t.chartengine_footprint_get_min_cell_volume_pct(this.__mrd_ptr)}footprint_get_naked_poc_enabled(){return t.chartengine_footprint_get_naked_poc_enabled(this.__mrd_ptr)!==0}footprint_get_poc_marker_style(){return t.chartengine_footprint_get_poc_marker_style(this.__mrd_ptr)}footprint_get_show_profile(){return t.chartengine_footprint_get_show_profile(this.__mrd_ptr)!==0}footprint_get_show_signals(){return t.chartengine_footprint_get_show_signals(this.__mrd_ptr)!==0}footprint_get_signal_kinds_mask(){return t.chartengine_footprint_get_signal_kinds_mask(this.__mrd_ptr)}footprint_get_stacked_imbalance_enabled(){return t.chartengine_footprint_get_stacked_imbalance_enabled(this.__mrd_ptr)!==0}footprint_get_stacked_imbalance_highlight_cells(){return t.chartengine_footprint_get_stacked_imbalance_highlight_cells(this.__mrd_ptr)!==0}footprint_get_stacked_imbalance_show_bracket(){return t.chartengine_footprint_get_stacked_imbalance_show_bracket(this.__mrd_ptr)!==0}footprint_get_stacked_imbalance_show_ray(){return t.chartengine_footprint_get_stacked_imbalance_show_ray(this.__mrd_ptr)!==0}footprint_get_volume_color_mode(){return t.chartengine_footprint_get_volume_color_mode(this.__mrd_ptr)}footprint_prepend_empty(_){t.chartengine_footprint_prepend_empty(this.__mrd_ptr,_)}footprint_profile_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_footprint_profile_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}footprint_set_bar(_,e,r,n,s){const i=h(r,t.__wbindgen_export2),o=a,c=h(n,t.__wbindgen_export2),d=a,p=h(s,t.__wbindgen_export2),l=a;t.chartengine_footprint_set_bar(this.__mrd_ptr,_,e,i,o,c,d,p,l)}footprint_set_cell_text_format(_){t.chartengine_footprint_set_cell_text_format(this.__mrd_ptr,_)}footprint_set_display_mode(_){t.chartengine_footprint_set_display_mode(this.__mrd_ptr,_)}footprint_set_font_scale(_){t.chartengine_footprint_set_font_scale(this.__mrd_ptr,_)}footprint_set_min_cell_volume_pct(_){t.chartengine_footprint_set_min_cell_volume_pct(this.__mrd_ptr,_)}footprint_set_naked_poc_enabled(_){t.chartengine_footprint_set_naked_poc_enabled(this.__mrd_ptr,_)}footprint_set_poc_marker_style(_){t.chartengine_footprint_set_poc_marker_style(this.__mrd_ptr,_)}footprint_set_show_profile(_){t.chartengine_footprint_set_show_profile(this.__mrd_ptr,_)}footprint_set_show_signals(_){t.chartengine_footprint_set_show_signals(this.__mrd_ptr,_)}footprint_set_signal_kinds_mask(_){t.chartengine_footprint_set_signal_kinds_mask(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_enabled(_){t.chartengine_footprint_set_stacked_imbalance_enabled(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_highlight_cells(_){t.chartengine_footprint_set_stacked_imbalance_highlight_cells(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_max_age(_){t.chartengine_footprint_set_stacked_imbalance_max_age(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_min_stack(_){t.chartengine_footprint_set_stacked_imbalance_min_stack(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_mode(_){t.chartengine_footprint_set_stacked_imbalance_mode(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_ratio(_){t.chartengine_footprint_set_stacked_imbalance_ratio(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_show_box(_){t.chartengine_footprint_set_stacked_imbalance_show_box(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_show_bracket(_){t.chartengine_footprint_set_stacked_imbalance_show_bracket(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_show_filled(_){t.chartengine_footprint_set_stacked_imbalance_show_filled(this.__mrd_ptr,_)}footprint_set_stacked_imbalance_show_ray(_){t.chartengine_footprint_set_stacked_imbalance_show_ray(this.__mrd_ptr,_)}footprint_set_volume_color_mode(_){t.chartengine_footprint_set_volume_color_mode(this.__mrd_ptr,_)}footprint_signal_count(){return t.chartengine_footprint_signal_count(this.__mrd_ptr)>>>0}footprint_stacked_zone_count(){return t.chartengine_footprint_stacked_zone_count(this.__mrd_ptr)>>>0}get_agg_liq_mode(){return t.chartengine_get_agg_liq_mode(this.__mrd_ptr)}get_agg_liq_ratio(){return t.chartengine_get_agg_liq_ratio(this.__mrd_ptr)}get_chart_type(){return t.chartengine_get_chart_type(this.__mrd_ptr)}get_command_buffer_len(){return t.chartengine_get_command_buffer_len(this.__mrd_ptr)>>>0}get_command_buffer_ptr(){return t.chartengine_get_command_buffer_ptr(this.__mrd_ptr)>>>0}get_custom_buffer_len(){return t.chartengine_get_custom_buffer_len(this.__mrd_ptr)>>>0}get_custom_buffer_ptr(){return t.chartengine_get_custom_buffer_ptr(this.__mrd_ptr)>>>0}get_custom_pane_ratio(){return t.chartengine_get_custom_pane_ratio(this.__mrd_ptr)}get_cvd_mode(){return t.chartengine_get_cvd_mode(this.__mrd_ptr)}get_cvd_profile_view_mode(){return t.chartengine_get_cvd_profile_view_mode(this.__mrd_ptr)}get_cvd_ratio(){return t.chartengine_get_cvd_ratio(this.__mrd_ptr)}get_cvd_show_delta(){return t.chartengine_get_cvd_show_delta(this.__mrd_ptr)!==0}get_cvd_show_divergence(){return t.chartengine_get_cvd_show_divergence(this.__mrd_ptr)!==0}get_cvd_show_signals(){return t.chartengine_get_cvd_show_signals(this.__mrd_ptr)!==0}get_cvd_source(){return t.chartengine_get_cvd_source(this.__mrd_ptr)}get_drawing_color(_){return t.chartengine_get_drawing_color(this.__mrd_ptr,_)>>>0}get_drawing_dashed(_){return t.chartengine_get_drawing_dashed(this.__mrd_ptr,_)!==0}get_drawing_flip_left(_){return t.chartengine_get_drawing_flip_left(this.__mrd_ptr,_)!==0}get_drawing_font_size(_){return t.chartengine_get_drawing_font_size(this.__mrd_ptr,_)}get_drawing_hide_label(_){return t.chartengine_get_drawing_hide_label(this.__mrd_ptr,_)!==0}get_drawing_kind_id(_){return t.chartengine_get_drawing_kind_id(this.__mrd_ptr,_)}get_drawing_text(_){let e,r;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_drawing_text(i,this.__mrd_ptr,_);var n=u().getInt32(i+4*0,!0),s=u().getInt32(i+4*1,!0);return e=n,r=s,q(n,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(e,r,1)}}get_drawing_text_wrap(_){return t.chartengine_get_drawing_text_wrap(this.__mrd_ptr,_)!==0}get_font_size(){return t.chartengine_get_font_size(this.__mrd_ptr)}get_forex_signals_count(){return t.chartengine_get_forex_signals_count(this.__mrd_ptr)>>>0}get_fr_display_style(){return t.chartengine_get_fr_display_style(this.__mrd_ptr)}get_fr_ratio(){return t.chartengine_get_fr_ratio(this.__mrd_ptr)}get_heatmap_data_max(){return t.chartengine_get_heatmap_data_max(this.__mrd_ptr)}get_heatmap_data_min(){return t.chartengine_get_heatmap_data_min(this.__mrd_ptr)}get_heatmap_last_timestamp(){return t.chartengine_get_heatmap_last_timestamp(this.__mrd_ptr)}get_heatmap_prefetch_max(){return t.chartengine_get_heatmap_prefetch_max(this.__mrd_ptr)}get_heatmap_profile_bar_length(){return t.chartengine_get_heatmap_profile_bar_length(this.__mrd_ptr)}get_heatmap_profile_brightness(){return t.chartengine_get_heatmap_profile_brightness(this.__mrd_ptr)}get_heatmap_wall_count(){return t.chartengine_get_heatmap_wall_count(this.__mrd_ptr)>>>0}get_heatmap_x_step(){return t.chartengine_get_heatmap_x_step(this.__mrd_ptr)}get_iceberg_count(){return t.chartengine_get_iceberg_count(this.__mrd_ptr)>>>0}get_kline_visible(){return t.chartengine_get_kline_visible(this.__mrd_ptr)!==0}get_last_candle_json(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_last_candle_json(s,this.__mrd_ptr);var r=u().getInt32(s+4*0,!0),n=u().getInt32(s+4*1,!0);return _=r,e=n,q(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}get_last_close(){return t.chartengine_get_last_close(this.__mrd_ptr)}get_liq_heatmap_bar_width(){return t.chartengine_get_liq_heatmap_bar_width(this.__mrd_ptr)}get_liq_heatmap_cell_height(){return t.chartengine_get_liq_heatmap_cell_height(this.__mrd_ptr)}get_liq_heatmap_filled_pct(){return t.chartengine_get_liq_heatmap_filled_pct(this.__mrd_ptr)}get_liq_heatmap_max(){return t.chartengine_get_liq_heatmap_max(this.__mrd_ptr)}get_liq_heatmap_min(){return t.chartengine_get_liq_heatmap_min(this.__mrd_ptr)}get_liq_heatmap_seg_max(){return t.chartengine_get_liq_heatmap_seg_max(this.__mrd_ptr)}get_live_signals_count(){return t.chartengine_get_live_signals_count(this.__mrd_ptr)>>>0}get_live_signals_leverage(){return t.chartengine_get_live_signals_leverage(this.__mrd_ptr)}get_lt_data_max_vol(){return t.chartengine_get_lt_data_max_vol(this.__mrd_ptr)}get_lt_data_min_vol(){return t.chartengine_get_lt_data_min_vol(this.__mrd_ptr)}get_obf_ratio(){return t.chartengine_get_obf_ratio(this.__mrd_ptr)}get_oi_ratio(){return t.chartengine_get_oi_ratio(this.__mrd_ptr)}get_rsi_ratio(){return t.chartengine_get_rsi_ratio(this.__mrd_ptr)}get_selected_drawing(){return t.chartengine_get_selected_drawing(this.__mrd_ptr)>>>0}get_selected_marker(){return t.chartengine_get_selected_marker(this.__mrd_ptr)>>>0}get_sr_signals_count(){return t.chartengine_get_sr_signals_count(this.__mrd_ptr)>>>0}get_stop_run_count(){return t.chartengine_get_stop_run_count(this.__mrd_ptr)>>>0}get_theme(){return t.chartengine_get_theme(this.__mrd_ptr)}get_tooltip_data(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_tooltip_data(s,this.__mrd_ptr);var r=u().getInt32(s+4*0,!0),n=u().getInt32(s+4*1,!0);return _=r,e=n,q(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}get_tpo_period(){return t.chartengine_get_tpo_period(this.__mrd_ptr)>>>0}get_volume_color_mode(){return t.chartengine_get_volume_color_mode(this.__mrd_ptr)}get_volume_ma_period(){return t.chartengine_get_volume_ma_period(this.__mrd_ptr)>>>0}get_volume_show_ma(){return t.chartengine_get_volume_show_ma(this.__mrd_ptr)!==0}get_volume_show_signals(){return t.chartengine_get_volume_show_signals(this.__mrd_ptr)!==0}get_vpin_bucket_size(){return t.chartengine_get_vpin_bucket_size(this.__mrd_ptr)>>>0}get_vpin_num_buckets(){return t.chartengine_get_vpin_num_buckets(this.__mrd_ptr)>>>0}get_vpin_ratio(){return t.chartengine_get_vpin_ratio(this.__mrd_ptr)}get_vpin_threshold(){return t.chartengine_get_vpin_threshold(this.__mrd_ptr)}get_vrvp_events_json(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_vrvp_events_json(s,this.__mrd_ptr);var r=u().getInt32(s+4*0,!0),n=u().getInt32(s+4*1,!0);return _=r,e=n,q(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}hide_crosshair(){t.chartengine_hide_crosshair(this.__mrd_ptr)}hit_test_drawing(_,e){return t.chartengine_hit_test_drawing(this.__mrd_ptr,_,e)>>>0}hit_test_drawing_anchor(_,e){return t.chartengine_hit_test_drawing_anchor(this.__mrd_ptr,_,e)}hit_test_marker(_,e){return t.chartengine_hit_test_marker(this.__mrd_ptr,_,e)>>>0}hit_zone(_,e){return t.chartengine_hit_zone(this.__mrd_ptr,_,e)}hover_hit_test(_,e){try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_hover_hit_test(i,this.__mrd_ptr,_,e);var r=u().getInt32(i+4*0,!0),n=u().getInt32(i+4*1,!0),s=v_(r,n).slice();return t.__wbindgen_export(r,n*4,4),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}import_drawings_json(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;t.chartengine_import_drawings_json(this.__mrd_ptr,e,r)}is_agg_liq_enabled(){return t.chartengine_is_agg_liq_enabled(this.__mrd_ptr)!==0}is_agg_liq_show_signals(){return t.chartengine_is_agg_liq_show_signals(this.__mrd_ptr)!==0}is_agg_liq_signals_on_chart(){return t.chartengine_is_agg_liq_signals_on_chart(this.__mrd_ptr)!==0}is_aux_pane_enabled(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_is_aux_pane_enabled(this.__mrd_ptr,e,r)!==0}is_custom_pane_enabled(){return t.chartengine_is_custom_pane_enabled(this.__mrd_ptr)!==0}is_cvd_divergence_enabled(){return t.chartengine_is_cvd_divergence_enabled(this.__mrd_ptr)!==0}is_cvd_enabled(){return t.chartengine_is_cvd_enabled(this.__mrd_ptr)!==0}is_cvd_orderblock_enabled(){return t.chartengine_is_cvd_orderblock_enabled(this.__mrd_ptr)!==0}is_cvd_profile_enabled(){return t.chartengine_is_cvd_profile_enabled(this.__mrd_ptr)!==0}is_cvd_regime_enabled(){return t.chartengine_is_cvd_regime_enabled(this.__mrd_ptr)!==0}is_cvd_trade_signals_enabled(){return t.chartengine_is_cvd_trade_signals_enabled(this.__mrd_ptr)!==0}is_dirty(){return t.chartengine_is_dirty(this.__mrd_ptr)!==0}is_ema_structure_enabled(){return t.chartengine_is_ema_structure_enabled(this.__mrd_ptr)!==0}is_forex_signals_enabled(){return t.chartengine_is_forex_signals_enabled(this.__mrd_ptr)!==0}is_funding_rate_enabled(){return t.chartengine_is_funding_rate_enabled(this.__mrd_ptr)!==0}is_heatmap_show_profile(){return t.chartengine_is_heatmap_show_profile(this.__mrd_ptr)!==0}is_in_quick_trade_btn(_,e){return t.chartengine_is_in_quick_trade_btn(this.__mrd_ptr,_,e)!==0}is_large_trades_enabled(){return t.chartengine_is_large_trades_enabled(this.__mrd_ptr)!==0}is_liq_heatmap_enabled(){return t.chartengine_is_liq_heatmap_enabled(this.__mrd_ptr)!==0}is_liq_heatmap_filled_zones(){return t.chartengine_is_liq_heatmap_filled_zones(this.__mrd_ptr)!==0}is_liq_heatmap_predictions(){return t.chartengine_is_liq_heatmap_predictions(this.__mrd_ptr)!==0}is_liq_heatmap_profile(){return t.chartengine_is_liq_heatmap_profile(this.__mrd_ptr)!==0}is_live_signals_enabled(){return t.chartengine_is_live_signals_enabled(this.__mrd_ptr)!==0}is_mrd_pullback_enabled(){return t.chartengine_is_mrd_pullback_enabled(this.__mrd_ptr)!==0}is_ob_flow_enabled(){return t.chartengine_is_ob_flow_enabled(this.__mrd_ptr)!==0}is_ob_micro_enabled(){return t.chartengine_is_ob_micro_enabled(this.__mrd_ptr)!==0}is_ob_signals_enabled(){return t.chartengine_is_ob_signals_enabled(this.__mrd_ptr)!==0}is_oi_cvd_pattern_enabled(){return t.chartengine_is_oi_cvd_pattern_enabled(this.__mrd_ptr)!==0}is_oi_enabled(){return t.chartengine_is_oi_enabled(this.__mrd_ptr)!==0}is_rsi_enabled(){return t.chartengine_is_rsi_enabled(this.__mrd_ptr)!==0}is_rsi_show_on_chart(){return t.chartengine_is_rsi_show_on_chart(this.__mrd_ptr)!==0}is_rsi_show_traps(){return t.chartengine_is_rsi_show_traps(this.__mrd_ptr)!==0}is_smart_ranges_enabled(){return t.chartengine_is_smart_ranges_enabled(this.__mrd_ptr)!==0}is_stop_iceberg_enabled(){return t.chartengine_is_stop_iceberg_enabled(this.__mrd_ptr)!==0}is_tpo_enabled(){return t.chartengine_is_tpo_enabled(this.__mrd_ptr)!==0}is_tpo_signals(){return t.chartengine_is_tpo_signals(this.__mrd_ptr)!==0}is_volume_enabled(){return t.chartengine_is_volume_enabled(this.__mrd_ptr)!==0}is_vpin_enabled(){return t.chartengine_is_vpin_enabled(this.__mrd_ptr)!==0}is_vrvp_enabled(){return t.chartengine_is_vrvp_enabled(this.__mrd_ptr)!==0}is_vrvp_signals_enabled(){return t.chartengine_is_vrvp_signals_enabled(this.__mrd_ptr)!==0}kline_closes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_closes(n,this.__mrd_ptr);var _=u().getInt32(n+4*0,!0),e=u().getInt32(n+4*1,!0),r=O(_,e).slice();return t.__wbindgen_export(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_count(){return t.chartengine_kline_count(this.__mrd_ptr)>>>0}kline_highs(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_highs(n,this.__mrd_ptr);var _=u().getInt32(n+4*0,!0),e=u().getInt32(n+4*1,!0),r=O(_,e).slice();return t.__wbindgen_export(_,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.__mrd_ptr);var _=u().getInt32(n+4*0,!0),e=u().getInt32(n+4*1,!0),r=O(_,e).slice();return t.__wbindgen_export(_,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.__mrd_ptr);var _=u().getInt32(n+4*0,!0),e=u().getInt32(n+4*1,!0),r=O(_,e).slice();return t.__wbindgen_export(_,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.__mrd_ptr);var _=u().getInt32(n+4*0,!0),e=u().getInt32(n+4*1,!0),r=O(_,e).slice();return t.__wbindgen_export(_,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.__mrd_ptr);var _=u().getInt32(n+4*0,!0),e=u().getInt32(n+4*1,!0),r=O(_,e).slice();return t.__wbindgen_export(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}liq_filled_zone_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_filled_zone_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}liq_heatmap_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_heatmap_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}liq_predict_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_predict_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}liq_zone_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_zone_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}lt_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_lt_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}move_drawing(_,e){t.chartengine_move_drawing(this.__mrd_ptr,_,e)}constructor(_,e){const r=t.chartengine_new(_,e);return this.__mrd_ptr=r>>>0,Q.register(this,this.__mrd_ptr,this),this}ob_flow_to_screen_y(_){return t.chartengine_ob_flow_to_screen_y(this.__mrd_ptr,_)}oi_to_screen_y(_){return t.chartengine_oi_to_screen_y(this.__mrd_ptr,_)}open_cvd_profile_session(_,e,r){t.chartengine_open_cvd_profile_session(this.__mrd_ptr,_,e,r)}pan(_,e){t.chartengine_pan(this.__mrd_ptr,_,e)}pan_indicator_y(_,e){t.chartengine_pan_indicator_y(this.__mrd_ptr,_,e)}pan_x(_){t.chartengine_pan_x(this.__mrd_ptr,_)}pan_y(_){t.chartengine_pan_y(this.__mrd_ptr,_)}pane_stack_bottom_y(){return t.chartengine_pane_stack_bottom_y(this.__mrd_ptr)}pop_last_kline(){return t.chartengine_pop_last_kline(this.__mrd_ptr)!==0}prepend_klines(_,e,r,n,s,i){const o=h(_,t.__wbindgen_export2),c=a,d=h(e,t.__wbindgen_export2),p=a,l=h(r,t.__wbindgen_export2),m=a,b=h(n,t.__wbindgen_export2),v=a,f=h(s,t.__wbindgen_export2),x=a,k=h(i,t.__wbindgen_export2),y=a;t.chartengine_prepend_klines(this.__mrd_ptr,o,c,d,p,l,m,b,v,f,x,k,y)}push_agg_liq_bar(_,e,r,n,s,i){t.chartengine_push_agg_liq_bar(this.__mrd_ptr,_,e,r,n,s,i)}push_agg_liq_signal(_,e,r,n,s,i){t.chartengine_push_agg_liq_signal(this.__mrd_ptr,_,e,r,n,s,i)}push_large_trade(_,e,r,n){t.chartengine_push_large_trade(this.__mrd_ptr,_,e,r,n)}push_obf_sample(_,e,r,n){t.chartengine_push_obf_sample(this.__mrd_ptr,_,e,r,n)}push_obs_alert(_,e,r,n,s){t.chartengine_push_obs_alert(this.__mrd_ptr,_,e,r,n,s)}remove_cvd_divergence(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_remove_cvd_divergence(this.__mrd_ptr,e,r)!==0}remove_cvd_orderblock_ob(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_remove_cvd_orderblock_ob(this.__mrd_ptr,e,r)!==0}remove_cvd_regime_flip(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_remove_cvd_regime_flip(this.__mrd_ptr,e,r)!==0}remove_cvd_trade_signal(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;return t.chartengine_remove_cvd_trade_signal(this.__mrd_ptr,e,r)!==0}remove_drawing(_){t.chartengine_remove_drawing(this.__mrd_ptr,_)}remove_marker(_){t.chartengine_remove_marker(this.__mrd_ptr,_)}render(){return t.chartengine_render(this.__mrd_ptr)>>>0}replace_cvd_profile_session(_,e,r,n,s){const i=h(s,t.__wbindgen_export2),o=a;t.chartengine_replace_cvd_profile_session(this.__mrd_ptr,_,e,r,n,i,o)}reset_indicator_y_auto(_){t.chartengine_reset_indicator_y_auto(this.__mrd_ptr,_)}resize(_,e){t.chartengine_resize(this.__mrd_ptr,_,e)}rsi_to_screen_y(_){return t.chartengine_rsi_to_screen_y(this.__mrd_ptr,_)}screen_to_agg_liq_y(_){return t.chartengine_screen_to_agg_liq_y(this.__mrd_ptr,_)}screen_to_aux_pane_y(_,e){const r=w(_,t.__wbindgen_export2,t.__wbindgen_export3),n=a;return t.chartengine_screen_to_aux_pane_y(this.__mrd_ptr,r,n,e)}screen_to_custom_pane_y(_){return t.chartengine_screen_to_custom_pane_y(this.__mrd_ptr,_)}screen_to_cvd_y(_){return t.chartengine_screen_to_cvd_y(this.__mrd_ptr,_)}screen_to_fr_y(_){return t.chartengine_screen_to_fr_y(this.__mrd_ptr,_)}screen_to_ob_flow_y(_){return t.chartengine_screen_to_ob_flow_y(this.__mrd_ptr,_)}screen_to_oi_y(_){return t.chartengine_screen_to_oi_y(this.__mrd_ptr,_)}screen_to_rsi_y(_){return t.chartengine_screen_to_rsi_y(this.__mrd_ptr,_)}screen_to_vpin_y(_){return t.chartengine_screen_to_vpin_y(this.__mrd_ptr,_)}screen_to_world_x(_){return t.chartengine_screen_to_world_x(this.__mrd_ptr,_)}screen_to_world_y(_){return t.chartengine_screen_to_world_y(this.__mrd_ptr,_)}script_box_new(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k){const y=w(e,t.__wbindgen_export2,t.__wbindgen_export3),z=a;return t.chartengine_script_box_new(this.__mrd_ptr,_,y,z,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k)>>>0}script_box_set_bg(_,e,r,n,s){t.chartengine_script_box_set_bg(this.__mrd_ptr,_,e,r,n,s)}script_box_set_border(_,e,r,n,s){t.chartengine_script_box_set_border(this.__mrd_ptr,_,e,r,n,s)}script_box_set_bottom(_,e){t.chartengine_script_box_set_bottom(this.__mrd_ptr,_,e)}script_box_set_corners(_,e,r,n,s){t.chartengine_script_box_set_corners(this.__mrd_ptr,_,e,r,n,s)}script_box_set_right(_,e){t.chartengine_script_box_set_right(this.__mrd_ptr,_,e)}script_box_set_top(_,e){t.chartengine_script_box_set_top(this.__mrd_ptr,_,e)}script_box_set_visible(_,e){t.chartengine_script_box_set_visible(this.__mrd_ptr,_,e)}script_drawing_channel_new(_,e,r,n,s,i,o,c,d,p,l,m,b,v){const f=w(e,t.__wbindgen_export2,t.__wbindgen_export3),x=a;return t.chartengine_script_drawing_channel_new(this.__mrd_ptr,_,f,x,r,n,s,i,o,c,d,p,l,m,b,v)>>>0}script_drawing_delete(_){t.chartengine_script_drawing_delete(this.__mrd_ptr,_)}script_drawing_fib_ret_new(_,e,r,n,s,i,o,c,d,p,l,m){const b=w(e,t.__wbindgen_export2,t.__wbindgen_export3),v=a;return t.chartengine_script_drawing_fib_ret_new(this.__mrd_ptr,_,b,v,r,n,s,i,o,c,d,p,l,m)>>>0}script_drawing_hline_new(_,e,r,n,s,i,o,c,d,p){const l=w(e,t.__wbindgen_export2,t.__wbindgen_export3),m=a;return t.chartengine_script_drawing_hline_new(this.__mrd_ptr,_,l,m,r,n,s,i,o,c,d,p)>>>0}script_drawing_set_anchors(_,e){const r=h(e,t.__wbindgen_export2),n=a;t.chartengine_script_drawing_set_anchors(this.__mrd_ptr,_,r,n)}script_drawing_set_color(_,e,r,n,s){t.chartengine_script_drawing_set_color(this.__mrd_ptr,_,e,r,n,s)}script_drawing_set_text(_,e){const r=w(e,t.__wbindgen_export2,t.__wbindgen_export3),n=a;t.chartengine_script_drawing_set_text(this.__mrd_ptr,_,r,n)}script_drawing_trendline_new(_,e,r,n,s,i,o,c,d,p,l,m){const b=w(e,t.__wbindgen_export2,t.__wbindgen_export3),v=a;return t.chartengine_script_drawing_trendline_new(this.__mrd_ptr,_,b,v,r,n,s,i,o,c,d,p,l,m)>>>0}script_label_new(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I,A){const j=w(e,t.__wbindgen_export2,t.__wbindgen_export3),F=a,R=w(s,t.__wbindgen_export2,t.__wbindgen_export3),W=a;return t.chartengine_script_label_new(this.__mrd_ptr,_,j,F,r,n,R,W,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I,A)>>>0}script_label_set_bg(_,e,r,n,s){t.chartengine_script_label_set_bg(this.__mrd_ptr,_,e,r,n,s)}script_label_set_color(_,e,r,n,s){t.chartengine_script_label_set_color(this.__mrd_ptr,_,e,r,n,s)}script_label_set_text(_,e){const r=w(e,t.__wbindgen_export2,t.__wbindgen_export3),n=a;t.chartengine_script_label_set_text(this.__mrd_ptr,_,r,n)}script_label_set_visible(_,e){t.chartengine_script_label_set_visible(this.__mrd_ptr,_,e)}script_label_set_xy(_,e,r){t.chartengine_script_label_set_xy(this.__mrd_ptr,_,e,r)}script_line_new(_,e,r,n,s,i,o,c,d,p,l,m,b,v){const f=w(e,t.__wbindgen_export2,t.__wbindgen_export3),x=a;return t.chartengine_script_line_new(this.__mrd_ptr,_,f,x,r,n,s,i,o,c,d,p,l,m,b,v)>>>0}script_line_set_anchors(_,e,r,n,s){t.chartengine_script_line_set_anchors(this.__mrd_ptr,_,e,r,n,s)}script_line_set_color(_,e,r,n,s){t.chartengine_script_line_set_color(this.__mrd_ptr,_,e,r,n,s)}script_line_set_extend(_,e){t.chartengine_script_line_set_extend(this.__mrd_ptr,_,e)}script_line_set_visible(_,e){t.chartengine_script_line_set_visible(this.__mrd_ptr,_,e)}script_object_count(){return t.chartengine_script_object_count(this.__mrd_ptr)>>>0}script_object_counts_for(_){try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_script_object_counts_for(s,this.__mrd_ptr,_);var e=u().getInt32(s+4*0,!0),r=u().getInt32(s+4*1,!0),n=f_(e,r).slice();return t.__wbindgen_export(e,r*4,4),n}finally{t.__wbindgen_add_to_stack_pointer(16)}}script_object_delete(_){t.chartengine_script_object_delete(this.__mrd_ptr,_)}script_polyline_new(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k){const y=w(e,t.__wbindgen_export2,t.__wbindgen_export3),z=a,I=h(r,t.__wbindgen_export2),A=a,j=h(n,t.__wbindgen_export2),F=a;return t.chartengine_script_polyline_new(this.__mrd_ptr,_,y,z,I,A,j,F,s,i,o,c,d,p,l,m,b,v,f,x,k)>>>0}script_polyline_set_visible(_,e){t.chartengine_script_polyline_set_visible(this.__mrd_ptr,_,e)}script_release(_){t.chartengine_script_release(this.__mrd_ptr,_)}script_release_drawings(_){t.chartengine_script_release_drawings(this.__mrd_ptr,_)}script_table_new(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I){return t.chartengine_script_table_new(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I)>>>0}script_table_set_cell(_,e,r,n){const s=w(n,t.__wbindgen_export2,t.__wbindgen_export3),i=a;t.chartengine_script_table_set_cell(this.__mrd_ptr,_,e,r,s,i)}script_table_set_visible(_,e){t.chartengine_script_table_set_visible(this.__mrd_ptr,_,e)}select_drawing(_){t.chartengine_select_drawing(this.__mrd_ptr,_)}select_marker(_){t.chartengine_select_marker(this.__mrd_ptr,_)}set_agg_liq_data(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_set_agg_liq_data(this.__mrd_ptr,e,r)}set_agg_liq_hover(_){t.chartengine_set_agg_liq_hover(this.__mrd_ptr,_)}set_agg_liq_mode(_){t.chartengine_set_agg_liq_mode(this.__mrd_ptr,_)}set_agg_liq_ratio(_){t.chartengine_set_agg_liq_ratio(this.__mrd_ptr,_)}set_agg_liq_show_long(_){t.chartengine_set_agg_liq_show_long(this.__mrd_ptr,_)}set_agg_liq_show_short(_){t.chartengine_set_agg_liq_show_short(this.__mrd_ptr,_)}set_agg_liq_show_signals(_){t.chartengine_set_agg_liq_show_signals(this.__mrd_ptr,_)}set_agg_liq_signals(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_set_agg_liq_signals(this.__mrd_ptr,e,r)}set_agg_liq_signals_on_chart(_){t.chartengine_set_agg_liq_signals_on_chart(this.__mrd_ptr,_)}set_aux_pane_ratio(_,e){const r=w(_,t.__wbindgen_export2,t.__wbindgen_export3),n=a;t.chartengine_set_aux_pane_ratio(this.__mrd_ptr,r,n,e)}set_aux_pane_y_range(_,e,r){const n=w(_,t.__wbindgen_export2,t.__wbindgen_export3),s=a;t.chartengine_set_aux_pane_y_range(this.__mrd_ptr,n,s,e,r)}set_background_color(_,e,r){t.chartengine_set_background_color(this.__mrd_ptr,_,e,r)}set_bg_gradient(_,e,r,n){t.chartengine_set_bg_gradient(this.__mrd_ptr,_,e,r,n)}set_candle_bear_border_color(_,e,r){t.chartengine_set_candle_bear_border_color(this.__mrd_ptr,_,e,r)}set_candle_bear_color(_,e,r){t.chartengine_set_candle_bear_color(this.__mrd_ptr,_,e,r)}set_candle_bear_wick_color(_,e,r){t.chartengine_set_candle_bear_wick_color(this.__mrd_ptr,_,e,r)}set_candle_bull_border_color(_,e,r){t.chartengine_set_candle_bull_border_color(this.__mrd_ptr,_,e,r)}set_candle_bull_color(_,e,r){t.chartengine_set_candle_bull_color(this.__mrd_ptr,_,e,r)}set_candle_bull_wick_color(_,e,r){t.chartengine_set_candle_bull_wick_color(this.__mrd_ptr,_,e,r)}set_candle_interval(_){t.chartengine_set_candle_interval(this.__mrd_ptr,_)}set_channel_preview(_,e,r,n,s,i,o,c,d,p,l,m){t.chartengine_set_channel_preview(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m)}set_chart_type(_){t.chartengine_set_chart_type(this.__mrd_ptr,_)}set_crosshair(_,e){t.chartengine_set_crosshair(this.__mrd_ptr,_,e)}set_crosshair_color(_,e,r,n){t.chartengine_set_crosshair_color(this.__mrd_ptr,_,e,r,n)}set_crosshair_magnet(_){t.chartengine_set_crosshair_magnet(this.__mrd_ptr,_)}set_crosshair_style(_){t.chartengine_set_crosshair_style(this.__mrd_ptr,_)}set_crosshair_width(_){t.chartengine_set_crosshair_width(this.__mrd_ptr,_)}set_custom_pane_ratio(_){t.chartengine_set_custom_pane_ratio(this.__mrd_ptr,_)}set_custom_pane_y_range(_,e){t.chartengine_set_custom_pane_y_range(this.__mrd_ptr,_,e)}set_cvd_data(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.chartengine_set_cvd_data(this.__mrd_ptr,r,n,s,i)}set_cvd_divergence_min_strength(_){t.chartengine_set_cvd_divergence_min_strength(this.__mrd_ptr,_)}set_cvd_divergence_show_band(_){t.chartengine_set_cvd_divergence_show_band(this.__mrd_ptr,_)}set_cvd_divergence_show_hidden(_){t.chartengine_set_cvd_divergence_show_hidden(this.__mrd_ptr,_)}set_cvd_divergence_show_labels(_){t.chartengine_set_cvd_divergence_show_labels(this.__mrd_ptr,_)}set_cvd_divergence_show_long(_){t.chartengine_set_cvd_divergence_show_long(this.__mrd_ptr,_)}set_cvd_divergence_show_regular(_){t.chartengine_set_cvd_divergence_show_regular(this.__mrd_ptr,_)}set_cvd_divergence_show_short(_){t.chartengine_set_cvd_divergence_show_short(this.__mrd_ptr,_)}set_cvd_mode(_){t.chartengine_set_cvd_mode(this.__mrd_ptr,_)}set_cvd_orderblock_breaker_style(_){t.chartengine_set_cvd_orderblock_breaker_style(this.__mrd_ptr,_)}set_cvd_orderblock_direction_filter(_){t.chartengine_set_cvd_orderblock_direction_filter(this.__mrd_ptr,_)}set_cvd_orderblock_label_size_scale(_){t.chartengine_set_cvd_orderblock_label_size_scale(this.__mrd_ptr,_)}set_cvd_orderblock_min_score(_){t.chartengine_set_cvd_orderblock_min_score(this.__mrd_ptr,_)}set_cvd_orderblock_mitigation_filter(_){t.chartengine_set_cvd_orderblock_mitigation_filter(this.__mrd_ptr,_)}set_cvd_orderblock_render_mode(_){t.chartengine_set_cvd_orderblock_render_mode(this.__mrd_ptr,_)}set_cvd_orderblock_show_filled_gaps(_){t.chartengine_set_cvd_orderblock_show_filled_gaps(this.__mrd_ptr,_)}set_cvd_orderblock_show_gaps(_){t.chartengine_set_cvd_orderblock_show_gaps(this.__mrd_ptr,_)}set_cvd_orderblock_show_labels(_){t.chartengine_set_cvd_orderblock_show_labels(this.__mrd_ptr,_)}set_cvd_orderblock_show_mitigated(_){t.chartengine_set_cvd_orderblock_show_mitigated(this.__mrd_ptr,_)}set_cvd_orderblock_show_obs(_){t.chartengine_set_cvd_orderblock_show_obs(this.__mrd_ptr,_)}set_cvd_profile_bar_height_px(_){t.chartengine_set_cvd_profile_bar_height_px(this.__mrd_ptr,_)}set_cvd_profile_bar_max_width_px(_){t.chartengine_set_cvd_profile_bar_max_width_px(this.__mrd_ptr,_)}set_cvd_profile_label_size_scale(_){t.chartengine_set_cvd_profile_label_size_scale(this.__mrd_ptr,_)}set_cvd_profile_max_bar_ratio(_){t.chartengine_set_cvd_profile_max_bar_ratio(this.__mrd_ptr,_)}set_cvd_profile_sessions(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_set_cvd_profile_sessions(this.__mrd_ptr,e,r)}set_cvd_profile_show_anchors(_){t.chartengine_set_cvd_profile_show_anchors(this.__mrd_ptr,_)}set_cvd_profile_show_delta_poc(_){t.chartengine_set_cvd_profile_show_delta_poc(this.__mrd_ptr,_)}set_cvd_profile_show_poc(_){t.chartengine_set_cvd_profile_show_poc(this.__mrd_ptr,_)}set_cvd_profile_show_session_poc_line(_){t.chartengine_set_cvd_profile_show_session_poc_line(this.__mrd_ptr,_)}set_cvd_profile_theme_mode(_){t.chartengine_set_cvd_profile_theme_mode(this.__mrd_ptr,_)}set_cvd_profile_tooltip_enabled(_){t.chartengine_set_cvd_profile_tooltip_enabled(this.__mrd_ptr,_)}set_cvd_profile_value_in_quote(_){t.chartengine_set_cvd_profile_value_in_quote(this.__mrd_ptr,_)}set_cvd_profile_view_mode(_){t.chartengine_set_cvd_profile_view_mode(this.__mrd_ptr,_)}set_cvd_ratio(_){t.chartengine_set_cvd_ratio(this.__mrd_ptr,_)}set_cvd_regime_show_flip_lines(_){t.chartengine_set_cvd_regime_show_flip_lines(this.__mrd_ptr,_)}set_cvd_regime_show_ribbon(_){t.chartengine_set_cvd_regime_show_ribbon(this.__mrd_ptr,_)}set_cvd_regime_show_wash(_){t.chartengine_set_cvd_regime_show_wash(this.__mrd_ptr,_)}set_cvd_show_delta(_){t.chartengine_set_cvd_show_delta(this.__mrd_ptr,_)}set_cvd_show_divergence(_){t.chartengine_set_cvd_show_divergence(this.__mrd_ptr,_)}set_cvd_show_signals(_){t.chartengine_set_cvd_show_signals(this.__mrd_ptr,_)}set_cvd_source(_){t.chartengine_set_cvd_source(this.__mrd_ptr,_)}set_cvd_spot_data(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.chartengine_set_cvd_spot_data(this.__mrd_ptr,r,n,s,i)}set_cvd_trade_signals_min_confidence(_){t.chartengine_set_cvd_trade_signals_min_confidence(this.__mrd_ptr,_)}set_cvd_trade_signals_show_absorption_resolution(_){t.chartengine_set_cvd_trade_signals_show_absorption_resolution(this.__mrd_ptr,_)}set_cvd_trade_signals_show_breakout(_){t.chartengine_set_cvd_trade_signals_show_breakout(this.__mrd_ptr,_)}set_cvd_trade_signals_show_delta_trap(_){t.chartengine_set_cvd_trade_signals_show_delta_trap(this.__mrd_ptr,_)}set_cvd_trade_signals_show_divergence(_){t.chartengine_set_cvd_trade_signals_show_divergence(this.__mrd_ptr,_)}set_cvd_trade_signals_show_labels(_){t.chartengine_set_cvd_trade_signals_show_labels(this.__mrd_ptr,_)}set_cvd_trade_signals_show_levels(_){t.chartengine_set_cvd_trade_signals_show_levels(this.__mrd_ptr,_)}set_cvd_trade_signals_show_long(_){t.chartengine_set_cvd_trade_signals_show_long(this.__mrd_ptr,_)}set_cvd_trade_signals_show_rejection(_){t.chartengine_set_cvd_trade_signals_show_rejection(this.__mrd_ptr,_)}set_cvd_trade_signals_show_short(_){t.chartengine_set_cvd_trade_signals_show_short(this.__mrd_ptr,_)}set_drawing_dashed(_,e){t.chartengine_set_drawing_dashed(this.__mrd_ptr,_,e)}set_drawing_flip_left(_,e){t.chartengine_set_drawing_flip_left(this.__mrd_ptr,_,e)}set_drawing_font_size(_,e){t.chartengine_set_drawing_font_size(this.__mrd_ptr,_,e)}set_drawing_hide_label(_,e){t.chartengine_set_drawing_hide_label(this.__mrd_ptr,_,e)}set_drawing_preview(_,e,r,n,s,i,o,c,d,p,l){t.chartengine_set_drawing_preview(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l)}set_drawing_style(_,e,r,n,s){t.chartengine_set_drawing_style(this.__mrd_ptr,_,e,r,n,s)}set_drawing_text(_,e){const r=w(e,t.__wbindgen_export2,t.__wbindgen_export3),n=a;t.chartengine_set_drawing_text(this.__mrd_ptr,_,r,n)}set_drawing_text_wrap(_,e){t.chartengine_set_drawing_text_wrap(this.__mrd_ptr,_,e)}set_drawings_visible(_){t.chartengine_set_drawings_visible(this.__mrd_ptr,_)}set_elliott_manual_cursor(_,e){t.chartengine_set_elliott_manual_cursor(this.__mrd_ptr,_,e)}set_elliott_preview(_,e,r,n,s,i,o){t.chartengine_set_elliott_preview(this.__mrd_ptr,_,e,r,n,s,i,o)}set_es_ema1_len(_){t.chartengine_set_es_ema1_len(this.__mrd_ptr,_)}set_es_ema2_len(_){t.chartengine_set_es_ema2_len(this.__mrd_ptr,_)}set_es_show_bos(_){t.chartengine_set_es_show_bos(this.__mrd_ptr,_)}set_es_show_ema1(_){t.chartengine_set_es_show_ema1(this.__mrd_ptr,_)}set_es_show_ema2(_){t.chartengine_set_es_show_ema2(this.__mrd_ptr,_)}set_es_show_wma(_){t.chartengine_set_es_show_wma(this.__mrd_ptr,_)}set_es_swing_len(_){t.chartengine_set_es_swing_len(this.__mrd_ptr,_)}set_es_wma_len(_){t.chartengine_set_es_wma_len(this.__mrd_ptr,_)}set_fib_ext_preview(_,e,r,n,s,i,o,c,d,p,l,m){t.chartengine_set_fib_ext_preview(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m)}set_font_size(_){t.chartengine_set_font_size(this.__mrd_ptr,_)}set_footprint_tick_size(_){t.chartengine_set_footprint_tick_size(this.__mrd_ptr,_)}set_forex_signals_mode(_){t.chartengine_set_forex_signals_mode(this.__mrd_ptr,_)}set_forex_signals_setup(_){t.chartengine_set_forex_signals_setup(this.__mrd_ptr,_)}set_forex_signals_show_stats(_){t.chartengine_set_forex_signals_show_stats(this.__mrd_ptr,_)}set_fr_agg_data(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.chartengine_set_fr_agg_data(this.__mrd_ptr,r,n,s,i)}set_fr_binance_data(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.chartengine_set_fr_binance_data(this.__mrd_ptr,r,n,s,i)}set_fr_display_style(_){t.chartengine_set_fr_display_style(this.__mrd_ptr,_)}set_fr_ratio(_){t.chartengine_set_fr_ratio(this.__mrd_ptr,_)}set_fr_show_agg(_){t.chartengine_set_fr_show_agg(this.__mrd_ptr,_)}set_fr_show_sma(_){t.chartengine_set_fr_show_sma(this.__mrd_ptr,_)}set_grid_color(_,e,r,n){t.chartengine_set_grid_color(this.__mrd_ptr,_,e,r,n)}set_grid_h_visible(_){t.chartengine_set_grid_h_visible(this.__mrd_ptr,_)}set_grid_v_visible(_){t.chartengine_set_grid_v_visible(this.__mrd_ptr,_)}set_heatmap(_,e,r,n,s,i,o){const c=h(_,t.__wbindgen_export2),d=a;t.chartengine_set_heatmap(this.__mrd_ptr,c,d,e,r,n,s,i,o)}set_heatmap_color_scheme(_){t.chartengine_set_heatmap_color_scheme(this.__mrd_ptr,_)}set_heatmap_prefetch_range(_){t.chartengine_set_heatmap_prefetch_range(this.__mrd_ptr,_)}set_heatmap_profile_bar_length(_){t.chartengine_set_heatmap_profile_bar_length(this.__mrd_ptr,_)}set_heatmap_profile_brightness(_){t.chartengine_set_heatmap_profile_brightness(this.__mrd_ptr,_)}set_heatmap_range(_,e){t.chartengine_set_heatmap_range(this.__mrd_ptr,_,e)}set_heatmap_show_profile(_){t.chartengine_set_heatmap_show_profile(this.__mrd_ptr,_)}set_heatmap_walls(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_set_heatmap_walls(this.__mrd_ptr,e,r)}set_hover_price(_){t.chartengine_set_hover_price(this.__mrd_ptr,_)}set_iceberg_events(_,e,r,n,s,i){const o=h(_,t.__wbindgen_export2),c=a,d=h(e,t.__wbindgen_export2),p=a,l=h(r,t.__wbindgen_export2),m=a,b=h(n,t.__wbindgen_export2),v=a,f=k_(s,t.__wbindgen_export2),x=a,k=S(i,t.__wbindgen_export2),y=a;t.chartengine_set_iceberg_events(this.__mrd_ptr,o,c,d,p,l,m,b,v,f,x,k,y)}set_indicators_visible(_){t.chartengine_set_indicators_visible(this.__mrd_ptr,_)}set_kline_visible(_){t.chartengine_set_kline_visible(this.__mrd_ptr,_)}set_klines(_,e,r,n,s,i){const o=h(_,t.__wbindgen_export2),c=a,d=h(e,t.__wbindgen_export2),p=a,l=h(r,t.__wbindgen_export2),m=a,b=h(n,t.__wbindgen_export2),v=a,f=h(s,t.__wbindgen_export2),x=a,k=h(i,t.__wbindgen_export2),y=a;t.chartengine_set_klines(this.__mrd_ptr,o,c,d,p,l,m,b,v,f,x,k,y)}set_klines_preserve_viewport(_,e,r,n,s,i){const o=h(_,t.__wbindgen_export2),c=a,d=h(e,t.__wbindgen_export2),p=a,l=h(r,t.__wbindgen_export2),m=a,b=h(n,t.__wbindgen_export2),v=a,f=h(s,t.__wbindgen_export2),x=a,k=h(i,t.__wbindgen_export2),y=a;t.chartengine_set_klines_preserve_viewport(this.__mrd_ptr,o,c,d,p,l,m,b,v,f,x,k,y)}set_large_trades_data(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_set_large_trades_data(this.__mrd_ptr,e,r)}set_last_price_line_enabled(_){t.chartengine_set_last_price_line_enabled(this.__mrd_ptr,_)}set_last_price_line_style(_,e,r){t.chartengine_set_last_price_line_style(this.__mrd_ptr,_,e,r)}set_license_state(_,e,r){t.chartengine_set_license_state(this.__mrd_ptr,_,e,r)}set_liq_heatmap_bar_width(_){t.chartengine_set_liq_heatmap_bar_width(this.__mrd_ptr,_)}set_liq_heatmap_cell_height(_){t.chartengine_set_liq_heatmap_cell_height(this.__mrd_ptr,_)}set_liq_heatmap_filled_pct(_){t.chartengine_set_liq_heatmap_filled_pct(this.__mrd_ptr,_)}set_liq_heatmap_filled_zones(_){t.chartengine_set_liq_heatmap_filled_zones(this.__mrd_ptr,_)}set_liq_heatmap_predictions(_){t.chartengine_set_liq_heatmap_predictions(this.__mrd_ptr,_)}set_liq_heatmap_profile(_){t.chartengine_set_liq_heatmap_profile(this.__mrd_ptr,_)}set_liq_heatmap_range(_,e){t.chartengine_set_liq_heatmap_range(this.__mrd_ptr,_,e)}set_live_signals_data(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_set_live_signals_data(this.__mrd_ptr,e,r)}set_live_signals_leverage(_){t.chartengine_set_live_signals_leverage(this.__mrd_ptr,_)}set_live_signals_loading(_){t.chartengine_set_live_signals_loading(this.__mrd_ptr,_)}set_live_signals_pip_value(_){t.chartengine_set_live_signals_pip_value(this.__mrd_ptr,_)}set_live_signals_show_entry(_){t.chartengine_set_live_signals_show_entry(this.__mrd_ptr,_)}set_live_signals_show_labels(_){t.chartengine_set_live_signals_show_labels(this.__mrd_ptr,_)}set_live_signals_show_max_profit(_){t.chartengine_set_live_signals_show_max_profit(this.__mrd_ptr,_)}set_live_signals_show_tp_sl(_){t.chartengine_set_live_signals_show_tp_sl(this.__mrd_ptr,_)}set_live_signals_show_zones(_){t.chartengine_set_live_signals_show_zones(this.__mrd_ptr,_)}set_live_signals_text_size(_){t.chartengine_set_live_signals_text_size(this.__mrd_ptr,_)}set_live_signals_trial(_){t.chartengine_set_live_signals_trial(this.__mrd_ptr,_)}set_lt_bubble_scale(_){t.chartengine_set_lt_bubble_scale(this.__mrd_ptr,_)}set_lt_bubble_style(_){t.chartengine_set_lt_bubble_style(this.__mrd_ptr,_)}set_lt_volume_filter(_,e){t.chartengine_set_lt_volume_filter(this.__mrd_ptr,_,e)}set_mrd_pullback_entry_mode(_){t.chartengine_set_mrd_pullback_entry_mode(this.__mrd_ptr,_)}set_mrd_pullback_htf_klines(_,e,r,n,s,i){const o=h(_,t.__wbindgen_export2),c=a,d=h(e,t.__wbindgen_export2),p=a,l=h(r,t.__wbindgen_export2),m=a,b=h(n,t.__wbindgen_export2),v=a,f=h(s,t.__wbindgen_export2),x=a,k=h(i,t.__wbindgen_export2),y=a;t.chartengine_set_mrd_pullback_htf_klines(this.__mrd_ptr,o,c,d,p,l,m,b,v,f,x,k,y)}set_mrd_pullback_show_hidden_div(_){t.chartengine_set_mrd_pullback_show_hidden_div(this.__mrd_ptr,_)}set_mrd_pullback_sr_mode(_){t.chartengine_set_mrd_pullback_sr_mode(this.__mrd_ptr,_)}set_mrd_pullback_text_size(_){t.chartengine_set_mrd_pullback_text_size(this.__mrd_ptr,_)}set_mrd_pullback_tf_mode(_){t.chartengine_set_mrd_pullback_tf_mode(this.__mrd_ptr,_)}set_mrd_pullback_trend_mode(_){t.chartengine_set_mrd_pullback_trend_mode(this.__mrd_ptr,_)}set_obf_data(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_set_obf_data(this.__mrd_ptr,e,r)}set_obf_ratio(_){t.chartengine_set_obf_ratio(this.__mrd_ptr,_)}set_obf_show_cum_delta(_){t.chartengine_set_obf_show_cum_delta(this.__mrd_ptr,_)}set_obf_show_net_flow(_){t.chartengine_set_obf_show_net_flow(this.__mrd_ptr,_)}set_obf_show_obi(_){t.chartengine_set_obf_show_obi(this.__mrd_ptr,_)}set_obm_anchor_top_right(_){t.chartengine_set_obm_anchor_top_right(this.__mrd_ptr,_)}set_obm_data(_,e,r,n,s,i,o,c,d,p,l,m,b){t.chartengine_set_obm_data(this.__mrd_ptr,_,e,r,n,s,i,o,c,d,p,l,m,b)}set_obs_com(_){t.chartengine_set_obs_com(this.__mrd_ptr,_)}set_obs_gaps(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.chartengine_set_obs_gaps(this.__mrd_ptr,r,n,s,i)}set_obs_show_alerts(_){t.chartengine_set_obs_show_alerts(this.__mrd_ptr,_)}set_obs_show_com(_){t.chartengine_set_obs_show_com(this.__mrd_ptr,_)}set_obs_show_gaps(_){t.chartengine_set_obs_show_gaps(this.__mrd_ptr,_)}set_obs_show_walls(_){t.chartengine_set_obs_show_walls(this.__mrd_ptr,_)}set_obs_walls(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.chartengine_set_obs_walls(this.__mrd_ptr,r,n,s,i)}set_oi_cvd_pattern_kinds(_){t.chartengine_set_oi_cvd_pattern_kinds(this.__mrd_ptr,_)}set_oi_cvd_pattern_show_labels(_){t.chartengine_set_oi_cvd_pattern_show_labels(this.__mrd_ptr,_)}set_oi_cvd_pattern_text_size(_){t.chartengine_set_oi_cvd_pattern_text_size(this.__mrd_ptr,_)}set_oi_cvd_pattern_thresholds(_,e,r,n,s,i,o){t.chartengine_set_oi_cvd_pattern_thresholds(this.__mrd_ptr,_,e,r,n,s,i,o)}set_oi_data(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_set_oi_data(this.__mrd_ptr,e,r)}set_oi_data_ts(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.chartengine_set_oi_data_ts(this.__mrd_ptr,r,n,s,i)}set_oi_display_mode(_){t.chartengine_set_oi_display_mode(this.__mrd_ptr,_)}set_oi_ratio(_){t.chartengine_set_oi_ratio(this.__mrd_ptr,_)}set_oi_show_on_chart(_){t.chartengine_set_oi_show_on_chart(this.__mrd_ptr,_)}set_oi_show_spike(_){t.chartengine_set_oi_show_spike(this.__mrd_ptr,_)}set_oi_spike_text_size(_){t.chartengine_set_oi_spike_text_size(this.__mrd_ptr,_)}set_path_cursor(_,e){t.chartengine_set_path_cursor(this.__mrd_ptr,_,e)}set_price_precision(_){t.chartengine_set_price_precision(this.__mrd_ptr,_)}set_quick_trade_btn_enabled(_){t.chartengine_set_quick_trade_btn_enabled(this.__mrd_ptr,_)}set_real_timestamps(_){const e=h(_,t.__wbindgen_export2),r=a;t.chartengine_set_real_timestamps(this.__mrd_ptr,e,r)}set_replay_hovered(_){t.chartengine_set_replay_hovered(this.__mrd_ptr,_)}set_replay_preview(_){t.chartengine_set_replay_preview(this.__mrd_ptr,_)}set_replay_state(_,e,r){t.chartengine_set_replay_state(this.__mrd_ptr,_,e,r)}set_rsi_period(_){t.chartengine_set_rsi_period(this.__mrd_ptr,_)}set_rsi_ratio(_){t.chartengine_set_rsi_ratio(this.__mrd_ptr,_)}set_rsi_show_divergence(_){t.chartengine_set_rsi_show_divergence(this.__mrd_ptr,_)}set_rsi_show_ema(_){t.chartengine_set_rsi_show_ema(this.__mrd_ptr,_)}set_rsi_show_levels(_){t.chartengine_set_rsi_show_levels(this.__mrd_ptr,_)}set_rsi_show_on_chart(_){t.chartengine_set_rsi_show_on_chart(this.__mrd_ptr,_)}set_rsi_show_signals(_){t.chartengine_set_rsi_show_signals(this.__mrd_ptr,_)}set_rsi_show_traps(_){t.chartengine_set_rsi_show_traps(this.__mrd_ptr,_)}set_rsi_show_wma(_){t.chartengine_set_rsi_show_wma(this.__mrd_ptr,_)}set_rsi_smoothing(_){t.chartengine_set_rsi_smoothing(this.__mrd_ptr,_)}set_session_levels_enabled(_){t.chartengine_set_session_levels_enabled(this.__mrd_ptr,_)}set_si_show_icebergs(_){t.chartengine_set_si_show_icebergs(this.__mrd_ptr,_)}set_si_show_stops(_){t.chartengine_set_si_show_stops(this.__mrd_ptr,_)}set_si_show_zones(_){t.chartengine_set_si_show_zones(this.__mrd_ptr,_)}set_sr_fvg_extend(_){t.chartengine_set_sr_fvg_extend(this.__mrd_ptr,_)}set_sr_fvg_htf(_){t.chartengine_set_sr_fvg_htf(this.__mrd_ptr,_)}set_sr_fvg_mitigation(_){t.chartengine_set_sr_fvg_mitigation(this.__mrd_ptr,_)}set_sr_fvg_theme(_){t.chartengine_set_sr_fvg_theme(this.__mrd_ptr,_)}set_sr_htf_minutes(_){t.chartengine_set_sr_htf_minutes(this.__mrd_ptr,_)}set_sr_mitigation(_){t.chartengine_set_sr_mitigation(this.__mrd_ptr,_)}set_sr_ob_last(_){t.chartengine_set_sr_ob_last(this.__mrd_ptr,_)}set_sr_show_breakers(_){t.chartengine_set_sr_show_breakers(this.__mrd_ptr,_)}set_sr_show_fvg(_){t.chartengine_set_sr_show_fvg(this.__mrd_ptr,_)}set_sr_show_fvg_signals(_){t.chartengine_set_sr_show_fvg_signals(this.__mrd_ptr,_)}set_sr_show_htf_ob(_){t.chartengine_set_sr_show_htf_ob(this.__mrd_ptr,_)}set_sr_show_metrics(_){t.chartengine_set_sr_show_metrics(this.__mrd_ptr,_)}set_sr_show_ob(_){t.chartengine_set_sr_show_ob(this.__mrd_ptr,_)}set_sr_show_ob_activity(_){t.chartengine_set_sr_show_ob_activity(this.__mrd_ptr,_)}set_sr_show_ob_signals(_){t.chartengine_set_sr_show_ob_signals(this.__mrd_ptr,_)}set_sr_show_predict(_){t.chartengine_set_sr_show_predict(this.__mrd_ptr,_)}set_sr_show_smart_rev(_){t.chartengine_set_sr_show_smart_rev(this.__mrd_ptr,_)}set_sr_smart_rev_htf(_){t.chartengine_set_sr_smart_rev_htf(this.__mrd_ptr,_)}set_sr_stats_position(_){t.chartengine_set_sr_stats_position(this.__mrd_ptr,_)}set_sr_stats_type(_){t.chartengine_set_sr_stats_type(this.__mrd_ptr,_)}set_sr_text_size(_){t.chartengine_set_sr_text_size(this.__mrd_ptr,_)}set_theme(_){t.chartengine_set_theme(this.__mrd_ptr,_)}set_touch_mode(_){t.chartengine_set_touch_mode(this.__mrd_ptr,_)}set_tpo_ib(_){t.chartengine_set_tpo_ib(this.__mrd_ptr,_)}set_tpo_ib_minutes(_){t.chartengine_set_tpo_ib_minutes(this.__mrd_ptr,_)}set_tpo_letter_minutes(_){t.chartengine_set_tpo_letter_minutes(this.__mrd_ptr,_)}set_tpo_naked_poc(_){t.chartengine_set_tpo_naked_poc(this.__mrd_ptr,_)}set_tpo_period(_){t.chartengine_set_tpo_period(this.__mrd_ptr,_)}set_tpo_poc_line(_){t.chartengine_set_tpo_poc_line(this.__mrd_ptr,_)}set_tpo_profile_shape(_){t.chartengine_set_tpo_profile_shape(this.__mrd_ptr,_)}set_tpo_signals(_){t.chartengine_set_tpo_signals(this.__mrd_ptr,_)}set_tpo_single_prints(_){t.chartengine_set_tpo_single_prints(this.__mrd_ptr,_)}set_tpo_va_lines(_){t.chartengine_set_tpo_va_lines(this.__mrd_ptr,_)}set_tz_offset_seconds(_){t.chartengine_set_tz_offset_seconds(this.__mrd_ptr,_)}set_volume_color_mode(_){t.chartengine_set_volume_color_mode(this.__mrd_ptr,_)}set_volume_ma_period(_){t.chartengine_set_volume_ma_period(this.__mrd_ptr,_)}set_volume_show_ma(_){t.chartengine_set_volume_show_ma(this.__mrd_ptr,_)}set_volume_show_signals(_){t.chartengine_set_volume_show_signals(this.__mrd_ptr,_)}set_vpin_bucket_size(_){t.chartengine_set_vpin_bucket_size(this.__mrd_ptr,_)}set_vpin_data(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.chartengine_set_vpin_data(this.__mrd_ptr,r,n,s,i)}set_vpin_num_buckets(_){t.chartengine_set_vpin_num_buckets(this.__mrd_ptr,_)}set_vpin_ratio(_){t.chartengine_set_vpin_ratio(this.__mrd_ptr,_)}set_vpin_show_sma(_){t.chartengine_set_vpin_show_sma(this.__mrd_ptr,_)}set_vpin_show_zones(_){t.chartengine_set_vpin_show_zones(this.__mrd_ptr,_)}set_vpin_threshold(_){t.chartengine_set_vpin_threshold(this.__mrd_ptr,_)}set_vrvp_data(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.chartengine_set_vrvp_data(this.__mrd_ptr,r,n,s,i)}set_vrvp_poc_line(_){t.chartengine_set_vrvp_poc_line(this.__mrd_ptr,_)}set_vrvp_signal_kinds(_){t.chartengine_set_vrvp_signal_kinds(this.__mrd_ptr,_)}set_vrvp_signal_show_labels(_){t.chartengine_set_vrvp_signal_show_labels(this.__mrd_ptr,_)}set_vrvp_signal_thresholds(_,e,r,n,s,i,o){t.chartengine_set_vrvp_signal_thresholds(this.__mrd_ptr,_,e,r,n,s,i,o)}set_vrvp_signal_tpsl(_,e,r,n){t.chartengine_set_vrvp_signal_tpsl(this.__mrd_ptr,_,e,r,n)}set_vrvp_signals_enabled(_){t.chartengine_set_vrvp_signals_enabled(this.__mrd_ptr,_)}set_y_auto_scale(_){t.chartengine_set_y_auto_scale(this.__mrd_ptr,_)}show_default_view(){t.chartengine_show_default_view(this.__mrd_ptr)}show_latest(_){t.chartengine_show_latest(this.__mrd_ptr,_)}start_brush(_,e,r,n,s){t.chartengine_start_brush(this.__mrd_ptr,_,e,r,n,s)}start_elliott_manual(_,e,r,n,s){t.chartengine_start_elliott_manual(this.__mrd_ptr,_,e,r,n,s)}start_path(_,e,r,n,s,i){t.chartengine_start_path(this.__mrd_ptr,_,e,r,n,s,i)}update_drawing_anchor(_,e,r){t.chartengine_update_drawing_anchor(this.__mrd_ptr,_,e,r)}update_heatmap_column(_,e){const r=h(e,t.__wbindgen_export2),n=a;t.chartengine_update_heatmap_column(this.__mrd_ptr,_,r,n)}update_heatmap_column_at(_,e,r,n){const s=h(_,t.__wbindgen_export2),i=a;t.chartengine_update_heatmap_column_at(this.__mrd_ptr,s,i,e,r,n)}update_last_heatmap_column(_,e,r){const n=h(_,t.__wbindgen_export2),s=a;t.chartengine_update_last_heatmap_column(this.__mrd_ptr,n,s,e,r)}update_last_kline(_,e,r,n,s,i){t.chartengine_update_last_kline(this.__mrd_ptr,_,e,r,n,s,i)}update_mrd_pullback_last_htf_kline(_,e,r,n,s,i){t.chartengine_update_mrd_pullback_last_htf_kline(this.__mrd_ptr,_,e,r,n,s,i)}upsert_cvd_divergence(_,e,r,n,s,i,o,c,d,p,l){const m=w(_,t.__wbindgen_export2,t.__wbindgen_export3),b=a;t.chartengine_upsert_cvd_divergence(this.__mrd_ptr,m,b,e,r,n,s,i,o,c,d,p,l)}upsert_cvd_orderblock_ob(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I,A,j,F,R,W,N,o_,a_,c_,d_,p_,h_,g_,l_,m_){const b_=w(_,t.__wbindgen_export2,t.__wbindgen_export3),u_=a;t.chartengine_upsert_cvd_orderblock_ob(this.__mrd_ptr,b_,u_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I,A,j,F,R,W,N,o_,a_,c_,d_,p_,h_,g_,l_,m_)}upsert_cvd_regime_flip(_,e,r,n,s,i,o,c){const d=w(_,t.__wbindgen_export2,t.__wbindgen_export3),p=a;t.chartengine_upsert_cvd_regime_flip(this.__mrd_ptr,d,p,e,r,n,s,i,o,c)}upsert_cvd_trade_signal(_,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I,A){const j=w(_,t.__wbindgen_export2,t.__wbindgen_export3),F=a,R=w(A,t.__wbindgen_export2,t.__wbindgen_export3),W=a;t.chartengine_upsert_cvd_trade_signal(this.__mrd_ptr,j,F,e,r,n,s,i,o,c,d,p,l,m,b,v,f,x,k,y,z,I,R,W)}vpin_to_screen_y(_){return t.chartengine_vpin_to_screen_y(this.__mrd_ptr,_)}vrvp_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_vrvp_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}vrvp_signal_hit_test(_,e){let r,n;try{const o=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_vrvp_signal_hit_test(o,this.__mrd_ptr,_,e);var s=u().getInt32(o+4*0,!0),i=u().getInt32(o+4*1,!0);return r=s,n=i,q(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}world_to_screen_x(_){return t.chartengine_world_to_screen_x(this.__mrd_ptr,_)}world_to_screen_y(_){return t.chartengine_world_to_screen_y(this.__mrd_ptr,_)}y_auto_scale(){return t.chartengine_y_auto_scale(this.__mrd_ptr)!==0}zoom(_,e,r){t.chartengine_zoom(this.__mrd_ptr,_,e,r)}zoom_indicator_y(_,e,r){t.chartengine_zoom_indicator_y(this.__mrd_ptr,_,e,r)}zoom_x(_,e){t.chartengine_zoom_x(this.__mrd_ptr,_,e)}zoom_y(_,e){t.chartengine_zoom_y(this.__mrd_ptr,_,e)}}Symbol.dispose&&(X.prototype[Symbol.dispose]=X.prototype.free);class Y{__destroy_into_raw(){const _=this.__mrd_ptr;return this.__mrd_ptr=0,Z.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__mrd_domladderengine_free(_,0)}append_trade(_,e,r,n){t.domladderengine_append_trade(this.__mrd_ptr,_,e,r,n)}buy_volume_1m(){return t.domladderengine_buy_volume_1m(this.__mrd_ptr)}center_on_mid(){t.domladderengine_center_on_mid(this.__mrd_ptr)}clear_dom_vol(){t.domladderengine_clear_dom_vol(this.__mrd_ptr)}clear_hover(){t.domladderengine_clear_hover(this.__mrd_ptr)}get_command_buffer_len(){return t.domladderengine_get_command_buffer_len(this.__mrd_ptr)>>>0}get_command_buffer_ptr(){return t.domladderengine_get_command_buffer_ptr(this.__mrd_ptr)>>>0}get_hover_price(){return t.domladderengine_get_hover_price(this.__mrd_ptr)}get_hover_side(){return t.domladderengine_get_hover_side(this.__mrd_ptr)}is_dirty(){return t.domladderengine_is_dirty(this.__mrd_ptr)!==0}is_view_locked(){return t.domladderengine_is_view_locked(this.__mrd_ptr)!==0}momentum_1m(){return t.domladderengine_momentum_1m(this.__mrd_ptr)}constructor(_,e){const r=t.domladderengine_new(_,e);return this.__mrd_ptr=r>>>0,Z.register(this,this.__mrd_ptr,this),this}push_book(_,e,r){const n=h(_,t.__wbindgen_export2),s=a,i=h(e,t.__wbindgen_export2),o=a;t.domladderengine_push_book(this.__mrd_ptr,n,s,i,o,r)}push_dom_vol(_,e,r){t.domladderengine_push_dom_vol(this.__mrd_ptr,_,e,r)}render(){return t.domladderengine_render(this.__mrd_ptr)>>>0}reset_symbol(){t.domladderengine_reset_symbol(this.__mrd_ptr)}resize(_,e){t.domladderengine_resize(this.__mrd_ptr,_,e)}scroll_by(_){t.domladderengine_scroll_by(this.__mrd_ptr,_)}sell_volume_1m(){return t.domladderengine_sell_volume_1m(this.__mrd_ptr)}set_fill_intensity(_){t.domladderengine_set_fill_intensity(this.__mrd_ptr,_)}set_hover(_,e){t.domladderengine_set_hover(this.__mrd_ptr,_,e)}set_now_ms(_){t.domladderengine_set_now_ms(this.__mrd_ptr,_)}set_price_precision(_){t.domladderengine_set_price_precision(this.__mrd_ptr,_)}set_qty_display_usd(_){t.domladderengine_set_qty_display_usd(this.__mrd_ptr,_)}set_text_scale(_){t.domladderengine_set_text_scale(this.__mrd_ptr,_)}set_theme(_){t.domladderengine_set_theme(this.__mrd_ptr,_)}set_tick_size(_){t.domladderengine_set_tick_size(this.__mrd_ptr,_)}set_visible_rows(_){t.domladderengine_set_visible_rows(this.__mrd_ptr,_)}set_walls(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.domladderengine_set_walls(this.__mrd_ptr,r,n,s,i)}}Symbol.dispose&&(Y.prototype[Symbol.dispose]=Y.prototype.free);class G{__destroy_into_raw(){const _=this.__mrd_ptr;return this.__mrd_ptr=0,$.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__mrd_orderbookengine_free(_,0)}center_on_mid(){t.orderbookengine_center_on_mid(this.__mrd_ptr)}clear(){t.orderbookengine_clear(this.__mrd_ptr)}clear_hover(){t.orderbookengine_clear_hover(this.__mrd_ptr)}clear_range(){t.orderbookengine_clear_range(this.__mrd_ptr)}get_command_buffer_len(){return t.orderbookengine_get_command_buffer_len(this.__mrd_ptr)>>>0}get_command_buffer_ptr(){return t.orderbookengine_get_command_buffer_ptr(this.__mrd_ptr)>>>0}get_hover_price(){return t.orderbookengine_get_hover_price(this.__mrd_ptr)}get_hover_qty(){return t.orderbookengine_get_hover_qty(this.__mrd_ptr)}get_hover_side(){return t.orderbookengine_get_hover_side(this.__mrd_ptr)}get_range_ask_qty(){return t.orderbookengine_get_range_ask_qty(this.__mrd_ptr)}get_range_bid_qty(){return t.orderbookengine_get_range_bid_qty(this.__mrd_ptr)}get_range_high_price(){return t.orderbookengine_get_range_high_price(this.__mrd_ptr)}get_range_low_price(){return t.orderbookengine_get_range_low_price(this.__mrd_ptr)}get_range_mode(){return t.orderbookengine_get_range_mode(this.__mrd_ptr)>>>0}get_range_tick_count(){return t.orderbookengine_get_range_tick_count(this.__mrd_ptr)>>>0}get_theme(){return t.orderbookengine_get_theme(this.__mrd_ptr)>>>0}is_dirty(){return t.orderbookengine_is_dirty(this.__mrd_ptr)!==0}is_range_active(){return t.orderbookengine_is_range_active(this.__mrd_ptr)!==0}constructor(_,e){const r=t.orderbookengine_new(_,e);return this.__mrd_ptr=r>>>0,$.register(this,this.__mrd_ptr,this),this}pan_y(_){t.orderbookengine_pan_y(this.__mrd_ptr,_)}push_heatmap_col(_,e,r){const n=h(_,t.__wbindgen_export2),s=a,i=h(e,t.__wbindgen_export2),o=a;t.orderbookengine_push_heatmap_col(this.__mrd_ptr,n,s,i,o,r)}push_snapshot(_,e,r){const n=h(_,t.__wbindgen_export2),s=a,i=h(e,t.__wbindgen_export2),o=a;t.orderbookengine_push_snapshot(this.__mrd_ptr,n,s,i,o,r)}render(){return t.orderbookengine_render(this.__mrd_ptr)>>>0}reset_ring(){t.orderbookengine_reset_ring(this.__mrd_ptr)}resize(_,e){t.orderbookengine_resize(this.__mrd_ptr,_,e)}set_auto_center(_){t.orderbookengine_set_auto_center(this.__mrd_ptr,_)}set_depth_book(_,e,r){const n=h(_,t.__wbindgen_export2),s=a,i=h(e,t.__wbindgen_export2),o=a;t.orderbookengine_set_depth_book(this.__mrd_ptr,n,s,i,o,r)}set_exchange_count(_){t.orderbookengine_set_exchange_count(this.__mrd_ptr,_)}set_exchange_labels(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;t.orderbookengine_set_exchange_labels(this.__mrd_ptr,e,r)}set_heatmap_alpha_mul(_){t.orderbookengine_set_heatmap_alpha_mul(this.__mrd_ptr,_)}set_heatmap_cols(_){t.orderbookengine_set_heatmap_cols(this.__mrd_ptr,_)}set_hover(_,e){t.orderbookengine_set_hover(this.__mrd_ptr,_,e)}set_hover_y(_){t.orderbookengine_set_hover_y(this.__mrd_ptr,_)}set_price_precision(_){t.orderbookengine_set_price_precision(this.__mrd_ptr,_)}set_range(_,e){t.orderbookengine_set_range(this.__mrd_ptr,_,e)}set_range_from_mid(_){t.orderbookengine_set_range_from_mid(this.__mrd_ptr,_)}set_ring_capacity(_,e){t.orderbookengine_set_ring_capacity(this.__mrd_ptr,_,e)}set_show_cumulative(_){t.orderbookengine_set_show_cumulative(this.__mrd_ptr,_)}set_show_signal_overlays(_){t.orderbookengine_set_show_signal_overlays(this.__mrd_ptr,_)}set_signal_absorption(_,e){t.orderbookengine_set_signal_absorption(this.__mrd_ptr,_,e)}set_signal_flow(_,e){t.orderbookengine_set_signal_flow(this.__mrd_ptr,_,e)}set_signal_gaps(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.orderbookengine_set_signal_gaps(this.__mrd_ptr,r,n,s,i)}set_signal_obi(_,e,r){t.orderbookengine_set_signal_obi(this.__mrd_ptr,_,e,r)}set_signal_spoof(_){t.orderbookengine_set_signal_spoof(this.__mrd_ptr,_)}set_signal_walls(_,e){const r=h(_,t.__wbindgen_export2),n=a,s=h(e,t.__wbindgen_export2),i=a;t.orderbookengine_set_signal_walls(this.__mrd_ptr,r,n,s,i)}set_symbol(_){const e=w(_,t.__wbindgen_export2,t.__wbindgen_export3),r=a;t.orderbookengine_set_symbol(this.__mrd_ptr,e,r)}set_theme(_){t.orderbookengine_set_theme(this.__mrd_ptr,_)}set_tick_size(_){t.orderbookengine_set_tick_size(this.__mrd_ptr,_)}set_visible_ticks(_){t.orderbookengine_set_visible_ticks(this.__mrd_ptr,_)}zoom_y(_,e){t.orderbookengine_zoom_y(this.__mrd_ptr,_,e)}}Symbol.dispose&&(G.prototype[Symbol.dispose]=G.prototype.free);class J{__destroy_into_raw(){const _=this.__mrd_ptr;return this.__mrd_ptr=0,__.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__mrd_tickengine_free(_,0)}chart_height_px(){return t.tickengine_chart_height_px(this.__mrd_ptr)}chart_left_px(){return t.tickengine_chart_left_px(this.__mrd_ptr)}chart_top_px(){return t.tickengine_chart_top_px(this.__mrd_ptr)}chart_width_px(){return t.tickengine_chart_width_px(this.__mrd_ptr)}clear(){t.tickengine_clear(this.__mrd_ptr)}clear_hover(){t.tickengine_clear_hover(this.__mrd_ptr)}get_command_buffer_len(){return t.tickengine_get_command_buffer_len(this.__mrd_ptr)>>>0}get_command_buffer_ptr(){return t.tickengine_get_command_buffer_ptr(this.__mrd_ptr)>>>0}get_last_mid(){return t.tickengine_get_last_mid(this.__mrd_ptr)}hit_zone(_,e){return t.tickengine_hit_zone(this.__mrd_ptr,_,e)}is_dirty(){return t.tickengine_is_dirty(this.__mrd_ptr)!==0}constructor(_,e){const r=t.tickengine_new(_,e);return this.__mrd_ptr=r>>>0,__.register(this,this.__mrd_ptr,this),this}pan_x(_){t.tickengine_pan_x(this.__mrd_ptr,_)}pan_y(_){t.tickengine_pan_y(this.__mrd_ptr,_)}push_book(_,e,r,n){const s=h(e,t.__wbindgen_export2),i=a,o=h(r,t.__wbindgen_export2),c=a;t.tickengine_push_book(this.__mrd_ptr,_,s,i,o,c,n)}push_trade(_,e,r,n){t.tickengine_push_trade(this.__mrd_ptr,_,e,r,n)}push_trades_batch(_){const e=h(_,t.__wbindgen_export2),r=a;t.tickengine_push_trades_batch(this.__mrd_ptr,e,r)}render(){return t.tickengine_render(this.__mrd_ptr)>>>0}reset_view(){t.tickengine_reset_view(this.__mrd_ptr)}reset_y_auto(){t.tickengine_reset_y_auto(this.__mrd_ptr)}resize(_,e){t.tickengine_resize(this.__mrd_ptr,_,e)}set_auto_scale_y(_){t.tickengine_set_auto_scale_y(this.__mrd_ptr,_)}set_follow_live(_){t.tickengine_set_follow_live(this.__mrd_ptr,_)}set_heatmap_intensity(_,e){t.tickengine_set_heatmap_intensity(this.__mrd_ptr,_,e)}set_heatmap_palette(_){t.tickengine_set_heatmap_palette(this.__mrd_ptr,_)}set_hover(_,e){t.tickengine_set_hover(this.__mrd_ptr,_,e)}set_large_trade_3d(_){t.tickengine_set_large_trade_3d(this.__mrd_ptr,_)}set_large_trade_scale(_){t.tickengine_set_large_trade_scale(this.__mrd_ptr,_)}set_lookback(_,e){t.tickengine_set_lookback(this.__mrd_ptr,_,e)}set_price_precision(_){t.tickengine_set_price_precision(this.__mrd_ptr,_)}set_show_book_heatmap(_){t.tickengine_set_show_book_heatmap(this.__mrd_ptr,_)}set_show_depth_lens(_){t.tickengine_set_show_depth_lens(this.__mrd_ptr,_)}set_show_grid(_){t.tickengine_set_show_grid(this.__mrd_ptr,_)}set_show_latest_profile(_){t.tickengine_set_show_latest_profile(this.__mrd_ptr,_)}set_show_price_line(_){t.tickengine_set_show_price_line(this.__mrd_ptr,_)}set_show_trade_tape(_){t.tickengine_set_show_trade_tape(this.__mrd_ptr,_)}set_show_volume(_){t.tickengine_set_show_volume(this.__mrd_ptr,_)}set_show_vwap(_){t.tickengine_set_show_vwap(this.__mrd_ptr,_)}set_theme(_){t.tickengine_set_theme(this.__mrd_ptr,_)}set_tick_size(_){t.tickengine_set_tick_size(this.__mrd_ptr,_)}set_tz_offset_seconds(_){t.tickengine_set_tz_offset_seconds(this.__mrd_ptr,_)}xaxis_height_px(){return t.tickengine_xaxis_height_px(this.__mrd_ptr)}yaxis_width_px(){return t.tickengine_yaxis_width_px(this.__mrd_ptr)}zoom(_,e,r){t.tickengine_zoom(this.__mrd_ptr,_,e,r)}zoom_x(_,e){t.tickengine_zoom_x(this.__mrd_ptr,_,e)}zoom_y(_,e){t.tickengine_zoom_y(this.__mrd_ptr,_,e)}}Symbol.dispose&&(J.prototype[Symbol.dispose]=J.prototype.free);function F_(){t.wasm_init()}function R_(){const g=t.wasm_memory();return s_(g)}function K(){return{__proto__:null,"./chart_engine_bg.js":{__proto__:null,__mrd___wbindgen_memory_edb3f01e3930bbf6:function(){const _=t.memory;return t_(_)},__mrd___wbindgen_throw_6ddd609b62940d55:function(_,e){throw new Error(q(_,e))},__mrd_error_a6fa202b58aa1cd3:function(_,e){let r,n;try{r=_,n=e,console.error(q(_,e))}finally{t.__wbindgen_export(r,n,1)}},__mrd_new_227d7c05414eb861:function(){const _=new Error;return t_(_)},__mrd_stack_3b0d974bbf31e44f:function(_,e){const r=n_(e).stack,n=w(r,t.__wbindgen_export2,t.__wbindgen_export3),s=a;u().setInt32(_+4,s,!0),u().setInt32(_+0,n,!0)},__wbindgen_object_drop_ref:function(_){s_(_)}}}}const Q=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(g=>t.__mrd_chartengine_free(g>>>0,1)),Z=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(g=>t.__mrd_domladderengine_free(g>>>0,1)),$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(g=>t.__mrd_orderbookengine_free(g>>>0,1)),__=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(g=>t.__mrd_tickengine_free(g>>>0,1));function t_(g){B===M.length&&M.push(M.length+1);const _=B;return B=M[_],M[_]=g,_}function w_(g){g<1028||(M[g]=B,B=g)}function O(g,_){return g=g>>>0,e_().subarray(g/8,g/8+_)}function v_(g,_){return g=g>>>0,x_().subarray(g/4,g/4+_)}function f_(g,_){return g=g>>>0,r_().subarray(g/4,g/4+_)}let E=null;function u(){return(E===null||E.buffer.detached===!0||E.buffer.detached===void 0&&E.buffer!==t.memory.buffer)&&(E=new DataView(t.memory.buffer)),E}let T=null;function e_(){return(T===null||T.byteLength===0)&&(T=new Float64Array(t.memory.buffer)),T}let D=null;function x_(){return(D===null||D.byteLength===0)&&(D=new Int32Array(t.memory.buffer)),D}function q(g,_){return g=g>>>0,q_(g,_)}let L=null;function r_(){return(L===null||L.byteLength===0)&&(L=new Uint32Array(t.memory.buffer)),L}let U=null;function C(){return(U===null||U.byteLength===0)&&(U=new Uint8Array(t.memory.buffer)),U}function n_(g){return M[g]}let M=new Array(1024).fill(void 0);M.push(void 0,null,!0,!1);let B=M.length;function S(g,_){const e=_(g.length*4,4)>>>0;return r_().set(g,e/4),a=g.length,e}function k_(g,_){const e=_(g.length*1,1)>>>0;return C().set(g,e/1),a=g.length,e}function h(g,_){const e=_(g.length*8,8)>>>0;return e_().set(g,e/8),a=g.length,e}function w(g,_,e){if(e===void 0){const o=V.encode(g),c=_(o.length,1)>>>0;return C().subarray(c,c+o.length).set(o),a=o.length,c}let r=g.length,n=_(r,1)>>>0;const s=C();let i=0;for(;i<r;i++){const o=g.charCodeAt(i);if(o>127)break;s[n+i]=o}if(i!==r){i!==0&&(g=g.slice(i)),n=e(n,r,r=i+g.length*3,1)>>>0;const o=C().subarray(n+i,n+r),c=V.encodeInto(g,o);i+=c.written,n=e(n,r,i,1)>>>0}return a=i,n}function s_(g){const _=n_(g);return w_(g),_}let P=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});P.decode();const y_=2146435072;let H=0;function q_(g,_){return H+=_,H>=y_&&(P=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),P.decode(),H=_),P.decode(C().subarray(g,g+_))}const V=new TextEncoder;"encodeInto"in V||(V.encodeInto=function(g,_){const e=V.encode(g);return _.set(e),{read:g.length,written:e.length}});let a=0,z_,t;function i_(g,_){return t=g.exports,z_=_,E=null,T=null,D=null,L=null,U=null,t.__wbindgen_start(),t}async function I_(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 A_(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 _=K();g instanceof WebAssembly.Module||(g=new WebAssembly.Module(g));const e=new WebAssembly.Instance(g,_);return i_(e,g)}async function j_(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 _=K();(typeof g=="string"||typeof Request=="function"&&g instanceof Request||typeof URL=="function"&&g instanceof URL)&&(g=fetch(g));const{instance:e,module:r}=await I_(await g,_);return i_(e,r)}export{X as ChartEngine,Y as DomLadderEngine,G as OrderbookEngine,J as TickEngine,j_ as default,A_ as initSync,F_ as wasm_init,R_ as wasm_memory};
Binary file
@@ -1 +1 @@
1
- var z={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,GRADIENT_RECT:16,END_FRAME:255},Be=["left","center","right"],Tt=new Map,Ge=4096;function qe(t,r,s,o){return t<<24|r<<16|s<<8|o}function V(t,r,s,o){let w=qe(t,r,s,o),e=Tt.get(w);return e||(e=`rgba(${t},${r},${s},${(o/255).toFixed(3)})`,Tt.size>=Ge&&Tt.clear(),Tt.set(w,e),e)}var re=new TextDecoder;function ut(t,r){return r&1?Math.round(t)+.5:Math.round(t)}function ct(t,r,s,o){let w=r.buffer;if(s+o>w.byteLength)return;let e=new DataView(w,s,o),i=new Uint8Array(w,s,o),n=0,u="",l="",f=-1,p="";for(;n<o;){let g=i[n];if(n+=1,g===z.END_FRAME)break;switch(g){case z.FILL_RECT:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4,c!==u&&(t.fillStyle=c,u=c);let M=Math.round(a),m=Math.round(_);t.fillRect(M,m,Math.round(a+d)-M,Math.round(_+h)-m);break}case z.STROKE_RECT:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let M=e.getFloat32(n,!0);n+=4,c!==l&&(t.strokeStyle=c,l=c),M!==f&&(t.lineWidth=M,f=M);let I=Math.round(M)&1,L=I?Math.round(a)+.5:Math.round(a),P=I?Math.round(_)+.5:Math.round(_);t.strokeRect(L,P,Math.round(d),Math.round(h));break}case z.LINE:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let M=e.getFloat32(n,!0);n+=4,t.beginPath(),c!==l&&(t.strokeStyle=c,l=c),M!==f&&(t.lineWidth=M,f=M),t.setLineDash([]);let m=Math.round(M);t.moveTo(ut(a,m),ut(_,m)),t.lineTo(ut(d,m),ut(h,m)),t.stroke();break}case z.DASHED_LINE:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let M=e.getFloat32(n,!0);n+=4;let m=e.getFloat32(n,!0);n+=4;let I=e.getFloat32(n,!0);n+=4,t.beginPath(),c!==l&&(t.strokeStyle=c,l=c),M!==f&&(t.lineWidth=M,f=M),t.setLineDash([m,I]);let L=Math.round(M);t.moveTo(ut(a,L),ut(_,L)),t.lineTo(ut(d,L),ut(h,L)),t.stroke(),t.setLineDash([]);break}case z.POLYLINE:{let a=e.getUint16(n,!0);n+=2;let _=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let d=e.getFloat32(n,!0);if(n+=4,a>0){let h=new Float32Array(a*2);for(let c=0;c<a;c++)h[c*2]=e.getFloat32(n,!0),n+=4,h[c*2+1]=e.getFloat32(n,!0),n+=4;if(t.beginPath(),_!==l&&(t.strokeStyle=_,l=_),d!==f&&(t.lineWidth=d,f=d),t.setLineDash([]),t.lineJoin="round",t.lineCap="round",a<=3){t.moveTo(h[0],h[1]);for(let c=1;c<a;c++)t.lineTo(h[c*2],h[c*2+1])}else{t.moveTo(h[0],h[1]),t.lineTo((h[0]+h[2])*.5,(h[1]+h[3])*.5);for(let c=1;c<a-1;c++){let M=h[c*2],m=h[c*2+1],I=h[(c+1)*2],L=h[(c+1)*2+1];t.quadraticCurveTo(M,m,(M+I)*.5,(m+L)*.5)}t.lineTo(h[(a-1)*2],h[(a-1)*2+1])}t.stroke()}break}case z.TEXT:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=i[n];n+=1;let M=e.getUint16(n,!0);n+=2;let m=re.decode(new Uint8Array(r.buffer,s+n,M));n+=M,d!==u&&(t.fillStyle=d,u=d);let I=`${Math.round(h)}px "IBM Plex Mono",monospace`;I!==p&&(t.font=I,p=I),t.textAlign=Be[c]||"left",t.textBaseline="middle",t.fillText(m,Math.round(a),Math.round(_));break}case z.CIRCLE:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let c=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let M=e.getFloat32(n,!0);n+=4,t.beginPath(),t.arc(a,_,d,0,Math.PI*2),h!==u&&(t.fillStyle=h,u=h),t.fill(),M>0&&(c!==l&&(t.strokeStyle=c,l=c),M!==f&&(t.lineWidth=M,f=M),t.stroke());break}case z.TRIANGLE:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=e.getFloat32(n,!0);n+=4;let M=e.getFloat32(n,!0);n+=4;let m=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4,t.beginPath(),t.moveTo(a,_),t.lineTo(d,h),t.lineTo(c,M),t.closePath(),m!==u&&(t.fillStyle=m,u=m),t.fill();break}case z.SAVE:{t.save();break}case z.RESTORE:{t.restore(),u="",l="",f=-1,p="";break}case z.CLIP_RECT:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=Math.floor(a),M=Math.floor(_);t.beginPath(),t.rect(c,M,Math.ceil(a+d)-c,Math.ceil(_+h)-M),t.clip();break}case z.ROTATED_TEXT:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=e.getFloat32(n,!0);n+=4;let M=e.getUint16(n,!0);n+=2;let m=re.decode(i.subarray(n,n+M));n+=M;let I=`${h}px sans-serif`;I!==p&&(t.font=I,p=I),d!==u&&(t.fillStyle=d,u=d),t.textAlign="center",t.textBaseline="middle",t.save(),t.translate(a,_),t.rotate(c),t.fillText(m,0,0),t.restore();break}case z.BUBBLE_3D:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=i[n],c=i[n+1],M=i[n+2],m=i[n+3];n+=4;let I=i[n],L=i[n+1],P=i[n+2],X=i[n+3];n+=4;let $=i[n],N=i[n+1],k=i[n+2],at=i[n+3];n+=4;let ht=e.getFloat32(n,!0);n+=4;let Y=d;if(Y<10){let W=`rgba(${h},${c},${M},${(m/255).toFixed(3)})`;t.beginPath(),t.arc(a,_,Y,0,Math.PI*2),t.fillStyle=W,t.fill(),u=""}else if(Y<18){let W=a-Y*.25,H=_-Y*.25,G=t.createRadialGradient(W,H,Y*.08,a,_,Y);G.addColorStop(0,`rgba(${I},${L},${P},${(X/255).toFixed(3)})`),G.addColorStop(1,`rgba(${h},${c},${M},${(m/255).toFixed(3)})`),t.beginPath(),t.arc(a,_,Y,0,Math.PI*2),t.fillStyle=G,t.fill(),u=""}else{let W=a-Y*.25,H=_-Y*.25,G=t.createRadialGradient(a,_,Y*.85,a,_,Y*1.2);G.addColorStop(0,`rgba(${$},${N},${k},${(at/255*.5).toFixed(3)})`),G.addColorStop(1,`rgba(${$},${N},${k},0)`),t.beginPath(),t.arc(a,_,Y*1.2,0,Math.PI*2),t.fillStyle=G,t.fill();let lt=t.createRadialGradient(W,H,Y*.08,a,_,Y);lt.addColorStop(0,`rgba(${I},${L},${P},${(X/255).toFixed(3)})`),lt.addColorStop(1,`rgba(${h},${c},${M},${(m/255).toFixed(3)})`),t.beginPath(),t.arc(a,_,Y,0,Math.PI*2),t.fillStyle=lt,t.fill();let b=Y*.2,C=t.createRadialGradient(W,H,0,W,H,b);C.addColorStop(0,"rgba(255,255,255,0.22)"),C.addColorStop(1,"rgba(255,255,255,0)"),t.beginPath(),t.arc(W,H,b,0,Math.PI*2),t.fillStyle=C,t.fill(),u=""}break}case z.FILL_POLYGON:{let a=e.getUint16(n,!0);n+=2;let _=V(i[n],i[n+1],i[n+2],i[n+3]);if(n+=4,a>2){t.beginPath();let d=e.getFloat32(n,!0);n+=4;let h=e.getFloat32(n,!0);n+=4,t.moveTo(d,h);for(let c=1;c<a;c++)t.lineTo(e.getFloat32(n,!0),e.getFloat32(n+4,!0)),n+=8;t.closePath(),_!==u&&(t.fillStyle=_,u=_),t.fill()}else n+=a*8;break}case z.DASHED_POLYLINE:{let a=e.getUint16(n,!0);n+=2;let _=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=e.getFloat32(n,!0);if(n+=4,a>1){t.beginPath(),_!==l&&(t.strokeStyle=_,l=_),d!==f&&(t.lineWidth=d,f=d),t.setLineDash([h,c]),t.lineJoin="round";let M=e.getFloat32(n,!0);n+=4;let m=e.getFloat32(n,!0);n+=4,t.moveTo(M,m);for(let I=1;I<a;I++)t.lineTo(e.getFloat32(n,!0),e.getFloat32(n+4,!0)),n+=8;t.stroke(),t.setLineDash([])}else n+=a*8;break}case z.GRADIENT_RECT:{let a=e.getFloat32(n,!0);n+=4;let _=e.getFloat32(n,!0);n+=4;let d=e.getFloat32(n,!0);n+=4;let h=e.getFloat32(n,!0);n+=4;let c=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let M=V(i[n],i[n+1],i[n+2],i[n+3]);n+=4;let m=Math.round(a),I=Math.round(_),L=Math.round(a+d)-m,P=Math.round(_+h)-I,X=t.createLinearGradient(m,I,m,I+P);X.addColorStop(0,c),X.addColorStop(1,M),t.fillStyle=X,u="",t.fillRect(m,I,L,P);break}default:return}}}var K={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 bt(t){return K[t]?.type==="2point"}function It(t){return K[t]?.type==="3point"}function wt(t){let r=K[t]?.type;return r==="1point"||r==="1point_x"||r==="1point_xy"||r==="1point_xp"}function Et(t){return K[t]?.type==="freehand"}function ot(t){return K[t]?.type==="npoint"}function st(t){return K[t]?.type==="elliott_manual"}var oe={r:.04,g:.49,b:1,lineWidth:2,dashed:!1,fontSize:12};function nt(t,r,s,o,w,e){e=e||oe;let i=K[r];if(!i)return 0;let n=0;return i.type==="3point"?n=t[i.addFn](s.x1,s.y1,s.x2,s.y2,o,w,e.r,e.g,e.b,e.lineWidth,e.dashed,s.pane):i.type==="2point"?n=t[i.addFn](s.x1,s.y1,o,w,e.r,e.g,e.b,e.lineWidth,e.dashed,s.pane):i.type==="1point_x"?n=t[i.addFn](o,e.r,e.g,e.b,e.lineWidth,e.dashed,s.pane):i.type==="1point_xp"?n=t[i.addFn](o,w,e.r,e.g,e.b,e.lineWidth,e.dashed,s.pane):i.type==="1point_xy"?n=t[i.addFn](o,w,e.r,e.g,e.b,e.fontSize||12,s.pane):n=t[i.addFn](w,e.r,e.g,e.b,e.lineWidth,e.dashed,s.pane),n||0}function U(t,r,s,o,w,e,i){e=e||oe;let n=K[r];if(n){if(n.previewFn==="elliott"){t.set_elliott_preview(o,w,e.r,e.g,e.b,e.lineWidth,i);return}n.type==="3point"?s.step===1?t.set_drawing_preview(n.previewKind,s.x1,s.y1,o,w,e.r,e.g,e.b,e.lineWidth,e.dashed,i):s.step===2&&(n.previewFn==="fib_ext"?t.set_fib_ext_preview(s.x1,s.y1,s.x2,s.y2,o,w,e.r,e.g,e.b,e.lineWidth,e.dashed,i):t.set_channel_preview(s.x1,s.y1,s.x2,s.y2,o,w,e.r,e.g,e.b,e.lineWidth,e.dashed,i)):n.type==="2point"?t.set_drawing_preview(n.previewKind,s.x1,s.y1,o,w,e.r,e.g,e.b,e.lineWidth,e.dashed,i):n.type==="1point_x"?t.set_drawing_preview(n.previewKind,o,0,0,0,e.r,e.g,e.b,e.lineWidth,e.dashed,i):n.type==="1point_xp"||n.type==="1point_xy"?t.set_drawing_preview(n.previewKind,o,w,0,0,e.r,e.g,e.b,e.lineWidth,e.dashed,i):t.set_drawing_preview(n.previewKind,0,w,0,0,e.r,e.g,e.b,e.lineWidth,e.dashed,i)}}function F(t,r,s,o){let w=t.screen_to_world_x(r),e;switch(o){case 1:e=t.screen_to_rsi_y(s);break;case 2:e=t.screen_to_oi_y(s);break;case 3:e=t.screen_to_fr_y(s);break;case 4:e=t.screen_to_cvd_y(s);break;case 5:e=t.screen_to_vpin_y(s);break;case 6:e=t.screen_to_ob_flow_y(s);break;default:e=t.screen_to_world_y(s);break}return{wx:w,wy:e}}function J(t){return t===4?1:t===6?2:t===8?3:t===10?4:t===12?5:t===19?6:0}function dt(t){return t===4||t===6||t===8||t===10||t===12||t===19}function D(t){return t===14||t===15||t===16||t===17||t===18||t===21}function x(t){return t===4||t===14?1:t===6||t===15?2:t===8||t===16?3:t===10||t===17?4:t===12||t===18?5:t===19||t===21?6:0}function it(t,r,s,o){dt(r)?(t.pan(s,0),Math.abs(o)>.01&&r!==4&&t.pan_indicator_y(x(r),o)):t.pan(s,o)}function q(t){return t===0||t===4||t===6||t===8||t===10||t===12}function _e(t,r,s,o){t.addEventListener("wheel",l=>{if(o.disposed)return;l.preventDefault(),o.cancelMomentum();let f=l.deltaY>0?1.1:.9,p=r.hit_zone(l.offsetX,l.offsetY);D(p)?p!==14&&r.zoom_indicator_y(x(p),l.offsetY,f):dt(p)?p===4?r.zoom_x(l.offsetX,f):l.ctrlKey?r.zoom_indicator_y(x(p),l.offsetY,f):r.zoom_x(l.offsetX,f):l.ctrlKey?r.zoom_y(l.offsetY,f):l.shiftKey||p===2?r.zoom_x(l.offsetX,f):p===3?r.zoom_y(l.offsetY,f):r.zoom(l.offsetX,l.offsetY,f),s.onDirty()},{passive:!1}),t.addEventListener("mousedown",l=>{if(o.disposed||l.button!==0)return;o.cancelMomentum(),e();let f=performance.now();if(f-o.lastClickTime<300){o.lastClickTime=f;return}o.lastClickTime=f;let p=o.drawingMode;if(p){let a=r.hit_zone(l.offsetX,l.offsetY);if(!q(a))return;let _=J(a),{wx:d,wy:h}=F(r,l.offsetX,l.offsetY,_),c=p.style,M=p.tool;if(st(M)){if(!p.pathStarted)p.pane=_,r.start_elliott_manual(c.r,c.g,c.b,c.lineWidth,_),r.add_elliott_manual_point(d,h),p.pathStarted=!0,p.step=1;else if(r.add_elliott_manual_point(d,h)){o.finishDrawing(),s.onDirty();return}}else if(ot(M))p.pathStarted?r.add_path_point(d,h):(p.pane=_,r.start_path(c.r,c.g,c.b,c.lineWidth,c.dashed,_),r.add_path_point(d,h),p.pathStarted=!0,p.step=1);else if(Et(M))p.pane=_,r.start_brush(c.r,c.g,c.b,c.lineWidth,_),r.add_brush_point(d,h),o.isBrushing=!0;else if(It(M))if(p.step===0)p.x1=d,p.y1=h,p.pane=_,p.step=1;else if(p.step===1)p.x2=d,p.y2=h,p.step=2,r.clear_drawing_preview();else{let m=K[M];m&&m.previewFn==="fib_ext"?r.clear_fib_ext_preview():r.clear_channel_preview(),nt(r,M,p,d,h,c),o.finishDrawing()}else if(bt(M))p.step===0?(p.x1=d,p.y1=h,p.pane=_,p.step=1):(nt(r,M,p,d,h,c),o.finishDrawing());else{p.pane=_;let m=nt(r,M,p,d,h,c);o.finishDrawing(),M==="textnote"&&m>0&&(r.select_drawing(m),s.onDrawingSelected?.(m),s.onDrawingDblClick?.(m,l.offsetX,l.offsetY,l.clientX,l.clientY))}s.onDirty();return}let g=r.hit_zone(l.offsetX,l.offsetY);if(g===5){o.isResizingRsi=!0,o.resizeStartY=l.offsetY,o.resizeStartRatio=r.get_rsi_ratio(),t.style.cursor="ns-resize";return}if(g===7){o.isResizingOi=!0,o.resizeStartY=l.offsetY,o.resizeStartRatio=r.get_oi_ratio(),t.style.cursor="ns-resize";return}if(g===9){o.isResizingFr=!0,o.resizeStartY=l.offsetY,o.resizeStartRatio=r.get_fr_ratio(),t.style.cursor="ns-resize";return}if(g===11){o.isResizingCvd=!0,o.resizeStartY=l.offsetY,o.resizeStartRatio=r.get_cvd_ratio(),t.style.cursor="ns-resize";return}if(g===13){o.isResizingVpin=!0,o.resizeStartY=l.offsetY,o.resizeStartRatio=r.get_vpin_ratio(),t.style.cursor="ns-resize";return}if(g===20){o.isResizingObFlow=!0,o.resizeStartY=l.offsetY,o.resizeStartRatio=r.get_obf_ratio(),t.style.cursor="ns-resize";return}if(q(g)){let a=r.get_selected_drawing();if(a>0){let M=r.hit_test_drawing_anchor(l.offsetX,l.offsetY);if(M>=0){o.isDraggingAnchor=!0,o.dragAnchorIdx=M,o.dragAnchorPane=J(g),t.style.cursor="grabbing";return}if(r.hit_test_drawing(l.offsetX,l.offsetY)===a){o.isDraggingDrawing=!0,o.dragDrawingPane=J(g);let{wx:I,wy:L}=F(r,l.offsetX,l.offsetY,o.dragDrawingPane);o.dragDrawingLastWx=I,o.dragDrawingLastWy=L,t.style.cursor="move";return}}let _=r.hit_test_drawing(l.offsetX,l.offsetY);if(_>0){r.deselect_marker(),s.onMarkerSelected?.(0),r.select_drawing(_),s.onDrawingSelected?.(_),s.onDirty();return}let d=r.hit_test_marker(l.offsetX,l.offsetY);if(d>0){r.deselect_drawing(),s.onDrawingSelected?.(0),r.select_marker(d),s.onMarkerSelected?.(d),s.onDirty();return}let h=r.get_selected_drawing(),c=r.get_selected_marker();h>0&&(r.deselect_drawing(),s.onDrawingSelected?.(0),s.onDirty()),c>0&&(r.deselect_marker(),s.onMarkerSelected?.(0),s.onDirty())}q(g)&&(o.liqPinSx=l.offsetX,o.liqPinSy=l.offsetY,o.liqPinTimer&&clearTimeout(o.liqPinTimer),o.liqPinTimer=setTimeout(()=>{o.liqPinTimer=null,s.onLiqAnnotationPin?.(o.liqPinSx,o.liqPinSy)},700)),o.isDragging=!0,o.dragZone=g,o.lastX=l.offsetX,o.lastY=l.offsetY,g===2?t.style.cursor="ew-resize":g===3||D(g)?t.style.cursor="ns-resize":t.style.cursor="grabbing"});let w=null;function e(){w&&(cancelAnimationFrame(w),w=null)}function i(l,f){let p=r.hover_hit_test(l,f),g=p[0],a=p[1],_=p[2],d=p[3],h=p[4],c=o.drawingMode;g===2?t.style.cursor="ew-resize":g===3||D(g)||g===5||g===7||g===9||g===11||g===13||g===20?t.style.cursor="ns-resize":!c&&q(g)&&a>0&&_>=0?t.style.cursor="grab":!c&&q(g)&&a>0&&d===a?t.style.cursor="move":!c&&q(g)&&(d>0||h>0)?t.style.cursor="pointer":t.style.cursor="crosshair"}function n(l,f){let p=r.hit_zone(l,f);p===2||p===3||D(p)?r.hide_crosshair():r.set_crosshair(l,f),s.onDirty(),s.onCrosshairMove?.(l,f,p),s.onVrvpHover?.(l,f),o._pendingHoverX=l,o._pendingHoverY=f,w||(w=requestAnimationFrame(()=>{w=null,o.disposed||i(o._pendingHoverX,o._pendingHoverY)}))}t.addEventListener("mousemove",l=>{if(o.disposed)return;if(o.liqPinTimer){let p=Math.abs(l.offsetX-o.liqPinSx),g=Math.abs(l.offsetY-o.liqPinSy);(p>6||g>6)&&(clearTimeout(o.liqPinTimer),o.liqPinTimer=null)}if(o.isResizingRsi){let g=t.getBoundingClientRect().height-28,_=(o.resizeStartY-l.offsetY)/g,d=Math.max(.05,Math.min(.5,o.resizeStartRatio+_));r.set_rsi_ratio(d),s.onDirty();return}if(o.isResizingOi){let g=t.getBoundingClientRect().height-28,_=(o.resizeStartY-l.offsetY)/g,d=Math.max(.05,Math.min(.5,o.resizeStartRatio+_));r.set_oi_ratio(d),s.onDirty();return}if(o.isResizingFr){let g=t.getBoundingClientRect().height-28,_=(o.resizeStartY-l.offsetY)/g,d=Math.max(.05,Math.min(.5,o.resizeStartRatio+_));r.set_fr_ratio(d),s.onDirty();return}if(o.isResizingCvd){let g=t.getBoundingClientRect().height-28,_=(o.resizeStartY-l.offsetY)/g,d=Math.max(.05,Math.min(.5,o.resizeStartRatio+_));r.set_cvd_ratio(d),s.onDirty();return}if(o.isResizingVpin){let g=t.getBoundingClientRect().height-28,_=(o.resizeStartY-l.offsetY)/g,d=Math.max(.05,Math.min(.5,o.resizeStartRatio+_));r.set_vpin_ratio(d),s.onDirty();return}if(o.isResizingObFlow){let g=t.getBoundingClientRect().height-28,_=(o.resizeStartY-l.offsetY)/g,d=Math.max(.05,Math.min(.5,o.resizeStartRatio+_));r.set_obf_ratio(d),s.onDirty();return}if(o.isDraggingAnchor){let{wx:p,wy:g}=F(r,l.offsetX,l.offsetY,o.dragAnchorPane);r.update_drawing_anchor(o.dragAnchorIdx,p,g),r.set_crosshair(l.offsetX,l.offsetY),s.onDirty(),s.onCrosshairMove?.(l.offsetX,l.offsetY,r.hit_zone(l.offsetX,l.offsetY));return}if(o.isDraggingDrawing){let{wx:p,wy:g}=F(r,l.offsetX,l.offsetY,o.dragDrawingPane),a=p-o.dragDrawingLastWx,_=g-o.dragDrawingLastWy;r.move_drawing(a,_),o.dragDrawingLastWx=p,o.dragDrawingLastWy=g,r.set_crosshair(l.offsetX,l.offsetY),s.onDirty(),s.onCrosshairMove?.(l.offsetX,l.offsetY,r.hit_zone(l.offsetX,l.offsetY));return}let f=o.drawingMode;if(o.isBrushing&&f){let p=f.pane||0,{wx:g,wy:a}=F(r,l.offsetX,l.offsetY,p);r.add_brush_point(g,a),r.set_crosshair(l.offsetX,l.offsetY),s.onDirty();return}if(f&&st(f.tool)&&f.pathStarted){let p=f.pane||0,{wx:g,wy:a}=F(r,l.offsetX,l.offsetY,p);r.set_elliott_manual_cursor(g,a),r.set_crosshair(l.offsetX,l.offsetY);let _=r.hit_zone(l.offsetX,l.offsetY);s.onDirty(),s.onCrosshairMove?.(l.offsetX,l.offsetY,_);return}if(f&&ot(f.tool)&&f.pathStarted){let p=f.pane||0,{wx:g,wy:a}=F(r,l.offsetX,l.offsetY,p);r.set_path_cursor(g,a),r.set_crosshair(l.offsetX,l.offsetY);let _=r.hit_zone(l.offsetX,l.offsetY);s.onDirty(),s.onCrosshairMove?.(l.offsetX,l.offsetY,_);return}if(f&&f.step>0){let p=f.pane||0,{wx:g,wy:a}=F(r,l.offsetX,l.offsetY,p);U(r,f.tool,f,g,a,f.style,p),r.set_crosshair(l.offsetX,l.offsetY);let _=r.hit_zone(l.offsetX,l.offsetY);s.onDirty(),s.onCrosshairMove?.(l.offsetX,l.offsetY,_);return}if(f&&wt(f.tool)){let p=r.hit_zone(l.offsetX,l.offsetY),g=J(p),{wx:a,wy:_}=F(r,l.offsetX,l.offsetY,g);U(r,f.tool,f,a,_,f.style,g),r.set_crosshair(l.offsetX,l.offsetY),s.onDirty(),s.onCrosshairMove?.(l.offsetX,l.offsetY,p);return}if(o.isDragging){let p=l.offsetX-o.lastX,g=l.offsetY-o.lastY;o.lastX=l.offsetX,o.lastY=l.offsetY,o.dragZone===2?r.pan_x(p):o.dragZone===3?r.pan_y(g):o.dragZone===14||(D(o.dragZone)?r.pan_indicator_y(x(o.dragZone),g):it(r,o.dragZone,p,g)),r.set_crosshair(l.offsetX,l.offsetY),s.onDirty(),s.onCrosshairMove?.(l.offsetX,l.offsetY,o.dragZone),s.onVrvpHover?.(l.offsetX,l.offsetY);return}n(l.offsetX,l.offsetY)}),t.addEventListener("mouseup",()=>{o.disposed||(o.liqPinTimer&&(clearTimeout(o.liqPinTimer),o.liqPinTimer=null),o.isBrushing&&(o.isBrushing=!1,r.finish_brush(),o.finishDrawing(),s.onDirty()),o.isDragging=!1,o.isResizingRsi=!1,o.isResizingOi=!1,o.isResizingFr=!1,o.isResizingCvd=!1,o.isResizingVpin=!1,o.isResizingObFlow=!1,o.isDraggingAnchor=!1,o.isDraggingDrawing=!1,o.dragAnchorIdx=-1,t.style.cursor="crosshair")});function u(){o.disposed||o._leaveHandled||(o._leaveHandled=!0,requestAnimationFrame(()=>{o._leaveHandled=!1}),e(),o.liqPinTimer&&(clearTimeout(o.liqPinTimer),o.liqPinTimer=null),o.isBrushing&&(o.isBrushing=!1,r.finish_brush(),o.finishDrawing()),o.isDragging=!1,o.isResizingRsi=!1,o.isResizingOi=!1,o.isResizingFr=!1,o.isResizingCvd=!1,o.isResizingVpin=!1,o.isResizingObFlow=!1,o.isDraggingAnchor=!1,o.isDraggingDrawing=!1,o.dragAnchorIdx=-1,r.hide_crosshair(),t.style.cursor="crosshair",s.onDirty(),s.onCrosshairHide?.(),s.onVrvpHover?.(null,null))}t.addEventListener("pointerleave",u),t.addEventListener("mouseleave",u),t.addEventListener("dblclick",l=>{if(o.disposed)return;l.preventDefault(),l.stopPropagation();let f=o.drawingMode;if(f&&st(f.tool)&&f.pathStarted){r.finish_elliott_manual(),o.finishDrawing(),s.onDirty();return}if(f&&ot(f.tool)&&f.pathStarted){r.finish_path(),o.finishDrawing(),s.onDirty();return}if(f)return;let p=r.hit_zone(l.offsetX,l.offsetY);if(dt(p)||D(p)){r.reset_indicator_y_auto(x(p)),s.onDirty();return}let g=r.hit_test_drawing(l.offsetX,l.offsetY);g>0&&(r.select_drawing(g),s.onDirty(),s.onDrawingDblClick?.(g,l.offsetX,l.offsetY,l.clientX,l.clientY))}),t.addEventListener("contextmenu",l=>{if(o.disposed)return;let f=o.drawingMode;if(f&&st(f.tool)&&f.pathStarted){l.preventDefault(),l.stopPropagation(),r.finish_elliott_manual(),o.finishDrawing(),s.onDirty();return}if(f&&ot(f.tool)&&f.pathStarted){l.preventDefault(),l.stopPropagation(),r.finish_path(),o.finishDrawing(),s.onDirty();return}})}var Nt=25;function ce(t,r,s,o){t.addEventListener("touchstart",w=>{if(!o.disposed){if(w.preventDefault(),o.cancelMomentum(),w.touches.length===2){clearTimeout(o.longPressTimer),o.isCrosshairMode=!1;let e=t.getBoundingClientRect(),i=w.touches[1].clientX-w.touches[0].clientX,n=w.touches[1].clientY-w.touches[0].clientY;o.lastTouchDist=Math.sqrt(i*i+n*n),o.lastX=(w.touches[0].clientX+w.touches[1].clientX)/2-e.left,o.lastY=(w.touches[0].clientY+w.touches[1].clientY)/2-e.top,o.dragZone=r.hit_zone(o.lastX,o.lastY),o.pinchAnchorY=o.lastY}else if(w.touches.length===1){let e=t.getBoundingClientRect(),i=w.touches[0].clientX-e.left,n=w.touches[0].clientY-e.top;o.touchStartX=i,o.touchStartY=n,o.touchMoved=!1;let u=o.drawingMode;if(u){let a=r.hit_zone(i,n);if(q(a)){let _=J(a),{wx:d,wy:h}=F(r,i,n,_),c=u.tool;if(st(c)){if(!u.pathStarted)u.pane=_,r.start_elliott_manual(u.style.r,u.style.g,u.style.b,u.style.lineWidth,_),r.add_elliott_manual_point(d,h),u.pathStarted=!0,u.step=1;else if(r.add_elliott_manual_point(d,h)){o.finishDrawing(),s.onDirty();return}}else ot(c)?u.pathStarted?r.add_path_point(d,h):(u.pane=_,r.start_path(u.style.r,u.style.g,u.style.b,u.style.lineWidth,u.style.dashed,_),r.add_path_point(d,h),u.pathStarted=!0,u.step=1):Et(c)?(u.pane=_,r.start_brush(u.style.r,u.style.g,u.style.b,u.style.lineWidth,_),r.add_brush_point(d,h),o.isBrushing=!0):It(c)?u.step===0?(u.x1=d,u.y1=h,u.pane=_,u.step=1,u._stepAtTouchStart=0,U(r,c,u,d,h,u.style,_)):u.step===1?(u._stepAtTouchStart=1,U(r,c,u,d,h,u.style,u.pane)):(u._stepAtTouchStart=2,U(r,c,u,d,h,u.style,u.pane)):bt(c)?u.step===0?(u.x1=d,u.y1=h,u.pane=_,u.step=1,u._stepAtTouchStart=0,U(r,c,u,d,h,u.style,_)):(u._stepAtTouchStart=1,U(r,c,u,d,h,u.style,u.pane)):wt(c)?(u.pane=_,U(r,c,u,d,h,u.style,_)):(u.pane=_,nt(r,c,u,d,h,u.style),o.finishDrawing());r.set_crosshair(i,n),s.onDirty(),s.onCrosshairMove?.(i,n,a)}return}let l=r.hover_hit_test(i,n),f=l[0],p=l[1],g=l[2];if(q(f)&&!o.drawingMode&&p>0){if(g>=0){o.isDraggingAnchor=!0,o.dragAnchorIdx=g,o.dragAnchorPane=J(f);return}if(l[3]===p){o.isDraggingDrawing=!0,o.dragDrawingPane=J(f);let{wx:_,wy:d}=F(r,i,n,o.dragDrawingPane);o.dragDrawingLastWx=_,o.dragDrawingLastWy=d;return}}o.isDragging=!0,o.isCrosshairMode=!1,o.lastX=i,o.lastY=n,o.dragZone=f,clearTimeout(o.longPressTimer),o.longPressTimer=setTimeout(()=>{o.isDragging&&!o.touchMoved&&(o.isCrosshairMode=!0,r.set_crosshair(i,n),s.onDirty(),s.onCrosshairMove?.(i,n,o.dragZone),s.onVrvpHover?.(i,n))},300),q(o.dragZone)&&(o.liqPinSx=i,o.liqPinSy=n,o.liqPinTimer&&clearTimeout(o.liqPinTimer),o.liqPinTimer=setTimeout(()=>{o.liqPinTimer=null,o.touchMoved||s.onLiqAnnotationPin?.(o.liqPinSx,o.liqPinSy)},700))}}},{passive:!1}),t.addEventListener("touchmove",w=>{if(o.disposed)return;w.preventDefault();let e=t.getBoundingClientRect();if(o.isDraggingAnchor&&w.touches.length===1){let n=w.touches[0].clientX-e.left,u=w.touches[0].clientY-e.top,{wx:l,wy:f}=F(r,n,u,o.dragAnchorPane);r.update_drawing_anchor(o.dragAnchorIdx,l,f),r.set_crosshair(n,u),s.onDirty();return}if(o.isDraggingDrawing&&w.touches.length===1){let n=w.touches[0].clientX-e.left,u=w.touches[0].clientY-e.top;o.touchMoved=!0;let{wx:l,wy:f}=F(r,n,u,o.dragDrawingPane),p=l-o.dragDrawingLastWx,g=f-o.dragDrawingLastWy;r.move_drawing(p,g),o.dragDrawingLastWx=l,o.dragDrawingLastWy=f,r.set_crosshair(n,u),s.onDirty();return}let i=o.drawingMode;if(o.isBrushing&&i&&w.touches.length===1){let n=w.touches[0].clientX-e.left,u=w.touches[0].clientY-e.top,l=i.pane||0,{wx:f,wy:p}=F(r,n,u,l);r.add_brush_point(f,p),r.set_crosshair(n,u),s.onDirty(),o.touchMoved=!0;return}if(i&&st(i.tool)&&i.pathStarted&&w.touches.length===1){let n=w.touches[0].clientX-e.left,u=w.touches[0].clientY-e.top,l=i.pane||0,{wx:f,wy:p}=F(r,n,u,l);r.set_elliott_manual_cursor(f,p),r.set_crosshair(n,u),s.onDirty(),o.touchMoved=!0;return}if(i&&ot(i.tool)&&i.pathStarted&&w.touches.length===1){let n=w.touches[0].clientX-e.left,u=w.touches[0].clientY-e.top,l=i.pane||0,{wx:f,wy:p}=F(r,n,u,l);r.set_path_cursor(f,p),r.set_crosshair(n,u),s.onDirty(),o.touchMoved=!0;return}if(i&&i.step>0&&w.touches.length===1){let n=w.touches[0].clientX-e.left,u=w.touches[0].clientY-e.top;!o.touchMoved&&(Math.abs(n-o.touchStartX)>Nt||Math.abs(u-o.touchStartY)>Nt)&&(o.touchMoved=!0);let l=i.pane||0,{wx:f,wy:p}=F(r,n,u,l);U(r,i.tool,i,f,p,i.style,l),r.set_crosshair(n,u);let g=r.hit_zone(n,u);s.onDirty(),s.onCrosshairMove?.(n,u,g);return}if(i&&wt(i.tool)&&w.touches.length===1){let n=w.touches[0].clientX-e.left,u=w.touches[0].clientY-e.top,l=r.hit_zone(n,u),f=J(l),{wx:p,wy:g}=F(r,n,u,f);U(r,i.tool,i,p,g,i.style,f),r.set_crosshair(n,u),s.onDirty(),s.onCrosshairMove?.(n,u,l);return}if(w.touches.length===2){o.velSamples=[];let n=w.touches[1].clientX-w.touches[0].clientX,u=w.touches[1].clientY-w.touches[0].clientY,l=Math.sqrt(n*n+u*u),f=o.lastTouchDist/l,p=(w.touches[0].clientX+w.touches[1].clientX)/2-e.left,g=(w.touches[0].clientY+w.touches[1].clientY)/2-e.top,a=o.pinchAnchorY??g;o.dragZone===3?r.zoom_y(a,f):D(o.dragZone)&&o.dragZone!==14?r.zoom_indicator_y(x(o.dragZone),a,f):o.dragZone===14?(r.zoom_x(p,f),it(r,4,p-o.lastX,g-o.lastY)):o.dragZone===2?r.zoom_x(p,f):dt(o.dragZone)?(r.zoom_x(p,f),it(r,o.dragZone,p-o.lastX,g-o.lastY)):(r.zoom(p,g,f),it(r,o.dragZone,p-o.lastX,g-o.lastY)),o.lastTouchDist=l,o.lastX=p,o.lastY=g,s.onDirty()}else if(w.touches.length===1&&o.isDragging){let n=w.touches[0].clientX-e.left,u=w.touches[0].clientY-e.top,l=n-o.lastX,f=u-o.lastY;if(!o.touchMoved&&(Math.abs(n-o.touchStartX)>Nt||Math.abs(u-o.touchStartY)>Nt)&&(o.touchMoved=!0,o.isCrosshairMode||clearTimeout(o.longPressTimer),o.liqPinTimer&&(clearTimeout(o.liqPinTimer),o.liqPinTimer=null)),o.isCrosshairMode)r.set_crosshair(n,u),s.onDirty(),s.onCrosshairMove?.(n,u,o.dragZone),s.onVrvpHover?.(n,u);else if(o.touchMoved){if(o.lastX=n,o.lastY=u,o.dragZone===3||D(o.dragZone)||o.recordVelocity(l,f),o.dragZone===2)r.pan_x(l);else if(o.dragZone===3){let g=Math.pow(1.005,f);r.zoom_y(o.touchStartY,g)}else if(o.dragZone!==14)if(D(o.dragZone)){let g=Math.pow(1.005,f);r.zoom_indicator_y(x(o.dragZone),o.touchStartY,g)}else it(r,o.dragZone,l,f);s.onDirty()}else o.lastX=n,o.lastY=u}},{passive:!1}),t.addEventListener("touchend",w=>{if(o.disposed)return;if(clearTimeout(o.longPressTimer),o.liqPinTimer&&(clearTimeout(o.liqPinTimer),o.liqPinTimer=null),o.isDraggingAnchor){o.isDraggingAnchor=!1,o.dragAnchorIdx=-1,r.hide_crosshair(),s.onDirty(),s.onCrosshairHide?.();return}if(o.isDraggingDrawing){if(o.isDraggingDrawing=!1,r.hide_crosshair(),s.onDirty(),s.onCrosshairHide?.(),!o.touchMoved){let n=r.get_selected_drawing();if(n>0){let u=t.getBoundingClientRect();s.onDrawingDblClick?.(n,o.touchStartX,o.touchStartY,o.touchStartX+u.left,o.touchStartY+u.top)}}return}if(o.isBrushing){o.isBrushing=!1,r.finish_brush(),o.finishDrawing(),s.onDirty(),s.onCrosshairHide?.();return}let e=o.drawingMode;if(e&&st(e.tool)&&e.pathStarted){let n=Date.now(),u=o.touchStartX-(o._pathLastTapX||0),l=o.touchStartY-(o._pathLastTapY||0),f=Math.sqrt(u*u+l*l);n-(o._pathLastTapTime||0)<350&&f<30?(r.finish_elliott_manual(),o.finishDrawing(),o._pathLastTapTime=0):(o._pathLastTapTime=n,o._pathLastTapX=o.touchStartX,o._pathLastTapY=o.touchStartY),o.isDragging=!1,o.lastTouchDist=0,s.onDirty();return}if(e&&ot(e.tool)&&e.pathStarted){let n=Date.now(),u=o.touchStartX-(o._pathLastTapX||0),l=o.touchStartY-(o._pathLastTapY||0),f=Math.sqrt(u*u+l*l);n-(o._pathLastTapTime||0)<350&&f<30?(r.finish_path(),o.finishDrawing(),o._pathLastTapTime=0):(o._pathLastTapTime=n,o._pathLastTapX=o.touchStartX,o._pathLastTapY=o.touchStartY),o.isDragging=!1,o.lastTouchDist=0,s.onDirty();return}if(e&&It(e.tool)){let n=e._stepAtTouchStart;if(e.step===1&&(n===1||o.touchMoved)){let u=t.getBoundingClientRect(),l=w.changedTouches?.[0];if(l){let f=l.clientX-u.left,p=l.clientY-u.top,g=e.pane||0,{wx:a,wy:_}=F(r,f,p,g);e.x2=a,e.y2=_,e.step=2,r.clear_drawing_preview()}}else if(e.step===2&&(n===2||o.touchMoved)){let u=t.getBoundingClientRect(),l=w.changedTouches?.[0];if(l){let f=l.clientX-u.left,p=l.clientY-u.top,g=e.pane||0,{wx:a,wy:_}=F(r,f,p,g),d=K[e.tool];d&&d.previewFn==="fib_ext"?r.clear_fib_ext_preview():r.clear_channel_preview(),nt(r,e.tool,e,a,_,e.style),o.finishDrawing()}}o.isDragging=!1,o.lastTouchDist=0,o.drawingMode||(r.hide_crosshair(),s.onCrosshairHide?.()),s.onDirty();return}if(e&&e.step===1&&bt(e.tool)){if(e._stepAtTouchStart===1||o.touchMoved){let u=t.getBoundingClientRect(),l=w.changedTouches?.[0];if(l){let f=l.clientX-u.left,p=l.clientY-u.top,g=e.pane||0,{wx:a,wy:_}=F(r,f,p,g);nt(r,e.tool,e,a,_,e.style),o.finishDrawing()}}o.isDragging=!1,o.lastTouchDist=0,o.drawingMode||(r.hide_crosshair(),s.onCrosshairHide?.()),s.onDirty();return}if(e&&wt(e.tool)){let n=t.getBoundingClientRect(),u=w.changedTouches?.[0];if(u){let l=u.clientX-n.left,f=u.clientY-n.top,p=r.hit_zone(l,f),g=q(p)?J(p):e.pane||0,{wx:a,wy:_}=F(r,l,f,g),d=e.tool;r.clear_drawing_preview();let h=nt(r,d,e,a,_,e.style);o.finishDrawing(),d==="textnote"&&h>0&&(r.select_drawing(h),s.onDrawingSelected?.(h),s.onDrawingDblClick?.(h,l,f,l+n.left,f+n.top))}o.isDragging=!1,o.lastTouchDist=0,r.hide_crosshair(),s.onCrosshairHide?.(),s.onDirty();return}if(!o.touchMoved&&!o.drawingMode){let n=Date.now(),u=o.touchStartX,l=o.touchStartY,f=u-o.lastTapX,p=l-o.lastTapY,g=Math.sqrt(f*f+p*p),a=n-o.lastTapTime<350&&g<30,_=r.hit_zone(u,l);if(a&&(dt(_)||D(_)))r.reset_indicator_y_auto(x(_)),s.onDirty();else if(q(_)){let d=r.get_selected_drawing(),h=r.hit_test_drawing(u,l),c=0;if(h<=0&&(c=r.hit_test_marker(u,l)),h>0){r.deselect_marker(),s.onMarkerSelected?.(0),r.select_drawing(h);let M=t.getBoundingClientRect(),m=u+M.left,I=l+M.top;s.onDrawingSelected?.(h,m,I),(d<=0||d===h)&&s.onDrawingDblClick?.(h,u,l,m,I),s.onDirty()}else c>0?(r.deselect_drawing(),s.onDrawingSelected?.(0),r.select_marker(c),s.onMarkerSelected?.(c),s.onDirty()):(d>0&&(r.deselect_drawing(),s.onDrawingSelected?.(0),s.onDirty()),r.get_selected_marker()>0&&(r.deselect_marker(),s.onMarkerSelected?.(0),s.onDirty()))}o.lastTapTime=n,o.lastTapX=u,o.lastTapY=l}o.touchMoved&&!o.isCrosshairMode&&!o.drawingMode&&o.dragZone!==3&&!D(o.dragZone)&&o.startMomentum(o.dragZone),o.isDragging=!1,o.isCrosshairMode=!1,o.lastTouchDist=0,(!o.drawingMode||o.drawingMode.step===0)&&(r.hide_crosshair(),s.onCrosshairHide?.()),s.onDirty(),s.onVrvpHover?.(null,null)}),t.addEventListener("touchcancel",()=>{clearTimeout(o.longPressTimer),o.liqPinTimer&&(clearTimeout(o.liqPinTimer),o.liqPinTimer=null),o.isDragging=!1,o.isDraggingAnchor=!1,o.isDraggingDrawing=!1,o.isBrushing=!1,o.isCrosshairMode=!1,o.lastTouchDist=0,o.cancelMomentum(),r.hide_crosshair(),s.onCrosshairHide?.(),s.onDirty()})}function Xt(t,r,s){let o={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},w=.92,e=.5,i=80;o.recordVelocity=function(f,p){let g=performance.now();for(o.velSamples.push({dx:f,dy:p,t:g});o.velSamples.length>0&&g-o.velSamples[0].t>i;)o.velSamples.shift()};function n(){if(o.velSamples.length<2)return{vx:0,vy:0};let f=o.velSamples[0],g=o.velSamples[o.velSamples.length-1].t-f.t;if(g<5)return{vx:0,vy:0};let a=0,_=0;for(let h of o.velSamples)a+=h.dx,_+=h.dy;let d=16.67;return{vx:a/g*d,vy:_/g*d}}o.cancelMomentum=function(){o.momentumRaf&&(cancelAnimationFrame(o.momentumRaf),o.momentumRaf=null),o.velSamples=[]},o.startMomentum=function(f){let{vx:p,vy:g}=n();if(o.velSamples=[],Math.abs(p)<e&&Math.abs(g)<e)return;o.momentumVx=p,o.momentumVy=g,o.momentumZone=f;function a(){if(o.momentumVx*=w,o.momentumVy*=w,Math.abs(o.momentumVx)<e&&Math.abs(o.momentumVy)<e){o.momentumRaf=null;return}if(o.momentumZone===2)r.pan_x(o.momentumVx);else if(o.momentumZone===3)r.pan_y(o.momentumVy);else if(o.momentumZone===14){o.momentumRaf=null;return}else D(o.momentumZone)?r.pan_indicator_y(x(o.momentumZone),o.momentumVy):it(r,o.momentumZone,o.momentumVx,o.momentumVy);s.onDirty(),o.momentumRaf=requestAnimationFrame(a)}o.momentumRaf=requestAnimationFrame(a)};let u={setMode(f,p){f?(o.drawingMode={tool:f,style:p,step:0,x1:0,y1:0},t.style.cursor="crosshair"):(o.drawingMode?.pathStarted&&r.finish_path(),o.drawingMode=null,r.clear_drawing_preview(),t.style.cursor="crosshair"),s.onDirty()},getMode(){return o.drawingMode}};s.drawingApi?.(u),o.finishDrawing=function(){r.clear_drawing_preview(),s.onDrawingComplete?.(),o.drawingMode=null,t.style.cursor="crosshair"},_e(t,r,s,o),ce(t,r,s,o);let l=f=>{let p=document.activeElement?.tagName,g=p==="INPUT"||p==="TEXTAREA"||document.activeElement?.isContentEditable;if((f.key==="Delete"||f.key==="Backspace")&&!o.drawingMode&&!g){let _=r.get_selected_drawing();if(_>0){r.remove_drawing(_),s.onDrawingSelected?.(0),s.onDirty();return}let d=r.get_selected_marker();if(d>0){r.remove_marker(d),s.onMarkerSelected?.(0),s.onDirty();return}}if(f.key==="Escape"&&!o.drawingMode){if(r.get_selected_drawing()>0){r.deselect_drawing(),s.onDrawingSelected?.(0),s.onDirty();return}if(r.get_selected_marker()>0){r.deselect_marker(),s.onMarkerSelected?.(0),s.onDirty();return}}if(f.key==="Escape"&&o.drawingMode){if(o.drawingMode.pathStarted){o.drawingMode.tool==="elliott"?r.finish_elliott_manual():r.finish_path(),o.finishDrawing(),s.onDirty();return}r.clear_drawing_preview(),o.drawingMode=null,t.style.cursor="crosshair",s.onDrawingCancel?.(),s.onDirty();return}let a=20;switch(f.key){case"+":case"=":r.zoom(t.width/2,t.height/2,.9);break;case"-":r.zoom(t.width/2,t.height/2,1.1);break;case"ArrowLeft":r.pan_x(a);break;case"ArrowRight":r.pan_x(-a);break;case"ArrowUp":r.pan_y(-a);break;case"ArrowDown":r.pan_y(a);break;case"r":case"R":r.auto_scale_y();for(let _=1;_<=5;_++)r.reset_indicator_y_auto(_);break;default:return}s.onDirty()};return window.addEventListener("keydown",l),()=>{o.disposed=!0,o.cancelMomentum(),window.removeEventListener("keydown",l)}}function he(t,r,s,o){let w=e=>o()(e);return{enableRsi(){t.enable_rsi(),r()},disableRsi(){t.disable_rsi(),r()},setRsiPeriod(e){t.set_rsi_period(e),r()},isRsiEnabled(){return t.is_rsi_enabled()},setRsiShowEma(e){t.set_rsi_show_ema(e),r()},setRsiShowWma(e){t.set_rsi_show_wma(e),r()},setRsiShowSignals(e){t.set_rsi_show_signals(e),r()},setRsiShowDivergence(e){t.set_rsi_show_divergence(e),r()},setRsiShowTraps(e){t.set_rsi_show_traps(e),r()},setRsiShowLevels(e){t.set_rsi_show_levels(e),r()},setRsiSmoothing(e){t.set_rsi_smoothing(e),r()},setRsiRatio(e){t.set_rsi_ratio(e),r()},getRsiRatio(){return t.get_rsi_ratio()},enableForexSignals(){w("forexSignals")&&(t.enable_forex_signals(),r())},disableForexSignals(){t.disable_forex_signals(),r()},isForexSignalsEnabled(){return t.is_forex_signals_enabled()},setForexSignalsSetup(e){t.set_forex_signals_setup(e),r()},setForexSignalsMode(e){t.set_forex_signals_mode(e),r()},setForexSignalsShowStats(e){t.set_forex_signals_show_stats(e),r()},getForexSignalsCount(){return t.get_forex_signals_count()},enableOi(){s()||w("oi")&&(t.enable_oi(),r())},disableOi(){s()||(t.disable_oi(),r())},isOiEnabled(){if(s())return!1;try{return t.is_oi_enabled()}catch{return!1}},setOiData(e){s()||(t.set_oi_data(e),r())},setOiDataTs(e,i){s()||(t.set_oi_data_ts(e,i),r())},setOiShowOnChart(e){s()||(t.set_oi_show_on_chart(e),r())},setOiDisplayMode(e){s()||(t.set_oi_display_mode(e),r())},setOiRatio(e){s()||(t.set_oi_ratio(e),r())},getOiRatio(){if(s())return .2;try{return t.get_oi_ratio()}catch{return .2}},enableFundingRate(){s()||w("fundingRate")&&(t.enable_funding_rate(),r())},disableFundingRate(){s()||(t.disable_funding_rate(),r())},isFundingRateEnabled(){if(s())return!1;try{return t.is_funding_rate_enabled()}catch{return!1}},setFrBinanceData(e,i){s()||(t.set_fr_binance_data(e,i),r())},setFrAggData(e,i){s()||(t.set_fr_agg_data(e,i),r())},setFrShowAgg(e){s()||(t.set_fr_show_agg(e),r())},setFrShowSma(e){s()||(t.set_fr_show_sma(e),r())},enableCvd(){s()||w("cvd")&&(t.enable_cvd(),r())},disableCvd(){s()||(t.disable_cvd(),r())},isCvdEnabled(){if(s())return!1;try{return t.is_cvd_enabled()}catch{return!1}},setCvdData(e,i){s()||(t.set_cvd_data(e,i),r())},setCvdSpotData(e,i){s()||(t.set_cvd_spot_data(e,i),r())},setCvdSource(e){s()||(t.set_cvd_source(e),r())},getCvdSource(){if(s())return 0;try{return t.get_cvd_source()}catch{return 0}},setCvdMode(e){s()||(t.set_cvd_mode(e),r())},getCvdMode(){if(s())return 0;try{return t.get_cvd_mode()}catch{return 0}},setCvdShowDelta(e){s()||(t.set_cvd_show_delta(e),r())},getCvdShowDelta(){if(s())return!0;try{return t.get_cvd_show_delta()}catch{return!0}},setCvdShowSignals(e){s()||(t.set_cvd_show_signals(e),r())},getCvdShowSignals(){if(s())return!0;try{return t.get_cvd_show_signals()}catch{return!0}},setCvdShowDivergence(e){s()||(t.set_cvd_show_divergence(e),r())},getCvdShowDivergence(){if(s())return!1;try{return t.get_cvd_show_divergence()}catch{return!1}},enableLargeTrades(){s()||w("largeTrades")&&(t.enable_large_trades(),r())},disableLargeTrades(){s()||(t.disable_large_trades(),r())},isLargeTradesEnabled(){if(s())return!1;try{return t.is_large_trades_enabled()}catch{return!1}},setLargeTradesData(e){s()||(t.set_large_trades_data(e),r())},pushLargeTrade(e,i,n,u){s()||(t.push_large_trade(e,i,n,u),r())},clearLargeTrades(){s()||(t.clear_large_trades(),r())},setLtVolumeFilter(e,i){s()||(t.set_lt_volume_filter(e,i),r())},setLtBubbleScale(e){s()||(t.set_lt_bubble_scale(e),r())},getLtDataMinVol(){return s()?0:t.get_lt_data_min_vol()},getLtDataMaxVol(){return s()?0:t.get_lt_data_max_vol()},ltHitTest(e,i){if(s())return"";try{return t.lt_hit_test(e,i)}catch{return""}},enableVrvp(){s()||w("vrvp")&&(t.enable_vrvp(),r())},disableVrvp(){s()||(t.disable_vrvp(),r())},isVrvpEnabled(){if(s())return!1;try{return t.is_vrvp_enabled()}catch{return!1}},setVrvpPocLine(e){s()||(t.set_vrvp_poc_line(e),r())},vrvpHitTest(e,i){if(s())return"";try{return t.vrvp_hit_test(e,i)}catch{return""}},enableTpo(){s()||w("tpo")&&(t.enable_tpo(),r())},disableTpo(){s()||(t.disable_tpo(),r())},isTpoEnabled(){if(s())return!1;try{return t.is_tpo_enabled()}catch{return!1}},setTpoPocLine(e){s()||(t.set_tpo_poc_line(e),r())},setTpoVaLines(e){s()||(t.set_tpo_va_lines(e),r())},setTpoIb(e){s()||(t.set_tpo_ib(e),r())},setTpoSinglePrints(e){s()||(t.set_tpo_single_prints(e),r())},setTpoPeriod(e){s()||(t.set_tpo_period(e),r())},getTpoPeriod(){if(s())return 1440;try{return t.get_tpo_period()}catch{return 1440}},setTpoNakedPoc(e){s()||(t.set_tpo_naked_poc(e),r())},setTpoProfileShape(e){s()||(t.set_tpo_profile_shape(e),r())},setTpoIbMinutes(e){s()||(t.set_tpo_ib_minutes(e),r())},setTpoLetterMinutes(e){s()||(t.set_tpo_letter_minutes(e),r())},setTpoSignals(e){s()||(t.set_tpo_signals(e),r())},isTpoSignals(){if(s())return!1;try{return t.is_tpo_signals()}catch{return!1}},enableLiqHeatmap(){s()||w("liqHeatmap")&&(t.enable_liq_heatmap(),r())},disableLiqHeatmap(){s()||(t.disable_liq_heatmap(),r())},isLiqHeatmapEnabled(){if(s())return!1;try{return t.is_liq_heatmap_enabled()}catch{return!1}},setLiqHeatmapRange(e,i){s()||(t.set_liq_heatmap_range(e,i),r())},getLiqHeatmapMin(){if(s())return 0;try{return t.get_liq_heatmap_min()}catch{return 0}},getLiqHeatmapMax(){if(s())return 1;try{return t.get_liq_heatmap_max()}catch{return 1}},getLiqHeatmapSegMax(){if(s())return 0;try{return t.get_liq_heatmap_seg_max()}catch{return 0}},setLiqHeatmapProfile(e){s()||(t.set_liq_heatmap_profile(e),r())},isLiqHeatmapProfile(){if(s())return!0;try{return t.is_liq_heatmap_profile()}catch{return!0}},setLiqHeatmapCellHeight(e){s()||(t.set_liq_heatmap_cell_height(e),r())},getLiqHeatmapCellHeight(){if(s())return 1;try{return t.get_liq_heatmap_cell_height()}catch{return 1}},setLiqHeatmapPredictions(e){s()||(t.set_liq_heatmap_predictions(e),r())},setLiqHeatmapFilledPct(e){s()||(t.set_liq_heatmap_filled_pct(e),r())},getLiqHeatmapFilledPct(){if(s())return .85;try{return t.get_liq_heatmap_filled_pct()}catch{return .85}},liqHeatmapHitTest(e,i){if(s())return"";try{return t.liq_heatmap_hit_test(e,i)}catch{return""}},liqZoneHitTest(e,i){if(s())return"";try{return t.liq_zone_hit_test(e,i)}catch{return""}},enableSmartRanges(){s()||w("smartRanges")&&(t.enable_smart_ranges(),r())},disableSmartRanges(){s()||(t.disable_smart_ranges(),r())},isSmartRangesEnabled(){if(s())return!1;try{return t.is_smart_ranges_enabled()}catch{return!1}},setSrTextSize(e){s()||(t.set_sr_text_size(e),r())},setSrShowOb(e){s()||(t.set_sr_show_ob(e),r())},setSrObLast(e){s()||(t.set_sr_ob_last(e),r())},setSrShowObActivity(e){s()||(t.set_sr_show_ob_activity(e),r())},setSrShowBreakers(e){s()||(t.set_sr_show_breakers(e),r())},setSrMitigation(e){s()||(t.set_sr_mitigation(e),r())},setSrShowMetrics(e){s()||(t.set_sr_show_metrics(e),r())},setSrShowHtfOb(e){s()||(t.set_sr_show_htf_ob(e),r())},setSrHtfMinutes(e){s()||(t.set_sr_htf_minutes(e),r())},setSrShowFvg(e){s()||(t.set_sr_show_fvg(e),r())},setSrFvgTheme(e){s()||(t.set_sr_fvg_theme(e),r())},setSrFvgMitigation(e){s()||(t.set_sr_fvg_mitigation(e),r())},setSrFvgHtf(e){s()||(t.set_sr_fvg_htf(e),r())},setSrFvgExtend(e){s()||(t.set_sr_fvg_extend(e),r())},setSrShowObSignals(e){s()||(t.set_sr_show_ob_signals(e),r())},setSrShowPredict(e){s()||(t.set_sr_show_predict(e),r())},setSrShowFvgSignals(e){s()||(t.set_sr_show_fvg_signals(e),r())},setSrShowSmartRev(e){s()||(t.set_sr_show_smart_rev(e),r())},setSrSmartRevHtf(e){s()||(t.set_sr_smart_rev_htf(e),r())},setSrStatsType(e){s()||(t.set_sr_stats_type(e),r())},setSrStatsPosition(e){s()||(t.set_sr_stats_position(e),r())},getSrSignalsCount(){if(s())return 0;try{return t.get_sr_signals_count()}catch{return 0}},enableEmaStructure(){s()||w("emaStructure")&&(t.enable_ema_structure(),r())},disableEmaStructure(){s()||(t.disable_ema_structure(),r())},isEmaStructureEnabled(){if(s())return!1;try{return t.is_ema_structure_enabled()}catch{return!1}},setEsEma1Len(e){s()||(t.set_es_ema1_len(e),r())},setEsEma2Len(e){s()||(t.set_es_ema2_len(e),r())},setEsWmaLen(e){s()||(t.set_es_wma_len(e),r())},setEsShowEma1(e){s()||(t.set_es_show_ema1(e),r())},setEsShowEma2(e){s()||(t.set_es_show_ema2(e),r())},setEsShowWma(e){s()||(t.set_es_show_wma(e),r())},setEsSwingLen(e){s()||(t.set_es_swing_len(e),r())},setEsShowBos(e){s()||(t.set_es_show_bos(e),r())},enableLiveSignals(){s()||(t.enable_live_signals(),r())},disableLiveSignals(){s()||(t.disable_live_signals(),r())},isLiveSignalsEnabled(){if(s())return!1;try{return t.is_live_signals_enabled()}catch{return!1}},setLiveSignalsData(e){s()||(t.set_live_signals_data(new Float64Array(e)),r())},clearLiveSignals(){s()||(t.clear_live_signals(),r())},setLiveSignalsLeverage(e){s()||(t.set_live_signals_leverage(e),r())},getLiveSignalsLeverage(){if(s())return 10;try{return t.get_live_signals_leverage()}catch{return 10}},setLiveSignalsTrial(e){s()||(t.set_live_signals_trial(e),r())},setLiveSignalsShowEntry(e){s()||(t.set_live_signals_show_entry(e),r())},setLiveSignalsShowTpSl(e){s()||(t.set_live_signals_show_tp_sl(e),r())},setLiveSignalsShowMaxProfit(e){s()||(t.set_live_signals_show_max_profit(e),r())},setLiveSignalsShowLabels(e){s()||(t.set_live_signals_show_labels(e),r())},setLiveSignalsShowZones(e){s()||(t.set_live_signals_show_zones(e),r())},setLiveSignalsTextSize(e){s()||(t.set_live_signals_text_size(e),r())},setLiveSignalsPipValue(e){s()||(t.set_live_signals_pip_value(e),r())},setLiveSignalsLoading(e){s()||(t.set_live_signals_loading(e),r())},getLiveSignalsCount(){if(s())return 0;try{return t.get_live_signals_count()}catch{return 0}},enableVpin(){s()||w("vpin")&&(t.enable_vpin(),r())},disableVpin(){s()||(t.disable_vpin(),r())},isVpinEnabled(){if(s())return!1;try{return t.is_vpin_enabled()}catch{return!1}},setVpinData(e,i){s()||(t.set_vpin_data(e,i),r())},setVpinBucketSize(e){s()||(t.set_vpin_bucket_size(e),r())},getVpinBucketSize(){if(s())return 50;try{return t.get_vpin_bucket_size()}catch{return 50}},setVpinNumBuckets(e){s()||(t.set_vpin_num_buckets(e),r())},getVpinNumBuckets(){if(s())return 50;try{return t.get_vpin_num_buckets()}catch{return 50}},setVpinThreshold(e){s()||(t.set_vpin_threshold(e),r())},getVpinThreshold(){if(s())return .7;try{return t.get_vpin_threshold()}catch{return .7}},setVpinShowSma(e){s()||(t.set_vpin_show_sma(e),r())},setVpinShowZones(e){s()||(t.set_vpin_show_zones(e),r())},enableStopIceberg(){s()||w("stopIceberg")&&(t.enable_stop_iceberg(),r())},disableStopIceberg(){s()||(t.disable_stop_iceberg(),r())},isStopIcebergEnabled(){if(s())return!1;try{return t.is_stop_iceberg_enabled()}catch{return!1}},setSiShowStops(e){s()||(t.set_si_show_stops(e),r())},setSiShowIcebergs(e){s()||(t.set_si_show_icebergs(e),r())},setSiShowZones(e){s()||(t.set_si_show_zones(e),r())},setIcebergEvents(e,i,n,u,l,f){s()||(t.set_iceberg_events(e,i,n,u,l,f),r())},getStopRunCount(){if(s())return 0;try{return t.get_stop_run_count()}catch{return 0}},getIcebergCount(){if(s())return 0;try{return t.get_iceberg_count()}catch{return 0}},enableVolume(){t.enable_volume(),r()},disableVolume(){t.disable_volume(),r()},isVolumeEnabled(){return t.is_volume_enabled()},setVolumeMaPeriod(e){t.set_volume_ma_period(e),r()},setVolumeShowMa(e){t.set_volume_show_ma(e),r()},setVolumeShowSignals(e){t.set_volume_show_signals(e),r()},setVolumeColorMode(e){t.set_volume_color_mode(e),r()},getVolumeMaPeriod(){return t.get_volume_ma_period()},getVolumeShowMa(){return t.get_volume_show_ma()},getVolumeShowSignals(){return t.get_volume_show_signals()},getVolumeColorMode(){return t.get_volume_color_mode()},enableObSignals(){t.enable_ob_signals(),r()},disableObSignals(){t.disable_ob_signals(),r()},isObSignalsEnabled(){return t.is_ob_signals_enabled()},setObsShowWalls(e){t.set_obs_show_walls(e),r()},setObsShowGaps(e){t.set_obs_show_gaps(e),r()},setObsShowAlerts(e){t.set_obs_show_alerts(e),r()},setObsShowCom(e){t.set_obs_show_com(e),r()},setObsWalls(e,i){t.set_obs_walls(new Float64Array(e),new Float64Array(i)),r()},setObsGaps(e,i){t.set_obs_gaps(new Float64Array(e),new Float64Array(i)),r()},pushObsAlert(e,i,n,u,l){t.push_obs_alert(e,i,n,u,l),r()},setObsCom(e){t.set_obs_com(e),r()},clearObSignals(){t.clear_ob_signals(),r()},enableObFlow(){t.enable_ob_flow(),r()},disableObFlow(){t.disable_ob_flow(),r()},isObFlowEnabled(){return t.is_ob_flow_enabled()},setObfShowObi(e){t.set_obf_show_obi(e),r()},setObfShowNetFlow(e){t.set_obf_show_net_flow(e),r()},setObfShowCumDelta(e){t.set_obf_show_cum_delta(e),r()},pushObfSample(e,i,n,u){t.push_obf_sample(e,i,n,u),r()},setObfData(e){t.set_obf_data(new Float64Array(e)),r()},clearObFlow(){t.clear_ob_flow(),r()},setObfRatio(e){t.set_obf_ratio(e),r()},getObfRatio(){return t.get_obf_ratio()},enableObMicro(){t.enable_ob_micro(),r()},disableObMicro(){t.disable_ob_micro(),r()},isObMicroEnabled(){return t.is_ob_micro_enabled()},setObmData(e,i,n,u,l,f,p,g,a,_,d,h,c){t.set_obm_data(e,i,n,u,l,f,p,g,a,_,d,h,c),r()},setObmAnchorTopRight(e){t.set_obm_anchor_top_right(e),r()},clearObMicro(){t.clear_ob_micro(),r()}}}function pe(t,r,s,o){let w=i=>o()(i),e=(i,n,u)=>i<=1&&n<=1&&u<=1&&(i>0||n>0||u>0)?[Math.round(i*255),Math.round(n*255),Math.round(u*255)]:[i&255,n&255,u&255];return{addMarker(i,n,u){t.add_marker(i,n,u),r()},clearMarkers(){t.clear_markers(),r()},hitTestMarker(i,n){return t.hit_test_marker(i,n)},selectMarker(i){t.select_marker(i),r()},deselectMarker(){t.deselect_marker(),r()},getSelectedMarker(){return t.get_selected_marker()},removeMarker(i){t.remove_marker(i),r()},deleteSelectedMarker(){let i=t.get_selected_marker();return i>0&&(t.remove_marker(i),r()),i},addTrendline(i,n,u,l,f,p,g,a,_,d=0){let[h,c,M]=e(f,p,g),m=t.add_trendline(i,n,u,l,h,c,M,a,_,d);return r(),m},addHorizontalLine(i,n,u,l,f,p,g,a=0){let[_,d,h]=e(u,l,f),c=t.add_horizontal_line(i,n,_,d,h,p,g,a);return r(),c},addArrow(i,n,u,l,f,p,g,a,_,d=0){let[h,c,M]=e(f,p,g),m=t.add_arrow(i,n,u,l,h,c,M,a,_,d);return r(),m},addFibRetracement(i,n,u,l,f,p,g,a,_,d=0){if(!w("drawingFull"))return 0;let[h,c,M]=e(f,p,g),m=t.add_fib_retracement(i,n,u,l,h,c,M,a,_,d);return r(),m},addFibExtension(i,n,u,l,f,p,g,a,_,d,h,c=0){if(!w("drawingFull"))return 0;let[M,m,I]=e(g,a,_),L=t.add_fib_extension(i,n,u,l,f,p,M,m,I,d,h,c);return r(),L},addLongPosition(i,n,u,l,f,p,g,a,_,d=0){if(!w("drawingFull"))return 0;let[h,c,M]=e(f,p,g),m=t.add_long_position(i,n,u,l,h,c,M,a,_,d);return r(),m},addShortPosition(i,n,u,l,f,p,g,a,_,d=0){if(!w("drawingFull"))return 0;let[h,c,M]=e(f,p,g),m=t.add_short_position(i,n,u,l,h,c,M,a,_,d);return r(),m},addAnchoredVwap(i,n,u,l,f,p,g=0){if(!w("drawingFull"))return 0;let[a,_,d]=e(n,u,l),h=t.add_anchored_vwap(i,a,_,d,f,p,g);return r(),h},addPriceLabel(i,n,u,l,f,p,g=0){let[a,_,d]=e(u,l,f),h=t.add_price_label(i,n,a,_,d,p,g);return r(),h},addTextNote(i,n,u,l,f,p,g=0){let[a,_,d]=e(u,l,f),h=t.add_text_note(i,n,a,_,d,p,g);return r(),h},addElliottImpulse(i,n,u,l,f,p,g=0){if(!w("drawingFull"))return 0;let[a,_,d]=e(u,l,f),h=t.add_elliott_impulse(i,n,a,_,d,p,g);return r(),h},setDrawingFontSize(i,n){t.set_drawing_font_size(i,n),r()},getDrawingFontSize(i){return t.get_drawing_font_size(i)},setDrawingText(i,n){t.set_drawing_text(i,n),r()},getDrawingText(i){return t.get_drawing_text(i)},setDrawingStyle(i,n,u,l,f){let[p,g,a]=e(n,u,l);t.set_drawing_style(i,p,g,a,f),r()},getDrawingColor(i){let n=t.get_drawing_color(i);return n?{r:n>>>24&255,g:n>>>16&255,b:n>>>8&255,lineWidth:(n&255)/10}:null},getDrawingDashed(i){try{return t.get_drawing_dashed(i)}catch{return!1}},setDrawingDashed(i,n){t.set_drawing_dashed(i,n),r()},getDrawingHideLabel(i){try{return t.get_drawing_hide_label(i)}catch{return!1}},setDrawingHideLabel(i,n){t.set_drawing_hide_label(i,n),r()},getDrawingKindId(i){try{return t.get_drawing_kind_id(i)}catch{return 255}},removeDrawing(i){t.remove_drawing(i),r()},clearDrawings(){t.clear_drawings(),r()},drawingCount(){return t.drawing_count()},setDrawingPreview(i,n,u,l,f,p,g,a,_,d,h=0){let[c,M,m]=e(p,g,a);t.set_drawing_preview(i,n,u,l,f,c,M,m,_,d,h),r()},clearDrawingPreview(){t.clear_drawing_preview(),r()},cancelBrush(){t.cancel_brush(),r()},selectDrawing(i){t.select_drawing(i),r()},deselectDrawing(){t.deselect_drawing(),r()},getSelectedDrawing(){return t.get_selected_drawing()},deleteSelectedDrawing(){let i=t.get_selected_drawing();return i>0&&(t.remove_drawing(i),r()),i},exportDrawingsJson(){try{return t.export_drawings_json()}catch{return"[]"}},importDrawingsJson(i){try{t.import_drawings_json(i),r()}catch(n){console.warn("[bridge] importDrawingsJson failed",n)}},screenToWorld(i,n){return{x:t.screen_to_world_x(i),y:t.screen_to_world_y(n)}},worldToScreen(i,n){try{return{x:t.world_to_screen_x(i),y:t.world_to_screen_y(n)}}catch{return null}}}}var j=t=>t instanceof Float64Array?t:new Float64Array(t);function we(t,r,s,o){let w=e=>o()(e);return{setKlines(e,i,n,u,l,f){t.set_klines(j(e),j(i),j(n),j(u),j(l),j(f)),r()},setRealTimestamps(e){t.set_real_timestamps(j(e)),r()},appendRealTimestamp(e){t.append_real_timestamp(e)},prependKlines(e,i,n,u,l,f){t.prepend_klines(j(e),j(i),j(n),j(u),j(l),j(f)),r()},appendKline(e,i,n,u,l,f){t.append_kline(e,i,n,u,l,f),r()},updateLastKline(e,i,n,u,l,f){t.update_last_kline(e,i,n,u,l,f),r()},popLastKline(){let e=t.pop_last_kline();return e&&r(),e},getLastClose(){try{return t.get_last_close()}catch{return 0}},getKlineCount(){if(s())return 0;try{return t.kline_count()}catch{return 0}},getKlineTimestamps(){if(s())return null;try{return t.kline_timestamps()}catch{return null}},getKlineOpens(){if(s())return null;try{return t.kline_opens()}catch{return null}},getKlineHighs(){if(s())return null;try{return t.kline_highs()}catch{return null}},getKlineLows(){if(s())return null;try{return t.kline_lows()}catch{return null}},getKlineCloses(){if(s())return null;try{return t.kline_closes()}catch{return null}},getKlineVolumes(){if(s())return null;try{return t.kline_volumes()}catch{return null}},setHeatmap(e,i,n,u,l,f,p){w("heatmap")&&(t.set_heatmap(j(e),i,n,u,l,f,p),r())},appendHeatmapColumn(e,i,n,u){w("heatmap")&&(t.append_heatmap_column(j(e),i,n,u),r())},updateLastHeatmapColumn(e,i,n){t.update_last_heatmap_column(j(e),i,n),r()},getHeatmapLastTimestamp(){try{return t.get_heatmap_last_timestamp()}catch{return 0}},getHeatmapXStep(){try{return t.get_heatmap_x_step()}catch{return 0}},updateHeatmapColumnAt(e,i,n,u){t.update_heatmap_column_at(j(e),i,n,u),r()},setHeatmapRange(e,i){t.set_heatmap_range(e,i),r()},getHeatmapDataRange(){try{return{min:t.get_heatmap_data_min(),max:t.get_heatmap_data_max()}}catch{return{min:0,max:0}}},setHeatmapPrefetchRange(e){try{t.set_heatmap_prefetch_range(e)}catch{}},clearHeatmapPrefetchRange(){try{t.clear_heatmap_prefetch_range()}catch{}},getHeatmapPrefetchMax(){try{return t.get_heatmap_prefetch_max()}catch{return 0}},setHeatmapColorScheme(e){try{t.set_heatmap_color_scheme(e),r()}catch{}},setChartType(e){s()||e===2&&!w("footprint")||(t.set_chart_type(e),r())},getChartType(){if(s())return 0;try{return t.get_chart_type()}catch{return 0}},setFootprintTickSize(e){s()||w("footprint")&&(t.set_footprint_tick_size(e),r())},footprintEnsureLen(e){s()||t.footprint_ensure_len(e)},footprintAddTrade(e,i,n,u){s()||t.footprint_add_trade(e,i,n,u)},footprintAddTradeBatch(e){s()||!e||e.length===0||t.footprint_add_trade_batch(j(e))},footprintSetBar(e,i,n,u,l){s()||(t.footprint_set_bar(e,i,n,u,l),r())},footprintClear(){s()||(t.footprint_clear(),r())},footprintClearBar(e){s()||t.footprint_clear_bar(e)},footprintPrependEmpty(e){s()||t.footprint_prepend_empty(e)},footprintSetShowSignals(e){s()||(t.footprint_set_show_signals(e),r())},footprintGetShowSignals(){if(s())return!0;try{return t.footprint_get_show_signals()}catch{return!0}},footprintSignalCount(){if(s())return 0;try{return t.footprint_signal_count()}catch{return 0}},footprintSetShowProfile(e){s()||(t.footprint_set_show_profile(e),r())},footprintGetShowProfile(){if(s())return!1;try{return t.footprint_get_show_profile()}catch{return!1}},footprintProfileHitTest(e,i){if(s())return"";try{return t.footprint_profile_hit_test(e,i)}catch{return""}},footprintSetDisplayMode(e){s()||(t.footprint_set_display_mode(e),r())},footprintGetDisplayMode(){if(s())return 0;try{return t.footprint_get_display_mode()}catch{return 0}},enableDeltaHistogram(){s()||t.enable_delta_histogram()},disableDeltaHistogram(){s()||t.disable_delta_histogram()},deltaHistogramEnabled(){if(s())return!1;try{return t.delta_histogram_enabled()}catch{return!1}}}}var Ue=1;function B(t){if(typeof t!="string")return{r:255,g:255,b:255,a:153};if(t.startsWith("#")){let s=t.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 o=parseInt(s.slice(0,2),16),w=parseInt(s.slice(2,4),16),e=parseInt(s.slice(4,6),16);return{r:o,g:w,b:e,a:255}}let r=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\)/);return r?{r:+r[1],g:+r[2],b:+r[3],a:r[4]!==void 0?Math.round(+r[4]*255):255}:{r:255,g:255,b:255,a:153}}function Wt(t,r,s){let o=new Map,w=null,e=0,i=NaN;function n(){let a;try{a=t.kline_count()}catch{return w}if(a===0)return null;let _=t.kline_closes(),d=_?.[a-1]??NaN;if(w&&!(a!==e||d!==i))return w;try{let c=t.kline_timestamps(),M=t.kline_opens(),m=t.kline_highs(),I=t.kline_lows(),L=t.kline_volumes();if(!c||!_)return w;w={timestamps:Array.from(c),open:Array.from(M),high:Array.from(m),low:Array.from(I),close:Array.from(_),volume:Array.from(L),length:a},e=a,i=d;for(let P of o.values())P._needsCompute=!0}catch{}return w}function u(){return{seriesLine(a,_="#ffffff99",d=1.5){let h=B(_);t.custom_series_line(new Float64Array(a),h.r,h.g,h.b,h.a,d)},seriesDashedLine(a,_="#ffffff66",d=1,h=4,c=4){let M=B(_);t.custom_series_dashed_line(new Float64Array(a),M.r,M.g,M.b,M.a,d,h,c)},band(a,_,d="rgba(100,149,237,0.08)"){let h=B(d);t.custom_band(new Float64Array(a),new Float64Array(_),h.r,h.g,h.b,h.a)},hline(a,_="#ffffff66",d=1){let h=B(_);t.custom_hline(a,h.r,h.g,h.b,h.a,d)},dashedHline(a,_="#ffffff66",d=1,h=6,c=4){let M=B(_);t.custom_dashed_hline(a,M.r,M.g,M.b,M.a,d,h,c)},marker(a,_,d="#e8a04a",h=3){let c=B(d);t.custom_marker(a,_,c.r,c.g,c.b,c.a,h)},markerUp(a,_,d="#26a69a",h=5){let c=B(d);t.custom_marker_up(a,_,c.r,c.g,c.b,c.a,h)},markerDown(a,_,d="#ef5350",h=5){let c=B(d);t.custom_marker_down(a,_,c.r,c.g,c.b,c.a,h)},text(a,_,d,h="#ffffffaa",c=10,M="center"){let m=B(h),I=M==="center"?1:M==="right"?2:0;t.custom_text(a,_,d,m.r,m.g,m.b,m.a,c,I)},priceLabel(a,_,d="#ffffffaa",h=10){let c=B(d);t.custom_price_label(a,_,c.r,c.g,c.b,c.a,h)},linePx(a,_,d,h,c,M=1){let m=B(c);t.custom_line_px(a,_,d,h,m.r,m.g,m.b,m.a,M)},fillRectPx(a,_,d,h,c){let M=B(c);t.custom_fill_rect_px(a,_,d,h,M.r,M.g,M.b,M.a)},strokeRectPx(a,_,d,h,c,M=1){let m=B(c);t.custom_stroke_rect_px(a,_,d,h,m.r,m.g,m.b,m.a,M)},textPx(a,_,d,h,c=10,M="left"){let m=B(h),I=M==="center"?1:M==="right"?2:0;t.custom_text_px(a,_,d,m.r,m.g,m.b,m.a,c,I)},worldToScreenX:a=>t.world_to_screen_x(a),worldToScreenY:a=>t.world_to_screen_y(a),screenToWorldX:a=>t.screen_to_world_x(a),screenToWorldY:a=>t.screen_to_world_y(a),chartArea:()=>({x:t.chart_area_x(),y:t.chart_area_y(),w:t.chart_area_w(),h:t.chart_area_h()})}}function l(a){if(!a.compute)return;let _=n();if(_)try{a._computed=a.compute(_,a.params)||{}}catch(d){console.warn(`[CustomIndicator "${a.name}"] compute error:`,d),a._computed={}}}let f=Object.freeze({length:0,timestamps:[],open:[],high:[],low:[],close:[],volume:[]});function p(a){if(o.size===0)return;let _=n(),d=!1;for(let m of o.values())if(m.enabled&&!(m.compute&&!_)){d=!0;break}if(!d)return;t.custom_begin();let h=u(),c=_||f;for(let m of o.values())if(m.enabled&&!(m.compute&&!_)){m._needsCompute&&(l(m),m._needsCompute=!1);try{m.render.call(m,h,m._computed||{},c)}catch(I){console.warn(`[CustomIndicator "${m.name}"] render error:`,I)}}if(t.custom_end(),t.custom_command_count()>0){let m=t.get_custom_buffer_ptr(),I=t.get_custom_buffer_len();s(a,r,m,I)}}function g(){w=null,e=0,i=NaN;for(let a of o.values())a._needsCompute=!0}return{add(a){let _=Ue++,d={id:_,name:a.name||`Custom ${_}`,params:{...a.params},compute:a.compute||null,render:a.render,enabled:!0,_computed:{},_needsCompute:!0};return o.set(_,d),_},remove(a){o.delete(a)},updateParams(a,_){let d=o.get(a);d&&(Object.assign(d.params,_),d._needsCompute=!0)},setEnabled(a,_){let d=o.get(a);d&&(d.enabled=_)},list(){return[...o.values()].map(a=>({id:a.id,name:a.name,params:{...a.params},enabled:a.enabled}))},invalidateCompute:g,renderAll:p}}var ge={trial:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!0,tpo:!0,smartRanges:!0,emaStructure:!0,customIndicators:!0,forexSignals:!0,vpin:!0,stopIceberg:!0},standard:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!1,heatmap:!1,footprint:!1,liqHeatmap:!1,oi:!1,fundingRate:!1,cvd:!1,largeTrades:!1,vrvp:!1,tpo:!1,smartRanges:!1,emaStructure:!1,customIndicators:!1,forexSignals:!1,vpin:!1,stopIceberg:!1},professional:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!1,tpo:!1,smartRanges:!1,emaStructure:!1,customIndicators:!1,forexSignals:!1,vpin:!1,stopIceberg:!1},enterprise:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!0,tpo:!0,smartRanges:!0,emaStructure:!0,customIndicators:!0,forexSignals:!0,vpin:!0,stopIceberg:!0}},xe={rsi:"RSI",drawingBasic:"Basic Drawing Tools",heatmap:"Orderbook Heatmap",footprint:"Footprint Chart",liqHeatmap:"Liquidation Heatmap",oi:"Open Interest",fundingRate:"Funding Rate",cvd:"CVD",largeTrades:"Large Trades",vrvp:"VRVP",tpo:"TPO / Market Profile",smartRanges:"Smart Ranges",emaStructure:"EMA Structure",drawingFull:"All Drawing Tools",customIndicators:"Custom Indicators",forexSignals:"Forex Signals",vpin:"VPIN",stopIceberg:"Stops & Icebergs"},Qe={rsi:"Standard",drawingBasic:"Standard",heatmap:"Professional",footprint:"Professional",liqHeatmap:"Professional",oi:"Professional",fundingRate:"Professional",cvd:"Professional",largeTrades:"Professional",drawingFull:"Professional",vrvp:"Enterprise",tpo:"Enterprise",smartRanges:"Enterprise",emaStructure:"Enterprise",customIndicators:"Enterprise",forexSignals:"Enterprise",vpin:"Enterprise",stopIceberg:"Enterprise"};function gt(t){return ge[t]||ge.trial}function Ht(t){let r=gt(t),s=new Set;return function(w){if(r[w])return!0;if(!s.has(w)){s.add(w);let e=xe[w]||w,i=Qe[w]||"a higher";console.warn(`[MRD Chart Engine] "${e}" requires ${i} plan. Current plan: ${t}. Upgrade at https://mrd-chart.dev/pricing`)}return!1}}var $e=14,me="trial",Ct="free";var Bt=[95,95,109,114].map(t=>String.fromCharCode(t)).join(""),Je=1297237059;function Ie(t){let r=`${t}:${Je}:${(t^2043453)>>>0}`,s=2166136261;for(let o=0;o<r.length;o++)s^=r.charCodeAt(o),s=Math.imul(s,16777619);return(s>>>0).toString(36)}function Lt(t){return`${t}.${Ie(t)}`}function At(t){if(!t||typeof t!="string")return null;let r=t.lastIndexOf(".");if(r<1)return null;let s=parseInt(t.slice(0,r),10);return!s||s<1e9||s>2e9||t.slice(r+1)!==Ie(s)?null:s}var Ce=Bt+"e7x",Le=Bt+"p3q",Ae="mrd_engine_session_id",ve="mrd_ce_db",mt="meta",ye="trial_ts",Te=Bt+"ck";function Gt(){try{return At(localStorage.getItem(Ce))}catch{return null}}function qt(t){try{localStorage.setItem(Ce,Lt(t))}catch{}}function Kt(){try{return At(localStorage.getItem(Le))}catch{return null}}function Ut(t){try{localStorage.setItem(Le,Lt(t))}catch{}}function xt(){try{return At(sessionStorage.getItem(Ae))}catch{return null}}function Qt(t){try{sessionStorage.setItem(Ae,Lt(t))}catch{}}function $t(){try{let t=document.cookie.match(new RegExp(`(?:^|;\\s*)${Te}=([^;]+)`));return t?At(decodeURIComponent(t[1])):null}catch{return null}}function Jt(t){try{let r=encodeURIComponent(Lt(t));document.cookie=`${Te}=${r};path=/;max-age=${86400*400};SameSite=Lax`}catch{}}var Mt=null,Me=!1;function ke(){if(!(Me||typeof indexedDB>"u")){Me=!0;try{let t=indexedDB.open(ve,1);t.onupgradeneeded=()=>{let r=t.result;r.objectStoreNames.contains(mt)||r.createObjectStore(mt)},t.onsuccess=()=>{let o=t.result.transaction(mt,"readonly").objectStore(mt).get(ye);o.onsuccess=()=>{let w=At(o.result);w&&(!Mt||w<Mt)&&(Mt=w,tr(w))}}}catch{}}}function Ee(t){Mt=t;try{let r=indexedDB.open(ve,1);r.onsuccess=()=>{r.result.transaction(mt,"readwrite").objectStore(mt).put(Lt(t),ye)}}catch{}}function tr(t){let r=Math.floor(Date.now()/1e3),s=Ne([Gt(),Kt(),xt(),$t(),t],r);s&&s!==t||s&&(qt(s),Ut(s),Qt(s),Jt(s))}function Ne(t,r){let s=null;for(let o of t)o&&(o>r+60||o<17e8||(!s||o<s)&&(s=o));return s}function er(){let t=Math.floor(Date.now()/1e3),r=[Gt(),Kt(),xt(),$t(),Mt];return Ne(r,t)}function rr(t){qt(t),Ut(t),Qt(t),Jt(t),Ee(t)}function or(t){Gt()||qt(t),Kt()||Ut(t),xt()||Qt(t),$t()||Jt(t),Mt||Ee(t)}ke();function Rt(t){if(!t||t==="trial")return sr();try{let r=JSON.parse(atob(t)),{p:s,d:o,e:w,s:e}=r;if(!s||!e)return{valid:!1,error:"Invalid license key format"};let i={...r};if(delete i.s,e!==Re(i))return{valid:!1,error:"Invalid license key signature"};if(w>0&&Date.now()/1e3>w)return{valid:!0,plan:Ct,watermark:!0,trialExpired:!0,originalPlan:s,error:`License expired on ${new Date(w*1e3).toLocaleDateString()}`,features:gt(Ct)};let n=r.pl||"web";if((n==="web"||n==="any")&&o&&o!=="*"&&typeof window<"u"){let u=window.location.hostname;if(u&&u!=="localhost"&&u!=="127.0.0.1"&&u!=="0.0.0.0"&&u!==""&&!o.split(",").map(p=>p.trim()).some(p=>nr(p,u)))return{valid:!1,error:`License not valid for domain: ${u}`}}if(n==="mobile"&&r.a&&typeof window<"u"){let u=window.__mrd_app_id;if(u&&u!==r.a)return{valid:!1,error:`License not valid for app: ${u}`}}return{valid:!0,plan:s,domain:o,platform:n,appId:r.a||null,expiry:w,watermark:!1,features:gt(s)}}catch{return{valid:!1,error:"Invalid license key"}}}function Re(t){let r="mrd-ce-hmac-2024-x9k2m",s=JSON.stringify(t),o=r+":"+s,w=2166136261,e=1818371886,i=3735928559;for(let n=0;n<o.length;n++){let u=o.charCodeAt(n);w=Math.imul(w^u,16777619)>>>0,e=Math.imul(e^u,1540483477)>>>0,i=Math.imul(i^u,461845907)>>>0}return(w.toString(36)+e.toString(36)+i.toString(36)).slice(0,24)}function sr(){let t=er();t?or(t):(t=Math.floor(Date.now()/1e3),rr(t));let r=t+$e*86400,s=Date.now()/1e3,o=Math.max(0,Math.ceil((r-s)/86400));return s>r?{valid:!0,plan:Ct,watermark:!0,trialExpired:!0,daysLeft:0,features:gt(Ct)}:{valid:!0,plan:me,watermark:!1,daysLeft:o,trialEnd:r,features:gt(me)}}function nr(t,r){if(t==="*"||t===r)return!0;if(t.startsWith("*.")){let s=t.slice(1);return r.endsWith(s)||r===t.slice(2)}return!1}var ir="MRD-Indicators",Se="mrd-indicators.com",ar="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNCk7CiAgICAgIH0KCiAgICAgIC5jbHMtMiB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtMik7CiAgICAgIH0KCiAgICAgIC5jbHMtMiwgLmNscy0zLCAuY2xzLTQsIC5jbHMtNSwgLmNscy02IHsKICAgICAgICBtaXgtYmxlbmQtbW9kZTogbXVsdGlwbHk7CiAgICAgIH0KCiAgICAgIC5jbHMtMyB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtMyk7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNik7CiAgICAgIH0KCiAgICAgIC5jbHMtNSB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNSk7CiAgICAgIH0KCiAgICAgIC5jbHMtNiB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNyk7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQpOwogICAgICB9CgogICAgICAuY2xzLTggewogICAgICAgIGlzb2xhdGlvbjogaXNvbGF0ZTsKICAgICAgfQogICAgPC9zdHlsZT4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50IiB4MT0iOS4xMiIgeTE9IjE1Ljg4IiB4Mj0iMTkuNjMiIHkyPSI1LjM3IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2IzNTA5ZSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmNWE0YzciLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImxpbmVhci1ncmFkaWVudC0yIiB4MT0iOS4wOCIgeTE9IjYuODEiIHgyPSI5LjA4IiB5Mj0iMTQuNzMiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjMjM0ZmIzIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2ZmZiIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTMiIHgxPSIxNy42NyIgeTE9IjYuMTEiIHgyPSI4LjQxIiB5Mj0iNi4xMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM1YTJhOGIiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtNCIgeDE9IjIwLjAzIiB5MT0iMTUuODkiIHgyPSIxMC45OCIgeTI9IjE1Ljg5IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Y2YWFjYiIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM3NzJhOGQiLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImxpbmVhci1ncmFkaWVudC01IiB4MT0iMTkuMDMiIHkxPSIxNi44MiIgeDI9IjE0Ljc5IiB5Mj0iMTIuNTgiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2VkMzQ4ZCIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTYiIHgxPSIxNS4yNyIgeTE9IjE1LjA2IiB4Mj0iMTUuMjciIHkyPSIxOS4zNyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWU0YzliIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtNyIgeDE9IjUuNTEiIHkxPSItMTI4LjAyIiB4Mj0iLTMuNyIgeTI9Ii0xMjguMDIiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEwOS4xMiAxMC4wMSkgcm90YXRlKDg5LjYpIiB4bGluazpocmVmPSIjbGluZWFyLWdyYWRpZW50LTMiLz4KICA8L2RlZnM+CiAgPGcgY2xhc3M9ImNscy04IiBpZD0iTG9nbyI+CiAgICA8ZyBpZD0iT0JKRUNUUyIgPgogICAgICA8ZyBpZCA9IkxvZ28iPiAKICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTciIGQ9Ik00LjIzLDExYzAsNS4zNiw0LjM3LDkuNzEsOS43Niw5LjcxczkuNzYtNC4zNSw5Ljc2LTkuNzFTMTkuMzksMS4yOSwxNCwxLjI5LDQuMjMsNS42NCw0LjIzLDExWk0xMC4yNiwxMC4wN2MwLTEuNTQsMS4yNS0yLjc4LDIuOC0yLjc4aDEuODdjMS41NSwwLDIuOCwxLjI1LDIuOCwyLjc4djEuODZjMCwxLjU0LTEuMjUsMi43OC0yLjgsMi43OGgtMS4yMmMtLjQ1LDAtLjg4LjE1LTEuMjIuNDRsLTIuMjMsMS44NHYtNi45MloiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0xMC4yNiwxNi45OXYtNi45MnMwLS4wMiwwLS4wM2MuMDItMS41MiwxLjI2LTIuNzUsMi44LTIuNzVoLTUuMDljLTIuMDUsMC0zLjczLDEuNjQtMy43NCwzLjY4LDAsLjAxLDAsLjAzLDAsLjA0LDAsLjA4LDAsLjE2LDAsLjI0LDAsLjA0LDAsLjA4LDAsLjEyLDAsLjA0LDAsLjA4LDAsLjEyLDAsLjA2LDAsLjExLjAxLjE3LDAsLjAyLDAsLjA1LDAsLjA3LDAsLjA2LjAxLjEzLjAyLjE5LDAsLjAxLDAsLjAzLDAsLjA0LDAsLjA3LjAxLjE0LjAyLjIxLDAsMCwwLC4wMSwwLC4wMiwwLC4wNy4wMi4xNS4wMy4yMiwwLDAsMCwwLDAsMCwuNjgsNC42OCw0LjcxLDguMjcsOS42LDguMy0yLjA0LS4wMi0zLjY3LTEuNjktMy42Ny0zLjcyWiIvPgogICAgICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTE0LjA0LDEuMjlzLS4wMywwLS4wNCwwYy0uMDgsMC0uMTYsMC0uMjQsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDYsMC0uMTEsMC0uMTcsMC0uMDIsMC0uMDUsMC0uMDcsMC0uMDYsMC0uMTMuMDEtLjE5LjAyLS4wMSwwLS4wMywwLS4wNCwwLS4wNywwLS4xNC4wMS0uMjEuMDIsMCwwLS4wMSwwLS4wMiwwLS4wNywwLS4xNS4wMi0uMjIuMDMsMCwwLDAsMCwwLDAtNC43LjY4LTguMzIsNC42OS04LjM1LDkuNTQuMDItMi4wMiwxLjctMy42NSwzLjc0LTMuNjVoNi45NnMuMDIsMCwuMDMsMGMxLjUzLjAyLDIuNzcsMS4yNiwyLjc3LDIuNzh2LTUuMDZjMC0yLjA0LTEuNjUtMy43MS0zLjctMy43MloiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xNC45MywxNC43MWg1LjA5YzIuMDQsMCwzLjcyLTEuNjMsMy43NC0zLjY1LS4wMyw0Ljg2LTMuNjUsOC44Ny04LjM1LDkuNTQsMCwwLDAsMCwwLDAtLjA3LjAxLS4xNS4wMi0uMjIuMDMsMCwwLS4wMSwwLS4wMiwwLS4wNywwLS4xNC4wMi0uMjEuMDItLjAxLDAtLjAzLDAtLjA0LDAtLjA2LDAtLjEzLjAxLS4xOS4wMi0uMDIsMC0uMDUsMC0uMDcsMC0uMDYsMC0uMTEsMC0uMTcsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDgsMC0uMTYsMC0uMjQsMC0uMDEsMC0uMDMsMC0uMDQsMC0yLjA1LDAtMy43LTEuNjgtMy43LTMuNzJsMi4yMy0xLjg0Yy4zNC0uMjguNzgtLjQ0LDEuMjItLjQ0aDEuMjJaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy01IiBkPSJNMTQuOTMsMTQuNzFoNS4wOWMyLjA0LDAsMy43Mi0xLjYzLDMuNzQtMy42NS0uMDMsNC44Ni0zLjY1LDguODctOC4zNSw5LjU0LDAsMCwwLDAsMCwwLS4wNy4wMS0uMTUuMDItLjIyLjAzLDAsMC0uMDEsMC0uMDIsMC0uMDcsMC0uMTQuMDItLjIxLjAyLS4wMSwwLS4wMywwLS4wNCwwLS4wNiwwLS4xMy4wMS0uMTkuMDItLjAyLDAtLjA1LDAtLjA3LDAtLjA2LDAtLjExLDAtLjE3LDAtLjA0LDAtLjA4LDAtLjEyLDAtLjA0LDAtLjA4LDAtLjEyLDAtLjA4LDAtLjE2LDAtLjI0LDAtLjAxLDAtLjAzLDAtLjA0LDAtMi4wNSwwLTMuNy0xLjY4LTMuNy0zLjcybDIuMjMtMS44NGMuMzQtLjI4Ljc4LS40NCwxLjIyLS40NGgxLjIyWiIvPgogICAgICAgIDxwYXRoIGNsYXNzPSJjbHMtNCIgZD0iTTIwLjI4LDE0LjcxYy0uMDgsMC0uMTcsMC0uMjUsMGgtNi4zMWMtLjQ1LDAtLjg4LjE1LTEuMjIuNDRsLTIuMjMsMS44NGMwLC4wOCwwLC4xNywwLC4yNSwxLjA5LjY1LDIuMzcsMS4wMiwzLjczLDEuMDIsMi42NywwLDUuMDEtMS40Myw2LjI4LTMuNTVaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy02IiBkPSJNMjMuNzcsMTAuOTdzMC0uMDMsMC0uMDRjMC0uMDgsMC0uMTYsMC0uMjQsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDYsMC0uMTEtLjAxLS4xNywwLS4wMiwwLS4wNSwwLS4wNywwLS4wNi0uMDEtLjEzLS4wMi0uMTksMC0uMDEsMC0uMDMsMC0uMDQsMC0uMDctLjAyLS4xNC0uMDItLjIxLDAsMCwwLS4wMSwwLS4wMiwwLS4wNy0uMDItLjE1LS4wMy0uMjIsMCwwLDAsMCwwLDAtLjcxLTQuNjctNC43Ny04LjI0LTkuNjYtOC4yNCwyLjA0LDAsMy42OCwxLjY2LDMuNywzLjY5bC4wNCw1LjA2djEuODZzLjAxLjAyLjAxLjAzYzAsMS41Mi0xLjI1LDIuNzYtMi43OCwyLjc3bDUuMDktLjA0YzIuMDUtLjAxLDMuNzItMS42NiwzLjcxLTMuN1oiLz4KICAgICAgPC9nPgogICAgPC9nPgogIDwvZz4KPC9zdmc+",Vt=null,be=!1;function Pe(){if(Vt||be)return Vt;be=!0;let t=new Image;return t.onload=()=>{Vt=t},t.src=ar,null}function lr(){return Math.floor(Date.now()/864e5)}function ur(t){let r=(t^2654435769)>>>0;return function(){r=r+1831565813>>>0;let s=Math.imul(r^r>>>15,1|r);return s=s+Math.imul(s^s>>>7,61|s)^s,((s^s>>>14)>>>0)/4294967296}}function fr(t,r,s,o,w,e){let i=Pe();t.save(),t.setTransform(1,0,0,1,0,0),t.font="bold 10px Inter, system-ui, sans-serif";let n=t.measureText(o);t.font="8px Inter, system-ui, sans-serif";let u=t.measureText(w),l=i?18:0,f=i?14:0,p=7,g=5,a=i?5:0,d=l+a+Math.max(n.width,u.width)+p*2,h=Math.max(f,20)+g*2,c=Math.round(r-d/2),M=Math.round(s-h/2);t.globalAlpha=.45,t.fillStyle=e?"rgba(255,255,255,0.8)":"rgba(18,18,28,0.8)",t.shadowColor=e?"rgba(0,0,0,0.06)":"rgba(0,0,0,0.25)",t.shadowBlur=8,t.shadowOffsetY=1,t.beginPath(),t.roundRect(c,M,d,h,6),t.fill(),t.shadowColor="transparent",t.strokeStyle=e?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",t.lineWidth=.5,t.stroke();let m=c+p,I=M+h/2;i&&(t.globalAlpha=.5,t.drawImage(i,m,I-f/2,l,f),m+=l+a),t.globalAlpha=.5,t.font="bold 10px Inter, system-ui, sans-serif",t.fillStyle=e?"#1a1a2e":"#ededf5",t.textAlign="left",t.textBaseline="alphabetic",t.fillText(o,m,I-1),t.font="8px Inter, system-ui, sans-serif",t.fillStyle=e?"#777790":"#8080a0",t.textBaseline="top",t.fillText(w,m,I+2),t.restore()}function Fe(t,r,s,o){Pe();let w=r.width,e=r.height;if(w<100||e<80)return;t.save(),t.setTransform(1,0,0,1,0,0);let i=ur(lr()),n=100,u=Math.max(w-n*2,60),l=Math.max(e-n*2,40),f=n+i()*u,p=n+i()*l,g=s.trialExpired||s.plan===Ct,a=ir,_=g?`Free \u2014 ${Se}/pricing`:`Trial: ${s.daysLeft||0}d left \u2014 ${Se}`;fr(t,f,p,a,_,o),t.restore()}function _r({plan:t,domain:r="*",expiryDays:s=365,name:o,email:w}){let e=s>0?Math.floor(Date.now()/1e3)+s*86400:0,i={p:t,d:r,e,...o?{n:o}:{},...w?{m:w}:{},i:Date.now()};return i.s=Re(i),btoa(JSON.stringify(i))}var kt=null,te=null,Pt=null;async function Ft(){return kt?{module:kt,memory:te}:Pt||(Pt=(async()=>{let t=await import("./chart_engine.js");return await t.default(),te=t.wasm_memory(),kt=t,{module:t,memory:te}})(),Pt)}function et(t){let r=t.replace("#","");return[parseInt(r.substring(0,2),16)||0,parseInt(r.substring(2,4),16)||0,parseInt(r.substring(4,6),16)||0]}var Yt=null,Ot=null;async function Ye(){if(Yt)return Yt;let{module:t,memory:r}=await Ft();return Yt=t,Ot=r,t}function cr(){Yt||Ye().catch(()=>{})}async function dr(t,r={}){r.appId&&typeof window<"u"&&(window.__mrd_app_id=r.appId);let s=r.licenseKey||r.key||null,o=Rt(s);if(!o.valid)if(o.expired)console.warn(`[MRD Chart Engine] ${o.error}. Get a license at https://mrd-chart.dev/pricing`);else throw new Error(`[MRD Chart Engine] ${o.error}`);o.plan==="trial"&&console.info(`[MRD Chart Engine] Trial mode \u2014 ${o.daysLeft} days remaining. Purchase: https://mrd-chart.dev/pricing`);let w=await Ye(),e=window.devicePixelRatio||1,i=t.getBoundingClientRect();(i.width<1||i.height<1)&&(await new Promise(S=>{let A=new ResizeObserver(y=>{for(let T of y)if(T.contentRect.width>0&&T.contentRect.height>0){A.disconnect(),S();return}});A.observe(t.parentElement||t),setTimeout(()=>{A.disconnect(),S()},2e3)}),i=t.getBoundingClientRect());let n=Math.max(i.width,100),u=Math.max(i.height,100);t.width=n*e,t.height=u*e;let l=t.getContext("2d");l.scale(e,e);let f=new w.ChartEngine(n,u);if("ontouchstart"in window||navigator.maxTouchPoints>0)try{f.set_touch_mode(!0)}catch{}try{let S=o.expired?2:o.watermark?1:0,A=o.daysLeft||0,y=1297237059;y=Math.imul(y,31)+S>>>0,y=Math.imul(y,31)+A>>>0,y=(y^y>>>16)>>>0,y=Math.imul(y,73244475)>>>0,y=(y^y>>>16)>>>0,f.set_license_state(S,A,y)}catch(S){console.warn("[MRD] set_license_state failed:",S.message)}let g=!0,a=null,_=!1,d=!1,h=!1,c=null,M=null,m=0,I=!1,L=!1,X=("ontouchstart"in window||navigator.maxTouchPoints>0)&&window.innerWidth<=1399?33:0;function $(){if(!(!_||d||a)){if(X>0){let S=performance.now()-m;if(S<X){M||(M=setTimeout(()=>{M=null,$()},X-S));return}}a=requestAnimationFrame(Xe)}}let N=()=>{g=!0,$()},k=()=>h,at=null,ht=null,Y=null,W=null,H=null,G=null,lt=null,b=null,C=0,E=null,R=null,O=0,v=0,pt=-1,vt=!1,yt=!1,Ze=Xt(t,f,{onDirty:N,onCrosshairMove:(S,A,y)=>{O=S,v=A,pt=y,vt=!0,yt=!0},onCrosshairHide:()=>{yt&&(yt=!1,vt=!0,pt=-1)},drawingApi:S=>{at=S},onDrawingComplete:()=>{ht?.()},onDrawingCancel:()=>{Y?.()},onDrawingSelected:(S,A,y)=>{W?.(S,A,y)},onMarkerSelected:S=>{H?.(S)},onDrawingDblClick:(S,A,y,T,rt)=>{G?.(S,A,y,T,rt)},onVrvpHover:(S,A)=>{lt?.(S,A)},onLiqAnnotationPin:(S,A)=>{R?.(S,A)}});function De(){if(!(!vt||L)){if(vt=!1,!yt){c&&c(null,0,0),b&&b("");return}if(c)if(pt===0||pt===1)try{let S=f.get_tooltip_data();c(S,O,v)}catch{}else c(null,0,0);if(b){let S=performance.now();if(pt===0||pt===1){if(S-C>=80){C=S;try{b(f.lt_hit_test(O,v))}catch{}}}else b("")}}}function Xe(){if(a=null,!(!_||d||L)){I=!0;try{let S=!1;try{S=g||f.is_dirty()}catch{L=!0;return}if(S){g=!1,m=performance.now();let A=!1;try{if(f.render()>0){let T=f.get_command_buffer_ptr(),rt=f.get_command_buffer_len();l.save(),l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,t.width,t.height),l.restore(),ct(l,Ot,T,rt),A=!0}try{_t.renderAll(l)}catch{}}catch(y){if(A||(g=!0),y instanceof WebAssembly.RuntimeError){L=!0,console.error("[MRD] Engine crashed:",y.message);return}}De();try{E?.()}catch{}if(o.watermark)try{let y=f.get_theme()===1;Fe(l,t,o,y)}catch{}try{(g||f.is_dirty())&&$()}catch{}}}finally{I=!1}}}let St=Ht(o.plan),We=he(f,N,k,()=>St),He=pe(f,N,k,()=>St),Ve=we(f,N,k,()=>St),_t=Wt(f,Ot,ct);return{engine:f,start(){_=!0,d=!1,g=!0,$()},stop(){_=!1,a&&(cancelAnimationFrame(a),a=null),M&&(clearTimeout(M),M=null)},resize(S){if(L||I)return;if(i=t.getBoundingClientRect(),i.width<1||i.height<1){(S||0)<8&&setTimeout(()=>this.resize((S||0)+1),250);return}e=window.devicePixelRatio||1;let A=i.width*e,y=i.height*e;t.width=A,t.height=y,l.setTransform(1,0,0,1,0,0),l.scale(e,e);try{f.resize(i.width,i.height)}catch(T){if(T instanceof WebAssembly.RuntimeError){L=!0;return}throw T}N()},renderSync(){if(L)return 0;try{let S=f.render();if(S>0){let A=f.get_command_buffer_ptr(),y=f.get_command_buffer_len();l.save(),l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,t.width,t.height),l.restore(),ct(l,Ot,A,y)}return S}catch(S){return S instanceof WebAssembly.RuntimeError&&(L=!0),0}},setHoverPrice(S){f.set_hover_price(S),N()},clearHoverPrice(){f.clear_hover_price(),N()},hitZone(S,A){return f.hit_zone(S,A)},startDrawing(S,A){at?.setMode(S,A)},cancelDrawing(){at?.setMode(null)},onDrawingComplete(S){ht=S},onDrawingCancel(S){Y=S},onDrawingSelected(S){W=S},onMarkerSelected(S){H=S},onDrawingDblClick(S){G=S},setReplayState(S,A,y){f.set_replay_state(S,A,y),N()},setReplayHovered(S){f.set_replay_hovered(S)},setReplayPreview(S){f.set_replay_preview(S),N()},setPrecision(S){f.set_price_precision(S),N()},setCandleInterval(S){f.set_candle_interval(S)},setTheme(S){let A=S==="light"?1:0;typeof f.set_theme=="function"?(f.set_theme(A),N()):console.warn("[ChartEngine] set_theme not available \u2014 reload page to load updated WASM")},getTheme(){return f.get_theme()===1?"light":"dark"},setCandleBullColor(S){let[A,y,T]=et(S);typeof f.set_candle_bull_color=="function"&&(f.set_candle_bull_color(A,y,T),N())},setCandleBearColor(S){let[A,y,T]=et(S);typeof f.set_candle_bear_color=="function"&&(f.set_candle_bear_color(A,y,T),N())},setBackgroundColor(S){let[A,y,T]=et(S);typeof f.set_background_color=="function"&&(f.set_background_color(A,y,T),N())},setGridColor(S,A=255){let[y,T,rt]=et(S);typeof f.set_grid_color=="function"&&(f.set_grid_color(y,T,rt,A),N())},setCrosshairColor(S,A=160){let[y,T,rt]=et(S);typeof f.set_crosshair_color=="function"&&(f.set_crosshair_color(y,T,rt,A),N())},setCrosshairStyle(S){typeof f.set_crosshair_style=="function"&&(f.set_crosshair_style(S),N())},setCrosshairWidth(S){typeof f.set_crosshair_width=="function"&&(f.set_crosshair_width(S),N())},setFontSize(S){typeof f.set_font_size=="function"&&(f.set_font_size(S),N())},getFontSize(){return typeof f.get_font_size=="function"?f.get_font_size():11},setGridHVisible(S){typeof f.set_grid_h_visible=="function"&&(f.set_grid_h_visible(!!S),N())},setGridVVisible(S){typeof f.set_grid_v_visible=="function"&&(f.set_grid_v_visible(!!S),N())},setBgGradient(S,A){if(typeof f.set_bg_gradient=="function"){let[y,T,rt]=et(A||"#000000");f.set_bg_gradient(!!S,y,T,rt),N()}},setCandleBullWickColor(S){let[A,y,T]=et(S);typeof f.set_candle_bull_wick_color=="function"&&(f.set_candle_bull_wick_color(A,y,T),N())},setCandleBullBorderColor(S){let[A,y,T]=et(S);typeof f.set_candle_bull_border_color=="function"&&(f.set_candle_bull_border_color(A,y,T),N())},setCandleBearWickColor(S){let[A,y,T]=et(S);typeof f.set_candle_bear_wick_color=="function"&&(f.set_candle_bear_wick_color(A,y,T),N())},setCandleBearBorderColor(S){let[A,y,T]=et(S);typeof f.set_candle_bear_border_color=="function"&&(f.set_candle_bear_border_color(A,y,T),N())},onTooltip(S){c=S},onVrvpHover(S){lt=S},onLtHover(S){b=S},onPostRender(S){E=S},onLiqAnnotationPin(S){R=S},pause(){d||(d=!0,a&&(cancelAnimationFrame(a),a=null),M&&(clearTimeout(M),M=null))},resume(){d&&(d=!1,_&&(g=!0,$()))},get isPaused(){return d},destroy(){h=!0,_=!1,d=!1,a&&(cancelAnimationFrame(a),a=null),M&&(clearTimeout(M),M=null),Ze();try{f.free()}catch{}},addIndicator(S){if(!St("customIndicators"))return null;let A=_t.add(S);return N(),A},removeIndicator(S){_t.remove(S),N()},updateIndicatorParams(S,A){_t.updateParams(S,A),N()},setIndicatorEnabled(S,A){_t.setEnabled(S,A),N()},listIndicators(){return _t.list()},invalidateCustomIndicators(){_t.invalidateCompute(),N()},get license(){return{plan:o.plan,valid:o.valid,expired:!!o.expired,watermark:!!o.watermark,daysLeft:o.daysLeft,features:o.features||{}}},setLicenseKey(S){o=Rt(S),!o.valid&&!o.expired&&console.error(`[MRD Chart Engine] ${o.error}`),St=Ht(o.plan);try{let A=o.expired?2:o.watermark?1:0,y=o.daysLeft||0,T=1297237059;T=Math.imul(T,31)+A>>>0,T=Math.imul(T,31)+y>>>0,T=(T^T>>>16)>>>0,T=Math.imul(T,73244475)>>>0,T=(T^T>>>16)>>>0,f.set_license_state(A,y,T)}catch{}return N(),o.valid},...Ve,...We,...He}}function hr(t,r){let{t:s,o,h:w,l:e,c:i,v:n}=t,u=i.length;if(u===0||r<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let l=[],f=[],p=[],g=[],a=[],_=[],d=Math.round(i[0]/r)*r,h=0;for(let c=0;c<u;c++){h+=n[c];let m=i[c]-d;for(;m>=r;){let I=d,L=d+r;l.push(s[c]),f.push(I),p.push(L),g.push(I),a.push(L),_.push(h),h=0,d=L}for(;-m>=r;){let I=d,L=d-r;l.push(s[c]),f.push(I),p.push(I),g.push(L),a.push(L),_.push(h),h=0,d=L}}return{t:l,o:f,h:p,l:g,c:a,v:_}}function pr(t,r){let{t:s,o,h:w,l:e,c:i,v:n}=t,u=i.length;if(u===0||r<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let l=[],f=[],p=[],g=[],a=[],_=[],d=o[0],h=w[0],c=e[0],M=0,m=s[0];for(let I=0;I<u;I++)for(h=Math.max(h,w[I]),c=Math.min(c,e[I]),M+=n[I];h-c>=r;){let L=i[I]>=d,P=L?c+r:h-r;if(l.push(m),f.push(d),p.push(h),g.push(c),a.push(P),_.push(M),d=P,h=L?Math.max(w[I],P):P,c=L?P:Math.min(e[I],P),M=0,m=s[I],h-c<r)break}return(M>0||l.length===0)&&(l.push(m),f.push(d),p.push(h),g.push(c),a.push(i[u-1]),_.push(M)),{t:l,o:f,h:p,l:g,c:a,v:_}}function wr(t,r){let{t:s,o,h:w,l:e,c:i,v:n}=t,u=i.length;if(u===0||r<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let l=[],f=[],p=[],g=[],a=[],_=[],d=Math.max(1,Math.round(r));for(let h=0;h<u;h+=d){let c=Math.min(h+d,u),M=-1/0,m=1/0,I=0;for(let L=h;L<c;L++)w[L]>M&&(M=w[L]),e[L]<m&&(m=e[L]),I+=n[L];l.push(s[h]),f.push(o[h]),p.push(M),g.push(m),a.push(i[c-1]),_.push(I)}return{t:l,o:f,h:p,l:g,c:a,v:_}}function gr(t,r){let s=t>1e4?50:t>1e3?10:t>100?1:t>1?.1:.001,o=s*2,w=r<=60?10:r<=300?5:3;return{brickSize:s,rangeSize:o,tickCount:w}}var mr={minRefills:3,hiddenRatio:2,refillWindowMs:1e4,maxTrackedLevels:200,maxEvents:500,decayMs:3e5};function Mr(t={}){let r={...mr,...t},s=new Map,o=new Map,w=[],e=0;function i(g){return Math.round(g*1e8)/1e8}function n(g,a,_,d){for(let[h,c]of g){let M=i(h),m=a.get(M);if(!m){a.set(M,{lastVol:c,refills:0,totalConsumed:0,lastRefillTs:d,peakVisible:c});continue}if(c<m.lastVol*.3&&m.lastVol>0){let I=m.lastVol-c;m.totalConsumed+=I,m.lastVol=c;continue}if(c>m.lastVol*1.5&&m.totalConsumed>0)if(d-m.lastRefillTs<r.refillWindowMs){if(m.refills++,m.lastRefillTs=d,m.peakVisible=Math.max(m.peakVisible,c),m.refills>=r.minRefills){let L=m.totalConsumed,P=m.peakVisible;L>=P*r.hiddenRatio&&(w.push({timestamp:d,price:h,visibleSize:P,hiddenSize:L,isBid:_,refillCount:m.refills}),w.length>r.maxEvents&&w.shift(),m.refills=0,m.totalConsumed=0)}}else m.refills=1,m.totalConsumed=0,m.lastRefillTs=d;m.lastVol=c}if(a.size>r.maxTrackedLevels){let h=[...a.entries()];h.sort((M,m)=>M[1].lastRefillTs-m[1].lastRefillTs);let c=h.length-r.maxTrackedLevels;for(let M=0;M<c;M++)a.delete(h[M][0])}}function u(g,a,_){let d=_||Date.now();e=d;let h=g instanceof Map?g:new Map(g.map(([m,I])=>[m,I])),c=a instanceof Map?a:new Map(a.map(([m,I])=>[m,I]));n(h,s,!0,d),n(c,o,!1,d);let M=d-r.decayMs;for(;w.length>0&&w[0].timestamp<M;)w.shift()}function l(){return w}function f(g){if(!g||w.length===0)return;let a=w.length,_=new Float64Array(a),d=new Float64Array(a),h=new Float64Array(a),c=new Float64Array(a),M=new Uint8Array(a),m=new Uint32Array(a);for(let I=0;I<a;I++){let L=w[I];_[I]=L.timestamp,d[I]=L.price,h[I]=L.visibleSize,c[I]=L.hiddenSize,M[I]=L.isBid?1:0,m[I]=L.refillCount}g.setIcebergEvents(_,d,h,c,M,m)}function p(){s.clear(),o.clear(),w.length=0}return{onOrderbookUpdate:u,getEvents:l,pushToEngine:f,reset:p}}var ee=null,ze=null;async function Sr(){if(ee)return ee;let{module:t,memory:r}=await Ft();return ee=t,ze=r,t}var Oe=Promise.resolve();async function br(t,r={}){let s=await Sr();return await(Oe=Oe.then(()=>je(s,t,r),()=>je(s,t,r)))}function je(t,r,s){let o=window.devicePixelRatio||1,w=r.getBoundingClientRect(),e=Math.max(w.width,60),i=Math.max(w.height,60);r.width=e*o,r.height=i*o;let n=r.getContext("2d");n.scale(o,o);let u=new t.OrderbookEngine(e,i);s.symbol&&u.set_symbol(s.symbol),s.tickSize&&u.set_tick_size(s.tickSize),s.visibleTicks&&u.set_visible_ticks(s.visibleTicks),s.exchangeCount&&u.set_exchange_count(s.exchangeCount),s.pricePrecision!=null&&u.set_price_precision(s.pricePrecision),s.theme==="light"&&u.set_theme(1),s.heatmapCols&&u.set_heatmap_cols(s.heatmapCols),(s.ringCols||s.ringRows)&&u.set_ring_capacity(s.ringCols||300,s.ringRows||400),s.heatmapAlphaMul!=null&&u.set_heatmap_alpha_mul(Number(s.heatmapAlphaMul)),s.showCumulative!=null&&u.set_show_cumulative(!!s.showCumulative),s.showSignalOverlays!=null&&u.set_show_signal_overlays(!!s.showSignalOverlays);let l=!0,f=null,p=!1,g=!1,a=!1,_=null,d=null;function h(){!p||a||f||(f=requestAnimationFrame(M))}let c=()=>{l=!0,h()};function M(){if(f=null,!p||a)return;let b=!1;try{b=l||u.is_dirty()}catch{a=!0;return}if(b){l=!1;try{if(u.render()>0){let E=u.get_command_buffer_ptr(),R=u.get_command_buffer_len();n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.restore(),ct(n,ze,E,R)}}catch(C){if(C instanceof WebAssembly.RuntimeError){a=!0,console.error("[OrderbookEngine] crashed:",C.message);return}l=!0}}}r.style.touchAction="none";let m=!1,I=0,L=new Map,P=0,X=0,$=0,N=0,k=!1;function at(b){if(a)return;b.preventDefault();let C=b.deltaY>0?1.08:.93;u.zoom_y(C,b.offsetY),c()}function ht(b){if(!a){if(L.set(b.pointerId,{y:b.offsetY}),r.setPointerCapture(b.pointerId),L.size===1)m=!0,I=b.offsetY,N=b.offsetX,$=b.offsetY,k=!1;else if(L.size===2){m=!1;let C=[...L.values()];P=Math.abs(C[0].y-C[1].y),X=(C[0].y+C[1].y)/2}}}function Y(b){if(!a){if(L.set(b.pointerId,{y:b.offsetY}),L.size>=2){let C=[...L.values()],E=Math.abs(C[0].y-C[1].y),R=(C[0].y+C[1].y)/2;if(P>0){let v=P/Math.max(E,1);u.zoom_y(v,R)}let O=R-X;Math.abs(O)>.5&&u.pan_y(O),P=E,X=R,c()}else if(m){let C=b.offsetY-I;I=b.offsetY,(Math.abs(b.offsetX-N)>4||Math.abs(b.offsetY-$)>4)&&(k=!0),u.pan_y(C),c()}else if(u.set_hover(b.offsetX,b.offsetY),c(),_)try{let C=u.get_hover_price();if(C>0){let E=u.get_hover_qty(),R=u.get_hover_side();_({price:C,qty:E,side:R===2?"ask":"bid"})}else _(null)}catch{}}}function W(){a||(_&&_(null),u.clear_hover(),c())}function H(b){let C=m&&!k&&L.size===1;L.delete(b.pointerId);try{r.releasePointerCapture(b.pointerId)}catch{}if(L.size===0){if(C&&d&&!a)try{u.set_hover(b.offsetX,b.offsetY);let E=u.get_hover_price();if(E>0){let R=u.get_hover_qty(),O=u.get_hover_side();d({price:E,qty:R,side:O===2?"ask":"bid"})}}catch{}m=!1,P=0}else L.size===1&&(m=!0,I=[...L.values()][0].y,P=0)}function G(){a||(u.center_on_mid(),c())}r.addEventListener("wheel",at,{passive:!1}),r.addEventListener("pointerdown",ht),r.addEventListener("pointermove",Y),r.addEventListener("pointerup",H),r.addEventListener("pointercancel",H),r.addEventListener("pointerleave",W),r.addEventListener("dblclick",G);function lt(){r.removeEventListener("wheel",at),r.removeEventListener("pointerdown",ht),r.removeEventListener("pointermove",Y),r.removeEventListener("pointerup",H),r.removeEventListener("pointercancel",H),r.removeEventListener("pointerleave",W),r.removeEventListener("dblclick",G)}return{engine:u,start(){p=!0,l=!0,h()},stop(){p=!1,f&&(cancelAnimationFrame(f),f=null)},resize(){if(!(g||a)&&(w=r.getBoundingClientRect(),!(w.width<1||w.height<1))){o=window.devicePixelRatio||1,r.width=w.width*o,r.height=w.height*o,n.setTransform(1,0,0,1,0,0),n.scale(o,o);try{u.resize(w.width,w.height)}catch(b){if(b instanceof WebAssembly.RuntimeError){a=!0;return}throw b}c()}},pushSnapshot(b,C,E){if(a)return;let R=new Float64Array(b.length*2);for(let v=0;v<b.length;v++)R[v*2]=b[v][0],R[v*2+1]=b[v][1];let O=new Float64Array(C.length*2);for(let v=0;v<C.length;v++)O[v*2]=C[v][0],O[v*2+1]=C[v][1];try{u.push_snapshot(R,O,E)}catch(v){if(v instanceof WebAssembly.RuntimeError){a=!0;return}throw v}c()},pushSnapshotFlat(b,C,E){if(!a){try{u.push_snapshot(b,C,E)}catch(R){if(R instanceof WebAssembly.RuntimeError){a=!0;return}throw R}c()}},setDepthBook(b,C,E){if(a)return;let R=new Float64Array(b.length*2);for(let v=0;v<b.length;v++)R[v*2]=b[v][0],R[v*2+1]=b[v][1];let O=new Float64Array(C.length*2);for(let v=0;v<C.length;v++)O[v*2]=C[v][0],O[v*2+1]=C[v][1];try{u.set_depth_book(R,O,E)}catch(v){if(v instanceof WebAssembly.RuntimeError){a=!0;return}throw v}c()},setDepthBookFlat(b,C,E){if(!a){try{u.set_depth_book(b,C,E)}catch(R){if(R instanceof WebAssembly.RuntimeError){a=!0;return}throw R}c()}},pushHeatmapCol(b,C,E){if(a)return;let R=new Float64Array(b.length*2);for(let v=0;v<b.length;v++)R[v*2]=b[v][0],R[v*2+1]=b[v][1];let O=new Float64Array(C.length*2);for(let v=0;v<C.length;v++)O[v*2]=C[v][0],O[v*2+1]=C[v][1];try{u.push_heatmap_col(R,O,E)}catch(v){if(v instanceof WebAssembly.RuntimeError){a=!0;return}throw v}c()},pushHeatmapColFlat(b,C,E){if(!a){try{u.push_heatmap_col(b,C,E)}catch(R){if(R instanceof WebAssembly.RuntimeError){a=!0;return}throw R}c()}},resetRing(){if(!a){try{u.reset_ring()}catch(b){if(b instanceof WebAssembly.RuntimeError){a=!0;return}throw b}c()}},setExchangeLabels(b){if(a)return;let C=Array.isArray(b)?b.join(","):String(b);try{u.set_exchange_labels(C)}catch(E){if(E instanceof WebAssembly.RuntimeError){a=!0;return}throw E}c()},setSignalObi(b,C,E){if(!a){try{u.set_signal_obi(b,C,E)}catch(R){if(R instanceof WebAssembly.RuntimeError){a=!0;return}throw R}c()}},setSignalSpoof(b){if(!a){try{u.set_signal_spoof(b)}catch(C){if(C instanceof WebAssembly.RuntimeError){a=!0;return}throw C}c()}},setSignalAbsorption(b,C){if(!a){try{u.set_signal_absorption(b,C)}catch(E){if(E instanceof WebAssembly.RuntimeError){a=!0;return}throw E}c()}},setSignalFlow(b,C){if(!a){try{u.set_signal_flow(b,C)}catch(E){if(E instanceof WebAssembly.RuntimeError){a=!0;return}throw E}c()}},setSignalWalls(b,C){if(!a){try{u.set_signal_walls(new Float64Array(b),new Float64Array(C))}catch(E){if(E instanceof WebAssembly.RuntimeError){a=!0;return}throw E}c()}},setSignalGaps(b,C){if(!a){try{u.set_signal_gaps(new Float64Array(b),new Float64Array(C))}catch(E){if(E instanceof WebAssembly.RuntimeError){a=!0;return}throw E}c()}},setSymbol(b){a||(u.set_symbol(b),c())},setTickSize(b){a||(u.set_tick_size(b),c())},setVisibleTicks(b){a||(u.set_visible_ticks(b),c())},setExchangeCount(b){a||(u.set_exchange_count(b),c())},setPrecision(b){a||(u.set_price_precision(b),c())},setAutoCenter(b){a||u.set_auto_center(b)},centerOnMid(){a||(u.center_on_mid(),c())},setHeatmapCols(b){a||(u.set_heatmap_cols(b),c())},setHeatmapAlphaMul(b){if(!a){try{u.set_heatmap_alpha_mul(Number(b))}catch(C){if(C instanceof WebAssembly.RuntimeError){a=!0;return}throw C}c()}},setShowCumulative(b){if(!a){try{u.set_show_cumulative(!!b)}catch(C){if(C instanceof WebAssembly.RuntimeError){a=!0;return}throw C}c()}},setShowSignalOverlays(b){if(!a){try{u.set_show_signal_overlays(!!b)}catch(C){if(C instanceof WebAssembly.RuntimeError){a=!0;return}throw C}c()}},getHoverPrice(){return a?0:u.get_hover_price()},getHoverQty(){return a?0:u.get_hover_qty()},getHoverSide(){return a?0:u.get_hover_side()},onHoverPrice(b){_=b},onClickPrice(b){d=b},setTheme(b){a||(u.set_theme(b==="light"?1:0),c())},clear(){a||(u.clear(),c())},get isDead(){return a},destroy(){g=!0,p=!1,f&&(cancelAnimationFrame(f),f=null),lt();try{u.free()}catch{}}}}export{pr as buildRange,hr as buildRenko,wr as buildTick,dr as createChartBridge,Wt as createCustomIndicatorManager,Mr as createIcebergDetector,br as createOrderbookBridge,ct as dispatchCommands,_r as generateLicenseKey,cr as prefetchWasm,Xt as setupEvents,gr as suggestDefaults,Rt as validateLicense};
1
+ var ct={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,GRADIENT_RECT:16,LINEAR_POLYLINE:17,BEGIN_HEATMAP_LAYER:18,END_HEATMAP_LAYER:19,HEATMAP_BITMAP:20,LINE_WITH_EXTEND:21,LABEL_CALLOUT:22,END_FRAME:255},Ht=null,Ke=null;function Vr(t,e){return Ht?(Ht.width!==t||Ht.height!==e)&&(Ht.width=t,Ht.height=e):(Ht=typeof OffscreenCanvas<"u"?new OffscreenCanvas(t,e):Object.assign(document.createElement("canvas"),{width:t,height:e}),Ke=Ht.getContext("2d")),Ke}var qr=["left","center","right"],ne=new Map,kr=4096;function Gr(t,e,o,s){return t<<24|e<<16|o<<8|s}function ht(t,e,o,s){let M=Gr(t,e,o,s),r=ne.get(M);return r||(r=`rgba(${t},${e},${o},${(s/255).toFixed(3)})`,ne.size>=kr&&ne.clear(),ne.set(M,r),r)}var me=new TextDecoder;function se(t,e){return Math.round(t*e)/e}var Qe=new Map;function be(t,e){let o=Qe.get(e);if(o!==void 0)return o;let s=t.font,M=t.textBaseline;t.font=e,t.textBaseline="alphabetic";let r=t.measureText("0"),i=r.actualBoundingBoxAscent||0,l=r.actualBoundingBoxDescent||0;return o=(i-l)/2,(!Number.isFinite(o)||o===0)&&(o=(parseFloat(e)||11)*.35),Qe.set(e,o),t.font=s,t.textBaseline=M,o}function gt(t,e,o){let s=Math.max(1,Math.round(e*o)),M=Math.round(t*o)/o;return s&1?M+.5/o:M}function ie(t,e,o,s,M){let r=Math.round(t*M),i=Math.round(e*M),l=Math.round((t+o)*M),n=Math.round((e+s)*M);return{x:r/M,y:i/M,w:(l-r)/M,h:(n-i)/M}}function $e(){let t=null,e=null,o=null,s=0;function M(r,i,l){return r<=0||i<=0?null:(t?(t.width!==r||t.height!==i)&&(t.width=r,t.height=i,o=null):(typeof OffscreenCanvas<"u"?t=new OffscreenCanvas(r,i):(t=document.createElement("canvas"),t.width=r,t.height=i),e=t.getContext("2d",{alpha:!0})),e&&s!==l&&(e.setTransform(l,0,0,l,0,0),s=l,o=null),e)}return{ensureSize:M,getCanvas(){return t},getKey(){return o},setKey(r){o=r},invalidate(){o=null}}}function Ft(t,e,o,s,M=null){let r=e.buffer;if(o+s>r.byteLength)return;let i=new DataView(r,o,s),l=new Uint8Array(r,o,s),n=0,c="",u="",p=-1,L="",S=Math.max(1,Math.abs(t.getTransform?.().a||window.devicePixelRatio||1)),E=t,C=!1,F="";for(;n<s;){let b=l[n];if(n+=1,b===ct.END_FRAME)break;switch(b){case ct.FILL_RECT:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4,O!==c&&(t.fillStyle=O,c=O);let x=ie(T,v,R,y,S);t.fillRect(x.x,x.y,x.w,x.h);break}case ct.STROKE_RECT:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let x=i.getFloat32(n,!0);n+=4,O!==u&&(t.strokeStyle=O,u=O),x!==p&&(t.lineWidth=x,p=x);let q=gt(T,x,S),U=gt(v,x,S),K=Math.round(R*S)/S,D=Math.round(y*S)/S;t.strokeRect(q,U,K,D);break}case ct.LINE:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let x=i.getFloat32(n,!0);n+=4,t.beginPath(),O!==u&&(t.strokeStyle=O,u=O),x!==p&&(t.lineWidth=x,p=x),t.setLineDash([]),t.moveTo(gt(T,x,S),gt(v,x,S)),t.lineTo(gt(R,x,S),gt(y,x,S)),t.stroke();break}case ct.DASHED_LINE:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let x=i.getFloat32(n,!0);n+=4;let q=i.getFloat32(n,!0);n+=4;let U=i.getFloat32(n,!0);n+=4,t.beginPath(),O!==u&&(t.strokeStyle=O,u=O),x!==p&&(t.lineWidth=x,p=x),t.setLineDash([q,U]),t.moveTo(gt(T,x,S),gt(v,x,S)),t.lineTo(gt(R,x,S),gt(y,x,S)),t.stroke(),t.setLineDash([]);break}case ct.LINEAR_POLYLINE:{let T=i.getUint16(n,!0);n+=2;let v=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let R=i.getFloat32(n,!0);if(n+=4,T>1){t.beginPath(),v!==u&&(t.strokeStyle=v,u=v),R!==p&&(t.lineWidth=R,p=R),t.setLineDash([]),t.lineJoin="miter",t.lineCap="butt",t.miterLimit=10;let y=i.getFloat32(n,!0);n+=4;let O=i.getFloat32(n,!0);n+=4,t.moveTo(y,O);for(let x=1;x<T;x++)t.lineTo(i.getFloat32(n,!0),i.getFloat32(n+4,!0)),n+=8;t.stroke()}else n+=T*8;break}case ct.POLYLINE:{let T=i.getUint16(n,!0);n+=2;let v=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let R=i.getFloat32(n,!0);if(n+=4,T>0){let y=new Float32Array(T*2);for(let O=0;O<T;O++)y[O*2]=i.getFloat32(n,!0),n+=4,y[O*2+1]=i.getFloat32(n,!0),n+=4;if(t.beginPath(),v!==u&&(t.strokeStyle=v,u=v),R!==p&&(t.lineWidth=R,p=R),t.setLineDash([]),t.lineJoin="round",t.lineCap="round",T===2)t.moveTo(y[0],y[1]),t.lineTo(y[2],y[3]);else{t.moveTo(y[0],y[1]);for(let O=0;O<T-1;O++){let x=O>0?O-1:0,q=O,U=O+1,K=O<T-2?O+2:T-1,D=y[x*2],rt=y[x*2+1],nt=y[q*2],B=y[q*2+1],H=y[U*2],j=y[U*2+1],$=y[K*2],Q=y[K*2+1],J=nt+(H-D)/6,et=B+(j-rt)/6,st=H-($-nt)/6,tt=j-(Q-B)/6;t.bezierCurveTo(J,et,st,tt,H,j)}}t.stroke()}break}case ct.TEXT:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=l[n];n+=1;let x=i.getUint16(n,!0);n+=2;let q=me.decode(new Uint8Array(e.buffer,o+n,x));n+=x,R!==c&&(t.fillStyle=R,c=R);let U=`${Math.round(y)}px "IBM Plex Mono",monospace`;U!==L&&(t.font=U,L=U),t.textAlign=qr[O]||"left",t.textBaseline="alphabetic";let K=v+be(t,U);t.fillText(q,se(T,S),se(K,S));break}case ct.CIRCLE:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let O=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let x=i.getFloat32(n,!0);n+=4,t.beginPath(),t.arc(T,v,R,0,Math.PI*2),y!==c&&(t.fillStyle=y,c=y),t.fill(),x>0&&(O!==u&&(t.strokeStyle=O,u=O),x!==p&&(t.lineWidth=x,p=x),t.stroke());break}case ct.TRIANGLE:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=i.getFloat32(n,!0);n+=4;let x=i.getFloat32(n,!0);n+=4;let q=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4,t.beginPath(),t.moveTo(T,v),t.lineTo(R,y),t.lineTo(O,x),t.closePath(),q!==c&&(t.fillStyle=q,c=q),t.fill();break}case ct.SAVE:{t.save();break}case ct.RESTORE:{t.restore(),c="",u="",p=-1,L="";break}case ct.CLIP_RECT:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=ie(T,v,R,y,S);t.beginPath(),t.rect(O.x,O.y,O.w,O.h),t.clip();break}case ct.ROTATED_TEXT:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=i.getFloat32(n,!0);n+=4;let x=i.getUint16(n,!0);n+=2;let q=me.decode(l.subarray(n,n+x));n+=x;let U=`${y}px sans-serif`;U!==L&&(t.font=U,L=U),R!==c&&(t.fillStyle=R,c=R),t.textAlign="center",t.textBaseline="alphabetic";let K=be(t,U);t.save(),t.translate(T,v),t.rotate(O),t.fillText(q,0,K),t.restore();break}case ct.BUBBLE_3D:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=l[n],O=l[n+1],x=l[n+2],q=l[n+3];n+=4;let U=l[n],K=l[n+1],D=l[n+2],rt=l[n+3];n+=4;let nt=l[n],B=l[n+1],H=l[n+2],j=l[n+3];n+=4;let $=i.getFloat32(n,!0);n+=4;let Q=R;if(Q<10){let J=`rgba(${y},${O},${x},${(q/255).toFixed(3)})`;t.beginPath(),t.arc(T,v,Q,0,Math.PI*2),t.fillStyle=J,t.fill(),c=""}else if(Q<18){let J=T-Q*.25,et=v-Q*.25,st=t.createRadialGradient(J,et,Q*.08,T,v,Q);st.addColorStop(0,`rgba(${U},${K},${D},${(rt/255).toFixed(3)})`),st.addColorStop(1,`rgba(${y},${O},${x},${(q/255).toFixed(3)})`),t.beginPath(),t.arc(T,v,Q,0,Math.PI*2),t.fillStyle=st,t.fill(),c=""}else{let J=T-Q*.25,et=v-Q*.25,st=t.createRadialGradient(T,v,Q*.85,T,v,Q*1.2);st.addColorStop(0,`rgba(${nt},${B},${H},${(j/255*.5).toFixed(3)})`),st.addColorStop(1,`rgba(${nt},${B},${H},0)`),t.beginPath(),t.arc(T,v,Q*1.2,0,Math.PI*2),t.fillStyle=st,t.fill();let tt=t.createRadialGradient(J,et,Q*.08,T,v,Q);tt.addColorStop(0,`rgba(${U},${K},${D},${(rt/255).toFixed(3)})`),tt.addColorStop(1,`rgba(${y},${O},${x},${(q/255).toFixed(3)})`),t.beginPath(),t.arc(T,v,Q,0,Math.PI*2),t.fillStyle=tt,t.fill();let ft=Q*.2,St=t.createRadialGradient(J,et,0,J,et,ft);St.addColorStop(0,"rgba(255,255,255,0.22)"),St.addColorStop(1,"rgba(255,255,255,0)"),t.beginPath(),t.arc(J,et,ft,0,Math.PI*2),t.fillStyle=St,t.fill(),c=""}break}case ct.FILL_POLYGON:{let T=i.getUint16(n,!0);n+=2;let v=ht(l[n],l[n+1],l[n+2],l[n+3]);if(n+=4,T>2){t.beginPath();let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4,t.moveTo(R,y);for(let O=1;O<T;O++)t.lineTo(i.getFloat32(n,!0),i.getFloat32(n+4,!0)),n+=8;t.closePath(),v!==c&&(t.fillStyle=v,c=v),t.fill()}else n+=T*8;break}case ct.DASHED_POLYLINE:{let T=i.getUint16(n,!0);n+=2;let v=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=i.getFloat32(n,!0);if(n+=4,T>1){t.beginPath(),v!==u&&(t.strokeStyle=v,u=v),R!==p&&(t.lineWidth=R,p=R),t.setLineDash([y,O]),t.lineJoin="round";let x=i.getFloat32(n,!0);n+=4;let q=i.getFloat32(n,!0);n+=4,t.moveTo(x,q);for(let U=1;U<T;U++)t.lineTo(i.getFloat32(n,!0),i.getFloat32(n+4,!0)),n+=8;t.stroke(),t.setLineDash([])}else n+=T*8;break}case ct.GRADIENT_RECT:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let x=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let q=ie(T,v,R,y,S),U=t.createLinearGradient(q.x,q.y,q.x,q.y+q.h);U.addColorStop(0,O),U.addColorStop(1,x),t.fillStyle=U,c="",t.fillRect(q.x,q.y,q.w,q.h);break}case ct.BEGIN_HEATMAP_LAYER:{let T=n-1,v=i.getUint32(n,!0);n+=4;let R=i.getUint32(n,!0);n+=4;let y=i.getUint32(n,!0);if(n+=4,!M||y===0)break;let O=E.canvas.width,x=E.canvas.height,q=`${v}|${R}|${O}|${x}|${S}`;if(M.getKey()===q&&M.getCanvas()){let U=O/S,K=x/S;E.drawImage(M.getCanvas(),0,0,U,K),n=T+y}else{let U=M.ensureSize(O,x,S);if(!U)break;U.save(),U.setTransform(1,0,0,1,0,0),U.clearRect(0,0,O,x),U.restore(),t=U,c="",u="",p=-1,L="",C=!0,F=q}break}case ct.END_HEATMAP_LAYER:{if(!C)break;let T=E.canvas.width/S,v=E.canvas.height/S;E.drawImage(M.getCanvas(),0,0,T,v),M.setKey(F),t=E,c="",u="",p=-1,L="",C=!1,F="";break}case ct.HEATMAP_BITMAP:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getUint32(n,!0);n+=4;let y=i.getUint32(n,!0);n+=4;let O=R*y*4;if(n+O>l.byteLength){n=l.byteLength;break}let x=new Uint8ClampedArray(l.buffer,l.byteOffset+n,O);n+=O;let q=new ImageData(x,R,y),U=Vr(R,y);if(!U)break;U.putImageData(q,0,0),t.drawImage(Ht,T,v,R,y);break}case ct.LINE_WITH_EXTEND:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=i.getFloat32(n,!0);n+=4;let y=i.getFloat32(n,!0);n+=4;let O=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let x=i.getFloat32(n,!0);n+=4;let q=i.getFloat32(n,!0);n+=4;let U=i.getFloat32(n,!0);n+=4;let K=l[n];n+=1,O!==u&&(t.strokeStyle=O,u=O),x!==p&&(t.lineWidth=x,p=x),t.setLineDash(q>0?[q,U]:[]);let D=1e5,rt=T,nt=v,B=R,H=y,j=R-T,$=y-v,Q=Math.hypot(j,$);if(Q>0&&K!==0){let J=j/Q,et=$/Q;K&1&&(rt=T-J*D,nt=v-et*D),K&2&&(B=R+J*D,H=y+et*D),K&4&&et<0&&(rt=T-J*D,nt=v-et*D),K&8&&et>0&&(B=R+J*D,H=y+et*D)}t.beginPath(),t.moveTo(gt(rt,x,S),gt(nt,x,S)),t.lineTo(gt(B,x,S),gt(H,x,S)),t.stroke(),q>0&&t.setLineDash([]);break}case ct.LABEL_CALLOUT:{let T=i.getFloat32(n,!0);n+=4;let v=i.getFloat32(n,!0);n+=4;let R=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let y=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let O=ht(l[n],l[n+1],l[n+2],l[n+3]);n+=4;let x=i.getFloat32(n,!0);n+=4;let q=i.getFloat32(n,!0);n+=4;let U=l[n];n+=1;let K=l[n];n+=1;let D=i.getUint16(n,!0);n+=2;let rt=me.decode(l.subarray(n,n+D));n+=D;let nt=`${Math.round(x)}px "IBM Plex Mono",monospace`;nt!==L&&(t.font=nt,L=nt);let B=4,H=6,j=t.measureText(rt).width,$=Math.round(x)+B*2,Q=Math.ceil(j)+B*2,J,et;switch(K){case 1:et=v-H-$,J=T-Q/2;break;case 2:et=v+H,J=T-Q/2;break;case 3:et=v-$/2,J=T+H;break;case 4:et=v-$/2,J=T-H-Q;break;default:et=v-$/2,U===1?J=T-Q/2:U===2?J=T-Q:J=T;break}let st=ie(J,et,Q,$,S);if(R!==c&&(t.fillStyle=R,c=R),t.fillRect(st.x,st.y,st.w,st.h),q>0){y!==u&&(t.strokeStyle=y,u=y),q!==p&&(t.lineWidth=q,p=q),t.setLineDash([]);let ft=gt(J,q,S),St=gt(et,q,S),vt=Math.round(Q*S)/S,Lt=Math.round($*S)/S;t.strokeRect(ft,St,vt,Lt)}if(K>=1&&K<=4){switch(R!==c&&(t.fillStyle=R,c=R),t.beginPath(),K){case 1:t.moveTo(T-H/2,et+$),t.lineTo(T+H/2,et+$),t.lineTo(T,v);break;case 2:t.moveTo(T-H/2,et),t.lineTo(T+H/2,et),t.lineTo(T,v);break;case 3:t.moveTo(J,v-H/2),t.lineTo(J,v+H/2),t.lineTo(T,v);break;case 4:t.moveTo(J+Q,v-H/2),t.lineTo(J+Q,v+H/2),t.lineTo(T,v);break}t.closePath(),t.fill()}O!==c&&(t.fillStyle=O,c=O),t.textAlign="left",t.textBaseline="alphabetic";let tt=be(t,nt);t.fillText(rt,se(J+B,S),se(et+$/2+tt,S));break}default:return}}if(C&&M){let b=E.canvas.width/S,T=E.canvas.height/S;E.drawImage(M.getCanvas(),0,0,b,T),M.invalidate()}}var At={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 Jt(t){return At[t]?.type==="2point"}function Dt(t){return At[t]?.type==="3point"}function Gt(t){let e=At[t]?.type;return e==="1point"||e==="1point_x"||e==="1point_xy"||e==="1point_xp"}function ae(t){return At[t]?.type==="freehand"}function zt(t){return At[t]?.type==="npoint"}function Bt(t){return At[t]?.type==="elliott_manual"}var Je={r:.04,g:.49,b:1,lineWidth:2,dashed:!1,fontSize:12};function Wt(t,e,o,s,M,r){r=r||Je;let i=At[e];if(!i)return 0;let l=0;if(i.type==="3point"?l=t[i.addFn](o.x1,o.y1,o.x2,o.y2,s,M,r.r,r.g,r.b,r.lineWidth,r.dashed,o.pane):i.type==="2point"?l=t[i.addFn](o.x1,o.y1,s,M,r.r,r.g,r.b,r.lineWidth,r.dashed,o.pane):i.type==="1point_x"?l=t[i.addFn](s,r.r,r.g,r.b,r.lineWidth,r.dashed,o.pane):i.type==="1point_xp"?l=t[i.addFn](s,M,r.r,r.g,r.b,r.lineWidth,r.dashed,o.pane):i.type==="1point_xy"?l=t[i.addFn](s,M,r.r,r.g,r.b,r.fontSize||12,o.pane):l=t[i.addFn](M,r.r,r.g,r.b,r.lineWidth,r.dashed,o.pane),l&&r.fontSize&&typeof t.set_drawing_font_size=="function"&&(i.type==="2point"||i.type==="3point"))try{t.set_drawing_font_size(l,r.fontSize)}catch{}return l||0}function It(t,e,o,s,M,r,i){r=r||Je;let l=At[e];if(l){if(l.previewFn==="elliott"){t.set_elliott_preview(s,M,r.r,r.g,r.b,r.lineWidth,i);return}l.type==="3point"?o.step===1?t.set_drawing_preview(l.previewKind,o.x1,o.y1,s,M,r.r,r.g,r.b,r.lineWidth,r.dashed,i):o.step===2&&(l.previewFn==="fib_ext"?t.set_fib_ext_preview(o.x1,o.y1,o.x2,o.y2,s,M,r.r,r.g,r.b,r.lineWidth,r.dashed,i):t.set_channel_preview(o.x1,o.y1,o.x2,o.y2,s,M,r.r,r.g,r.b,r.lineWidth,r.dashed,i)):l.type==="2point"?t.set_drawing_preview(l.previewKind,o.x1,o.y1,s,M,r.r,r.g,r.b,r.lineWidth,r.dashed,i):l.type==="1point_x"?t.set_drawing_preview(l.previewKind,s,0,0,0,r.r,r.g,r.b,r.lineWidth,r.dashed,i):l.type==="1point_xp"||l.type==="1point_xy"?t.set_drawing_preview(l.previewKind,s,M,0,0,r.r,r.g,r.b,r.lineWidth,r.dashed,i):t.set_drawing_preview(l.previewKind,0,M,0,0,r.r,r.g,r.b,r.lineWidth,r.dashed,i)}}function le(t,e,o,s,M,r){if(s!=null&&M!=null){let c=e-s,u=o-M,p=Math.sqrt(c*c+u*u);if(p>1.5*1.2){let L=Math.min(128,Math.ceil(p/1.5));for(let S=1;S<L;S++){let E=S/L,C=s+c*E,F=M+u*E,{wx:b,wy:T}=at(t,C,F,r);t.add_brush_point(b,T)}}}let{wx:l,wy:n}=at(t,e,o,r);t.add_brush_point(l,n)}function at(t,e,o,s){let M=t.screen_to_world_x(e),r;switch(s){case 1:r=t.screen_to_rsi_y(o);break;case 2:r=t.screen_to_oi_y(o);break;case 3:r=t.screen_to_fr_y(o);break;case 4:r=t.screen_to_cvd_y(o);break;case 5:r=t.screen_to_vpin_y(o);break;case 6:r=t.screen_to_ob_flow_y(o);break;case 7:r=t.screen_to_agg_liq_y(o);break;case 8:r=t.screen_to_custom_pane_y(o);break;default:r=t.screen_to_world_y(o);break}return{wx:M,wy:r}}function Rt(t){return t===4?1:t===6?2:t===8?3:t===10?4:t===12?5:t===19?6:t===22?7:t===25?8:0}function qt(t){return t===4||t===6||t===8||t===10||t===12||t===19||t===22||t===25}function Ct(t){return t===14||t===15||t===16||t===17||t===18||t===21||t===24||t===27}function Et(t){return t===4||t===14?1:t===6||t===15?2:t===8||t===16?3:t===10||t===17?4:t===12||t===18?5:t===19||t===21?6:t===22||t===24?7:0}function jt(t,e,o,s){qt(e)?(t.pan(o,0),Math.abs(s)>.01&&e!==4&&t.pan_indicator_y(Et(e),s)):t.pan(o,s)}function yt(t){return t===0||t===4||t===6||t===8||t===10||t===12||t===22||t===25}function ar(t,e,o,s){t.addEventListener("wheel",c=>{if(s.disposed)return;c.preventDefault(),s.cancelMomentum();let u=c.deltaY>0?1.1:.9,p=e.hit_zone(c.offsetX,c.offsetY);p!==255&&(Ct(p)?p!==14&&e.zoom_indicator_y(Et(p),c.offsetY,u):qt(p)?p===4?e.zoom_x(c.offsetX,u):c.ctrlKey?e.zoom_indicator_y(Et(p),c.offsetY,u):e.zoom_x(c.offsetX,u):c.ctrlKey?e.zoom_y(c.offsetY,u):c.shiftKey||p===2?e.zoom_x(c.offsetX,u):p===3?e.zoom_y(c.offsetY,u):e.zoom(c.offsetX,c.offsetY,u),o.onDirty())},{passive:!1}),t.addEventListener("mousedown",c=>{if(s.disposed||c.button!==0)return;s.cancelMomentum(),r();let u=performance.now();if(u-s.lastClickTime<300){s.lastClickTime=u;return}if(s.lastClickTime=u,typeof e.is_in_quick_trade_btn=="function"&&e.is_in_quick_trade_btn(c.offsetX,c.offsetY)){s.qtbPending=!0;try{s.qtbWorldY=e.crosshair_world_y()}catch{s.qtbWorldY=0}return}let p=s.drawingMode;if(p){let S=e.hit_zone(c.offsetX,c.offsetY);if(!yt(S))return;let E=Rt(S),{wx:C,wy:F}=at(e,c.offsetX,c.offsetY,E),b=p.style,T=p.tool;if(Bt(T)){if(!p.pathStarted)p.pane=E,e.start_elliott_manual(b.r,b.g,b.b,b.lineWidth,E),e.add_elliott_manual_point(C,F),p.pathStarted=!0,p.step=1;else if(e.add_elliott_manual_point(C,F)){s.finishDrawing(),o.onDirty();return}}else if(zt(T))p.pathStarted?e.add_path_point(C,F):(p.pane=E,e.start_path(b.r,b.g,b.b,b.lineWidth,b.dashed,E),e.add_path_point(C,F),p.pathStarted=!0,p.step=1);else if(ae(T))p.pane=E,e.start_brush(b.r,b.g,b.b,b.lineWidth,E),e.add_brush_point(C,F),s.isBrushing=!0,s.brushLastSx=c.offsetX,s.brushLastSy=c.offsetY;else if(Dt(T))if(p.step===0)p.x1=C,p.y1=F,p.pane=E,p.step=1;else if(p.step===1)p.x2=C,p.y2=F,p.step=2,e.clear_drawing_preview();else{let v=At[T];v&&v.previewFn==="fib_ext"?e.clear_fib_ext_preview():e.clear_channel_preview(),Wt(e,T,p,C,F,b),s.finishDrawing()}else if(Jt(T))p.step===0?(p.x1=C,p.y1=F,p.pane=E,p.step=1):(Wt(e,T,p,C,F,b),s.finishDrawing());else{p.pane=E;let v=Wt(e,T,p,C,F,b);s.finishDrawing(),T==="textnote"&&v>0&&(e.select_drawing(v),o.onDrawingSelected?.(v),o.onDrawingDblClick?.(v,c.offsetX,c.offsetY,c.clientX,c.clientY))}o.onDirty();return}let L=e.hit_zone(c.offsetX,c.offsetY);if(L!==255){if(L===5){s.isResizingRsi=!0,s.resizeStartY=c.offsetY,s.resizeStartRatio=e.get_rsi_ratio(),t.style.cursor="ns-resize";return}if(L===7){s.isResizingOi=!0,s.resizeStartY=c.offsetY,s.resizeStartRatio=e.get_oi_ratio(),t.style.cursor="ns-resize";return}if(L===9){s.isResizingFr=!0,s.resizeStartY=c.offsetY,s.resizeStartRatio=e.get_fr_ratio(),t.style.cursor="ns-resize";return}if(L===11){s.isResizingCvd=!0,s.resizeStartY=c.offsetY,s.resizeStartRatio=e.get_cvd_ratio(),t.style.cursor="ns-resize";return}if(L===13){s.isResizingVpin=!0,s.resizeStartY=c.offsetY,s.resizeStartRatio=e.get_vpin_ratio(),t.style.cursor="ns-resize";return}if(L===20){s.isResizingObFlow=!0,s.resizeStartY=c.offsetY,s.resizeStartRatio=e.get_obf_ratio(),t.style.cursor="ns-resize";return}if(L===23){s.isResizingAggLiq=!0,s.resizeStartY=c.offsetY,s.resizeStartRatio=e.get_agg_liq_ratio(),t.style.cursor="ns-resize";return}if(yt(L)){let S=e.get_selected_drawing();if(S>0){let T=e.hit_test_drawing_anchor(c.offsetX,c.offsetY);if(T>=0){s.isDraggingAnchor=!0,s.dragAnchorIdx=T,s.dragAnchorPane=Rt(L),t.style.cursor="grabbing";return}if(e.hit_test_drawing(c.offsetX,c.offsetY)===S){s.isDraggingDrawing=!0,s.dragDrawingPane=Rt(L);let{wx:R,wy:y}=at(e,c.offsetX,c.offsetY,s.dragDrawingPane);s.dragDrawingLastWx=R,s.dragDrawingLastWy=y,t.style.cursor="move";return}}let E=e.hit_test_drawing(c.offsetX,c.offsetY);if(E>0){e.deselect_marker(),o.onMarkerSelected?.(0),e.select_drawing(E),o.onDrawingSelected?.(E),o.onDirty();return}let C=e.hit_test_marker(c.offsetX,c.offsetY);if(C>0){e.deselect_drawing(),o.onDrawingSelected?.(0),e.select_marker(C),o.onMarkerSelected?.(C),o.onDirty();return}let F=e.get_selected_drawing(),b=e.get_selected_marker();F>0&&(e.deselect_drawing(),o.onDrawingSelected?.(0),o.onDirty()),b>0&&(e.deselect_marker(),o.onMarkerSelected?.(0),o.onDirty())}yt(L)&&(s.liqPinSx=c.offsetX,s.liqPinSy=c.offsetY,s.liqPinTimer&&clearTimeout(s.liqPinTimer),s.liqPinTimer=setTimeout(()=>{s.liqPinTimer=null,o.onLiqAnnotationPin?.(s.liqPinSx,s.liqPinSy)},700)),s.isDragging=!0,s.dragZone=L,s.lastX=c.offsetX,s.lastY=c.offsetY,L===2?t.style.cursor="ew-resize":L===3||Ct(L)?t.style.cursor="ns-resize":t.style.cursor="grabbing"}});let M=null;function r(){M&&(cancelAnimationFrame(M),M=null)}function i(c,u){if(typeof e.is_in_quick_trade_btn=="function"&&e.is_in_quick_trade_btn(c,u)){t.style.cursor="pointer";return}let p=e.hover_hit_test(c,u),L=p[0],S=p[1],E=p[2],C=p[3],F=p[4],b=s.drawingMode;L===255?t.style.cursor="default":L===2?t.style.cursor="ew-resize":L===3||Ct(L)||L===5||L===7||L===9||L===11||L===13||L===20||L===23?t.style.cursor="ns-resize":!b&&yt(L)&&S>0&&E>=0?t.style.cursor="grab":!b&&yt(L)&&S>0&&C===S?t.style.cursor="move":!b&&yt(L)&&(C>0||F>0)?t.style.cursor="pointer":t.style.cursor="crosshair"}function l(c,u){let p=e.hit_zone(c,u);p===2||p===3||Ct(p)||p===255?e.hide_crosshair():e.set_crosshair(c,u),o.onDirty(),o.onCrosshairMove?.(c,u,p),o.onVrvpHover?.(c,u),s._pendingHoverX=c,s._pendingHoverY=u,M||(M=requestAnimationFrame(()=>{M=null,s.disposed||i(s._pendingHoverX,s._pendingHoverY)}))}t.addEventListener("mousemove",c=>{if(s.disposed)return;if(s.liqPinTimer){let p=Math.abs(c.offsetX-s.liqPinSx),L=Math.abs(c.offsetY-s.liqPinSy);(p>6||L>6)&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null)}if(s.isResizingRsi){let L=t.getBoundingClientRect().height-28,E=(s.resizeStartY-c.offsetY)/L,C=Math.max(.05,Math.min(.5,s.resizeStartRatio+E));e.set_rsi_ratio(C),o.onDirty();return}if(s.isResizingOi){let L=t.getBoundingClientRect().height-28,E=(s.resizeStartY-c.offsetY)/L,C=Math.max(.05,Math.min(.5,s.resizeStartRatio+E));e.set_oi_ratio(C),o.onDirty();return}if(s.isResizingFr){let L=t.getBoundingClientRect().height-28,E=(s.resizeStartY-c.offsetY)/L,C=Math.max(.05,Math.min(.5,s.resizeStartRatio+E));e.set_fr_ratio(C),o.onDirty();return}if(s.isResizingCvd){let L=t.getBoundingClientRect().height-28,E=(s.resizeStartY-c.offsetY)/L,C=Math.max(.05,Math.min(.5,s.resizeStartRatio+E));e.set_cvd_ratio(C),o.onDirty();return}if(s.isResizingVpin){let L=t.getBoundingClientRect().height-28,E=(s.resizeStartY-c.offsetY)/L,C=Math.max(.05,Math.min(.5,s.resizeStartRatio+E));e.set_vpin_ratio(C),o.onDirty();return}if(s.isResizingObFlow){let L=t.getBoundingClientRect().height-28,E=(s.resizeStartY-c.offsetY)/L,C=Math.max(.05,Math.min(.5,s.resizeStartRatio+E));e.set_obf_ratio(C),o.onDirty();return}if(s.isResizingAggLiq){let L=t.getBoundingClientRect().height-28,E=(s.resizeStartY-c.offsetY)/L,C=Math.max(.05,Math.min(.5,s.resizeStartRatio+E));e.set_agg_liq_ratio(C),o.onDirty();return}if(s.isDraggingAnchor){let{wx:p,wy:L}=at(e,c.offsetX,c.offsetY,s.dragAnchorPane);e.update_drawing_anchor(s.dragAnchorIdx,p,L),e.set_crosshair(c.offsetX,c.offsetY),o.onDirty(),o.onCrosshairMove?.(c.offsetX,c.offsetY,e.hit_zone(c.offsetX,c.offsetY));return}if(s.isDraggingDrawing){let{wx:p,wy:L}=at(e,c.offsetX,c.offsetY,s.dragDrawingPane),S=p-s.dragDrawingLastWx,E=L-s.dragDrawingLastWy;e.move_drawing(S,E),s.dragDrawingLastWx=p,s.dragDrawingLastWy=L,e.set_crosshair(c.offsetX,c.offsetY),o.onDirty(),o.onCrosshairMove?.(c.offsetX,c.offsetY,e.hit_zone(c.offsetX,c.offsetY));return}let u=s.drawingMode;if(s.isBrushing&&u){let p=u.pane||0;le(e,c.offsetX,c.offsetY,s.brushLastSx,s.brushLastSy,p),s.brushLastSx=c.offsetX,s.brushLastSy=c.offsetY,e.set_crosshair(c.offsetX,c.offsetY),o.onDirty();return}if(u&&Bt(u.tool)&&u.pathStarted){let p=u.pane||0,{wx:L,wy:S}=at(e,c.offsetX,c.offsetY,p);e.set_elliott_manual_cursor(L,S),e.set_crosshair(c.offsetX,c.offsetY);let E=e.hit_zone(c.offsetX,c.offsetY);o.onDirty(),o.onCrosshairMove?.(c.offsetX,c.offsetY,E);return}if(u&&zt(u.tool)&&u.pathStarted){let p=u.pane||0,{wx:L,wy:S}=at(e,c.offsetX,c.offsetY,p);e.set_path_cursor(L,S),e.set_crosshair(c.offsetX,c.offsetY);let E=e.hit_zone(c.offsetX,c.offsetY);o.onDirty(),o.onCrosshairMove?.(c.offsetX,c.offsetY,E);return}if(u&&u.step>0){let p=u.pane||0,{wx:L,wy:S}=at(e,c.offsetX,c.offsetY,p);It(e,u.tool,u,L,S,u.style,p),e.set_crosshair(c.offsetX,c.offsetY);let E=e.hit_zone(c.offsetX,c.offsetY);o.onDirty(),o.onCrosshairMove?.(c.offsetX,c.offsetY,E);return}if(u&&Gt(u.tool)){let p=e.hit_zone(c.offsetX,c.offsetY),L=Rt(p),{wx:S,wy:E}=at(e,c.offsetX,c.offsetY,L);It(e,u.tool,u,S,E,u.style,L),e.set_crosshair(c.offsetX,c.offsetY),o.onDirty(),o.onCrosshairMove?.(c.offsetX,c.offsetY,p);return}if(s.isDragging){let p=c.offsetX-s.lastX,L=c.offsetY-s.lastY;s.lastX=c.offsetX,s.lastY=c.offsetY,(p!==0||L!==0)&&(s.isPanning=!0),s.dragZone===2?e.pan_x(p):s.dragZone===3?e.pan_y(L):s.dragZone===14||(Ct(s.dragZone)?e.pan_indicator_y(Et(s.dragZone),L):jt(e,s.dragZone,p,L)),e.set_crosshair(c.offsetX,c.offsetY),o.onDirty(),o.onCrosshairMove?.(c.offsetX,c.offsetY,s.dragZone),o.onVrvpHover?.(c.offsetX,c.offsetY);return}l(c.offsetX,c.offsetY)}),t.addEventListener("mouseup",c=>{if(!s.disposed){if(s.qtbPending){if(s.qtbPending=!1,c&&typeof e.is_in_quick_trade_btn=="function"&&e.is_in_quick_trade_btn(c.offsetX,c.offsetY)){let p=Number(s.qtbWorldY)||0;p>0&&o.onQuickTradeBtnClick?.(p,c.offsetX,c.offsetY)}s.qtbWorldY=0;return}s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isBrushing&&(s.isBrushing=!1,s.brushLastSx=null,s.brushLastSy=null,e.finish_brush(),s.finishDrawing(),o.onDirty()),s.isDragging=!1,s.isPanning=!1,s.isResizingRsi=!1,s.isResizingOi=!1,s.isResizingFr=!1,s.isResizingCvd=!1,s.isResizingVpin=!1,s.isResizingObFlow=!1,s.isResizingAggLiq=!1,s.isDraggingAnchor=!1,s.isDraggingDrawing=!1,s.dragAnchorIdx=-1,t.style.cursor="crosshair"}});function n(){s.disposed||s._leaveHandled||(s._leaveHandled=!0,requestAnimationFrame(()=>{s._leaveHandled=!1}),r(),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isBrushing&&(s.isBrushing=!1,s.brushLastSx=null,s.brushLastSy=null,e.finish_brush(),s.finishDrawing()),s.isDragging=!1,s.isPanning=!1,s.isResizingRsi=!1,s.isResizingOi=!1,s.isResizingFr=!1,s.isResizingCvd=!1,s.isResizingVpin=!1,s.isResizingObFlow=!1,s.isResizingAggLiq=!1,s.isDraggingAnchor=!1,s.isDraggingDrawing=!1,s.dragAnchorIdx=-1,s.qtbPending=!1,s.qtbWorldY=0,e.hide_crosshair(),t.style.cursor="crosshair",o.onDirty(),o.onCrosshairHide?.(),o.onVrvpHover?.(null,null))}t.addEventListener("pointerleave",n),t.addEventListener("mouseleave",n),t.addEventListener("dblclick",c=>{if(s.disposed)return;c.preventDefault(),c.stopPropagation();let u=s.drawingMode;if(u&&Bt(u.tool)&&u.pathStarted){e.finish_elliott_manual(),s.finishDrawing(),o.onDirty();return}if(u&&zt(u.tool)&&u.pathStarted){e.finish_path(),s.finishDrawing(),o.onDirty();return}if(u)return;let p=e.hit_zone(c.offsetX,c.offsetY),L=e.hit_test_drawing(c.offsetX,c.offsetY);if(L>0){e.select_drawing(L),o.onDirty(),o.onDrawingDblClick?.(L,c.offsetX,c.offsetY,c.clientX,c.clientY);return}if(qt(p)||Ct(p)){e.reset_indicator_y_auto(Et(p)),o.onDirty();return}(p===0||p===1)&&o.onChartDblClick?.(c.offsetX,c.offsetY,c.clientX,c.clientY)}),t.addEventListener("contextmenu",c=>{if(s.disposed)return;let u=s.drawingMode;if(u&&Bt(u.tool)&&u.pathStarted){c.preventDefault(),c.stopPropagation(),e.finish_elliott_manual(),s.finishDrawing(),o.onDirty();return}if(u&&zt(u.tool)&&u.pathStarted){c.preventDefault(),c.stopPropagation(),e.finish_path(),s.finishDrawing(),o.onDirty();return}})}var ce=25;function lr(t,e,o,s){t.addEventListener("touchstart",M=>{if(!s.disposed){if(M.preventDefault(),s.cancelMomentum(),M.touches.length===2){clearTimeout(s.longPressTimer),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isCrosshairMode=!1,s.pinchActive=!0,s.lastTapTime=0;let r=t.getBoundingClientRect(),i=M.touches[1].clientX-M.touches[0].clientX,l=M.touches[1].clientY-M.touches[0].clientY;if(s.lastTouchDist=Math.sqrt(i*i+l*l),s.lastX=(M.touches[0].clientX+M.touches[1].clientX)/2-r.left,s.lastY=(M.touches[0].clientY+M.touches[1].clientY)/2-r.top,s.dragZone=e.hit_zone(s.lastX,s.lastY),s.pinchAnchorY=s.lastY,s.dragZone===255){s.pinchActive=!1,s.lastTouchDist=0;return}}else if(M.touches.length===1){let r=t.getBoundingClientRect(),i=M.touches[0].clientX-r.left,l=M.touches[0].clientY-r.top;s.touchStartX=i,s.touchStartY=l,s.touchMoved=!1;let n=s.drawingMode;if(n){let S=e.hit_zone(i,l);if(yt(S)){let E=Rt(S),{wx:C,wy:F}=at(e,i,l,E),b=n.tool;if(Bt(b)){if(!n.pathStarted)n.pane=E,e.start_elliott_manual(n.style.r,n.style.g,n.style.b,n.style.lineWidth,E),e.add_elliott_manual_point(C,F),n.pathStarted=!0,n.step=1;else if(e.add_elliott_manual_point(C,F)){s.finishDrawing(),o.onDirty();return}}else zt(b)?n.pathStarted?e.add_path_point(C,F):(n.pane=E,e.start_path(n.style.r,n.style.g,n.style.b,n.style.lineWidth,n.style.dashed,E),e.add_path_point(C,F),n.pathStarted=!0,n.step=1):ae(b)?(n.pane=E,e.start_brush(n.style.r,n.style.g,n.style.b,n.style.lineWidth,E),e.add_brush_point(C,F),s.isBrushing=!0,s.brushLastSx=i,s.brushLastSy=l):Dt(b)?n.step===0?(n.x1=C,n.y1=F,n.pane=E,n.step=1,n._stepAtTouchStart=0,It(e,b,n,C,F,n.style,E)):n.step===1?(n._stepAtTouchStart=1,It(e,b,n,C,F,n.style,n.pane)):(n._stepAtTouchStart=2,It(e,b,n,C,F,n.style,n.pane)):Jt(b)?n.step===0?(n.x1=C,n.y1=F,n.pane=E,n.step=1,n._stepAtTouchStart=0,It(e,b,n,C,F,n.style,E)):(n._stepAtTouchStart=1,It(e,b,n,C,F,n.style,n.pane)):Gt(b)?(n.pane=E,It(e,b,n,C,F,n.style,E)):(n.pane=E,Wt(e,b,n,C,F,n.style),s.finishDrawing());e.set_crosshair(i,l),o.onDirty(),o.onCrosshairMove?.(i,l,S)}return}let c=e.hover_hit_test(i,l),u=c[0],p=c[1],L=c[2];if(u===255)return;if(yt(u)&&!s.drawingMode&&p>0){if(L>=0){s.isDraggingAnchor=!0,s.dragAnchorIdx=L,s.dragAnchorPane=Rt(u);return}if(c[3]===p){s.isDraggingDrawing=!0,s.dragDrawingPane=Rt(u);let{wx:E,wy:C}=at(e,i,l,s.dragDrawingPane);s.dragDrawingLastWx=E,s.dragDrawingLastWy=C;return}}s.isDragging=!0,s.isCrosshairMode=!1,s.lastX=i,s.lastY=l,s.dragZone=u,clearTimeout(s.longPressTimer),s.longPressTimer=setTimeout(()=>{s.isDragging&&!s.touchMoved&&(s.isCrosshairMode=!0,e.set_crosshair(i,l),o.onDirty(),o.onCrosshairMove?.(i,l,s.dragZone),o.onVrvpHover?.(i,l))},300),yt(s.dragZone)&&(s.liqPinSx=i,s.liqPinSy=l,s.liqPinTimer&&clearTimeout(s.liqPinTimer),s.liqPinTimer=setTimeout(()=>{s.liqPinTimer=null,s.touchMoved||o.onLiqAnnotationPin?.(s.liqPinSx,s.liqPinSy)},700))}}},{passive:!1}),t.addEventListener("touchmove",M=>{if(s.disposed)return;M.preventDefault();let r=t.getBoundingClientRect();if(s.isDraggingAnchor&&M.touches.length===1){let l=M.touches[0].clientX-r.left,n=M.touches[0].clientY-r.top,{wx:c,wy:u}=at(e,l,n,s.dragAnchorPane);e.update_drawing_anchor(s.dragAnchorIdx,c,u),e.set_crosshair(l,n),o.onDirty();return}if(s.isDraggingDrawing&&M.touches.length===1){let l=M.touches[0].clientX-r.left,n=M.touches[0].clientY-r.top;s.touchMoved=!0;let{wx:c,wy:u}=at(e,l,n,s.dragDrawingPane),p=c-s.dragDrawingLastWx,L=u-s.dragDrawingLastWy;e.move_drawing(p,L),s.dragDrawingLastWx=c,s.dragDrawingLastWy=u,e.set_crosshair(l,n),o.onDirty();return}let i=s.drawingMode;if(s.isBrushing&&i&&M.touches.length===1){let l=M.touches[0].clientX-r.left,n=M.touches[0].clientY-r.top,c=i.pane||0;le(e,l,n,s.brushLastSx,s.brushLastSy,c),s.brushLastSx=l,s.brushLastSy=n,e.set_crosshair(l,n),o.onDirty(),s.touchMoved=!0;return}if(i&&Bt(i.tool)&&i.pathStarted&&M.touches.length===1){let l=M.touches[0].clientX-r.left,n=M.touches[0].clientY-r.top,c=i.pane||0,{wx:u,wy:p}=at(e,l,n,c);e.set_elliott_manual_cursor(u,p),e.set_crosshair(l,n),o.onDirty(),s.touchMoved=!0;return}if(i&&zt(i.tool)&&i.pathStarted&&M.touches.length===1){let l=M.touches[0].clientX-r.left,n=M.touches[0].clientY-r.top,c=i.pane||0,{wx:u,wy:p}=at(e,l,n,c);e.set_path_cursor(u,p),e.set_crosshair(l,n),o.onDirty(),s.touchMoved=!0;return}if(i&&i.step>0&&M.touches.length===1){let l=M.touches[0].clientX-r.left,n=M.touches[0].clientY-r.top;!s.touchMoved&&(Math.abs(l-s.touchStartX)>ce||Math.abs(n-s.touchStartY)>ce)&&(s.touchMoved=!0);let c=i.pane||0,{wx:u,wy:p}=at(e,l,n,c);It(e,i.tool,i,u,p,i.style,c),e.set_crosshair(l,n);let L=e.hit_zone(l,n);o.onDirty(),o.onCrosshairMove?.(l,n,L);return}if(i&&Gt(i.tool)&&M.touches.length===1){let l=M.touches[0].clientX-r.left,n=M.touches[0].clientY-r.top,c=e.hit_zone(l,n),u=Rt(c),{wx:p,wy:L}=at(e,l,n,u);It(e,i.tool,i,p,L,i.style,u),e.set_crosshair(l,n),o.onDirty(),o.onCrosshairMove?.(l,n,c);return}if(M.touches.length===2){if(s.dragZone===255)return;s.velSamples=[],s.pinchActive=!0;let l=M.touches[1].clientX-M.touches[0].clientX,n=M.touches[1].clientY-M.touches[0].clientY,c=Math.sqrt(l*l+n*n),u=s.lastTouchDist/c,p=(M.touches[0].clientX+M.touches[1].clientX)/2-r.left,L=(M.touches[0].clientY+M.touches[1].clientY)/2-r.top,S=s.pinchAnchorY??L;s.dragZone===3?e.zoom_y(S,u):Ct(s.dragZone)&&s.dragZone!==14?e.zoom_indicator_y(Et(s.dragZone),S,u):s.dragZone===14?(e.zoom_x(p,u),jt(e,4,p-s.lastX,L-s.lastY)):s.dragZone===2?e.zoom_x(p,u):qt(s.dragZone)?(e.zoom_x(p,u),jt(e,s.dragZone,p-s.lastX,L-s.lastY)):(e.zoom(p,L,u),jt(e,s.dragZone,p-s.lastX,L-s.lastY)),s.lastTouchDist=c,s.lastX=p,s.lastY=L,o.onDirty()}else if(M.touches.length===1&&s.isDragging){let l=M.touches[0].clientX-r.left,n=M.touches[0].clientY-r.top,c=l-s.lastX,u=n-s.lastY;if(!s.touchMoved&&(Math.abs(l-s.touchStartX)>ce||Math.abs(n-s.touchStartY)>ce)&&(s.touchMoved=!0,s.isCrosshairMode||clearTimeout(s.longPressTimer),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null)),s.isCrosshairMode)e.set_crosshair(l,n),o.onDirty(),o.onCrosshairMove?.(l,n,s.dragZone),o.onVrvpHover?.(l,n);else if(s.touchMoved){if(s.isPanning=!0,s.lastX=l,s.lastY=n,s.dragZone===3||Ct(s.dragZone)||s.recordVelocity(c,u),s.dragZone===2)e.pan_x(c);else if(s.dragZone===3){let L=Math.pow(1.005,u);e.zoom_y(s.touchStartY,L)}else if(s.dragZone!==14)if(Ct(s.dragZone)){let L=Math.pow(1.005,u);e.zoom_indicator_y(Et(s.dragZone),s.touchStartY,L)}else jt(e,s.dragZone,c,u);o.onDirty()}else s.lastX=l,s.lastY=n}},{passive:!1}),t.addEventListener("touchend",M=>{if(s.disposed)return;if(clearTimeout(s.longPressTimer),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isDraggingAnchor){s.isDraggingAnchor=!1,s.dragAnchorIdx=-1,e.hide_crosshair(),o.onDirty(),o.onCrosshairHide?.();return}if(s.isDraggingDrawing){if(s.isDraggingDrawing=!1,e.hide_crosshair(),o.onDirty(),o.onCrosshairHide?.(),!s.touchMoved){let n=e.get_selected_drawing();if(n>0){let c=t.getBoundingClientRect();o.onDrawingDblClick?.(n,s.touchStartX,s.touchStartY,s.touchStartX+c.left,s.touchStartY+c.top)}}return}if(s.isBrushing){s.isBrushing=!1,s.brushLastSx=null,s.brushLastSy=null,e.finish_brush(),s.finishDrawing(),o.onDirty(),o.onCrosshairHide?.();return}let r=s.drawingMode;if(r&&Bt(r.tool)&&r.pathStarted){let n=Date.now(),c=s.touchStartX-(s._pathLastTapX||0),u=s.touchStartY-(s._pathLastTapY||0),p=Math.sqrt(c*c+u*u);n-(s._pathLastTapTime||0)<350&&p<30?(e.finish_elliott_manual(),s.finishDrawing(),s._pathLastTapTime=0):(s._pathLastTapTime=n,s._pathLastTapX=s.touchStartX,s._pathLastTapY=s.touchStartY),s.isDragging=!1,s.lastTouchDist=0,o.onDirty();return}if(r&&zt(r.tool)&&r.pathStarted){let n=Date.now(),c=s.touchStartX-(s._pathLastTapX||0),u=s.touchStartY-(s._pathLastTapY||0),p=Math.sqrt(c*c+u*u);n-(s._pathLastTapTime||0)<350&&p<30?(e.finish_path(),s.finishDrawing(),s._pathLastTapTime=0):(s._pathLastTapTime=n,s._pathLastTapX=s.touchStartX,s._pathLastTapY=s.touchStartY),s.isDragging=!1,s.lastTouchDist=0,o.onDirty();return}if(r&&Dt(r.tool)){let n=r._stepAtTouchStart;if(r.step===1&&(n===1||s.touchMoved)){let c=t.getBoundingClientRect(),u=M.changedTouches?.[0];if(u){let p=u.clientX-c.left,L=u.clientY-c.top,S=r.pane||0,{wx:E,wy:C}=at(e,p,L,S);r.x2=E,r.y2=C,r.step=2,e.clear_drawing_preview()}}else if(r.step===2&&(n===2||s.touchMoved)){let c=t.getBoundingClientRect(),u=M.changedTouches?.[0];if(u){let p=u.clientX-c.left,L=u.clientY-c.top,S=r.pane||0,{wx:E,wy:C}=at(e,p,L,S),F=At[r.tool];F&&F.previewFn==="fib_ext"?e.clear_fib_ext_preview():e.clear_channel_preview(),Wt(e,r.tool,r,E,C,r.style),s.finishDrawing()}}s.isDragging=!1,s.lastTouchDist=0,s.drawingMode||(e.hide_crosshair(),o.onCrosshairHide?.()),o.onDirty();return}if(r&&r.step===1&&Jt(r.tool)){if(r._stepAtTouchStart===1||s.touchMoved){let c=t.getBoundingClientRect(),u=M.changedTouches?.[0];if(u){let p=u.clientX-c.left,L=u.clientY-c.top,S=r.pane||0,{wx:E,wy:C}=at(e,p,L,S);Wt(e,r.tool,r,E,C,r.style),s.finishDrawing()}}s.isDragging=!1,s.lastTouchDist=0,s.drawingMode||(e.hide_crosshair(),o.onCrosshairHide?.()),o.onDirty();return}if(r&&Gt(r.tool)){let n=t.getBoundingClientRect(),c=M.changedTouches?.[0];if(c){let u=c.clientX-n.left,p=c.clientY-n.top,L=e.hit_zone(u,p),S=yt(L)?Rt(L):r.pane||0,{wx:E,wy:C}=at(e,u,p,S),F=r.tool;e.clear_drawing_preview();let b=Wt(e,F,r,E,C,r.style);s.finishDrawing(),F==="textnote"&&b>0&&(e.select_drawing(b),o.onDrawingSelected?.(b),o.onDrawingDblClick?.(b,u,p,u+n.left,p+n.top))}s.isDragging=!1,s.lastTouchDist=0,e.hide_crosshair(),o.onCrosshairHide?.(),o.onDirty();return}let i=M.touches.length===0;if(i&&!s.pinchActive&&!s.touchMoved&&!s.drawingMode){let n=Date.now(),c=s.touchStartX,u=s.touchStartY,p=c-s.lastTapX,L=u-s.lastTapY,S=Math.sqrt(p*p+L*L),E=n-s.lastTapTime<350&&S<30,C=e.hit_zone(c,u),F=E?e.hit_test_drawing(c,u):0;if(E&&(qt(C)||Ct(C))&&F<=0)e.reset_indicator_y_auto(Et(C)),o.onDirty();else if(yt(C)){let b=e.get_selected_drawing(),T=F>0?F:e.hit_test_drawing(c,u),v=0;if(T<=0&&(v=e.hit_test_marker(c,u)),T>0){e.deselect_marker(),o.onMarkerSelected?.(0),e.select_drawing(T);let R=t.getBoundingClientRect(),y=c+R.left,O=u+R.top;o.onDrawingSelected?.(T,y,O),(b<=0||b===T)&&o.onDrawingDblClick?.(T,c,u,y,O),o.onDirty()}else if(v>0)e.deselect_drawing(),o.onDrawingSelected?.(0),e.select_marker(v),o.onMarkerSelected?.(v),o.onDirty();else if(b>0&&(e.deselect_drawing(),o.onDrawingSelected?.(0),o.onDirty()),e.get_selected_marker()>0&&(e.deselect_marker(),o.onMarkerSelected?.(0),o.onDirty()),E&&C===0){let y=t.getBoundingClientRect();o.onChartDblClick?.(c,u,c+y.left,u+y.top)}}s.lastTapTime=n,s.lastTapX=c,s.lastTapY=u}i&&!s.pinchActive&&s.touchMoved&&!s.isCrosshairMode&&!s.drawingMode&&s.dragZone!==3&&!Ct(s.dragZone)&&s.startMomentum(s.dragZone),s.isDragging=!1,s.isPanning=!1,s.isCrosshairMode=!1,s.lastTouchDist=0,i&&(s.pinchActive=!1),(!s.drawingMode||s.drawingMode.step===0)&&(e.hide_crosshair(),o.onCrosshairHide?.()),o.onDirty(),o.onVrvpHover?.(null,null)}),t.addEventListener("touchcancel",()=>{clearTimeout(s.longPressTimer),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isDragging=!1,s.isPanning=!1,s.isDraggingAnchor=!1,s.isDraggingDrawing=!1,s.isBrushing=!1,s.brushLastSx=null,s.brushLastSy=null,s.isCrosshairMode=!1,s.lastTouchDist=0,s.pinchActive=!1,s.cancelMomentum(),e.hide_crosshair(),o.onCrosshairHide?.(),o.onDirty()})}function Me(t,e,o){let s={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,pinchActive:!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},M=!1;Object.defineProperty(s,"isPanning",{get(){return M},set(p){let L=!!p;L!==M&&(M=L,L?o.onPanStart?.():o.onPanEnd?.())}});let r=.92,i=.5,l=80;s.recordVelocity=function(p,L){let S=performance.now();for(s.velSamples.push({dx:p,dy:L,t:S});s.velSamples.length>0&&S-s.velSamples[0].t>l;)s.velSamples.shift()};function n(){if(s.velSamples.length<2)return{vx:0,vy:0};let p=s.velSamples[0],S=s.velSamples[s.velSamples.length-1].t-p.t;if(S<5)return{vx:0,vy:0};let E=0,C=0;for(let b of s.velSamples)E+=b.dx,C+=b.dy;let F=16.67;return{vx:E/S*F,vy:C/S*F}}s.cancelMomentum=function(){s.momentumRaf&&(cancelAnimationFrame(s.momentumRaf),s.momentumRaf=null),s.velSamples=[]},s.startMomentum=function(p){let{vx:L,vy:S}=n();if(s.velSamples=[],Math.abs(L)<i&&Math.abs(S)<i)return;s.momentumVx=L,s.momentumVy=S,s.momentumZone=p;function E(){if(s.momentumVx*=r,s.momentumVy*=r,Math.abs(s.momentumVx)<i&&Math.abs(s.momentumVy)<i){s.momentumRaf=null;return}if(s.momentumZone===2)e.pan_x(s.momentumVx);else if(s.momentumZone===3)e.pan_y(s.momentumVy);else if(s.momentumZone===14){s.momentumRaf=null;return}else Ct(s.momentumZone)?e.pan_indicator_y(Et(s.momentumZone),s.momentumVy):jt(e,s.momentumZone,s.momentumVx,s.momentumVy);o.onDirty(),s.momentumRaf=requestAnimationFrame(E)}s.momentumRaf=requestAnimationFrame(E)};let c={setMode(p,L){p?(s.drawingMode={tool:p,style:L,step:0,x1:0,y1:0},t.style.cursor="crosshair"):(s.drawingMode?.pathStarted&&e.finish_path(),s.drawingMode=null,e.clear_drawing_preview(),t.style.cursor="crosshair"),o.onDirty()},getMode(){return s.drawingMode}};o.drawingApi?.(c),s.finishDrawing=function(){e.clear_drawing_preview(),o.onDrawingComplete?.(),s.drawingMode=null,t.style.cursor="crosshair"},ar(t,e,o,s),lr(t,e,o,s);let u=p=>{let L=document.activeElement?.tagName,S=L==="INPUT"||L==="TEXTAREA"||document.activeElement?.isContentEditable;if((p.key==="Delete"||p.key==="Backspace")&&!s.drawingMode&&!S){let C=e.get_selected_drawing();if(C>0){e.remove_drawing(C),o.onDrawingSelected?.(0),o.onDirty();return}let F=e.get_selected_marker();if(F>0){e.remove_marker(F),o.onMarkerSelected?.(0),o.onDirty();return}}if(p.key==="Escape"&&!s.drawingMode){if(e.get_selected_drawing()>0){e.deselect_drawing(),o.onDrawingSelected?.(0),o.onDirty();return}if(e.get_selected_marker()>0){e.deselect_marker(),o.onMarkerSelected?.(0),o.onDirty();return}}if(p.key==="Escape"&&s.drawingMode){if(s.drawingMode.pathStarted){s.drawingMode.tool==="elliott"?e.finish_elliott_manual():e.finish_path(),s.finishDrawing(),o.onDirty();return}e.clear_drawing_preview(),s.drawingMode=null,t.style.cursor="crosshair",o.onDrawingCancel?.(),o.onDirty();return}if(S)return;let E=20;switch(p.key){case"+":case"=":e.zoom(t.width/2,t.height/2,.9);break;case"-":e.zoom(t.width/2,t.height/2,1.1);break;case"ArrowLeft":e.pan_x(E);break;case"ArrowRight":e.pan_x(-E);break;case"ArrowUp":e.pan_y(-E);break;case"ArrowDown":e.pan_y(E);break;case"r":case"R":e.auto_scale_y();for(let C=1;C<=5;C++)e.reset_indicator_y_auto(C);break;default:return}o.onDirty()};return window.addEventListener("keydown",u),()=>{s.disposed=!0,s.cancelMomentum(),window.removeEventListener("keydown",u)}}var Zt=t=>t instanceof Float64Array?t:new Float64Array(t),cr=(t,e=0)=>{if(t==null||t==="")return e;if(typeof t=="number")return(t|0)&255;switch(String(t).toLowerCase()){case"bull":return 0;case"bear":return 1;case"neutral":return 2;case"all":return 255;default:return e}},Qr=(t,e=255)=>{if(t==null||t==="")return e;if(typeof t=="number")return(t|0)&255;switch(String(t).toLowerCase()){case"offside_buy":return 0;case"offside_sell":return 1;case"distribution":return 2;case"accumulation":return 3;case"absorption":return 4;default:return e}},$r=(t,e=0)=>{if(t==null||t==="")return e;if(typeof t=="number")return(t|0)&255;switch(String(t).toLowerCase()){case"wick":return 0;case"close":return 1;case"all":return 255;default:return e}};function _r(t,e,o,s){let M=r=>s()(r);return{enableRsi(){t.enable_rsi(),e()},disableRsi(){t.disable_rsi(),e()},setRsiPeriod(r){t.set_rsi_period(r),e()},isRsiEnabled(){return t.is_rsi_enabled()},setRsiShowEma(r){t.set_rsi_show_ema(r),e()},setRsiShowWma(r){t.set_rsi_show_wma(r),e()},setRsiShowSignals(r){t.set_rsi_show_signals(r),e()},setRsiShowDivergence(r){t.set_rsi_show_divergence(r),e()},setRsiShowTraps(r){t.set_rsi_show_traps(r),e()},setRsiShowLevels(r){t.set_rsi_show_levels(r),e()},setRsiShowOnChart(r){t.set_rsi_show_on_chart(r),e()},setRsiSmoothing(r){t.set_rsi_smoothing(r),e()},setRsiRatio(r){t.set_rsi_ratio(r),e()},getRsiRatio(){return t.get_rsi_ratio()},enableForexSignals(){M("forexSignals")&&(t.enable_forex_signals(),e())},disableForexSignals(){t.disable_forex_signals(),e()},isForexSignalsEnabled(){return t.is_forex_signals_enabled()},setForexSignalsSetup(r){t.set_forex_signals_setup(r),e()},setForexSignalsMode(r){t.set_forex_signals_mode(r),e()},setForexSignalsShowStats(r){t.set_forex_signals_show_stats(r),e()},getForexSignalsCount(){return t.get_forex_signals_count()},enableOi(){o()||M("oi")&&(t.enable_oi(),e())},disableOi(){o()||(t.disable_oi(),e())},isOiEnabled(){if(o())return!1;try{return t.is_oi_enabled()}catch{return!1}},setOiData(r){o()||(t.set_oi_data(r),e())},setOiDataTs(r,i){o()||(t.set_oi_data_ts(r,i),e())},setOiShowOnChart(r){o()||(t.set_oi_show_on_chart(r),e())},setOiShowSpike(r){o()||(t.set_oi_show_spike(r),e())},setOiSpikeTextSize(r){if(o())return;let i=Number(r);Number.isFinite(i)&&(t.set_oi_spike_text_size(i),e())},setOiDisplayMode(r){o()||(t.set_oi_display_mode(r),e())},setOiRatio(r){o()||(t.set_oi_ratio(r),e())},getOiRatio(){if(o())return .2;try{return t.get_oi_ratio()}catch{return .2}},enableFundingRate(){o()||M("fundingRate")&&(t.enable_funding_rate(),e())},disableFundingRate(){o()||(t.disable_funding_rate(),e())},isFundingRateEnabled(){if(o())return!1;try{return t.is_funding_rate_enabled()}catch{return!1}},setFrBinanceData(r,i){o()||(t.set_fr_binance_data(r,i),e())},setFrAggData(r,i){o()||(t.set_fr_agg_data(r,i),e())},setFrShowAgg(r){o()||(t.set_fr_show_agg(r),e())},setFrShowSma(r){o()||(t.set_fr_show_sma(r),e())},setFrDisplayStyle(r){if(o())return;let i=Number(r),l=Number.isFinite(i)?Math.max(0,Math.min(3,Math.trunc(i))):0;t.set_fr_display_style(l),e()},getFrDisplayStyle(){if(o())return 0;try{return t.get_fr_display_style()}catch{return 0}},clearFrData(){o()||(t.clear_fr_data(),e())},enableCvd(){o()||M("cvd")&&(t.enable_cvd(),e())},disableCvd(){o()||(t.disable_cvd(),e())},isCvdEnabled(){if(o())return!1;try{return t.is_cvd_enabled()}catch{return!1}},setCvdData(r,i){o()||(t.set_cvd_data(r,i),e())},setCvdSpotData(r,i){o()||(t.set_cvd_spot_data(r,i),e())},setCvdSource(r){o()||(t.set_cvd_source(r),e())},getCvdSource(){if(o())return 0;try{return t.get_cvd_source()}catch{return 0}},setCvdMode(r){o()||(t.set_cvd_mode(r),e())},getCvdMode(){if(o())return 0;try{return t.get_cvd_mode()}catch{return 0}},setCvdShowDelta(r){o()||(t.set_cvd_show_delta(r),e())},getCvdShowDelta(){if(o())return!0;try{return t.get_cvd_show_delta()}catch{return!0}},setCvdShowSignals(r){o()||(t.set_cvd_show_signals(r),e())},getCvdShowSignals(){if(o())return!0;try{return t.get_cvd_show_signals()}catch{return!0}},setCvdShowDivergence(r){o()||(t.set_cvd_show_divergence(r),e())},getCvdShowDivergence(){if(o())return!1;try{return t.get_cvd_show_divergence()}catch{return!1}},enableLargeTrades(){o()||M("largeTrades")&&(t.enable_large_trades(),e())},disableLargeTrades(){o()||(t.disable_large_trades(),e())},isLargeTradesEnabled(){if(o())return!1;try{return t.is_large_trades_enabled()}catch{return!1}},setLargeTradesData(r){o()||(t.set_large_trades_data(r),e())},pushLargeTrade(r,i,l,n){o()||(t.push_large_trade(r,i,l,n),e())},clearLargeTrades(){o()||(t.clear_large_trades(),e())},setLtVolumeFilter(r,i){o()||(t.set_lt_volume_filter(r,i),e())},setLtBubbleScale(r){o()||(t.set_lt_bubble_scale(r),e())},setLtBubbleStyle(r){if(o())return;let l=Number(r)===1?1:0;t.set_lt_bubble_style(l),e()},getLtDataMinVol(){return o()?0:t.get_lt_data_min_vol()},getLtDataMaxVol(){return o()?0:t.get_lt_data_max_vol()},ltHitTest(r,i){if(o())return"";try{return t.lt_hit_test(r,i)}catch{return""}},enableVrvp(){o()||M("vrvp")&&(t.enable_vrvp(),e())},disableVrvp(){o()||(t.disable_vrvp(),e())},isVrvpEnabled(){if(o())return!1;try{return t.is_vrvp_enabled()}catch{return!1}},setVrvpPocLine(r){o()||(t.set_vrvp_poc_line(r),e())},setVrvpData(r,i){o()||(t.set_vrvp_data(r,i),e())},vrvpHitTest(r,i){if(o())return"";try{return t.vrvp_hit_test(r,i)}catch{return""}},setVrvpSignalsEnabled(r){o()||(t.set_vrvp_signals_enabled(!!r),e())},isVrvpSignalsEnabled(){if(o())return!1;try{return t.is_vrvp_signals_enabled()}catch{return!1}},setVrvpSignalKinds(r){if(o())return;let i=(Number(r)|0)&255;t.set_vrvp_signal_kinds(i>>>0),e()},setVrvpSignalThresholds(r){if(o()||!r)return;let i=(l,n)=>{let c=Number(l);return Number.isFinite(c)?c:n};t.set_vrvp_signal_thresholds(i(r.vaPct,70),i(r.hvnThreshold,.55),i(r.hvnMinSpacing,6)>>>0,i(r.pocDistancePct,.6),i(r.vaBreakoutVolMult,1.5),i(r.hvnImbalancePct,65),i(r.cooldownBars,5)>>>0),e()},setVrvpSignalTpSl(r){if(o()||!r)return;let i=(l,n)=>{let c=Number(l);return Number.isFinite(c)?c:n};t.set_vrvp_signal_tpsl((Number(r.mode)|0)&1,i(r.atrPeriod,14)>>>0,i(r.atrSlMult,1.5),i(r.atrTpMult,3)),e()},setVrvpSignalShowLabels(r){o()||(t.set_vrvp_signal_show_labels(!!r),e())},getVrvpEvents(){if(o())return[];try{let r=t.get_vrvp_events_json();return r?JSON.parse(r):[]}catch{return[]}},vrvpSignalHitTest(r,i){if(o())return"";try{return t.vrvp_signal_hit_test(r,i)}catch{return""}},enableCvdProfile(){o()||M("cvdProfile")&&(t.enable_cvd_profile(),e())},disableCvdProfile(){o()||(t.disable_cvd_profile(),e())},isCvdProfileEnabled(){if(o())return!1;try{return t.is_cvd_profile_enabled()}catch{return!1}},setCvdProfileSessions(r){o()||(t.set_cvd_profile_sessions(Zt(r)),e())},applyCvdProfileUpdate(r,i,l,n){o()||(t.apply_cvd_profile_update(r,i,l,Zt(n)),e())},replaceCvdProfileSession(r,i,l,n,c){o()||(t.replace_cvd_profile_session(r,i,!!l,n,Zt(c)),e())},openCvdProfileSession(r,i,l){o()||(t.open_cvd_profile_session(r,i,l),e())},clearCvdProfile(){o()||(t.clear_cvd_profile(),e())},setCvdProfileViewMode(r){o()||(t.set_cvd_profile_view_mode(r|0),e())},getCvdProfileViewMode(){if(o())return 2;try{return t.get_cvd_profile_view_mode()}catch{return 2}},setCvdProfileShowAnchors(r){o()||(t.set_cvd_profile_show_anchors(!!r),e())},setCvdProfileShowPoc(r){o()||(t.set_cvd_profile_show_poc(!!r),e())},setCvdProfileShowSessionPocLine(r){o()||(t.set_cvd_profile_show_session_poc_line(!!r),e())},setCvdProfileShowDeltaPoc(r){o()||(t.set_cvd_profile_show_delta_poc(!!r),e())},setCvdProfileTooltipEnabled(r){o()||(t.set_cvd_profile_tooltip_enabled(!!r),e())},setCvdProfileMaxBarRatio(r){o()||(t.set_cvd_profile_max_bar_ratio(Number(r)||.85),e())},setCvdProfileLabelSizeScale(r){if(o())return;let i=Number(r);t.set_cvd_profile_label_size_scale(Number.isFinite(i)?i:1),e()},setCvdProfileBarHeightPx(r){o()||(t.set_cvd_profile_bar_height_px(Number(r)||0),e())},setCvdProfileBarMaxWidthPx(r){o()||(t.set_cvd_profile_bar_max_width_px(Number(r)||0),e())},setCvdProfileThemeMode(r){if(o())return;let i=Number(r),l=i===1||i===2?i:0;t.set_cvd_profile_theme_mode(l),e()},setCvdProfileValueInQuote(r){o()||(t.set_cvd_profile_value_in_quote(!!r),e())},cvdProfileHitTest(r,i){if(o())return"";try{return t.cvd_profile_hit_test(r,i)}catch{return""}},enableCvdOrderBlock(){o()||M("cvdProfile")&&(t.enable_cvd_orderblock(),e())},disableCvdOrderBlock(){o()||(t.disable_cvd_orderblock(),e())},isCvdOrderBlockEnabled(){if(o())return!1;try{return t.is_cvd_orderblock_enabled()}catch{return!1}},clearCvdOrderBlockObs(){o()||(t.clear_cvd_orderblock_obs(),e())},clearCvdOrderBlockAll(){o()||(t.clear_cvd_orderblock_all(),e())},upsertCvdOrderBlockOb(r,i,l,n,c,u,p,L,S,E,C,F,b,T,v,R,y,O,x,q,U,K,D,rt,nt,B,H,j,$,Q,J,et,st,tt,ft){o()||(t.upsert_cvd_orderblock_ob(String(r||""),cr(i),Qr(l),(n|0)>>>0,Number(c)||0,Number(u)||0,Number(p)||0,Number(L)||0,Number(S)||0,Number(E)||0,Number(C)||0,Number(F)||0,Number(b)||0,Number(T)||0,Number(v)||0,Number(R)||0,Number(y)||0,Number(O)||0,Number(x)||0,Number(q)||0,Number(U)||0,Number(K)||0,Number(D)||0,(rt|0)>>>0,Number(nt)||0,(B|0)>>>0,!!H,Number(j)||0,$===void 0?!0:!!$,!!Q,!!J,Number(et)||0,Number(st)||0,Number(tt)||0,Number(ft)||0),e())},removeCvdOrderBlockOb(r){if(o())return!1;try{let i=t.remove_cvd_orderblock_ob(String(r||""));return i&&e(),i}catch{return!1}},setCvdOrderBlockDirectionFilter(r){o()||(t.set_cvd_orderblock_direction_filter(cr(r,255)),e())},setCvdOrderBlockMitigationFilter(r){o()||(t.set_cvd_orderblock_mitigation_filter($r(r,255)),e())},setCvdOrderBlockMinScore(r){o()||(t.set_cvd_orderblock_min_score(Number(r)||0),e())},setCvdOrderBlockShowMitigated(r){o()||(t.set_cvd_orderblock_show_mitigated(!!r),e())},setCvdOrderBlockBreakerStyle(r){if(o())return;let i=Number(r),l=Number.isFinite(i)?Math.max(0,Math.min(2,Math.trunc(i))):0;t.set_cvd_orderblock_breaker_style(l),e()},setCvdOrderBlockShowObs(r){o()||(t.set_cvd_orderblock_show_obs(!!r),e())},setCvdOrderBlockShowGaps(r){o()||(t.set_cvd_orderblock_show_gaps(!!r),e())},setCvdOrderBlockShowFilledGaps(r){o()||(t.set_cvd_orderblock_show_filled_gaps(!!r),e())},setCvdOrderBlockShowLabels(r){o()||(t.set_cvd_orderblock_show_labels(!!r),e())},setCvdOrderBlockLabelSizeScale(r){if(o())return;let i=Number(r);t.set_cvd_orderblock_label_size_scale(Number.isFinite(i)?i:1),e()},setCvdOrderBlockRenderMode(r){if(o())return;let i=Number(r),l=i===0||i===1||i===2?i:1;t.set_cvd_orderblock_render_mode(l),e()},cvdOrderBlockObCount(){if(o())return 0;try{return t.cvd_orderblock_ob_count()}catch{return 0}},cvdOrderBlockGapCount(){if(o())return 0;try{return t.cvd_orderblock_gap_count()}catch{return 0}},cvdOrderBlockHitTest(r,i){if(o())return"";try{return t.cvd_orderblock_hit_test(r,i)}catch{return""}},enableCvdTradeSignals(){o()||M("cvdProfile")&&(t.enable_cvd_trade_signals(),e())},disableCvdTradeSignals(){o()||(t.disable_cvd_trade_signals(),e())},isCvdTradeSignalsEnabled(){if(o())return!1;try{return t.is_cvd_trade_signals_enabled()}catch{return!1}},clearCvdTradeSignals(){o()||(t.clear_cvd_trade_signals(),e())},upsertCvdTradeSignal(r,i,l,n,c,u,p,L,S,E,C,F,b,T,v,R,y,O,x,q,U){if(o())return;let K=0;(i==="short"||i===1)&&(K=1);let D=0;l==="breakout"||l===1?D=1:l==="delta_trap"||l===2?D=2:l==="absorption_resolution"||l===3?D=3:(l==="divergence"||l===4)&&(D=4);let rt=0;T==="bull"||T===1?rt=1:(T==="bear"||T===2)&&(rt=2),t.upsert_cvd_trade_signal(String(r||""),K,D,Number(n)||0,Number(c)||0,Number(u)||0,Number(p)||0,Number(L)||0,Number(S)||0,Number(E)||0,Number(C)||0,Number(F)||0,Number(b)||0,rt,(v|0)>>>0,Number(R)||0,Number(y)||0,Number(O)||0,Number(x)||0,(q|0)>>>0,String(U||"")),e()},removeCvdTradeSignal(r){if(o())return!1;try{let i=t.remove_cvd_trade_signal(String(r||""));return i&&e(),i}catch{return!1}},setCvdTradeSignalsShowLong(r){o()||(t.set_cvd_trade_signals_show_long(!!r),e())},setCvdTradeSignalsShowShort(r){o()||(t.set_cvd_trade_signals_show_short(!!r),e())},setCvdTradeSignalsShowRejection(r){o()||(t.set_cvd_trade_signals_show_rejection(!!r),e())},setCvdTradeSignalsShowBreakout(r){o()||(t.set_cvd_trade_signals_show_breakout(!!r),e())},setCvdTradeSignalsShowDeltaTrap(r){o()||(t.set_cvd_trade_signals_show_delta_trap(!!r),e())},setCvdTradeSignalsShowAbsorptionResolution(r){o()||(t.set_cvd_trade_signals_show_absorption_resolution(!!r),e())},setCvdTradeSignalsShowDivergence(r){o()||(t.set_cvd_trade_signals_show_divergence(!!r),e())},setCvdTradeSignalsShowLabels(r){o()||(t.set_cvd_trade_signals_show_labels(!!r),e())},setCvdTradeSignalsShowLevels(r){o()||(t.set_cvd_trade_signals_show_levels(!!r),e())},setCvdTradeSignalsMinConfidence(r){o()||(t.set_cvd_trade_signals_min_confidence(Number(r)||0),e())},cvdTradeSignalCount(){if(o())return 0;try{return t.cvd_trade_signal_count()}catch{return 0}},cvdTradeSignalsHitTest(r,i){if(o())return"";try{return t.cvd_trade_signals_hit_test(r,i)}catch{return""}},enableCvdDivergence(){o()||M("cvdProfile")&&(t.enable_cvd_divergence(),e())},disableCvdDivergence(){o()||(t.disable_cvd_divergence(),e())},isCvdDivergenceEnabled(){if(o())return!1;try{return t.is_cvd_divergence_enabled()}catch{return!1}},clearCvdDivergence(){o()||(t.clear_cvd_divergence(),e())},upsertCvdDivergence(r,i,l,n,c,u,p,L,S,E,C){if(o())return;let F=0;(i==="hidden"||i===1)&&(F=1);let b=0;(l==="short"||l===1)&&(b=1),t.upsert_cvd_divergence(String(r||""),F,b,Number(n)||0,Number(c)||0,Number(u)||0,Number(p)||0,Number(L)||0,Number(S)||0,Number(E)||0,Number(C)||0),e()},removeCvdDivergence(r){if(o())return!1;try{let i=t.remove_cvd_divergence(String(r||""));return i&&e(),i}catch{return!1}},setCvdDivergenceShowRegular(r){o()||(t.set_cvd_divergence_show_regular(!!r),e())},setCvdDivergenceShowHidden(r){o()||(t.set_cvd_divergence_show_hidden(!!r),e())},setCvdDivergenceShowLong(r){o()||(t.set_cvd_divergence_show_long(!!r),e())},setCvdDivergenceShowShort(r){o()||(t.set_cvd_divergence_show_short(!!r),e())},setCvdDivergenceShowLabels(r){o()||(t.set_cvd_divergence_show_labels(!!r),e())},setCvdDivergenceShowBand(r){o()||(t.set_cvd_divergence_show_band(!!r),e())},setCvdDivergenceMinStrength(r){o()||(t.set_cvd_divergence_min_strength(Number(r)||0),e())},cvdDivergenceCount(){if(o())return 0;try{return t.cvd_divergence_count()}catch{return 0}},cvdDivergenceHitTest(r,i){if(o())return"";try{return t.cvd_divergence_hit_test(r,i)}catch{return""}},enableCvdRegime(){o()||M("cvdProfile")&&(t.enable_cvd_regime(),e())},disableCvdRegime(){o()||(t.disable_cvd_regime(),e())},isCvdRegimeEnabled(){if(o())return!1;try{return t.is_cvd_regime_enabled()}catch{return!1}},clearCvdRegime(){o()||(t.clear_cvd_regime(),e())},upsertCvdRegimeFlip(r,i,l,n,c,u,p,L){if(o())return;let S=E=>E==="bull"||E===1?1:E==="bear"||E===2?2:0;t.upsert_cvd_regime_flip(String(r||""),Number(i)||0,Number(l)||0,S(n),S(c),Number(u)||0,(p|0)>>>0,Number(L)||0),e()},removeCvdRegimeFlip(r){if(o())return!1;try{let i=t.remove_cvd_regime_flip(String(r||""));return i&&e(),i}catch{return!1}},setCvdRegimeShowRibbon(r){o()||(t.set_cvd_regime_show_ribbon(!!r),e())},setCvdRegimeShowWash(r){o()||(t.set_cvd_regime_show_wash(!!r),e())},setCvdRegimeShowFlipLines(r){o()||(t.set_cvd_regime_show_flip_lines(!!r),e())},cvdRegimeFlipCount(){if(o())return 0;try{return t.cvd_regime_flip_count()}catch{return 0}},cvdRegimeHitTest(r,i){if(o())return"";try{return t.cvd_regime_hit_test(r,i)}catch{return""}},enableTpo(){o()||M("tpo")&&(t.enable_tpo(),e())},disableTpo(){o()||(t.disable_tpo(),e())},isTpoEnabled(){if(o())return!1;try{return t.is_tpo_enabled()}catch{return!1}},setTpoPocLine(r){o()||(t.set_tpo_poc_line(r),e())},setTpoVaLines(r){o()||(t.set_tpo_va_lines(r),e())},setTpoIb(r){o()||(t.set_tpo_ib(r),e())},setTpoSinglePrints(r){o()||(t.set_tpo_single_prints(r),e())},setTpoPeriod(r){o()||(t.set_tpo_period(r),e())},getTpoPeriod(){if(o())return 1440;try{return t.get_tpo_period()}catch{return 1440}},setTpoNakedPoc(r){o()||(t.set_tpo_naked_poc(r),e())},setTpoProfileShape(r){o()||(t.set_tpo_profile_shape(r),e())},setTpoIbMinutes(r){o()||(t.set_tpo_ib_minutes(r),e())},setTpoLetterMinutes(r){o()||(t.set_tpo_letter_minutes(r),e())},setTpoSignals(r){o()||(t.set_tpo_signals(r),e())},isTpoSignals(){if(o())return!1;try{return t.is_tpo_signals()}catch{return!1}},enableLiqHeatmap(){o()||M("liqHeatmap")&&(t.enable_liq_heatmap(),e())},disableLiqHeatmap(){o()||(t.disable_liq_heatmap(),e())},isLiqHeatmapEnabled(){if(o())return!1;try{return t.is_liq_heatmap_enabled()}catch{return!1}},setLiqHeatmapRange(r,i){o()||(t.set_liq_heatmap_range(r,i),e())},getLiqHeatmapMin(){if(o())return 0;try{return t.get_liq_heatmap_min()}catch{return 0}},getLiqHeatmapMax(){if(o())return 1;try{return t.get_liq_heatmap_max()}catch{return 1}},getLiqHeatmapSegMax(){if(o())return 0;try{return t.get_liq_heatmap_seg_max()}catch{return 0}},setLiqHeatmapProfile(r){o()||(t.set_liq_heatmap_profile(r),e())},isLiqHeatmapProfile(){if(o())return!0;try{return t.is_liq_heatmap_profile()}catch{return!0}},setLiqHeatmapCellHeight(r){o()||(t.set_liq_heatmap_cell_height(r),e())},getLiqHeatmapCellHeight(){if(o())return 1;try{return t.get_liq_heatmap_cell_height()}catch{return 1}},setLiqHeatmapBarWidth(r){o()||(t.set_liq_heatmap_bar_width(r),e())},getLiqHeatmapBarWidth(){if(o())return 1;try{return t.get_liq_heatmap_bar_width()}catch{return 1}},setLiqHeatmapPredictions(r){o()||(t.set_liq_heatmap_predictions(r),e())},setLiqHeatmapFilledPct(r){o()||(t.set_liq_heatmap_filled_pct(r),e())},getLiqHeatmapFilledPct(){if(o())return .85;try{return t.get_liq_heatmap_filled_pct()}catch{return .85}},liqHeatmapHitTest(r,i){if(o())return"";try{return t.liq_heatmap_hit_test(r,i)}catch{return""}},liqZoneHitTest(r,i){if(o())return"";try{return t.liq_zone_hit_test(r,i)}catch{return""}},enableSmartRanges(){o()||M("smartRanges")&&(t.enable_smart_ranges(),e())},disableSmartRanges(){o()||(t.disable_smart_ranges(),e())},isSmartRangesEnabled(){if(o())return!1;try{return t.is_smart_ranges_enabled()}catch{return!1}},setSrTextSize(r){o()||(t.set_sr_text_size(r),e())},setSrShowOb(r){o()||(t.set_sr_show_ob(r),e())},setSrObLast(r){o()||(t.set_sr_ob_last(r),e())},setSrShowObActivity(r){o()||(t.set_sr_show_ob_activity(r),e())},setSrShowBreakers(r){o()||(t.set_sr_show_breakers(r),e())},setSrMitigation(r){o()||(t.set_sr_mitigation(r),e())},setSrShowMetrics(r){o()||(t.set_sr_show_metrics(r),e())},setSrShowHtfOb(r){o()||(t.set_sr_show_htf_ob(r),e())},setSrHtfMinutes(r){o()||(t.set_sr_htf_minutes(r),e())},setSrShowFvg(r){o()||(t.set_sr_show_fvg(r),e())},setSrFvgTheme(r){o()||(t.set_sr_fvg_theme(r),e())},setSrFvgMitigation(r){o()||(t.set_sr_fvg_mitigation(r),e())},setSrFvgHtf(r){o()||(t.set_sr_fvg_htf(r),e())},setSrFvgExtend(r){o()||(t.set_sr_fvg_extend(r),e())},setSrShowObSignals(r){o()||(t.set_sr_show_ob_signals(r),e())},setSrShowPredict(r){o()||(t.set_sr_show_predict(r),e())},setSrShowFvgSignals(r){o()||(t.set_sr_show_fvg_signals(r),e())},setSrShowSmartRev(r){o()||(t.set_sr_show_smart_rev(r),e())},setSrSmartRevHtf(r){o()||(t.set_sr_smart_rev_htf(r),e())},setSrStatsType(r){o()||(t.set_sr_stats_type(r),e())},setSrStatsPosition(r){o()||(t.set_sr_stats_position(r),e())},getSrSignalsCount(){if(o())return 0;try{return t.get_sr_signals_count()}catch{return 0}},enableEmaStructure(){o()||M("emaStructure")&&(t.enable_ema_structure(),e())},disableEmaStructure(){o()||(t.disable_ema_structure(),e())},isEmaStructureEnabled(){if(o())return!1;try{return t.is_ema_structure_enabled()}catch{return!1}},setEsEma1Len(r){o()||(t.set_es_ema1_len(r),e())},setEsEma2Len(r){o()||(t.set_es_ema2_len(r),e())},setEsWmaLen(r){o()||(t.set_es_wma_len(r),e())},setEsShowEma1(r){o()||(t.set_es_show_ema1(r),e())},setEsShowEma2(r){o()||(t.set_es_show_ema2(r),e())},setEsShowWma(r){o()||(t.set_es_show_wma(r),e())},setEsSwingLen(r){o()||(t.set_es_swing_len(r),e())},setEsShowBos(r){o()||(t.set_es_show_bos(r),e())},enableLiveSignals(){o()||(t.enable_live_signals(),e())},disableLiveSignals(){o()||(t.disable_live_signals(),e())},isLiveSignalsEnabled(){if(o())return!1;try{return t.is_live_signals_enabled()}catch{return!1}},setLiveSignalsData(r){o()||(t.set_live_signals_data(new Float64Array(r)),e())},clearLiveSignals(){o()||(t.clear_live_signals(),e())},setLiveSignalsLeverage(r){o()||(t.set_live_signals_leverage(r),e())},getLiveSignalsLeverage(){if(o())return 10;try{return t.get_live_signals_leverage()}catch{return 10}},setLiveSignalsTrial(r){o()||(t.set_live_signals_trial(r),e())},setLiveSignalsShowEntry(r){o()||(t.set_live_signals_show_entry(r),e())},setLiveSignalsShowTpSl(r){o()||(t.set_live_signals_show_tp_sl(r),e())},setLiveSignalsShowMaxProfit(r){o()||(t.set_live_signals_show_max_profit(r),e())},setLiveSignalsShowLabels(r){o()||(t.set_live_signals_show_labels(r),e())},setLiveSignalsShowZones(r){o()||(t.set_live_signals_show_zones(r),e())},setLiveSignalsTextSize(r){o()||(t.set_live_signals_text_size(r),e())},setLiveSignalsPipValue(r){o()||(t.set_live_signals_pip_value(r),e())},setLiveSignalsLoading(r){o()||(t.set_live_signals_loading(r),e())},getLiveSignalsCount(){if(o())return 0;try{return t.get_live_signals_count()}catch{return 0}},enableVpin(){o()||M("vpin")&&(t.enable_vpin(),e())},disableVpin(){o()||(t.disable_vpin(),e())},isVpinEnabled(){if(o())return!1;try{return t.is_vpin_enabled()}catch{return!1}},setVpinData(r,i){o()||(t.set_vpin_data(r,i),e())},setVpinBucketSize(r){o()||(t.set_vpin_bucket_size(r),e())},getVpinBucketSize(){if(o())return 50;try{return t.get_vpin_bucket_size()}catch{return 50}},setVpinNumBuckets(r){o()||(t.set_vpin_num_buckets(r),e())},getVpinNumBuckets(){if(o())return 50;try{return t.get_vpin_num_buckets()}catch{return 50}},setVpinThreshold(r){o()||(t.set_vpin_threshold(r),e())},getVpinThreshold(){if(o())return .7;try{return t.get_vpin_threshold()}catch{return .7}},setVpinShowSma(r){o()||(t.set_vpin_show_sma(r),e())},setVpinShowZones(r){o()||(t.set_vpin_show_zones(r),e())},enableStopIceberg(){o()||M("stopIceberg")&&(t.enable_stop_iceberg(),e())},disableStopIceberg(){o()||(t.disable_stop_iceberg(),e())},isStopIcebergEnabled(){if(o())return!1;try{return t.is_stop_iceberg_enabled()}catch{return!1}},setSiShowStops(r){o()||(t.set_si_show_stops(r),e())},setSiShowIcebergs(r){o()||(t.set_si_show_icebergs(r),e())},setSiShowZones(r){o()||(t.set_si_show_zones(r),e())},setIcebergEvents(r,i,l,n,c,u){o()||(t.set_iceberg_events(r,i,l,n,c,u),e())},getStopRunCount(){if(o())return 0;try{return t.get_stop_run_count()}catch{return 0}},getIcebergCount(){if(o())return 0;try{return t.get_iceberg_count()}catch{return 0}},enableVolume(){t.enable_volume(),e()},disableVolume(){t.disable_volume(),e()},isVolumeEnabled(){return t.is_volume_enabled()},setVolumeMaPeriod(r){t.set_volume_ma_period(r),e()},setVolumeShowMa(r){t.set_volume_show_ma(r),e()},setVolumeShowSignals(r){t.set_volume_show_signals(r),e()},setVolumeColorMode(r){t.set_volume_color_mode(r),e()},getVolumeMaPeriod(){return t.get_volume_ma_period()},getVolumeShowMa(){return t.get_volume_show_ma()},getVolumeShowSignals(){return t.get_volume_show_signals()},getVolumeColorMode(){return t.get_volume_color_mode()},enableObSignals(){t.enable_ob_signals(),e()},disableObSignals(){t.disable_ob_signals(),e()},isObSignalsEnabled(){return t.is_ob_signals_enabled()},setObsShowWalls(r){t.set_obs_show_walls(r),e()},setObsShowGaps(r){t.set_obs_show_gaps(r),e()},setObsShowAlerts(r){t.set_obs_show_alerts(r),e()},setObsShowCom(r){t.set_obs_show_com(r),e()},setObsWalls(r,i){t.set_obs_walls(new Float64Array(r),new Float64Array(i)),e()},setObsGaps(r,i){t.set_obs_gaps(new Float64Array(r),new Float64Array(i)),e()},pushObsAlert(r,i,l,n,c){t.push_obs_alert(r,i,l,n,c),e()},setObsCom(r){t.set_obs_com(r),e()},clearObSignals(){t.clear_ob_signals(),e()},enableObFlow(){t.enable_ob_flow(),e()},disableObFlow(){t.disable_ob_flow(),e()},isObFlowEnabled(){return t.is_ob_flow_enabled()},setObfShowObi(r){t.set_obf_show_obi(r),e()},setObfShowNetFlow(r){t.set_obf_show_net_flow(r),e()},setObfShowCumDelta(r){t.set_obf_show_cum_delta(r),e()},pushObfSample(r,i,l,n){t.push_obf_sample(r,i,l,n),e()},setObfData(r){t.set_obf_data(new Float64Array(r)),e()},clearObFlow(){t.clear_ob_flow(),e()},setObfRatio(r){t.set_obf_ratio(r),e()},getObfRatio(){return t.get_obf_ratio()},enableObMicro(){t.enable_ob_micro(),e()},disableObMicro(){t.disable_ob_micro(),e()},isObMicroEnabled(){return t.is_ob_micro_enabled()},setObmData(r,i,l,n,c,u,p,L,S,E,C,F,b){t.set_obm_data(r,i,l,n,c,u,p,L,S,E,C,F,b),e()},setObmAnchorTopRight(r){t.set_obm_anchor_top_right(r),e()},clearObMicro(){t.clear_ob_micro(),e()},enableAggLiq(){M("aggLiquidations")&&(t.enable_agg_liq(),e())},disableAggLiq(){t.disable_agg_liq(),e()},isAggLiqEnabled(){return t.is_agg_liq_enabled()},setAggLiqData(r){let i;if(r&&r.length>0&&typeof r[0]=="object"&&!Array.isArray(r[0])){i=new Float64Array(r.length*6);for(let l=0;l<r.length;l++){let n=r[l];i[l*6+0]=Number(n.time)||0,i[l*6+1]=Number(n.longUsd)||0,i[l*6+2]=Number(n.shortUsd)||0,i[l*6+3]=Number(n.longQty)||0,i[l*6+4]=Number(n.shortQty)||0,i[l*6+5]=Number(n.count)||0}}else i=new Float64Array(r||[]);t.set_agg_liq_data(i),e()},pushAggLiqBar(r,i,l,n,c,u){t.push_agg_liq_bar(r,i,l,n,c,u>>>0),e()},clearAggLiq(){t.clear_agg_liq(),e()},setAggLiqMode(r){t.set_agg_liq_mode(r),e()},getAggLiqMode(){return t.get_agg_liq_mode()},setAggLiqShowLong(r){t.set_agg_liq_show_long(r),e()},setAggLiqShowShort(r){t.set_agg_liq_show_short(r),e()},setAggLiqHover(r){t.set_agg_liq_hover(r|0),e()},aggLiqBarJson(r){let i=t.agg_liq_bar_json(r|0);if(!i)return null;try{return JSON.parse(i)}catch{return null}},setAggLiqRatio(r){t.set_agg_liq_ratio(r),e()},getAggLiqRatio(){return t.get_agg_liq_ratio()},screenToAggLiqY(r){return t.screen_to_agg_liq_y(r)},aggLiqToScreenY(r){return t.agg_liq_to_screen_y(r)},setAggLiqSignals(r){let i;if(r&&r.length>0&&typeof r[0]=="object"&&!Array.isArray(r[0])){i=new Float64Array(r.length*6);for(let l=0;l<r.length;l++){let n=r[l];i[l*6+0]=Number(n.time)/1e3,i[l*6+1]=ur[n.type]??-1,i[l*6+2]=fr[n.side]??0,i[l*6+3]=Number(n.volumeUsd)||0,i[l*6+4]=Number(n.ratio)||0,i[l*6+5]=Math.max(0,Math.min(1,Number(n.confidence)||0))}}else i=new Float64Array(r||[]);t.set_agg_liq_signals(i),e()},pushAggLiqSignal(r){if(!r||r.time==null||r.type==null)return;let i=ur[r.type];i!=null&&(t.push_agg_liq_signal(Number(r.time)/1e3,i,fr[r.side]??0,Number(r.volumeUsd)||0,Number(r.ratio)||0,Math.max(0,Math.min(1,Number(r.confidence)||0))),e())},clearAggLiqSignals(){t.clear_agg_liq_signals(),e()},setAggLiqShowSignals(r){t.set_agg_liq_show_signals(!!r),e()},isAggLiqShowSignals(){return t.is_agg_liq_show_signals()},setAggLiqSignalsOnChart(r){t.set_agg_liq_signals_on_chart(!!r),e()},isAggLiqSignalsOnChart(){return t.is_agg_liq_signals_on_chart()},enableMrdPullback(){o()||M("mrdPullback")&&(t.enable_mrd_pullback(),e())},disableMrdPullback(){o()||(t.disable_mrd_pullback(),e())},isMrdPullbackEnabled(){if(o())return!1;try{return t.is_mrd_pullback_enabled()}catch{return!1}},setMrdPullbackEntryMode(r){o()||(t.set_mrd_pullback_entry_mode(r),e())},setMrdPullbackTrendMode(r){o()||(t.set_mrd_pullback_trend_mode(r),e())},setMrdPullbackShowHiddenDiv(r){o()||(t.set_mrd_pullback_show_hidden_div(r),e())},setMrdPullbackSrMode(r){o()||(t.set_mrd_pullback_sr_mode(r),e())},setMrdPullbackTextSize(r){o()||(t.set_mrd_pullback_text_size(r),e())},setMrdPullbackTfMode(r){o()||(t.set_mrd_pullback_tf_mode(r),e())},setMrdPullbackHtfKlines(r,i,l,n,c,u){o()||(t.set_mrd_pullback_htf_klines(Zt(r),Zt(i),Zt(l),Zt(n),Zt(c),Zt(u)),e())},updateMrdPullbackLastHtfKline(r,i,l,n,c,u){o()||(t.update_mrd_pullback_last_htf_kline(r,i,l,n,c,u),e())},clearMrdPullbackHtfKlines(){o()||(t.clear_mrd_pullback_htf_klines(),e())},enableOiCvdPattern(){o()||(t.enable_oi_cvd_pattern(),e())},disableOiCvdPattern(){o()||(t.disable_oi_cvd_pattern(),e())},isOiCvdPatternEnabled(){if(o())return!1;try{return t.is_oi_cvd_pattern_enabled()}catch{return!1}},setOiCvdPatternKinds(r){if(o())return;let i=(Number(r)|0)&15;t.set_oi_cvd_pattern_kinds(i>>>0),e()},setOiCvdPatternThresholds(r){if(o()||!r)return;let i=(l,n)=>{let c=Number(l);return Number.isFinite(c)?c:n};t.set_oi_cvd_pattern_thresholds(i(r.lookback,10)>>>0,i(r.oiThresholdPct,1.5),i(r.priceCompressPct,1.5),i(r.cvdQuietFactor,.4),i(r.trapLookback,20)>>>0,i(r.trapOiPct,.8),i(r.cooldownBars,5)>>>0),e()},setOiCvdPatternShowLabels(r){o()||(t.set_oi_cvd_pattern_show_labels(!!r),e())},setOiCvdPatternTextSize(r){if(o())return;let i=Number(r);Number.isFinite(i)&&(t.set_oi_cvd_pattern_text_size(i),e())}}}var ur=Object.freeze({spike:0,capitulation:1,cascade_start:2,cascade_exhaustion:3,imbalance:4,silent_zone:5}),fr=Object.freeze({neutral:0,long:1,short:2}),Uo=Object.freeze({POC_REVERT_LONG:{code:1,bit:0,side:"long",label:"POC\u2191"},POC_REVERT_SHORT:{code:2,bit:1,side:"short",label:"POC\u2193"},VAL_BOUNCE:{code:3,bit:2,side:"long",label:"VAL\u2192"},VAH_REJECT:{code:4,bit:3,side:"short",label:"VAH\u2192"},VAH_BREAK:{code:5,bit:4,side:"long",label:"\u25B6VAH"},VAL_BREAK:{code:6,bit:5,side:"short",label:"\u25C0VAL"},HVN_BUY_IMBAL:{code:7,bit:6,side:"long",label:"+HVN"},HVN_SELL_IMBAL:{code:8,bit:7,side:"short",label:"-HVN"}});function dr(t,e,o,s){let M=i=>s()(i),r=(i,l,n)=>i<=1&&l<=1&&n<=1&&(i>0||l>0||n>0)?[Math.round(i*255),Math.round(l*255),Math.round(n*255)]:[i&255,l&255,n&255];return{addMarker(i,l,n){t.add_marker(i,l,n),e()},clearMarkers(){t.clear_markers(),e()},hitTestMarker(i,l){return t.hit_test_marker(i,l)},selectMarker(i){t.select_marker(i),e()},deselectMarker(){t.deselect_marker(),e()},getSelectedMarker(){return t.get_selected_marker()},removeMarker(i){t.remove_marker(i),e()},deleteSelectedMarker(){let i=t.get_selected_marker();return i>0&&(t.remove_marker(i),e()),i},addTrendline(i,l,n,c,u,p,L,S,E,C=0){let[F,b,T]=r(u,p,L),v=t.add_trendline(i,l,n,c,F,b,T,S,E,C);return e(),v},addHorizontalLine(i,l,n,c,u,p,L,S=0){let[E,C,F]=r(n,c,u),b=t.add_horizontal_line(i,l,E,C,F,p,L,S);return e(),b},addArrow(i,l,n,c,u,p,L,S,E,C=0){let[F,b,T]=r(u,p,L),v=t.add_arrow(i,l,n,c,F,b,T,S,E,C);return e(),v},addFibRetracement(i,l,n,c,u,p,L,S,E,C=0){if(!M("drawingFull"))return 0;let[F,b,T]=r(u,p,L),v=t.add_fib_retracement(i,l,n,c,F,b,T,S,E,C);return e(),v},addFibExtension(i,l,n,c,u,p,L,S,E,C,F,b=0){if(!M("drawingFull"))return 0;let[T,v,R]=r(L,S,E),y=t.add_fib_extension(i,l,n,c,u,p,T,v,R,C,F,b);return e(),y},addLongPosition(i,l,n,c,u,p,L,S,E,C=0){if(!M("drawingFull"))return 0;let[F,b,T]=r(u,p,L),v=t.add_long_position(i,l,n,c,F,b,T,S,E,C);return e(),v},addShortPosition(i,l,n,c,u,p,L,S,E,C=0){if(!M("drawingFull"))return 0;let[F,b,T]=r(u,p,L),v=t.add_short_position(i,l,n,c,F,b,T,S,E,C);return e(),v},addAnchoredVwap(i,l,n,c,u,p,L=0){if(!M("drawingFull"))return 0;let[S,E,C]=r(l,n,c),F=t.add_anchored_vwap(i,S,E,C,u,p,L);return e(),F},addPriceLabel(i,l,n,c,u,p,L=0){let[S,E,C]=r(n,c,u),F=t.add_price_label(i,l,S,E,C,p,L);return e(),F},addTextNote(i,l,n,c,u,p,L=0){let[S,E,C]=r(n,c,u),F=t.add_text_note(i,l,S,E,C,p,L);return e(),F},addElliottImpulse(i,l,n,c,u,p,L=0){if(!M("drawingFull"))return 0;let[S,E,C]=r(n,c,u),F=t.add_elliott_impulse(i,l,S,E,C,p,L);return e(),F},setDrawingFontSize(i,l){t.set_drawing_font_size(i,l),e()},getDrawingFontSize(i){return t.get_drawing_font_size(i)},setDrawingText(i,l){t.set_drawing_text(i,l),e()},getDrawingText(i){return t.get_drawing_text(i)},setDrawingStyle(i,l,n,c,u){let[p,L,S]=r(l,n,c);t.set_drawing_style(i,p,L,S,u),e()},getDrawingColor(i){let l=t.get_drawing_color(i);return l?{r:l>>>24&255,g:l>>>16&255,b:l>>>8&255,lineWidth:(l&255)/10}:null},getDrawingDashed(i){try{return t.get_drawing_dashed(i)}catch{return!1}},setDrawingDashed(i,l){t.set_drawing_dashed(i,l),e()},getDrawingHideLabel(i){try{return t.get_drawing_hide_label(i)}catch{return!1}},setDrawingHideLabel(i,l){t.set_drawing_hide_label(i,l),e()},getDrawingFlipLeft(i){try{return t.get_drawing_flip_left(i)}catch{return!1}},setDrawingFlipLeft(i,l){try{t.set_drawing_flip_left(i,l),e()}catch{}},getDrawingTextWrap(i){try{return t.get_drawing_text_wrap(i)}catch{return!1}},setDrawingTextWrap(i,l){try{t.set_drawing_text_wrap(i,l),e()}catch{}},getDrawingKindId(i){try{return t.get_drawing_kind_id(i)}catch{return 255}},removeDrawing(i){t.remove_drawing(i),e()},clearDrawings(){t.clear_drawings(),e()},drawingCount(){return t.drawing_count()},setDrawingPreview(i,l,n,c,u,p,L,S,E,C,F=0){let[b,T,v]=r(p,L,S);t.set_drawing_preview(i,l,n,c,u,b,T,v,E,C,F),e()},clearDrawingPreview(){t.clear_drawing_preview(),e()},cancelBrush(){t.cancel_brush(),e()},selectDrawing(i){t.select_drawing(i),e()},deselectDrawing(){t.deselect_drawing(),e()},getSelectedDrawing(){return t.get_selected_drawing()},deleteSelectedDrawing(){let i=t.get_selected_drawing();return i>0&&(t.remove_drawing(i),e()),i},exportDrawingsJson(){try{return t.export_drawings_json()}catch{return"[]"}},importDrawingsJson(i){try{t.import_drawings_json(i),e()}catch(l){console.warn("[bridge] importDrawingsJson failed",l)}},screenToWorld(i,l){return{x:t.screen_to_world_x(i),y:t.screen_to_world_y(l)}},worldToScreen(i,l){try{return{x:t.world_to_screen_x(i),y:t.world_to_screen_y(l)}}catch{return null}}}}var lt=t=>t instanceof Float64Array?t:new Float64Array(t);function hr(t,e,o,s){let M=r=>s()(r);return{setKlines(r,i,l,n,c,u){o()||(t.set_klines(lt(r),lt(i),lt(l),lt(n),lt(c),lt(u)),e())},setKlinesPreserveViewport(r,i,l,n,c,u){o()||(t.set_klines_preserve_viewport(lt(r),lt(i),lt(l),lt(n),lt(c),lt(u)),e())},setRealTimestamps(r){o()||(t.set_real_timestamps(lt(r)),e())},appendRealTimestamp(r){o()||t.append_real_timestamp(r)},prependKlines(r,i,l,n,c,u){o()||(t.prepend_klines(lt(r),lt(i),lt(l),lt(n),lt(c),lt(u)),e())},appendKline(r,i,l,n,c,u){o()||(t.append_kline(r,i,l,n,c,u),e())},updateLastKline(r,i,l,n,c,u){o()||(t.update_last_kline(r,i,l,n,c,u),e())},popLastKline(){if(o())return!1;let r=t.pop_last_kline();return r&&e(),!!r},getLastClose(){try{return t.get_last_close()}catch{return 0}},getKlineCount(){if(o())return 0;try{return t.kline_count()}catch{return 0}},getKlineTimestamps(){if(o())return null;try{return t.kline_timestamps()}catch{return null}},getKlineOpens(){if(o())return null;try{return t.kline_opens()}catch{return null}},getKlineHighs(){if(o())return null;try{return t.kline_highs()}catch{return null}},getKlineLows(){if(o())return null;try{return t.kline_lows()}catch{return null}},getKlineCloses(){if(o())return null;try{return t.kline_closes()}catch{return null}},getKlineVolumes(){if(o())return null;try{return t.kline_volumes()}catch{return null}},setHeatmap(r,i,l,n,c,u,p){o()||M("heatmap")&&(t.set_heatmap(lt(r),i,l,n,c,u,p),e())},appendHeatmapColumn(r,i,l,n){o()||M("heatmap")&&(t.append_heatmap_column(lt(r),i,l,n),e())},updateLastHeatmapColumn(r,i,l){o()||(t.update_last_heatmap_column(lt(r),i,l),e())},getHeatmapLastTimestamp(){if(o())return 0;try{return t.get_heatmap_last_timestamp()??0}catch{return 0}},getHeatmapXStep(){if(o())return 0;try{return t.get_heatmap_x_step()??0}catch{return 0}},updateHeatmapColumnAt(r,i,l,n){o()||(t.update_heatmap_column_at(lt(r),i,l,n),e())},setHeatmapRange(r,i){o()||(t.set_heatmap_range(r,i),e())},getHeatmapDataRange(){try{return{min:t.get_heatmap_data_min(),max:t.get_heatmap_data_max()}}catch{return{min:0,max:0}}},setHeatmapPrefetchRange(r){try{t.set_heatmap_prefetch_range(r)}catch{}},clearHeatmapPrefetchRange(){try{t.clear_heatmap_prefetch_range()}catch{}},getHeatmapPrefetchMax(){try{return t.get_heatmap_prefetch_max()}catch{return 0}},setHeatmapColorScheme(r){try{t.set_heatmap_color_scheme(r),e()}catch{}},setHeatmapShowProfile(r){try{t.set_heatmap_show_profile(r),e()}catch{}},isHeatmapShowProfile(){try{return t.is_heatmap_show_profile()}catch{return!1}},setHeatmapProfileBrightness(r){try{t.set_heatmap_profile_brightness(Number(r)||1),e()}catch{}},getHeatmapProfileBrightness(){try{return t.get_heatmap_profile_brightness()}catch{return 1}},setHeatmapProfileBarLength(r){try{t.set_heatmap_profile_bar_length(Number(r)||1),e()}catch{}},getHeatmapProfileBarLength(){try{return t.get_heatmap_profile_bar_length()}catch{return 1}},setHeatmapWalls(r){try{t.set_heatmap_walls(new Float64Array(r)),e()}catch{}},clearHeatmapWalls(){try{t.clear_heatmap_walls(),e()}catch{}},getHeatmapWallCount(){try{return t.get_heatmap_wall_count()}catch{return 0}},setChartType(r){o()||r===2&&!M("footprint")||(t.set_chart_type(r),e())},getChartType(){if(o())return 0;try{return t.get_chart_type()}catch{return 0}},setFootprintTickSize(r){o()||M("footprint")&&(t.set_footprint_tick_size(r),e())},footprintSetFontScale(r){if(o()||!M("footprint"))return;let i=Number.isFinite(+r)?+r:1;try{t.footprint_set_font_scale(i)}catch{}e()},footprintEnsureLen(r){o()||t.footprint_ensure_len(r)},footprintAddTrade(r,i,l,n){o()||t.footprint_add_trade(r,i,l,n)},footprintAddTradeBatch(r){o()||!r||r.length===0||t.footprint_add_trade_batch(lt(r))},footprintSetBar(r,i,l,n,c){o()||(t.footprint_set_bar(r,i,l,n,c),e())},footprintClear(){o()||(t.footprint_clear(),e())},footprintClearBar(r){o()||t.footprint_clear_bar(r)},footprintPrependEmpty(r){o()||t.footprint_prepend_empty(r)},footprintSetSignalKindsMask(r){if(!o()&&M("footprint")){try{t.footprint_set_signal_kinds_mask((r|0)&255)}catch{}e()}},footprintSetPocMarkerStyle(r){if(o()||!M("footprint"))return;let i=Math.max(0,Math.min(3,r|0));try{t.footprint_set_poc_marker_style(i)}catch{}e()},footprintSetNakedPocEnabled(r){if(!o()&&M("footprint")){try{t.footprint_set_naked_poc_enabled(!!r)}catch{}e()}},footprintSetMinCellVolumePct(r){if(o()||!M("footprint"))return;let i=Number.isFinite(+r)?Math.max(0,Math.min(100,+r)):0;try{t.footprint_set_min_cell_volume_pct(i)}catch{}e()},footprintSetCellTextFormat(r){if(o()||!M("footprint"))return;let i=(r|0)===1?1:0;try{t.footprint_set_cell_text_format(i)}catch{}e()},footprintSetShowSignals(r){o()||(t.footprint_set_show_signals(r),e())},footprintGetShowSignals(){if(o())return!0;try{return t.footprint_get_show_signals()}catch{return!0}},footprintSignalCount(){if(o())return 0;try{return t.footprint_signal_count()}catch{return 0}},footprintSetShowProfile(r){o()||(t.footprint_set_show_profile(r),e())},footprintGetShowProfile(){if(o())return!1;try{return t.footprint_get_show_profile()}catch{return!1}},footprintProfileHitTest(r,i){if(o())return"";try{return t.footprint_profile_hit_test(r,i)}catch{return""}},footprintSetDisplayMode(r){o()||(t.footprint_set_display_mode(r),e())},footprintGetDisplayMode(){if(o())return 0;try{return t.footprint_get_display_mode()}catch{return 0}},footprintSetVolumeColorMode(r){if(!o()){try{t.footprint_set_volume_color_mode((r|0)===1?1:0)}catch{}e()}},footprintGetVolumeColorMode(){if(o())return 0;try{return t.footprint_get_volume_color_mode()}catch{return 0}},footprintSetStackedImbalanceEnabled(r){o()||(t.footprint_set_stacked_imbalance_enabled(!!r),e())},footprintGetStackedImbalanceEnabled(){if(o())return!1;try{return t.footprint_get_stacked_imbalance_enabled()}catch{return!1}},footprintSetStackedImbalanceMode(r){o()||(t.footprint_set_stacked_imbalance_mode(r|0),e())},footprintSetStackedImbalanceRatio(r){o()||(t.footprint_set_stacked_imbalance_ratio(Number(r)||3),e())},footprintSetStackedImbalanceMinStack(r){o()||(t.footprint_set_stacked_imbalance_min_stack(Math.max(2,r|0)),e())},footprintSetStackedImbalanceShowFilled(r){o()||(t.footprint_set_stacked_imbalance_show_filled(!!r),e())},footprintSetStackedImbalanceShowBox(r){o()||(t.footprint_set_stacked_imbalance_show_box(!!r),e())},footprintSetStackedImbalanceMaxAge(r){o()||(t.footprint_set_stacked_imbalance_max_age(Math.max(0,r|0)),e())},footprintSetStackedImbalanceHighlightCells(r){if(!o()){try{t.footprint_set_stacked_imbalance_highlight_cells(!!r)}catch{}e()}},footprintGetStackedImbalanceHighlightCells(){if(o())return!1;try{return t.footprint_get_stacked_imbalance_highlight_cells()}catch{return!1}},footprintSetStackedImbalanceShowBracket(r){if(!o()){try{t.footprint_set_stacked_imbalance_show_bracket(!!r)}catch{}e()}},footprintGetStackedImbalanceShowBracket(){if(o())return!1;try{return t.footprint_get_stacked_imbalance_show_bracket()}catch{return!1}},footprintSetStackedImbalanceShowRay(r){if(!o()){try{t.footprint_set_stacked_imbalance_show_ray(!!r)}catch{}e()}},footprintGetStackedImbalanceShowRay(){if(o())return!1;try{return t.footprint_get_stacked_imbalance_show_ray()}catch{return!1}},footprintStackedZoneCount(){if(o())return 0;try{return t.footprint_stacked_zone_count()}catch{return 0}},enableDeltaHistogram(){o()||t.enable_delta_histogram()},disableDeltaHistogram(){o()||t.disable_delta_histogram()},deltaHistogramEnabled(){if(o())return!1;try{return t.delta_histogram_enabled()}catch{return!1}}}}var Jr=1,ue=new Map,Dr=4096,Ce=Object.freeze({r:255,g:255,b:255,a:153});function to(t){if(typeof t!="string")return Ce;if(t.charCodeAt(0)===35){let o=t.slice(1);return o.length===8?Object.freeze({r:parseInt(o.slice(0,2),16),g:parseInt(o.slice(2,4),16),b:parseInt(o.slice(4,6),16),a:parseInt(o.slice(6,8),16)}):Object.freeze({r:parseInt(o.slice(0,2),16),g:parseInt(o.slice(2,4),16),b:parseInt(o.slice(4,6),16),a:255})}let e=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\)/);return e?Object.freeze({r:+e[1],g:+e[2],b:+e[3],a:e[4]!==void 0?Math.round(+e[4]*255):255}):Ce}function V(t){if(typeof t!="string")return Ce;let e=ue.get(t);if(e!==void 0)return e;ue.size>=Dr&&ue.clear();let o=to(t);return ue.set(t,o),o}function Le(t,e,o){let s=new Map,M=null,r=0,i=NaN,l=NaN,n=0,c=300,u=16,p=500,L=500,S=100,E=100,C=500,F=100,b=100,T=500;function v(){let a;try{a=t.kline_count()}catch{return M}if(a===0)return null;let _=t.kline_closes(),d=_?.[a-1]??NaN,f=a!==r,h=M==null,m=NaN,I=(()=>{if(f||h)return!1;if(d!==i)return!0;try{m=t.kline_highs()?.[a-1]??NaN}catch{}return m!==l})();if(!f&&!h&&!I)return M;if(I){let P=!1;for(let z of s.values())if(z.calcOnEveryTick&&!z._heavyCompute&&z.enabled){P=!0;break}if(!P||performance.now()-n<c)return i=d,isNaN(m)||(l=m),M}try{let P=t.kline_timestamps(),N=t.kline_opens(),z=t.kline_highs(),W=t.kline_lows(),k=t.kline_volumes();if(!P||!_)return M;M={timestamps:Array.from(P),open:Array.from(N),high:Array.from(z),low:Array.from(W),close:Array.from(_),volume:Array.from(k),length:a},r=a,i=d,l=isNaN(m)?z?.[a-1]??NaN:m,n=performance.now();let G=I&&!f&&!h;for(let w of s.values())w.enabled&&(G?w.calcOnEveryTick&&!w._heavyCompute&&(w._needsCompute=!0):w._needsCompute=!0)}catch{}return M}let R=new WeakMap;function y(a){if(a instanceof Float64Array)return a;if(!Array.isArray(a))return new Float64Array(0);let _=R.get(a);if(_&&_.length===a.length)return _;_=new Float64Array(a.length);for(let d=0;d<a.length;d++)_[d]=a[d];return R.set(a,_),_}function O(a){return a instanceof Uint32Array?a:new Uint32Array(a||[])}function x(a){if(typeof a=="number")return(a|0)&15;switch(a){case"left":return 1;case"right":return 2;case"both":return 3;case"up":return 4;case"down":return 8;default:return 0}}function q(a){switch(a){case"below":return 1;case"above":return 2;case"left":return 3;case"right":return 4;default:return 0}}function U(a){switch(a){case"triangleUp":return 1;case"triangleDown":return 2;case"square":return 3;case"diamond":return 4;case"cross":return 5;case"xcross":return 6;case"arrowUp":return 7;case"arrowDown":return 8;default:return 0}}let K=0,D=null,rt=new Map,nt=null,B=new Map,H={slotLabel:S,slotBox:L,slotLine:p,slotPolyline:E,slotTrendline:T,slotHline:C,slotFibRet:F,slotChannel:b};function j(a){if(!Array.isArray(a)||a.length===0)return;let _=Object.create(null),d=new Uint8Array(a.length),f=!1;for(let m=a.length-1;m>=0;m--){let I=a[m],P=H[I?.kind];if(!P)continue;let N=_[I.kind]||0;N>=P?(d[m]=1,f=!0):_[I.kind]=N+1}if(!f)return;let h=0;for(let m=0;m<a.length;m++)d[m]||(a[h++]=a[m]);a.length=h}function $(a,_,d,f){if(d<=0)return;let h=0,m=null;for(let[I,P]of a)P.kind===_&&(h++,m===null&&(m=I));if(!(h<d))for(;h>=d&&m!==null;){let I=a.get(m);if(I){try{f(I.id)}catch{}a.delete(m)}h--,m=null;for(let[P,N]of a)if(N.kind===_){m=P;break}}}let Q=a=>t.script_object_delete(a),J=a=>t.script_drawing_delete(a);function et(){return{seriesLine(a,_="#ffffff99",d=1.5){let f=V(_);t.custom_series_line(y(a),f.r,f.g,f.b,f.a,d)},seriesDashedLine(a,_="#ffffff66",d=1,f=4,h=4){let m=V(_);t.custom_series_dashed_line(y(a),m.r,m.g,m.b,m.a,d,f,h)},band(a,_,d="rgba(100,149,237,0.08)"){let f=V(d);t.custom_band(y(a),y(_),f.r,f.g,f.b,f.a)},seriesCandles(a,_,d,f,h="#089981",m="#F23645",I,P){let N=V(h),z=V(m),W=I!=null?V(I):{r:0,g:0,b:0,a:0},k=Number.isFinite(P)&&P>0?P:0;t.custom_candles(y(a),y(_),y(d),y(f),N.r,N.g,N.b,N.a,z.r,z.g,z.b,z.a,W.r,W.g,W.b,W.a,k)},hline(a,_="#ffffff66",d=1){let f=V(_);t.custom_hline(a,f.r,f.g,f.b,f.a,d)},dashedHline(a,_="#ffffff66",d=1,f=6,h=4){let m=V(_);t.custom_dashed_hline(a,m.r,m.g,m.b,m.a,d,f,h)},marker(a,_,d="#e8a04a",f=3){let h=V(d);t.custom_marker(a,_,h.r,h.g,h.b,h.a,f)},markerUp(a,_,d="#26a69a",f=5){let h=V(d);t.custom_marker_up(a,_,h.r,h.g,h.b,h.a,f)},markerDown(a,_,d="#ef5350",f=5){let h=V(d);t.custom_marker_down(a,_,h.r,h.g,h.b,h.a,f)},text(a,_,d,f="#ffffffaa",h=10,m="center"){let I=V(f),P=m==="center"?1:m==="right"?2:0;t.custom_text(a,_,d,I.r,I.g,I.b,I.a,h,P)},priceLabel(a,_,d="#ffffffaa",f=10){let h=V(d);t.custom_price_label(a,_,h.r,h.g,h.b,h.a,f)},linePx(a,_,d,f,h,m=1){let I=V(h);t.custom_line_px(a,_,d,f,I.r,I.g,I.b,I.a,m)},fillRectPx(a,_,d,f,h){let m=V(h);t.custom_fill_rect_px(a,_,d,f,m.r,m.g,m.b,m.a)},strokeRectPx(a,_,d,f,h,m=1){let I=V(h);t.custom_stroke_rect_px(a,_,d,f,I.r,I.g,I.b,I.a,m)},textPx(a,_,d,f,h=10,m="left"){let I=V(f),P=m==="center"?1:m==="right"?2:0;t.custom_text_px(a,_,d,I.r,I.g,I.b,I.a,h,P)},worldToScreenX:a=>t.world_to_screen_x(a),worldToScreenY:a=>t.world_to_screen_y(a),screenToWorldX:a=>t.screen_to_world_x(a),screenToWorldY:a=>t.screen_to_world_y(a),chartArea:()=>({x:t.chart_area_x(),y:t.chart_area_y(),w:t.chart_area_w(),h:t.chart_area_h()}),paneSeriesLine(a,_="#e8a04a",d=1.5){let f=V(_);t.custom_pane_series_line(y(a),f.r,f.g,f.b,f.a,d)},paneSeriesDashedLine(a,_="#e8a04a99",d=1,f=4,h=4){let m=V(_);t.custom_pane_series_dashed_line(y(a),m.r,m.g,m.b,m.a,d,f,h)},paneBand(a,_,d="rgba(232, 160, 74, 0.10)"){let f=V(d);t.custom_pane_band(y(a),y(_),f.r,f.g,f.b,f.a)},paneSeriesCandles(a,_,d,f,h="#089981",m="#F23645",I,P){let N=V(h),z=V(m),W=I!=null?V(I):{r:0,g:0,b:0,a:0},k=Number.isFinite(P)&&P>0?P:0;t.custom_pane_candles(y(a),y(_),y(d),y(f),N.r,N.g,N.b,N.a,z.r,z.g,z.b,z.a,W.r,W.g,W.b,W.a,k)},paneHline(a,_="#ffffff44",d=1){let f=V(_);t.custom_pane_hline(a,f.r,f.g,f.b,f.a,d)},paneDashedHline(a,_="#ffffff44",d=1,f=4,h=4){let m=V(_);t.custom_pane_dashed_hline(a,m.r,m.g,m.b,m.a,d,f,h)},paneLabel(a,_,d="#ffffffaa",f=10,h="left"){let m=V(d),I=h==="center"?1:h==="right"?2:0;t.custom_pane_label(a,String(_),m.r,m.g,m.b,m.a,f,I)},line(a,_,d,f,h="#ffffff66",m=1,I=0,P=0,N=0){let z=V(h),W=x(N);t.custom_line(a,_,d,f,z.r,z.g,z.b,z.a,m,I,P,W)},vline(a,_="#ffffff66",d=1,f=0,h=0){let m=V(_);t.custom_vline(a,m.r,m.g,m.b,m.a,d,f,h)},box(a,_,d,f,h={}){let m=V(h.bg??h.bgColor??"rgba(232,160,74,0.08)"),I=V(h.border??h.borderColor??"#ffffff44"),P=Number.isFinite(h.lineWidth)?h.lineWidth:1,N=!!h.dashed;t.custom_box(a,_,d,f,m.r,m.g,m.b,m.a,I.r,I.g,I.b,I.a,P,N)},label(a,_,d,f={}){let h=V(f.bg??f.bgColor??"rgba(13,15,19,0.92)"),m=V(f.border??f.borderColor??"#ffffff44"),I=V(f.color??f.textColor??"#ffffffe0"),P=Number.isFinite(f.fontSize)?f.fontSize:11,N=Number.isFinite(f.lineWidth)?f.lineWidth:1,z=f.align==="center"?1:f.align==="right"?2:0,W=q(f.anchor);t.custom_label(a,_,String(d),h.r,h.g,h.b,h.a,m.r,m.g,m.b,m.a,I.r,I.g,I.b,I.a,P,N,z,W)},polylineWorld(a,_,d="#e8a04a",f=1.5,h={}){let m=V(d),I=!!h.dashed,P=Number.isFinite(h.dash)?h.dash:4,N=Number.isFinite(h.gap)?h.gap:4;t.custom_polyline_world(y(a),y(_),m.r,m.g,m.b,m.a,f,I,P,N)},polygonWorld(a,_,d={}){let f=V(d.fill??d.bg??"rgba(232,160,74,0.18)"),h=V(d.border??"#e8a04a"),m=Number.isFinite(d.lineWidth)?d.lineWidth:1;t.custom_polygon_world(y(a),y(_),f.r,f.g,f.b,f.a,h.r,h.g,h.b,h.a,m)},arrow(a,_,d,f,h="#e8a04a",m=1.5,I=8){let P=V(h);t.custom_arrow(a,_,d,f,P.r,P.g,P.b,P.a,m,I)},shape(a,_,d={}){let f=U(d.shape),h=V(d.color??"#e8a04a"),m=Number.isFinite(d.size)?d.size:4;t.custom_shape_batch(O(a),y(_),f,h.r,h.g,h.b,h.a,m)},bgColor(a,_,d="rgba(232,160,74,0.05)"){let f=V(d),h=Array.isArray(a)?a:[a],m=Array.isArray(_)?_:[_];t.custom_bg_color_batch(O(h),O(m),f.r,f.g,f.b,f.a)},plotchar(a,_,d="\xB7",f="#e8a04a",h=10){let m=V(f);t.custom_plotchar_batch(O(a),y(_),String(d),m.r,m.g,m.b,m.a,h)},markersBatch(a,_,d=0,f="#e8a04a",h=5){let m=V(f);t.custom_markers_batch(O(a),y(_),d,m.r,m.g,m.b,m.a,h)},textsBatch(a,_,d,f="#ffffffaa",h=10,m="center"){let I=V(f),P=m==="center"?1:m==="right"?2:0;t.custom_texts_batch(O(a),y(_),String(d),I.r,I.g,I.b,I.a,h,P)},paneLine(a,_,d,f,h="#ffffff66",m=1,I=0,P=0,N=0){let z=V(h),W=x(N);t.custom_pane_line(a,_,d,f,z.r,z.g,z.b,z.a,m,I,P,W)},paneVline(a,_="#ffffff66",d=1,f=0,h=0){let m=V(_);t.custom_pane_vline(a,m.r,m.g,m.b,m.a,d,f,h)},paneBox(a,_,d,f,h={}){let m=V(h.bg??h.bgColor??"rgba(232,160,74,0.08)"),I=V(h.border??h.borderColor??"#ffffff44"),P=Number.isFinite(h.lineWidth)?h.lineWidth:1,N=!!h.dashed;t.custom_pane_box(a,_,d,f,m.r,m.g,m.b,m.a,I.r,I.g,I.b,I.a,P,N)},paneLabelXY(a,_,d,f={}){let h=V(f.bg??f.bgColor??"rgba(13,15,19,0.92)"),m=V(f.border??f.borderColor??"#ffffff44"),I=V(f.color??f.textColor??"#ffffffe0"),P=Number.isFinite(f.fontSize)?f.fontSize:11,N=Number.isFinite(f.lineWidth)?f.lineWidth:1,z=f.align==="center"?1:f.align==="right"?2:0,W=q(f.anchor);t.custom_pane_label_xy(a,_,String(d),h.r,h.g,h.b,h.a,m.r,m.g,m.b,m.a,I.r,I.g,I.b,I.a,P,N,z,W)},setPaneYRange(a,_){!Number.isFinite(a)||!Number.isFinite(_)||t.set_custom_pane_y_range(a,_)},setPaneRatio(a){if(!(!Number.isFinite(a)||a<=0))try{t.set_custom_pane_ratio(a)}catch{}},paneArea:()=>({x:t.custom_pane_x(),y:t.custom_pane_y(),w:t.custom_pane_w(),h:t.custom_pane_h()}),paneYAxisArea:()=>({x:t.custom_pane_yaxis_x(),y:t.custom_pane_y(),w:t.custom_pane_yaxis_w(),h:t.custom_pane_h()}),paneYRange:()=>({min:t.custom_pane_y_min(),max:t.custom_pane_y_max()}),paneToScreenY:a=>t.custom_pane_to_screen_y(a),screenToPaneY:a=>t.screen_to_custom_pane_y(a),auxPaneSeriesLine(a,_,d="#e8a04a",f=1.5){let h=V(d);t.aux_pane_series_line(a,y(_),h.r,h.g,h.b,h.a,f)},auxPaneBand(a,_,d,f="rgba(232,160,74,0.10)"){let h=V(f);t.aux_pane_band(a,y(_),y(d),h.r,h.g,h.b,h.a)},auxPaneHline(a,_,d="#ffffff44",f=1){let h=V(d);t.aux_pane_hline(a,_,h.r,h.g,h.b,h.a,f)},auxPaneLabel(a,_,d,f="#ffffffaa",h=10,m="right"){let I=V(f),P=m==="center"?1:m==="left"?0:2;t.aux_pane_label(a,_,String(d),I.r,I.g,I.b,I.a,h,P)},auxPaneLine(a,_,d,f,h,m="#ffffff66",I=1,P=0,N=0,z=0){let W=V(m),k=x(z);t.aux_pane_line(a,_,d,f,h,W.r,W.g,W.b,W.a,I,P,N,k)},auxPaneBox(a,_,d,f,h,m={}){let I=V(m.bg??m.bgColor??"rgba(232,160,74,0.08)"),P=V(m.border??m.borderColor??"#ffffff44"),N=Number.isFinite(m.lineWidth)?m.lineWidth:1,z=!!m.dashed;t.aux_pane_box(a,_,d,f,h,I.r,I.g,I.b,I.a,P.r,P.g,P.b,P.a,N,z)},auxPaneLabelXY(a,_,d,f,h={}){let m=V(h.bg??h.bgColor??"rgba(13,15,19,0.92)"),I=V(h.border??h.borderColor??"#ffffff44"),P=V(h.color??h.textColor??"#ffffffe0"),N=Number.isFinite(h.fontSize)?h.fontSize:11,z=Number.isFinite(h.lineWidth)?h.lineWidth:1,W=h.align==="center"?1:h.align==="right"?2:0,k=q(h.anchor);t.aux_pane_label_xy(a,_,d,String(f),m.r,m.g,m.b,m.a,I.r,I.g,I.b,I.a,P.r,P.g,P.b,P.a,N,z,W,k)},setAuxPaneYRange(a,_,d){!Number.isFinite(_)||!Number.isFinite(d)||t.set_aux_pane_y_range(a,_,d)},setAuxPaneRatio(a,_){if(!(!Number.isFinite(_)||_<=0))try{t.set_aux_pane_ratio(a,_)}catch{}},auxPaneArea:a=>({x:t.aux_pane_x(a),y:t.aux_pane_y(a),w:t.aux_pane_w(a),h:t.aux_pane_h(a)}),auxPaneYAxisArea:a=>({x:t.aux_pane_yaxis_x(a),y:t.aux_pane_y(a),w:t.aux_pane_yaxis_w(a),h:t.aux_pane_h(a)}),auxPaneYRange:a=>({min:t.aux_pane_y_min_get(a),max:t.aux_pane_y_max_get(a)}),auxPaneToScreenY:(a,_)=>t.aux_pane_to_screen_y(a,_),screenToAuxPaneY:(a,_)=>t.screen_to_aux_pane_y(a,_),scriptLabelNew(a,_,d,f={}){let h=K;if(!h)return 0;let m=V(f.bg??f.bgColor??"rgba(13,15,19,0.92)"),I=V(f.border??f.borderColor??"#ffffff44"),P=V(f.color??f.textColor??"#ffffffe0"),N=Number.isFinite(f.fontSize)?f.fontSize:11,z=Number.isFinite(f.lineWidth)?f.lineWidth:1,W=f.align==="center"?1:f.align==="right"?2:0,k=q(f.anchor),G=String(f.pane??"overlay");return t.script_label_new(h,G,a,_,String(d),m.r,m.g,m.b,m.a,I.r,I.g,I.b,I.a,P.r,P.g,P.b,P.a,N,z,W,k)},scriptLabelSetXY(a,_,d){a&&t.script_label_set_xy(a,_,d)},scriptLabelSetText(a,_){a&&t.script_label_set_text(a,String(_))},scriptLabelSetColor(a,_){if(!a)return;let d=V(_);t.script_label_set_color(a,d.r,d.g,d.b,d.a)},scriptLabelSetBg(a,_){if(!a)return;let d=V(_);t.script_label_set_bg(a,d.r,d.g,d.b,d.a)},scriptLabelSetVisible(a,_){a&&t.script_label_set_visible(a,!!_)},scriptBoxNew(a,_,d,f,h={}){let m=K;if(!m)return 0;let I=V(h.bg??h.bgColor??"rgba(232,160,74,0.10)"),P=V(h.border??h.borderColor??"#ffffff44"),N=Number.isFinite(h.lineWidth)?h.lineWidth:1,z=!!h.dashed,W=x(h.extend??0),k=String(h.pane??"overlay");return t.script_box_new(m,k,a,_,d,f,I.r,I.g,I.b,I.a,P.r,P.g,P.b,P.a,N,z,W)},scriptBoxSetCorners(a,_,d,f,h){a&&t.script_box_set_corners(a,_,d,f,h)},scriptBoxSetTop(a,_){a&&t.script_box_set_top(a,_)},scriptBoxSetBottom(a,_){a&&t.script_box_set_bottom(a,_)},scriptBoxSetRight(a,_){a&&t.script_box_set_right(a,_)},scriptBoxSetBg(a,_){if(!a)return;let d=V(_);t.script_box_set_bg(a,d.r,d.g,d.b,d.a)},scriptBoxSetBorder(a,_){if(!a)return;let d=V(_);t.script_box_set_border(a,d.r,d.g,d.b,d.a)},scriptBoxSetVisible(a,_){a&&t.script_box_set_visible(a,!!_)},scriptLineNew(a,_,d,f,h={}){let m=K;if(!m)return 0;let I=V(h.color??"#F0B90B"),P=Number.isFinite(h.lineWidth)?h.lineWidth:1.5,N=Number.isFinite(h.dash)?h.dash:0,z=Number.isFinite(h.gap)?h.gap:0,W=x(h.extend??0),k=String(h.pane??"overlay");return t.script_line_new(m,k,a,_,d,f,I.r,I.g,I.b,I.a,P,N,z,W)},scriptLineSetAnchors(a,_,d,f,h){a&&t.script_line_set_anchors(a,_,d,f,h)},scriptLineSetColor(a,_){if(!a)return;let d=V(_);t.script_line_set_color(a,d.r,d.g,d.b,d.a)},scriptLineSetExtend(a,_){a&&t.script_line_set_extend(a,x(_))},scriptLineSetVisible(a,_){a&&t.script_line_set_visible(a,!!_)},scriptPolylineNew(a,_,d={}){let f=K;if(!f)return 0;let h=V(d.color??"#F0B90B"),m=Number.isFinite(d.lineWidth)?d.lineWidth:1.5,I=!!d.dashed,P=Number.isFinite(d.dash)?d.dash:4,N=Number.isFinite(d.gap)?d.gap:4,z=V(d.fill??"rgba(0,0,0,0)"),W=!!d.closed,k=String(d.pane??"overlay");return t.script_polyline_new(f,k,y(a),y(_),h.r,h.g,h.b,h.a,m,I,P,N,z.r,z.g,z.b,z.a,W)},scriptPolylineSetVisible(a,_){a&&t.script_polyline_set_visible(a,!!_)},scriptTableNew(a,_,d,f,h={}){let m=K;if(!m)return 0;let I=Number.isFinite(h.cellW)?h.cellW:80,P=Number.isFinite(h.cellH)?h.cellH:22,N=V(h.bg??"rgba(13,15,19,0.92)"),z=V(h.border??"#ffffff22"),W=V(h.color??"#ffffffe0"),k=Number.isFinite(h.fontSize)?h.fontSize:11;return t.script_table_new(m,+a,+_,+I,+P,+d,+f,N.r,N.g,N.b,N.a,z.r,z.g,z.b,z.a,W.r,W.g,W.b,W.a,k)},scriptTableSetCell(a,_,d,f){a&&t.script_table_set_cell(a,+_,+d,String(f))},scriptTableSetVisible(a,_){a&&t.script_table_set_visible(a,!!_)},scriptObjectDelete(a){a&&t.script_object_delete(a)},slotLabel(a,_,d,f,h={}){let m=D;if(!m)return 0;let I=String(a),P=m.get(I);if(P&&P.kind!=="label"){try{t.script_object_delete(P.id)}catch{}P=null}let N=V(h.bg??h.bgColor??"rgba(13,15,19,0.92)"),z=V(h.border??h.borderColor??"#ffffff44"),W=V(h.color??h.textColor??"#ffffffe0"),k=Number.isFinite(h.fontSize)?h.fontSize:11,G=Number.isFinite(h.lineWidth)?h.lineWidth:1,w=h.align==="center"?1:h.align==="right"?2:0,g=q(h.anchor),A=String(h.pane??"overlay");if(!P){$(m,"label",S,Q);let X=t.script_label_new(K,A,_,d,String(f),N.r,N.g,N.b,N.a,z.r,z.g,z.b,z.a,W.r,W.g,W.b,W.a,k,G,w,g);return X?(P={id:X,kind:"label",touched:!0},m.set(I,P),X):0}return t.script_label_set_xy(P.id,_,d),t.script_label_set_text(P.id,String(f)),t.script_label_set_color(P.id,W.r,W.g,W.b,W.a),t.script_label_set_bg(P.id,N.r,N.g,N.b,N.a),P.touched=!0,P.id},slotBox(a,_,d,f,h,m={}){let I=D;if(!I)return 0;let P=String(a),N=I.get(P);if(N&&N.kind!=="box"){try{t.script_object_delete(N.id)}catch{}N=null}let z=V(m.bg??m.bgColor??"rgba(232,160,74,0.10)"),W=V(m.border??m.borderColor??"#ffffff44"),k=Number.isFinite(m.lineWidth)?m.lineWidth:1,G=!!m.dashed,w=x(m.extend??0),g=String(m.pane??"overlay");if(!N){$(I,"box",L,Q);let A=t.script_box_new(K,g,_,d,f,h,z.r,z.g,z.b,z.a,W.r,W.g,W.b,W.a,k,G,w);return A?(N={id:A,kind:"box",touched:!0},I.set(P,N),A):0}return t.script_box_set_corners(N.id,_,d,f,h),t.script_box_set_bg(N.id,z.r,z.g,z.b,z.a),t.script_box_set_border(N.id,W.r,W.g,W.b,W.a),N.touched=!0,N.id},slotLine(a,_,d,f,h,m={}){let I=D;if(!I)return 0;let P=String(a),N=I.get(P);if(N&&N.kind!=="line"){try{t.script_object_delete(N.id)}catch{}N=null}let z=V(m.color??"#F0B90B"),W=Number.isFinite(m.lineWidth)?m.lineWidth:1.5,k=Number.isFinite(m.dash)?m.dash:0,G=Number.isFinite(m.gap)?m.gap:0,w=x(m.extend??0),g=String(m.pane??"overlay");if(!N){$(I,"line",p,Q);let A=t.script_line_new(K,g,_,d,f,h,z.r,z.g,z.b,z.a,W,k,G,w);return A?(N={id:A,kind:"line",touched:!0},I.set(P,N),A):0}return t.script_line_set_anchors(N.id,_,d,f,h),t.script_line_set_color(N.id,z.r,z.g,z.b,z.a),t.script_line_set_extend(N.id,w),N.touched=!0,N.id},slotPolyline(a,_,d,f={}){let h=D;if(!h)return 0;let m=String(a),I=h.get(m);if(I)try{t.script_object_delete(I.id)}catch{}else $(h,"polyline",E,Q);let P=V(f.color??"#F0B90B"),N=Number.isFinite(f.lineWidth)?f.lineWidth:1.5,z=!!f.dashed,W=Number.isFinite(f.dash)?f.dash:4,k=Number.isFinite(f.gap)?f.gap:4,G=V(f.fill??"rgba(0,0,0,0)"),w=!!f.closed,g=String(f.pane??"overlay"),A=t.script_polyline_new(K,g,y(_),y(d),P.r,P.g,P.b,P.a,N,z,W,k,G.r,G.g,G.b,G.a,w);return A?(h.set(m,{id:A,kind:"polyline",touched:!0}),A):(h.delete(m),0)},slotTable(a,_,d,f,h,m={}){let I=D;if(!I)return 0;let P=String(a),N=I.get(P),z=Number.isFinite(m.cellW)?m.cellW:80,W=Number.isFinite(m.cellH)?m.cellH:22,k=V(m.bg??"rgba(13,15,19,0.92)"),G=V(m.border??"#ffffff22"),w=V(m.color??"#ffffffe0"),g=Number.isFinite(m.fontSize)?m.fontSize:11;if(N&&(N.kind!=="table"||N.cols!==f||N.rows!==h)){try{t.script_object_delete(N.id)}catch{}N=null}if(!N){let A=t.script_table_new(K,+_,+d,+z,+W,+f,+h,k.r,k.g,k.b,k.a,G.r,G.g,G.b,G.a,w.r,w.g,w.b,w.a,g);return A?(N={id:A,kind:"table",touched:!0,cols:+f,rows:+h},I.set(P,N),A):0}return N.touched=!0,N.id},slotTableSet(a,_,d,f){a&&t.script_table_set_cell(a,+_,+d,String(f))},slotTrendline(a,_,d,f,h,m={}){let I=nt;if(!I||!K)return 0;let P=String(a),N=I.get(P);if(N&&N.kind!=="trendline"){try{t.script_drawing_delete(N.id)}catch{}N=null}let z=V(m.color??"#F0B90B"),W=Number.isFinite(m.lineWidth)?m.lineWidth:1.5,k=!!m.dashed,G=String(m.pane??"overlay");if(!N){$(I,"trendline",T,J);let w=t.script_drawing_trendline_new(K,G,_,d,f,h,z.r,z.g,z.b,z.a,W,k);return w?(N={id:w,kind:"trendline",touched:!0},I.set(P,N),w):0}return t.script_drawing_set_anchors(N.id,y([_,d,f,h])),t.script_drawing_set_color(N.id,z.r,z.g,z.b,z.a),N.touched=!0,N.id},slotHline(a,_,d={}){let f=nt;if(!f||!K)return 0;let h=String(a),m=f.get(h);if(m&&m.kind!=="hline"){try{t.script_drawing_delete(m.id)}catch{}m=null}let I=Number.isFinite(d.anchorX)?d.anchorX:0,P=V(d.color??"#F0B90B"),N=Number.isFinite(d.lineWidth)?d.lineWidth:1,z=!!d.dashed,W=String(d.pane??"overlay");if(!m){$(f,"hline",C,J);let k=t.script_drawing_hline_new(K,W,_,I,P.r,P.g,P.b,P.a,N,z);return k?(m={id:k,kind:"hline",touched:!0},f.set(h,m),k):0}return t.script_drawing_set_anchors(m.id,y([I,_])),t.script_drawing_set_color(m.id,P.r,P.g,P.b,P.a),m.touched=!0,m.id},slotFibRet(a,_,d,f,h,m={}){let I=nt;if(!I||!K)return 0;let P=String(a),N=I.get(P);if(N&&N.kind!=="fib_ret"){try{t.script_drawing_delete(N.id)}catch{}N=null}let z=V(m.color??"#F0B90B"),W=Number.isFinite(m.lineWidth)?m.lineWidth:1,k=!!m.dashed,G=String(m.pane??"overlay");if(!N){$(I,"fib_ret",F,J);let w=t.script_drawing_fib_ret_new(K,G,_,d,f,h,z.r,z.g,z.b,z.a,W,k);return w?(N={id:w,kind:"fib_ret",touched:!0},I.set(P,N),w):0}return t.script_drawing_set_anchors(N.id,y([_,d,f,h])),t.script_drawing_set_color(N.id,z.r,z.g,z.b,z.a),N.touched=!0,N.id},slotChannel(a,_,d,f,h,m,I,P={}){let N=nt;if(!N||!K)return 0;let z=String(a),W=N.get(z);if(W&&W.kind!=="channel"){try{t.script_drawing_delete(W.id)}catch{}W=null}let k=V(P.color??"#F0B90B"),G=Number.isFinite(P.lineWidth)?P.lineWidth:1,w=!!P.dashed,g=String(P.pane??"overlay");if(!W){$(N,"channel",b,J);let A=t.script_drawing_channel_new(K,g,_,d,f,h,m,I,k.r,k.g,k.b,k.a,G,w);return A?(W={id:A,kind:"channel",touched:!0},N.set(z,W),A):0}return t.script_drawing_set_anchors(W.id,y([_,d,f,h,m,I])),t.script_drawing_set_color(W.id,k.r,k.g,k.b,k.a),W.touched=!0,W.id}}}let st=new Map;function tt(a="below"){let _=st.get(a)||0;if(st.set(a,_+1),_===0)try{a==="below"?t.enable_custom_pane():t.enable_aux_pane(a,.22)}catch(d){console.warn(`[CustomIndicator] enable pane "${a}" failed:`,d)}}function ft(a="below"){let _=st.get(a)||0;if(!(_<=0))if(_===1){st.delete(a);try{a==="below"?t.disable_custom_pane():t.disable_aux_pane(a)}catch(d){console.warn(`[CustomIndicator] disable pane "${a}" failed:`,d)}}else st.set(a,_-1)}function St(a){if(!a.compute)return;let _=v();if(!_)return;let d=[];try{let m=t.drawing_count?.()??0;for(let I=0;I<m;I++){let P=t.drawing_descriptor?.(I);if(P)try{let N=JSON.parse(P);if(N.owner!=="user")continue;let z=new Set(["trendline","arrow","range","fib_ret","circle","channel","fib_ext","brush","path","elliott"]),W=Array.isArray(N.anchors)?N.anchors:[],k=[];if(z.has(N.kind))for(let g=0;g+1<W.length;g+=2)k.push({t:W[g],p:W[g+1]});else N.kind==="hline"?W.length>=2&&k.push({t:W[0],p:W[1]}):N.kind==="arrow_marker_up"||N.kind==="arrow_marker_down"||N.kind==="text_note"?W.length>=2&&k.push({t:W[0],p:W[1]}):N.kind==="price_label"&&W.length>=2&&k.push({t:W[0],p:W[1]});let G=Array.isArray(N.color)?N.color:null,w=G?`#${[G[0]|0,G[1]|0,G[2]|0].map(g=>g.toString(16).padStart(2,"0")).join("")}`:void 0;d.push({id:`u_${N.id}`,owner:"user",scriptId:null,kind:N.kind,pane:N.pane,anchors:k,anchorsRaw:W,style:{color:w,lineWidth:N.line_width,dashed:!!N.dashed,text:N.text||""}})}catch{}}}catch{}Object.freeze(d),globalThis.__mrdScriptUserDrawings=d;let f=performance.now();try{a._computed=a.compute(_,a.params)||{}}catch(m){console.warn(`[CustomIndicator "${a.name}"] compute error:`,m),a._computed={}}let h=performance.now();a._perf||(a._perf={compute:0,render:0,primitives:0,frames:0}),a._perf.compute=h-f,!a._heavyCompute&&a._perf.compute>u&&(a._heavyCompute=!0,console.warn(`[CustomIndicator "${a.name}"] compute=${a._perf.compute.toFixed(1)}ms > ${u}ms budget \u2014 auto-throttled to bar-close-only (set calcOnEveryTick=false explicitly to silence this).`)),j(a._computed?.__draws),a._fa=vt(a._computed,a._fa)}function vt(a,_){if(!a||typeof a!="object")return null;let d={};for(let f in a){if(!Object.prototype.hasOwnProperty.call(a,f))continue;let h=a[f];if(Array.isArray(h)&&(typeof h[0]=="number"||h.length===0)){let m=_&&_[f]&&_[f].length===h.length?_[f]:new Float64Array(h.length);for(let I=0;I<h.length;I++)m[I]=h[I];d[f]=m}else h instanceof Float64Array?d[f]=h:h&&typeof h=="object"&&!Array.isArray(h)&&(d[f]=vt(h,_?.[f]))}return d}let Lt=Object.freeze({length:0,timestamps:[],open:[],high:[],low:[],close:[],volume:[]});function mt(a){if(s.size===0)return;let _=v(),d=!1;for(let P of s.values())if(P.enabled&&!(P.compute&&!_)){d=!0;break}if(!d)return;t.custom_begin();let f=et(),h=_||Lt,m=t.custom_command_count();for(let P of s.values()){if(!P.enabled||P.compute&&!_)continue;if(P._needsCompute&&(St(P),P._needsCompute=!1),P._computed?.__draws?.length&&_){let A=_.length;try{let X=t.kline_closes();if(X&&X.length===A){let ot=t.kline_opens(),ut=t.kline_highs(),Pt=t.kline_lows(),dt=A-1;for(let oe of P._computed.__draws){if(oe.kind!=="seriesCandles")continue;let[$t,Xe,xe,Ve]=oe.args;if(!Array.isArray($t)||$t.length!==A||isNaN($t[dt]))continue;let qe=R.get($t);qe&&(qe[dt]=ot[dt]);let ke=R.get(Xe);ke&&(ke[dt]=ut[dt]);let Ge=R.get(xe);Ge&&(Ge[dt]=Pt[dt]);let Ue=R.get(Ve);Ue&&(Ue[dt]=X[dt]),$t[dt]=ot[dt],Xe[dt]=ut[dt],xe[dt]=Pt[dt],Ve[dt]=X[dt]}}}catch{}}let N=performance.now();K=P.id;let z=rt.get(P.id);z||(z=new Map,rt.set(P.id,z));for(let A of z.values())A.touched=!1;D=z;let W=B.get(P.id);W||(W=new Map,B.set(P.id,W));for(let A of W.values())A.touched=!1;nt=W;try{P.render.call(P,f,P._computed||{},h)}catch(A){console.warn(`[CustomIndicator "${P.name}"] render error:`,A)}finally{for(let[A,X]of z)if(!X.touched){try{t.script_object_delete(X.id)}catch{}z.delete(A)}for(let[A,X]of W)if(!X.touched){try{t.script_drawing_delete(X.id)}catch{}W.delete(A)}K=0,D=null,nt=null}let k=performance.now();P._perf||(P._perf={compute:0,render:0,primitives:0,frames:0});let G=.2,w=k-N;P._perf.render=P._perf.render===0?w:P._perf.render*(1-G)+w*G;let g=t.custom_command_count();P._perf.primitives=g-m,P._perf.frames++,m=g}if(t.custom_end(),t.custom_command_count()>0){let P=t.get_custom_buffer_ptr(),N=t.get_custom_buffer_len();o(a,e,P,N)}}function Tt(){M=null,r=0,i=NaN,l=NaN;for(let a of s.values())a._needsCompute=!0}function Mt(a,_,d){return a&&Number.isFinite(a.x)&&_>=a.x&&_<=a.x+a.w&&d>=a.y&&d<=a.y+a.h}function pt(a,_){let d=[...s.values()];for(let f=d.length-1;f>=0;f--){let h=d[f];if(h.enabled&&h.pane!=="overlay"){if(Mt(h._paneSeparatorRect,a,_))return{ind:h,role:"separator"};if(Mt(h._paneYAxisRect,a,_))return{ind:h,role:"yaxis"};if(Mt(h._paneRect,a,_))return{ind:h,role:"body"}}}return null}function bt(a,_){let d=pt(a,_);return d?d.ind:null}function it(a,_){let d=a._paneRect,f=a._paneDomain;if(!d||!f)return;let h=f.ymax-f.ymin;if(h<=0||d.h<=0)return;let m=_/d.h*h,I=a._paneViewport||f;a._paneViewport={ymin:I.ymin+m,ymax:I.ymax+m,heightRatio:I.heightRatio}}function _t(a,_,d){let f=a._paneRect,h=a._paneDomain;if(!f||!h||!Number.isFinite(h.ymin)||!Number.isFinite(h.ymax))return;let m=h.ymax-h.ymin;if(m<=0)return;let I=Math.max(0,Math.min(1,(_-f.y)/Math.max(1,f.h))),P=h.ymax-I*m,N=m*d,z=a._paneViewportDefault?a._paneViewportDefault.ymax-a._paneViewportDefault.ymin:m;if(z>0&&(N/z>50||N/z<.005))return;let W=P+I*N,k=W-N;a._paneViewport={ymin:k,ymax:W,heightRatio:a._paneViewport?.heightRatio??h.heightRatio}}function Y(a){a._paneViewportDefault?a._paneViewport={...a._paneViewportDefault}:a._paneViewport=null}function Z(a,_={}){if(!a||typeof a.addEventListener!="function")return{destroy(){}};let d=typeof _.markDirty=="function"?_.markDirty:()=>{},f=typeof _.getDrawingMode=="function"?_.getDrawingMode:null,h=G=>{let w=bt(G.offsetX,G.offsetY);if(!w)return;let g=G.deltaY>0?1.1:.9;if(G.ctrlKey||G.metaKey)_t(w,G.offsetY,g);else try{t.zoom_x(G.offsetX,g)}catch{}G.preventDefault(),G.stopPropagation(),d()},m=G=>{if(f&&f())return;let w=bt(G.offsetX,G.offsetY);w&&(Y(w),G.preventDefault(),G.stopPropagation(),d())},I=null;function P(){I=null,window.removeEventListener("mousemove",N,!0),window.removeEventListener("mouseup",z,!0);try{a.style.cursor=""}catch{}}function N(G){if(!I)return;let w=I;if(w.type==="separator"){let g=w.startSy-G.offsetY,A=Math.max(.05,Math.min(.5,w.startRatio+g/w.totalH));try{t.set_custom_pane_ratio(A)}catch{}w.ind._paneViewport={ymin:w.ind._paneViewport?.ymin??w.ind._paneDomain?.ymin,ymax:w.ind._paneViewport?.ymax??w.ind._paneDomain?.ymax,heightRatio:A},d()}else if(w.type==="yaxis"){let g=G.offsetY-w.lastSy;w.lastSy=G.offsetY,it(w.ind,g),d()}else if(w.type==="body"){let g=G.offsetX-w.lastSx,A=G.offsetY-w.lastSy;if(w.lastSx=G.offsetX,w.lastSy=G.offsetY,g!==0)try{t.pan(g,0)}catch{}A!==0&&it(w.ind,A),d()}G.preventDefault(),G.stopPropagation()}function z(G){I&&(P(),G.preventDefault(),G.stopPropagation())}function W(G){if(G.button!==0)return;let w=pt(G.offsetX,G.offsetY);if(!w)return;let{ind:g,role:A}=w;if(A==="body"){if(f&&f())return;try{if(t.hit_test_drawing&&t.hit_test_drawing(G.offsetX,G.offsetY)>0||t.hit_test_marker&&t.hit_test_marker(G.offsetX,G.offsetY)>0)return}catch{}}if(A==="separator"){let X=a.getBoundingClientRect(),ot=Math.max(1,X.height-28),ut=g._paneViewport?.heightRatio??g._paneDomain?.heightRatio??(()=>{try{return t.get_custom_pane_ratio?.()??.25}catch{return .25}})();I={type:"separator",ind:g,startSy:G.offsetY,startRatio:ut,totalH:ot},a.style.cursor="ns-resize"}else A==="yaxis"?(I={type:"yaxis",ind:g,lastSy:G.offsetY},a.style.cursor="ns-resize"):A==="body"&&(I={type:"body",ind:g,lastSx:G.offsetX,lastSy:G.offsetY},a.style.cursor="grabbing");window.addEventListener("mousemove",N,!0),window.addEventListener("mouseup",z,!0),G.preventDefault(),G.stopPropagation()}function k(G){if(I)return;let w=pt(G.offsetX,G.offsetY);if(!w)return;let A=f&&f()?"crosshair":w.role==="separator"||w.role==="yaxis"?"ns-resize":"crosshair";requestAnimationFrame(()=>{if(!I)try{a.style.cursor=A}catch{}})}return a.addEventListener("wheel",h,{passive:!1,capture:!0}),a.addEventListener("dblclick",m,{capture:!0}),a.addEventListener("mousedown",W,{capture:!0}),a.addEventListener("mousemove",k,{capture:!1}),{destroy(){a.removeEventListener("wheel",h,{capture:!0}),a.removeEventListener("dblclick",m,{capture:!0}),a.removeEventListener("mousedown",W,{capture:!0}),a.removeEventListener("mousemove",k,{capture:!1}),I&&P()}}}return{add(a){let _=Jr++,d=typeof a?.pane=="string"?a.pane.trim():"",f=!d||d==="overlay",h=f?null:d,m={id:_,name:a.name||`Custom ${_}`,params:{...a.params},compute:a.compute||null,render:a.render,enabled:!0,pane:f?"overlay":h,paneId:h,calcOnEveryTick:a.calcOnEveryTick!==!1,_heavyCompute:!1,_computed:{},_needsCompute:!0,_paneRect:null,_paneDomain:null,_paneViewport:null,_paneViewportDefault:null};return s.set(_,m),h&&tt(h),_},remove(a){let _=s.get(a);if(!_)return;let d=_.paneId;try{t.script_release(a)}catch(f){console.warn(`[CustomIndicator] script_release(${a}) failed:`,f)}try{t.script_release_drawings(a)}catch(f){console.warn(`[CustomIndicator] script_release_drawings(${a}) failed:`,f)}rt.delete(a),B.delete(a),s.delete(a),d&&ft(d)},updateParams(a,_){let d=s.get(a);d&&(Object.assign(d.params,_),d._needsCompute=!0,d._paneViewport=null,d._paneViewportDefault=null)},setEnabled(a,_){let d=s.get(a);d&&(d.enabled=_)},setCalcOnEveryTick(a,_){let d=s.get(a);d&&(d.calcOnEveryTick=!!_,d._heavyCompute=!1)},list(){return[...s.values()].map(a=>({id:a.id,name:a.name,params:{...a.params},enabled:a.enabled,calcOnEveryTick:!!a.calcOnEveryTick,heavyCompute:!!a._heavyCompute,compute:a._perf?.compute??0}))},perfStats(a){if(a!=null){let d=s.get(a);return!d||!d._perf?null:{...d._perf}}let _={};for(let d of s.values())d._perf&&(_[d.id]={...d._perf,name:d.name});return _},listDrawings(){let a=[],_=0;try{_=t.drawing_count()}catch{return a}for(let d=0;d<_;d++){let f="";try{f=t.drawing_descriptor(d)}catch{continue}if(f)try{a.push(JSON.parse(f))}catch(h){console.warn(`[CustomIndicator] failed to parse drawing[${d}]:`,h,f)}}return a},scriptObjectStats(a){try{let _=t.script_object_counts_for(a)||[],[d=0,f=0,h=0,m=0,I=0]=_;return{labels:d,boxes:f,lines:h,polylines:m,tables:I,total:d+f+h+m+I}}catch{return{labels:0,boxes:0,lines:0,polylines:0,tables:0,total:0}}},invalidateCompute:Tt,renderAll:mt,setupPaneInteraction:Z}}var pr={trial:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!0,tpo:!0,cvdProfile:!0,smartRanges:!0,emaStructure:!0,customIndicators:!0,forexSignals:!0,vpin:!0,stopIceberg:!0,aggLiquidations:!0,mrdPullback:!0},standard:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!1,heatmap:!1,footprint:!1,liqHeatmap:!1,oi:!1,fundingRate:!1,cvd:!1,largeTrades:!1,vrvp:!1,tpo:!1,cvdProfile:!0,smartRanges:!1,emaStructure:!1,customIndicators:!1,forexSignals:!1,vpin:!1,stopIceberg:!1,aggLiquidations:!1,mrdPullback:!1},professional:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!1,tpo:!1,cvdProfile:!0,smartRanges:!1,emaStructure:!1,customIndicators:!1,forexSignals:!1,vpin:!1,stopIceberg:!1,aggLiquidations:!0,mrdPullback:!0},enterprise:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!0,tpo:!0,cvdProfile:!0,smartRanges:!0,emaStructure:!0,customIndicators:!0,forexSignals:!0,vpin:!0,stopIceberg:!0,aggLiquidations:!0,mrdPullback:!0}},eo={rsi:"RSI",drawingBasic:"Basic Drawing Tools",heatmap:"Orderbook Heatmap",footprint:"Footprint Chart",liqHeatmap:"Liquidation Heatmap",oi:"Open Interest",fundingRate:"Funding Rate",cvd:"CVD",largeTrades:"Large Trades",vrvp:"VRVP",tpo:"TPO / Market Profile",cvdProfile:"CVD Profile",smartRanges:"Smart Ranges",emaStructure:"EMA Structure",drawingFull:"All Drawing Tools",customIndicators:"Custom Indicators",forexSignals:"Forex Signals",vpin:"VPIN",stopIceberg:"Stops & Icebergs",aggLiquidations:"Aggregated Liquidations",mrdPullback:"mrD-Pullback Signals"},ro={rsi:"Standard",drawingBasic:"Standard",heatmap:"Professional",footprint:"Professional",liqHeatmap:"Professional",oi:"Professional",fundingRate:"Professional",cvd:"Professional",largeTrades:"Professional",drawingFull:"Professional",vrvp:"Enterprise",tpo:"Enterprise",smartRanges:"Enterprise",emaStructure:"Enterprise",customIndicators:"Enterprise",forexSignals:"Enterprise",vpin:"Enterprise",stopIceberg:"Enterprise",aggLiquidations:"Professional",mrdPullback:"Professional"};function kt(t){return pr[t]||pr.trial}function ye(t){let e=kt(t),o=new Set;return function(M){if(e[M])return!0;if(!o.has(M)){o.add(M);let r=eo[M]||M,i=ro[M]||"a higher";console.warn(`[MRD Chart Engine] "${r}" requires ${i} plan. Current plan: ${t}. Upgrade at https://mrd-chart.dev/pricing`)}return!1}}var mr="jx9hUoH64b12M9nidvauYGZa3KQRjU1UcuQtI2l-0uI",oo=14,br="trial",te="free",no="MRD-Indicators",gr="mrd-indicators.com",Ee=[95,95,109,114].map(t=>String.fromCharCode(t)).join(""),so=1297237059;function Ie(t){t=t.replace(/-/g,"+").replace(/_/g,"/");let e=t.length%4;if(e===2)t+="==";else if(e===3)t+="=";else if(e!==0)throw new Error("bad b64url");return atob(t)}function vr(t){let e=Ie(t),o=new Uint8Array(e.length);for(let s=0;s<e.length;s++)o[s]=e.charCodeAt(s);return o}function io(t){return new TextEncoder().encode(t)}var fe=null;async function ao(){if(fe)return fe;let t=globalThis.crypto?.subtle;if(!t)throw new Error("WebCrypto not available");let e=vr(mr);if(e.length!==32)throw new Error("Public key must be 32 bytes (Ed25519 raw)");return fe=(async()=>{let o={kty:"OKP",crv:"Ed25519",x:mr,ext:!0};try{return await t.importKey("jwk",o,{name:"Ed25519"},!1,["verify"])}catch{return await t.importKey("raw",e,{name:"Ed25519"},!1,["verify"])}})(),fe}async function lo(t){let e=t.split(".");if(e.length!==3)return null;let o,s;try{o=JSON.parse(Ie(e[0])),s=JSON.parse(Ie(e[1]))}catch{return null}if(o.alg!=="EdDSA"||o.typ!=="MRD-LIC")return null;let M=vr(e[2]),r=io(e[0]+"."+e[1]),i=await ao();return await globalThis.crypto.subtle.verify("Ed25519",i,M,r)?s:null}function co(t,e){if(t==="*"||t===e)return!0;if(t.startsWith("*.")){let o=t.slice(1);return e.endsWith(o)||e===t.slice(2)}return!1}var Mr=Ee+"e7x",Cr=Ee+"p3q",Lr="mrd_engine_session_id",yr="mrd_ce_db",Kt="meta",Ar="trial_ts",Ir=Ee+"ck";function Er(t){let e=`${t}:${so}:${(t^2043453)>>>0}`,o=2166136261;for(let s=0;s<e.length;s++)o^=e.charCodeAt(s),o=Math.imul(o,16777619);return(o>>>0).toString(36)}function ee(t){return`${t}.${Er(t)}`}function re(t){if(!t||typeof t!="string")return null;let e=t.lastIndexOf(".");if(e<1)return null;let o=parseInt(t.slice(0,e),10);return!o||o<1e9||o>2e9||t.slice(e+1)!==Er(o)?null:o}function Ne(){try{return re(localStorage.getItem(Mr))}catch{return null}}function Te(t){try{localStorage.setItem(Mr,ee(t))}catch{}}function Pe(){try{return re(localStorage.getItem(Cr))}catch{return null}}function Fe(t){try{localStorage.setItem(Cr,ee(t))}catch{}}function Re(){try{return re(sessionStorage.getItem(Lr))}catch{return null}}function Oe(t){try{sessionStorage.setItem(Lr,ee(t))}catch{}}function Ye(){try{let t=document.cookie.match(new RegExp(`(?:^|;\\s*)${Ir}=([^;]+)`));return t?re(decodeURIComponent(t[1])):null}catch{return null}}function ze(t){try{let e=encodeURIComponent(ee(t));document.cookie=`${Ir}=${e};path=/;max-age=${86400*400};SameSite=Lax`}catch{}}var Qt=null,wr=!1;function uo(){if(!(wr||typeof indexedDB>"u")){wr=!0;try{let t=indexedDB.open(yr,1);t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(Kt)||e.createObjectStore(Kt)},t.onsuccess=()=>{let s=t.result.transaction(Kt,"readonly").objectStore(Kt).get(Ar);s.onsuccess=()=>{let M=re(s.result);M&&(!Qt||M<Qt)&&(Qt=M,fo(M))}}}catch{}}}function Nr(t){Qt=t;try{let e=indexedDB.open(yr,1);e.onsuccess=()=>{e.result.transaction(Kt,"readwrite").objectStore(Kt).put(ee(t),Ar)}}catch{}}function Tr(t,e){let o=null;for(let s of t)s&&(s>e+60||s<17e8||(!o||s<o)&&(o=s));return o}function fo(t){let e=Math.floor(Date.now()/1e3),o=Tr([Ne(),Pe(),Re(),Ye(),t],e);o&&o!==t||o&&(Te(o),Fe(o),Oe(o),ze(o))}function _o(){let t=Math.floor(Date.now()/1e3);return Tr([Ne(),Pe(),Re(),Ye(),Qt],t)}function ho(t){Te(t),Fe(t),Oe(t),ze(t),Nr(t)}function po(t){Ne()||Te(t),Pe()||Fe(t),Re()||Oe(t),Ye()||ze(t),Qt||Nr(t)}uo();function mo(){let t=_o();t?po(t):(t=Math.floor(Date.now()/1e3),ho(t));let e=t+oo*86400,o=Date.now()/1e3,s=Math.max(0,Math.ceil((e-o)/86400));return o>e?{valid:!0,plan:te,watermark:!0,trialExpired:!0,daysLeft:0,features:kt(te)}:{valid:!0,plan:br,watermark:!1,daysLeft:s,trialEnd:e,features:kt(br)}}async function _e(t){if(!t||t==="trial")return mo();let e;try{e=await lo(t)}catch(c){return{valid:!1,error:`License verification error: ${c.message}`}}if(!e)return{valid:!1,error:"Invalid license signature"};let{p:o,d:s,e:M,pl:r,a:i}=e;if(!o)return{valid:!1,error:"Invalid license payload (missing plan)"};let l=Math.floor(Date.now()/1e3);if(M>0&&l>M)return{valid:!0,plan:te,watermark:!0,trialExpired:!0,originalPlan:o,error:`License expired on ${new Date(M*1e3).toLocaleDateString()}`,features:kt(te)};let n=r||"web";if((n==="web"||n==="any")&&s&&s!=="*"&&typeof window<"u"){let c=window.location.hostname;if(c&&c!=="localhost"&&c!=="127.0.0.1"&&c!=="0.0.0.0"&&c!==""&&!String(s).split(",").map(L=>L.trim()).some(L=>co(L,c)))return{valid:!1,error:`License not valid for domain: ${c}`}}if(n==="mobile"&&i&&typeof window<"u"){let c=window.__mrd_app_id;if(c&&c!==i)return{valid:!1,error:`License not valid for app: ${c}`}}return{valid:!0,plan:o,domain:s,platform:n,appId:i||null,expiry:M,issuedAt:e.iat,subject:e.sub,watermark:!1,features:e.f?{...kt(o),custom:e.f}:kt(o)}}var bo="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNCk7CiAgICAgIH0KCiAgICAgIC5jbHMtMiB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtMik7CiAgICAgIH0KCiAgICAgIC5jbHMtMiwgLmNscy0zLCAuY2xzLTQsIC5jbHMtNSwgLmNscy02IHsKICAgICAgICBtaXgtYmxlbmQtbW9kZTogbXVsdGlwbHk7CiAgICAgIH0KCiAgICAgIC5jbHMtMyB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtMyk7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNik7CiAgICAgIH0KCiAgICAgIC5jbHMtNSB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNSk7CiAgICAgIH0KCiAgICAgIC5jbHMtNiB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNyk7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQpOwogICAgICB9CgogICAgICAuY2xzLTggewogICAgICAgIGlzb2xhdGlvbjogaXNvbGF0ZTsKICAgICAgfQogICAgPC9zdHlsZT4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50IiB4MT0iOS4xMiIgeTE9IjE1Ljg4IiB4Mj0iMTkuNjMiIHkyPSI1LjM3IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2IzNTA5ZSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmNWE0YzciLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImxpbmVhci1ncmFkaWVudC0yIiB4MT0iOS4wOCIgeTE9IjYuODEiIHgyPSI5LjA4IiB5Mj0iMTQuNzMiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjMjM0ZmIzIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2ZmZiIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTMiIHgxPSIxNy42NyIgeTE9IjYuMTEiIHgyPSI4LjQxIiB5Mj0iNi4xMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM1YTJhOGIiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtNCIgeDE9IjIwLjAzIiB5MT0iMTUuODkiIHgyPSIxMC45OCIgeTI9IjE1Ljg5IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Y2YWFjYiIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM3NzJhOGQiLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImxpbmVhci1ncmFkaWVudC01IiB4MT0iMTkuMDMiIHkxPSIxNi44MiIgeDI9IjE0Ljc5IiB5Mj0iMTIuNTgiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2VkMzQ4ZCIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTYiIHgxPSIxNS4yNyIgeTE9IjE1LjA2IiB4Mj0iMTUuMjciIHkyPSIxOS4zNyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWU0YzliIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtNyIgeDE9IjUuNTEiIHkxPSItMTI4LjAyIiB4Mj0iLTMuNyIgeTI9Ii0xMjguMDIiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEwOS4xMiAxMC4wMSkgcm90YXRlKDg5LjYpIiB4bGluazpocmVmPSIjbGluZWFyLWdyYWRpZW50LTMiLz4KICA8L2RlZnM+CiAgPGcgY2xhc3M9ImNscy04IiBpZD0iTG9nbyI+CiAgICA8ZyBpZD0iT0JKRUNUUyIgPgogICAgICA8ZyBpZCA9IkxvZ28iPiAKICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTciIGQ9Ik00LjIzLDExYzAsNS4zNiw0LjM3LDkuNzEsOS43Niw5LjcxczkuNzYtNC4zNSw5Ljc2LTkuNzFTMTkuMzksMS4yOSwxNCwxLjI5LDQuMjMsNS42NCw0LjIzLDExWk0xMC4yNiwxMC4wN2MwLTEuNTQsMS4yNS0yLjc4LDIuOC0yLjc4aDEuODdjMS41NSwwLDIuOCwxLjI1LDIuOCwyLjc4djEuODZjMCwxLjU0LTEuMjUsMi43OC0yLjgsMi43OGgtMS4yMmMtLjQ1LDAtLjg4LjE1LTEuMjIuNDRsLTIuMjMsMS44NHYtNi45MloiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0xMC4yNiwxNi45OXYtNi45MnMwLS4wMiwwLS4wM2MuMDItMS41MiwxLjI2LTIuNzUsMi44LTIuNzVoLTUuMDljLTIuMDUsMC0zLjczLDEuNjQtMy43NCwzLjY4LDAsLjAxLDAsLjAzLDAsLjA0LDAsLjA4LDAsLjE2LDAsLjI0LDAsLjA0LDAsLjA4LDAsLjEyLDAsLjA0LDAsLjA4LDAsLjEyLDAsLjA2LDAsLjExLjAxLjE3LDAsLjAyLDAsLjA1LDAsLjA3LDAsLjA2LjAxLjEzLjAyLjE5LDAsLjAxLDAsLjAzLDAsLjA0LDAsLjA3LjAxLjE0LjAyLjIxLDAsMCwwLC4wMSwwLC4wMiwwLC4wNy4wMi4xNS4wMy4yMiwwLDAsMCwwLDAsMCwuNjgsNC42OCw0LjcxLDguMjcsOS42LDguMy0yLjA0LS4wMi0zLjY3LTEuNjktMy42Ny0zLjcyWiIvPgogICAgICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTE0LjA0LDEuMjlzLS4wMywwLS4wNCwwYy0uMDgsMC0uMTYsMC0uMjQsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDYsMC0uMTEsMC0uMTcsMC0uMDIsMC0uMDUsMC0uMDcsMC0uMDYsMC0uMTMuMDEtLjE5LjAyLS4wMSwwLS4wMywwLS4wNCwwLS4wNywwLS4xNC4wMS0uMjEuMDIsMCwwLS4wMSwwLS4wMiwwLS4wNywwLS4xNS4wMi0uMjIuMDMsMCwwLDAsMCwwLDAtNC43LjY4LTguMzIsNC42OS04LjM1LDkuNTQuMDItMi4wMiwxLjctMy42NSwzLjc0LTMuNjVoNi45NnMuMDIsMCwuMDMsMGMxLjUzLjAyLDIuNzcsMS4yNiwyLjc3LDIuNzh2LTUuMDZjMC0yLjA0LTEuNjUtMy43MS0zLjctMy43MloiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xNC45MywxNC43MWg1LjA5YzIuMDQsMCwzLjcyLTEuNjMsMy43NC0zLjY1LS4wMyw0Ljg2LTMuNjUsOC44Ny04LjM1LDkuNTQsMCwwLDAsMCwwLDAtLjA3LjAxLS4xNS4wMi0uMjIuMDMsMCwwLS4wMSwwLS4wMiwwLS4wNywwLS4xNC4wMi0uMjEuMDItLjAxLDAtLjAzLDAtLjA0LDAtLjA2LDAtLjEzLjAxLS4xOS4wMi0uMDIsMC0uMDUsMC0uMDcsMC0uMDYsMC0uMTEsMC0uMTcsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDgsMC0uMTYsMC0uMjQsMC0uMDEsMC0uMDMsMC0uMDQsMC0yLjA1LDAtMy43LTEuNjgtMy43LTMuNzJsMi4yMy0xLjg0Yy4zNC0uMjguNzgtLjQ0LDEuMjItLjQ0aDEuMjJaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy01IiBkPSJNMTQuOTMsMTQuNzFoNS4wOWMyLjA0LDAsMy43Mi0xLjYzLDMuNzQtMy42NS0uMDMsNC44Ni0zLjY1LDguODctOC4zNSw5LjU0LDAsMCwwLDAsMCwwLS4wNy4wMS0uMTUuMDItLjIyLjAzLDAsMC0uMDEsMC0uMDIsMC0uMDcsMC0uMTQuMDItLjIxLjAyLS4wMSwwLS4wMywwLS4wNCwwLS4wNiwwLS4xMy4wMS0uMTkuMDItLjAyLDAtLjA1LDAtLjA3LDAtLjA2LDAtLjExLDAtLjE3LDAtLjA0LDAtLjA4LDAtLjEyLDAtLjA0LDAtLjA4LDAtLjEyLDAtLjA4LDAtLjE2LDAtLjI0LDAtLjAxLDAtLjAzLDAtLjA0LDAtMi4wNSwwLTMuNy0xLjY4LTMuNy0zLjcybDIuMjMtMS44NGMuMzQtLjI4Ljc4LS40NCwxLjIyLS40NGgxLjIyWiIvPgogICAgICAgIDxwYXRoIGNsYXNzPSJjbHMtNCIgZD0iTTIwLjI4LDE0LjcxYy0uMDgsMC0uMTcsMC0uMjUsMGgtNi4zMWMtLjQ1LDAtLjg4LjE1LTEuMjIuNDRsLTIuMjMsMS44NGMwLC4wOCwwLC4xNywwLC4yNSwxLjA5LjY1LDIuMzcsMS4wMiwzLjczLDEuMDIsMi42NywwLDUuMDEtMS40Myw2LjI4LTMuNTVaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy02IiBkPSJNMjMuNzcsMTAuOTdzMC0uMDMsMC0uMDQsMC0uMDgsMC0uMTYsMC0uMjQsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDYsMC0uMTEtLjAxLS4xNywwLS4wMiwwLS4wNSwwLS4wNywwLS4wNi0uMDEtLjEzLS4wMi0uMTksMC0uMDEsMC0uMDMsMC0uMDQsMC0uMDctLjAyLS4xNC0uMDItLjIxLDAsMCwwLS4wMSwwLS4wMiwwLS4wNy0uMDItLjE1LS4wMy0uMjIsMCwwLDAsMCwwLDAtLjcxLTQuNjctNC43Ny04LjI0LTkuNjYtOC4yNCwyLjA0LDAsMy42OCwxLjY2LDMuNywzLjY5bC4wNCw1LjA2djEuODZzLjAxLjAyLjAxLjAzYzAsMS41Mi0xLjI1LDIuNzYtMi43OCwyLjc3bDUuMDktLjA0YzIuMDUtLjAxLDMuNzItMS42NiwzLjcxLTMuN1oiLz4KICAgICAgPC9nPgogICAgPC9nPgogIDwvZz4KPC9zdmc+",Ae=null,Sr=!1;function Pr(){if(Ae||Sr)return Ae;Sr=!0;let t=new Image;return t.onload=()=>{Ae=t},t.src=bo,null}function go(){return Math.floor(Date.now()/864e5)}function wo(t){let e=(t^2654435769)>>>0;return function(){e=e+1831565813>>>0;let o=Math.imul(e^e>>>15,1|e);return o=o+Math.imul(o^o>>>7,61|o)^o,((o^o>>>14)>>>0)/4294967296}}function So(t,e,o,s,M,r){let i=Pr();t.save(),t.setTransform(1,0,0,1,0,0),t.font="bold 10px Inter, system-ui, sans-serif";let l=t.measureText(s);t.font="8px Inter, system-ui, sans-serif";let n=t.measureText(M),c=i?18:0,u=i?14:0,p=7,L=5,S=i?5:0,C=c+S+Math.max(l.width,n.width)+p*2,F=Math.max(u,20)+L*2,b=Math.round(e-C/2),T=Math.round(o-F/2);t.globalAlpha=.45,t.fillStyle=r?"rgba(255,255,255,0.8)":"rgba(18,18,28,0.8)",t.beginPath(),t.roundRect(b,T,C,F,6),t.fill(),t.strokeStyle=r?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",t.lineWidth=.5,t.stroke();let v=b+p,R=T+F/2;i&&(t.globalAlpha=.5,t.drawImage(i,v,R-u/2,c,u),v+=c+S),t.globalAlpha=.5,t.font="bold 10px Inter, system-ui, sans-serif",t.fillStyle=r?"#1a1a2e":"#ededf5",t.textAlign="left",t.textBaseline="alphabetic",t.fillText(s,v,R-1),t.font="8px Inter, system-ui, sans-serif",t.fillStyle=r?"#777790":"#8080a0",t.textBaseline="top",t.fillText(M,v,R+2),t.restore()}function Fr(t,e,o,s){Pr();let M=e.width,r=e.height;if(M<100||r<80)return;t.save(),t.setTransform(1,0,0,1,0,0);let i=wo(go()),l=100,n=Math.max(M-l*2,60),c=Math.max(r-l*2,40),u=l+i()*n,p=l+i()*c,L=o.trialExpired||o.plan===te,S=no,E=L?`Free \u2014 ${gr}/pricing`:`Trial: ${o.daysLeft||0}d left \u2014 ${gr}`;So(t,u,p,S,E,s),t.restore()}var Be=null,We=null,de=null;async function Vt(){return Be?{module:Be,memory:We}:de||(de=(async()=>{let t=await import("./chart_engine.js");return await t.default(),We=t.wasm_memory(),Be=t,{module:t,memory:We}})(),de)}function Yt(t){let e=t.replace("#","");return[parseInt(e.substring(0,2),16)||0,parseInt(e.substring(2,4),16)||0,parseInt(e.substring(4,6),16)||0]}var he=null,pe=null;async function Rr(){if(he)return he;let{module:t,memory:e}=await Vt();return he=t,pe=e,t}function vo(){he||Rr().catch(()=>{})}async function Mo(t,e={}){e.appId&&typeof window<"u"&&(window.__mrd_app_id=e.appId);let o=e.licenseKey||e.key||null,s=await _e(o);if(!s.valid)if(s.expired)console.warn(`[MRD Chart Engine] ${s.error}. Get a license at https://mrd-chart.dev/pricing`);else throw new Error(`[MRD Chart Engine] ${s.error}`);s.plan==="trial"&&console.info(`[MRD Chart Engine] Trial mode \u2014 ${s.daysLeft} days remaining. Purchase: https://mrd-chart.dev/pricing`);let M=await Rr(),r=window.devicePixelRatio||1,i=r,l=r,n=t.getBoundingClientRect();(n.width<1||n.height<1)&&(await new Promise(w=>{let g=new ResizeObserver(A=>{for(let X of A)if(X.contentRect.width>0&&X.contentRect.height>0){g.disconnect(),w();return}});g.observe(t.parentElement||t),setTimeout(()=>{g.disconnect(),w()},2e3)}),n=t.getBoundingClientRect());let c=Math.max(n.width,100),u=Math.max(n.height,100);t.width=Math.max(1,Math.round(c*r)),t.height=Math.max(1,Math.round(u*r));let p=t.getContext("2d");i=t.width/c,l=t.height/u,p.setTransform(i,0,0,l,0,0);let L=new M.ChartEngine(c,u),S=!1,E={dead:!1,destroyed:!1,cleanupEvents:null};function C(w){if(!E.dead){E.dead=!0,S=!0;try{let g=w?.message?String(w.message):String(w||"unknown");console.error("[MRD Chart Engine] fatal WASM error \u2014 engine disabled:",g)}catch{}try{E.cleanupEvents?.()}catch{}}}function F(w){if(!w)return!1;if(typeof WebAssembly<"u"&&w instanceof WebAssembly.RuntimeError)return!0;let g=w.message?String(w.message):"";return g.includes("memory access out of bounds")||g.includes("recursive use of an object")||g.includes("null pointer passed to rust")||g.includes("unreachable")}let b=new Proxy(L,{get(w,g){let A=Reflect.get(w,g);return typeof A!="function"?A:function(...ot){if(!E.dead)try{return A.apply(w,ot)}catch(ut){if(F(ut)){C(ut);return}throw ut}}}});if("ontouchstart"in window||navigator.maxTouchPoints>0)try{b.set_touch_mode(!0)}catch{}try{let w=s.expired?2:s.watermark?1:0,g=s.daysLeft||0,A=1297237059;A=Math.imul(A,31)+w>>>0,A=Math.imul(A,31)+g>>>0,A=(A^A>>>16)>>>0,A=Math.imul(A,73244475)>>>0,A=(A^A>>>16)>>>0,b.set_license_state(w,g,A)}catch(w){console.warn("[MRD] set_license_state failed:",w.message)}let v=!0,R=null,y=!1,O=!1,x=!1,q=null,U=null,K=0,D=!1,rt=$e(),B=("ontouchstart"in window||navigator.maxTouchPoints>0)&&window.innerWidth<=1399?33:8;function H(){if(!(!y||O||R)){if(B>0){let w=performance.now()-K;if(w<B){U||(U=setTimeout(()=>{U=null,H()},B-w));return}}R=requestAnimationFrame(f)}}let j=()=>{v=!0,H()},$=()=>x||E.dead,Q=null,J=null,et=null,st=null,tt=null,ft=null,St=null,vt=null,Lt=null,mt=null,Tt=0,Mt=null,pt=null,bt=0,it=0,_t=-1,Y=!1,Z=!1,a=!1,_=Me(t,b,{onDirty:j,onCrosshairMove:(w,g,A)=>{bt=w,it=g,_t=A,Y=!0,Z=!0},onCrosshairHide:()=>{Z&&(Z=!1,Y=!0,_t=-1)},drawingApi:w=>{Q=w},onDrawingComplete:()=>{J?.()},onDrawingCancel:()=>{et?.()},onDrawingSelected:(w,g,A)=>{st?.(w,g,A)},onMarkerSelected:w=>{tt?.(w)},onDrawingDblClick:(w,g,A,X,ot)=>{ft?.(w,g,A,X,ot)},onChartDblClick:(w,g,A,X)=>{St?.(w,g,A,X)},onVrvpHover:(w,g)=>{a||vt?.(w,g)},onLiqAnnotationPin:(w,g)=>{pt?.(w,g)},onQuickTradeBtnClick:(w,g,A)=>{Lt?.(w,g,A)},onPanStart:()=>{a=!0;try{q?.(null,0,0)}catch{}try{mt?.("")}catch{}try{vt?.(null,null)}catch{}},onPanEnd:()=>{a=!1}});E.cleanupEvents=_;function d(){if(!(!Y||S)){if(Y=!1,!Z||a){q&&q(null,0,0),mt&&mt("");return}if(q)if(_t===0||_t===1)try{let w=b.get_tooltip_data();q(w,bt,it)}catch{}else q(null,0,0);if(mt){let w=performance.now();if(_t===0||_t===1){if(w-Tt>=80){Tt=w;try{mt(b.lt_hit_test(bt,it))}catch{}}}else mt("")}}}function f(){if(R=null,!(!y||O||S)){D=!0;try{let w=!1;try{w=v||b.is_dirty()}catch{S=!0;return}if(w){v=!1,K=performance.now();let g=!1;try{if(b.render()>0){let X=b.get_command_buffer_ptr(),ot=b.get_command_buffer_len();p.save(),p.setTransform(1,0,0,1,0,0),p.clearRect(0,0,t.width,t.height),p.restore(),Ft(p,pe,X,ot,rt),g=!0}z()}catch(A){if(g||(v=!0),A instanceof WebAssembly.RuntimeError){S=!0,console.error("[MRD] Engine crashed:",A.message);return}}d();try{Mt?.()}catch{}if(s.watermark)try{let A=b.get_theme()===1;Fr(p,t,s,A)}catch{}try{(v||b.is_dirty())&&H()}catch{}}}finally{D=!1}}}let h=ye(s.plan),m=_r(b,j,$,()=>h),I=dr(b,j,$,()=>h),P=hr(b,j,$,()=>h),N=Le(b,pe,Ft);function z(){let w=0,g=0,A=0,X=0;try{w=b.chart_area_x(),g=b.chart_area_y(),A=b.chart_area_w(),X=b.pane_stack_bottom_y()-g}catch{return}if(!(!(A>0)||!(X>0))){p.save();try{p.beginPath(),p.rect(w,g,A,X),p.clip(),N.renderAll(p)}catch{}finally{p.restore()}}}let W=N.setupPaneInteraction(t,{markDirty:j,getDrawingMode:()=>Q?.getMode()}),k=["__trade_overlay","__position_overlay"],G=!0;return{engine:b,start(){y=!0,O=!1,v=!0,H()},stop(){y=!1,R&&(cancelAnimationFrame(R),R=null),U&&(clearTimeout(U),U=null)},resize(w){if(S||D)return;if(n=t.getBoundingClientRect(),n.width<1||n.height<1){(w||0)<8&&setTimeout(()=>this.resize((w||0)+1),250);return}r=window.devicePixelRatio||1;let g=Math.max(1,Math.round(n.width*r)),A=Math.max(1,Math.round(n.height*r));t.width=g,t.height=A,i=t.width/n.width,l=t.height/n.height,p.setTransform(1,0,0,1,0,0),p.setTransform(i,0,0,l,0,0);try{rt.invalidate()}catch{}try{b.resize(n.width,n.height)}catch(X){if(X instanceof WebAssembly.RuntimeError){S=!0;return}throw X}O||this.renderSync(),j()},renderSync(){if(S)return 0;try{let w=b.render();if(w>0){let g=b.get_command_buffer_ptr(),A=b.get_command_buffer_len();p.save(),p.setTransform(1,0,0,1,0,0),p.clearRect(0,0,t.width,t.height),p.restore(),Ft(p,pe,g,A,rt)}return z(),w}catch(w){return w instanceof WebAssembly.RuntimeError&&(S=!0),0}},renderFrameNow(){!y||O||S||(R&&(cancelAnimationFrame(R),R=null),U&&(clearTimeout(U),U=null),v=!0,f())},setCrosshairExternal(w,g,A){if(S)return!1;try{return b.set_crosshair(w,g),bt=w,it=g,_t=typeof A=="number"?A:0,Y=!0,Z=!0,!0}catch{return!1}},hideCrosshairExternal(){if(!S)try{b.hide_crosshair(),Z&&(Z=!1,Y=!0,_t=-1)}catch{}},setHoverPrice(w){$()||(b.set_hover_price(w),j())},clearHoverPrice(){$()||(b.clear_hover_price(),j())},hitZone(w,g){if($())return-1;let A=b.hit_zone(w,g);return A===void 0?-1:A},startDrawing(w,g){Q?.setMode(w,g)},cancelDrawing(){Q?.setMode(null)},onDrawingComplete(w){J=w},onDrawingCancel(w){et=w},onDrawingSelected(w){st=w},onMarkerSelected(w){tt=w},onDrawingDblClick(w){ft=w},onChartDblClick(w){St=w},setReplayState(w,g,A){$()||(b.set_replay_state(w,g,A),j())},setReplayHovered(w){$()||b.set_replay_hovered(w)},setReplayPreview(w){$()||(b.set_replay_preview(w),j())},setPrecision(w){b.set_price_precision(w),j()},setYAutoScale(w){typeof b.set_y_auto_scale=="function"&&(b.set_y_auto_scale(!!w),j())},getYAutoScale(){return typeof b.y_auto_scale=="function"?!!b.y_auto_scale():!0},setCandleInterval(w){b.set_candle_interval(w)},setTzOffsetSeconds(w){if($())return;let g=Number.isFinite(w)?Math.trunc(w):0;if(typeof b.set_tz_offset_seconds=="function"){try{b.set_tz_offset_seconds(g)}catch{}j()}},setTheme(w){let g=w==="light"?1:0;typeof b.set_theme=="function"?(b.set_theme(g),j()):console.warn("[ChartEngine] set_theme not available \u2014 reload page to load updated WASM")},getTheme(){return b.get_theme()===1?"light":"dark"},setCandleBullColor(w){let[g,A,X]=Yt(w);typeof b.set_candle_bull_color=="function"&&(b.set_candle_bull_color(g,A,X),j())},setCandleBearColor(w){let[g,A,X]=Yt(w);typeof b.set_candle_bear_color=="function"&&(b.set_candle_bear_color(g,A,X),j())},setBackgroundColor(w){let[g,A,X]=Yt(w);typeof b.set_background_color=="function"&&(b.set_background_color(g,A,X),j())},setGridColor(w,g=255){let[A,X,ot]=Yt(w);typeof b.set_grid_color=="function"&&(b.set_grid_color(A,X,ot,g),j())},setCrosshairColor(w,g=160){let[A,X,ot]=Yt(w);typeof b.set_crosshair_color=="function"&&(b.set_crosshair_color(A,X,ot,g),j())},setCrosshairStyle(w){typeof b.set_crosshair_style=="function"&&(b.set_crosshair_style(w),j())},setCrosshairWidth(w){typeof b.set_crosshair_width=="function"&&(b.set_crosshair_width(w),j())},setCrosshairMagnet(w){if(typeof b.set_crosshair_magnet!="function")return;let g=0;if(typeof w=="number")g=w===1||w===2?w:0;else if(typeof w=="string"){let A=w.toLowerCase();A==="weak"?g=1:A==="strong"?g=2:g=0}b.set_crosshair_magnet(g),j()},setFontSize(w){typeof b.set_font_size=="function"&&(b.set_font_size(w),j())},getFontSize(){return typeof b.get_font_size=="function"?b.get_font_size():11},setGridHVisible(w){typeof b.set_grid_h_visible=="function"&&(b.set_grid_h_visible(!!w),j())},setGridVVisible(w){typeof b.set_grid_v_visible=="function"&&(b.set_grid_v_visible(!!w),j())},setSessionLevels(w){typeof b.set_session_levels_enabled=="function"&&(b.set_session_levels_enabled(!!w),j())},setLastPriceLine(w){if(!(!w||typeof w!="object")){if(typeof w.enabled=="boolean"&&typeof b.set_last_price_line_enabled=="function"&&b.set_last_price_line_enabled(w.enabled),typeof b.set_last_price_line_style=="function"){let g=Number.isFinite(w.width)?w.width:1,A=Number.isFinite(w.dashLen)?w.dashLen:4,X=Number.isFinite(w.gapLen)?w.gapLen:3;b.set_last_price_line_style(g,A,X)}j()}},setDrawingsVisible(w){typeof b.set_drawings_visible=="function"&&(b.set_drawings_visible(!!w),j())},setIndicatorsVisible(w){typeof b.set_indicators_visible=="function"&&(b.set_indicators_visible(!!w),j())},setKlineVisible(w){typeof b.set_kline_visible=="function"&&(b.set_kline_visible(!!w),j())},getKlineVisible(){return typeof b.get_kline_visible=="function"?!!b.get_kline_visible():!0},setPositionMarkersVisible(w){let g=!!w;G=g;for(let A of N.list())k.includes(A.name)&&N.setEnabled(A.id,g);j()},setBgGradient(w,g){if(typeof b.set_bg_gradient=="function"){let[A,X,ot]=Yt(g||"#000000");b.set_bg_gradient(!!w,A,X,ot),j()}},setCandleBullWickColor(w){let[g,A,X]=Yt(w);typeof b.set_candle_bull_wick_color=="function"&&(b.set_candle_bull_wick_color(g,A,X),j())},setCandleBullBorderColor(w){let[g,A,X]=Yt(w);typeof b.set_candle_bull_border_color=="function"&&(b.set_candle_bull_border_color(g,A,X),j())},setCandleBearWickColor(w){let[g,A,X]=Yt(w);typeof b.set_candle_bear_wick_color=="function"&&(b.set_candle_bear_wick_color(g,A,X),j())},setCandleBearBorderColor(w){let[g,A,X]=Yt(w);typeof b.set_candle_bear_border_color=="function"&&(b.set_candle_bear_border_color(g,A,X),j())},onTooltip(w){q=w},onVrvpHover(w){vt=w},onLtHover(w){mt=w},onPostRender(w){Mt=w},onLiqAnnotationPin(w){pt=w},onQuickTradeBtnClick(w){Lt=w},setQuickTradeBtnEnabled(w){typeof b.set_quick_trade_btn_enabled=="function"&&(b.set_quick_trade_btn_enabled(!!w),j())},hitQuickTradeBtn(w,g){return typeof b.is_in_quick_trade_btn!="function"?!1:!!b.is_in_quick_trade_btn(w,g)},crosshairWorldY(){return typeof b.crosshair_world_y!="function"?0:b.crosshair_world_y()},pause(){O||(O=!0,R&&(cancelAnimationFrame(R),R=null),U&&(clearTimeout(U),U=null))},resume(){O&&(O=!1,y&&(v=!0,H()))},get isPaused(){return O},destroy(){x=!0,E.destroyed=!0,y=!1,O=!1,R&&(cancelAnimationFrame(R),R=null),U&&(clearTimeout(U),U=null),_();try{W?.destroy?.()}catch{}try{rt.invalidate()}catch{}if(!E.dead)try{L.free()}catch{}E.dead=!0},addIndicator(w){if(!h("customIndicators"))return null;let g=N.add(w);return!G&&w&&k.includes(w.name)&&N.setEnabled(g,!1),j(),g},removeIndicator(w){N.remove(w),j()},updateIndicatorParams(w,g){N.updateParams(w,g),j()},setIndicatorEnabled(w,g){N.setEnabled(w,g),j()},listIndicators(){return N.list()},setIndicatorCalcOnEveryTick(w,g){N.setCalcOnEveryTick(w,g),j()},invalidateCustomIndicators(){N.invalidateCompute(),j()},get license(){return{plan:s.plan,valid:s.valid,expired:!!s.expired,watermark:!!s.watermark,daysLeft:s.daysLeft,features:s.features||{}}},async setLicenseKey(w){s=await _e(w),!s.valid&&!s.expired&&console.error(`[MRD Chart Engine] ${s.error}`),h=ye(s.plan);try{let g=s.expired?2:s.watermark?1:0,A=s.daysLeft||0,X=1297237059;X=Math.imul(X,31)+g>>>0,X=Math.imul(X,31)+A>>>0,X=(X^X>>>16)>>>0,X=Math.imul(X,73244475)>>>0,X=(X^X>>>16)>>>0,b.set_license_state(g,A,X)}catch{}return j(),s.valid},...P,...m,...I}}function Co(t,e){let{t:o,o:s,h:M,l:r,c:i,v:l}=t,n=i.length;if(n===0||e<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let c=[],u=[],p=[],L=[],S=[],E=[],C=Math.round(i[0]/e)*e,F=0;for(let b=0;b<n;b++){F+=l[b];let v=i[b]-C;for(;v>=e;){let R=C,y=C+e;c.push(o[b]),u.push(R),p.push(y),L.push(R),S.push(y),E.push(F),F=0,C=y}for(;-v>=e;){let R=C,y=C-e;c.push(o[b]),u.push(R),p.push(R),L.push(y),S.push(y),E.push(F),F=0,C=y}}return{t:c,o:u,h:p,l:L,c:S,v:E}}function Lo(t,e){let{t:o,o:s,h:M,l:r,c:i,v:l}=t,n=i.length;if(n===0||e<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let c=[],u=[],p=[],L=[],S=[],E=[],C=s[0],F=M[0],b=r[0],T=0,v=o[0];for(let R=0;R<n;R++)for(F=Math.max(F,M[R]),b=Math.min(b,r[R]),T+=l[R];F-b>=e;){let y=i[R]>=C,O=y?b+e:F-e;if(c.push(v),u.push(C),p.push(F),L.push(b),S.push(O),E.push(T),C=O,F=y?Math.max(M[R],O):O,b=y?O:Math.min(r[R],O),T=0,v=o[R],F-b<e)break}return(T>0||c.length===0)&&(c.push(v),u.push(C),p.push(F),L.push(b),S.push(i[n-1]),E.push(T)),{t:c,o:u,h:p,l:L,c:S,v:E}}function yo(t,e){let{t:o,o:s,h:M,l:r,c:i,v:l}=t,n=i.length;if(n===0||e<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let c=[],u=[],p=[],L=[],S=[],E=[],C=Math.max(1,Math.round(e));for(let F=0;F<n;F+=C){let b=Math.min(F+C,n),T=-1/0,v=1/0,R=0;for(let y=F;y<b;y++)M[y]>T&&(T=M[y]),r[y]<v&&(v=r[y]),R+=l[y];c.push(o[F]),u.push(s[F]),p.push(T),L.push(v),S.push(i[b-1]),E.push(R)}return{t:c,o:u,h:p,l:L,c:S,v:E}}function Ao(t,e){let o=t>1e4?50:t>1e3?10:t>100?1:t>1?.1:.001,s=o*2,M=e<=60?10:e<=300?5:3;return{brickSize:o,rangeSize:s,tickCount:M}}var Io={minRefills:3,hiddenRatio:2,refillWindowMs:1e4,maxTrackedLevels:200,maxEvents:500,decayMs:3e5};function Eo(t={}){let e={...Io,...t},o=new Map,s=new Map,M=[],r=0;function i(L){return Math.round(L*1e8)/1e8}function l(L,S,E,C){for(let[F,b]of L){let T=i(F),v=S.get(T);if(!v){S.set(T,{lastVol:b,refills:0,totalConsumed:0,lastRefillTs:C,peakVisible:b});continue}if(b<v.lastVol*.3&&v.lastVol>0){let R=v.lastVol-b;v.totalConsumed+=R,v.lastVol=b;continue}if(b>v.lastVol*1.5&&v.totalConsumed>0)if(C-v.lastRefillTs<e.refillWindowMs){if(v.refills++,v.lastRefillTs=C,v.peakVisible=Math.max(v.peakVisible,b),v.refills>=e.minRefills){let y=v.totalConsumed,O=v.peakVisible;y>=O*e.hiddenRatio&&(M.push({timestamp:C,price:F,visibleSize:O,hiddenSize:y,isBid:E,refillCount:v.refills}),M.length>e.maxEvents&&M.shift(),v.refills=0,v.totalConsumed=0)}}else v.refills=1,v.totalConsumed=0,v.lastRefillTs=C;v.lastVol=b}if(S.size>e.maxTrackedLevels){let F=[...S.entries()];F.sort((T,v)=>T[1].lastRefillTs-v[1].lastRefillTs);let b=F.length-e.maxTrackedLevels;for(let T=0;T<b;T++)S.delete(F[T][0])}}function n(L,S,E){let C=E||Date.now();r=C;let F=L instanceof Map?L:new Map(L.map(([v,R])=>[v,R])),b=S instanceof Map?S:new Map(S.map(([v,R])=>[v,R]));l(F,o,!0,C),l(b,s,!1,C);let T=C-e.decayMs;for(;M.length>0&&M[0].timestamp<T;)M.shift()}function c(){return M}function u(L){if(!L||M.length===0)return;let S=M.length,E=new Float64Array(S),C=new Float64Array(S),F=new Float64Array(S),b=new Float64Array(S),T=new Uint8Array(S),v=new Uint32Array(S);for(let R=0;R<S;R++){let y=M[R];E[R]=y.timestamp,C[R]=y.price,F[R]=y.visibleSize,b[R]=y.hiddenSize,T[R]=y.isBid?1:0,v[R]=y.refillCount}L.setIcebergEvents(E,C,F,b,T,v)}function p(){o.clear(),s.clear(),M.length=0}return{onOrderbookUpdate:n,getEvents:c,pushToEngine:u,reset:p}}var je=null,zr=null;async function No(){if(je)return je;let{module:t,memory:e}=await Vt();return je=t,zr=e,t}var Or=Promise.resolve();async function To(t,e={}){let o=await No();return await(Or=Or.then(()=>Yr(o,t,e),()=>Yr(o,t,e)))}function Yr(t,e,o){let s=window.devicePixelRatio||1,r=(e.parentElement||e).getBoundingClientRect(),i=Math.max(r.width,60),l=Math.max(r.height,60),n={width:i,height:l};e.width=Math.round(i*s),e.height=Math.round(l*s);let c=e.getContext("2d");c.setTransform(s,0,0,s,0,0);let u=new t.OrderbookEngine(i,l);o.symbol&&u.set_symbol(o.symbol),o.tickSize&&u.set_tick_size(o.tickSize),o.visibleTicks&&u.set_visible_ticks(o.visibleTicks),o.exchangeCount&&u.set_exchange_count(o.exchangeCount),o.pricePrecision!=null&&u.set_price_precision(o.pricePrecision),o.theme==="light"&&u.set_theme(1),o.heatmapCols&&u.set_heatmap_cols(o.heatmapCols),(o.ringCols||o.ringRows)&&u.set_ring_capacity(o.ringCols||300,o.ringRows||400),o.heatmapAlphaMul!=null&&u.set_heatmap_alpha_mul(Number(o.heatmapAlphaMul)),o.showCumulative!=null&&u.set_show_cumulative(!!o.showCumulative),o.showSignalOverlays!=null&&u.set_show_signal_overlays(!!o.showSignalOverlays);let p=!0,L=null,S=!1,E=!1,C=!1,F=null,b=null;function T(){!S||C||L||(L=requestAnimationFrame(y))}let v=()=>{p=!0,T()};function R(){if(C)return!1;try{if(u.render()>0){let Z=u.get_command_buffer_ptr(),a=u.get_command_buffer_len();c.save(),c.setTransform(1,0,0,1,0,0),c.clearRect(0,0,e.width,e.height),c.restore(),Ft(c,zr,Z,a)}return!0}catch(Y){return Y instanceof WebAssembly.RuntimeError&&(C=!0,console.error("[OrderbookEngine] crashed:",Y.message)),!1}}function y(){if(L=null,!S||C)return;let Y=!1;try{Y=p||u.is_dirty()}catch{C=!0;return}Y&&(R()?p=!1:p=!0)}e.style.touchAction="none";let O=!1,x=0,q=new Map,U=0,K=0,D=0,rt=0,nt=!1,B=!1,H=0,j=null,$=280,Q=5,J=null,et=!1,st=0,tt=0;function ft(){J!=null&&(clearTimeout(J),J=null)}function St(){if(et){et=!1;try{u.clear_range()}catch{}if(j)try{j(null)}catch{}v()}}function vt(Y){if(!C){et=!0,O=!1;try{u.set_range_from_mid(Y)}catch{}try{u.clear_hover()}catch{}try{navigator.vibrate&&navigator.vibrate(8)}catch{}if(v(),j)try{let Z=u.get_range_low_price(),a=u.get_range_high_price();a>Z&&j({low:Z,high:a,delta:a-Z,deltaPct:Z>0?(a-Z)/Z*100:0,bidQty:u.get_range_bid_qty(),askQty:u.get_range_ask_qty(),ticks:u.get_range_tick_count(),mode:"hover"})}catch{}}}function Lt(Y){if(C)return;Y.preventDefault();let Z=Y.deltaY>0?1.08:.93;u.zoom_y(Z,Y.offsetY),v()}function mt(Y){if(!C){if(q.set(Y.pointerId,{y:Y.offsetY}),e.setPointerCapture(Y.pointerId),q.size===1)if(Y.shiftKey){B=!0,H=Y.offsetY,O=!1;try{u.set_range(H,Y.offsetY)}catch{}try{u.clear_hover()}catch{}v()}else{try{u.clear_range()}catch{}if(j)try{j(null)}catch{}O=!0,x=Y.offsetY,rt=Y.offsetX,D=Y.offsetY,nt=!1,Y.pointerType==="touch"&&(st=Y.offsetX,tt=Y.offsetY,ft(),J=setTimeout(()=>{J=null,!(q.size!==1||!O||nt)&&vt(tt)},$))}else if(q.size===2){if(ft(),et&&St(),B){B=!1;try{u.clear_range()}catch{}}O=!1;let Z=[...q.values()];U=Math.abs(Z[0].y-Z[1].y),K=(Z[0].y+Z[1].y)/2}}}function Tt(Y){if(!C)if(q.set(Y.pointerId,{y:Y.offsetY}),q.size>=2){let Z=[...q.values()],a=Math.abs(Z[0].y-Z[1].y),_=(Z[0].y+Z[1].y)/2;if(U>0){let f=U/Math.max(a,1);u.zoom_y(f,_)}let d=_-K;Math.abs(d)>.5&&u.pan_y(d),U=a,K=_,v()}else if(B){try{u.set_range(H,Y.offsetY)}catch{}if(v(),j)try{let Z=u.get_range_low_price(),a=u.get_range_high_price();a>Z&&j({low:Z,high:a,delta:a-Z,deltaPct:Z>0?(a-Z)/Z*100:0,bidQty:u.get_range_bid_qty(),askQty:u.get_range_ask_qty(),ticks:u.get_range_tick_count(),mode:"measure"})}catch{}}else if(et){try{u.set_range_from_mid(Y.offsetY)}catch{}if(v(),j)try{let Z=u.get_range_low_price(),a=u.get_range_high_price();a>Z?j({low:Z,high:a,delta:a-Z,deltaPct:Z>0?(a-Z)/Z*100:0,bidQty:u.get_range_bid_qty(),askQty:u.get_range_ask_qty(),ticks:u.get_range_tick_count(),mode:"hover"}):j(null)}catch{}}else if(O){let Z=Y.offsetY-x;x=Y.offsetY,(Math.abs(Y.offsetX-rt)>4||Math.abs(Y.offsetY-D)>4)&&(nt=!0),J!=null&&(Math.abs(Y.offsetX-st)>Q||Math.abs(Y.offsetY-tt)>Q)&&ft(),u.pan_y(Z),v()}else{u.set_hover(Y.offsetX,Y.offsetY);try{u.set_range_from_mid(Y.offsetY)}catch{}if(v(),F)try{let Z=u.get_hover_price();if(Z>0){let a=u.get_hover_qty(),_=u.get_hover_side();F({price:Z,qty:a,side:_===2?"ask":"bid"})}else F(null)}catch{}if(j)try{let Z=u.get_range_low_price(),a=u.get_range_high_price();a>Z?j({low:Z,high:a,delta:a-Z,deltaPct:Z>0?(a-Z)/Z*100:0,bidQty:u.get_range_bid_qty(),askQty:u.get_range_ask_qty(),ticks:u.get_range_tick_count(),mode:"hover"}):j(null)}catch{}}}function Mt(){if(!C){if(F&&F(null),u.clear_hover(),!B){try{u.clear_range()}catch{}if(j)try{j(null)}catch{}}v()}}function pt(Y){let Z=O&&!nt&&q.size===1&&!et,a=B,_=et;q.delete(Y.pointerId);try{e.releasePointerCapture(Y.pointerId)}catch{}if(ft(),q.size===0){if(a&&!C){try{u.clear_range()}catch{}if(j)try{j(null)}catch{}B=!1,v()}if(_&&St(),Z&&b&&!C)try{u.set_hover(Y.offsetX,Y.offsetY);let d=u.get_hover_price();if(d>0){let f=u.get_hover_qty(),h=u.get_hover_side();b({price:d,qty:f,side:h===2?"ask":"bid"})}}catch{}O=!1,U=0}else q.size===1&&(O=!0,x=[...q.values()][0].y,U=0)}function bt(Y){if(!(Y.key!=="Escape"||C)&&B){B=!1;try{u.clear_range()}catch{}if(j)try{j(null)}catch{}v()}}function it(){C||(u.center_on_mid(),v())}e.addEventListener("wheel",Lt,{passive:!1}),e.addEventListener("pointerdown",mt),e.addEventListener("pointermove",Tt),e.addEventListener("pointerup",pt),e.addEventListener("pointercancel",pt),e.addEventListener("pointerleave",Mt),e.addEventListener("dblclick",it),window.addEventListener("keydown",bt);function _t(){e.removeEventListener("wheel",Lt),e.removeEventListener("pointerdown",mt),e.removeEventListener("pointermove",Tt),e.removeEventListener("pointerup",pt),e.removeEventListener("pointercancel",pt),e.removeEventListener("pointerleave",Mt),e.removeEventListener("dblclick",it),window.removeEventListener("keydown",bt)}return{engine:u,start(){S=!0,p=!0,T()},stop(){S=!1,L&&(cancelAnimationFrame(L),L=null)},resize(){if(E||C)return;let Z=(e.parentElement||e).getBoundingClientRect(),a=Math.max(Z.width,1),_=Math.max(Z.height,1);if(a<1||_<1)return;s=window.devicePixelRatio||1;let d=Math.round(a*s),f=Math.round(_*s),h=e.width!==d||e.height!==f;e.width!==d&&(e.width=d),e.height!==f&&(e.height=f),c.setTransform(s,0,0,s,0,0),n={width:a,height:_};try{u.resize(a,_),h&&R()}catch(m){if(m instanceof WebAssembly.RuntimeError){C=!0;return}throw m}v()},pushSnapshot(Y,Z,a){if(C)return;let _=new Float64Array(Y.length*2);for(let f=0;f<Y.length;f++)_[f*2]=Y[f][0],_[f*2+1]=Y[f][1];let d=new Float64Array(Z.length*2);for(let f=0;f<Z.length;f++)d[f*2]=Z[f][0],d[f*2+1]=Z[f][1];try{u.push_snapshot(_,d,a)}catch(f){if(f instanceof WebAssembly.RuntimeError){C=!0;return}throw f}v()},pushSnapshotFlat(Y,Z,a){if(!C){try{u.push_snapshot(Y,Z,a)}catch(_){if(_ instanceof WebAssembly.RuntimeError){C=!0;return}throw _}v()}},setDepthBook(Y,Z,a){if(C)return;let _=new Float64Array(Y.length*2);for(let f=0;f<Y.length;f++)_[f*2]=Y[f][0],_[f*2+1]=Y[f][1];let d=new Float64Array(Z.length*2);for(let f=0;f<Z.length;f++)d[f*2]=Z[f][0],d[f*2+1]=Z[f][1];try{u.set_depth_book(_,d,a)}catch(f){if(f instanceof WebAssembly.RuntimeError){C=!0;return}throw f}v()},setDepthBookFlat(Y,Z,a){if(!C){try{u.set_depth_book(Y,Z,a)}catch(_){if(_ instanceof WebAssembly.RuntimeError){C=!0;return}throw _}v()}},pushHeatmapCol(Y,Z,a){if(C)return;let _=new Float64Array(Y.length*2);for(let f=0;f<Y.length;f++)_[f*2]=Y[f][0],_[f*2+1]=Y[f][1];let d=new Float64Array(Z.length*2);for(let f=0;f<Z.length;f++)d[f*2]=Z[f][0],d[f*2+1]=Z[f][1];try{u.push_heatmap_col(_,d,a)}catch(f){if(f instanceof WebAssembly.RuntimeError){C=!0;return}throw f}v()},pushHeatmapColFlat(Y,Z,a){if(!C){try{u.push_heatmap_col(Y,Z,a)}catch(_){if(_ instanceof WebAssembly.RuntimeError){C=!0;return}throw _}v()}},resetRing(){if(!C){try{u.reset_ring()}catch(Y){if(Y instanceof WebAssembly.RuntimeError){C=!0;return}throw Y}v()}},setExchangeLabels(Y){if(C)return;let Z=Array.isArray(Y)?Y.join(","):String(Y);try{u.set_exchange_labels(Z)}catch(a){if(a instanceof WebAssembly.RuntimeError){C=!0;return}throw a}v()},setSignalObi(Y,Z,a){if(!C){try{u.set_signal_obi(Y,Z,a)}catch(_){if(_ instanceof WebAssembly.RuntimeError){C=!0;return}throw _}v()}},setSignalSpoof(Y){if(!C){try{u.set_signal_spoof(Y)}catch(Z){if(Z instanceof WebAssembly.RuntimeError){C=!0;return}throw Z}v()}},setSignalAbsorption(Y,Z){if(!C){try{u.set_signal_absorption(Y,Z)}catch(a){if(a instanceof WebAssembly.RuntimeError){C=!0;return}throw a}v()}},setSignalFlow(Y,Z){if(!C){try{u.set_signal_flow(Y,Z)}catch(a){if(a instanceof WebAssembly.RuntimeError){C=!0;return}throw a}v()}},setSignalWalls(Y,Z){if(!C){try{u.set_signal_walls(new Float64Array(Y),new Float64Array(Z))}catch(a){if(a instanceof WebAssembly.RuntimeError){C=!0;return}throw a}v()}},setSignalGaps(Y,Z){if(!C){try{u.set_signal_gaps(new Float64Array(Y),new Float64Array(Z))}catch(a){if(a instanceof WebAssembly.RuntimeError){C=!0;return}throw a}v()}},setSymbol(Y){C||(u.set_symbol(Y),v())},setTickSize(Y){C||(u.set_tick_size(Y),v())},setVisibleTicks(Y){C||(u.set_visible_ticks(Y),v())},setExchangeCount(Y){C||(u.set_exchange_count(Y),v())},setPrecision(Y){C||(u.set_price_precision(Y),v())},setAutoCenter(Y){C||u.set_auto_center(Y)},centerOnMid(){C||(u.center_on_mid(),v())},setHeatmapCols(Y){C||(u.set_heatmap_cols(Y),v())},setHeatmapAlphaMul(Y){if(!C){try{u.set_heatmap_alpha_mul(Number(Y))}catch(Z){if(Z instanceof WebAssembly.RuntimeError){C=!0;return}throw Z}v()}},setShowCumulative(Y){if(!C){try{u.set_show_cumulative(!!Y)}catch(Z){if(Z instanceof WebAssembly.RuntimeError){C=!0;return}throw Z}v()}},setShowSignalOverlays(Y){if(!C){try{u.set_show_signal_overlays(!!Y)}catch(Z){if(Z instanceof WebAssembly.RuntimeError){C=!0;return}throw Z}v()}},getHoverPrice(){return C?0:u.get_hover_price()},getHoverQty(){return C?0:u.get_hover_qty()},getHoverSide(){return C?0:u.get_hover_side()},onHoverPrice(Y){F=Y},onClickPrice(Y){b=Y},onRangeUpdate(Y){j=Y},clearRange(){if(!C){if(B&&(B=!1,j))try{j(null)}catch{}try{u.clear_range()}catch{}v()}},setTheme(Y){C||(u.set_theme(Y==="light"?1:0),v())},clear(){C||(u.clear(),v())},get isDead(){return C},destroy(){E=!0,S=!1,L&&(cancelAnimationFrame(L),L=null),ft(),_t();try{u.free()}catch{}}}}var Ze=null,Zr=null;async function Po(){if(Ze)return Ze;let{module:t,memory:e}=await Vt();return Ze=t,Zr=e,t}var Br=Promise.resolve();async function Fo(t,e={}){let o=await Po();return Br=Br.then(()=>Wr(o,t,e),()=>Wr(o,t,e))}function Wr(t,e,o){let s=window.devicePixelRatio||1,M=()=>{let B=e.parentElement,H=B?B.getBoundingClientRect():e.getBoundingClientRect();return{w:Math.max(60,Math.floor(H.width||60)),h:Math.max(120,Math.floor(H.height||120))}},{w:r,h:i}=M();e.width=Math.round(r*s),e.height=Math.round(i*s);let l=e.getContext("2d");l.setTransform(s,0,0,s,0,0);let n=new t.DomLadderEngine(r,i);o.tickSize&&n.set_tick_size(o.tickSize),o.pricePrecision!=null&&n.set_price_precision(o.pricePrecision),o.visibleRows&&n.set_visible_rows(o.visibleRows),o.theme==="light"&&n.set_theme(1),Number.isFinite(o.textScale)&&n.set_text_scale(o.textScale),Number.isFinite(o.fillIntensity)&&n.set_fill_intensity(o.fillIntensity),o.qtyDisplayUsd===!0&&n.set_qty_display_usd(1);let c=!0,u=null,p=!1,L=!1,S=!1,E=null,C=null;function F(){!p||S||u||(u=requestAnimationFrame(v))}let b=()=>{c=!0,F()};function T(){if(S)return!1;try{if(n.render()>0){let H=n.get_command_buffer_ptr(),j=n.get_command_buffer_len();l.save(),l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,e.width,e.height),l.restore(),Ft(l,Zr,H,j)}return!0}catch(B){return B instanceof WebAssembly.RuntimeError&&(S=!0,console.error("[DomLadderEngine] crashed:",B.message)),!1}}function v(){if(u=null,!p||S)return;let B=!1;try{n.set_now_ms(Date.now()),B=c||n.is_dirty()}catch{S=!0;return}B&&(T()?c=!1:c=!0),p&&!S&&(u=requestAnimationFrame(v))}e.style.touchAction="none";let R=0,y=0,O=!1;function x(B){S||(R=B.offsetX,y=B.offsetY,O=!1)}function q(B){if(!S&&((Math.abs(B.offsetX-R)>4||Math.abs(B.offsetY-y)>4)&&(O=!0),n.set_hover(B.offsetX,B.offsetY),b(),E))try{let H=n.get_hover_price();if(H>0){let j=n.get_hover_side();E({price:H,side:j===1?"ask":"bid"},B)}else E(null,B)}catch{}}function U(){S||(E&&E(null),n.clear_hover(),b())}function K(B){if(!S&&!O&&C)try{n.set_hover(B.offsetX,B.offsetY);let H=n.get_hover_price();if(H>0){let j=n.get_hover_side();C({price:H,side:j===1?"ask":"bid"})}}catch{}}function D(){S||(n.center_on_mid(),b())}function rt(B){if(S)return;B.preventDefault();let H=B.deltaY;if(B.deltaMode===1?H*=16:B.deltaMode===2&&(H*=e.clientHeight||400),!(Math.abs(H)<.5)){try{n.scroll_by(H)}catch(j){if(j instanceof WebAssembly.RuntimeError){S=!0;return}return}b()}}e.addEventListener("pointerdown",x),e.addEventListener("pointermove",q),e.addEventListener("pointerup",K),e.addEventListener("pointerleave",U),e.addEventListener("dblclick",D),e.addEventListener("wheel",rt,{passive:!1});function nt(){e.removeEventListener("pointerdown",x),e.removeEventListener("pointermove",q),e.removeEventListener("pointerup",K),e.removeEventListener("pointerleave",U),e.removeEventListener("dblclick",D),e.removeEventListener("wheel",rt)}return{engine:n,start(){p=!0,c=!0,F()},stop(){p=!1,u&&(cancelAnimationFrame(u),u=null)},resize(){if(L||S)return;let{w:B,h:H}=M();if(B<1||H<1)return;s=window.devicePixelRatio||1;let j=Math.round(B*s),$=Math.round(H*s),Q=e.width!==j||e.height!==$;e.width!==j&&(e.width=j),e.height!==$&&(e.height=$),l.setTransform(s,0,0,s,0,0);try{if(n.resize(B,H),Q){try{n.set_now_ms(Date.now())}catch{}T()}}catch(J){if(J instanceof WebAssembly.RuntimeError){S=!0;return}throw J}b()},pushBook(B,H,j){if(S)return;let $=B instanceof Float64Array?B:jr(B),Q=H instanceof Float64Array?H:jr(H);try{n.push_book($,Q,j)}catch(J){if(J instanceof WebAssembly.RuntimeError){S=!0;return}throw J}b()},appendTrade(B,H,j,$){if(!S){try{n.append_trade(B,H,!!j,$||Date.now())}catch(Q){if(Q instanceof WebAssembly.RuntimeError){S=!0;return}throw Q}b()}},pushDomVol(B){if(!(S||!Array.isArray(B)||B.length===0)){try{for(let H of B){if(!H)continue;let j=Number(H.p??H.price),$=Number(H.b??H.buy??0),Q=Number(H.s??H.sell??0);j>0&&n.push_dom_vol(j,$,Q)}}catch(H){if(H instanceof WebAssembly.RuntimeError){S=!0;return}throw H}b()}},clearDomVol(){if(!S){try{n.clear_dom_vol()}catch(B){if(B instanceof WebAssembly.RuntimeError){S=!0;return}throw B}b()}},setWalls(B,H){if(S)return;let j=B instanceof Float64Array?B:new Float64Array(B||[]),$=H instanceof Float64Array?H:new Float64Array(H||[]);try{n.set_walls(j,$)}catch(Q){if(Q instanceof WebAssembly.RuntimeError){S=!0;return}throw Q}b()},setTickSize(B){if(!S){try{n.set_tick_size(B)}catch(H){if(H instanceof WebAssembly.RuntimeError){S=!0;return}throw H}b()}},setPricePrecision(B){if(!S){try{n.set_price_precision(B)}catch(H){if(H instanceof WebAssembly.RuntimeError){S=!0;return}throw H}b()}},setVisibleRows(B){S||(n.set_visible_rows(B),b())},setTextScale(B){if(!(S||!Number.isFinite(B))){try{n.set_text_scale(B)}catch(H){if(H instanceof WebAssembly.RuntimeError){S=!0;return}throw H}b()}},setFillIntensity(B){if(!(S||!Number.isFinite(B))){try{n.set_fill_intensity(B)}catch(H){if(H instanceof WebAssembly.RuntimeError){S=!0;return}throw H}b()}},setQtyDisplayUsd(B){if(!S){try{n.set_qty_display_usd(B?1:0)}catch(H){if(H instanceof WebAssembly.RuntimeError){S=!0;return}throw H}b()}},setTheme(B){S||(n.set_theme(B==="light"?1:0),b())},resetSymbol(){S||(n.reset_symbol(),b())},centerOnMid(){S||(n.center_on_mid(),b())},scrollBy(B){if(!(S||!Number.isFinite(B))){try{n.scroll_by(B)}catch(H){if(H instanceof WebAssembly.RuntimeError){S=!0;return}throw H}b()}},isViewLocked(){if(S)return!1;try{return n.is_view_locked()}catch{return!1}},getMomentum(){if(S)return{m1:0,buy1m:0,sell1m:0};try{return{m1:n.momentum_1m(),buy1m:n.buy_volume_1m(),sell1m:n.sell_volume_1m()}}catch{return{m1:0,buy1m:0,sell1m:0}}},onHover(B){E=B},onClick(B){C=B},destroy(){L=!0,p=!1,u&&cancelAnimationFrame(u),u=null,nt();try{n.free&&n.free()}catch{}}}}function jr(t){let e=new Float64Array(t.length*2);for(let o=0;o<t.length;o++)e[o*2]=t[o][0],e[o*2+1]=t[o][1];return e}var He=null,xr=null;async function Ro(){if(He)return He;let{module:t,memory:e}=await Vt();return He=t,xr=e,t}function Oo(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||"",e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches,o=typeof window<"u"&&Math.min(window.innerWidth,window.innerHeight)<820;return/iphone|ipad|ipod|android|mobile/i.test(t)||e&&o}var Hr=Promise.resolve();async function Yo(t,e={}){let o=await Ro();return Hr=Hr.then(()=>Xr(o,t,e),()=>Xr(o,t,e))}function Xr(t,e,o){let s=window.devicePixelRatio||1,M=e.getBoundingClientRect(),r=Math.max(M.width,60),i=Math.max(M.height,60);e.width=r*s,e.height=i*s;let l=e.getContext("2d");l.setTransform(1,0,0,1,0,0),l.scale(s,s);let n=new t.TickEngine(r,i);o.tickSize&&n.set_tick_size(o.tickSize),o.pricePrecision!=null&&n.set_price_precision(o.pricePrecision),o.theme==="light"&&n.set_theme(1);let c=o.lookbackMs||5*60*1e3,u=o.cellMs||1e3;(o.lookbackMs||o.cellMs)&&n.set_lookback(c,u),o.showTradeTape!=null&&n.set_show_trade_tape(!!o.showTradeTape),o.showBookHeatmap!=null&&n.set_show_book_heatmap(!!o.showBookHeatmap),o.showVwap!=null&&n.set_show_vwap(!!o.showVwap),o.showGrid!=null&&n.set_show_grid(!!o.showGrid);let p=o.isMobile!=null?!!o.isMobile:Oo(),L=!!o.lowPower,S=p||L?33:8,E=66,C=3e4,F=!0,b=null,T=!1,v=!1,R=!1,y=!1,O=0,x=performance.now(),q=performance.now(),U=0,K=Math.max(4,S-1),D=0,rt=0,nt=0,B=null,H=null,j=0,$=[];function Q(){if(v||!T||typeof document<"u"&&document.hidden)return Number.POSITIVE_INFINITY;let g=performance.now();return(g-x>C&&g-q>C?E:S)+rt}function J(){!T||v||y||b||(b=requestAnimationFrame(et))}function et(g){if(b=null,!T||v||y)return;let A=Q();if(!Number.isFinite(A))return;if(g-O<A){b=requestAnimationFrame(et);return}O=g,st();let X=F;if(!X)try{X=n.is_dirty()}catch{y=!0;return}if(X){F=!1;let ot=performance.now();try{if(n.render()>0){let dt=n.get_command_buffer_ptr(),oe=n.get_command_buffer_len();l.save(),l.setTransform(1,0,0,1,0,0),l.clearRect(0,0,e.width,e.height),l.restore(),Ft(l,xr,dt,oe)}}catch(Pt){if(Pt instanceof WebAssembly.RuntimeError){y=!0,console.error("[TickEngine] crashed:",Pt.message);return}F=!0}let ut=performance.now()-ot;U=U*.85+ut*.15,ut>K?(D+=1,D>=8&&(rt=Math.min(100,rt+16),D=0,console.debug(`[TickEngine] adaptive throttle \u2192 ${S+rt}ms (EMA ${U.toFixed(1)}ms, last ${ut.toFixed(1)}ms)`))):(D=0,rt>0&&U<K*.5&&(rt=Math.max(0,rt-8)))}b=requestAnimationFrame(et)}function st(){if(B&&j>0){try{n.push_book(nt,B,H,j)}catch(g){if(g instanceof WebAssembly.RuntimeError){y=!0;return}}B=null,H=null,j=0}if($.length){let g=new Float64Array($);$.length=0;try{n.push_trades_batch(g)}catch(A){if(A instanceof WebAssembly.RuntimeError){y=!0;return}}}}let tt=()=>{F=!0,J()};function ft(){typeof document>"u"||(document.hidden?b&&(cancelAnimationFrame(b),b=null):($.length=0,B=null,H=null,j=0,O=0,tt()))}typeof document<"u"&&document.addEventListener("visibilitychange",ft);function St(){if(!(R||y)&&(M=e.getBoundingClientRect(),!(M.width<1||M.height<1))){s=window.devicePixelRatio||1,e.width=M.width*s,e.height=M.height*s,l.setTransform(1,0,0,1,0,0),l.scale(s,s);try{n.resize(M.width,M.height)}catch(g){if(g instanceof WebAssembly.RuntimeError){y=!0;return}throw g}tt()}}let vt=0,Lt=2,mt=3,Tt=vt,Mt=!1,pt=0,bt=0,it=new Map,_t=0,Y=0;function Z(g,A){if(y)return vt;try{let X=n.hit_zone?.(g,A);return Number.isFinite(X)?X:vt}catch{return vt}}function a(){}e.style.touchAction="none";function _(g){if(y||v)return;g.stopImmediatePropagation(),g.preventDefault(),x=performance.now();let A=g.deltaY,X=g.deltaX,ot=Math.abs(A)>=Math.abs(X)?A:X;if(ot===0)return;let ut=ot>0?1.1:.9,Pt=Z(g.offsetX,g.offsetY);try{g.ctrlKey?n.zoom_y(g.offsetY,ut):g.shiftKey||Pt===Lt?n.zoom_x(g.offsetX,ut):Pt===mt?n.zoom_y(g.offsetY,ut):n.zoom(g.offsetX,g.offsetY,ut)}catch{}tt()}function d(g){if(!(y||v)){if(g.stopImmediatePropagation(),x=performance.now(),it.set(g.pointerId,{x:g.offsetX,y:g.offsetY}),e.setPointerCapture(g.pointerId),it.size===1)Mt=!0,pt=g.offsetX,bt=g.offsetY,Tt=Z(g.offsetX,g.offsetY);else if(it.size===2){Mt=!1;let A=[...it.values()];_t=Math.abs(A[0].y-A[1].y),Y=(A[0].y+A[1].y)/2}}}function f(g){if(!(y||v))if(it.size>0&&g.stopImmediatePropagation(),x=performance.now(),it.set(g.pointerId,{x:g.offsetX,y:g.offsetY}),it.size>=2){let A=[...it.values()],X=Math.abs(A[0].y-A[1].y),ot=(A[0].y+A[1].y)/2;if(_t>0){let Pt=_t/Math.max(X,1);try{n.zoom_y(ot,Pt)}catch{}}let ut=ot-Y;if(Math.abs(ut)>.5)try{n.pan_y(ut)}catch{}_t=X,Y=ot,tt()}else if(Mt){let A=g.offsetX-pt,X=g.offsetY-bt;pt=g.offsetX,bt=g.offsetY;try{if(Tt===Lt){if(Math.abs(A)>.5){let ot=Math.exp(A*.004);n.zoom_x(pt,ot)}}else if(Tt===mt){if(Math.abs(X)>.5){let ot=Math.exp(X*.004);n.zoom_y(bt,ot)}}else Math.abs(A)>.5&&n.pan_x(A),Math.abs(X)>.5&&n.pan_y(X)}catch{}tt()}else{try{n.set_hover(g.offsetX,g.offsetY)}catch{}tt()}}function h(g){if(y)return;let A=it.has(g.pointerId);!v&&A&&g.stopImmediatePropagation(),it.delete(g.pointerId);try{e.releasePointerCapture(g.pointerId)}catch{}if(it.size===0)Mt=!1,_t=0;else if(it.size===1){Mt=!0;let X=[...it.values()][0];pt=X.x,bt=X.y,_t=0}}function m(g){if(y)return;let A=it.has(g.pointerId);!v&&A&&g.stopImmediatePropagation();try{n.clear_hover()}catch{}tt()}function I(g){if(y||v)return;g.stopImmediatePropagation();let A=Z(g.offsetX,g.offsetY);try{A===mt?n.reset_y_auto?.():A===Lt?n.set_follow_live?.(!0):n.reset_view?.()}catch{}tt()}function P(g){y||v||g.stopImmediatePropagation()}function N(g){y||v||it.size>0&&g.stopImmediatePropagation()}function z(g){y||v||it.size>0&&g.stopImmediatePropagation()}function W(g){y||v||(g.stopImmediatePropagation(),g.preventDefault())}let k={capture:!0},G={capture:!0,passive:!1};e.addEventListener("wheel",_,G),e.addEventListener("pointerdown",d,k),e.addEventListener("pointermove",f,k),e.addEventListener("pointerup",h,k),e.addEventListener("pointercancel",h,k),e.addEventListener("pointerleave",m,k),e.addEventListener("dblclick",I,k),e.addEventListener("mousedown",P,k),e.addEventListener("mousemove",N,k),e.addEventListener("mouseup",z,k),e.addEventListener("contextmenu",W,k);function w(){e.removeEventListener("wheel",_,G),e.removeEventListener("pointerdown",d,k),e.removeEventListener("pointermove",f,k),e.removeEventListener("pointerup",h,k),e.removeEventListener("pointercancel",h,k),e.removeEventListener("pointerleave",m,k),e.removeEventListener("dblclick",I,k),e.removeEventListener("mousedown",P,k),e.removeEventListener("mousemove",N,k),e.removeEventListener("mouseup",z,k),e.removeEventListener("contextmenu",W,k),typeof document<"u"&&document.removeEventListener("visibilitychange",ft)}return{engine:n,isMobile:p,start(){T=!0,v=!1,F=!0,O=0,x=performance.now(),q=performance.now(),J()},pause(){v=!0,b&&(cancelAnimationFrame(b),b=null)},resume(){R||y||(v=!1,T=!0,F=!0,O=0,J())},stop(){T=!1,b&&(cancelAnimationFrame(b),b=null)},resize:St,pushBook(g,A,X,ot){y||v||(q=performance.now(),nt=g,B=A,H=X,j=ot,J())},pushTrade(g,A,X,ot){y||v||(q=performance.now(),$.push(g,A,X,ot),J())},pushTradesFlat(g){if(!(y||v)){q=performance.now();for(let A=0;A<g.length;A++)$.push(g[A]);J()}},setTheme(g){if(!y){try{n.set_theme(g==="light"||g===1?1:0)}catch{}tt()}},setTickSize(g){if(!y){try{n.set_tick_size(g)}catch{}tt()}},setPricePrecision(g){if(!y){try{n.set_price_precision(g)}catch{}tt()}},setTzOffsetSeconds(g){if(y)return;let A=Number.isFinite(g)?Math.trunc(g):0;if(typeof n.set_tz_offset_seconds=="function"){try{n.set_tz_offset_seconds(A)}catch{}tt()}},setLookback(g,A){if(y)return;let X=Math.max(20,A|0),ot=Math.max(X,g|0);if(!(X===u&&ot===c)){u=X,c=ot;try{n.set_lookback(ot,X)}catch{}tt()}},setShowTradeTape(g){y||(n.set_show_trade_tape(!!g),tt())},setShowBookHeatmap(g){y||(n.set_show_book_heatmap(!!g),tt())},setShowVwap(g){y||(n.set_show_vwap(!!g),tt())},setShowGrid(g){y||(n.set_show_grid(!!g),tt())},setHeatmapPalette(g){if(y)return;let A=Math.max(0,Math.min(4,g|0));try{n.set_heatmap_palette?.(A)}catch{}tt()},setLargeTrade3d(g){if(!y){try{n.set_large_trade_3d?.(!!g)}catch{}tt()}},setLargeTradeScale(g){if(y)return;let A=Number.isFinite(g)?+g:1;try{n.set_large_trade_scale?.(A)}catch{}tt()},setShowVolume(g){if(!y){try{n.set_show_volume?.(!!g)}catch{}tt()}},setShowPriceLine(g){if(!y){try{n.set_show_price_line?.(!!g)}catch{}tt()}},setShowDepthLens(g){if(!y){try{n.set_show_depth_lens?.(!!g)}catch{}tt()}},setHeatmapIntensity(g,A){if(y)return;let X=Number.isFinite(g)?Math.max(0,Math.min(.99,+g)):0,ot=Number.isFinite(A)?Math.max(X+.01,Math.min(1,+A)):1;try{n.set_heatmap_intensity?.(X,ot)}catch{}tt()},setShowLatestProfile(g){if(!y){try{n.set_show_latest_profile?.(!!g)}catch{}tt()}},setFollowLive(g){y||(n.set_follow_live(!!g),tt())},setAutoScaleY(g){y||(n.set_auto_scale_y(!!g),tt())},resetView(){y||(n.reset_view(),tt())},getLastMid(){if(y)return 0;try{return n.get_last_mid()}catch{return 0}},clearData(){if(!y){try{n.clear()}catch{}$.length=0,B=null,H=null,j=0,tt()}},destroy(){if(!R){R=!0,T=!1,v=!0,b&&(cancelAnimationFrame(b),b=null),w();try{n.free?.()}catch{}}}}}export{Lo as buildRange,Co as buildRenko,yo as buildTick,Mo as createChartBridge,Le as createCustomIndicatorManager,Fo as createDomLadderBridge,Eo as createIcebergDetector,To as createOrderbookBridge,Yo as createTickBridge,Ft as dispatchCommands,vo as prefetchWasm,Me as setupEvents,Ao as suggestDefaults,_e as validateLicense};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kline-orderbook-chart",
3
- "version": "0.2.20",
3
+ "version": "1.1.0",
4
4
  "description": "Candlestick chart with built-in orderbook heatmap, footprint chart, and liquidation heatmap. Native high-performance engine. 60 fps, zero dependencies.",
5
5
  "type": "module",
6
6
  "main": "dist/mrd-chart-engine.mjs",
@@ -15,7 +15,8 @@
15
15
  "files": [
16
16
  "dist/",
17
17
  "LICENSE",
18
- "README.md"
18
+ "README.md",
19
+ "CHANGELOG.md"
19
20
  ],
20
21
  "keywords": [
21
22
  "orderbook-heatmap",