-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.index.js
38 lines (28 loc) · 54.7 KB
/
1.index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[1],{
/***/ "../lib/pkg/rustpython_wasm.js":
/*!*************************************!*\
!*** ../lib/pkg/rustpython_wasm.js ***!
\*************************************/
/*! exports provided: setup_console_error, pyEval, __widl_f_query_selector_Document, __widl_f_get_attribute_Element, __widl_f_set_attribute_Element, __widl_f_set_Headers, __widl_f_new_with_str_and_init_Request, __widl_f_headers_Request, __widl_instanceof_Response, __widl_f_array_buffer_Response, __widl_f_json_Response, __widl_f_text_Response, __widl_instanceof_Window, __widl_f_alert_with_message_Window, __widl_f_cancel_animation_frame_Window, __widl_f_confirm_with_message_Window, __widl_f_prompt_with_message_Window, __widl_f_prompt_with_message_and_default_Window, __widl_f_request_animation_frame_Window, __widl_f_document_Window, __widl_f_fetch_with_request_Window, __widl_f_log_, __wbg_new_816c11756f2e51ab, __wbg_isArray_9bff3f9d00f36da5, __wbg_push_ce2a178eef8f4483, __wbg_instanceof_ArrayBuffer_7b79746f789692de, __wbg_isView_2a8037d56f09b136, __wbg_values_c5ff7b837b3f6830, __wbg_instanceof_Error_fdac2ec12870b182, __wbg_new_832d47172cff7c40, __wbg_message_4e7ed1a249b8e785, __wbg_name_da78b12bdfa5ceb1, __wbg_toString_e8fd6ec59829ff8c, __wbg_newnoargs_b4526aa2a6db81de, __wbg_apply_ccde16c927c5f8be, __wbg_call_a7a8823c404228ab, __wbg_call_e6e8911c46484a33, __wbg_next_c004b8a85ecf4b77, __wbg_done_178d004be150c0b1, __wbg_value_43d4ee3a28fa5f46, __wbg_entries_f0621d88037d7e39, __wbg_new_7fc81df805aaefb0, __wbg_toString_4964e720c1c2dd0b, __wbg_new_0e18fff561c9c269, __wbg_get_44104914d11d4644, __wbg_set_4c196bb000d34157, __wbg_new_89034170295509fb, __wbg_new_d558b6572c1b5235, __wbg_parse_79a81072d7862d78, __wbg_stringify_93f1cd10368e2438, __wbg_instanceof_Promise_aedc16bc7659e950, __wbg_new_7440491cc5e719b8, __wbg_resolve_ec1f85083faa6c47, __wbg_then_f1813c1d50cb0b3d, __wbg_then_37317e38a820e922, __wbg_new_1a20aebd7054d9e3, __wbg_newwithbyteoffsetandlength_50f030092954587d, __wbg_buffer_7f0f38c0fbbca6e0, __wbg_slice_e7bdbd0e93c5ab13, __wbg_length_f7d8598626eb36d7, __wbg_set_f87b1d3d2c63a317, __wbg_new_0b074655b6f45c52, __wbg_buffer_859770b344faa681, __wbindgen_string_new, __wbindgen_number_new, __wbindgen_is_null, __wbindgen_is_undefined, __wbindgen_is_object, __wbindgen_is_function, __wbindgen_string_get, __wbindgen_debug_string, __wbindgen_cb_drop, __wbindgen_cb_forget, __wbindgen_memory, __wbindgen_rethrow, __wbindgen_throw, __wbindgen_closure_wrapper1618, __wbindgen_closure_wrapper1620, __wbindgen_closure_wrapper3105, __wbg_virtualmachine_new, VirtualMachine, vmStore, __wbindgen_object_clone_ref, __wbindgen_object_drop_ref */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setup_console_error\", function() { return setup_console_error; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pyEval\", function() { return pyEval; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_query_selector_Document\", function() { return __widl_f_query_selector_Document; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_get_attribute_Element\", function() { return __widl_f_get_attribute_Element; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_set_attribute_Element\", function() { return __widl_f_set_attribute_Element; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_set_Headers\", function() { return __widl_f_set_Headers; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_new_with_str_and_init_Request\", function() { return __widl_f_new_with_str_and_init_Request; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_headers_Request\", function() { return __widl_f_headers_Request; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_instanceof_Response\", function() { return __widl_instanceof_Response; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_array_buffer_Response\", function() { return __widl_f_array_buffer_Response; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_json_Response\", function() { return __widl_f_json_Response; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_text_Response\", function() { return __widl_f_text_Response; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_instanceof_Window\", function() { return __widl_instanceof_Window; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_alert_with_message_Window\", function() { return __widl_f_alert_with_message_Window; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_cancel_animation_frame_Window\", function() { return __widl_f_cancel_animation_frame_Window; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_confirm_with_message_Window\", function() { return __widl_f_confirm_with_message_Window; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_prompt_with_message_Window\", function() { return __widl_f_prompt_with_message_Window; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_prompt_with_message_and_default_Window\", function() { return __widl_f_prompt_with_message_and_default_Window; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_request_animation_frame_Window\", function() { return __widl_f_request_animation_frame_Window; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_document_Window\", function() { return __widl_f_document_Window; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_fetch_with_request_Window\", function() { return __widl_f_fetch_with_request_Window; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__widl_f_log_\", function() { return __widl_f_log_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_816c11756f2e51ab\", function() { return __wbg_new_816c11756f2e51ab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_isArray_9bff3f9d00f36da5\", function() { return __wbg_isArray_9bff3f9d00f36da5; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_push_ce2a178eef8f4483\", function() { return __wbg_push_ce2a178eef8f4483; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_instanceof_ArrayBuffer_7b79746f789692de\", function() { return __wbg_instanceof_ArrayBuffer_7b79746f789692de; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_isView_2a8037d56f09b136\", function() { return __wbg_isView_2a8037d56f09b136; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_values_c5ff7b837b3f6830\", function() { return __wbg_values_c5ff7b837b3f6830; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_instanceof_Error_fdac2ec12870b182\", function() { return __wbg_instanceof_Error_fdac2ec12870b182; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_832d47172cff7c40\", function() { return __wbg_new_832d47172cff7c40; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_message_4e7ed1a249b8e785\", function() { return __wbg_message_4e7ed1a249b8e785; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_name_da78b12bdfa5ceb1\", function() { return __wbg_name_da78b12bdfa5ceb1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_toString_e8fd6ec59829ff8c\", function() { return __wbg_toString_e8fd6ec59829ff8c; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_newnoargs_b4526aa2a6db81de\", function() { return __wbg_newnoargs_b4526aa2a6db81de; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_apply_ccde16c927c5f8be\", function() { return __wbg_apply_ccde16c927c5f8be; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_call_a7a8823c404228ab\", function() { return __wbg_call_a7a8823c404228ab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_call_e6e8911c46484a33\", function() { return __wbg_call_e6e8911c46484a33; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_next_c004b8a85ecf4b77\", function() { return __wbg_next_c004b8a85ecf4b77; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_done_178d004be150c0b1\", function() { return __wbg_done_178d004be150c0b1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_value_43d4ee3a28fa5f46\", function() { return __wbg_value_43d4ee3a28fa5f46; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_entries_f0621d88037d7e39\", function() { return __wbg_entries_f0621d88037d7e39; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_7fc81df805aaefb0\", function() { return __wbg_new_7fc81df805aaefb0; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_toString_4964e720c1c2dd0b\", function() { return __wbg_toString_4964e720c1c2dd0b; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_0e18fff561c9c269\", function() { return __wbg_new_0e18fff561c9c269; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_get_44104914d11d4644\", function() { return __wbg_get_44104914d11d4644; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_set_4c196bb000d34157\", function() { return __wbg_set_4c196bb000d34157; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_89034170295509fb\", function() { return __wbg_new_89034170295509fb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_d558b6572c1b5235\", function() { return __wbg_new_d558b6572c1b5235; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_parse_79a81072d7862d78\", function() { return __wbg_parse_79a81072d7862d78; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_stringify_93f1cd10368e2438\", function() { return __wbg_stringify_93f1cd10368e2438; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_instanceof_Promise_aedc16bc7659e950\", function() { return __wbg_instanceof_Promise_aedc16bc7659e950; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_7440491cc5e719b8\", function() { return __wbg_new_7440491cc5e719b8; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_resolve_ec1f85083faa6c47\", function() { return __wbg_resolve_ec1f85083faa6c47; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_then_f1813c1d50cb0b3d\", function() { return __wbg_then_f1813c1d50cb0b3d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_then_37317e38a820e922\", function() { return __wbg_then_37317e38a820e922; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_1a20aebd7054d9e3\", function() { return __wbg_new_1a20aebd7054d9e3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_newwithbyteoffsetandlength_50f030092954587d\", function() { return __wbg_newwithbyteoffsetandlength_50f030092954587d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_buffer_7f0f38c0fbbca6e0\", function() { return __wbg_buffer_7f0f38c0fbbca6e0; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_slice_e7bdbd0e93c5ab13\", function() { return __wbg_slice_e7bdbd0e93c5ab13; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_length_f7d8598626eb36d7\", function() { return __wbg_length_f7d8598626eb36d7; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_set_f87b1d3d2c63a317\", function() { return __wbg_set_f87b1d3d2c63a317; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_0b074655b6f45c52\", function() { return __wbg_new_0b074655b6f45c52; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_buffer_859770b344faa681\", function() { return __wbg_buffer_859770b344faa681; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_string_new\", function() { return __wbindgen_string_new; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_number_new\", function() { return __wbindgen_number_new; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_is_null\", function() { return __wbindgen_is_null; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_is_undefined\", function() { return __wbindgen_is_undefined; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_is_object\", function() { return __wbindgen_is_object; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_is_function\", function() { return __wbindgen_is_function; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_string_get\", function() { return __wbindgen_string_get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_debug_string\", function() { return __wbindgen_debug_string; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_cb_drop\", function() { return __wbindgen_cb_drop; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_cb_forget\", function() { return __wbindgen_cb_forget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_memory\", function() { return __wbindgen_memory; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_rethrow\", function() { return __wbindgen_rethrow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return __wbindgen_throw; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_closure_wrapper1618\", function() { return __wbindgen_closure_wrapper1618; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_closure_wrapper1620\", function() { return __wbindgen_closure_wrapper1620; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_closure_wrapper3105\", function() { return __wbindgen_closure_wrapper3105; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_virtualmachine_new\", function() { return __wbg_virtualmachine_new; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VirtualMachine\", function() { return VirtualMachine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vmStore\", function() { return vmStore; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_object_clone_ref\", function() { return __wbindgen_object_clone_ref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_object_drop_ref\", function() { return __wbindgen_object_drop_ref; });\n/* harmony import */ var _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rustpython_wasm_bg */ \"../lib/pkg/rustpython_wasm_bg.wasm\");\n\n\nlet cachedTextEncoder = new TextEncoder('utf-8');\n\nlet cachegetUint8Memory = null;\nfunction getUint8Memory() {\n if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint8Memory = new Uint8Array(_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint8Memory;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet passStringToWasm;\nif (typeof cachedTextEncoder.encodeInto === 'function') {\n passStringToWasm = function(arg) {\n\n if (typeof(arg) !== 'string') throw new Error('expected a string argument');\n\n let size = arg.length;\n let ptr = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_malloc\"](size);\n let writeOffset = 0;\n while (true) {\n const view = getUint8Memory().subarray(ptr + writeOffset, ptr + size);\n const { read, written } = cachedTextEncoder.encodeInto(arg, view);\n arg = arg.substring(read);\n writeOffset += written;\n if (arg.length === 0) {\n break;\n }\n ptr = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_realloc\"](ptr, size, size * 2);\n size *= 2;\n }\n WASM_VECTOR_LEN = writeOffset;\n return ptr;\n };\n} else {\n passStringToWasm = function(arg) {\n\n if (typeof(arg) !== 'string') throw new Error('expected a string argument');\n\n const buf = cachedTextEncoder.encode(arg);\n const ptr = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_malloc\"](buf.length);\n getUint8Memory().set(buf, ptr);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n };\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nfunction _assertBoolean(n) {\n if (typeof(n) !== 'boolean') {\n throw new Error('expected a boolean argument');\n }\n}\n\nconst heap = new Array(32);\n\nheap.fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nlet heap_next = heap.length;\n\nfunction dropObject(idx) {\n if (idx < 36) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nlet cachegetUint32Memory = null;\nfunction getUint32Memory() {\n if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint32Memory = new Uint32Array(_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint32Memory;\n}\n\nfunction getArrayJsValueFromWasm(ptr, len) {\n const mem = getUint32Memory();\n const slice = mem.subarray(ptr / 4, ptr / 4 + len);\n const result = [];\n for (let i = 0; i < slice.length; i++) {\n result.push(takeObject(slice[i]));\n }\n return result;\n}\n\nlet cachedGlobalArgumentPtr = null;\nfunction globalArgumentPtr() {\n if (cachedGlobalArgumentPtr === null) {\n cachedGlobalArgumentPtr = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_global_argument_ptr\"]();\n }\n return cachedGlobalArgumentPtr;\n}\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n if (typeof(heap_next) !== 'number') throw new Error('corrupt heap');\n\n heap[idx] = obj;\n return idx;\n}\n/**\n* @returns {void}\n*/\nfunction setup_console_error() {\n return _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"setup_console_error\"]();\n}\n\n/**\n* Evaluate Python code\n*\n* ```js\n* pyEval(code, options?);\n* ```\n*\n* `code`: `string`: The Python code to run\n*\n* `options`:\n*\n* - `vars?`: `{ [key: string]: any }`: Variables passed to the VM that can be\n* accessed in Python with the variable `js_vars`. Functions do work, and\n* receive the Python kwargs as the `this` argument.\n* - `stdout?`: `(out: string) => void`: A function to replace the native print\n* function, by default `console.log`.\n* @param {string} source\n* @param {any} options\n* @returns {any}\n*/\nfunction pyEval(source, options) {\n const ptr0 = passStringToWasm(source);\n const len0 = WASM_VECTOR_LEN;\n return takeObject(_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"pyEval\"](ptr0, len0, isLikeNone(options) ? 0 : addHeapObject(options)));\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8');\n\nfunction getStringFromWasm(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len));\n}\n\nfunction handleError(exnptr, e) {\n const view = getUint32Memory();\n view[exnptr / 4] = 1;\n view[exnptr / 4 + 1] = addHeapObject(e);\n}\n\nfunction __widl_f_query_selector_Document(arg0, arg1, arg2, exnptr) {\n let varg1 = getStringFromWasm(arg1, arg2);\n try {\n\n const val = getObject(arg0).querySelector(varg1);\n return isLikeNone(val) ? 0 : addHeapObject(val);\n\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_get_attribute_Element(ret, arg0, arg1, arg2) {\n let varg1 = getStringFromWasm(arg1, arg2);\n try {\n const val = getObject(arg0).getAttribute(varg1);\n const retptr = isLikeNone(val) ? [0, 0] : passStringToWasm(val);\n const retlen = WASM_VECTOR_LEN;\n const mem = getUint32Memory();\n mem[ret / 4] = retptr;\n mem[ret / 4 + 1] = retlen;\n\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __widl_f_set_attribute_Element(arg0, arg1, arg2, arg3, arg4, exnptr) {\n let varg1 = getStringFromWasm(arg1, arg2);\n let varg3 = getStringFromWasm(arg3, arg4);\n try {\n getObject(arg0).setAttribute(varg1, varg3);\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_set_Headers(arg0, arg1, arg2, arg3, arg4, exnptr) {\n let varg1 = getStringFromWasm(arg1, arg2);\n let varg3 = getStringFromWasm(arg3, arg4);\n try {\n getObject(arg0).set(varg1, varg3);\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_new_with_str_and_init_Request(arg0, arg1, arg2, exnptr) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n return addHeapObject(new Request(varg0, getObject(arg2)));\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_headers_Request(arg0) {\n try {\n return addHeapObject(getObject(arg0).headers);\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __widl_instanceof_Response(idx) { return getObject(idx) instanceof Response ? 1 : 0; }\n\nfunction __widl_f_array_buffer_Response(arg0, exnptr) {\n try {\n return addHeapObject(getObject(arg0).arrayBuffer());\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_json_Response(arg0, exnptr) {\n try {\n return addHeapObject(getObject(arg0).json());\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_text_Response(arg0, exnptr) {\n try {\n return addHeapObject(getObject(arg0).text());\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_instanceof_Window(idx) { return getObject(idx) instanceof Window ? 1 : 0; }\n\nfunction __widl_f_alert_with_message_Window(arg0, arg1, arg2, exnptr) {\n let varg1 = getStringFromWasm(arg1, arg2);\n try {\n getObject(arg0).alert(varg1);\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_cancel_animation_frame_Window(arg0, arg1, exnptr) {\n try {\n getObject(arg0).cancelAnimationFrame(arg1);\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_confirm_with_message_Window(arg0, arg1, arg2, exnptr) {\n let varg1 = getStringFromWasm(arg1, arg2);\n try {\n return getObject(arg0).confirm(varg1);\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_prompt_with_message_Window(ret, arg0, arg1, arg2, exnptr) {\n let varg1 = getStringFromWasm(arg1, arg2);\n try {\n const val = getObject(arg0).prompt(varg1);\n const retptr = isLikeNone(val) ? [0, 0] : passStringToWasm(val);\n const retlen = WASM_VECTOR_LEN;\n const mem = getUint32Memory();\n mem[ret / 4] = retptr;\n mem[ret / 4 + 1] = retlen;\n\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_prompt_with_message_and_default_Window(ret, arg0, arg1, arg2, arg3, arg4, exnptr) {\n let varg1 = getStringFromWasm(arg1, arg2);\n let varg3 = getStringFromWasm(arg3, arg4);\n try {\n const val = getObject(arg0).prompt(varg1, varg3);\n const retptr = isLikeNone(val) ? [0, 0] : passStringToWasm(val);\n const retlen = WASM_VECTOR_LEN;\n const mem = getUint32Memory();\n mem[ret / 4] = retptr;\n mem[ret / 4 + 1] = retlen;\n\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_request_animation_frame_Window(arg0, arg1, exnptr) {\n try {\n return getObject(arg0).requestAnimationFrame(getObject(arg1));\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __widl_f_document_Window(arg0) {\n try {\n\n const val = getObject(arg0).document;\n return isLikeNone(val) ? 0 : addHeapObject(val);\n\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __widl_f_fetch_with_request_Window(arg0, arg1) {\n try {\n return addHeapObject(getObject(arg0).fetch(getObject(arg1)));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __widl_f_log_(arg0) {\n try {\n console.log(...getObject(arg0));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_new_816c11756f2e51ab() {\n try {\n return addHeapObject(new Array());\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_isArray_9bff3f9d00f36da5(arg0) {\n try {\n return Array.isArray(getObject(arg0));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_push_ce2a178eef8f4483(arg0, arg1) {\n try {\n return getObject(arg0).push(getObject(arg1));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_instanceof_ArrayBuffer_7b79746f789692de(idx) { return getObject(idx) instanceof ArrayBuffer ? 1 : 0; }\n\nfunction __wbg_isView_2a8037d56f09b136(arg0) {\n try {\n return ArrayBuffer.isView(getObject(arg0));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_values_c5ff7b837b3f6830(arg0) {\n try {\n return addHeapObject(getObject(arg0).values());\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_instanceof_Error_fdac2ec12870b182(idx) { return getObject(idx) instanceof Error ? 1 : 0; }\n\nfunction __wbg_new_832d47172cff7c40(arg0, arg1) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n return addHeapObject(new Error(varg0));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_message_4e7ed1a249b8e785(arg0) {\n try {\n return addHeapObject(getObject(arg0).message);\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_name_da78b12bdfa5ceb1(arg0) {\n try {\n return addHeapObject(getObject(arg0).name);\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_toString_e8fd6ec59829ff8c(arg0) {\n try {\n return addHeapObject(getObject(arg0).toString());\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_newnoargs_b4526aa2a6db81de(arg0, arg1) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n return addHeapObject(new Function(varg0));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_apply_ccde16c927c5f8be(arg0, arg1, arg2, exnptr) {\n try {\n return addHeapObject(getObject(arg0).apply(getObject(arg1), getObject(arg2)));\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __wbg_call_a7a8823c404228ab(arg0, arg1, exnptr) {\n try {\n return addHeapObject(getObject(arg0).call(getObject(arg1)));\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __wbg_call_e6e8911c46484a33(arg0, arg1, arg2, exnptr) {\n try {\n return addHeapObject(getObject(arg0).call(getObject(arg1), getObject(arg2)));\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __wbg_next_c004b8a85ecf4b77(arg0, exnptr) {\n try {\n return addHeapObject(getObject(arg0).next());\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __wbg_done_178d004be150c0b1(arg0) {\n try {\n return getObject(arg0).done;\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_value_43d4ee3a28fa5f46(arg0) {\n try {\n return addHeapObject(getObject(arg0).value);\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_entries_f0621d88037d7e39(arg0) {\n try {\n return addHeapObject(Object.entries(getObject(arg0)));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_new_7fc81df805aaefb0() {\n try {\n return addHeapObject(new Object());\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_toString_4964e720c1c2dd0b(arg0) {\n try {\n return addHeapObject(getObject(arg0).toString());\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_new_0e18fff561c9c269(arg0, arg1) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n return addHeapObject(new ReferenceError(varg0));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_get_44104914d11d4644(arg0, arg1, exnptr) {\n try {\n return addHeapObject(Reflect.get(getObject(arg0), getObject(arg1)));\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __wbg_set_4c196bb000d34157(arg0, arg1, arg2, exnptr) {\n try {\n return Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __wbg_new_89034170295509fb(arg0, arg1) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n return addHeapObject(new SyntaxError(varg0));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_new_d558b6572c1b5235(arg0, arg1) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n return addHeapObject(new TypeError(varg0));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_parse_79a81072d7862d78(arg0, arg1, exnptr) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n return addHeapObject(JSON.parse(varg0));\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __wbg_stringify_93f1cd10368e2438(arg0, exnptr) {\n try {\n return addHeapObject(JSON.stringify(getObject(arg0)));\n } catch (e) {\n handleError(exnptr, e);\n }\n}\n\nfunction __wbg_instanceof_Promise_aedc16bc7659e950(idx) { return getObject(idx) instanceof Promise ? 1 : 0; }\n\nfunction __wbg_new_7440491cc5e719b8(arg0, arg1) {\n let cbarg0 = function(arg0, arg1) {\n let a = this.a;\n this.a = 0;\n try {\n return this.f(a, this.b, addHeapObject(arg0), addHeapObject(arg1));\n\n } finally {\n this.a = a;\n\n }\n\n };\n cbarg0.f = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_function_table\"].get(3474);\n cbarg0.a = arg0;\n cbarg0.b = arg1;\n try {\n try {\n return addHeapObject(new Promise(cbarg0.bind(cbarg0)));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n } finally {\n cbarg0.a = cbarg0.b = 0;\n\n }\n}\n\nfunction __wbg_resolve_ec1f85083faa6c47(arg0) {\n try {\n return addHeapObject(Promise.resolve(getObject(arg0)));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_then_f1813c1d50cb0b3d(arg0, arg1) {\n try {\n return addHeapObject(getObject(arg0).then(getObject(arg1)));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_then_37317e38a820e922(arg0, arg1, arg2) {\n try {\n return addHeapObject(getObject(arg0).then(getObject(arg1), getObject(arg2)));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_new_1a20aebd7054d9e3(arg0) {\n try {\n return addHeapObject(new Uint8Array(getObject(arg0)));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_newwithbyteoffsetandlength_50f030092954587d(arg0, arg1, arg2) {\n try {\n return addHeapObject(new Uint8Array(getObject(arg0), arg1, arg2));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_buffer_7f0f38c0fbbca6e0(arg0) {\n try {\n return addHeapObject(getObject(arg0).buffer);\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_slice_e7bdbd0e93c5ab13(arg0, arg1, arg2) {\n try {\n return addHeapObject(getObject(arg0).slice(arg1, arg2));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_length_f7d8598626eb36d7(arg0) {\n try {\n return getObject(arg0).length;\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_set_f87b1d3d2c63a317(arg0, arg1, arg2) {\n try {\n getObject(arg0).set(getObject(arg1), arg2);\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_new_0b074655b6f45c52(arg0, arg1) {\n let varg0 = getStringFromWasm(arg0, arg1);\n try {\n return addHeapObject(new WebAssembly.RuntimeError(varg0));\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbg_buffer_859770b344faa681(arg0) {\n try {\n return addHeapObject(getObject(arg0).buffer);\n } catch (e) {\n console.error(\"wasm-bindgen: imported JS function that was not marked as `catch` threw an error:\", e);\n throw e;\n }\n}\n\nfunction __wbindgen_string_new(p, l) { return addHeapObject(getStringFromWasm(p, l)); }\n\nfunction __wbindgen_number_new(i) { return addHeapObject(i); }\n\nfunction __wbindgen_is_null(i) { return getObject(i) === null ? 1 : 0; }\n\nfunction __wbindgen_is_undefined(i) { return getObject(i) === undefined ? 1 : 0; }\n\nfunction __wbindgen_is_object(i) {\n const val = getObject(i);\n return typeof(val) === 'object' && val !== null ? 1 : 0;\n}\n\nfunction __wbindgen_is_function(i) { return typeof(getObject(i)) === 'function' ? 1 : 0; }\n\nfunction __wbindgen_string_get(i, len_ptr) {\n let obj = getObject(i);\n if (typeof(obj) !== 'string') return 0;\n const ptr = passStringToWasm(obj);\n getUint32Memory()[len_ptr / 4] = WASM_VECTOR_LEN;\n return ptr;\n}\n\nfunction __wbindgen_debug_string(i, len_ptr) {\n const debug_str =\n val => {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debug_str(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debug_str(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\n ${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n;\nconst toString = Object.prototype.toString;\nconst val = getObject(i);\nconst debug = debug_str(val);\nconst ptr = passStringToWasm(debug);\ngetUint32Memory()[len_ptr / 4] = WASM_VECTOR_LEN;\nreturn ptr;\n}\n\nfunction __wbindgen_cb_drop(i) {\n const obj = takeObject(i).original;\n if (obj.cnt-- == 1) {\n obj.a = 0;\n return 1;\n }\n return 0;\n}\n\nconst __wbindgen_cb_forget = dropObject;\n\nfunction __wbindgen_memory() { return addHeapObject(_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"]); }\n\nfunction __wbindgen_rethrow(idx) { throw takeObject(idx); }\n\nfunction __wbindgen_throw(ptr, len) {\n throw new Error(getStringFromWasm(ptr, len));\n}\n\nfunction __wbindgen_closure_wrapper1618(a, b, _ignored) {\n const f = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_function_table\"].get(70);\n const d = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_function_table\"].get(71);\n const cb = function(arg0, arg1) {\n this.cnt++;\n let a = this.a;\n this.a = 0;\n try {\n return takeObject(f(a, b, isLikeNone(arg0) ? 0 : addHeapObject(arg0), isLikeNone(arg1) ? 0 : addHeapObject(arg1)));\n\n } finally {\n if (--this.cnt === 0) d(a, b);\n else this.a = a;\n\n }\n\n };\n cb.a = a;\n cb.cnt = 1;\n let real = cb.bind(cb);\n real.original = cb;\n return addHeapObject(real);\n}\n\nfunction _assertNum(n) {\n if (typeof(n) !== 'number') throw new Error('expected a number argument');\n}\n\nfunction __wbindgen_closure_wrapper1620(a, b, _ignored) {\n const f = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_function_table\"].get(68);\n const d = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_function_table\"].get(69);\n const cb = function(arg0) {\n this.cnt++;\n _assertNum(arg0);\n try {\n return f(this.a, b, arg0);\n\n } finally {\n if (--this.cnt === 0) { d(this.a, b); this.a = 0; }\n\n }\n\n};\ncb.a = a;\ncb.cnt = 1;\nlet real = cb.bind(cb);\nreal.original = cb;\nreturn addHeapObject(real);\n}\n\nfunction __wbindgen_closure_wrapper3105(a, b, _ignored) {\n const f = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_function_table\"].get(149);\n const d = _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_function_table\"].get(150);\n const cb = function(arg0) {\n this.cnt++;\n let a = this.a;\n this.a = 0;\n try {\n return f(a, b, addHeapObject(arg0));\n\n } finally {\n if (--this.cnt === 0) d(a, b);\n else this.a = a;\n\n }\n\n };\n cb.a = a;\n cb.cnt = 1;\n let real = cb.bind(cb);\n real.original = cb;\n return addHeapObject(real);\n}\n\nfunction __wbg_virtualmachine_new(ptr) { return addHeapObject(VirtualMachine.__wrap(ptr)); }\n\nfunction freeVirtualMachine(ptr) {\n\n _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_virtualmachine_free\"](ptr);\n}\n/**\n*/\nclass VirtualMachine {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n static __wrap(ptr) {\n const obj = Object.create(VirtualMachine.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n freeVirtualMachine(ptr);\n }\n\n /**\n * @returns {boolean}\n */\n valid() {\n if (this.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n return (_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"virtualmachine_valid\"](this.ptr)) !== 0;\n }\n /**\n * @returns {void}\n */\n assert_valid() {\n if (this.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n return _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"virtualmachine_assert_valid\"](this.ptr);\n }\n /**\n * @returns {void}\n */\n destroy() {\n if (this.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n return _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"virtualmachine_destroy\"](this.ptr);\n }\n /**\n * @param {string} name\n * @param {any} value\n * @returns {void}\n */\n addToScope(name, value) {\n if (this.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = passStringToWasm(name);\n const len0 = WASM_VECTOR_LEN;\n return _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"virtualmachine_addToScope\"](this.ptr, ptr0, len0, addHeapObject(value));\n }\n /**\n * @param {any} stdout\n * @returns {void}\n */\n setStdout(stdout) {\n if (this.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n return _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"virtualmachine_setStdout\"](this.ptr, addHeapObject(stdout));\n }\n /**\n * @param {string} name\n * @param {any} module\n * @returns {void}\n */\n injectModule(name, module) {\n if (this.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = passStringToWasm(name);\n const len0 = WASM_VECTOR_LEN;\n return _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"virtualmachine_injectModule\"](this.ptr, ptr0, len0, addHeapObject(module));\n }\n /**\n * @param {string} source\n * @returns {any}\n */\n exec(source) {\n if (this.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = passStringToWasm(source);\n const len0 = WASM_VECTOR_LEN;\n return takeObject(_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"virtualmachine_exec\"](this.ptr, ptr0, len0));\n }\n /**\n * @param {string} source\n * @returns {any}\n */\n eval(source) {\n if (this.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = passStringToWasm(source);\n const len0 = WASM_VECTOR_LEN;\n return takeObject(_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"virtualmachine_eval\"](this.ptr, ptr0, len0));\n }\n /**\n * @param {string} source\n * @returns {any}\n */\n execSingle(source) {\n if (this.ptr === 0) {\n throw new Error('Attempt to use a moved value');\n }\n const ptr0 = passStringToWasm(source);\n const len0 = WASM_VECTOR_LEN;\n return takeObject(_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"virtualmachine_execSingle\"](this.ptr, ptr0, len0));\n }\n}\n\nfunction freevmStore(ptr) {\n\n _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbg_vmstore_free\"](ptr);\n}\n/**\n*/\nclass vmStore {\n\n constructor() {\n throw new Error('cannot invoke `new` directly');\n }\n\n free() {\n const ptr = this.ptr;\n this.ptr = 0;\n freevmStore(ptr);\n }\n\n /**\n * @param {string} id\n * @param {boolean | undefined} inject_browser_module\n * @returns {VirtualMachine}\n */\n static init(id, inject_browser_module) {\n const ptr0 = passStringToWasm(id);\n const len0 = WASM_VECTOR_LEN;\n\n if (!isLikeNone(inject_browser_module)) {\n _assertBoolean(inject_browser_module);\n }\n\n return VirtualMachine.__wrap(_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"vmstore_init\"](ptr0, len0, isLikeNone(inject_browser_module) ? 0xFFFFFF : inject_browser_module ? 1 : 0));\n }\n /**\n * @param {string} id\n * @returns {any}\n */\n static get(id) {\n const ptr0 = passStringToWasm(id);\n const len0 = WASM_VECTOR_LEN;\n return takeObject(_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"vmstore_get\"](ptr0, len0));\n }\n /**\n * @param {string} id\n * @returns {void}\n */\n static destroy(id) {\n const ptr0 = passStringToWasm(id);\n const len0 = WASM_VECTOR_LEN;\n return _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"vmstore_destroy\"](ptr0, len0);\n }\n /**\n * @returns {any[]}\n */\n static ids() {\n const retptr = globalArgumentPtr();\n _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"vmstore_ids\"](retptr);\n const mem = getUint32Memory();\n const rustptr = mem[retptr / 4];\n const rustlen = mem[retptr / 4 + 1];\n\n const realRet = getArrayJsValueFromWasm(rustptr, rustlen).slice();\n _rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_free\"](rustptr, rustlen * 4);\n return realRet;\n\n }\n}\n\nfunction __wbindgen_object_clone_ref(idx) {\n return addHeapObject(getObject(idx));\n}\n\nfunction __wbindgen_object_drop_ref(i) { dropObject(i); }\n\n_rustpython_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"__wbindgen_start\"]();\n\n\n\n//# sourceURL=webpack:///../lib/pkg/rustpython_wasm.js?");
/***/ }),
/***/ "../lib/pkg/rustpython_wasm_bg.wasm":
/*!******************************************!*\
!*** ../lib/pkg/rustpython_wasm_bg.wasm ***!
\******************************************/
/*! exports provided: memory, __rustc_debug_gdb_scripts_section__, __wbg_vmstore_free, vmstore_init, vmstore_get, vmstore_destroy, vmstore_ids, __wbg_virtualmachine_free, virtualmachine_valid, virtualmachine_assert_valid, virtualmachine_destroy, virtualmachine_addToScope, virtualmachine_setStdout, virtualmachine_injectModule, virtualmachine_exec, virtualmachine_eval, virtualmachine_execSingle, setup_console_error, pyEval, __wbindgen_global_argument_ptr, atou8_range, atou16_range, atou32_range, atou64_range, atou128_range, atousize_range, atoi8_range, atoi16_range, atoi32_range, atoi64_range, atoi128_range, atoisize_range, try_atou8_range, try_atou16_range, try_atou32_range, try_atou64_range, try_atou128_range, try_atousize_range, try_atoi8_range, try_atoi16_range, try_atoi32_range, try_atoi64_range, try_atoi128_range, try_atoisize_range, u8toa_range, u16toa_range, u32toa_range, u64toa_range, u128toa_range, usizetoa_range, i8toa_range, i16toa_range, i32toa_range, i64toa_range, i128toa_range, isizetoa_range, get_nan_string_ffi, set_nan_string_ffi, get_inf_string_ffi, set_inf_string_ffi, get_infinity_string_ffi, set_infinity_string_ffi, EXPONENT_DEFAULT_CHAR, MAX_I8_SIZE_FFI, MAX_I16_SIZE_FFI, MAX_I32_SIZE_FFI, MAX_I64_SIZE_FFI, MAX_I128_SIZE_FFI, MAX_ISIZE_SIZE_FFI, MAX_U8_SIZE_FFI, MAX_U16_SIZE_FFI, MAX_U32_SIZE_FFI, MAX_U64_SIZE_FFI, MAX_U128_SIZE_FFI, MAX_USIZE_SIZE_FFI, MAX_F32_SIZE_FFI, MAX_F64_SIZE_FFI, BUFFER_SIZE_FFI, is_success, is_overflow, is_invalid_digit, is_empty, atof32_range, atof64_range, atof32_lossy_range, atof64_lossy_range, try_atof32_range, try_atof64_range, try_atof32_lossy_range, try_atof64_lossy_range, f32toa_range, f64toa_range, __wbindgen_malloc, __wbindgen_realloc, __wbindgen_free, __wbindgen_start, __wbg_function_table */
/***/ (function(module, exports, __webpack_require__) {
eval("\"use strict\";\n// Instantiate WebAssembly module\nvar wasmExports = __webpack_require__.w[module.i];\n__webpack_require__.r(exports);\n// export exports from WebAssembly module\nfor(var name in wasmExports) if(name != \"__webpack_init__\") exports[name] = wasmExports[name];\n// exec imports from WebAssembly module (for esm order)\n/* harmony import */ var m0 = __webpack_require__(/*! ./rustpython_wasm */ \"../lib/pkg/rustpython_wasm.js\");\n\n\n// exec wasm module\nwasmExports[\"__webpack_init__\"]()\n\n//# sourceURL=webpack:///../lib/pkg/rustpython_wasm_bg.wasm?");
/***/ }),
/***/ "./src/main.js":
/*!*********************!*\
!*** ./src/main.js ***!
\*********************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lib_pkg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../lib/pkg */ \"../lib/pkg/rustpython_wasm.js\");\n/* harmony import */ var xterm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! xterm */ \"./node_modules/xterm/lib/public/Terminal.js\");\n/* harmony import */ var xterm__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(xterm__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var xterm_lib_addons_fit_fit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! xterm/lib/addons/fit/fit */ \"./node_modules/xterm/lib/addons/fit/fit.js\");\n/* harmony import */ var xterm_lib_addons_fit_fit__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(xterm_lib_addons_fit_fit__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\n\n// so people can play around with it\nwindow.rp = _lib_pkg__WEBPACK_IMPORTED_MODULE_0__;\n\nconst prompt = '>>>>> ';\n\nxterm__WEBPACK_IMPORTED_MODULE_1__[\"Terminal\"].applyAddon(xterm_lib_addons_fit_fit__WEBPACK_IMPORTED_MODULE_2__);\nconst term = new xterm__WEBPACK_IMPORTED_MODULE_1__[\"Terminal\"]();\nterm.open(document.getElementById('terminal'));\nterm.fit();\nterm.write(prompt);\n\nfunction removeNonAscii(str) {\n if (str === null || str === '') return false;\n else str = str.toString();\n\n return str.replace(/[^\\x20-\\x7E]/g, '');\n}\n\nfunction printToConsole(data) {\n term.write(removeNonAscii(data) + '\\r\\n');\n}\n\nconst terminalVM = _lib_pkg__WEBPACK_IMPORTED_MODULE_0__[\"vmStore\"].init('term_vm');\nterminalVM.setStdout(printToConsole);\n\nvar input = '';\nterm.on('data', data => {\n const code = data.charCodeAt(0);\n if (code == 13) {\n // CR\n if (input[input.length - 1] == ':') {\n input += data;\n term.write('\\r\\n.....');\n } else {\n term.write('\\r\\n');\n try {\n terminalVM.execSingle(input);\n } catch (err) {\n if (err instanceof WebAssembly.RuntimeError) {\n err = window.__RUSTPYTHON_ERROR || err;\n }\n printToConsole(err);\n }\n term.write(prompt);\n input = '';\n }\n } else if (code == 127) {\n if (input.length > 0) {\n term.write('\\b \\b');\n input = input.slice(0, -1);\n }\n } else if (code < 32 || code == 127) {\n // Control\n return;\n } else {\n // Visible\n term.write(data);\n input += data;\n }\n});\n\nwindow.addEventListener('resize', () => {\n term.fit();\n});\n\n\n//# sourceURL=webpack:///./src/main.js?");
/***/ })
}]);