diff --git a/media/surfer/index.html b/media/surfer/index.html new file mode 100644 index 0000000..7839afa --- /dev/null +++ b/media/surfer/index.html @@ -0,0 +1,200 @@ + + + + + + + + + + Surfer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/surfer/integration.js b/media/surfer/integration.js new file mode 100644 index 0000000..b848919 --- /dev/null +++ b/media/surfer/integration.js @@ -0,0 +1,65 @@ +// Web apps which integrate Surfer as an iframe can give commands to surfer via +// the .postMessage [1] function on the iframe. +// +// For example, to tell Surfer to load waveforms from a URL, use +// `.postMessage({command: "LoadUrl", url: "https://app.surfer-project.org/picorv32.vcd"})` +// +// For more complex functionality, one can also inject any `Message` defined +// in `surfer::Message` in surfer/main.rs. However, the API of these messages +// is not stable and may change at any time. If you add functionality via +// these, make sure to test the new functionality when changing Surfer version. +// +// [1] https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage + +function register_message_listener() { + window.addEventListener("message", (event) => { + // JSON decode the message + const decoded = event.data + + switch (decoded.command) { + // Load a waveform from a URL. The format is inferred from the data. + // Example: `{command: "LoadUrl", url: "https://app.surfer-project.org/picorv32.vcd"}` + + case 'LoadUrl': { + const msg = { + LoadWaveformFileFromUrl: [ + decoded.url, + "Clear" + ] + } + inject_message(JSON.stringify(msg)) + break; + } + + case 'ToggleMenu': { + const msg = "ToggleMenu" + inject_message(JSON.stringify(msg)) + break; + } + + // Load waveform data directly from string content + case 'LoadData': { + const msg = { + LoadFromData: [ + decoded.content, + decoded.fileName || "waveform.vcd", + "Clear" + ] + } + inject_message(JSON.stringify(msg)) + break; + } + + // Inject any other message supported by Surfer in the surfer::Message enum. + // NOTE: The API of these is unstable. + case 'InjectMessage': { + inject_message(decoded.message); + break + } + + default: + console.log(`Unknown message.command ${decoded.command}`) + break; + } + }); +} diff --git a/media/surfer/manifest.json b/media/surfer/manifest.json new file mode 100644 index 0000000..bdd75a4 --- /dev/null +++ b/media/surfer/manifest.json @@ -0,0 +1,10 @@ +{ + "background_color": "white", + "display": "standalone", + "id": "/index.html", + "lang": "en-US", + "name": "Surfer", + "short_name": "surfer", + "start_url": "./index.html", + "theme_color": "white" +} diff --git a/media/surfer/surfer.js b/media/surfer/surfer.js new file mode 100644 index 0000000..2427ce2 --- /dev/null +++ b/media/surfer/surfer.js @@ -0,0 +1,2227 @@ +let wasm; + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_externrefs.set(idx, obj); + return idx; +} + +const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(state => state.dtor(state.a, state.b)); + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches && builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +function getArrayU8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); +} + +let cachedDataViewMemory0 = null; +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return decodeText(ptr, len); +} + +let cachedUint8ArrayMemory0 = null; +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + const idx = addToExternrefTable0(e); + wasm.__wbindgen_exn_store(idx); + } +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +function makeMutClosure(arg0, arg1, dtor, f) { + const state = { a: arg0, b: arg1, cnt: 1, dtor }; + const real = (...args) => { + + // First up with a closure we increment the internal reference + // count. This ensures that the Rust closure environment won't + // be deallocated while we're invoking it. + state.cnt++; + const a = state.a; + state.a = 0; + try { + return f(a, state.b, ...args); + } finally { + state.a = a; + real._wbg_cb_unref(); + } + }; + real._wbg_cb_unref = () => { + if (--state.cnt === 0) { + state.dtor(state.a, state.b); + state.a = 0; + CLOSURE_DTORS.unregister(state); + } + }; + CLOSURE_DTORS.register(real, state, state); + return real; +} + +function passStringToWasm0(arg, malloc, realloc) { + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = cachedTextEncoder.encodeInto(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_externrefs.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} + +let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); +cachedTextDecoder.decode(); +const MAX_SAFARI_DECODE_BYTES = 2146435072; +let numBytesDecoded = 0; +function decodeText(ptr, len) { + numBytesDecoded += len; + if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) { + cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + cachedTextDecoder.decode(); + numBytesDecoded = len; + } + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +const cachedTextEncoder = new TextEncoder(); + +if (!('encodeInto' in cachedTextEncoder)) { + cachedTextEncoder.encodeInto = function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; + } +} + +let WASM_VECTOR_LEN = 0; + +function wasm_bindgen__convert__closures_____invoke__h3019cdfbf8217f17(arg0, arg1) { + const ret = wasm.wasm_bindgen__convert__closures_____invoke__h3019cdfbf8217f17(arg0, arg1); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} + +function wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981(arg0, arg1, arg2) { + wasm.wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981(arg0, arg1, arg2); +} + +function wasm_bindgen__convert__closures_____invoke__hbe65ce5d0d117e04(arg0, arg1) { + wasm.wasm_bindgen__convert__closures_____invoke__hbe65ce5d0d117e04(arg0, arg1); +} + +function wasm_bindgen__convert__closures_____invoke__h01d319199f3517b1(arg0, arg1, arg2, arg3) { + wasm.wasm_bindgen__convert__closures_____invoke__h01d319199f3517b1(arg0, arg1, arg2, arg3); +} + +const __wbindgen_enum_ReadableStreamType = ["bytes"]; + +const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"]; + +const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"]; + +const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"]; + +const __wbindgen_enum_ResizeObserverBoxOptions = ["border-box", "content-box", "device-pixel-content-box"]; + +const DisplayedItemRefFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_displayeditemref_free(ptr >>> 0, 1)); + +const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1)); + +const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1)); + +const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1)); + +const WebHandleFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_webhandle_free(ptr >>> 0, 1)); + +/** + * Key for the [`crate::wave_data::WaveData::displayed_items`] hash map + */ +export class DisplayedItemRef { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + DisplayedItemRefFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_displayeditemref_free(ptr, 0); + } + /** + * @returns {number} + */ + get 0() { + const ret = wasm.__wbg_get_displayeditemref_0(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} arg0 + */ + set 0(arg0) { + wasm.__wbg_set_displayeditemref_0(this.__wbg_ptr, arg0); + } +} +if (Symbol.dispose) DisplayedItemRef.prototype[Symbol.dispose] = DisplayedItemRef.prototype.free; + +export class IntoUnderlyingByteSource { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingByteSourceFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingbytesource_free(ptr, 0); + } + /** + * @returns {number} + */ + get autoAllocateChunkSize() { + const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {ReadableByteStreamController} controller + * @returns {Promise} + */ + pull(controller) { + const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller); + return ret; + } + /** + * @param {ReadableByteStreamController} controller + */ + start(controller) { + wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller); + } + /** + * @returns {ReadableStreamType} + */ + get type() { + const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr); + return __wbindgen_enum_ReadableStreamType[ret]; + } + cancel() { + const ptr = this.__destroy_into_raw(); + wasm.intounderlyingbytesource_cancel(ptr); + } +} +if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free; + +export class IntoUnderlyingSink { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingSinkFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingsink_free(ptr, 0); + } + /** + * @param {any} reason + * @returns {Promise} + */ + abort(reason) { + const ptr = this.__destroy_into_raw(); + const ret = wasm.intounderlyingsink_abort(ptr, reason); + return ret; + } + /** + * @returns {Promise} + */ + close() { + const ptr = this.__destroy_into_raw(); + const ret = wasm.intounderlyingsink_close(ptr); + return ret; + } + /** + * @param {any} chunk + * @returns {Promise} + */ + write(chunk) { + const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk); + return ret; + } +} +if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free; + +export class IntoUnderlyingSource { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingSourceFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingsource_free(ptr, 0); + } + /** + * @param {ReadableStreamDefaultController} controller + * @returns {Promise} + */ + pull(controller) { + const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller); + return ret; + } + cancel() { + const ptr = this.__destroy_into_raw(); + wasm.intounderlyingsource_cancel(ptr); + } +} +if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free; + +/** + * Your handle to the web app from JavaScript. + */ +export class WebHandle { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + WebHandleFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_webhandle_free(ptr, 0); + } + /** + * Installs a panic hook, then returns. + */ + constructor() { + const ret = wasm.webhandle_new(); + this.__wbg_ptr = ret >>> 0; + WebHandleFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * Call this once from JavaScript to start your app. + * @param {HTMLCanvasElement} canvas + * @returns {Promise} + */ + start(canvas) { + const ret = wasm.webhandle_start(this.__wbg_ptr, canvas); + return ret; + } +} +if (Symbol.dispose) WebHandle.prototype[Symbol.dispose] = WebHandle.prototype.free; + +/** + * @returns {Promise} + */ +export function cxxrtl_cs_message() { + const ret = wasm.cxxrtl_cs_message(); + return ret; +} + +/** + * @param {number} id + * @param {string} from_item + * @param {bigint} from_time + * @param {string} to_item + * @param {bigint} to_time + * @param {string} text + * @returns {Promise} + */ +export function draw_text_arrow(id, from_item, from_time, to_item, to_time, text) { + const ptr0 = passStringToWasm0(from_item, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passStringToWasm0(to_item, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len2 = WASM_VECTOR_LEN; + const ret = wasm.draw_text_arrow(id, ptr0, len0, from_time, ptr1, len1, to_time, ptr2, len2); + return ret; +} + +/** + * @param {string} message + * @returns {Promise} + */ +export function handle_wcp_cs_message(message) { + const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.handle_wcp_cs_message(ptr0, len0); + return ret; +} + +/** + * @param {string} name + * @returns {Promise} + */ +export function id_of_name(name) { + const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.id_of_name(ptr0, len0); + return ret; +} + +/** + * @param {string} name + * @returns {Promise} + */ +export function index_of_name(name) { + const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.index_of_name(ptr0, len0); + return ret; +} + +/** + * @param {string} message + */ +export function inject_message(message) { + const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + wasm.inject_message(ptr0, len0); +} + +/** + * @returns {Promise} + */ +export function next_wcp_sc_message() { + const ret = wasm.next_wcp_sc_message(); + return ret; +} + +/** + * @param {string} message + * @returns {Promise} + */ +export function on_cxxrtl_sc_message(message) { + const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.on_cxxrtl_sc_message(ptr0, len0); + return ret; +} + +/** + * @returns {Promise} + */ +export function spade_loaded() { + const ret = wasm.spade_loaded(); + return ret; +} + +/** + * @returns {Promise} + */ +export function start_cxxrtl() { + const ret = wasm.start_cxxrtl(); + return ret; +} + +/** + * @returns {Promise} + */ +export function start_wcp() { + const ret = wasm.start_wcp(); + return ret; +} + +/** + * @returns {Promise} + */ +export function waves_loaded() { + const ret = wasm.waves_loaded(); + return ret; +} + +const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']); + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + } catch (e) { + const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type); + + if (validResponse && module.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", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) { + const ret = Error(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) { + const v = arg0; + const ret = typeof(v) === 'boolean' ? v : undefined; + return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0; + }; + imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) { + const ret = debugString(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) { + const ret = arg0 in arg1; + return ret; + }; + imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) { + const ret = typeof(arg0) === 'function'; + return ret; + }; + imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) { + const val = arg0; + const ret = typeof(val) === 'object' && val !== null; + return ret; + }; + imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) { + const ret = arg0 === undefined; + return ret; + }; + imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'number' ? obj : undefined; + getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); + }; + imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) { + arg0._wbg_cb_unref(); + }; + imports.wbg.__wbg_abort_07646c894ebbf2bd = function(arg0) { + arg0.abort(); + }; + imports.wbg.__wbg_abort_399ecbcfd6ef3c8e = function(arg0, arg1) { + arg0.abort(arg1); + }; + imports.wbg.__wbg_activeElement_6c18eb1d0e808cec = function(arg0) { + const ret = arg0.activeElement; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_activeElement_b3e6b135325e4d5f = function(arg0) { + const ret = arg0.activeElement; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_activeTexture_1db0722f00c3f843 = function(arg0, arg1) { + arg0.activeTexture(arg1 >>> 0); + }; + imports.wbg.__wbg_activeTexture_59810c16ea8d6e34 = function(arg0, arg1) { + arg0.activeTexture(arg1 >>> 0); + }; + imports.wbg.__wbg_addEventListener_6a82629b3d430a48 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3); + }, arguments) }; + imports.wbg.__wbg_addEventListener_82cddc614107eb45 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3, arg4); + }, arguments) }; + imports.wbg.__wbg_altKey_56d1d642f3a28c92 = function(arg0) { + const ret = arg0.altKey; + return ret; + }; + imports.wbg.__wbg_altKey_e13fae92dfebca3e = function(arg0) { + const ret = arg0.altKey; + return ret; + }; + imports.wbg.__wbg_appendChild_7465eba84213c75f = function() { return handleError(function (arg0, arg1) { + const ret = arg0.appendChild(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_append_c5cbdf46455cc776 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_arrayBuffer_3356d392ef2d2aa9 = function(arg0) { + const ret = arg0.arrayBuffer(); + return ret; + }; + imports.wbg.__wbg_arrayBuffer_c04af4fce566092d = function() { return handleError(function (arg0) { + const ret = arg0.arrayBuffer(); + return ret; + }, arguments) }; + imports.wbg.__wbg_at_505937f1c4b80bfa = function(arg0, arg1) { + const ret = arg0.at(arg1); + return ret; + }; + imports.wbg.__wbg_attachShader_bc2b53790fd12d3a = function(arg0, arg1, arg2) { + arg0.attachShader(arg1, arg2); + }; + imports.wbg.__wbg_attachShader_ce575704294db9cc = function(arg0, arg1, arg2) { + arg0.attachShader(arg1, arg2); + }; + imports.wbg.__wbg_bindBuffer_110b128c65a97376 = function(arg0, arg1, arg2) { + arg0.bindBuffer(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindBuffer_c24c31cbec41cb21 = function(arg0, arg1, arg2) { + arg0.bindBuffer(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindTexture_4537240b278f1d53 = function(arg0, arg1, arg2) { + arg0.bindTexture(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindTexture_6ed714c0afe8b8d1 = function(arg0, arg1, arg2) { + arg0.bindTexture(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindVertexArrayOES_fdb7e747e386f55a = function(arg0, arg1) { + arg0.bindVertexArrayOES(arg1); + }; + imports.wbg.__wbg_bindVertexArray_ced27387a0718508 = function(arg0, arg1) { + arg0.bindVertexArray(arg1); + }; + imports.wbg.__wbg_blendEquationSeparate_403e2a62d6e0d67f = function(arg0, arg1, arg2) { + arg0.blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); + }; + imports.wbg.__wbg_blendEquationSeparate_e1eb0d0f32ef91af = function(arg0, arg1, arg2) { + arg0.blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); + }; + imports.wbg.__wbg_blendFuncSeparate_4cca29476893cc61 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); + }; + imports.wbg.__wbg_blendFuncSeparate_e5a1bacf4a0700cd = function(arg0, arg1, arg2, arg3, arg4) { + arg0.blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); + }; + imports.wbg.__wbg_blockSize_6456aaf09f0ab287 = function(arg0) { + const ret = arg0.blockSize; + return ret; + }; + imports.wbg.__wbg_blur_ca11f751d4c09d3f = function() { return handleError(function (arg0) { + arg0.blur(); + }, arguments) }; + imports.wbg.__wbg_body_544738f8b03aef13 = function(arg0) { + const ret = arg0.body; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_bottom_7d2cabadf8c452a8 = function(arg0) { + const ret = arg0.bottom; + return ret; + }; + imports.wbg.__wbg_bufferData_69dbeea8e1d79f7b = function(arg0, arg1, arg2, arg3) { + arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0); + }; + imports.wbg.__wbg_bufferData_ac5c7900b06f1517 = function(arg0, arg1, arg2, arg3) { + arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0); + }; + imports.wbg.__wbg_buffer_6cb2fecb1f253d71 = function(arg0) { + const ret = arg0.buffer; + return ret; + }; + imports.wbg.__wbg_button_a54acd25bab5d442 = function(arg0) { + const ret = arg0.button; + return ret; + }; + imports.wbg.__wbg_byobRequest_f8e3517f5f8ad284 = function(arg0) { + const ret = arg0.byobRequest; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_byteLength_faa9938885bdeee6 = function(arg0) { + const ret = arg0.byteLength; + return ret; + }; + imports.wbg.__wbg_byteOffset_3868b6a19ba01dea = function(arg0) { + const ret = arg0.byteOffset; + return ret; + }; + imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.call(arg1, arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.call(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_cancelAnimationFrame_1c2a3faf7be5aedd = function() { return handleError(function (arg0, arg1) { + arg0.cancelAnimationFrame(arg1); + }, arguments) }; + imports.wbg.__wbg_changedTouches_002fee0da4489efe = function(arg0) { + const ret = arg0.changedTouches; + return ret; + }; + imports.wbg.__wbg_clearColor_66e5dad6393f32ec = function(arg0, arg1, arg2, arg3, arg4) { + arg0.clearColor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_clearColor_fe8de7e582b77e40 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.clearColor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_clearInterval_45ac4607741420fd = function(arg0, arg1) { + arg0.clearInterval(arg1); + }; + imports.wbg.__wbg_clearTimeout_7a42b49784aea641 = function(arg0) { + const ret = clearTimeout(arg0); + return ret; + }; + imports.wbg.__wbg_clear_00ac71df5db8ab17 = function(arg0, arg1) { + arg0.clear(arg1 >>> 0); + }; + imports.wbg.__wbg_clear_52caf9271911674b = function(arg0, arg1) { + arg0.clear(arg1 >>> 0); + }; + imports.wbg.__wbg_click_3a8e35c38329dd3a = function(arg0) { + arg0.click(); + }; + imports.wbg.__wbg_clientX_2ea1e898842f21ed = function(arg0) { + const ret = arg0.clientX; + return ret; + }; + imports.wbg.__wbg_clientX_c17906c33ea43025 = function(arg0) { + const ret = arg0.clientX; + return ret; + }; + imports.wbg.__wbg_clientY_70eb66d231a332a3 = function(arg0) { + const ret = arg0.clientY; + return ret; + }; + imports.wbg.__wbg_clientY_d12086a5a6a3a9d5 = function(arg0) { + const ret = arg0.clientY; + return ret; + }; + imports.wbg.__wbg_clipboardData_11e9a33a8f4d9552 = function(arg0) { + const ret = arg0.clipboardData; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_clipboard_c210ce30f20907dd = function(arg0) { + const ret = arg0.clipboard; + return ret; + }; + imports.wbg.__wbg_close_0af5661bf3d335f2 = function() { return handleError(function (arg0) { + arg0.close(); + }, arguments) }; + imports.wbg.__wbg_close_3ec111e7b23d94d8 = function() { return handleError(function (arg0) { + arg0.close(); + }, arguments) }; + imports.wbg.__wbg_colorMask_27d9f83dd2189ed6 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); + }; + imports.wbg.__wbg_colorMask_f000b510fac0bd7c = function(arg0, arg1, arg2, arg3, arg4) { + arg0.colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); + }; + imports.wbg.__wbg_compileShader_ac0bf6f0837881c3 = function(arg0, arg1) { + arg0.compileShader(arg1); + }; + imports.wbg.__wbg_compileShader_ba337110bed419e1 = function(arg0, arg1) { + arg0.compileShader(arg1); + }; + imports.wbg.__wbg_contentBoxSize_252a34474a67b3bb = function(arg0) { + const ret = arg0.contentBoxSize; + return ret; + }; + imports.wbg.__wbg_contentRect_1806147dfdc380d8 = function(arg0) { + const ret = arg0.contentRect; + return ret; + }; + imports.wbg.__wbg_createBuffer_465b645a46535184 = function(arg0) { + const ret = arg0.createBuffer(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createBuffer_8601b8ec330ab49d = function(arg0) { + const ret = arg0.createBuffer(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createElement_da4ed2b219560fc6 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.createElement(getStringFromWasm0(arg1, arg2)); + return ret; + }, arguments) }; + imports.wbg.__wbg_createObjectURL_7d9f7f8f41373850 = function() { return handleError(function (arg0, arg1) { + const ret = URL.createObjectURL(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_createProgram_023ba0fc6ff6efd6 = function(arg0) { + const ret = arg0.createProgram(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createProgram_ffe9d4a2cba210f4 = function(arg0) { + const ret = arg0.createProgram(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createShader_4626088b63c33727 = function(arg0, arg1) { + const ret = arg0.createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createShader_f88f9b82748ef6c0 = function(arg0, arg1) { + const ret = arg0.createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createTexture_41211a4e8ae0afec = function(arg0) { + const ret = arg0.createTexture(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createTexture_4d5934eb9772b5fe = function(arg0) { + const ret = arg0.createTexture(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createVertexArrayOES_7bcc20082143e8f2 = function(arg0) { + const ret = arg0.createVertexArrayOES(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createVertexArray_997b3c5b1091afd9 = function(arg0) { + const ret = arg0.createVertexArray(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_ctrlKey_487597b9069da036 = function(arg0) { + const ret = arg0.ctrlKey; + return ret; + }; + imports.wbg.__wbg_ctrlKey_b391e5105c3f6e76 = function(arg0) { + const ret = arg0.ctrlKey; + return ret; + }; + imports.wbg.__wbg_dataTransfer_3653d4b679b026b2 = function(arg0) { + const ret = arg0.dataTransfer; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_data_ba1e638a3b5a1da7 = function(arg0, arg1) { + const ret = arg1.data; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_deleteBuffer_5ed1698208181e1f = function(arg0, arg1) { + arg0.deleteBuffer(arg1); + }; + imports.wbg.__wbg_deleteBuffer_ba7f1164cc23b2ca = function(arg0, arg1) { + arg0.deleteBuffer(arg1); + }; + imports.wbg.__wbg_deleteProgram_3bf297a31d0e6e48 = function(arg0, arg1) { + arg0.deleteProgram(arg1); + }; + imports.wbg.__wbg_deleteProgram_62774baacb13ff2b = function(arg0, arg1) { + arg0.deleteProgram(arg1); + }; + imports.wbg.__wbg_deleteShader_c357bb8fbede8370 = function(arg0, arg1) { + arg0.deleteShader(arg1); + }; + imports.wbg.__wbg_deleteShader_c686dd351de5a068 = function(arg0, arg1) { + arg0.deleteShader(arg1); + }; + imports.wbg.__wbg_deleteTexture_2a9b703dc2df5657 = function(arg0, arg1) { + arg0.deleteTexture(arg1); + }; + imports.wbg.__wbg_deleteTexture_875f8d84e74610a0 = function(arg0, arg1) { + arg0.deleteTexture(arg1); + }; + imports.wbg.__wbg_deltaMode_d74ec093e23ffeec = function(arg0) { + const ret = arg0.deltaMode; + return ret; + }; + imports.wbg.__wbg_deltaX_41f7678c94b10355 = function(arg0) { + const ret = arg0.deltaX; + return ret; + }; + imports.wbg.__wbg_deltaY_3f10fd796fae2a0f = function(arg0) { + const ret = arg0.deltaY; + return ret; + }; + imports.wbg.__wbg_detachShader_678bb6c64268535d = function(arg0, arg1, arg2) { + arg0.detachShader(arg1, arg2); + }; + imports.wbg.__wbg_detachShader_6dca9ecdeb9bbcd3 = function(arg0, arg1, arg2) { + arg0.detachShader(arg1, arg2); + }; + imports.wbg.__wbg_devicePixelContentBoxSize_4312b643ce19dcae = function(arg0) { + const ret = arg0.devicePixelContentBoxSize; + return ret; + }; + imports.wbg.__wbg_devicePixelRatio_390dee26c70aa30f = function(arg0) { + const ret = arg0.devicePixelRatio; + return ret; + }; + imports.wbg.__wbg_disableVertexAttribArray_4c5c7214724209d0 = function(arg0, arg1) { + arg0.disableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_disableVertexAttribArray_bcf2272b428ec9fc = function(arg0, arg1) { + arg0.disableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_disable_3af3e194392b0a83 = function(arg0, arg1) { + arg0.disable(arg1 >>> 0); + }; + imports.wbg.__wbg_disable_c05809e00765548d = function(arg0, arg1) { + arg0.disable(arg1 >>> 0); + }; + imports.wbg.__wbg_disconnect_0078fed2ab427a04 = function(arg0) { + arg0.disconnect(); + }; + imports.wbg.__wbg_document_5b745e82ba551ca5 = function(arg0) { + const ret = arg0.document; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) { + const ret = arg0.done; + return ret; + }; + imports.wbg.__wbg_drawElements_2a3619292860fa19 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); + }; + imports.wbg.__wbg_drawElements_738773baf3df000e = function(arg0, arg1, arg2, arg3, arg4) { + arg0.drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); + }; + imports.wbg.__wbg_elementFromPoint_3e36e942ea9d1a54 = function(arg0, arg1, arg2) { + const ret = arg0.elementFromPoint(arg1, arg2); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_elementFromPoint_8a2969ab5273b90a = function(arg0, arg1, arg2) { + const ret = arg0.elementFromPoint(arg1, arg2); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_enableVertexAttribArray_2898de871f949393 = function(arg0, arg1) { + arg0.enableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_enableVertexAttribArray_def9952d8426be95 = function(arg0, arg1) { + arg0.enableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_enable_2d8bb952637ad17a = function(arg0, arg1) { + arg0.enable(arg1 >>> 0); + }; + imports.wbg.__wbg_enable_52598759008d46ee = function(arg0, arg1) { + arg0.enable(arg1 >>> 0); + }; + imports.wbg.__wbg_enqueue_a7e6b1ee87963aad = function() { return handleError(function (arg0, arg1) { + arg0.enqueue(arg1); + }, arguments) }; + imports.wbg.__wbg_error_8175373a88db6004 = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_fetch_74a3e84ebd2c9a0e = function(arg0) { + const ret = fetch(arg0); + return ret; + }; + imports.wbg.__wbg_fetch_90447c28cc0b095e = function(arg0, arg1) { + const ret = arg0.fetch(arg1); + return ret; + }; + imports.wbg.__wbg_files_aa1f009258eadae6 = function(arg0) { + const ret = arg0.files; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_files_d5264787ebe0eb8e = function(arg0) { + const ret = arg0.files; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_focus_220a53e22147dc0f = function() { return handleError(function (arg0) { + arg0.focus(); + }, arguments) }; + imports.wbg.__wbg_force_ec61071358a7ae6f = function(arg0) { + const ret = arg0.force; + return ret; + }; + imports.wbg.__wbg_generateMipmap_85452cd8f350f404 = function(arg0, arg1) { + arg0.generateMipmap(arg1 >>> 0); + }; + imports.wbg.__wbg_generateMipmap_bfd04ca851518e7c = function(arg0, arg1) { + arg0.generateMipmap(arg1 >>> 0); + }; + imports.wbg.__wbg_getAttribLocation_5917620b3c9497e6 = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getAttribLocation(arg1, getStringFromWasm0(arg2, arg3)); + return ret; + }; + imports.wbg.__wbg_getAttribLocation_e56db0839c7627ca = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getAttribLocation(arg1, getStringFromWasm0(arg2, arg3)); + return ret; + }; + imports.wbg.__wbg_getBoundingClientRect_25e44a78507968b0 = function(arg0) { + const ret = arg0.getBoundingClientRect(); + return ret; + }; + imports.wbg.__wbg_getComputedStyle_bbcd5e3d08077b71 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getComputedStyle(arg1); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getContext_01f42b234e833f0a = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getContext(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getData_0c18014d58e42433 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = arg1.getData(getStringFromWasm0(arg2, arg3)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getElementById_e05488d2143c2b21 = function(arg0, arg1, arg2) { + const ret = arg0.getElementById(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getError_1512d8f11d3dce17 = function(arg0) { + const ret = arg0.getError(); + return ret; + }; + imports.wbg.__wbg_getError_86b51f8a9c7debb3 = function(arg0) { + const ret = arg0.getError(); + return ret; + }; + imports.wbg.__wbg_getExtension_2078be640f482416 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getExtension(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getExtension_49a13df0dc150fab = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getExtension(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getItem_1340bfc9a10d5991 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = arg1.getItem(getStringFromWasm0(arg2, arg3)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getParameter_08df3cb47d357cca = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getParameter(arg1 >>> 0); + return ret; + }, arguments) }; + imports.wbg.__wbg_getParameter_1dfd667c33169fab = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getParameter(arg1 >>> 0); + return ret; + }, arguments) }; + imports.wbg.__wbg_getProgramInfoLog_a0ff8b0971fcaf48 = function(arg0, arg1, arg2) { + const ret = arg1.getProgramInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getProgramInfoLog_ea3064b153e4542a = function(arg0, arg1, arg2) { + const ret = arg1.getProgramInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getProgramParameter_c777611a448a6ccd = function(arg0, arg1, arg2) { + const ret = arg0.getProgramParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getProgramParameter_ff1aee3815d6a8f9 = function(arg0, arg1, arg2) { + const ret = arg0.getProgramParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getPropertyValue_dcded91357966805 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = arg1.getPropertyValue(getStringFromWasm0(arg2, arg3)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getRootNode_c2316085ca42cd67 = function(arg0) { + const ret = arg0.getRootNode(); + return ret; + }; + imports.wbg.__wbg_getShaderInfoLog_1affea8c74bd191c = function(arg0, arg1, arg2) { + const ret = arg1.getShaderInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getShaderInfoLog_862d8c35c68d02c8 = function(arg0, arg1, arg2) { + const ret = arg1.getShaderInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getShaderParameter_1f86483b99db3dcc = function(arg0, arg1, arg2) { + const ret = arg0.getShaderParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getShaderParameter_b8a41abb0d7d23c3 = function(arg0, arg1, arg2) { + const ret = arg0.getShaderParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getSupportedExtensions_bc23bc19c9dac45d = function(arg0) { + const ret = arg0.getSupportedExtensions(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getSupportedExtensions_e1652e64b15aff85 = function(arg0) { + const ret = arg0.getSupportedExtensions(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getUniformLocation_21ac12bfc569cbbf = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getUniformLocation(arg1, getStringFromWasm0(arg2, arg3)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getUniformLocation_2a4ddf8dd8285373 = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getUniformLocation(arg1, getStringFromWasm0(arg2, arg3)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_331085331950b4f1 = function(arg0, arg1, arg2, arg3) { + const ret = arg1.get(getStringFromWasm0(arg2, arg3)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return ret; + }; + imports.wbg.__wbg_get_84957f57555c0874 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_89bca58298277b24 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(arg0, arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_get_e8e8a591c89f67f6 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_has_0e670569d65d3a45 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.has(arg0, arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_hash_979a7861415bf1f8 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.hash; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_headers_654c30e1bcccc552 = function(arg0) { + const ret = arg0.headers; + return ret; + }; + imports.wbg.__wbg_height_5d22b94a936fae9f = function(arg0) { + const ret = arg0.height; + return ret; + }; + imports.wbg.__wbg_height_a07787f693c253d2 = function(arg0) { + const ret = arg0.height; + return ret; + }; + imports.wbg.__wbg_hidden_63c9db3ea5c1e10a = function(arg0) { + const ret = arg0.hidden; + return ret; + }; + imports.wbg.__wbg_host_d33d7c53a6d98060 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.host; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_hostname_4d06d0f997fded29 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.hostname; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_href_0a387dfdb6abe7e5 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.href; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_identifier_4045753259aef15d = function(arg0) { + const ret = arg0.identifier; + return ret; + }; + imports.wbg.__wbg_inlineSize_65c8cd0ecc54c605 = function(arg0) { + const ret = arg0.inlineSize; + return ret; + }; + imports.wbg.__wbg_instanceof_Document_90b941f0297459fe = function(arg0) { + let result; + try { + result = arg0 instanceof Document; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Element_6f7ba982258cfc0f = function(arg0) { + let result; + try { + result = arg0 instanceof Element; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlAnchorElement_2ac07b5cf25eac0c = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLAnchorElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlButtonElement_a1508e6aded117e1 = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLButtonElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlCanvasElement_c4251b1b6a15edcc = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLCanvasElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlElement_20a3acb594113d73 = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlInputElement_46b31917ce88698f = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLInputElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ResizeObserverEntry_598d7b7088f31bb9 = function(arg0) { + let result; + try { + result = arg0 instanceof ResizeObserverEntry; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ResizeObserverSize_1631a4523f7b848b = function(arg0) { + let result; + try { + result = arg0 instanceof ResizeObserverSize; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Response_cd74d1c2ac92cb0b = function(arg0) { + let result; + try { + result = arg0 instanceof Response; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ShadowRoot_acbbcc2231ef8a7b = function(arg0) { + let result; + try { + result = arg0 instanceof ShadowRoot; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_WebGl2RenderingContext_121e4c8c95b128ef = function(arg0) { + let result; + try { + result = arg0 instanceof WebGL2RenderingContext; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_WebGlRenderingContext_f2a36a2d31de185f = function(arg0) { + let result; + try { + result = arg0 instanceof WebGLRenderingContext; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Window_b5cf7783caa68180 = function(arg0) { + let result; + try { + result = arg0 instanceof Window; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_isActive_c1070510cdbd906b = function(arg0) { + const ret = arg0.isActive; + return ret; + }; + imports.wbg.__wbg_isComposing_f44397d3c48338be = function(arg0) { + const ret = arg0.isComposing; + return ret; + }; + imports.wbg.__wbg_isComposing_fcde9aa6cddb1f42 = function(arg0) { + const ret = arg0.isComposing; + return ret; + }; + imports.wbg.__wbg_isSecureContext_0defe0b227a0ff2a = function(arg0) { + const ret = arg0.isSecureContext; + return ret; + }; + imports.wbg.__wbg_is_928aa29d71e75457 = function(arg0, arg1) { + const ret = Object.is(arg0, arg1); + return ret; + }; + imports.wbg.__wbg_item_2c9f4df896e24628 = function(arg0, arg1) { + const ret = arg0.item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_items_7724bf0013e68df2 = function(arg0) { + const ret = arg0.items; + return ret; + }; + imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() { + const ret = Symbol.iterator; + return ret; + }; + imports.wbg.__wbg_keyCode_9a2cb918794208e5 = function(arg0) { + const ret = arg0.keyCode; + return ret; + }; + imports.wbg.__wbg_key_505d33c50799526a = function(arg0, arg1) { + const ret = arg1.key; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_lastModified_0b523634ff1e63fc = function(arg0) { + const ret = arg0.lastModified; + return ret; + }; + imports.wbg.__wbg_left_d52bfa3824286825 = function(arg0) { + const ret = arg0.left; + return ret; + }; + imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_5548a3a9b927d0af = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_7226f74c66ca4a9d = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_b3a710c4ed3e081c = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_linkProgram_2f770464e69099dc = function(arg0, arg1) { + arg0.linkProgram(arg1); + }; + imports.wbg.__wbg_linkProgram_93f76a2f5030041e = function(arg0, arg1) { + arg0.linkProgram(arg1); + }; + imports.wbg.__wbg_localStorage_e7a9e9fee8fc608d = function() { return handleError(function (arg0) { + const ret = arg0.localStorage; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_location_962e75c1c1b3ebed = function(arg0) { + const ret = arg0.location; + return ret; + }; + imports.wbg.__wbg_log_0cc1b7768397bcfe = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.log(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.log(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_mark_7438147ce31e9d4b = function(arg0, arg1) { + performance.mark(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbg_matchMedia_29904c79dbaba90b = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.matchMedia(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_matches_9cef9b7c722bd7c8 = function(arg0) { + const ret = arg0.matches; + return ret; + }; + imports.wbg.__wbg_measure_fb7825c11612c823 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + let deferred0_0; + let deferred0_1; + let deferred1_0; + let deferred1_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + deferred1_0 = arg2; + deferred1_1 = arg3; + performance.measure(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); + } + }, arguments) }; + imports.wbg.__wbg_metaKey_0572b1cbcb5b272b = function(arg0) { + const ret = arg0.metaKey; + return ret; + }; + imports.wbg.__wbg_metaKey_448c751accad2eba = function(arg0) { + const ret = arg0.metaKey; + return ret; + }; + imports.wbg.__wbg_name_13bb9dc8b6e6e67c = function(arg0, arg1) { + const ret = arg1.name; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_navigator_b49edef831236138 = function(arg0) { + const ret = arg0.navigator; + return ret; + }; + imports.wbg.__wbg_new_111dde64cffa8ba1 = function() { return handleError(function () { + const ret = new FileReader(); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_1ba21ce319a06297 = function() { + const ret = new Object(); + return ret; + }; + imports.wbg.__wbg_new_25f239778d6112b9 = function() { + const ret = new Array(); + return ret; + }; + imports.wbg.__wbg_new_3a326de758934c0f = function() { + const ret = new Error(); + return ret; + }; + imports.wbg.__wbg_new_3c79b3bb1b32b7d3 = function() { return handleError(function () { + const ret = new Headers(); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) { + const ret = new Uint8Array(arg0); + return ret; + }; + imports.wbg.__wbg_new_71138ce70c488616 = function() { + const ret = new Error(); + return ret; + }; + imports.wbg.__wbg_new_881a222c65f168fc = function() { return handleError(function () { + const ret = new AbortController(); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_a25bd305a87faf63 = function() { return handleError(function (arg0) { + const ret = new ResizeObserver(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_df1173567d5ff028 = function(arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) { + try { + var state0 = {a: arg0, b: arg1}; + var cb0 = (arg0, arg1) => { + const a = state0.a; + state0.a = 0; + try { + return wasm_bindgen__convert__closures_____invoke__h01d319199f3517b1(a, state0.b, arg0, arg1); + } finally { + state0.a = a; + } + }; + const ret = new Promise(cb0); + return ret; + } finally { + state0.a = state0.b = 0; + } + }; + imports.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) { + const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_new_with_byte_offset_and_length_d85c3da1fd8df149 = function(arg0, arg1, arg2) { + const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_new_with_record_from_str_to_blob_promise_44de1087288de77b = function() { return handleError(function (arg0) { + const ret = new ClipboardItem(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_with_str_and_init_c5748f76f5108934 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = new Request(getStringFromWasm0(arg0, arg1), arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_with_str_dea1b77a8c2f6d7d = function() { return handleError(function (arg0, arg1) { + const ret = new URLSearchParams(getStringFromWasm0(arg0, arg1)); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_with_u8_array_sequence_and_options_d4def9ec0588c7ec = function() { return handleError(function (arg0, arg1) { + const ret = new Blob(arg0, arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) { + const ret = arg0.next; + return ret; + }; + imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) { + const ret = arg0.next(); + return ret; + }, arguments) }; + imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) { + const ret = arg0.now(); + return ret; + }; + imports.wbg.__wbg_now_8cf15d6e317793e1 = function(arg0) { + const ret = arg0.now(); + return ret; + }; + imports.wbg.__wbg_observe_ce343c3f1701b1f1 = function(arg0, arg1, arg2) { + arg0.observe(arg1, arg2); + }; + imports.wbg.__wbg_of_6505a0eb509da02e = function(arg0) { + const ret = Array.of(arg0); + return ret; + }; + imports.wbg.__wbg_offsetTop_cea3f2bb4eff1df7 = function(arg0) { + const ret = arg0.offsetTop; + return ret; + }; + imports.wbg.__wbg_on_surfer_error_cdd96daedaef756e = function() { return handleError(function (arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + on_surfer_error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }, arguments) }; + imports.wbg.__wbg_open_c565053c17d497bd = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + const ret = arg0.open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_origin_c4ac149104b9ebad = function() { return handleError(function (arg0, arg1) { + const ret = arg1.origin; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_performance_7a3ffd0b17f663ad = function(arg0) { + const ret = arg0.performance; + return ret; + }; + imports.wbg.__wbg_performance_c77a440eff2efd9b = function(arg0) { + const ret = arg0.performance; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_pixelStorei_1956db9ae4b22c29 = function(arg0, arg1, arg2) { + arg0.pixelStorei(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_pixelStorei_5449c87f83f25694 = function(arg0, arg1, arg2) { + arg0.pixelStorei(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_port_3b339e96d336d1a4 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.port; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_preventDefault_e97663aeeb9709d3 = function(arg0) { + arg0.preventDefault(); + }; + imports.wbg.__wbg_protocol_9d5f5cf57103846e = function() { return handleError(function (arg0, arg1) { + const ret = arg1.protocol; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) { + Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2); + }; + imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) { + const ret = arg0.push(arg1); + return ret; + }; + imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) { + const ret = arg0.queueMicrotask; + return ret; + }; + imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) { + queueMicrotask(arg0); + }; + imports.wbg.__wbg_readAsArrayBuffer_0aca937439be3197 = function() { return handleError(function (arg0, arg1) { + arg0.readAsArrayBuffer(arg1); + }, arguments) }; + imports.wbg.__wbg_readPixels_031b1d4c916fc4f9 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + arg0.readPixels(arg1, arg2, arg3, arg4, arg5 >>> 0, arg6 >>> 0, arg7); + }, arguments) }; + imports.wbg.__wbg_readPixels_3288aabda6ab89ff = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + arg0.readPixels(arg1, arg2, arg3, arg4, arg5 >>> 0, arg6 >>> 0, arg7); + }, arguments) }; + imports.wbg.__wbg_removeChild_e269b93f63c5ba71 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.removeChild(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_removeEventListener_565e273024b68b75 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.removeEventListener(getStringFromWasm0(arg1, arg2), arg3); + }, arguments) }; + imports.wbg.__wbg_remove_32f69ffabcbc4072 = function(arg0) { + arg0.remove(); + }; + imports.wbg.__wbg_requestAnimationFrame_994dc4ebde22b8d9 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.requestAnimationFrame(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) { + const ret = Promise.resolve(arg0); + return ret; + }; + imports.wbg.__wbg_respond_9f7fc54636c4a3af = function() { return handleError(function (arg0, arg1) { + arg0.respond(arg1 >>> 0); + }, arguments) }; + imports.wbg.__wbg_result_893437a1eaacc4df = function() { return handleError(function (arg0) { + const ret = arg0.result; + return ret; + }, arguments) }; + imports.wbg.__wbg_right_b7a0dcdcec0301e1 = function(arg0) { + const ret = arg0.right; + return ret; + }; + imports.wbg.__wbg_scissor_04e903bd18e45083 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.scissor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_scissor_988df87f9cf85e7e = function(arg0, arg1, arg2, arg3, arg4) { + arg0.scissor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_search_856af82f9dccb2ef = function() { return handleError(function (arg0, arg1) { + const ret = arg1.search; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_setAttribute_34747dd193f45828 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setItem_1167ad38996d6426 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setProperty_f27b2c05323daf8a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setProperty(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setTimeout_06477c23d31efef1 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.setTimeout(arg1, arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_setTimeout_7bb3429662ab1e70 = function(arg0, arg1) { + const ret = setTimeout(arg0, arg1); + return ret; + }; + imports.wbg.__wbg_set_169e13b608078b7b = function(arg0, arg1, arg2) { + arg0.set(getArrayU8FromWasm0(arg1, arg2)); + }; + imports.wbg.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = Reflect.set(arg0, arg1, arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_set_accept_4af7309453c16421 = function(arg0, arg1, arg2) { + arg0.accept = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_autofocus_ae8f5acfea79d602 = function() { return handleError(function (arg0, arg1) { + arg0.autofocus = arg1 !== 0; + }, arguments) }; + imports.wbg.__wbg_set_body_8e743242d6076a4f = function(arg0, arg1) { + arg0.body = arg1; + }; + imports.wbg.__wbg_set_box_d724bbbe6354cf86 = function(arg0, arg1) { + arg0.box = __wbindgen_enum_ResizeObserverBoxOptions[arg1]; + }; + imports.wbg.__wbg_set_cache_0e437c7c8e838b9b = function(arg0, arg1) { + arg0.cache = __wbindgen_enum_RequestCache[arg1]; + }; + imports.wbg.__wbg_set_className_52411a7e4782668d = function(arg0, arg1, arg2) { + arg0.className = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_credentials_55ae7c3c106fd5be = function(arg0, arg1) { + arg0.credentials = __wbindgen_enum_RequestCredentials[arg1]; + }; + imports.wbg.__wbg_set_download_8403fd66b94b25a2 = function(arg0, arg1, arg2) { + arg0.download = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_headers_5671cf088e114d2b = function(arg0, arg1) { + arg0.headers = arg1; + }; + imports.wbg.__wbg_set_height_6f8f8ef4cb40e496 = function(arg0, arg1) { + arg0.height = arg1 >>> 0; + }; + imports.wbg.__wbg_set_href_25c4bcdcbfb4459b = function(arg0, arg1, arg2) { + arg0.href = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_id_702da6e1bcec3b45 = function(arg0, arg1, arg2) { + arg0.id = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_innerHTML_f1d03f780518a596 = function(arg0, arg1, arg2) { + arg0.innerHTML = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_innerText_b0abb40240106cb9 = function(arg0, arg1, arg2) { + arg0.innerText = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_method_76c69e41b3570627 = function(arg0, arg1, arg2) { + arg0.method = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_mode_611016a6818fc690 = function(arg0, arg1) { + arg0.mode = __wbindgen_enum_RequestMode[arg1]; + }; + imports.wbg.__wbg_set_multiple_5bdba13a27ad28c3 = function(arg0, arg1) { + arg0.multiple = arg1 !== 0; + }; + imports.wbg.__wbg_set_once_cb88c6a887803dfa = function(arg0, arg1) { + arg0.once = arg1 !== 0; + }; + imports.wbg.__wbg_set_onclick_bd577c6578279be4 = function(arg0, arg1) { + arg0.onclick = arg1; + }; + imports.wbg.__wbg_set_onload_3ff2f72af5cc911d = function(arg0, arg1) { + arg0.onload = arg1; + }; + imports.wbg.__wbg_set_signal_e89be862d0091009 = function(arg0, arg1) { + arg0.signal = arg1; + }; + imports.wbg.__wbg_set_tabIndex_10b13c5f00904478 = function(arg0, arg1) { + arg0.tabIndex = arg1; + }; + imports.wbg.__wbg_set_type_466673d0a1ab874b = function(arg0, arg1, arg2) { + arg0.type = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_type_7ce650670a34c68f = function(arg0, arg1, arg2) { + arg0.type = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_value_8f487a4f7d71c024 = function(arg0, arg1, arg2) { + arg0.value = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_width_7ff7a22c6e9f423e = function(arg0, arg1) { + arg0.width = arg1 >>> 0; + }; + imports.wbg.__wbg_shaderSource_8a7a30baeaf655d5 = function(arg0, arg1, arg2, arg3) { + arg0.shaderSource(arg1, getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbg_shaderSource_aea71cfa376fc985 = function(arg0, arg1, arg2, arg3) { + arg0.shaderSource(arg1, getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbg_shiftKey_a6df227a917d203b = function(arg0) { + const ret = arg0.shiftKey; + return ret; + }; + imports.wbg.__wbg_shiftKey_d2640abcfa98acec = function(arg0) { + const ret = arg0.shiftKey; + return ret; + }; + imports.wbg.__wbg_signal_3c14fbdc89694b39 = function(arg0) { + const ret = arg0.signal; + return ret; + }; + imports.wbg.__wbg_stack_7ab0e52d303d5f54 = function(arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_stack_a52ce04892c62bc3 = function(arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() { + const ret = typeof global === 'undefined' ? null : global; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() { + const ret = typeof globalThis === 'undefined' ? null : globalThis; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() { + const ret = typeof self === 'undefined' ? null : self; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() { + const ret = typeof window === 'undefined' ? null : window; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_status_9bfc680efca4bdfd = function(arg0) { + const ret = arg0.status; + return ret; + }; + imports.wbg.__wbg_stopPropagation_611935c25ee35a3c = function(arg0) { + arg0.stopPropagation(); + }; + imports.wbg.__wbg_stringify_655a6390e1f5eb6b = function() { return handleError(function (arg0) { + const ret = JSON.stringify(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_style_521a717da50e53c6 = function(arg0) { + const ret = arg0.style; + return ret; + }; + imports.wbg.__wbg_texImage2D_9626e500f8562784 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texImage2D_d2480404caf2a35b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texParameteri_035e104616b395e0 = function(arg0, arg1, arg2, arg3) { + arg0.texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); + }; + imports.wbg.__wbg_texParameteri_3a52bfd2ef280632 = function(arg0, arg1, arg2, arg3) { + arg0.texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); + }; + imports.wbg.__wbg_texSubImage2D_1f2ed8e2272ea41a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texSubImage2D_b3a850c16797a6b2 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_text_51046bb33d257f63 = function() { return handleError(function (arg0) { + const ret = arg0.text(); + return ret; + }, arguments) }; + imports.wbg.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) { + const ret = arg0.then(arg1, arg2); + return ret; + }; + imports.wbg.__wbg_then_4f95312d68691235 = function(arg0, arg1) { + const ret = arg0.then(arg1); + return ret; + }; + imports.wbg.__wbg_top_7d5b82a2c5d7f13f = function(arg0) { + const ret = arg0.top; + return ret; + }; + imports.wbg.__wbg_touches_1cf6f6e3e2a7e85d = function(arg0) { + const ret = arg0.touches; + return ret; + }; + imports.wbg.__wbg_type_498349ffaacc608d = function(arg0, arg1) { + const ret = arg1.type; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_type_cb833fc71b5282fb = function(arg0, arg1) { + const ret = arg1.type; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_uniform1i_85131b7388bc8e3f = function(arg0, arg1, arg2) { + arg0.uniform1i(arg1, arg2); + }; + imports.wbg.__wbg_uniform1i_e48736e68cd30ed1 = function(arg0, arg1, arg2) { + arg0.uniform1i(arg1, arg2); + }; + imports.wbg.__wbg_uniform2f_191d769606542c31 = function(arg0, arg1, arg2, arg3) { + arg0.uniform2f(arg1, arg2, arg3); + }; + imports.wbg.__wbg_uniform2f_d0f7977f54aed068 = function(arg0, arg1, arg2, arg3) { + arg0.uniform2f(arg1, arg2, arg3); + }; + imports.wbg.__wbg_url_b6d11838a4f95198 = function(arg0, arg1) { + const ret = arg1.url; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_useProgram_142dd02d095f80f1 = function(arg0, arg1) { + arg0.useProgram(arg1); + }; + imports.wbg.__wbg_useProgram_4632a62f19deea67 = function(arg0, arg1) { + arg0.useProgram(arg1); + }; + imports.wbg.__wbg_userActivation_5b18f08f775343b8 = function(arg0) { + const ret = arg0.userActivation; + return ret; + }; + imports.wbg.__wbg_userAgent_e18bc0cc9ad38ec1 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.userAgent; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_value_2c75ca481407d038 = function(arg0, arg1) { + const ret = arg1.value; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) { + const ret = arg0.value; + return ret; + }; + imports.wbg.__wbg_vertexAttribPointer_5c516f4c675103bf = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + arg0.vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + imports.wbg.__wbg_vertexAttribPointer_880223685613a791 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + arg0.vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + imports.wbg.__wbg_view_788aaf149deefd2f = function(arg0) { + const ret = arg0.view; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_viewport_1b0f7b63c424b52f = function(arg0, arg1, arg2, arg3, arg4) { + arg0.viewport(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_viewport_ceaa5c1a061b76df = function(arg0, arg1, arg2, arg3, arg4) { + arg0.viewport(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_width_30d712cfe70e4fae = function(arg0) { + const ret = arg0.width; + return ret; + }; + imports.wbg.__wbg_width_dd0cfe94d42f5143 = function(arg0) { + const ret = arg0.width; + return ret; + }; + imports.wbg.__wbg_writeText_c9776abb6826901c = function(arg0, arg1, arg2) { + const ret = arg0.writeText(getStringFromWasm0(arg1, arg2)); + return ret; + }; + imports.wbg.__wbg_write_b6b51422643b0ba7 = function(arg0, arg1) { + const ret = arg0.write(arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) { + // Cast intrinsic for `Ref(String) -> Externref`. + const ret = getStringFromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_23bcaa43665d663e = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [], shim_idx: 356, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__hbe65ce5d0d117e04); + return ret; + }; + imports.wbg.__wbindgen_cast_595a31e0e283e6e5 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [], shim_idx: 91, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__h3019cdfbf8217f17); + return ret; + }; + imports.wbg.__wbindgen_cast_c457c5a709184ae8 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [NamedExternref("Event")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981); + return ret; + }; + imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) { + // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`. + const ret = getArrayU8FromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) { + // Cast intrinsic for `F64 -> Externref`. + const ret = arg0; + return ret; + }; + imports.wbg.__wbindgen_cast_ec3b197b7ee78e65 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [NamedExternref("Array")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981); + return ret; + }; + imports.wbg.__wbindgen_cast_f4b9452ec3f63fa1 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [Externref], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981); + return ret; + }; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_externrefs; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + }; + + return imports; +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedDataViewMemory0 = null; + cachedUint8ArrayMemory0 = null; + + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + const instance = new WebAssembly.Instance(module, imports); + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('surfer_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync }; +export default __wbg_init; diff --git a/media/surfer/surfer/index.html b/media/surfer/surfer/index.html new file mode 100644 index 0000000..7839afa --- /dev/null +++ b/media/surfer/surfer/index.html @@ -0,0 +1,200 @@ + + + + + + + + + + Surfer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/surfer/surfer/integration.js b/media/surfer/surfer/integration.js new file mode 100644 index 0000000..fdeb1d1 --- /dev/null +++ b/media/surfer/surfer/integration.js @@ -0,0 +1,52 @@ +// Web apps which integrate Surfer as an iframe can give commands to surfer via +// the .postMessage [1] function on the iframe. +// +// For example, to tell Surfer to load waveforms from a URL, use +// `.postMessage({command: "LoadUrl", url: "https://app.surfer-project.org/picorv32.vcd"})` +// +// For more complex functionality, one can also inject any `Message` defined +// in `surfer::Message` in surfer/main.rs. However, the API of these messages +// is not stable and may change at any time. If you add functionality via +// these, make sure to test the new functionality when changing Surfer version. +// +// [1] https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage + +function register_message_listener() { + window.addEventListener("message", (event) => { + // JSON decode the message + const decoded = event.data + + switch (decoded.command) { + // Load a waveform from a URL. The format is inferred from the data. + // Example: `{command: "LoadUrl", url: "https://app.surfer-project.org/picorv32.vcd"}` + + case 'LoadUrl': { + const msg = { + LoadWaveformFileFromUrl: [ + decoded.url, + "Clear" + ] + } + inject_message(JSON.stringify(msg)) + break; + } + + case 'ToggleMenu': { + const msg = "ToggleMenu" + inject_message(JSON.stringify(msg)) + break; + } + + // Inject any other message supported by Surfer in the surfer::Message enum. + // NOTE: The API of these is unstable. + case 'InjectMessage': { + inject_message(decoded.message); + break + } + + default: + console.log(`Unknown message.command ${decoded.command}`) + break; + } + }); +} diff --git a/media/surfer/surfer/manifest.json b/media/surfer/surfer/manifest.json new file mode 100644 index 0000000..bdd75a4 --- /dev/null +++ b/media/surfer/surfer/manifest.json @@ -0,0 +1,10 @@ +{ + "background_color": "white", + "display": "standalone", + "id": "/index.html", + "lang": "en-US", + "name": "Surfer", + "short_name": "surfer", + "start_url": "./index.html", + "theme_color": "white" +} diff --git a/media/surfer/surfer/surfer.js b/media/surfer/surfer/surfer.js new file mode 100644 index 0000000..2427ce2 --- /dev/null +++ b/media/surfer/surfer/surfer.js @@ -0,0 +1,2227 @@ +let wasm; + +function addToExternrefTable0(obj) { + const idx = wasm.__externref_table_alloc(); + wasm.__wbindgen_externrefs.set(idx, obj); + return idx; +} + +const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(state => state.dtor(state.a, state.b)); + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches && builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +function getArrayU8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); +} + +let cachedDataViewMemory0 = null; +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return decodeText(ptr, len); +} + +let cachedUint8ArrayMemory0 = null; +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + const idx = addToExternrefTable0(e); + wasm.__wbindgen_exn_store(idx); + } +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +function makeMutClosure(arg0, arg1, dtor, f) { + const state = { a: arg0, b: arg1, cnt: 1, dtor }; + const real = (...args) => { + + // First up with a closure we increment the internal reference + // count. This ensures that the Rust closure environment won't + // be deallocated while we're invoking it. + state.cnt++; + const a = state.a; + state.a = 0; + try { + return f(a, state.b, ...args); + } finally { + state.a = a; + real._wbg_cb_unref(); + } + }; + real._wbg_cb_unref = () => { + if (--state.cnt === 0) { + state.dtor(state.a, state.b); + state.a = 0; + CLOSURE_DTORS.unregister(state); + } + }; + CLOSURE_DTORS.register(real, state, state); + return real; +} + +function passStringToWasm0(arg, malloc, realloc) { + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = cachedTextEncoder.encodeInto(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +function takeFromExternrefTable0(idx) { + const value = wasm.__wbindgen_externrefs.get(idx); + wasm.__externref_table_dealloc(idx); + return value; +} + +let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); +cachedTextDecoder.decode(); +const MAX_SAFARI_DECODE_BYTES = 2146435072; +let numBytesDecoded = 0; +function decodeText(ptr, len) { + numBytesDecoded += len; + if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) { + cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + cachedTextDecoder.decode(); + numBytesDecoded = len; + } + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +const cachedTextEncoder = new TextEncoder(); + +if (!('encodeInto' in cachedTextEncoder)) { + cachedTextEncoder.encodeInto = function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; + } +} + +let WASM_VECTOR_LEN = 0; + +function wasm_bindgen__convert__closures_____invoke__h3019cdfbf8217f17(arg0, arg1) { + const ret = wasm.wasm_bindgen__convert__closures_____invoke__h3019cdfbf8217f17(arg0, arg1); + if (ret[1]) { + throw takeFromExternrefTable0(ret[0]); + } +} + +function wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981(arg0, arg1, arg2) { + wasm.wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981(arg0, arg1, arg2); +} + +function wasm_bindgen__convert__closures_____invoke__hbe65ce5d0d117e04(arg0, arg1) { + wasm.wasm_bindgen__convert__closures_____invoke__hbe65ce5d0d117e04(arg0, arg1); +} + +function wasm_bindgen__convert__closures_____invoke__h01d319199f3517b1(arg0, arg1, arg2, arg3) { + wasm.wasm_bindgen__convert__closures_____invoke__h01d319199f3517b1(arg0, arg1, arg2, arg3); +} + +const __wbindgen_enum_ReadableStreamType = ["bytes"]; + +const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"]; + +const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"]; + +const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"]; + +const __wbindgen_enum_ResizeObserverBoxOptions = ["border-box", "content-box", "device-pixel-content-box"]; + +const DisplayedItemRefFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_displayeditemref_free(ptr >>> 0, 1)); + +const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1)); + +const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1)); + +const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1)); + +const WebHandleFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_webhandle_free(ptr >>> 0, 1)); + +/** + * Key for the [`crate::wave_data::WaveData::displayed_items`] hash map + */ +export class DisplayedItemRef { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + DisplayedItemRefFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_displayeditemref_free(ptr, 0); + } + /** + * @returns {number} + */ + get 0() { + const ret = wasm.__wbg_get_displayeditemref_0(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} arg0 + */ + set 0(arg0) { + wasm.__wbg_set_displayeditemref_0(this.__wbg_ptr, arg0); + } +} +if (Symbol.dispose) DisplayedItemRef.prototype[Symbol.dispose] = DisplayedItemRef.prototype.free; + +export class IntoUnderlyingByteSource { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingByteSourceFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingbytesource_free(ptr, 0); + } + /** + * @returns {number} + */ + get autoAllocateChunkSize() { + const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {ReadableByteStreamController} controller + * @returns {Promise} + */ + pull(controller) { + const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller); + return ret; + } + /** + * @param {ReadableByteStreamController} controller + */ + start(controller) { + wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller); + } + /** + * @returns {ReadableStreamType} + */ + get type() { + const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr); + return __wbindgen_enum_ReadableStreamType[ret]; + } + cancel() { + const ptr = this.__destroy_into_raw(); + wasm.intounderlyingbytesource_cancel(ptr); + } +} +if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free; + +export class IntoUnderlyingSink { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingSinkFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingsink_free(ptr, 0); + } + /** + * @param {any} reason + * @returns {Promise} + */ + abort(reason) { + const ptr = this.__destroy_into_raw(); + const ret = wasm.intounderlyingsink_abort(ptr, reason); + return ret; + } + /** + * @returns {Promise} + */ + close() { + const ptr = this.__destroy_into_raw(); + const ret = wasm.intounderlyingsink_close(ptr); + return ret; + } + /** + * @param {any} chunk + * @returns {Promise} + */ + write(chunk) { + const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk); + return ret; + } +} +if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free; + +export class IntoUnderlyingSource { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingSourceFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingsource_free(ptr, 0); + } + /** + * @param {ReadableStreamDefaultController} controller + * @returns {Promise} + */ + pull(controller) { + const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller); + return ret; + } + cancel() { + const ptr = this.__destroy_into_raw(); + wasm.intounderlyingsource_cancel(ptr); + } +} +if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free; + +/** + * Your handle to the web app from JavaScript. + */ +export class WebHandle { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + WebHandleFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_webhandle_free(ptr, 0); + } + /** + * Installs a panic hook, then returns. + */ + constructor() { + const ret = wasm.webhandle_new(); + this.__wbg_ptr = ret >>> 0; + WebHandleFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * Call this once from JavaScript to start your app. + * @param {HTMLCanvasElement} canvas + * @returns {Promise} + */ + start(canvas) { + const ret = wasm.webhandle_start(this.__wbg_ptr, canvas); + return ret; + } +} +if (Symbol.dispose) WebHandle.prototype[Symbol.dispose] = WebHandle.prototype.free; + +/** + * @returns {Promise} + */ +export function cxxrtl_cs_message() { + const ret = wasm.cxxrtl_cs_message(); + return ret; +} + +/** + * @param {number} id + * @param {string} from_item + * @param {bigint} from_time + * @param {string} to_item + * @param {bigint} to_time + * @param {string} text + * @returns {Promise} + */ +export function draw_text_arrow(id, from_item, from_time, to_item, to_time, text) { + const ptr0 = passStringToWasm0(from_item, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passStringToWasm0(to_item, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len2 = WASM_VECTOR_LEN; + const ret = wasm.draw_text_arrow(id, ptr0, len0, from_time, ptr1, len1, to_time, ptr2, len2); + return ret; +} + +/** + * @param {string} message + * @returns {Promise} + */ +export function handle_wcp_cs_message(message) { + const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.handle_wcp_cs_message(ptr0, len0); + return ret; +} + +/** + * @param {string} name + * @returns {Promise} + */ +export function id_of_name(name) { + const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.id_of_name(ptr0, len0); + return ret; +} + +/** + * @param {string} name + * @returns {Promise} + */ +export function index_of_name(name) { + const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.index_of_name(ptr0, len0); + return ret; +} + +/** + * @param {string} message + */ +export function inject_message(message) { + const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + wasm.inject_message(ptr0, len0); +} + +/** + * @returns {Promise} + */ +export function next_wcp_sc_message() { + const ret = wasm.next_wcp_sc_message(); + return ret; +} + +/** + * @param {string} message + * @returns {Promise} + */ +export function on_cxxrtl_sc_message(message) { + const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.on_cxxrtl_sc_message(ptr0, len0); + return ret; +} + +/** + * @returns {Promise} + */ +export function spade_loaded() { + const ret = wasm.spade_loaded(); + return ret; +} + +/** + * @returns {Promise} + */ +export function start_cxxrtl() { + const ret = wasm.start_cxxrtl(); + return ret; +} + +/** + * @returns {Promise} + */ +export function start_wcp() { + const ret = wasm.start_wcp(); + return ret; +} + +/** + * @returns {Promise} + */ +export function waves_loaded() { + const ret = wasm.waves_loaded(); + return ret; +} + +const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']); + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + } catch (e) { + const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type); + + if (validResponse && module.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", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) { + const ret = Error(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) { + const v = arg0; + const ret = typeof(v) === 'boolean' ? v : undefined; + return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0; + }; + imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) { + const ret = debugString(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) { + const ret = arg0 in arg1; + return ret; + }; + imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) { + const ret = typeof(arg0) === 'function'; + return ret; + }; + imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) { + const val = arg0; + const ret = typeof(val) === 'object' && val !== null; + return ret; + }; + imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) { + const ret = arg0 === undefined; + return ret; + }; + imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'number' ? obj : undefined; + getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); + }; + imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) { + arg0._wbg_cb_unref(); + }; + imports.wbg.__wbg_abort_07646c894ebbf2bd = function(arg0) { + arg0.abort(); + }; + imports.wbg.__wbg_abort_399ecbcfd6ef3c8e = function(arg0, arg1) { + arg0.abort(arg1); + }; + imports.wbg.__wbg_activeElement_6c18eb1d0e808cec = function(arg0) { + const ret = arg0.activeElement; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_activeElement_b3e6b135325e4d5f = function(arg0) { + const ret = arg0.activeElement; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_activeTexture_1db0722f00c3f843 = function(arg0, arg1) { + arg0.activeTexture(arg1 >>> 0); + }; + imports.wbg.__wbg_activeTexture_59810c16ea8d6e34 = function(arg0, arg1) { + arg0.activeTexture(arg1 >>> 0); + }; + imports.wbg.__wbg_addEventListener_6a82629b3d430a48 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3); + }, arguments) }; + imports.wbg.__wbg_addEventListener_82cddc614107eb45 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3, arg4); + }, arguments) }; + imports.wbg.__wbg_altKey_56d1d642f3a28c92 = function(arg0) { + const ret = arg0.altKey; + return ret; + }; + imports.wbg.__wbg_altKey_e13fae92dfebca3e = function(arg0) { + const ret = arg0.altKey; + return ret; + }; + imports.wbg.__wbg_appendChild_7465eba84213c75f = function() { return handleError(function (arg0, arg1) { + const ret = arg0.appendChild(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_append_c5cbdf46455cc776 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_arrayBuffer_3356d392ef2d2aa9 = function(arg0) { + const ret = arg0.arrayBuffer(); + return ret; + }; + imports.wbg.__wbg_arrayBuffer_c04af4fce566092d = function() { return handleError(function (arg0) { + const ret = arg0.arrayBuffer(); + return ret; + }, arguments) }; + imports.wbg.__wbg_at_505937f1c4b80bfa = function(arg0, arg1) { + const ret = arg0.at(arg1); + return ret; + }; + imports.wbg.__wbg_attachShader_bc2b53790fd12d3a = function(arg0, arg1, arg2) { + arg0.attachShader(arg1, arg2); + }; + imports.wbg.__wbg_attachShader_ce575704294db9cc = function(arg0, arg1, arg2) { + arg0.attachShader(arg1, arg2); + }; + imports.wbg.__wbg_bindBuffer_110b128c65a97376 = function(arg0, arg1, arg2) { + arg0.bindBuffer(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindBuffer_c24c31cbec41cb21 = function(arg0, arg1, arg2) { + arg0.bindBuffer(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindTexture_4537240b278f1d53 = function(arg0, arg1, arg2) { + arg0.bindTexture(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindTexture_6ed714c0afe8b8d1 = function(arg0, arg1, arg2) { + arg0.bindTexture(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_bindVertexArrayOES_fdb7e747e386f55a = function(arg0, arg1) { + arg0.bindVertexArrayOES(arg1); + }; + imports.wbg.__wbg_bindVertexArray_ced27387a0718508 = function(arg0, arg1) { + arg0.bindVertexArray(arg1); + }; + imports.wbg.__wbg_blendEquationSeparate_403e2a62d6e0d67f = function(arg0, arg1, arg2) { + arg0.blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); + }; + imports.wbg.__wbg_blendEquationSeparate_e1eb0d0f32ef91af = function(arg0, arg1, arg2) { + arg0.blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); + }; + imports.wbg.__wbg_blendFuncSeparate_4cca29476893cc61 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); + }; + imports.wbg.__wbg_blendFuncSeparate_e5a1bacf4a0700cd = function(arg0, arg1, arg2, arg3, arg4) { + arg0.blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); + }; + imports.wbg.__wbg_blockSize_6456aaf09f0ab287 = function(arg0) { + const ret = arg0.blockSize; + return ret; + }; + imports.wbg.__wbg_blur_ca11f751d4c09d3f = function() { return handleError(function (arg0) { + arg0.blur(); + }, arguments) }; + imports.wbg.__wbg_body_544738f8b03aef13 = function(arg0) { + const ret = arg0.body; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_bottom_7d2cabadf8c452a8 = function(arg0) { + const ret = arg0.bottom; + return ret; + }; + imports.wbg.__wbg_bufferData_69dbeea8e1d79f7b = function(arg0, arg1, arg2, arg3) { + arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0); + }; + imports.wbg.__wbg_bufferData_ac5c7900b06f1517 = function(arg0, arg1, arg2, arg3) { + arg0.bufferData(arg1 >>> 0, arg2, arg3 >>> 0); + }; + imports.wbg.__wbg_buffer_6cb2fecb1f253d71 = function(arg0) { + const ret = arg0.buffer; + return ret; + }; + imports.wbg.__wbg_button_a54acd25bab5d442 = function(arg0) { + const ret = arg0.button; + return ret; + }; + imports.wbg.__wbg_byobRequest_f8e3517f5f8ad284 = function(arg0) { + const ret = arg0.byobRequest; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_byteLength_faa9938885bdeee6 = function(arg0) { + const ret = arg0.byteLength; + return ret; + }; + imports.wbg.__wbg_byteOffset_3868b6a19ba01dea = function(arg0) { + const ret = arg0.byteOffset; + return ret; + }; + imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.call(arg1, arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.call(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_cancelAnimationFrame_1c2a3faf7be5aedd = function() { return handleError(function (arg0, arg1) { + arg0.cancelAnimationFrame(arg1); + }, arguments) }; + imports.wbg.__wbg_changedTouches_002fee0da4489efe = function(arg0) { + const ret = arg0.changedTouches; + return ret; + }; + imports.wbg.__wbg_clearColor_66e5dad6393f32ec = function(arg0, arg1, arg2, arg3, arg4) { + arg0.clearColor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_clearColor_fe8de7e582b77e40 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.clearColor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_clearInterval_45ac4607741420fd = function(arg0, arg1) { + arg0.clearInterval(arg1); + }; + imports.wbg.__wbg_clearTimeout_7a42b49784aea641 = function(arg0) { + const ret = clearTimeout(arg0); + return ret; + }; + imports.wbg.__wbg_clear_00ac71df5db8ab17 = function(arg0, arg1) { + arg0.clear(arg1 >>> 0); + }; + imports.wbg.__wbg_clear_52caf9271911674b = function(arg0, arg1) { + arg0.clear(arg1 >>> 0); + }; + imports.wbg.__wbg_click_3a8e35c38329dd3a = function(arg0) { + arg0.click(); + }; + imports.wbg.__wbg_clientX_2ea1e898842f21ed = function(arg0) { + const ret = arg0.clientX; + return ret; + }; + imports.wbg.__wbg_clientX_c17906c33ea43025 = function(arg0) { + const ret = arg0.clientX; + return ret; + }; + imports.wbg.__wbg_clientY_70eb66d231a332a3 = function(arg0) { + const ret = arg0.clientY; + return ret; + }; + imports.wbg.__wbg_clientY_d12086a5a6a3a9d5 = function(arg0) { + const ret = arg0.clientY; + return ret; + }; + imports.wbg.__wbg_clipboardData_11e9a33a8f4d9552 = function(arg0) { + const ret = arg0.clipboardData; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_clipboard_c210ce30f20907dd = function(arg0) { + const ret = arg0.clipboard; + return ret; + }; + imports.wbg.__wbg_close_0af5661bf3d335f2 = function() { return handleError(function (arg0) { + arg0.close(); + }, arguments) }; + imports.wbg.__wbg_close_3ec111e7b23d94d8 = function() { return handleError(function (arg0) { + arg0.close(); + }, arguments) }; + imports.wbg.__wbg_colorMask_27d9f83dd2189ed6 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); + }; + imports.wbg.__wbg_colorMask_f000b510fac0bd7c = function(arg0, arg1, arg2, arg3, arg4) { + arg0.colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); + }; + imports.wbg.__wbg_compileShader_ac0bf6f0837881c3 = function(arg0, arg1) { + arg0.compileShader(arg1); + }; + imports.wbg.__wbg_compileShader_ba337110bed419e1 = function(arg0, arg1) { + arg0.compileShader(arg1); + }; + imports.wbg.__wbg_contentBoxSize_252a34474a67b3bb = function(arg0) { + const ret = arg0.contentBoxSize; + return ret; + }; + imports.wbg.__wbg_contentRect_1806147dfdc380d8 = function(arg0) { + const ret = arg0.contentRect; + return ret; + }; + imports.wbg.__wbg_createBuffer_465b645a46535184 = function(arg0) { + const ret = arg0.createBuffer(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createBuffer_8601b8ec330ab49d = function(arg0) { + const ret = arg0.createBuffer(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createElement_da4ed2b219560fc6 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.createElement(getStringFromWasm0(arg1, arg2)); + return ret; + }, arguments) }; + imports.wbg.__wbg_createObjectURL_7d9f7f8f41373850 = function() { return handleError(function (arg0, arg1) { + const ret = URL.createObjectURL(arg1); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_createProgram_023ba0fc6ff6efd6 = function(arg0) { + const ret = arg0.createProgram(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createProgram_ffe9d4a2cba210f4 = function(arg0) { + const ret = arg0.createProgram(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createShader_4626088b63c33727 = function(arg0, arg1) { + const ret = arg0.createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createShader_f88f9b82748ef6c0 = function(arg0, arg1) { + const ret = arg0.createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createTexture_41211a4e8ae0afec = function(arg0) { + const ret = arg0.createTexture(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createTexture_4d5934eb9772b5fe = function(arg0) { + const ret = arg0.createTexture(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createVertexArrayOES_7bcc20082143e8f2 = function(arg0) { + const ret = arg0.createVertexArrayOES(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_createVertexArray_997b3c5b1091afd9 = function(arg0) { + const ret = arg0.createVertexArray(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_ctrlKey_487597b9069da036 = function(arg0) { + const ret = arg0.ctrlKey; + return ret; + }; + imports.wbg.__wbg_ctrlKey_b391e5105c3f6e76 = function(arg0) { + const ret = arg0.ctrlKey; + return ret; + }; + imports.wbg.__wbg_dataTransfer_3653d4b679b026b2 = function(arg0) { + const ret = arg0.dataTransfer; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_data_ba1e638a3b5a1da7 = function(arg0, arg1) { + const ret = arg1.data; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_deleteBuffer_5ed1698208181e1f = function(arg0, arg1) { + arg0.deleteBuffer(arg1); + }; + imports.wbg.__wbg_deleteBuffer_ba7f1164cc23b2ca = function(arg0, arg1) { + arg0.deleteBuffer(arg1); + }; + imports.wbg.__wbg_deleteProgram_3bf297a31d0e6e48 = function(arg0, arg1) { + arg0.deleteProgram(arg1); + }; + imports.wbg.__wbg_deleteProgram_62774baacb13ff2b = function(arg0, arg1) { + arg0.deleteProgram(arg1); + }; + imports.wbg.__wbg_deleteShader_c357bb8fbede8370 = function(arg0, arg1) { + arg0.deleteShader(arg1); + }; + imports.wbg.__wbg_deleteShader_c686dd351de5a068 = function(arg0, arg1) { + arg0.deleteShader(arg1); + }; + imports.wbg.__wbg_deleteTexture_2a9b703dc2df5657 = function(arg0, arg1) { + arg0.deleteTexture(arg1); + }; + imports.wbg.__wbg_deleteTexture_875f8d84e74610a0 = function(arg0, arg1) { + arg0.deleteTexture(arg1); + }; + imports.wbg.__wbg_deltaMode_d74ec093e23ffeec = function(arg0) { + const ret = arg0.deltaMode; + return ret; + }; + imports.wbg.__wbg_deltaX_41f7678c94b10355 = function(arg0) { + const ret = arg0.deltaX; + return ret; + }; + imports.wbg.__wbg_deltaY_3f10fd796fae2a0f = function(arg0) { + const ret = arg0.deltaY; + return ret; + }; + imports.wbg.__wbg_detachShader_678bb6c64268535d = function(arg0, arg1, arg2) { + arg0.detachShader(arg1, arg2); + }; + imports.wbg.__wbg_detachShader_6dca9ecdeb9bbcd3 = function(arg0, arg1, arg2) { + arg0.detachShader(arg1, arg2); + }; + imports.wbg.__wbg_devicePixelContentBoxSize_4312b643ce19dcae = function(arg0) { + const ret = arg0.devicePixelContentBoxSize; + return ret; + }; + imports.wbg.__wbg_devicePixelRatio_390dee26c70aa30f = function(arg0) { + const ret = arg0.devicePixelRatio; + return ret; + }; + imports.wbg.__wbg_disableVertexAttribArray_4c5c7214724209d0 = function(arg0, arg1) { + arg0.disableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_disableVertexAttribArray_bcf2272b428ec9fc = function(arg0, arg1) { + arg0.disableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_disable_3af3e194392b0a83 = function(arg0, arg1) { + arg0.disable(arg1 >>> 0); + }; + imports.wbg.__wbg_disable_c05809e00765548d = function(arg0, arg1) { + arg0.disable(arg1 >>> 0); + }; + imports.wbg.__wbg_disconnect_0078fed2ab427a04 = function(arg0) { + arg0.disconnect(); + }; + imports.wbg.__wbg_document_5b745e82ba551ca5 = function(arg0) { + const ret = arg0.document; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) { + const ret = arg0.done; + return ret; + }; + imports.wbg.__wbg_drawElements_2a3619292860fa19 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); + }; + imports.wbg.__wbg_drawElements_738773baf3df000e = function(arg0, arg1, arg2, arg3, arg4) { + arg0.drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); + }; + imports.wbg.__wbg_elementFromPoint_3e36e942ea9d1a54 = function(arg0, arg1, arg2) { + const ret = arg0.elementFromPoint(arg1, arg2); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_elementFromPoint_8a2969ab5273b90a = function(arg0, arg1, arg2) { + const ret = arg0.elementFromPoint(arg1, arg2); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_enableVertexAttribArray_2898de871f949393 = function(arg0, arg1) { + arg0.enableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_enableVertexAttribArray_def9952d8426be95 = function(arg0, arg1) { + arg0.enableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_enable_2d8bb952637ad17a = function(arg0, arg1) { + arg0.enable(arg1 >>> 0); + }; + imports.wbg.__wbg_enable_52598759008d46ee = function(arg0, arg1) { + arg0.enable(arg1 >>> 0); + }; + imports.wbg.__wbg_enqueue_a7e6b1ee87963aad = function() { return handleError(function (arg0, arg1) { + arg0.enqueue(arg1); + }, arguments) }; + imports.wbg.__wbg_error_8175373a88db6004 = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_fetch_74a3e84ebd2c9a0e = function(arg0) { + const ret = fetch(arg0); + return ret; + }; + imports.wbg.__wbg_fetch_90447c28cc0b095e = function(arg0, arg1) { + const ret = arg0.fetch(arg1); + return ret; + }; + imports.wbg.__wbg_files_aa1f009258eadae6 = function(arg0) { + const ret = arg0.files; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_files_d5264787ebe0eb8e = function(arg0) { + const ret = arg0.files; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_focus_220a53e22147dc0f = function() { return handleError(function (arg0) { + arg0.focus(); + }, arguments) }; + imports.wbg.__wbg_force_ec61071358a7ae6f = function(arg0) { + const ret = arg0.force; + return ret; + }; + imports.wbg.__wbg_generateMipmap_85452cd8f350f404 = function(arg0, arg1) { + arg0.generateMipmap(arg1 >>> 0); + }; + imports.wbg.__wbg_generateMipmap_bfd04ca851518e7c = function(arg0, arg1) { + arg0.generateMipmap(arg1 >>> 0); + }; + imports.wbg.__wbg_getAttribLocation_5917620b3c9497e6 = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getAttribLocation(arg1, getStringFromWasm0(arg2, arg3)); + return ret; + }; + imports.wbg.__wbg_getAttribLocation_e56db0839c7627ca = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getAttribLocation(arg1, getStringFromWasm0(arg2, arg3)); + return ret; + }; + imports.wbg.__wbg_getBoundingClientRect_25e44a78507968b0 = function(arg0) { + const ret = arg0.getBoundingClientRect(); + return ret; + }; + imports.wbg.__wbg_getComputedStyle_bbcd5e3d08077b71 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getComputedStyle(arg1); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getContext_01f42b234e833f0a = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getContext(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getData_0c18014d58e42433 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = arg1.getData(getStringFromWasm0(arg2, arg3)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getElementById_e05488d2143c2b21 = function(arg0, arg1, arg2) { + const ret = arg0.getElementById(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getError_1512d8f11d3dce17 = function(arg0) { + const ret = arg0.getError(); + return ret; + }; + imports.wbg.__wbg_getError_86b51f8a9c7debb3 = function(arg0) { + const ret = arg0.getError(); + return ret; + }; + imports.wbg.__wbg_getExtension_2078be640f482416 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getExtension(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getExtension_49a13df0dc150fab = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.getExtension(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_getItem_1340bfc9a10d5991 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = arg1.getItem(getStringFromWasm0(arg2, arg3)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getParameter_08df3cb47d357cca = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getParameter(arg1 >>> 0); + return ret; + }, arguments) }; + imports.wbg.__wbg_getParameter_1dfd667c33169fab = function() { return handleError(function (arg0, arg1) { + const ret = arg0.getParameter(arg1 >>> 0); + return ret; + }, arguments) }; + imports.wbg.__wbg_getProgramInfoLog_a0ff8b0971fcaf48 = function(arg0, arg1, arg2) { + const ret = arg1.getProgramInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getProgramInfoLog_ea3064b153e4542a = function(arg0, arg1, arg2) { + const ret = arg1.getProgramInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getProgramParameter_c777611a448a6ccd = function(arg0, arg1, arg2) { + const ret = arg0.getProgramParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getProgramParameter_ff1aee3815d6a8f9 = function(arg0, arg1, arg2) { + const ret = arg0.getProgramParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getPropertyValue_dcded91357966805 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = arg1.getPropertyValue(getStringFromWasm0(arg2, arg3)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_getRootNode_c2316085ca42cd67 = function(arg0) { + const ret = arg0.getRootNode(); + return ret; + }; + imports.wbg.__wbg_getShaderInfoLog_1affea8c74bd191c = function(arg0, arg1, arg2) { + const ret = arg1.getShaderInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getShaderInfoLog_862d8c35c68d02c8 = function(arg0, arg1, arg2) { + const ret = arg1.getShaderInfoLog(arg2); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_getShaderParameter_1f86483b99db3dcc = function(arg0, arg1, arg2) { + const ret = arg0.getShaderParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getShaderParameter_b8a41abb0d7d23c3 = function(arg0, arg1, arg2) { + const ret = arg0.getShaderParameter(arg1, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_getSupportedExtensions_bc23bc19c9dac45d = function(arg0) { + const ret = arg0.getSupportedExtensions(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getSupportedExtensions_e1652e64b15aff85 = function(arg0) { + const ret = arg0.getSupportedExtensions(); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getUniformLocation_21ac12bfc569cbbf = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getUniformLocation(arg1, getStringFromWasm0(arg2, arg3)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_getUniformLocation_2a4ddf8dd8285373 = function(arg0, arg1, arg2, arg3) { + const ret = arg0.getUniformLocation(arg1, getStringFromWasm0(arg2, arg3)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_331085331950b4f1 = function(arg0, arg1, arg2, arg3) { + const ret = arg1.get(getStringFromWasm0(arg2, arg3)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return ret; + }; + imports.wbg.__wbg_get_84957f57555c0874 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_89bca58298277b24 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(arg0, arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_get_e8e8a591c89f67f6 = function(arg0, arg1) { + const ret = arg0[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_has_0e670569d65d3a45 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.has(arg0, arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_hash_979a7861415bf1f8 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.hash; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_headers_654c30e1bcccc552 = function(arg0) { + const ret = arg0.headers; + return ret; + }; + imports.wbg.__wbg_height_5d22b94a936fae9f = function(arg0) { + const ret = arg0.height; + return ret; + }; + imports.wbg.__wbg_height_a07787f693c253d2 = function(arg0) { + const ret = arg0.height; + return ret; + }; + imports.wbg.__wbg_hidden_63c9db3ea5c1e10a = function(arg0) { + const ret = arg0.hidden; + return ret; + }; + imports.wbg.__wbg_host_d33d7c53a6d98060 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.host; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_hostname_4d06d0f997fded29 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.hostname; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_href_0a387dfdb6abe7e5 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.href; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_identifier_4045753259aef15d = function(arg0) { + const ret = arg0.identifier; + return ret; + }; + imports.wbg.__wbg_inlineSize_65c8cd0ecc54c605 = function(arg0) { + const ret = arg0.inlineSize; + return ret; + }; + imports.wbg.__wbg_instanceof_Document_90b941f0297459fe = function(arg0) { + let result; + try { + result = arg0 instanceof Document; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Element_6f7ba982258cfc0f = function(arg0) { + let result; + try { + result = arg0 instanceof Element; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlAnchorElement_2ac07b5cf25eac0c = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLAnchorElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlButtonElement_a1508e6aded117e1 = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLButtonElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlCanvasElement_c4251b1b6a15edcc = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLCanvasElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlElement_20a3acb594113d73 = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_HtmlInputElement_46b31917ce88698f = function(arg0) { + let result; + try { + result = arg0 instanceof HTMLInputElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ResizeObserverEntry_598d7b7088f31bb9 = function(arg0) { + let result; + try { + result = arg0 instanceof ResizeObserverEntry; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ResizeObserverSize_1631a4523f7b848b = function(arg0) { + let result; + try { + result = arg0 instanceof ResizeObserverSize; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Response_cd74d1c2ac92cb0b = function(arg0) { + let result; + try { + result = arg0 instanceof Response; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_ShadowRoot_acbbcc2231ef8a7b = function(arg0) { + let result; + try { + result = arg0 instanceof ShadowRoot; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_WebGl2RenderingContext_121e4c8c95b128ef = function(arg0) { + let result; + try { + result = arg0 instanceof WebGL2RenderingContext; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_WebGlRenderingContext_f2a36a2d31de185f = function(arg0) { + let result; + try { + result = arg0 instanceof WebGLRenderingContext; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Window_b5cf7783caa68180 = function(arg0) { + let result; + try { + result = arg0 instanceof Window; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_isActive_c1070510cdbd906b = function(arg0) { + const ret = arg0.isActive; + return ret; + }; + imports.wbg.__wbg_isComposing_f44397d3c48338be = function(arg0) { + const ret = arg0.isComposing; + return ret; + }; + imports.wbg.__wbg_isComposing_fcde9aa6cddb1f42 = function(arg0) { + const ret = arg0.isComposing; + return ret; + }; + imports.wbg.__wbg_isSecureContext_0defe0b227a0ff2a = function(arg0) { + const ret = arg0.isSecureContext; + return ret; + }; + imports.wbg.__wbg_is_928aa29d71e75457 = function(arg0, arg1) { + const ret = Object.is(arg0, arg1); + return ret; + }; + imports.wbg.__wbg_item_2c9f4df896e24628 = function(arg0, arg1) { + const ret = arg0.item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_items_7724bf0013e68df2 = function(arg0) { + const ret = arg0.items; + return ret; + }; + imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() { + const ret = Symbol.iterator; + return ret; + }; + imports.wbg.__wbg_keyCode_9a2cb918794208e5 = function(arg0) { + const ret = arg0.keyCode; + return ret; + }; + imports.wbg.__wbg_key_505d33c50799526a = function(arg0, arg1) { + const ret = arg1.key; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_lastModified_0b523634ff1e63fc = function(arg0) { + const ret = arg0.lastModified; + return ret; + }; + imports.wbg.__wbg_left_d52bfa3824286825 = function(arg0) { + const ret = arg0.left; + return ret; + }; + imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_5548a3a9b927d0af = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_7226f74c66ca4a9d = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_b3a710c4ed3e081c = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) { + const ret = arg0.length; + return ret; + }; + imports.wbg.__wbg_linkProgram_2f770464e69099dc = function(arg0, arg1) { + arg0.linkProgram(arg1); + }; + imports.wbg.__wbg_linkProgram_93f76a2f5030041e = function(arg0, arg1) { + arg0.linkProgram(arg1); + }; + imports.wbg.__wbg_localStorage_e7a9e9fee8fc608d = function() { return handleError(function (arg0) { + const ret = arg0.localStorage; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_location_962e75c1c1b3ebed = function(arg0) { + const ret = arg0.location; + return ret; + }; + imports.wbg.__wbg_log_0cc1b7768397bcfe = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.log(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.log(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_mark_7438147ce31e9d4b = function(arg0, arg1) { + performance.mark(getStringFromWasm0(arg0, arg1)); + }; + imports.wbg.__wbg_matchMedia_29904c79dbaba90b = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.matchMedia(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_matches_9cef9b7c722bd7c8 = function(arg0) { + const ret = arg0.matches; + return ret; + }; + imports.wbg.__wbg_measure_fb7825c11612c823 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + let deferred0_0; + let deferred0_1; + let deferred1_0; + let deferred1_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + deferred1_0 = arg2; + deferred1_1 = arg3; + performance.measure(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); + } + }, arguments) }; + imports.wbg.__wbg_metaKey_0572b1cbcb5b272b = function(arg0) { + const ret = arg0.metaKey; + return ret; + }; + imports.wbg.__wbg_metaKey_448c751accad2eba = function(arg0) { + const ret = arg0.metaKey; + return ret; + }; + imports.wbg.__wbg_name_13bb9dc8b6e6e67c = function(arg0, arg1) { + const ret = arg1.name; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_navigator_b49edef831236138 = function(arg0) { + const ret = arg0.navigator; + return ret; + }; + imports.wbg.__wbg_new_111dde64cffa8ba1 = function() { return handleError(function () { + const ret = new FileReader(); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_1ba21ce319a06297 = function() { + const ret = new Object(); + return ret; + }; + imports.wbg.__wbg_new_25f239778d6112b9 = function() { + const ret = new Array(); + return ret; + }; + imports.wbg.__wbg_new_3a326de758934c0f = function() { + const ret = new Error(); + return ret; + }; + imports.wbg.__wbg_new_3c79b3bb1b32b7d3 = function() { return handleError(function () { + const ret = new Headers(); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) { + const ret = new Uint8Array(arg0); + return ret; + }; + imports.wbg.__wbg_new_71138ce70c488616 = function() { + const ret = new Error(); + return ret; + }; + imports.wbg.__wbg_new_881a222c65f168fc = function() { return handleError(function () { + const ret = new AbortController(); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_a25bd305a87faf63 = function() { return handleError(function (arg0) { + const ret = new ResizeObserver(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_df1173567d5ff028 = function(arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) { + try { + var state0 = {a: arg0, b: arg1}; + var cb0 = (arg0, arg1) => { + const a = state0.a; + state0.a = 0; + try { + return wasm_bindgen__convert__closures_____invoke__h01d319199f3517b1(a, state0.b, arg0, arg1); + } finally { + state0.a = a; + } + }; + const ret = new Promise(cb0); + return ret; + } finally { + state0.a = state0.b = 0; + } + }; + imports.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) { + const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return ret; + }; + imports.wbg.__wbg_new_with_byte_offset_and_length_d85c3da1fd8df149 = function(arg0, arg1, arg2) { + const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0); + return ret; + }; + imports.wbg.__wbg_new_with_record_from_str_to_blob_promise_44de1087288de77b = function() { return handleError(function (arg0) { + const ret = new ClipboardItem(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_with_str_and_init_c5748f76f5108934 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = new Request(getStringFromWasm0(arg0, arg1), arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_with_str_dea1b77a8c2f6d7d = function() { return handleError(function (arg0, arg1) { + const ret = new URLSearchParams(getStringFromWasm0(arg0, arg1)); + return ret; + }, arguments) }; + imports.wbg.__wbg_new_with_u8_array_sequence_and_options_d4def9ec0588c7ec = function() { return handleError(function (arg0, arg1) { + const ret = new Blob(arg0, arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) { + const ret = arg0.next; + return ret; + }; + imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) { + const ret = arg0.next(); + return ret; + }, arguments) }; + imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) { + const ret = arg0.now(); + return ret; + }; + imports.wbg.__wbg_now_8cf15d6e317793e1 = function(arg0) { + const ret = arg0.now(); + return ret; + }; + imports.wbg.__wbg_observe_ce343c3f1701b1f1 = function(arg0, arg1, arg2) { + arg0.observe(arg1, arg2); + }; + imports.wbg.__wbg_of_6505a0eb509da02e = function(arg0) { + const ret = Array.of(arg0); + return ret; + }; + imports.wbg.__wbg_offsetTop_cea3f2bb4eff1df7 = function(arg0) { + const ret = arg0.offsetTop; + return ret; + }; + imports.wbg.__wbg_on_surfer_error_cdd96daedaef756e = function() { return handleError(function (arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + on_surfer_error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }, arguments) }; + imports.wbg.__wbg_open_c565053c17d497bd = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + const ret = arg0.open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }, arguments) }; + imports.wbg.__wbg_origin_c4ac149104b9ebad = function() { return handleError(function (arg0, arg1) { + const ret = arg1.origin; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_performance_7a3ffd0b17f663ad = function(arg0) { + const ret = arg0.performance; + return ret; + }; + imports.wbg.__wbg_performance_c77a440eff2efd9b = function(arg0) { + const ret = arg0.performance; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_pixelStorei_1956db9ae4b22c29 = function(arg0, arg1, arg2) { + arg0.pixelStorei(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_pixelStorei_5449c87f83f25694 = function(arg0, arg1, arg2) { + arg0.pixelStorei(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_port_3b339e96d336d1a4 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.port; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_preventDefault_e97663aeeb9709d3 = function(arg0) { + arg0.preventDefault(); + }; + imports.wbg.__wbg_protocol_9d5f5cf57103846e = function() { return handleError(function (arg0, arg1) { + const ret = arg1.protocol; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) { + Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2); + }; + imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) { + const ret = arg0.push(arg1); + return ret; + }; + imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) { + const ret = arg0.queueMicrotask; + return ret; + }; + imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) { + queueMicrotask(arg0); + }; + imports.wbg.__wbg_readAsArrayBuffer_0aca937439be3197 = function() { return handleError(function (arg0, arg1) { + arg0.readAsArrayBuffer(arg1); + }, arguments) }; + imports.wbg.__wbg_readPixels_031b1d4c916fc4f9 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + arg0.readPixels(arg1, arg2, arg3, arg4, arg5 >>> 0, arg6 >>> 0, arg7); + }, arguments) }; + imports.wbg.__wbg_readPixels_3288aabda6ab89ff = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + arg0.readPixels(arg1, arg2, arg3, arg4, arg5 >>> 0, arg6 >>> 0, arg7); + }, arguments) }; + imports.wbg.__wbg_removeChild_e269b93f63c5ba71 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.removeChild(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_removeEventListener_565e273024b68b75 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + arg0.removeEventListener(getStringFromWasm0(arg1, arg2), arg3); + }, arguments) }; + imports.wbg.__wbg_remove_32f69ffabcbc4072 = function(arg0) { + arg0.remove(); + }; + imports.wbg.__wbg_requestAnimationFrame_994dc4ebde22b8d9 = function() { return handleError(function (arg0, arg1) { + const ret = arg0.requestAnimationFrame(arg1); + return ret; + }, arguments) }; + imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) { + const ret = Promise.resolve(arg0); + return ret; + }; + imports.wbg.__wbg_respond_9f7fc54636c4a3af = function() { return handleError(function (arg0, arg1) { + arg0.respond(arg1 >>> 0); + }, arguments) }; + imports.wbg.__wbg_result_893437a1eaacc4df = function() { return handleError(function (arg0) { + const ret = arg0.result; + return ret; + }, arguments) }; + imports.wbg.__wbg_right_b7a0dcdcec0301e1 = function(arg0) { + const ret = arg0.right; + return ret; + }; + imports.wbg.__wbg_scissor_04e903bd18e45083 = function(arg0, arg1, arg2, arg3, arg4) { + arg0.scissor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_scissor_988df87f9cf85e7e = function(arg0, arg1, arg2, arg3, arg4) { + arg0.scissor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_search_856af82f9dccb2ef = function() { return handleError(function (arg0, arg1) { + const ret = arg1.search; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_setAttribute_34747dd193f45828 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setItem_1167ad38996d6426 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setProperty_f27b2c05323daf8a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + arg0.setProperty(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setTimeout_06477c23d31efef1 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = arg0.setTimeout(arg1, arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_setTimeout_7bb3429662ab1e70 = function(arg0, arg1) { + const ret = setTimeout(arg0, arg1); + return ret; + }; + imports.wbg.__wbg_set_169e13b608078b7b = function(arg0, arg1, arg2) { + arg0.set(getArrayU8FromWasm0(arg1, arg2)); + }; + imports.wbg.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = Reflect.set(arg0, arg1, arg2); + return ret; + }, arguments) }; + imports.wbg.__wbg_set_accept_4af7309453c16421 = function(arg0, arg1, arg2) { + arg0.accept = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_autofocus_ae8f5acfea79d602 = function() { return handleError(function (arg0, arg1) { + arg0.autofocus = arg1 !== 0; + }, arguments) }; + imports.wbg.__wbg_set_body_8e743242d6076a4f = function(arg0, arg1) { + arg0.body = arg1; + }; + imports.wbg.__wbg_set_box_d724bbbe6354cf86 = function(arg0, arg1) { + arg0.box = __wbindgen_enum_ResizeObserverBoxOptions[arg1]; + }; + imports.wbg.__wbg_set_cache_0e437c7c8e838b9b = function(arg0, arg1) { + arg0.cache = __wbindgen_enum_RequestCache[arg1]; + }; + imports.wbg.__wbg_set_className_52411a7e4782668d = function(arg0, arg1, arg2) { + arg0.className = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_credentials_55ae7c3c106fd5be = function(arg0, arg1) { + arg0.credentials = __wbindgen_enum_RequestCredentials[arg1]; + }; + imports.wbg.__wbg_set_download_8403fd66b94b25a2 = function(arg0, arg1, arg2) { + arg0.download = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_headers_5671cf088e114d2b = function(arg0, arg1) { + arg0.headers = arg1; + }; + imports.wbg.__wbg_set_height_6f8f8ef4cb40e496 = function(arg0, arg1) { + arg0.height = arg1 >>> 0; + }; + imports.wbg.__wbg_set_href_25c4bcdcbfb4459b = function(arg0, arg1, arg2) { + arg0.href = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_id_702da6e1bcec3b45 = function(arg0, arg1, arg2) { + arg0.id = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_innerHTML_f1d03f780518a596 = function(arg0, arg1, arg2) { + arg0.innerHTML = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_innerText_b0abb40240106cb9 = function(arg0, arg1, arg2) { + arg0.innerText = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_method_76c69e41b3570627 = function(arg0, arg1, arg2) { + arg0.method = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_mode_611016a6818fc690 = function(arg0, arg1) { + arg0.mode = __wbindgen_enum_RequestMode[arg1]; + }; + imports.wbg.__wbg_set_multiple_5bdba13a27ad28c3 = function(arg0, arg1) { + arg0.multiple = arg1 !== 0; + }; + imports.wbg.__wbg_set_once_cb88c6a887803dfa = function(arg0, arg1) { + arg0.once = arg1 !== 0; + }; + imports.wbg.__wbg_set_onclick_bd577c6578279be4 = function(arg0, arg1) { + arg0.onclick = arg1; + }; + imports.wbg.__wbg_set_onload_3ff2f72af5cc911d = function(arg0, arg1) { + arg0.onload = arg1; + }; + imports.wbg.__wbg_set_signal_e89be862d0091009 = function(arg0, arg1) { + arg0.signal = arg1; + }; + imports.wbg.__wbg_set_tabIndex_10b13c5f00904478 = function(arg0, arg1) { + arg0.tabIndex = arg1; + }; + imports.wbg.__wbg_set_type_466673d0a1ab874b = function(arg0, arg1, arg2) { + arg0.type = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_type_7ce650670a34c68f = function(arg0, arg1, arg2) { + arg0.type = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_value_8f487a4f7d71c024 = function(arg0, arg1, arg2) { + arg0.value = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_set_width_7ff7a22c6e9f423e = function(arg0, arg1) { + arg0.width = arg1 >>> 0; + }; + imports.wbg.__wbg_shaderSource_8a7a30baeaf655d5 = function(arg0, arg1, arg2, arg3) { + arg0.shaderSource(arg1, getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbg_shaderSource_aea71cfa376fc985 = function(arg0, arg1, arg2, arg3) { + arg0.shaderSource(arg1, getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbg_shiftKey_a6df227a917d203b = function(arg0) { + const ret = arg0.shiftKey; + return ret; + }; + imports.wbg.__wbg_shiftKey_d2640abcfa98acec = function(arg0) { + const ret = arg0.shiftKey; + return ret; + }; + imports.wbg.__wbg_signal_3c14fbdc89694b39 = function(arg0) { + const ret = arg0.signal; + return ret; + }; + imports.wbg.__wbg_stack_7ab0e52d303d5f54 = function(arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_stack_a52ce04892c62bc3 = function(arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() { + const ret = typeof global === 'undefined' ? null : global; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() { + const ret = typeof globalThis === 'undefined' ? null : globalThis; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() { + const ret = typeof self === 'undefined' ? null : self; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() { + const ret = typeof window === 'undefined' ? null : window; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_status_9bfc680efca4bdfd = function(arg0) { + const ret = arg0.status; + return ret; + }; + imports.wbg.__wbg_stopPropagation_611935c25ee35a3c = function(arg0) { + arg0.stopPropagation(); + }; + imports.wbg.__wbg_stringify_655a6390e1f5eb6b = function() { return handleError(function (arg0) { + const ret = JSON.stringify(arg0); + return ret; + }, arguments) }; + imports.wbg.__wbg_style_521a717da50e53c6 = function(arg0) { + const ret = arg0.style; + return ret; + }; + imports.wbg.__wbg_texImage2D_9626e500f8562784 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texImage2D_d2480404caf2a35b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texParameteri_035e104616b395e0 = function(arg0, arg1, arg2, arg3) { + arg0.texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); + }; + imports.wbg.__wbg_texParameteri_3a52bfd2ef280632 = function(arg0, arg1, arg2, arg3) { + arg0.texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); + }; + imports.wbg.__wbg_texSubImage2D_1f2ed8e2272ea41a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_texSubImage2D_b3a850c16797a6b2 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + arg0.texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); + }, arguments) }; + imports.wbg.__wbg_text_51046bb33d257f63 = function() { return handleError(function (arg0) { + const ret = arg0.text(); + return ret; + }, arguments) }; + imports.wbg.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) { + const ret = arg0.then(arg1, arg2); + return ret; + }; + imports.wbg.__wbg_then_4f95312d68691235 = function(arg0, arg1) { + const ret = arg0.then(arg1); + return ret; + }; + imports.wbg.__wbg_top_7d5b82a2c5d7f13f = function(arg0) { + const ret = arg0.top; + return ret; + }; + imports.wbg.__wbg_touches_1cf6f6e3e2a7e85d = function(arg0) { + const ret = arg0.touches; + return ret; + }; + imports.wbg.__wbg_type_498349ffaacc608d = function(arg0, arg1) { + const ret = arg1.type; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_type_cb833fc71b5282fb = function(arg0, arg1) { + const ret = arg1.type; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_uniform1i_85131b7388bc8e3f = function(arg0, arg1, arg2) { + arg0.uniform1i(arg1, arg2); + }; + imports.wbg.__wbg_uniform1i_e48736e68cd30ed1 = function(arg0, arg1, arg2) { + arg0.uniform1i(arg1, arg2); + }; + imports.wbg.__wbg_uniform2f_191d769606542c31 = function(arg0, arg1, arg2, arg3) { + arg0.uniform2f(arg1, arg2, arg3); + }; + imports.wbg.__wbg_uniform2f_d0f7977f54aed068 = function(arg0, arg1, arg2, arg3) { + arg0.uniform2f(arg1, arg2, arg3); + }; + imports.wbg.__wbg_url_b6d11838a4f95198 = function(arg0, arg1) { + const ret = arg1.url; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_useProgram_142dd02d095f80f1 = function(arg0, arg1) { + arg0.useProgram(arg1); + }; + imports.wbg.__wbg_useProgram_4632a62f19deea67 = function(arg0, arg1) { + arg0.useProgram(arg1); + }; + imports.wbg.__wbg_userActivation_5b18f08f775343b8 = function(arg0) { + const ret = arg0.userActivation; + return ret; + }; + imports.wbg.__wbg_userAgent_e18bc0cc9ad38ec1 = function() { return handleError(function (arg0, arg1) { + const ret = arg1.userAgent; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbg_value_2c75ca481407d038 = function(arg0, arg1) { + const ret = arg1.value; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) { + const ret = arg0.value; + return ret; + }; + imports.wbg.__wbg_vertexAttribPointer_5c516f4c675103bf = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + arg0.vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + imports.wbg.__wbg_vertexAttribPointer_880223685613a791 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + arg0.vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + imports.wbg.__wbg_view_788aaf149deefd2f = function(arg0) { + const ret = arg0.view; + return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); + }; + imports.wbg.__wbg_viewport_1b0f7b63c424b52f = function(arg0, arg1, arg2, arg3, arg4) { + arg0.viewport(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_viewport_ceaa5c1a061b76df = function(arg0, arg1, arg2, arg3, arg4) { + arg0.viewport(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_width_30d712cfe70e4fae = function(arg0) { + const ret = arg0.width; + return ret; + }; + imports.wbg.__wbg_width_dd0cfe94d42f5143 = function(arg0) { + const ret = arg0.width; + return ret; + }; + imports.wbg.__wbg_writeText_c9776abb6826901c = function(arg0, arg1, arg2) { + const ret = arg0.writeText(getStringFromWasm0(arg1, arg2)); + return ret; + }; + imports.wbg.__wbg_write_b6b51422643b0ba7 = function(arg0, arg1) { + const ret = arg0.write(arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) { + // Cast intrinsic for `Ref(String) -> Externref`. + const ret = getStringFromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_23bcaa43665d663e = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [], shim_idx: 356, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__hbe65ce5d0d117e04); + return ret; + }; + imports.wbg.__wbindgen_cast_595a31e0e283e6e5 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [], shim_idx: 91, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__h3019cdfbf8217f17); + return ret; + }; + imports.wbg.__wbindgen_cast_c457c5a709184ae8 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [NamedExternref("Event")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981); + return ret; + }; + imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) { + // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`. + const ret = getArrayU8FromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) { + // Cast intrinsic for `F64 -> Externref`. + const ret = arg0; + return ret; + }; + imports.wbg.__wbindgen_cast_ec3b197b7ee78e65 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [NamedExternref("Array")], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981); + return ret; + }; + imports.wbg.__wbindgen_cast_f4b9452ec3f63fa1 = function(arg0, arg1) { + // Cast intrinsic for `Closure(Closure { dtor_idx: 83, function: Function { arguments: [Externref], shim_idx: 84, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. + const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h184aaa8526d11197, wasm_bindgen__convert__closures_____invoke__h251608b0a4d90981); + return ret; + }; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_externrefs; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + }; + + return imports; +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedDataViewMemory0 = null; + cachedUint8ArrayMemory0 = null; + + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + const instance = new WebAssembly.Instance(module, imports); + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('surfer_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync }; +export default __wbg_init; diff --git a/media/surfer/surfer/surfer_bg.wasm b/media/surfer/surfer/surfer_bg.wasm new file mode 100644 index 0000000..2bfb38f Binary files /dev/null and b/media/surfer/surfer/surfer_bg.wasm differ diff --git a/media/surfer/surfer/sw.js b/media/surfer/surfer/sw.js new file mode 100644 index 0000000..303cf59 --- /dev/null +++ b/media/surfer/surfer/sw.js @@ -0,0 +1,37 @@ +self.addEventListener("install", function () { + self.skipWaiting(); +}); + +self.addEventListener("activate", (event) => { + event.waitUntil(self.clients.claim()); +}); + +self.addEventListener("fetch", function (event) { + if (event.request.cache === "only-if-cached" && event.request.mode !== "same-origin") { + return; + } + + event.respondWith( + fetch(event.request) + .then(function (response) { + // It seems like we only need to set the headers for index.html + // If you want to be on the safe side, comment this out + // if (!response.url.includes("index.html")) return response; + + const newHeaders = new Headers(response.headers); + newHeaders.set("Cross-Origin-Embedder-Policy", "require-corp"); + newHeaders.set("Cross-Origin-Opener-Policy", "same-origin"); + + const moddedResponse = new Response(response.body, { + status: response.status, + statusText: response.statusText, + headers: newHeaders, + }); + + return moddedResponse; + }) + .catch(function (e) { + console.error(e); + }) + ); +}); diff --git a/media/surfer/surfer_bg.wasm b/media/surfer/surfer_bg.wasm new file mode 100644 index 0000000..2bfb38f Binary files /dev/null and b/media/surfer/surfer_bg.wasm differ diff --git a/media/surfer/sw.js b/media/surfer/sw.js new file mode 100644 index 0000000..303cf59 --- /dev/null +++ b/media/surfer/sw.js @@ -0,0 +1,37 @@ +self.addEventListener("install", function () { + self.skipWaiting(); +}); + +self.addEventListener("activate", (event) => { + event.waitUntil(self.clients.claim()); +}); + +self.addEventListener("fetch", function (event) { + if (event.request.cache === "only-if-cached" && event.request.mode !== "same-origin") { + return; + } + + event.respondWith( + fetch(event.request) + .then(function (response) { + // It seems like we only need to set the headers for index.html + // If you want to be on the safe side, comment this out + // if (!response.url.includes("index.html")) return response; + + const newHeaders = new Headers(response.headers); + newHeaders.set("Cross-Origin-Embedder-Policy", "require-corp"); + newHeaders.set("Cross-Origin-Opener-Policy", "same-origin"); + + const moddedResponse = new Response(response.body, { + status: response.status, + statusText: response.statusText, + headers: newHeaders, + }); + + return moddedResponse; + }) + .catch(function (e) { + console.error(e); + }) + ); +}); diff --git a/package.json b/package.json index 8ccf484..79fcfb3 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,18 @@ "id": "iccoder", "label": "IC Coder" } + ], + "customEditors": [ + { + "viewType": "ic-coder.vcdViewer", + "displayName": "VCD 波形查看器", + "selector": [ + { + "filenamePattern": "*.vcd" + } + ], + "priority": "default" + } ] }, "scripts": { diff --git a/rustup-init.exe b/rustup-init.exe new file mode 100644 index 0000000..111a059 Binary files /dev/null and b/rustup-init.exe differ diff --git a/src/extension.ts b/src/extension.ts index 9abe301..bbf33fd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,13 +1,27 @@ import * as vscode from "vscode"; import { ICViewProvider } from "./views/ICViewProvider"; import { showICHelperPanel } from "./panels/ICHelperPanel"; -import { VCDViewerPanel } from "./panels/VCDViewerPanel"; +import { VCDViewerPanel, VCDViewerEditorProvider } from "./panels/VCDViewerPanel"; import { ChatHistoryManager } from "./utils/chatHistoryManager"; import { ICCoderAuthenticationProvider } from "./services/icCoderAuthProvider"; +import { VCDFileServer } from "./services/vcdFileServer"; export function activate(context: vscode.ExtensionContext) { console.log("🎉 IC Coder 插件已激活!"); + // 初始化 VCD 文件服务器 + const vcdFileServer = new VCDFileServer(); + vcdFileServer.start().then((port) => { + console.log(`VCD 文件服务器已启动,端口: ${port}`); + }).catch((error) => { + console.error("启动 VCD 文件服务器失败:", error); + }); + + // 在插件停用时关闭服务器 + context.subscriptions.push({ + dispose: () => vcdFileServer.stop() + }); + // 注册 Authentication Provider const authProvider = new ICCoderAuthenticationProvider(context); context.subscriptions.push( @@ -68,7 +82,7 @@ export function activate(context: vscode.ExtensionContext) { } } - VCDViewerPanel.createOrShow(context.extensionUri, vcdFilePath); + VCDViewerPanel.createOrShow(context.extensionUri, vcdFilePath, vcdFileServer); } ); @@ -160,6 +174,9 @@ export function activate(context: vscode.ExtensionContext) { viewProvider ); + // 注册 VCD 自定义编辑器 + const vcdEditorProvider = VCDViewerEditorProvider.register(context); + // 添加到订阅 context.subscriptions.push( openPanelCommand, @@ -174,7 +191,8 @@ export function activate(context: vscode.ExtensionContext) { // deleteSessionCommand, // clearHistoryCommand, // searchSessionCommand, - viewRegistration + viewRegistration, + vcdEditorProvider ); } diff --git a/src/panels/VCDViewerPanel.ts b/src/panels/VCDViewerPanel.ts index 151aa56..8961716 100644 --- a/src/panels/VCDViewerPanel.ts +++ b/src/panels/VCDViewerPanel.ts @@ -1,19 +1,73 @@ import * as vscode from "vscode"; import * as path from "path"; import * as fs from "fs"; +import { VCDFileServer } from "../services/vcdFileServer"; /** - * VCD 波形查看器面板 + * VCD 波形查看器自定义编辑器提供者 + */ +export class VCDViewerEditorProvider implements vscode.CustomReadonlyEditorProvider { + public static register(context: vscode.ExtensionContext): vscode.Disposable { + const provider = new VCDViewerEditorProvider(context); + const providerRegistration = vscode.window.registerCustomEditorProvider( + "ic-coder.vcdViewer", + provider, + { + webviewOptions: { + retainContextWhenHidden: true, + }, + } + ); + return providerRegistration; + } + + constructor(private readonly context: vscode.ExtensionContext) {} + + async openCustomDocument( + uri: vscode.Uri, + openContext: vscode.CustomDocumentOpenContext, + token: vscode.CancellationToken + ): Promise { + return { + uri, + dispose: () => {}, + }; + } + + async resolveCustomEditor( + document: vscode.CustomDocument, + webviewPanel: vscode.WebviewPanel, + token: vscode.CancellationToken + ): Promise { + webviewPanel.webview.options = { + enableScripts: true, + localResourceRoots: [this.context.extensionUri], + }; + + // 使用公共工厂方法创建 VCD 查看器实例 + VCDViewerPanel.createFromWebviewPanel( + webviewPanel, + this.context.extensionUri, + document.uri.fsPath + ); + } +} + +/** + * VCD 波形查看器面板 (使用 Surfer) */ export class VCDViewerPanel { public static currentPanel: VCDViewerPanel | undefined; private readonly _panel: vscode.WebviewPanel; private readonly _extensionUri: vscode.Uri; private _disposables: vscode.Disposable[] = []; + private _currentVcdPath: string | undefined; + private _vcdFileServer: VCDFileServer | undefined; - private constructor(panel: vscode.WebviewPanel, extensionUri: vscode.Uri) { + private constructor(panel: vscode.WebviewPanel, extensionUri: vscode.Uri, vcdFileServer?: VCDFileServer) { this._panel = panel; this._extensionUri = extensionUri; + this._vcdFileServer = vcdFileServer; // 设置初始 HTML 内容 this._panel.webview.html = this._getLoadingHtml(); @@ -24,12 +78,20 @@ export class VCDViewerPanel { // 监听来自 webview 的消息 this._panel.webview.onDidReceiveMessage( (message) => { + console.log("[VCDViewerPanel] 收到消息:", message); switch (message.command) { case "loadVCD": if (message.filePath) { this.loadVCDFile(message.filePath); } break; + case "loaded": + // Surfer iframe 加载完成,发送 VCD 文件 + console.log("[VCDViewerPanel] Surfer 已加载,当前 VCD 路径:", this._currentVcdPath); + if (this._currentVcdPath) { + this.sendVcdToSurfer(this._currentVcdPath); + } + break; } }, null, @@ -40,7 +102,7 @@ export class VCDViewerPanel { /** * 创建或显示 VCD 查看器面板 */ - public static createOrShow(extensionUri: vscode.Uri, vcdFilePath?: string) { + public static createOrShow(extensionUri: vscode.Uri, vcdFilePath?: string, vcdFileServer?: VCDFileServer) { const column = vscode.ViewColumn.One; // 如果已经有面板打开,则显示它 @@ -64,7 +126,7 @@ export class VCDViewerPanel { } ); - VCDViewerPanel.currentPanel = new VCDViewerPanel(panel, extensionUri); + VCDViewerPanel.currentPanel = new VCDViewerPanel(panel, extensionUri, vcdFileServer); // 如果提供了 VCD 文件路径,加载它 if (vcdFilePath) { @@ -72,23 +134,43 @@ export class VCDViewerPanel { } } + /** + * 从已有的 webview panel 创建 VCD 查看器(用于自定义编辑器) + */ + public static createFromWebviewPanel( + panel: vscode.WebviewPanel, + extensionUri: vscode.Uri, + vcdFilePath: string + ) { + const viewer = new VCDViewerPanel(panel, extensionUri); + viewer.loadVCDFile(vcdFilePath); + return viewer; + } + /** * 加载 VCD 文件 */ public loadVCDFile(vcdFilePath: string) { try { + console.log("[VCDViewerPanel] 开始加载 VCD 文件:", vcdFilePath); + // 检查文件是否存在 if (!fs.existsSync(vcdFilePath)) { vscode.window.showErrorMessage(`VCD 文件不存在: ${vcdFilePath}`); return; } + // 保存当前 VCD 路径 + this._currentVcdPath = vcdFilePath; + console.log("[VCDViewerPanel] VCD 路径已保存:", this._currentVcdPath); + // 更新面板标题 const fileName = path.basename(vcdFilePath); - this._panel.title = `VCD 波形查看器 - ${fileName}`; + this._panel.title = `Surfer 波形查看器 - ${fileName}`; // 设置 HTML 内容 - this._panel.webview.html = this._getWebviewContent(vcdFilePath); + this._panel.webview.html = this._getWebviewContent(); + console.log("[VCDViewerPanel] Webview HTML 已设置"); } catch (error) { vscode.window.showErrorMessage( `加载 VCD 文件失败: ${error instanceof Error ? error.message : "未知错误"}` @@ -96,6 +178,104 @@ export class VCDViewerPanel { } } + /** + * 解析 VCD 文件获取根模块及其直接子模块名称 + */ + private parseVcdRootScope(vcdFilePath: string): string[] { + try { + // 读取 VCD 文件 + const buffer = fs.readFileSync(vcdFilePath, { encoding: 'utf8' }); + const lines = buffer.split('\n'); + + const scopeNames: string[] = []; + let scopeDepth = 0; + const scopeStack: string[] = []; + + for (const line of lines) { + const trimmed = line.trim(); + + // 遇到 $enddefinitions 就停止解析 + if (trimmed.startsWith('$enddefinitions')) { + break; + } + + // 查找 $scope 定义 + const scopeMatch = trimmed.match(/^\$scope\s+(\w+)\s+(\w+)/); + if (scopeMatch) { + const scopeType = scopeMatch[1]; + const scopeName = scopeMatch[2]; + + // 记录顶层 module (depth = 0) + if (scopeDepth === 0 && scopeType === 'module') { + scopeStack.push(scopeName); + console.log("[VCDViewerPanel] 找到顶层作用域:", scopeName); + } + // 记录顶层下的直接子模块 (depth = 1) + else if (scopeDepth === 1 && scopeType === 'module') { + const fullPath = [...scopeStack, scopeName]; + scopeNames.push(fullPath.join('.')); + console.log("[VCDViewerPanel] 找到子模块:", fullPath.join('.')); + } + + scopeDepth++; + } + + // 遇到 $upscope 减少深度 + if (trimmed.startsWith('$upscope')) { + scopeDepth--; + if (scopeDepth === 0) { + scopeStack.pop(); + } + } + } + + return scopeNames; + } catch (error) { + console.error("[VCDViewerPanel] 解析 VCD 文件失败:", error); + return []; + } + } + + /** + * 发送 VCD 文件到 Surfer + */ + private sendVcdToSurfer(vcdFilePath: string) { + try { + console.log("[VCDViewerPanel] 准备发送 VCD 到 Surfer:", vcdFilePath); + + if (!this._vcdFileServer) { + throw new Error("VCD 文件服务器未初始化"); + } + + // 解析 VCD 文件获取根模块名称 + const scopeNames = this.parseVcdRootScope(vcdFilePath); + console.log("[VCDViewerPanel] 解析到的作用域名称:", scopeNames); + + // 注册文件到 HTTP 服务器 + const fileId = this._vcdFileServer.registerFile(vcdFilePath); + const httpUrl = this._vcdFileServer.getFileUrl(fileId); + const fileName = path.basename(vcdFilePath); + + console.log("[VCDViewerPanel] 文件名:", fileName); + console.log("[VCDViewerPanel] HTTP URL:", httpUrl); + + // 使用 LoadUrl 命令通过 HTTP 加载文件 + this._panel.webview.postMessage({ + command: "loadVcdUrl", + url: httpUrl, + fileName: fileName, + scopeNames: scopeNames, // 传递解析到的作用域名称 + }); + + console.log("[VCDViewerPanel] 已发送 loadVcdUrl 消息到 webview"); + } catch (error) { + console.error("[VCDViewerPanel] 发送 VCD 数据失败:", error); + vscode.window.showErrorMessage( + `发送 VCD 数据失败: ${error instanceof Error ? error.message : "未知错误"}` + ); + } + } + /** * 清理资源 */ @@ -163,188 +343,239 @@ export class VCDViewerPanel { /** * 获取 Webview 的 HTML 内容 */ - private _getWebviewContent(vcdFilePath: string): string { - // 获取资源 URI - const vcdromJsUri = this._panel.webview.asWebviewUri( - vscode.Uri.joinPath(this._extensionUri, "media", "vcdrom", "vcdrom.js") + private _getWebviewContent(): string { + // 获取 surfer 资源 URI + const surferJsUri = this._panel.webview.asWebviewUri( + vscode.Uri.joinPath(this._extensionUri, "media", "surfer", "surfer.js") ); - const vcdWasmUri = this._panel.webview.asWebviewUri( - vscode.Uri.joinPath(this._extensionUri, "media", "vcdrom", "vcd.wasm") + const surferWasmUri = this._panel.webview.asWebviewUri( + vscode.Uri.joinPath(this._extensionUri, "media", "surfer", "surfer_bg.wasm") ); - const fontRegularUri = this._panel.webview.asWebviewUri( - vscode.Uri.joinPath(this._extensionUri, "media", "vcdrom", "IosevkaDrom-Regular.woff2") + const integrationJsUri = this._panel.webview.asWebviewUri( + vscode.Uri.joinPath(this._extensionUri, "media", "surfer", "integration.js") ); - const fontObliqueUri = this._panel.webview.asWebviewUri( - vscode.Uri.joinPath(this._extensionUri, "media", "vcdrom", "IosevkaDrom-Oblique.woff2") - ); - const fontItalicUri = this._panel.webview.asWebviewUri( - vscode.Uri.joinPath(this._extensionUri, "media", "vcdrom", "IosevkaDrom-Italic.woff2") - ); - - // 读取 VCD 文件内容并转换为 base64 - const vcdContent = fs.readFileSync(vcdFilePath, "utf-8"); - const vcdBase64 = Buffer.from(vcdContent).toString("base64"); return ` - + - - - VCD 波形查看器 + + + Surfer 波形查看器 + + + + + - -
-
-
-

正在加载 VCD 波形...

-
-
+ + + + `; diff --git a/src/services/vcdFileServer.ts b/src/services/vcdFileServer.ts new file mode 100644 index 0000000..1afff27 --- /dev/null +++ b/src/services/vcdFileServer.ts @@ -0,0 +1,145 @@ +import * as http from "http"; +import * as fs from "fs"; +import * as path from "path"; + +/** + * VCD 文件 HTTP 服务器 + * 用于为 Surfer 波形查看器提供 VCD 文件访问 + */ +export class VCDFileServer { + private server: http.Server | null = null; + private port: number = 0; + private vcdFiles: Map = new Map(); // fileId -> filePath + + /** + * 启动服务器 + */ + public async start(): Promise { + if (this.server) { + return this.port; + } + + return new Promise((resolve, reject) => { + this.server = http.createServer((req, res) => { + this.handleRequest(req, res); + }); + + // 监听随机端口 + this.server.listen(0, "127.0.0.1", () => { + const address = this.server!.address(); + if (address && typeof address === "object") { + this.port = address.port; + console.log(`[VCDFileServer] 服务器已启动,端口: ${this.port}`); + resolve(this.port); + } else { + reject(new Error("无法获取服务器端口")); + } + }); + + this.server.on("error", (error) => { + console.error("[VCDFileServer] 服务器错误:", error); + reject(error); + }); + }); + } + + /** + * 停止服务器 + */ + public stop(): void { + if (this.server) { + this.server.close(); + this.server = null; + this.port = 0; + this.vcdFiles.clear(); + console.log("[VCDFileServer] 服务器已停止"); + } + } + + /** + * 注册 VCD 文件 + */ + public registerFile(filePath: string): string { + const fileId = this.generateFileId(filePath); + this.vcdFiles.set(fileId, filePath); + console.log(`[VCDFileServer] 注册文件: ${fileId} -> ${filePath}`); + return fileId; + } + + /** + * 获取文件 URL + */ + public getFileUrl(fileId: string): string { + return `http://127.0.0.1:${this.port}/vcd/${fileId}`; + } + + /** + * 生成文件 ID + */ + private generateFileId(filePath: string): string { + const timestamp = Date.now(); + const fileName = path.basename(filePath); + return `${timestamp}-${fileName}`; + } + + /** + * 处理 HTTP 请求 + */ + private handleRequest(req: http.IncomingMessage, res: http.ServerResponse): void { + const url = req.url || ""; + console.log(`[VCDFileServer] 收到请求: ${url}`); + + // 设置 CORS 头 + res.setHeader("Access-Control-Allow-Origin", "*"); + res.setHeader("Access-Control-Allow-Methods", "GET, OPTIONS"); + res.setHeader("Access-Control-Allow-Headers", "Content-Type"); + + // 处理 OPTIONS 请求 + if (req.method === "OPTIONS") { + res.writeHead(200); + res.end(); + return; + } + + // 解析 URL,提取文件 ID + const match = url.match(/^\/vcd\/(.+)$/); + if (!match) { + res.writeHead(404, { "Content-Type": "text/plain" }); + res.end("Not Found"); + return; + } + + const fileId = match[1]; + const filePath = this.vcdFiles.get(fileId); + + if (!filePath) { + console.error(`[VCDFileServer] 文件 ID 不存在: ${fileId}`); + res.writeHead(404, { "Content-Type": "text/plain" }); + res.end("File Not Found"); + return; + } + + // 检查文件是否存在 + if (!fs.existsSync(filePath)) { + console.error(`[VCDFileServer] 文件不存在: ${filePath}`); + res.writeHead(404, { "Content-Type": "text/plain" }); + res.end("File Not Found"); + return; + } + + // 读取并发送文件 + try { + const fileContent = fs.readFileSync(filePath); + res.writeHead(200, { + "Content-Type": "text/plain", + "Content-Length": fileContent.length, + }); + res.end(fileContent); + console.log(`[VCDFileServer] 成功发送文件: ${filePath}`); + } catch (error) { + console.error(`[VCDFileServer] 读取文件失败:`, error); + res.writeHead(500, { "Content-Type": "text/plain" }); + res.end("Internal Server Error"); + } + } +} diff --git a/src/types/api.ts b/src/types/api.ts index d9b0a71..28289fe 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -59,7 +59,8 @@ export type SSEEventType = | 'error' // 错误 | 'warning' // 警告 | 'notification' // 通知 - | 'depth_update'; // 深度更新 + | 'depth_update' // 深度更新 + | 'heartbeat'; // 心跳事件 /** text_delta 事件数据 */ export interface TextDeltaEvent {