From 6ddd131788f2eb4580d70de4c867b3c7e5db0823 Mon Sep 17 00:00:00 2001 From: Tom Kazimiers Date: Thu, 16 Jan 2025 16:13:30 +0100 Subject: [PATCH] Add sharding support for Neuroglancer Precomputed tile source The Rust/WASM implementation fo tile source 14 supports sharded datasets now. The changes of this commit make the client side in CATMAID work with these changes. Some additional improvements are included, too: parallel loading of non-sharded blocks and prefetching data into the block cache with batch support. --- .travis.jshintexpected | 36 +- CHANGELOG.md | 4 +- .../catmaid/static/js/image-block.js | 51 +- .../js/layers/pixi-image-block-layer.js | 39 +- .../catmaid/static/js/tile-source.js | 105 +- .../static/libs/ngpre-wasm/ngpre_wasm.js | 4216 +++++++++-------- .../libs/ngpre-wasm/ngpre_wasm_worker.js | 77 +- 7 files changed, 2591 insertions(+), 1937 deletions(-) diff --git a/.travis.jshintexpected b/.travis.jshintexpected index 20a8df14b2..60592a5bc4 100644 --- a/.travis.jshintexpected +++ b/.travis.jshintexpected @@ -150,8 +150,34 @@ django/applications/catmaid/static/libs/catmaid/time-series.js: line 19, col 12, django/applications/catmaid/static/libs/catmaid/volumes.js: line 613, col 9, 'abs' is defined but never used. django/applications/catmaid/static/libs/catmaid/volumes.js: line 805, col 15, 'dSimplicesT' is defined but never used. -django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 1817, col 1, 'async functions' is only available in ES8 (use 'esversion: 8'). -django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 1850, col 1, 'async functions' is only available in ES8 (use 'esversion: 8'). -django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2009, col 29, The object literal notation {} is preferable. - -115 errors +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 8, col 9, It's not necessary to initialize 'wasm' to 'undefined'. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 35, col 188, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 37, col 76, Unnecessary semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 55, col 154, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 137, col 67, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 1942, col 5, 'async functions' is only available in ES8 (use 'esversion: 8'). +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 1979, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 1987, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 1991, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2007, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2026, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2030, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2118, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2131, col 34, The array literal notation [] is preferable. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2157, col 35, The object literal notation {} is preferable. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2171, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2175, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2226, col 22, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2333, col 35, Invalid typeof value 'bigint' +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2371, col 49, Invalid typeof value 'bigint' +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2469, col 36, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2471, col 107, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2488, col 5, 'async functions' is only available in ES8 (use 'esversion: 8'). +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2494, col 52, Missing semicolon. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js: line 2496, col 122, Missing semicolon. + +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm_worker.js: line 28, col 43, 'use_cache' is defined but never used. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm_worker.js: line 57, col 43, 'use_cache' is defined but never used. +django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm_worker.js: line 57, col 54, '_' is defined but never used. + +140 errors diff --git a/CHANGELOG.md b/CHANGELOG.md index a6b272a0f4..29a6ca7e5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -634,8 +634,8 @@ Data sources: - A new tile source has been added: Neuroglancer Precomputed data, with ID 14. This image block source works very similar to the N5 tile source. At the - moment only non-compressed and non-sharded image volumes are supported. In - order for the voxel space coordinates to match between CATMAID and + moment only GZip and JPEG compression is supported. Sharded datasets can be + loaded. In order for the voxel space coordinates to match between CATMAID and Neuroglancer, if the Neuroglancer dataset defines a voxel offset, the respective CATMAID stack needs to have its zoom-level zero voxel offset defined in the stack meta data in the admin view, e.g. `{"voxelOffset": diff --git a/django/applications/catmaid/static/js/image-block.js b/django/applications/catmaid/static/js/image-block.js index f6cea20244..476d342619 100644 --- a/django/applications/catmaid/static/js/image-block.js +++ b/django/applications/catmaid/static/js/image-block.js @@ -35,12 +35,59 @@ CATMAID.asEventSource(this); this.queue = new CATMAID.MultiQueueDispatcher( - coord => this.readBlock(...coord), + this.source.prefersCombinedRequests() ? + // Assume same zoom level + coords => this.readBlocks(coords[0][0], coords) : + coord => this.readBlock(...coord), 4, - () => this._deduper.pending() + () => this._deduper.pending(), + this.source.prefersCombinedRequests(), + // Filter function that will only allow set requests of same zoom level + // as last coord in queue. + (coord, i, coords) => coord[0] === coords[coords.length - 1][0] ); } + readBlocks(zoomLevel, blockCoords) { + if (!CATMAID.tools.isFn(this.source.readBlocks)) { + return Promise.resolve([]); + } + + // Drop all block coords that are available from the cache already + const blockKeys = new Map(); + const uncachedBlocks = blockCoords.map(coord => { + const blockKey = [coord[0], coord[1], coord[2], coord[3]].join('/'); + blockKeys.set(blockKey, coord); + return blockKey; + }).filter(blockKey => { + return !this._cache.has(blockKey); + }); + + // Drop all block coords that are currently requested + let blockPromise = this._deduper.dedup_many( + uncachedBlocks, + (keysToRequest) => { + const coordsToRequest = keysToRequest.map(k => blockKeys.get(k)); + return this.source.readBlocks(zoomLevel, coordsToRequest); + }, + (blockData, key) => { + let [z, c1, c2, c3] = key.split('/'); + return blockData.find(b => z == zoomLevel && b.gridPosition[0] == c1 + && b.gridPosition[1] == c2 && b.gridPosition[2] == c3); + }); + + return blockPromise + .then(block_data => { + for (let {block, etag, gridPosition} of block_data) { + if (!block || !etag || !gridPosition) continue; + let blockKey = [zoomLevel, ...gridPosition].join('/'); + this._stateIDs.set(blockKey, etag); + this._cache.set(blockKey, block); + } + return block_data; + }); + } + readBlock(...zoomBlockCoord) { let blockKey = zoomBlockCoord.join('/'); let block = this._cache.get(blockKey); diff --git a/django/applications/catmaid/static/js/layers/pixi-image-block-layer.js b/django/applications/catmaid/static/js/layers/pixi-image-block-layer.js index d8d8fbcdf4..b3862ca5ad 100644 --- a/django/applications/catmaid/static/js/layers/pixi-image-block-layer.js +++ b/django/applications/catmaid/static/js/layers/pixi-image-block-layer.js @@ -327,20 +327,29 @@ // immediately, so that the buffer will be cleared. window.clearTimeout(this._swapBuffersTimeout); this._swapBuffersTimeout = window.setTimeout(this._swapBuffers.bind(this, true), 3000); - Promise.all(toLoad.map(([[i, j], coord]) => this - ._readBlock(...coord.slice(0, 4)) - .then(block => { - if (this._context.renderer === null) return; // Layer was destroyed. - if (!this._tilesBuffer || !this._tilesBuffer[i] || !this._tilesBuffer[i][j] || - !CATMAID.tools.arraysEqual(this._tilesBuffer[i][j].coord, coord)) return; - let slice = this._sliceBlock(block, blockZ); - - this._sliceToTexture(slice, this._tilesBuffer[i][j].texture); - this._tilesBuffer[i][j].coord = coord; - this._tilesBuffer[i][j].loaded = true; - }) - )).then(this._swapBuffers.bind(this, false, this._swapBuffersTimeout)); + // Attempt to get entire data for view at the same time and populate + // cache with it. This is usually much faster with sharded data. For + // non-sharded data, it is faster to skip this step at the moment. + let prepare = this.tileSource.prefersCombinedRequests() ? + this._populateCache(tileInfo.zoom, toLoad.map(x => x[1])) : + Promise.resolve([]); + prepare.then(() => { + Promise.all(toLoad.map(([[i, j], coord]) => this + ._readBlock(...coord.slice(0, 4)) + .then(block => { + if (this._context.renderer === null) return; // Layer was destroyed. + if (!this._tilesBuffer || !this._tilesBuffer[i] || !this._tilesBuffer[i][j] || + !CATMAID.tools.arraysEqual(this._tilesBuffer[i][j].coord, coord)) return; + + let slice = this._sliceBlock(block, blockZ); + + this._sliceToTexture(slice, this._tilesBuffer[i][j].texture); + this._tilesBuffer[i][j].coord = coord; + this._tilesBuffer[i][j].loaded = true; + }) + )).then(this._swapBuffers.bind(this, false, this._swapBuffersTimeout)); + }); loading = true; } else if (!loading) { this._oldZoom = this._swapZoom; @@ -361,6 +370,10 @@ } } + _populateCache(zoomLevel, locations) { + return this._blockCache.readBlocks(zoomLevel, locations); + } + _readBlock(zoomLevel, x, y, z) { let blockCoord = CATMAID.tools.permute([x, y, z], this.recipDimPerm); diff --git a/django/applications/catmaid/static/js/tile-source.js b/django/applications/catmaid/static/js/tile-source.js index f02cb45d8e..415920c044 100644 --- a/django/applications/catmaid/static/js/tile-source.js +++ b/django/applications/catmaid/static/js/tile-source.js @@ -579,6 +579,14 @@ readBlock(zoomLevel, xi, yi, zi) { throw new CATMAID.NotImplementedError(); } + + /** + * Whether or not it can be benefitial to combine multiple block requests + * into a single one. This can be the case e.g. for sharded data. + */ + prefersCombinedRequests() { + return false; + } }; @@ -1026,7 +1034,9 @@ this.promiseNeuroglancerPrecomputedwasm = (new Function(`return import('${jsPath}')`))() .then(module => // The global ngpre_wasm variable is created in ngpre_wasm.js - ngpre_wasm(CATMAID.makeStaticURL('libs/ngpre-wasm/ngpre_wasm_bg.wasm')) + ngpre_wasm({ + module_or_path: CATMAID.makeStaticURL('libs/ngpre-wasm/ngpre_wasm_bg.wasm'), + }) .then(() => ngpre_wasm)); } @@ -1142,6 +1152,41 @@ }); } + readBlocks(zoomLevel, blockCoords) { + return this.promiseReady.then(() => { + let path = this.datasetPath(zoomLevel); + let dataAttrs = this.datasetAttributes; + + if (blockCoords.length === 0) { + return []; + } + + const gridCoords = blockCoords.map(coord => coord.slice(1,4).map(BigInt)).flat(); + return this.reader.read_blocks_with_etag(path, dataAttrs, gridCoords); + }).then(block_data => { + let desBlocks = new Array(block_data.length); + for (let i=0; i { let rn = n; n *= s; return rn; }); + desBlocks[i] = { + etag, + block: new nj.NdArray(nj.ndarray(block.into_data(), size, stride)) + .transpose(...this.sliceDims), + gridPosition, + }; + } else { + desBlocks[i] = {block, etag: undefined, gridPosition: undefined}; + } + } + return desBlocks; + }); + } + datasetPath(zoomLevel) { return this.datasetPathFormat .replace('%SCALE_DATASET%', this.scaleLevelPath(zoomLevel)); @@ -1184,6 +1229,14 @@ corsTime: result[1][1] }))); } + + /** + * The Neuroglancer WASM implementation supports downloading multiple blocks + * in parallel. + */ + prefersCombinedRequests() { + return true; + } }; /** @@ -1239,6 +1292,56 @@ }); }); } + + readBlocks(zoomLevel, blockCoords) { + return this.promiseReady.then(() => { + let path = this.datasetPath(zoomLevel); + let dataAttrs = this.datasetAttributes; + + if (blockCoords.length === 0) { + return []; + } + + // Flatten input grid coords (needed for wasm-bindgen) + const gridCoords = blockCoords.map(coord => coord.slice(1,4).map(BigInt)).flat(); + // FIXME: Optionally, run bundle downloads in separate web workers. This + // seems currently slower and might not be worthwile afterall, because + // all block requests in a single call to WASM will be executed in + // parallel already. + let bundleRequests = false; + let request_block_data = bundleRequests ? + this.workers + .postMessage([path, dataAttrs.to_json(), gridCoords, true, true]) + .then(bundles => { + return Promise.all(bundles.map(bundle => { + return bundle && bundle.length > 0 ? + this.workers.postMessage([path, dataAttrs.to_json(), bundle.flat(), true]) : + []; + })); + }) : + this.workers.postMessage([path, dataAttrs.to_json(), gridCoords, true]).then(block_data => [block_data]); + + return request_block_data + .then(bundled_block_data => { + return bundled_block_data.map(block_data => { + return block_data.map(block => { + if (block) { + let n = 1; + let stride = block.size.map(s => { let rn = n; n *= s; return rn; }); + return { + etag: block.etag, + block: new nj.NdArray(nj.ndarray(block.data, block.size, stride)) + .transpose(...this.sliceDims), + gridPosition: block.gridPosition, + }; + } else { + return {block, etag: undefined, gridPosition: undefined}; + } + }); + }).flat(); + }); + }); + } }; /** diff --git a/django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js b/django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js index 6e46affa84..e1f61be0ef 100644 --- a/django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js +++ b/django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm.js @@ -1,2129 +1,2519 @@ let wasm_bindgen; (function() { const __exports = {}; - let wasm; + let script_src; + if (typeof document !== 'undefined' && document.currentScript !== null) { + script_src = new URL(document.currentScript.src, location.href).toString(); + } + let wasm = undefined; - const heap = new Array(32).fill(undefined); + const heap = new Array(128).fill(undefined); heap.push(undefined, null, true, false); -function getObject(idx) { return heap[idx]; } - -let heap_next = heap.length; + function getObject(idx) { return heap[idx]; } -function dropObject(idx) { - if (idx < 36) return; - heap[idx] = heap_next; - heap_next = idx; -} + let heap_next = heap.length; -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} + function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; -let WASM_VECTOR_LEN = 0; - -let cachegetUint8Memory0 = null; -function getUint8Memory0() { - if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { - cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); - } - return cachegetUint8Memory0; -} - -let cachedTextEncoder = new TextEncoder('utf-8'); - -const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' - ? function (arg, view) { - return cachedTextEncoder.encodeInto(arg, view); -} - : function (arg, view) { - const buf = cachedTextEncoder.encode(arg); - view.set(buf); - return { - read: arg.length, - written: buf.length - }; -}); - -function passStringToWasm0(arg, malloc, realloc) { - - if (realloc === undefined) { - const buf = cachedTextEncoder.encode(arg); - const ptr = malloc(buf.length); - getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); - WASM_VECTOR_LEN = buf.length; - return ptr; + heap[idx] = obj; + return idx; } - let len = arg.length; - let ptr = malloc(len); + function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + wasm.__wbindgen_exn_store(addHeapObject(e)); + } + } - const mem = getUint8Memory0(); + const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); - let offset = 0; + if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; - for (; offset < len; offset++) { - const code = arg.charCodeAt(offset); - if (code > 0x7F) break; - mem[ptr + offset] = code; - } + let cachedUint8ArrayMemory0 = null; - if (offset !== len) { - if (offset !== 0) { - arg = arg.slice(offset); + function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); } - ptr = realloc(ptr, len, len = offset + arg.length * 3); - const view = getUint8Memory0().subarray(ptr + offset, ptr + len); - const ret = encodeString(arg, view); + return cachedUint8ArrayMemory0; + } - offset += ret.written; + function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); } - WASM_VECTOR_LEN = offset; - return ptr; -} + let WASM_VECTOR_LEN = 0; + + const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); -let cachegetInt32Memory0 = null; -function getInt32Memory0() { - if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) { - cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer); + const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); } - return cachegetInt32Memory0; -} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; + }); -let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + function passStringToWasm0(arg, malloc, realloc) { -cachedTextDecoder.decode(); + 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; + } -function getStringFromWasm0(ptr, len) { - return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); -} + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; -function addHeapObject(obj) { - if (heap_next === heap.length) heap.push(heap.length + 1); - const idx = heap_next; - heap_next = heap[idx]; + const mem = getUint8ArrayMemory0(); - heap[idx] = obj; - return idx; -} + let offset = 0; -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})`; + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; } - } - if (type == 'function') { - const name = val.name; - if (typeof name == 'string' && name.length > 0) { - return `Function(${name})`; - } else { - return 'Function'; + + 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 = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; } + + WASM_VECTOR_LEN = offset; + return ptr; } - // 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.length > 1) { - className = builtInMatches[1]; - } else { - // Failed to match the standard '[object ClassName]' - return toString.call(val); + + function isLikeNone(x) { + return x === undefined || x === null; } - 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'; + + 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; } - // errors - if (val instanceof Error) { - return `${val.name}: ${val.message}\n${val.stack}`; + + function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; } - // TODO we could test for more things here, like `Set`s and `Map`s. - return className; -} - -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 { - if (--state.cnt === 0) { - wasm.__wbindgen_export_2.get(state.dtor)(a, state.b); - } else { - state.a = a; - } - } - }; - real.original = state; + function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; + } - return real; -} -function __wbg_adapter_24(arg0, arg1, arg2) { - wasm.wasm_bindgen__convert__closures__invoke1_mut__h6d341b92f1d02704(arg0, arg1, addHeapObject(arg2)); -} + const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(state => { + wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b) + }); -function handleError(f) { - return function () { - try { - return f.apply(this, arguments); + 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 { + if (--state.cnt === 0) { + wasm.__wbindgen_export_3.get(state.dtor)(a, state.b); + CLOSURE_DTORS.unregister(state); + } else { + state.a = a; + } + } + }; + real.original = state; + CLOSURE_DTORS.register(real, state, state); + return real; + } - } catch (e) { - wasm.__wbindgen_exn_store(addHeapObject(e)); + function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; } - }; -} -function __wbg_adapter_39(arg0, arg1, arg2, arg3) { - wasm.wasm_bindgen__convert__closures__invoke2_mut__h06f37eb52c7a14c7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); -} - -let cachegetUint64Memory0 = null; -function getUint64Memory0() { - if (cachegetUint64Memory0 === null || cachegetUint64Memory0.buffer !== wasm.memory.buffer) { - cachegetUint64Memory0 = new BigUint64Array(wasm.memory.buffer); + 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; } - return cachegetUint64Memory0; -} -function getArrayU64FromWasm0(ptr, len) { - return getUint64Memory0().subarray(ptr / 8, ptr / 8 + len); -} - -let cachegetUint32Memory0 = null; -function getUint32Memory0() { - if (cachegetUint32Memory0 === null || cachegetUint32Memory0.buffer !== wasm.memory.buffer) { - cachegetUint32Memory0 = new Uint32Array(wasm.memory.buffer); + function _assertClass(instance, klass) { + if (!(instance instanceof klass)) { + throw new Error(`expected instance of ${klass.name}`); + } } - return cachegetUint32Memory0; -} -function getArrayU32FromWasm0(ptr, len) { - return getUint32Memory0().subarray(ptr / 4, ptr / 4 + len); -} + let cachedBigUint64ArrayMemory0 = null; -function getArrayI32FromWasm0(ptr, len) { - return getInt32Memory0().subarray(ptr / 4, ptr / 4 + len); -} + function getBigUint64ArrayMemory0() { + if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) { + cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer); + } + return cachedBigUint64ArrayMemory0; + } -let stack_pointer = 32; + function passArray64ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 8, 8) >>> 0; + getBigUint64ArrayMemory0().set(arg, ptr / 8); + WASM_VECTOR_LEN = arg.length; + return ptr; + } -function addBorrowedObject(obj) { - if (stack_pointer == 1) throw new Error('out of js stack'); - heap[--stack_pointer] = obj; - return stack_pointer; -} + let cachedUint32ArrayMemory0 = null; -function _assertClass(instance, klass) { - if (!(instance instanceof klass)) { - throw new Error(`expected instance of ${klass.name}`); - } - return instance.ptr; -} - -function passArray64ToWasm0(arg, malloc) { - const ptr = malloc(arg.length * 8); - getUint64Memory0().set(arg, ptr / 8); - WASM_VECTOR_LEN = arg.length; - return ptr; -} - -function getArrayU8FromWasm0(ptr, len) { - return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len); -} - -let cachegetUint16Memory0 = null; -function getUint16Memory0() { - if (cachegetUint16Memory0 === null || cachegetUint16Memory0.buffer !== wasm.memory.buffer) { - cachegetUint16Memory0 = new Uint16Array(wasm.memory.buffer); + function getUint32ArrayMemory0() { + if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) { + cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer); + } + return cachedUint32ArrayMemory0; } - return cachegetUint16Memory0; -} -function getArrayU16FromWasm0(ptr, len) { - return getUint16Memory0().subarray(ptr / 2, ptr / 2 + len); -} - -let cachegetInt8Memory0 = null; -function getInt8Memory0() { - if (cachegetInt8Memory0 === null || cachegetInt8Memory0.buffer !== wasm.memory.buffer) { - cachegetInt8Memory0 = new Int8Array(wasm.memory.buffer); + function getArrayU32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); } - return cachegetInt8Memory0; -} -function getArrayI8FromWasm0(ptr, len) { - return getInt8Memory0().subarray(ptr / 1, ptr / 1 + len); -} + function getArrayU64FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getBigUint64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len); + } -let cachegetInt16Memory0 = null; -function getInt16Memory0() { - if (cachegetInt16Memory0 === null || cachegetInt16Memory0.buffer !== wasm.memory.buffer) { - cachegetInt16Memory0 = new Int16Array(wasm.memory.buffer); + function getArrayU8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); } - return cachegetInt16Memory0; -} -function getArrayI16FromWasm0(ptr, len) { - return getInt16Memory0().subarray(ptr / 2, ptr / 2 + len); -} + let cachedUint16ArrayMemory0 = null; -let cachegetInt64Memory0 = null; -function getInt64Memory0() { - if (cachegetInt64Memory0 === null || cachegetInt64Memory0.buffer !== wasm.memory.buffer) { - cachegetInt64Memory0 = new BigInt64Array(wasm.memory.buffer); + function getUint16ArrayMemory0() { + if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.byteLength === 0) { + cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer); + } + return cachedUint16ArrayMemory0; } - return cachegetInt64Memory0; -} - -function getArrayI64FromWasm0(ptr, len) { - return getInt64Memory0().subarray(ptr / 8, ptr / 8 + len); -} -let cachegetFloat32Memory0 = null; -function getFloat32Memory0() { - if (cachegetFloat32Memory0 === null || cachegetFloat32Memory0.buffer !== wasm.memory.buffer) { - cachegetFloat32Memory0 = new Float32Array(wasm.memory.buffer); + function getArrayU16FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getUint16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len); } - return cachegetFloat32Memory0; -} -function getArrayF32FromWasm0(ptr, len) { - return getFloat32Memory0().subarray(ptr / 4, ptr / 4 + len); -} + let cachedInt8ArrayMemory0 = null; -let cachegetFloat64Memory0 = null; -function getFloat64Memory0() { - if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) { - cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer); + function getInt8ArrayMemory0() { + if (cachedInt8ArrayMemory0 === null || cachedInt8ArrayMemory0.byteLength === 0) { + cachedInt8ArrayMemory0 = new Int8Array(wasm.memory.buffer); + } + return cachedInt8ArrayMemory0; } - return cachegetFloat64Memory0; -} -function getArrayF64FromWasm0(ptr, len) { - return getFloat64Memory0().subarray(ptr / 8, ptr / 8 + len); -} + function getArrayI8FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); + } -function isLikeNone(x) { - return x === undefined || x === null; -} -/** -*/ -class DatasetAttributes { + let cachedInt16ArrayMemory0 = null; - static __wrap(ptr) { - const obj = Object.create(DatasetAttributes.prototype); - obj.ptr = ptr; + function getInt16ArrayMemory0() { + if (cachedInt16ArrayMemory0 === null || cachedInt16ArrayMemory0.byteLength === 0) { + cachedInt16ArrayMemory0 = new Int16Array(wasm.memory.buffer); + } + return cachedInt16ArrayMemory0; + } - return obj; + function getArrayI16FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt16ArrayMemory0().subarray(ptr / 2, ptr / 2 + len); } - free() { - const ptr = this.ptr; - this.ptr = 0; + let cachedInt32ArrayMemory0 = null; - wasm.__wbg_datasetattributes_free(ptr); - } - /** - * @param {number} zoom_level - * @returns {BigUint64Array} - */ - get_dimensions(zoom_level) { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.datasetattributes_get_dimensions(retptr, this.ptr, zoom_level); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + function getInt32ArrayMemory0() { + if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) { + cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer); } + return cachedInt32ArrayMemory0; } - /** - * @param {number} zoom_level - * @returns {Uint32Array} - */ - get_block_size(zoom_level) { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.datasetattributes_get_block_size(retptr, this.ptr, zoom_level); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; - } + + function getArrayI32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); } - /** - * @param {number} zoom_level - * @returns {Int32Array} - */ - get_voxel_offset(zoom_level) { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.datasetattributes_get_voxel_offset(retptr, this.ptr, zoom_level); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayI32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + let cachedBigInt64ArrayMemory0 = null; + + function getBigInt64ArrayMemory0() { + if (cachedBigInt64ArrayMemory0 === null || cachedBigInt64ArrayMemory0.byteLength === 0) { + cachedBigInt64ArrayMemory0 = new BigInt64Array(wasm.memory.buffer); } + return cachedBigInt64ArrayMemory0; } - /** - * @returns {string} - */ - get_data_type() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.datasetattributes_get_data_type(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_export_6.value += 16; - wasm.__wbindgen_free(r0, r1); - } + + function getArrayI64FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getBigInt64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len); } - /** - * @returns {string} - */ - get_compression() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.datasetattributes_get_compression(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_export_6.value += 16; - wasm.__wbindgen_free(r0, r1); + + let cachedFloat32ArrayMemory0 = null; + + function getFloat32ArrayMemory0() { + if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) { + cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer); } + return cachedFloat32ArrayMemory0; } - /** - * @param {number} zoom_level - * @returns {number} - */ - get_ndim(zoom_level) { - var ret = wasm.datasetattributes_get_ndim(this.ptr, zoom_level); - return ret >>> 0; - } - /** - * Get the total number of elements possible given the dimensions. - * @param {number} zoom_level - * @returns {number} - */ - get_num_elements(zoom_level) { - var ret = wasm.datasetattributes_get_num_elements(this.ptr, zoom_level); - return ret >>> 0; - } - /** - * Get the total number of elements possible in a block. - * @param {number} zoom_level - * @returns {number} - */ - get_block_num_elements(zoom_level) { - var ret = wasm.datasetattributes_get_block_num_elements(this.ptr, zoom_level); - return ret >>> 0; - } - /** - * @returns {any} - */ - to_json() { - var ret = wasm.datasetattributes_to_json(this.ptr); - return takeObject(ret); + + function getArrayF32FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len); } - /** - * @param {any} js - * @returns {DatasetAttributes} - */ - static from_json(js) { - try { - var ret = wasm.datasetattributes_from_json(addBorrowedObject(js)); - return DatasetAttributes.__wrap(ret); - } finally { - heap[stack_pointer++] = undefined; + + let cachedFloat64ArrayMemory0 = null; + + function getFloat64ArrayMemory0() { + if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) { + cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer); } + return cachedFloat64ArrayMemory0; } -} -__exports.DatasetAttributes = DatasetAttributes; -/** -*/ -class NgPreHTTPFetch { - - static __wrap(ptr) { - const obj = Object.create(NgPreHTTPFetch.prototype); - obj.ptr = ptr; - return obj; + function getArrayF64FromWasm0(ptr, len) { + ptr = ptr >>> 0; + return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len); } - free() { - const ptr = this.ptr; - this.ptr = 0; + let stack_pointer = 128; - wasm.__wbg_ngprehttpfetch_free(ptr); - } - /** - * @param {string} base_path - * @returns {Promise} - */ - static open(base_path) { - var ptr0 = passStringToWasm0(base_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - var ret = wasm.ngprehttpfetch_open(ptr0, len0); - return takeObject(ret); - } - /** - * @returns {Promise} - */ - get_version() { - var ret = wasm.ngprehttpfetch_get_version(this.ptr); - return takeObject(ret); + function addBorrowedObject(obj) { + if (stack_pointer == 1) throw new Error('out of js stack'); + heap[--stack_pointer] = obj; + return stack_pointer; } - /** - * @param {string} path_name - * @returns {Promise} - */ - get_dataset_attributes(path_name) { - var ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - var ret = wasm.ngprehttpfetch_get_dataset_attributes(this.ptr, ptr0, len0); - return takeObject(ret); + function __wbg_adapter_54(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hba9c4d05d94bb2f6(arg0, arg1, addHeapObject(arg2)); } - /** - * @param {string} path_name - * @returns {Promise} - */ - exists(path_name) { - var ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - var ret = wasm.ngprehttpfetch_exists(this.ptr, ptr0, len0); - return takeObject(ret); - } - /** - * @param {string} path_name - * @returns {Promise} - */ - dataset_exists(path_name) { - var ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - var ret = wasm.ngprehttpfetch_dataset_exists(this.ptr, ptr0, len0); - return takeObject(ret); - } - /** - * @param {string} path_name - * @param {DatasetAttributes} data_attrs - * @param {BigInt64Array} grid_position - * @returns {Promise} - */ - read_block(path_name, data_attrs, grid_position) { - var ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - _assertClass(data_attrs, DatasetAttributes); - var ptr1 = passArray64ToWasm0(grid_position, wasm.__wbindgen_malloc); - var len1 = WASM_VECTOR_LEN; - var ret = wasm.ngprehttpfetch_read_block(this.ptr, ptr0, len0, data_attrs.ptr, ptr1, len1); - return takeObject(ret); - } - /** - * @param {string} path_name - * @returns {Promise} - */ - list_attributes(path_name) { - var ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - var ret = wasm.ngprehttpfetch_list_attributes(this.ptr, ptr0, len0); - return takeObject(ret); - } - /** - * @param {string} path_name - * @param {DatasetAttributes} data_attrs - * @param {BigInt64Array} grid_position - * @returns {Promise} - */ - block_etag(path_name, data_attrs, grid_position) { - var ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - _assertClass(data_attrs, DatasetAttributes); - var ptr1 = passArray64ToWasm0(grid_position, wasm.__wbindgen_malloc); - var len1 = WASM_VECTOR_LEN; - var ret = wasm.ngprehttpfetch_block_etag(this.ptr, ptr0, len0, data_attrs.ptr, ptr1, len1); - return takeObject(ret); - } - /** - * @param {string} path_name - * @param {DatasetAttributes} data_attrs - * @param {BigInt64Array} grid_position - * @returns {Promise} - */ - read_block_with_etag(path_name, data_attrs, grid_position) { - var ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - _assertClass(data_attrs, DatasetAttributes); - var ptr1 = passArray64ToWasm0(grid_position, wasm.__wbindgen_malloc); - var len1 = WASM_VECTOR_LEN; - var ret = wasm.ngprehttpfetch_read_block_with_etag(this.ptr, ptr0, len0, data_attrs.ptr, ptr1, len1); - return takeObject(ret); + + function __wbg_adapter_253(arg0, arg1, arg2, arg3) { + wasm.wasm_bindgen__convert__closures__invoke2_mut__ha4add01b7784d4e4(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); } -} -__exports.NgPreHTTPFetch = NgPreHTTPFetch; -/** -*/ -class VecDataBlockFLOAT32 { - static __wrap(ptr) { - const obj = Object.create(VecDataBlockFLOAT32.prototype); - obj.ptr = ptr; + const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"]; - return obj; - } + const DatasetAttributesFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_datasetattributes_free(ptr >>> 0, 1)); - free() { - const ptr = this.ptr; - this.ptr = 0; + class DatasetAttributes { - wasm.__wbg_vecdatablockfloat32_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(DatasetAttributes.prototype); + obj.__wbg_ptr = ptr; + DatasetAttributesFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + DatasetAttributesFinalization.unregister(this); + return ptr; } - } - /** - * @returns {Float32Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayF32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_datasetattributes_free(ptr, 0); } - } - /** - * @returns {Float32Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayF32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @param {number} zoom_level + * @returns {BigUint64Array} + */ + get_dimensions(zoom_level) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.datasetattributes_get_dimensions(retptr, this.__wbg_ptr, zoom_level); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @param {number} zoom_level + * @returns {Uint32Array} + */ + get_block_size(zoom_level) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.datasetattributes_get_block_size(retptr, this.__wbg_ptr, zoom_level); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } -} -__exports.VecDataBlockFLOAT32 = VecDataBlockFLOAT32; -/** -*/ -class VecDataBlockFLOAT64 { - - static __wrap(ptr) { - const obj = Object.create(VecDataBlockFLOAT64.prototype); - obj.ptr = ptr; - - return obj; - } - - free() { - const ptr = this.ptr; - this.ptr = 0; - - wasm.__wbg_vecdatablockfloat64_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @param {number} zoom_level + * @returns {Int32Array} + */ + get_voxel_offset(zoom_level) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.datasetattributes_get_voxel_offset(retptr, this.__wbg_ptr, zoom_level); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayI32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {string} + */ + get_data_type() { + let deferred1_0; + let deferred1_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.datasetattributes_get_data_type(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); + } } - } - /** - * @returns {Float64Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat64_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayF64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @param {number} zoom_level + * @returns {string} + */ + get_compression(zoom_level) { + let deferred1_0; + let deferred1_1; + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.datasetattributes_get_compression(retptr, this.__wbg_ptr, zoom_level); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); + } } - } - /** - * @returns {Float64Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat64_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayF64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @param {number} zoom_level + * @returns {number} + */ + get_ndim(zoom_level) { + const ret = wasm.datasetattributes_get_ndim(this.__wbg_ptr, zoom_level); + return ret >>> 0; + } + /** + * Get the total number of elements possible given the dimensions. + * @param {number} zoom_level + * @returns {number} + */ + get_num_elements(zoom_level) { + const ret = wasm.datasetattributes_get_num_elements(this.__wbg_ptr, zoom_level); + return ret >>> 0; + } + /** + * Get the total number of elements possible in a block. + * @param {number} zoom_level + * @returns {number} + */ + get_block_num_elements(zoom_level) { + const ret = wasm.datasetattributes_get_block_num_elements(this.__wbg_ptr, zoom_level); + return ret >>> 0; + } + /** + * Find out if this dataset is sharded. Currently this is assumed for + * all scale level if scale zero is sharded. + * @param {number} zoom_level + * @returns {boolean} + */ + is_sharded(zoom_level) { + const ret = wasm.datasetattributes_is_sharded(this.__wbg_ptr, zoom_level); + return ret !== 0; + } + /** + * @returns {any} + */ + to_json() { + const ret = wasm.datasetattributes_to_json(this.__wbg_ptr); + return takeObject(ret); + } + /** + * @param {any} js + * @returns {DatasetAttributes} + */ + static from_json(js) { + try { + const ret = wasm.datasetattributes_from_json(addBorrowedObject(js)); + return DatasetAttributes.__wrap(ret); + } finally { + heap[stack_pointer++] = undefined; + } } } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + __exports.DatasetAttributes = DatasetAttributes; + + const NgPreHTTPFetchFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_ngprehttpfetch_free(ptr >>> 0, 1)); + + class NgPreHTTPFetch { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(NgPreHTTPFetch.prototype); + obj.__wbg_ptr = ptr; + NgPreHTTPFetchFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + NgPreHTTPFetchFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_ngprehttpfetch_free(ptr, 0); + } + /** + * @param {string} base_path + * @returns {Promise} + */ + static open(base_path) { + const ptr0 = passStringToWasm0(base_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_open(ptr0, len0); + return takeObject(ret); + } + /** + * @returns {Promise} + */ + get_version() { + const ret = wasm.ngprehttpfetch_get_version(this.__wbg_ptr); + return takeObject(ret); + } + /** + * @param {string} path_name + * @returns {Promise} + */ + get_dataset_attributes(path_name) { + const ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_get_dataset_attributes(this.__wbg_ptr, ptr0, len0); + return takeObject(ret); + } + /** + * @param {string} path_name + * @returns {Promise} + */ + exists(path_name) { + const ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_exists(this.__wbg_ptr, ptr0, len0); + return takeObject(ret); + } + /** + * @param {string} path_name + * @returns {Promise} + */ + dataset_exists(path_name) { + const ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_dataset_exists(this.__wbg_ptr, ptr0, len0); + return takeObject(ret); + } + /** + * @param {string} path_name + * @param {DatasetAttributes} data_attrs + * @param {BigInt64Array} grid_position + * @returns {Promise} + */ + read_block(path_name, data_attrs, grid_position) { + const ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + _assertClass(data_attrs, DatasetAttributes); + const ptr1 = passArray64ToWasm0(grid_position, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_read_block(this.__wbg_ptr, ptr0, len0, data_attrs.__wbg_ptr, ptr1, len1); + return takeObject(ret); + } + /** + * @param {string} path_name + * @returns {Promise} + */ + list_attributes(path_name) { + const ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_list_attributes(this.__wbg_ptr, ptr0, len0); + return takeObject(ret); + } + /** + * @param {string} path_name + * @param {DatasetAttributes} data_attrs + * @param {BigInt64Array} grid_position + * @returns {Promise} + */ + block_etag(path_name, data_attrs, grid_position) { + const ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + _assertClass(data_attrs, DatasetAttributes); + const ptr1 = passArray64ToWasm0(grid_position, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_block_etag(this.__wbg_ptr, ptr0, len0, data_attrs.__wbg_ptr, ptr1, len1); + return takeObject(ret); + } + /** + * @param {string} path_name + * @param {DatasetAttributes} data_attrs + * @param {BigInt64Array} grid_position + * @returns {Promise} + */ + read_block_with_etag(path_name, data_attrs, grid_position) { + const ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + _assertClass(data_attrs, DatasetAttributes); + const ptr1 = passArray64ToWasm0(grid_position, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_read_block_with_etag(this.__wbg_ptr, ptr0, len0, data_attrs.__wbg_ptr, ptr1, len1); + return takeObject(ret); + } + /** + * @param {string} path_name + * @param {DatasetAttributes} data_attrs + * @param {BigInt64Array} flattened_grid_coords + * @returns {Promise} + */ + read_blocks_with_etag(path_name, data_attrs, flattened_grid_coords) { + const ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + _assertClass(data_attrs, DatasetAttributes); + const ptr1 = passArray64ToWasm0(flattened_grid_coords, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_read_blocks_with_etag(this.__wbg_ptr, ptr0, len0, data_attrs.__wbg_ptr, ptr1, len1); + return takeObject(ret); + } + /** + * @param {string} path_name + * @param {DatasetAttributes} data_attrs + * @param {BigInt64Array} flattened_grid_coords + * @returns {Promise} + */ + get_optimized_request_bundles(path_name, data_attrs, flattened_grid_coords) { + const ptr0 = passStringToWasm0(path_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + _assertClass(data_attrs, DatasetAttributes); + const ptr1 = passArray64ToWasm0(flattened_grid_coords, wasm.__wbindgen_malloc); + const len1 = WASM_VECTOR_LEN; + const ret = wasm.ngprehttpfetch_get_optimized_request_bundles(this.__wbg_ptr, ptr0, len0, data_attrs.__wbg_ptr, ptr1, len1); + return takeObject(ret); + } + } + __exports.NgPreHTTPFetch = NgPreHTTPFetch; + + const VecDataBlockFLOAT32Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockfloat32_free(ptr >>> 0, 1)); + + class VecDataBlockFLOAT32 { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockFLOAT32.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockFLOAT32Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockFLOAT32Finalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockfloat32_free(ptr, 0); + } + /** + * @returns {Uint32Array} + */ + get_size() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat32_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat32_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Float32Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat32_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayF32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Float32Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat32_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayF32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockfloat32_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat32_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } } -} -__exports.VecDataBlockFLOAT64 = VecDataBlockFLOAT64; -/** -*/ -class VecDataBlockINT16 { + __exports.VecDataBlockFLOAT32 = VecDataBlockFLOAT32; - static __wrap(ptr) { - const obj = Object.create(VecDataBlockINT16.prototype); - obj.ptr = ptr; + const VecDataBlockFLOAT64Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockfloat64_free(ptr >>> 0, 1)); - return obj; - } + class VecDataBlockFLOAT64 { - free() { - const ptr = this.ptr; - this.ptr = 0; + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockFLOAT64.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockFLOAT64Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } - wasm.__wbg_vecdatablockint16_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockFLOAT64Finalization.unregister(this); + return ptr; } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockfloat64_free(ptr, 0); } - } - /** - * @returns {Int16Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockint16_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayI16FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 2); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint32Array} + */ + get_size() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat64_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {Int16Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockint16_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayI16FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 2); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat64_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Float64Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat64_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayF64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Float64Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat64_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayF64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockfloat64_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat64_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } } -} -__exports.VecDataBlockINT16 = VecDataBlockINT16; -/** -*/ -class VecDataBlockINT32 { + __exports.VecDataBlockFLOAT64 = VecDataBlockFLOAT64; - static __wrap(ptr) { - const obj = Object.create(VecDataBlockINT32.prototype); - obj.ptr = ptr; + const VecDataBlockINT16Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockint16_free(ptr >>> 0, 1)); - return obj; - } + class VecDataBlockINT16 { - free() { - const ptr = this.ptr; - this.ptr = 0; + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockINT16.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockINT16Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } - wasm.__wbg_vecdatablockint32_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockINT16Finalization.unregister(this); + return ptr; } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockint16_free(ptr, 0); } - } - /** - * @returns {Int32Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockint32_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayI32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint32Array} + */ + get_size() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint16_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {Int32Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayI32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint16_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Int16Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint16_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayI16FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 2, 2); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Int16Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint16_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayI16FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 2, 2); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockint16_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint16_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } } -} -__exports.VecDataBlockINT32 = VecDataBlockINT32; -/** -*/ -class VecDataBlockINT64 { + __exports.VecDataBlockINT16 = VecDataBlockINT16; - static __wrap(ptr) { - const obj = Object.create(VecDataBlockINT64.prototype); - obj.ptr = ptr; + const VecDataBlockINT32Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockint32_free(ptr >>> 0, 1)); - return obj; - } + class VecDataBlockINT32 { - free() { - const ptr = this.ptr; - this.ptr = 0; + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockINT32.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockINT32Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } - wasm.__wbg_vecdatablockint64_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockINT32Finalization.unregister(this); + return ptr; } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockint32_free(ptr, 0); } - } - /** - * @returns {BigInt64Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockint64_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayI64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint32Array} + */ + get_size() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint32_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {BigInt64Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat64_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayI64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint32_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Int32Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint32_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayI32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Int32Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat32_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayI32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockint32_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint32_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } } -} -__exports.VecDataBlockINT64 = VecDataBlockINT64; -/** -*/ -class VecDataBlockINT8 { + __exports.VecDataBlockINT32 = VecDataBlockINT32; - static __wrap(ptr) { - const obj = Object.create(VecDataBlockINT8.prototype); - obj.ptr = ptr; + const VecDataBlockINT64Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockint64_free(ptr >>> 0, 1)); - return obj; - } + class VecDataBlockINT64 { - free() { - const ptr = this.ptr; - this.ptr = 0; + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockINT64.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockINT64Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } - wasm.__wbg_vecdatablockint8_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockINT64Finalization.unregister(this); + return ptr; } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockint64_free(ptr, 0); } - } - /** - * @returns {Int8Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockint8_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayI8FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint32Array} + */ + get_size() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint64_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {Int8Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockint8_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayI8FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint64_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigInt64Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint64_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayI64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {BigInt64Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat64_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayI64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockint64_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint64_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } } -} -__exports.VecDataBlockINT8 = VecDataBlockINT8; -/** -*/ -class VecDataBlockUINT16 { + __exports.VecDataBlockINT64 = VecDataBlockINT64; - static __wrap(ptr) { - const obj = Object.create(VecDataBlockUINT16.prototype); - obj.ptr = ptr; + const VecDataBlockINT8Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockint8_free(ptr >>> 0, 1)); - return obj; - } + class VecDataBlockINT8 { - free() { - const ptr = this.ptr; - this.ptr = 0; + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockINT8.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockINT8Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } - wasm.__wbg_vecdatablockuint16_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockINT8Finalization.unregister(this); + return ptr; } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockint8_free(ptr, 0); } - } - /** - * @returns {Uint16Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockuint16_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU16FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 2); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint32Array} + */ + get_size() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint8_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {Uint16Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockint16_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU16FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 2); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint8_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Int8Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint8_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayI8FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Int8Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint8_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayI8FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockint8_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint8_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } } -} -__exports.VecDataBlockUINT16 = VecDataBlockUINT16; -/** -*/ -class VecDataBlockUINT32 { + __exports.VecDataBlockINT8 = VecDataBlockINT8; - static __wrap(ptr) { - const obj = Object.create(VecDataBlockUINT32.prototype); - obj.ptr = ptr; + const VecDataBlockUINT16Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockuint16_free(ptr >>> 0, 1)); - return obj; - } + class VecDataBlockUINT16 { - free() { - const ptr = this.ptr; - this.ptr = 0; + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockUINT16.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockUINT16Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } - wasm.__wbg_vecdatablockuint32_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockUINT16Finalization.unregister(this); + return ptr; } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockuint16_free(ptr, 0); } - } - /** - * @returns {Uint32Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockuint32_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint32Array} + */ + get_size() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint16_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {Uint32Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint16_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint16Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint16_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU16FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 2, 2); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Uint16Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint16_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU16FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 2, 2); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockuint16_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint16_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } } -} -__exports.VecDataBlockUINT32 = VecDataBlockUINT32; -/** -*/ -class VecDataBlockUINT64 { + __exports.VecDataBlockUINT16 = VecDataBlockUINT16; - static __wrap(ptr) { - const obj = Object.create(VecDataBlockUINT64.prototype); - obj.ptr = ptr; + const VecDataBlockUINT32Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockuint32_free(ptr >>> 0, 1)); - return obj; - } + class VecDataBlockUINT32 { - free() { - const ptr = this.ptr; - this.ptr = 0; + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockUINT32.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockUINT32Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } - wasm.__wbg_vecdatablockuint64_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockUINT32Finalization.unregister(this); + return ptr; } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockuint32_free(ptr, 0); } - } - /** - * @returns {BigUint64Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockuint64_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint32Array} + */ + get_size() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint32_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {BigUint64Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat64_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint32_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint32Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint32_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Uint32Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat32_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockuint32_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint32_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } } -} -__exports.VecDataBlockUINT64 = VecDataBlockUINT64; -/** -*/ -class VecDataBlockUINT8 { + __exports.VecDataBlockUINT32 = VecDataBlockUINT32; - static __wrap(ptr) { - const obj = Object.create(VecDataBlockUINT8.prototype); - obj.ptr = ptr; + const VecDataBlockUINT64Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockuint64_free(ptr >>> 0, 1)); - return obj; - } + class VecDataBlockUINT64 { - free() { - const ptr = this.ptr; - this.ptr = 0; + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockUINT64.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockUINT64Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } - wasm.__wbg_vecdatablockuint8_free(ptr); - } - /** - * @returns {Uint32Array} - */ - get_size() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_size(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU32FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 4); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockUINT64Finalization.unregister(this); + return ptr; } - } - /** - * @returns {BigUint64Array} - */ - get_grid_position() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_grid_position(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU64FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 8); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockuint64_free(ptr, 0); } - } - /** - * @returns {Uint8Array} - */ - get_data() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockuint8_get_data(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU8FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {Uint32Array} + */ + get_size() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint64_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {Uint8Array} - */ - into_data() { - try { - var ptr = this.ptr; - this.ptr = 0; - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockint8_into_data(retptr, ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var v0 = getArrayU8FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint64_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } - } - /** - * @returns {number} - */ - get_num_elements() { - var ret = wasm.vecdatablockfloat32_get_num_elements(this.ptr); - return ret >>> 0; - } - /** - * @returns {string | undefined} - */ - get_etag() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.vecdatablockfloat32_get_etag(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - let v0; - if (r0 !== 0) { - v0 = getStringFromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1); - } - return v0; - } finally { - wasm.__wbindgen_export_6.value += 16; + /** + * @returns {BigUint64Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint64_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {BigUint64Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockfloat64_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockuint64_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint64_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } } } -} -__exports.VecDataBlockUINT8 = VecDataBlockUINT8; -/** -*/ -class Version { - - static __wrap(ptr) { - const obj = Object.create(Version.prototype); - obj.ptr = ptr; + __exports.VecDataBlockUINT64 = VecDataBlockUINT64; - return obj; - } + const VecDataBlockUINT8Finalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_vecdatablockuint8_free(ptr >>> 0, 1)); - free() { - const ptr = this.ptr; - this.ptr = 0; + class VecDataBlockUINT8 { - wasm.__wbg_version_free(ptr); - } - /** - * @returns {string} - */ - to_string() { - try { - const retptr = wasm.__wbindgen_export_6.value - 16; - wasm.__wbindgen_export_6.value = retptr; - wasm.version_to_string(retptr, this.ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_export_6.value += 16; - wasm.__wbindgen_free(r0, r1); + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(VecDataBlockUINT8.prototype); + obj.__wbg_ptr = ptr; + VecDataBlockUINT8Finalization.register(obj, obj.__wbg_ptr, obj); + return obj; } - } -} -__exports.Version = Version; -async function load(module, imports) { - if (typeof Response === 'function' && module instanceof Response) { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VecDataBlockUINT8Finalization.unregister(this); + return ptr; + } - if (typeof WebAssembly.instantiateStreaming === 'function') { + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_vecdatablockuint8_free(ptr, 0); + } + /** + * @returns {Uint32Array} + */ + get_size() { try { - return await WebAssembly.instantiateStreaming(module, imports); - - } catch (e) { - if (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 retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint8_get_size(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU32FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 4, 4); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {BigUint64Array} + */ + get_grid_position() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint8_get_grid_position(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU64FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 8, 8); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Uint8Array} + */ + get_data() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint8_get_data(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU8FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Uint8Array} + */ + into_data() { + try { + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockint8_into_data(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var v1 = getArrayU8FromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {number} + */ + get_num_elements() { + const ret = wasm.vecdatablockuint8_get_num_elements(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {string | undefined} + */ + get_etag() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.vecdatablockuint8_get_etag(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_free(r0, r1 * 1, 1); } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); } } + } + __exports.VecDataBlockUINT8 = VecDataBlockUINT8; - const bytes = await module.arrayBuffer(); - return await WebAssembly.instantiate(bytes, imports); + const VersionFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_version_free(ptr >>> 0, 1)); - } else { + class Version { - const instance = await WebAssembly.instantiate(module, imports); + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(Version.prototype); + obj.__wbg_ptr = ptr; + VersionFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } - if (instance instanceof WebAssembly.Instance) { - return { instance, module }; + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + VersionFinalization.unregister(this); + return ptr; + } - } else { - return instance; + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_version_free(ptr, 0); } } -} + __exports.Version = Version; + + 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) { + if (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); -async function init(input) { - if (typeof input === 'undefined') { - let src; - if (typeof document === 'undefined') { - src = location.href; } else { - src = document.currentScript.src; + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } } - input = src.replace(/\.js$/, '_bg.wasm'); } - const imports = {}; - imports.wbg = {}; - imports.wbg.__wbg_instanceof_ArrayBuffer_3a0fa134e6809d57 = function(arg0) { - var ret = getObject(arg0) instanceof ArrayBuffer; - return ret; - }; - imports.wbg.__wbg_new_c6c0228e6d22a2f9 = function(arg0) { - var ret = new Uint8Array(getObject(arg0)); - return addHeapObject(ret); - }; - imports.wbg.__wbindgen_object_drop_ref = function(arg0) { - takeObject(arg0); - }; - imports.wbg.__wbg_vecdatablockfloat32_new = function(arg0) { - var ret = VecDataBlockFLOAT32.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_new_94a7dfa9529ec6e8 = function(arg0, arg1) { - var ret = new Error(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_vecdatablockuint32_new = function(arg0) { - var ret = VecDataBlockUINT32.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_vecdatablockint32_new = function(arg0) { - var ret = VecDataBlockINT32.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_vecdatablockint64_new = function(arg0) { - var ret = VecDataBlockINT64.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_instanceof_Response_f52c65c389890639 = function(arg0) { - var ret = getObject(arg0) instanceof Response; - return ret; - }; - imports.wbg.__wbg_ok_c20643e0a45dc5a0 = function(arg0) { - var ret = getObject(arg0).ok; - return ret; - }; - imports.wbg.__wbg_headers_6fafb2c7669a8ac5 = function(arg0) { - var ret = getObject(arg0).headers; - return addHeapObject(ret); - }; - imports.wbg.__wbg_arrayBuffer_0ba17dfaad804b6f = handleError(function(arg0) { - var ret = getObject(arg0).arrayBuffer(); - return addHeapObject(ret); - }); - imports.wbg.__wbg_vecdatablockfloat64_new = function(arg0) { - var ret = VecDataBlockFLOAT64.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { - const obj = getObject(arg1); - var ret = JSON.stringify(obj === undefined ? null : obj); - var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len0; - getInt32Memory0()[arg0 / 4 + 0] = ptr0; - }; - imports.wbg.__wbg_datasetattributes_new = function(arg0) { - var ret = DatasetAttributes.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbindgen_string_new = function(arg0, arg1) { - var ret = getStringFromWasm0(arg0, arg1); - return addHeapObject(ret); - }; - imports.wbg.__wbg_vecdatablockint8_new = function(arg0) { - var ret = VecDataBlockINT8.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { - var ret = JSON.parse(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_vecdatablockuint8_new = function(arg0) { - var ret = VecDataBlockUINT8.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_vecdatablockint16_new = function(arg0) { - var ret = VecDataBlockINT16.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_ngprehttpfetch_new = function(arg0) { - var ret = NgPreHTTPFetch.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_vecdatablockuint16_new = function(arg0) { - var ret = VecDataBlockUINT16.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_vecdatablockuint64_new = function(arg0) { - var ret = VecDataBlockUINT64.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_version_new = function(arg0) { - var ret = Version.__wrap(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_self_6baf3a3aa7b63415 = handleError(function() { - var ret = self.self; - return addHeapObject(ret); - }); - imports.wbg.__wbg_window_63fc4027b66c265b = handleError(function() { - var ret = window.window; - return addHeapObject(ret); - }); - imports.wbg.__wbg_globalThis_513fb247e8e4e6d2 = handleError(function() { - var ret = globalThis.globalThis; - return addHeapObject(ret); - }); - imports.wbg.__wbg_global_b87245cd886d7113 = handleError(function() { - var ret = global.global; - return addHeapObject(ret); - }); - imports.wbg.__wbindgen_is_undefined = function(arg0) { - var ret = getObject(arg0) === undefined; - return ret; - }; - imports.wbg.__wbg_newnoargs_7c6bd521992b4022 = function(arg0, arg1) { - var ret = new Function(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_call_951bd0c6d815d6f1 = handleError(function(arg0, arg1) { - var ret = getObject(arg0).call(getObject(arg1)); - return addHeapObject(ret); - }); - imports.wbg.__wbg_length_c645e7c02233b440 = function(arg0) { - var ret = getObject(arg0).length; - return ret; - }; - imports.wbg.__wbindgen_memory = function() { - var ret = wasm.memory; - return addHeapObject(ret); - }; - imports.wbg.__wbg_buffer_3f12a1c608c6d04e = function(arg0) { - var ret = getObject(arg0).buffer; - return addHeapObject(ret); - }; - imports.wbg.__wbg_set_b91afac9fd216d99 = function(arg0, arg1, arg2) { - getObject(arg0).set(getObject(arg1), arg2 >>> 0); - }; - imports.wbg.__wbg_json_012a7a84489a5ec5 = handleError(function(arg0) { - var ret = getObject(arg0).json(); - return addHeapObject(ret); - }); - imports.wbg.__wbg_new_ba07d0daa0e4677e = function() { - var ret = new Object(); - return addHeapObject(ret); - }; - imports.wbg.__wbg_set_9bdd413385146137 = handleError(function(arg0, arg1, arg2) { - var ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); - return ret; - }); - imports.wbg.__wbg_newwithstrandinit_11debb554792e043 = handleError(function(arg0, arg1, arg2) { - var ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); - return addHeapObject(ret); - }); - imports.wbg.__wbg_fetch_f26b740013c0eb32 = function(arg0, arg1) { - var ret = getObject(arg0).fetch(getObject(arg1)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_fetch_f532e04b8fe49aa0 = function(arg0, arg1) { - var ret = getObject(arg0).fetch(getObject(arg1)); - return addHeapObject(ret); - }; - imports.wbg.__wbindgen_object_clone_ref = function(arg0) { - var ret = getObject(arg0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_eval_394e553abe29dbfd = handleError(function(arg0, arg1) { - var ret = eval(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - }); - imports.wbg.__wbindgen_boolean_get = function(arg0) { - const v = getObject(arg0); - var ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; - return ret; - }; - imports.wbg.__wbg_instanceof_Window_49f532f06a9786ee = function(arg0) { - var ret = getObject(arg0) instanceof Window; - return ret; - }; - imports.wbg.__wbg_instanceof_WorkerGlobalScope_fa8ee4d4a987fc47 = function(arg0) { - var ret = getObject(arg0) instanceof WorkerGlobalScope; - return ret; - }; - imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { - var ret = debugString(getObject(arg1)); - var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len0; - getInt32Memory0()[arg0 / 4 + 0] = ptr0; - }; - imports.wbg.__wbindgen_throw = function(arg0, arg1) { - throw new Error(getStringFromWasm0(arg0, arg1)); - }; - imports.wbg.__wbg_new_bb4e44ef089e45b4 = function(arg0, arg1) { - try { - var state0 = {a: arg0, b: arg1}; - var cb0 = (arg0, arg1) => { - const a = state0.a; - state0.a = 0; - try { - return __wbg_adapter_39(a, state0.b, arg0, arg1); - } finally { - state0.a = a; - } - }; - var ret = new Promise(cb0); + + function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_arrayBuffer_d0ca2ad8bda0039b = function() { return handleError(function (arg0) { + const ret = getObject(arg0).arrayBuffer(); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_buffer_61b7ce01341d7f88 = function(arg0) { + const ret = getObject(arg0).buffer; + return addHeapObject(ret); + }; + imports.wbg.__wbg_call_500db948e69c7330 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_call_b0d8e36992d9900d = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).call(getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_datasetattributes_new = function(arg0) { + const ret = DatasetAttributes.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_done_f22c1561fa919baa = function(arg0) { + const ret = getObject(arg0).done; + return ret; + }; + imports.wbg.__wbg_entries_4f2bb9b0d701c0f6 = function(arg0) { + const ret = Object.entries(getObject(arg0)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_eval_cd0c386c3899dd07 = function() { return handleError(function (arg0, arg1) { + const ret = eval(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_fetch_229368eecee9d217 = function(arg0, arg1) { + const ret = getObject(arg0).fetch(getObject(arg1)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_fetch_e26fdd92ea39f634 = function(arg0, arg1) { + const ret = getObject(arg0).fetch(getObject(arg1)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_get_9aa3dff3f0266054 = function(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return addHeapObject(ret); + }; + imports.wbg.__wbg_get_ae7344ec6091c6c5 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = getObject(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); + }, arguments) }; + imports.wbg.__wbg_get_bbccf8970793c087 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) { + const ret = getObject(arg0)[getObject(arg1)]; + return addHeapObject(ret); + }; + imports.wbg.__wbg_headers_24e3e19fe3f187c0 = function(arg0) { + const ret = getObject(arg0).headers; + return addHeapObject(ret); + }; + imports.wbg.__wbg_headers_786276f5fbbdb28a = function(arg0) { + const ret = getObject(arg0).headers; + return addHeapObject(ret); + }; + imports.wbg.__wbg_instanceof_ArrayBuffer_670ddde44cdb2602 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ArrayBuffer; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Map_98ecb30afec5acdb = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Map; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Response_d3453657e10c4300 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Response; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Uint8Array; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_Window_d2514c6a7ee7ba60 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Window; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_instanceof_WorkerGlobalScope_b32c94246142a6a7 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof WorkerGlobalScope; + } catch (_) { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_isArray_1ba11a930108ec51 = function(arg0) { + const ret = Array.isArray(getObject(arg0)); + return ret; + }; + imports.wbg.__wbg_isSafeInteger_12f5549b2fca23f4 = function(arg0) { + const ret = Number.isSafeInteger(getObject(arg0)); + return ret; + }; + imports.wbg.__wbg_iterator_23604bb983791576 = function() { + const ret = Symbol.iterator; + return addHeapObject(ret); + }; + imports.wbg.__wbg_json_2c755d0be3f5cc5c = function() { return handleError(function (arg0) { + const ret = getObject(arg0).json(); return addHeapObject(ret); - } finally { - state0.a = state0.b = 0; + }, arguments) }; + imports.wbg.__wbg_length_65d1cd11729ced11 = function(arg0) { + const ret = getObject(arg0).length; + return ret; + }; + imports.wbg.__wbg_length_d65cf0786bfc5739 = function(arg0) { + const ret = getObject(arg0).length; + return ret; + }; + imports.wbg.__wbg_log_464d1b2190ca1e04 = function(arg0) { + console.log(getObject(arg0)); + }; + imports.wbg.__wbg_new_254fa9eac11932ae = function() { + const ret = new Array(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_new_3d446df9155128ef = function(arg0, arg1) { + try { + var state0 = {a: arg0, b: arg1}; + var cb0 = (arg0, arg1) => { + const a = state0.a; + state0.a = 0; + try { + return __wbg_adapter_253(a, state0.b, arg0, arg1); + } finally { + state0.a = a; + } + }; + const ret = new Promise(cb0); + return addHeapObject(ret); + } finally { + state0.a = state0.b = 0; + } + }; + imports.wbg.__wbg_new_3ff5b33b1ce712df = function(arg0) { + const ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_new_688846f374351c92 = function() { + const ret = new Object(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_new_bc96c6a1c0786643 = function() { + const ret = new Map(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_newnoargs_fd9e4bf8be2bc16d = function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_newwithstrandinit_a1f6583f20e4faff = function() { return handleError(function (arg0, arg1, arg2) { + const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_next_01dd9234a5bf6d05 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).next(); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_next_137428deb98342b0 = function(arg0) { + const ret = getObject(arg0).next; + return addHeapObject(ret); + }; + imports.wbg.__wbg_ngprehttpfetch_new = function(arg0) { + const ret = NgPreHTTPFetch.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_now_62a101fe35b60230 = function(arg0) { + const ret = getObject(arg0).now(); + return ret; + }; + imports.wbg.__wbg_ok_4cacdb33ce54895f = function(arg0) { + const ret = getObject(arg0).ok; + return ret; + }; + imports.wbg.__wbg_performance_2e69ce813a883f21 = function(arg0) { + const ret = getObject(arg0).performance; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_performance_33af593be9d2f2bb = function(arg0) { + const ret = getObject(arg0).performance; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_queueMicrotask_2181040e064c0dc8 = function(arg0) { + queueMicrotask(getObject(arg0)); + }; + imports.wbg.__wbg_queueMicrotask_ef9ac43769cbcc4f = function(arg0) { + const ret = getObject(arg0).queueMicrotask; + return addHeapObject(ret); + }; + imports.wbg.__wbg_resolve_0bf7c44d641804f9 = function(arg0) { + const ret = Promise.resolve(getObject(arg0)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_set_1d80752d0d5f0b21 = function(arg0, arg1, arg2) { + getObject(arg0)[arg1 >>> 0] = takeObject(arg2); + }; + imports.wbg.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); + }; + imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) { + getObject(arg0)[takeObject(arg1)] = takeObject(arg2); + }; + imports.wbg.__wbg_set_76818dc3c59a63d5 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).set(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_set_aa8f7a765a0a2e5f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_setmethod_cfc7f688ba46a6be = function(arg0, arg1, arg2) { + getObject(arg0).method = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_setmode_cd03637eb7da01e0 = function(arg0, arg1) { + getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1]; + }; + imports.wbg.__wbg_static_accessor_GLOBAL_0be7472e492ad3e3 = function() { + const ret = typeof global === 'undefined' ? null : global; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_THIS_1a6eb482d12c9bfb = function() { + const ret = typeof globalThis === 'undefined' ? null : globalThis; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_static_accessor_SELF_1dc398a895c82351 = function() { + const ret = typeof self === 'undefined' ? null : self; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_static_accessor_WINDOW_ae1c80c7eea8d64a = function() { + const ret = typeof window === 'undefined' ? null : window; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_statusText_613aac5c001080c1 = function(arg0, arg1) { + const ret = getObject(arg1).statusText; + 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_then_0438fad860fe38e1 = function(arg0, arg1) { + const ret = getObject(arg0).then(getObject(arg1)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_then_0ffafeddf0e182a4 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_value_4c32fd138a88eee2 = function(arg0) { + const ret = getObject(arg0).value; + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockfloat32_new = function(arg0) { + const ret = VecDataBlockFLOAT32.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockfloat64_new = function(arg0) { + const ret = VecDataBlockFLOAT64.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockint16_new = function(arg0) { + const ret = VecDataBlockINT16.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockint32_new = function(arg0) { + const ret = VecDataBlockINT32.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockint64_new = function(arg0) { + const ret = VecDataBlockINT64.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockint8_new = function(arg0) { + const ret = VecDataBlockINT8.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockuint16_new = function(arg0) { + const ret = VecDataBlockUINT16.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockuint32_new = function(arg0) { + const ret = VecDataBlockUINT32.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockuint64_new = function(arg0) { + const ret = VecDataBlockUINT64.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_vecdatablockuint8_new = function(arg0) { + const ret = VecDataBlockUINT8.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_version_new = function(arg0) { + const ret = Version.__wrap(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_array_new = function() { + const ret = []; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_array_push = function(arg0, arg1) { + getObject(arg0).push(takeObject(arg1)); + }; + imports.wbg.__wbindgen_as_number = function(arg0) { + const ret = +getObject(arg0); + return ret; + }; + imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) { + const ret = arg0; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) { + const ret = BigInt.asUintN(64, arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) { + const v = getObject(arg1); + const ret = typeof(v) === 'bigint' ? v : undefined; + getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); + }; + imports.wbg.__wbindgen_boolean_get = function(arg0) { + const v = getObject(arg0); + const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; + return ret; + }; + imports.wbg.__wbindgen_cb_drop = function(arg0) { + const obj = takeObject(arg0).original; + if (obj.cnt-- == 1) { + obj.a = 0; + return true; + } + const ret = false; + return ret; + }; + imports.wbg.__wbindgen_closure_wrapper1322 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 263, __wbg_adapter_54); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { + const ret = debugString(getObject(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.__wbindgen_error_new = function(arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_in = function(arg0, arg1) { + const ret = getObject(arg0) in getObject(arg1); + return ret; + }; + imports.wbg.__wbindgen_is_bigint = function(arg0) { + const ret = typeof(getObject(arg0)) === 'bigint'; + return ret; + }; + imports.wbg.__wbindgen_is_function = function(arg0) { + const ret = typeof(getObject(arg0)) === 'function'; + return ret; + }; + imports.wbg.__wbindgen_is_object = function(arg0) { + const val = getObject(arg0); + const ret = typeof(val) === 'object' && val !== null; + return ret; + }; + imports.wbg.__wbindgen_is_string = function(arg0) { + const ret = typeof(getObject(arg0)) === 'string'; + return ret; + }; + imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = getObject(arg0) === undefined; + return ret; + }; + imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) { + const ret = getObject(arg0) === getObject(arg1); + return ret; + }; + imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) { + const ret = getObject(arg0) == getObject(arg1); + return ret; + }; + imports.wbg.__wbindgen_memory = function() { + const ret = wasm.memory; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_number_get = function(arg0, arg1) { + const obj = getObject(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.__wbindgen_number_new = function(arg0) { + const ret = arg0; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = getObject(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.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + + return imports; + } + + function __wbg_init_memory(imports, memory) { + + } + + function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedBigInt64ArrayMemory0 = null; + cachedBigUint64ArrayMemory0 = null; + cachedDataViewMemory0 = null; + cachedFloat32ArrayMemory0 = null; + cachedFloat64ArrayMemory0 = null; + cachedInt16ArrayMemory0 = null; + cachedInt32ArrayMemory0 = null; + cachedInt8ArrayMemory0 = null; + cachedUint16ArrayMemory0 = null; + cachedUint32ArrayMemory0 = null; + cachedUint8ArrayMemory0 = null; + + + + 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') + } } - }; - imports.wbg.__wbg_call_bf745b1758bb6693 = handleError(function(arg0, arg1, arg2) { - var ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); - return addHeapObject(ret); - }); - imports.wbg.__wbindgen_cb_drop = function(arg0) { - const obj = takeObject(arg0).original; - if (obj.cnt-- == 1) { - obj.a = 0; - return true; + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); } - var ret = false; - return ret; - }; - imports.wbg.__wbg_then_0f957e0f4c3e537a = function(arg0, arg1, arg2) { - var ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_resolve_6e61e640925a0db9 = function(arg0) { - var ret = Promise.resolve(getObject(arg0)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_then_dd3785597974798a = function(arg0, arg1) { - var ret = getObject(arg0).then(getObject(arg1)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_get_f7c7868f719f98ec = handleError(function(arg0, arg1, arg2, arg3) { - var ret = getObject(arg1).get(getStringFromWasm0(arg2, arg3)); - var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len0 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len0; - getInt32Memory0()[arg0 / 4 + 0] = ptr0; - }); - imports.wbg.__wbindgen_closure_wrapper990 = function(arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 49, __wbg_adapter_24); - return addHeapObject(ret); - }; - if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) { - input = fetch(input); + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); } - const { instance, module } = await load(await input, imports); + async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; - wasm = instance.exports; - init.__wbindgen_wasm_module = module; - 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' && typeof script_src !== 'undefined') { + module_or_path = script_src.replace(/\.js$/, '_bg.wasm'); + } + 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); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); + } -wasm_bindgen = Object.assign(init, __exports); + wasm_bindgen = Object.assign(__wbg_init, { initSync }, __exports); })(); self.ngpre_wasm = wasm_bindgen; diff --git a/django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm_worker.js b/django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm_worker.js index 66176d9f48..c3ab78def3 100644 --- a/django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm_worker.js +++ b/django/applications/catmaid/static/libs/ngpre-wasm/ngpre_wasm_worker.js @@ -20,10 +20,85 @@ onmessage = function(e) { if (message.length == 2) { // Initialization let [wasmModule, rootPath] = message; - promiseReady = wasm_bindgen(...wasmModule).then(() => wasm_bindgen); + promiseReady = wasm_bindgen({ module_or_path: wasmModule[0] }).then(() => wasm_bindgen); promiseReader = promiseReady .then(ngprewasm => ngprewasm.NgPreHTTPFetch.open(rootPath)); promiseReader.then(r => postMessage([messageId, r])); + } else if (message.length == 4) { + let [path, dataAttrsPtr, grid_coords, use_cache] = message; + let dataAttrs = wasm_bindgen.DatasetAttributes.from_json(dataAttrsPtr); + + promiseReader.then(r => { + r.read_blocks_with_etag(path, dataAttrs, grid_coords) + .then(blocks => { + if (blocks) { + const loadedBlocks = []; + for (let i=0; i b ? b.data.buffer : b)); + } else { + postMessage([messageId, blocks]); + } + }); + }); + } else if (message.length == 5) { + let [path, dataAttrsPtr, grid_coords, use_cache, _] = message; + + // This does not work because: + // - This wasm instance does not share memory with the sender instance. + // - Even when it does, this requires custom rustc parameters. See the + // wasm_bindgen parallel raytracer example for details. + // let dataAttrs = wasm_bindgen.DatasetAttributes.__wrap(dataAttrsPtr.ptr); + // Instead, use JSON serialization. + let dataAttrs = wasm_bindgen.DatasetAttributes.from_json(dataAttrsPtr); + + promiseReader.then(r => { + r.get_optimized_request_bundles(path, dataAttrs, grid_coords) + .then(raw_bundles => { + // Bundles are returned in a flattened version of a nested array, so + // we must recreate the nested array manually. + let bundles = raw_bundles.reduce((o, c) => { + if (o.count === 0) { + // Add new bundle + o.count = Number(c); + o.target.push([]); + } else if (o.coord) { + // Add BigInt dimension to current coordinate + o.coord.push(c); + if (o.coord.length == 3) { + // Is already added to bundle below + o.coord = null; + o.count -= 1; + } + } else { + // Add new coordinate array to current bundle and add first BigInt + // dimension. + o.coord = [c]; + o.target[o.target.length - 1].push(o.coord); + } + return o; + }, { + target: [], + coord: null, + count: 0, + }).target; + + postMessage([messageId, bundles]); + }); + }); + } else { let [path, dataAttrsPtr, blockCoord] = message;