zengeld-canvas 0.1.8 → 0.1.9

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.
@@ -6,6 +6,17 @@ function addToExternrefTable0(obj) {
6
6
  return idx;
7
7
  }
8
8
 
9
+ function getArrayJsValueFromWasm0(ptr, len) {
10
+ ptr = ptr >>> 0;
11
+ const mem = getDataViewMemory0();
12
+ const result = [];
13
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
14
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
15
+ }
16
+ wasm.__externref_drop_slice(ptr, len);
17
+ return result;
18
+ }
19
+
9
20
  let cachedDataViewMemory0 = null;
10
21
  function getDataViewMemory0() {
11
22
  if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
@@ -134,10 +145,18 @@ const JsChartConfigFinalization = (typeof FinalizationRegistry === 'undefined')
134
145
  ? { register: () => {}, unregister: () => {} }
135
146
  : new FinalizationRegistry(ptr => wasm.__wbg_jschartconfig_free(ptr >>> 0, 1));
136
147
 
148
+ const JsRuntimeThemeFinalization = (typeof FinalizationRegistry === 'undefined')
149
+ ? { register: () => {}, unregister: () => {} }
150
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsruntimetheme_free(ptr >>> 0, 1));
151
+
137
152
  const JsThemeFinalization = (typeof FinalizationRegistry === 'undefined')
138
153
  ? { register: () => {}, unregister: () => {} }
139
154
  : new FinalizationRegistry(ptr => wasm.__wbg_jstheme_free(ptr >>> 0, 1));
140
155
 
156
+ const JsUIThemeFinalization = (typeof FinalizationRegistry === 'undefined')
157
+ ? { register: () => {}, unregister: () => {} }
158
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsuitheme_free(ptr >>> 0, 1));
159
+
141
160
  const JsViewportFinalization = (typeof FinalizationRegistry === 'undefined')
142
161
  ? { register: () => {}, unregister: () => {} }
143
162
  : new FinalizationRegistry(ptr => wasm.__wbg_jsviewport_free(ptr >>> 0, 1));
@@ -1851,34 +1870,35 @@ export class JsChartConfig {
1851
1870
  if (Symbol.dispose) JsChartConfig.prototype[Symbol.dispose] = JsChartConfig.prototype.free;
1852
1871
 
1853
1872
  /**
1854
- * Chart theme with predefined color schemes.
1873
+ * Runtime-modifiable theme with JSON serialization support.
1874
+ * All colors are owned strings that can be modified.
1855
1875
  */
1856
- export class JsTheme {
1876
+ export class JsRuntimeTheme {
1857
1877
  static __wrap(ptr) {
1858
1878
  ptr = ptr >>> 0;
1859
- const obj = Object.create(JsTheme.prototype);
1879
+ const obj = Object.create(JsRuntimeTheme.prototype);
1860
1880
  obj.__wbg_ptr = ptr;
1861
- JsThemeFinalization.register(obj, obj.__wbg_ptr, obj);
1881
+ JsRuntimeThemeFinalization.register(obj, obj.__wbg_ptr, obj);
1862
1882
  return obj;
1863
1883
  }
1864
1884
  __destroy_into_raw() {
1865
1885
  const ptr = this.__wbg_ptr;
1866
1886
  this.__wbg_ptr = 0;
1867
- JsThemeFinalization.unregister(this);
1887
+ JsRuntimeThemeFinalization.unregister(this);
1868
1888
  return ptr;
1869
1889
  }
1870
1890
  free() {
1871
1891
  const ptr = this.__destroy_into_raw();
1872
- wasm.__wbg_jstheme_free(ptr, 0);
1892
+ wasm.__wbg_jsruntimetheme_free(ptr, 0);
1873
1893
  }
1874
1894
  /**
1875
1895
  * @returns {string}
1876
1896
  */
1877
- get gridColor() {
1897
+ get background() {
1878
1898
  let deferred1_0;
1879
1899
  let deferred1_1;
1880
1900
  try {
1881
- const ret = wasm.jstheme_gridColor(this.__wbg_ptr);
1901
+ const ret = wasm.jsruntimetheme_background(this.__wbg_ptr);
1882
1902
  deferred1_0 = ret[0];
1883
1903
  deferred1_1 = ret[1];
1884
1904
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1889,11 +1909,11 @@ export class JsTheme {
1889
1909
  /**
1890
1910
  * @returns {string}
1891
1911
  */
1892
- get textColor() {
1912
+ get lineColor() {
1893
1913
  let deferred1_0;
1894
1914
  let deferred1_1;
1895
1915
  try {
1896
- const ret = wasm.jstheme_textColor(this.__wbg_ptr);
1916
+ const ret = wasm.jsruntimetheme_lineColor(this.__wbg_ptr);
1897
1917
  deferred1_0 = ret[0];
1898
1918
  deferred1_1 = ret[1];
1899
1919
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1904,11 +1924,11 @@ export class JsTheme {
1904
1924
  /**
1905
1925
  * @returns {string}
1906
1926
  */
1907
- get candleDown() {
1927
+ get scaleText() {
1908
1928
  let deferred1_0;
1909
1929
  let deferred1_1;
1910
1930
  try {
1911
- const ret = wasm.jstheme_candleDown(this.__wbg_ptr);
1931
+ const ret = wasm.jsruntimetheme_scaleText(this.__wbg_ptr);
1912
1932
  deferred1_0 = ret[0];
1913
1933
  deferred1_1 = ret[1];
1914
1934
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1917,27 +1937,29 @@ export class JsTheme {
1917
1937
  }
1918
1938
  }
1919
1939
  /**
1920
- * @returns {JsTheme}
1940
+ * @param {string} color
1921
1941
  */
1922
- static dark() {
1923
- const ret = wasm.jstheme_dark();
1924
- return JsTheme.__wrap(ret);
1942
+ set accent(color) {
1943
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1944
+ const len0 = WASM_VECTOR_LEN;
1945
+ wasm.jsruntimetheme_set_accent(this.__wbg_ptr, ptr0, len0);
1925
1946
  }
1926
1947
  /**
1927
- * @returns {JsTheme}
1948
+ * @param {string} color
1928
1949
  */
1929
- static light() {
1930
- const ret = wasm.jstheme_light();
1931
- return JsTheme.__wrap(ret);
1950
+ set danger(color) {
1951
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1952
+ const len0 = WASM_VECTOR_LEN;
1953
+ wasm.jsruntimetheme_set_danger(this.__wbg_ptr, ptr0, len0);
1932
1954
  }
1933
1955
  /**
1934
1956
  * @returns {string}
1935
1957
  */
1936
- get bgColor() {
1958
+ get toolbarBg() {
1937
1959
  let deferred1_0;
1938
1960
  let deferred1_1;
1939
1961
  try {
1940
- const ret = wasm.jstheme_bgColor(this.__wbg_ptr);
1962
+ const ret = wasm.jsruntimetheme_toolbarBg(this.__wbg_ptr);
1941
1963
  deferred1_0 = ret[0];
1942
1964
  deferred1_1 = ret[1];
1943
1965
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1945,14 +1967,57 @@ export class JsTheme {
1945
1967
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1946
1968
  }
1947
1969
  }
1970
+ /**
1971
+ * Create from preset name: "dark", "light", "high_contrast", "cyberpunk"
1972
+ * @param {string} name
1973
+ * @returns {JsRuntimeTheme}
1974
+ */
1975
+ static fromPreset(name) {
1976
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1977
+ const len0 = WASM_VECTOR_LEN;
1978
+ const ret = wasm.jsruntimetheme_fromPreset(ptr0, len0);
1979
+ return JsRuntimeTheme.__wrap(ret);
1980
+ }
1981
+ /**
1982
+ * @param {string} color
1983
+ */
1984
+ set maFast(color) {
1985
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1986
+ const len0 = WASM_VECTOR_LEN;
1987
+ wasm.jsruntimetheme_set_maFast(this.__wbg_ptr, ptr0, len0);
1988
+ }
1989
+ /**
1990
+ * @param {string} color
1991
+ */
1992
+ set maSlow(color) {
1993
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1994
+ const len0 = WASM_VECTOR_LEN;
1995
+ wasm.jsruntimetheme_set_maSlow(this.__wbg_ptr, ptr0, len0);
1996
+ }
1997
+ /**
1998
+ * @param {string} color
1999
+ */
2000
+ set success(color) {
2001
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2002
+ const len0 = WASM_VECTOR_LEN;
2003
+ wasm.jsruntimetheme_set_success(this.__wbg_ptr, ptr0, len0);
2004
+ }
2005
+ /**
2006
+ * @param {string} color
2007
+ */
2008
+ set scaleBg(color) {
2009
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2010
+ const len0 = WASM_VECTOR_LEN;
2011
+ wasm.jsruntimetheme_set_scaleBg(this.__wbg_ptr, ptr0, len0);
2012
+ }
1948
2013
  /**
1949
2014
  * @returns {string}
1950
2015
  */
1951
- get candleUp() {
2016
+ get textPrimary() {
1952
2017
  let deferred1_0;
1953
2018
  let deferred1_1;
1954
2019
  try {
1955
- const ret = wasm.jstheme_candleUp(this.__wbg_ptr);
2020
+ const ret = wasm.jsruntimetheme_textPrimary(this.__wbg_ptr);
1956
2021
  deferred1_0 = ret[0];
1957
2022
  deferred1_1 = ret[1];
1958
2023
  return getStringFromWasm0(ret[0], ret[1]);
@@ -1960,133 +2025,878 @@ export class JsTheme {
1960
2025
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1961
2026
  }
1962
2027
  }
1963
- }
1964
- if (Symbol.dispose) JsTheme.prototype[Symbol.dispose] = JsTheme.prototype.free;
1965
-
1966
- /**
1967
- * Chart viewport managing visible area and scrolling.
1968
- */
1969
- export class JsViewport {
1970
- __destroy_into_raw() {
1971
- const ptr = this.__wbg_ptr;
1972
- this.__wbg_ptr = 0;
1973
- JsViewportFinalization.unregister(this);
1974
- return ptr;
2028
+ /**
2029
+ * Create high contrast theme
2030
+ * @returns {JsRuntimeTheme}
2031
+ */
2032
+ static highContrast() {
2033
+ const ret = wasm.jsruntimetheme_highContrast();
2034
+ return JsRuntimeTheme.__wrap(ret);
1975
2035
  }
1976
- free() {
1977
- const ptr = this.__destroy_into_raw();
1978
- wasm.__wbg_jsviewport_free(ptr, 0);
2036
+ /**
2037
+ * @param {string} color
2038
+ */
2039
+ set gridLine(color) {
2040
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2041
+ const len0 = WASM_VECTOR_LEN;
2042
+ wasm.jsruntimetheme_set_gridLine(this.__wbg_ptr, ptr0, len0);
1979
2043
  }
1980
2044
  /**
1981
- * @returns {number}
2045
+ * @returns {string}
1982
2046
  */
1983
- get chartWidth() {
1984
- const ret = wasm.jsviewport_chartWidth(this.__wbg_ptr);
1985
- return ret;
2047
+ get candleUpBody() {
2048
+ let deferred1_0;
2049
+ let deferred1_1;
2050
+ try {
2051
+ const ret = wasm.jsruntimetheme_candleUpBody(this.__wbg_ptr);
2052
+ deferred1_0 = ret[0];
2053
+ deferred1_1 = ret[1];
2054
+ return getStringFromWasm0(ret[0], ret[1]);
2055
+ } finally {
2056
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2057
+ }
1986
2058
  }
1987
2059
  /**
1988
- * @returns {number}
2060
+ * @returns {string}
1989
2061
  */
1990
- get chartHeight() {
1991
- const ret = wasm.jsviewport_chartHeight(this.__wbg_ptr);
1992
- return ret;
2062
+ get crosshairLine() {
2063
+ let deferred1_0;
2064
+ let deferred1_1;
2065
+ try {
2066
+ const ret = wasm.jsruntimetheme_crosshairLine(this.__wbg_ptr);
2067
+ deferred1_0 = ret[0];
2068
+ deferred1_1 = ret[1];
2069
+ return getStringFromWasm0(ret[0], ret[1]);
2070
+ } finally {
2071
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2072
+ }
1993
2073
  }
1994
- scrollToEnd() {
1995
- wasm.jsviewport_scrollToEnd(this.__wbg_ptr);
2074
+ /**
2075
+ * @param {string} color
2076
+ */
2077
+ set background(color) {
2078
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2079
+ const len0 = WASM_VECTOR_LEN;
2080
+ wasm.jsruntimetheme_set_background(this.__wbg_ptr, ptr0, len0);
1996
2081
  }
1997
2082
  /**
1998
- * @param {number} count
2083
+ * @param {string} color
1999
2084
  */
2000
- setBarCount(count) {
2001
- wasm.jsviewport_setBarCount(this.__wbg_ptr, count);
2085
+ set lineColor(color) {
2086
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2087
+ const len0 = WASM_VECTOR_LEN;
2088
+ wasm.jsruntimetheme_set_lineColor(this.__wbg_ptr, ptr0, len0);
2002
2089
  }
2003
- scrollToStart() {
2004
- wasm.jsviewport_scrollToStart(this.__wbg_ptr);
2090
+ /**
2091
+ * @param {string} color
2092
+ */
2093
+ set scaleText(color) {
2094
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2095
+ const len0 = WASM_VECTOR_LEN;
2096
+ wasm.jsruntimetheme_set_scaleText(this.__wbg_ptr, ptr0, len0);
2005
2097
  }
2006
2098
  /**
2007
- * @param {number} width
2008
- * @param {number} height
2099
+ * @param {string} color
2009
2100
  */
2010
- constructor(width, height) {
2011
- const ret = wasm.jsviewport_new(width, height);
2012
- this.__wbg_ptr = ret >>> 0;
2013
- JsViewportFinalization.register(this, this.__wbg_ptr, this);
2014
- return this;
2101
+ set toolbarBg(color) {
2102
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2103
+ const len0 = WASM_VECTOR_LEN;
2104
+ wasm.jsruntimetheme_set_toolbarBg(this.__wbg_ptr, ptr0, len0);
2015
2105
  }
2016
2106
  /**
2017
- * @param {number} width
2018
- * @param {number} height
2107
+ * Serialize to pretty JSON string
2108
+ * @returns {string}
2019
2109
  */
2020
- setSize(width, height) {
2021
- wasm.jsviewport_setSize(this.__wbg_ptr, width, height);
2110
+ toJsonPretty() {
2111
+ let deferred1_0;
2112
+ let deferred1_1;
2113
+ try {
2114
+ const ret = wasm.jsruntimetheme_toJsonPretty(this.__wbg_ptr);
2115
+ deferred1_0 = ret[0];
2116
+ deferred1_1 = ret[1];
2117
+ return getStringFromWasm0(ret[0], ret[1]);
2118
+ } finally {
2119
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2120
+ }
2022
2121
  }
2023
2122
  /**
2024
- * @returns {number}
2123
+ * @returns {string}
2025
2124
  */
2026
- get barWidth() {
2027
- const ret = wasm.jsviewport_barWidth(this.__wbg_ptr);
2028
- return ret;
2125
+ get candleDownBody() {
2126
+ let deferred1_0;
2127
+ let deferred1_1;
2128
+ try {
2129
+ const ret = wasm.jsruntimetheme_candleDownBody(this.__wbg_ptr);
2130
+ deferred1_0 = ret[0];
2131
+ deferred1_1 = ret[1];
2132
+ return getStringFromWasm0(ret[0], ret[1]);
2133
+ } finally {
2134
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2135
+ }
2029
2136
  }
2030
- }
2031
- if (Symbol.dispose) JsViewport.prototype[Symbol.dispose] = JsViewport.prototype.free;
2032
-
2033
- /**
2034
- * Get library version.
2035
- * @returns {string}
2036
- */
2037
- export function version() {
2038
- let deferred1_0;
2039
- let deferred1_1;
2040
- try {
2041
- const ret = wasm.version();
2042
- deferred1_0 = ret[0];
2043
- deferred1_1 = ret[1];
2044
- return getStringFromWasm0(ret[0], ret[1]);
2045
- } finally {
2046
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2137
+ /**
2138
+ * @param {string} color
2139
+ */
2140
+ set textPrimary(color) {
2141
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2142
+ const len0 = WASM_VECTOR_LEN;
2143
+ wasm.jsruntimetheme_set_textPrimary(this.__wbg_ptr, ptr0, len0);
2047
2144
  }
2048
- }
2049
-
2050
- const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
2051
-
2052
- async function __wbg_load(module, imports) {
2053
- if (typeof Response === 'function' && module instanceof Response) {
2054
- if (typeof WebAssembly.instantiateStreaming === 'function') {
2055
- try {
2056
- return await WebAssembly.instantiateStreaming(module, imports);
2057
- } catch (e) {
2058
- const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
2059
-
2060
- if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
2061
- 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", e);
2062
-
2063
- } else {
2064
- throw e;
2065
- }
2066
- }
2067
- }
2068
-
2069
- const bytes = await module.arrayBuffer();
2070
- return await WebAssembly.instantiate(bytes, imports);
2071
- } else {
2072
- const instance = await WebAssembly.instantiate(module, imports);
2073
-
2074
- if (instance instanceof WebAssembly.Instance) {
2075
- return { instance, module };
2076
- } else {
2077
- return instance;
2078
- }
2145
+ /**
2146
+ * @param {string} color
2147
+ */
2148
+ set candleUpBody(color) {
2149
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2150
+ const len0 = WASM_VECTOR_LEN;
2151
+ wasm.jsruntimetheme_set_candleUpBody(this.__wbg_ptr, ptr0, len0);
2079
2152
  }
2080
- }
2081
-
2082
- function __wbg_get_imports() {
2083
- const imports = {};
2084
- imports.wbg = {};
2085
- imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
2086
- throw new Error(getStringFromWasm0(arg0, arg1));
2087
- };
2088
- imports.wbg.__wbg_jsbar_unwrap = function(arg0) {
2089
- const ret = JsBar.__unwrap(arg0);
2153
+ /**
2154
+ * @param {string} color
2155
+ */
2156
+ set crosshairLine(color) {
2157
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2158
+ const len0 = WASM_VECTOR_LEN;
2159
+ wasm.jsruntimetheme_set_crosshairLine(this.__wbg_ptr, ptr0, len0);
2160
+ }
2161
+ /**
2162
+ * @param {string} color
2163
+ */
2164
+ set candleDownBody(color) {
2165
+ const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2166
+ const len0 = WASM_VECTOR_LEN;
2167
+ wasm.jsruntimetheme_set_candleDownBody(this.__wbg_ptr, ptr0, len0);
2168
+ }
2169
+ /**
2170
+ * Create dark theme
2171
+ * @returns {JsRuntimeTheme}
2172
+ */
2173
+ static dark() {
2174
+ const ret = wasm.jsruntimetheme_dark();
2175
+ return JsRuntimeTheme.__wrap(ret);
2176
+ }
2177
+ /**
2178
+ * @returns {string}
2179
+ */
2180
+ get name() {
2181
+ let deferred1_0;
2182
+ let deferred1_1;
2183
+ try {
2184
+ const ret = wasm.jsruntimetheme_name(this.__wbg_ptr);
2185
+ deferred1_0 = ret[0];
2186
+ deferred1_1 = ret[1];
2187
+ return getStringFromWasm0(ret[0], ret[1]);
2188
+ } finally {
2189
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2190
+ }
2191
+ }
2192
+ /**
2193
+ * Create light theme
2194
+ * @returns {JsRuntimeTheme}
2195
+ */
2196
+ static light() {
2197
+ const ret = wasm.jsruntimetheme_light();
2198
+ return JsRuntimeTheme.__wrap(ret);
2199
+ }
2200
+ /**
2201
+ * @returns {string}
2202
+ */
2203
+ get accent() {
2204
+ let deferred1_0;
2205
+ let deferred1_1;
2206
+ try {
2207
+ const ret = wasm.jsruntimetheme_accent(this.__wbg_ptr);
2208
+ deferred1_0 = ret[0];
2209
+ deferred1_1 = ret[1];
2210
+ return getStringFromWasm0(ret[0], ret[1]);
2211
+ } finally {
2212
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2213
+ }
2214
+ }
2215
+ /**
2216
+ * @returns {string}
2217
+ */
2218
+ get danger() {
2219
+ let deferred1_0;
2220
+ let deferred1_1;
2221
+ try {
2222
+ const ret = wasm.jsruntimetheme_danger(this.__wbg_ptr);
2223
+ deferred1_0 = ret[0];
2224
+ deferred1_1 = ret[1];
2225
+ return getStringFromWasm0(ret[0], ret[1]);
2226
+ } finally {
2227
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2228
+ }
2229
+ }
2230
+ /**
2231
+ * @returns {string}
2232
+ */
2233
+ get maFast() {
2234
+ let deferred1_0;
2235
+ let deferred1_1;
2236
+ try {
2237
+ const ret = wasm.jsruntimetheme_maFast(this.__wbg_ptr);
2238
+ deferred1_0 = ret[0];
2239
+ deferred1_1 = ret[1];
2240
+ return getStringFromWasm0(ret[0], ret[1]);
2241
+ } finally {
2242
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2243
+ }
2244
+ }
2245
+ /**
2246
+ * @returns {string}
2247
+ */
2248
+ get maSlow() {
2249
+ let deferred1_0;
2250
+ let deferred1_1;
2251
+ try {
2252
+ const ret = wasm.jsruntimetheme_maSlow(this.__wbg_ptr);
2253
+ deferred1_0 = ret[0];
2254
+ deferred1_1 = ret[1];
2255
+ return getStringFromWasm0(ret[0], ret[1]);
2256
+ } finally {
2257
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2258
+ }
2259
+ }
2260
+ /**
2261
+ * Get available preset names
2262
+ * @returns {string[]}
2263
+ */
2264
+ static presets() {
2265
+ const ret = wasm.jsruntimetheme_presets();
2266
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
2267
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
2268
+ return v1;
2269
+ }
2270
+ /**
2271
+ * @returns {string}
2272
+ */
2273
+ get success() {
2274
+ let deferred1_0;
2275
+ let deferred1_1;
2276
+ try {
2277
+ const ret = wasm.jsruntimetheme_success(this.__wbg_ptr);
2278
+ deferred1_0 = ret[0];
2279
+ deferred1_1 = ret[1];
2280
+ return getStringFromWasm0(ret[0], ret[1]);
2281
+ } finally {
2282
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2283
+ }
2284
+ }
2285
+ /**
2286
+ * Serialize to JSON string
2287
+ * @returns {string}
2288
+ */
2289
+ toJson() {
2290
+ let deferred1_0;
2291
+ let deferred1_1;
2292
+ try {
2293
+ const ret = wasm.jsruntimetheme_toJson(this.__wbg_ptr);
2294
+ deferred1_0 = ret[0];
2295
+ deferred1_1 = ret[1];
2296
+ return getStringFromWasm0(ret[0], ret[1]);
2297
+ } finally {
2298
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2299
+ }
2300
+ }
2301
+ /**
2302
+ * @returns {string}
2303
+ */
2304
+ get scaleBg() {
2305
+ let deferred1_0;
2306
+ let deferred1_1;
2307
+ try {
2308
+ const ret = wasm.jsruntimetheme_scaleBg(this.__wbg_ptr);
2309
+ deferred1_0 = ret[0];
2310
+ deferred1_1 = ret[1];
2311
+ return getStringFromWasm0(ret[0], ret[1]);
2312
+ } finally {
2313
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2314
+ }
2315
+ }
2316
+ /**
2317
+ * @param {string} name
2318
+ */
2319
+ set name(name) {
2320
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2321
+ const len0 = WASM_VECTOR_LEN;
2322
+ wasm.jsruntimetheme_set_name(this.__wbg_ptr, ptr0, len0);
2323
+ }
2324
+ /**
2325
+ * Create cyberpunk theme
2326
+ * @returns {JsRuntimeTheme}
2327
+ */
2328
+ static cyberpunk() {
2329
+ const ret = wasm.jsruntimetheme_cyberpunk();
2330
+ return JsRuntimeTheme.__wrap(ret);
2331
+ }
2332
+ /**
2333
+ * Deserialize from JSON string
2334
+ * @param {string} json
2335
+ * @returns {JsRuntimeTheme | undefined}
2336
+ */
2337
+ static fromJson(json) {
2338
+ const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2339
+ const len0 = WASM_VECTOR_LEN;
2340
+ const ret = wasm.jsruntimetheme_fromJson(ptr0, len0);
2341
+ return ret === 0 ? undefined : JsRuntimeTheme.__wrap(ret);
2342
+ }
2343
+ /**
2344
+ * @returns {string}
2345
+ */
2346
+ get gridLine() {
2347
+ let deferred1_0;
2348
+ let deferred1_1;
2349
+ try {
2350
+ const ret = wasm.jsruntimetheme_gridLine(this.__wbg_ptr);
2351
+ deferred1_0 = ret[0];
2352
+ deferred1_1 = ret[1];
2353
+ return getStringFromWasm0(ret[0], ret[1]);
2354
+ } finally {
2355
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2356
+ }
2357
+ }
2358
+ }
2359
+ if (Symbol.dispose) JsRuntimeTheme.prototype[Symbol.dispose] = JsRuntimeTheme.prototype.free;
2360
+
2361
+ /**
2362
+ * Legacy simple theme with basic color properties.
2363
+ */
2364
+ export class JsTheme {
2365
+ static __wrap(ptr) {
2366
+ ptr = ptr >>> 0;
2367
+ const obj = Object.create(JsTheme.prototype);
2368
+ obj.__wbg_ptr = ptr;
2369
+ JsThemeFinalization.register(obj, obj.__wbg_ptr, obj);
2370
+ return obj;
2371
+ }
2372
+ __destroy_into_raw() {
2373
+ const ptr = this.__wbg_ptr;
2374
+ this.__wbg_ptr = 0;
2375
+ JsThemeFinalization.unregister(this);
2376
+ return ptr;
2377
+ }
2378
+ free() {
2379
+ const ptr = this.__destroy_into_raw();
2380
+ wasm.__wbg_jstheme_free(ptr, 0);
2381
+ }
2382
+ /**
2383
+ * @returns {string}
2384
+ */
2385
+ get gridColor() {
2386
+ let deferred1_0;
2387
+ let deferred1_1;
2388
+ try {
2389
+ const ret = wasm.jstheme_gridColor(this.__wbg_ptr);
2390
+ deferred1_0 = ret[0];
2391
+ deferred1_1 = ret[1];
2392
+ return getStringFromWasm0(ret[0], ret[1]);
2393
+ } finally {
2394
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2395
+ }
2396
+ }
2397
+ /**
2398
+ * @returns {string}
2399
+ */
2400
+ get textColor() {
2401
+ let deferred1_0;
2402
+ let deferred1_1;
2403
+ try {
2404
+ const ret = wasm.jstheme_textColor(this.__wbg_ptr);
2405
+ deferred1_0 = ret[0];
2406
+ deferred1_1 = ret[1];
2407
+ return getStringFromWasm0(ret[0], ret[1]);
2408
+ } finally {
2409
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2410
+ }
2411
+ }
2412
+ /**
2413
+ * @returns {string}
2414
+ */
2415
+ get candleDown() {
2416
+ let deferred1_0;
2417
+ let deferred1_1;
2418
+ try {
2419
+ const ret = wasm.jstheme_candleDown(this.__wbg_ptr);
2420
+ deferred1_0 = ret[0];
2421
+ deferred1_1 = ret[1];
2422
+ return getStringFromWasm0(ret[0], ret[1]);
2423
+ } finally {
2424
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2425
+ }
2426
+ }
2427
+ /**
2428
+ * @returns {JsTheme}
2429
+ */
2430
+ static dark() {
2431
+ const ret = wasm.jstheme_dark();
2432
+ return JsTheme.__wrap(ret);
2433
+ }
2434
+ /**
2435
+ * @returns {JsTheme}
2436
+ */
2437
+ static light() {
2438
+ const ret = wasm.jstheme_light();
2439
+ return JsTheme.__wrap(ret);
2440
+ }
2441
+ /**
2442
+ * @returns {string}
2443
+ */
2444
+ get bgColor() {
2445
+ let deferred1_0;
2446
+ let deferred1_1;
2447
+ try {
2448
+ const ret = wasm.jstheme_bgColor(this.__wbg_ptr);
2449
+ deferred1_0 = ret[0];
2450
+ deferred1_1 = ret[1];
2451
+ return getStringFromWasm0(ret[0], ret[1]);
2452
+ } finally {
2453
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2454
+ }
2455
+ }
2456
+ /**
2457
+ * @returns {string}
2458
+ */
2459
+ get candleUp() {
2460
+ let deferred1_0;
2461
+ let deferred1_1;
2462
+ try {
2463
+ const ret = wasm.jstheme_candleUp(this.__wbg_ptr);
2464
+ deferred1_0 = ret[0];
2465
+ deferred1_1 = ret[1];
2466
+ return getStringFromWasm0(ret[0], ret[1]);
2467
+ } finally {
2468
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2469
+ }
2470
+ }
2471
+ }
2472
+ if (Symbol.dispose) JsTheme.prototype[Symbol.dispose] = JsTheme.prototype.free;
2473
+
2474
+ /**
2475
+ * Complete UI theme with all styling options (static, compile-time).
2476
+ * Use JsRuntimeTheme for modifiable themes.
2477
+ */
2478
+ export class JsUITheme {
2479
+ static __wrap(ptr) {
2480
+ ptr = ptr >>> 0;
2481
+ const obj = Object.create(JsUITheme.prototype);
2482
+ obj.__wbg_ptr = ptr;
2483
+ JsUIThemeFinalization.register(obj, obj.__wbg_ptr, obj);
2484
+ return obj;
2485
+ }
2486
+ __destroy_into_raw() {
2487
+ const ptr = this.__wbg_ptr;
2488
+ this.__wbg_ptr = 0;
2489
+ JsUIThemeFinalization.unregister(this);
2490
+ return ptr;
2491
+ }
2492
+ free() {
2493
+ const ptr = this.__destroy_into_raw();
2494
+ wasm.__wbg_jsuitheme_free(ptr, 0);
2495
+ }
2496
+ /**
2497
+ * @returns {string}
2498
+ */
2499
+ get background() {
2500
+ let deferred1_0;
2501
+ let deferred1_1;
2502
+ try {
2503
+ const ret = wasm.jsuitheme_background(this.__wbg_ptr);
2504
+ deferred1_0 = ret[0];
2505
+ deferred1_1 = ret[1];
2506
+ return getStringFromWasm0(ret[0], ret[1]);
2507
+ } finally {
2508
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2509
+ }
2510
+ }
2511
+ /**
2512
+ * @returns {string}
2513
+ */
2514
+ get lineColor() {
2515
+ let deferred1_0;
2516
+ let deferred1_1;
2517
+ try {
2518
+ const ret = wasm.jsuitheme_lineColor(this.__wbg_ptr);
2519
+ deferred1_0 = ret[0];
2520
+ deferred1_1 = ret[1];
2521
+ return getStringFromWasm0(ret[0], ret[1]);
2522
+ } finally {
2523
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2524
+ }
2525
+ }
2526
+ /**
2527
+ * @returns {string}
2528
+ */
2529
+ get scaleText() {
2530
+ let deferred1_0;
2531
+ let deferred1_1;
2532
+ try {
2533
+ const ret = wasm.jsuitheme_scaleText(this.__wbg_ptr);
2534
+ deferred1_0 = ret[0];
2535
+ deferred1_1 = ret[1];
2536
+ return getStringFromWasm0(ret[0], ret[1]);
2537
+ } finally {
2538
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2539
+ }
2540
+ }
2541
+ /**
2542
+ * @returns {string}
2543
+ */
2544
+ get toolbarBg() {
2545
+ let deferred1_0;
2546
+ let deferred1_1;
2547
+ try {
2548
+ const ret = wasm.jsuitheme_toolbarBg(this.__wbg_ptr);
2549
+ deferred1_0 = ret[0];
2550
+ deferred1_1 = ret[1];
2551
+ return getStringFromWasm0(ret[0], ret[1]);
2552
+ } finally {
2553
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2554
+ }
2555
+ }
2556
+ /**
2557
+ * @returns {string}
2558
+ */
2559
+ get textPrimary() {
2560
+ let deferred1_0;
2561
+ let deferred1_1;
2562
+ try {
2563
+ const ret = wasm.jsuitheme_textPrimary(this.__wbg_ptr);
2564
+ deferred1_0 = ret[0];
2565
+ deferred1_1 = ret[1];
2566
+ return getStringFromWasm0(ret[0], ret[1]);
2567
+ } finally {
2568
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2569
+ }
2570
+ }
2571
+ /**
2572
+ * Create high contrast theme (accessibility)
2573
+ * @returns {JsUITheme}
2574
+ */
2575
+ static highContrast() {
2576
+ const ret = wasm.jsuitheme_highContrast();
2577
+ return JsUITheme.__wrap(ret);
2578
+ }
2579
+ /**
2580
+ * @returns {string}
2581
+ */
2582
+ get candleUpBody() {
2583
+ let deferred1_0;
2584
+ let deferred1_1;
2585
+ try {
2586
+ const ret = wasm.jsuitheme_candleUpBody(this.__wbg_ptr);
2587
+ deferred1_0 = ret[0];
2588
+ deferred1_1 = ret[1];
2589
+ return getStringFromWasm0(ret[0], ret[1]);
2590
+ } finally {
2591
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2592
+ }
2593
+ }
2594
+ /**
2595
+ * @returns {string}
2596
+ */
2597
+ get crosshairLine() {
2598
+ let deferred1_0;
2599
+ let deferred1_1;
2600
+ try {
2601
+ const ret = wasm.jsuitheme_crosshairLine(this.__wbg_ptr);
2602
+ deferred1_0 = ret[0];
2603
+ deferred1_1 = ret[1];
2604
+ return getStringFromWasm0(ret[0], ret[1]);
2605
+ } finally {
2606
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2607
+ }
2608
+ }
2609
+ /**
2610
+ * @returns {string}
2611
+ */
2612
+ get candleDownBody() {
2613
+ let deferred1_0;
2614
+ let deferred1_1;
2615
+ try {
2616
+ const ret = wasm.jsuitheme_candleDownBody(this.__wbg_ptr);
2617
+ deferred1_0 = ret[0];
2618
+ deferred1_1 = ret[1];
2619
+ return getStringFromWasm0(ret[0], ret[1]);
2620
+ } finally {
2621
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2622
+ }
2623
+ }
2624
+ /**
2625
+ * Create dark theme (TradingView-like)
2626
+ * @returns {JsUITheme}
2627
+ */
2628
+ static dark() {
2629
+ const ret = wasm.jsuitheme_dark();
2630
+ return JsUITheme.__wrap(ret);
2631
+ }
2632
+ /**
2633
+ * @returns {string}
2634
+ */
2635
+ get name() {
2636
+ let deferred1_0;
2637
+ let deferred1_1;
2638
+ try {
2639
+ const ret = wasm.jsuitheme_name(this.__wbg_ptr);
2640
+ deferred1_0 = ret[0];
2641
+ deferred1_1 = ret[1];
2642
+ return getStringFromWasm0(ret[0], ret[1]);
2643
+ } finally {
2644
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2645
+ }
2646
+ }
2647
+ /**
2648
+ * Create light theme
2649
+ * @returns {JsUITheme}
2650
+ */
2651
+ static light() {
2652
+ const ret = wasm.jsuitheme_light();
2653
+ return JsUITheme.__wrap(ret);
2654
+ }
2655
+ /**
2656
+ * @returns {string}
2657
+ */
2658
+ get accent() {
2659
+ let deferred1_0;
2660
+ let deferred1_1;
2661
+ try {
2662
+ const ret = wasm.jsuitheme_accent(this.__wbg_ptr);
2663
+ deferred1_0 = ret[0];
2664
+ deferred1_1 = ret[1];
2665
+ return getStringFromWasm0(ret[0], ret[1]);
2666
+ } finally {
2667
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2668
+ }
2669
+ }
2670
+ /**
2671
+ * @returns {string}
2672
+ */
2673
+ get danger() {
2674
+ let deferred1_0;
2675
+ let deferred1_1;
2676
+ try {
2677
+ const ret = wasm.jsuitheme_danger(this.__wbg_ptr);
2678
+ deferred1_0 = ret[0];
2679
+ deferred1_1 = ret[1];
2680
+ return getStringFromWasm0(ret[0], ret[1]);
2681
+ } finally {
2682
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2683
+ }
2684
+ }
2685
+ /**
2686
+ * @returns {string}
2687
+ */
2688
+ get maFast() {
2689
+ let deferred1_0;
2690
+ let deferred1_1;
2691
+ try {
2692
+ const ret = wasm.jsuitheme_maFast(this.__wbg_ptr);
2693
+ deferred1_0 = ret[0];
2694
+ deferred1_1 = ret[1];
2695
+ return getStringFromWasm0(ret[0], ret[1]);
2696
+ } finally {
2697
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2698
+ }
2699
+ }
2700
+ /**
2701
+ * @returns {string}
2702
+ */
2703
+ get maSlow() {
2704
+ let deferred1_0;
2705
+ let deferred1_1;
2706
+ try {
2707
+ const ret = wasm.jsuitheme_maSlow(this.__wbg_ptr);
2708
+ deferred1_0 = ret[0];
2709
+ deferred1_1 = ret[1];
2710
+ return getStringFromWasm0(ret[0], ret[1]);
2711
+ } finally {
2712
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2713
+ }
2714
+ }
2715
+ /**
2716
+ * @returns {string}
2717
+ */
2718
+ get success() {
2719
+ let deferred1_0;
2720
+ let deferred1_1;
2721
+ try {
2722
+ const ret = wasm.jsuitheme_success(this.__wbg_ptr);
2723
+ deferred1_0 = ret[0];
2724
+ deferred1_1 = ret[1];
2725
+ return getStringFromWasm0(ret[0], ret[1]);
2726
+ } finally {
2727
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2728
+ }
2729
+ }
2730
+ /**
2731
+ * @returns {string}
2732
+ */
2733
+ get scaleBg() {
2734
+ let deferred1_0;
2735
+ let deferred1_1;
2736
+ try {
2737
+ const ret = wasm.jsuitheme_scaleBg(this.__wbg_ptr);
2738
+ deferred1_0 = ret[0];
2739
+ deferred1_1 = ret[1];
2740
+ return getStringFromWasm0(ret[0], ret[1]);
2741
+ } finally {
2742
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2743
+ }
2744
+ }
2745
+ /**
2746
+ * Create cyberpunk/neon theme
2747
+ * @returns {JsUITheme}
2748
+ */
2749
+ static cyberpunk() {
2750
+ const ret = wasm.jsuitheme_cyberpunk();
2751
+ return JsUITheme.__wrap(ret);
2752
+ }
2753
+ /**
2754
+ * @returns {string}
2755
+ */
2756
+ get gridLine() {
2757
+ let deferred1_0;
2758
+ let deferred1_1;
2759
+ try {
2760
+ const ret = wasm.jsuitheme_gridLine(this.__wbg_ptr);
2761
+ deferred1_0 = ret[0];
2762
+ deferred1_1 = ret[1];
2763
+ return getStringFromWasm0(ret[0], ret[1]);
2764
+ } finally {
2765
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2766
+ }
2767
+ }
2768
+ }
2769
+ if (Symbol.dispose) JsUITheme.prototype[Symbol.dispose] = JsUITheme.prototype.free;
2770
+
2771
+ /**
2772
+ * Chart viewport managing visible area and scrolling.
2773
+ */
2774
+ export class JsViewport {
2775
+ __destroy_into_raw() {
2776
+ const ptr = this.__wbg_ptr;
2777
+ this.__wbg_ptr = 0;
2778
+ JsViewportFinalization.unregister(this);
2779
+ return ptr;
2780
+ }
2781
+ free() {
2782
+ const ptr = this.__destroy_into_raw();
2783
+ wasm.__wbg_jsviewport_free(ptr, 0);
2784
+ }
2785
+ /**
2786
+ * @returns {number}
2787
+ */
2788
+ get chartWidth() {
2789
+ const ret = wasm.jsviewport_chartWidth(this.__wbg_ptr);
2790
+ return ret;
2791
+ }
2792
+ /**
2793
+ * @returns {number}
2794
+ */
2795
+ get chartHeight() {
2796
+ const ret = wasm.jsviewport_chartHeight(this.__wbg_ptr);
2797
+ return ret;
2798
+ }
2799
+ scrollToEnd() {
2800
+ wasm.jsviewport_scrollToEnd(this.__wbg_ptr);
2801
+ }
2802
+ /**
2803
+ * @param {number} count
2804
+ */
2805
+ setBarCount(count) {
2806
+ wasm.jsviewport_setBarCount(this.__wbg_ptr, count);
2807
+ }
2808
+ scrollToStart() {
2809
+ wasm.jsviewport_scrollToStart(this.__wbg_ptr);
2810
+ }
2811
+ /**
2812
+ * @param {number} width
2813
+ * @param {number} height
2814
+ */
2815
+ constructor(width, height) {
2816
+ const ret = wasm.jsviewport_new(width, height);
2817
+ this.__wbg_ptr = ret >>> 0;
2818
+ JsViewportFinalization.register(this, this.__wbg_ptr, this);
2819
+ return this;
2820
+ }
2821
+ /**
2822
+ * @param {number} width
2823
+ * @param {number} height
2824
+ */
2825
+ setSize(width, height) {
2826
+ wasm.jsviewport_setSize(this.__wbg_ptr, width, height);
2827
+ }
2828
+ /**
2829
+ * @returns {number}
2830
+ */
2831
+ get barWidth() {
2832
+ const ret = wasm.jsviewport_barWidth(this.__wbg_ptr);
2833
+ return ret;
2834
+ }
2835
+ }
2836
+ if (Symbol.dispose) JsViewport.prototype[Symbol.dispose] = JsViewport.prototype.free;
2837
+
2838
+ /**
2839
+ * Get library version.
2840
+ * @returns {string}
2841
+ */
2842
+ export function version() {
2843
+ let deferred1_0;
2844
+ let deferred1_1;
2845
+ try {
2846
+ const ret = wasm.version();
2847
+ deferred1_0 = ret[0];
2848
+ deferred1_1 = ret[1];
2849
+ return getStringFromWasm0(ret[0], ret[1]);
2850
+ } finally {
2851
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2852
+ }
2853
+ }
2854
+
2855
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
2856
+
2857
+ async function __wbg_load(module, imports) {
2858
+ if (typeof Response === 'function' && module instanceof Response) {
2859
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
2860
+ try {
2861
+ return await WebAssembly.instantiateStreaming(module, imports);
2862
+ } catch (e) {
2863
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
2864
+
2865
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
2866
+ 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", e);
2867
+
2868
+ } else {
2869
+ throw e;
2870
+ }
2871
+ }
2872
+ }
2873
+
2874
+ const bytes = await module.arrayBuffer();
2875
+ return await WebAssembly.instantiate(bytes, imports);
2876
+ } else {
2877
+ const instance = await WebAssembly.instantiate(module, imports);
2878
+
2879
+ if (instance instanceof WebAssembly.Instance) {
2880
+ return { instance, module };
2881
+ } else {
2882
+ return instance;
2883
+ }
2884
+ }
2885
+ }
2886
+
2887
+ function __wbg_get_imports() {
2888
+ const imports = {};
2889
+ imports.wbg = {};
2890
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
2891
+ throw new Error(getStringFromWasm0(arg0, arg1));
2892
+ };
2893
+ imports.wbg.__wbg_jsbar_unwrap = function(arg0) {
2894
+ const ret = JsBar.__unwrap(arg0);
2895
+ return ret;
2896
+ };
2897
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
2898
+ // Cast intrinsic for `Ref(String) -> Externref`.
2899
+ const ret = getStringFromWasm0(arg0, arg1);
2090
2900
  return ret;
2091
2901
  };
2092
2902
  imports.wbg.__wbindgen_init_externref_table = function() {