@rivm-loculus-tools/sequence-editor 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/EngineWorker.js +1 -1
- package/dist/_chunks/EngineWorker.js.map +1 -1
- package/dist/_chunks/SequenceEditor.js +184 -97
- package/dist/_chunks/SequenceEditor.js.map +1 -1
- package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageDrawer.js +42 -38
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -1
- package/dist/_chunks/SequenceEditorPageHeader.js +7 -4
- package/dist/_chunks/SequenceEditorPageHeader.js.map +1 -1
- package/dist/_chunks/sequenceEditorStore.js +2 -2
- package/dist/_chunks/sequenceEditorStore.js.map +1 -1
- package/dist/_chunks/sequence_editor.js +8 -1
- package/dist/_chunks/sequence_editor.js.map +1 -1
- package/dist/assets/AlignerWorker-cbSDVRKB.js +8 -0
- package/dist/assets/AlignerWorker-cbSDVRKB.js.map +1 -0
- package/dist/assets/index--BqOy4u7.js +8 -0
- package/dist/assets/index--BqOy4u7.js.map +1 -0
- package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +29 -23
- package/dist/classes/services/EditorWorkerService/index.js +80 -69
- package/dist/classes/services/EditorWorkerService/index.js.map +1 -1
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +3 -0
- package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +2 -0
- package/dist/classes/workers/EngineWorker/index.js +6 -0
- package/dist/classes/workers/EngineWorker/index.js.map +1 -1
- package/dist/constants/keyboard.d.ts +2 -0
- package/dist/constants/keyboard.js +42 -5
- package/dist/constants/keyboard.js.map +1 -1
- package/dist/models/editor.models.d.ts +2 -0
- package/dist/models/editor.models.js.map +1 -1
- package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +2 -2
- package/dist/utils/EditorUtil/EditorUtil.d.ts +3 -0
- package/dist/utils/EditorUtil/index.js +139 -102
- package/dist/utils/EditorUtil/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/assets/AlignerWorker-Cf4trdzm.js +0 -8
- package/dist/assets/AlignerWorker-Cf4trdzm.js.map +0 -1
- package/dist/assets/index-YCKQaSTQ.js +0 -8
- package/dist/assets/index-YCKQaSTQ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence_editor.js","names":["ret","proxyMarker","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","expose","obj","port1","port2","port","wrap","value","serialized","isAllowedOrigin","allowedOrigin","allowedOrigins","origin","ep","callback","ev","argumentList","fromWireValue","returnValue","parent","path","prop","rawValue","type","proxy","transfer","wireValue","transferables","toWireValue","closeEndPoint","isMessagePort","endpoint","pendingListeners","data","resolver","createProxy","target","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","proxyFinalizers","newCount","registerProxy","unregisterProxy","isProxyReleased","r","p","last","processArguments","rawArgumentList","myFlat","arr","processed","v","transferCache","transfers","name","handler","serializedValue","id","generateUUID","resolve","msg","MoveDirection","MsaEngine","ptr","MsaEngineFinalization","ptr0","passStringToWasm0","fasta_content","wasm","len0","WASM_VECTOR_LEN","ret","takeFromExternrefTable0","passArray32ToWasm0","row_indices","col_idx","row","col","deferred1_0","deferred1_1","getStringFromWasm0","ptr1","col_indices","len1","direction","target_row","delta","new_base","query","check_record_names","start_row","end_row","start_col","end_col","reading_frame","passArray8ToWasm0","out","align_fasta","deferred3_0","deferred3_1","ptr2","len2","__wbg_get_imports","arg0","arg1","getDataViewMemory0","arg2","getArrayU8FromWasm0","table","offset","getUint8ArrayMemory0","len","cachedDataViewMemory0","decodeText","cachedUint32ArrayMemory0","getUint32ArrayMemory0","cachedUint8ArrayMemory0","malloc","arg","realloc","buf","cachedTextEncoder","mem","code","view","idx","cachedTextDecoder","MAX_SAFARI_DECODE_BYTES","numBytesDecoded","__wbg_finalize_init","instance","__wbg_load","module","imports","e","expectedResponseType","bytes","__wbg_init","module_or_path"],"sources":["../../../../../../node_modules/.pnpm/comlink@4.4.2/node_modules/comlink/dist/esm/comlink.mjs","../../../engine/wasm/sequence_editor.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","/* @ts-self-types=\"./sequence_editor.d.ts\" */\n\n/**\n * @enum {0 | 1 | 2 | 3}\n */\nexport const EditError = Object.freeze({\n DeleteNotGap: 0, \"0\": \"DeleteNotGap\",\n MutateNotIupac: 1, \"1\": \"MutateNotIupac\",\n MoveNoGapTarget: 2, \"2\": \"MoveNoGapTarget\",\n MoveNotIupac: 3, \"3\": \"MoveNotIupac\",\n});\n\n/**\n * Direction for horizontal character movement.\n * @enum {0 | 1}\n */\nexport const MoveDirection = Object.freeze({\n Left: 0, \"0\": \"Left\",\n Right: 1, \"1\": \"Right\",\n});\n\n/**\n * The core MSA engine. Owns the alignment matrix, row names, the reusable\n * viewport buffer, and the undo/redo stacks.\n */\nexport class MsaEngine {\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n MsaEngineFinalization.unregister(this);\n return ptr;\n }\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_msaengine_free(ptr, 0);\n }\n /**\n * Apply an externally aligned FASTA into the engine, recording a single\n * structural undo transaction so the alignment can be undone and redone\n * via `undo()` and `redo()`.\n *\n * Enforces strict validation:\n * - Sequence count must match the currently loaded matrix.\n * - All rows in the aligned FASTA must have equal length (uniform alignment width).\n * - Sequence headers and ordering must strictly match `self.names`.\n * - Ungapped nucleotide residue identities must be conserved for each sequence.\n * @param {string} fasta_content\n */\n apply_aligned_fasta(fasta_content) {\n const ptr0 = passStringToWasm0(fasta_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_apply_aligned_fasta(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Simultaneous deletion at a single column index on a subset of rows.\n * Only rows in `row_indices` are affected: the character at `col_idx`\n * is removed and a `-` is appended at the end to keep width unchanged.\n * Non-target rows are completely untouched.\n *\n * Returns `DeleteNotGap` if any target position contains a non-`-`\n * character; the operation is all-or-nothing.\n * @param {Uint32Array} row_indices\n * @param {number} col_idx\n */\n delete_at_subset(row_indices, col_idx) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_delete_at_subset(this.__wbg_ptr, ptr0, len0, col_idx);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Delete a column from every row, shrinking `alignment_width` by 1.\n * This is the width-preserving inverse of a full-column insert.\n * Returns success.\n * @param {number} col_idx\n */\n delete_column(col_idx) {\n const ret = wasm.msaengine_delete_column(this.__wbg_ptr, col_idx);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Serialize the full matrix as a gapped FASTA.\n * Returns the bytes wrapped in a `js_sys::Uint8Array`.\n * Each record is emitted in its current row order and ends with a newline.\n * An empty engine exports an empty buffer.\n * @returns {Uint8Array}\n */\n export_gapped_fasta() {\n const ret = wasm.msaengine_export_gapped_fasta(this.__wbg_ptr);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * Serialize the current full matrix as an ungapped FASTA.\n * Meaning that all gap characters (`-`) are stripped from every sequence.\n * Returns the bytes wrapped in a `js_sys::Uint8Array`.\n * Each record is emitted in its current row order and ends with a newline.\n * An empty engine exports an empty buffer.\n * @returns {Uint8Array}\n */\n export_ungapped_fasta() {\n const ret = wasm.msaengine_export_ungapped_fasta(this.__wbg_ptr);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * Global alignment width (columns). Zero if nothing is loaded.\n * @returns {number}\n */\n get_alignment_width() {\n const ret = wasm.msaengine_get_alignment_width(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} row\n * @returns {Uint8Array}\n */\n get_aminoacid_view(row) {\n const ret = wasm.msaengine_get_aminoacid_view(this.__wbg_ptr, row);\n return ret;\n }\n /**\n * Return the raw byte at `(row, col)`, or `0` if out of range.\n * Useful for the test harness to spot-check individual cells.\n * @param {number} row\n * @param {number} col\n * @returns {number}\n */\n get_base(row, col) {\n const ret = wasm.msaengine_get_base(this.__wbg_ptr, row, col);\n return ret;\n }\n /**\n * Return the name/identifier of a given row, or an empty string if the\n * index is out of range.\n * @param {number} row\n * @returns {string}\n */\n get_name(row) {\n let deferred1_0;\n let deferred1_1;\n try {\n const ret = wasm.msaengine_get_name(this.__wbg_ptr, row);\n deferred1_0 = ret[0];\n deferred1_1 = ret[1];\n return getStringFromWasm0(ret[0], ret[1]);\n } finally {\n wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * Return the length of a specific row, or `0` if the row index is invalid.\n * @param {number} row\n * @returns {number}\n */\n get_row_length(row) {\n const ret = wasm.msaengine_get_row_length(this.__wbg_ptr, row);\n return ret >>> 0;\n }\n /**\n * Number of sequences currently loaded.\n * @returns {number}\n */\n get_sequence_count() {\n const ret = wasm.msaengine_get_sequence_count(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * Number of bytes currently held in the viewport buffer.\n * @returns {number}\n */\n get_viewport_len() {\n const ret = wasm.msaengine_get_viewport_len(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * Simultaneous gap insertion at a single column index on a subset of\n * rows. The inserted character is always `-` (gap). Target rows receive\n * the gap at the clamped insertion column; non-target rows have a `-`\n * appended at the end to keep matrix width consistent.\n *\n * Returns success; no validation is needed since only `-` can be inserted.\n * @param {Uint32Array} row_indices\n * @param {number} col_idx\n */\n insert_at_subset(row_indices, col_idx) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_insert_at_subset(this.__wbg_ptr, ptr0, len0, col_idx);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Parse FASTA content and populate the engine.\n *\n * Performs a line-by-line scan. Sequences may span multiple lines;\n * a new sequence begins at any line starting with `>`. Whitespace and\n * blank lines are ignored. All sequence bytes are uppercased.\n *\n * The sequences are assumed to be pre-aligned as this is given from\n * loculus as a provider of the sequence data. After all sequences are\n * parsed, `alignment_width` is set to the length of the longest\n * sequence. Shorter sequences are NOT automatically padded.\n * Callers can detect ragged alignments via `get_row_length`.\n *\n * Returns the sequence count on success. Invalid sequence characters\n * reject the load without changing the current engine state.\n * @param {string} fasta_content\n * @returns {number}\n */\n load_fasta(fasta_content) {\n const ptr0 = passStringToWasm0(fasta_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_load_fasta(this.__wbg_ptr, ptr0, len0);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return ret[0] >>> 0;\n }\n /**\n * Move a contiguous block of IUPAC characters horizontally by 1 position\n * across one or more rows. Each call moves exactly 1 position; callers must\n * issue multiple calls for multi-position moves.\n *\n * `col_indices` is treated as a range `[min, max]`, non-contiguous\n * indices are clamped to their min/max.\n *\n * **Left move:** validates the selected chars are IUPAC and the position\n * to the left is `-`, then rotates the block left by 1.\n *\n * **Right move:** validates the selected chars are IUPAC and the position\n * to the right is `-`, then rotates the block right by 1.\n *\n * The entire operation is recorded as a single transaction in the undo stack.\n * Returns a typed error on failure; the operation is all-or-nothing.\n * @param {Uint32Array} row_indices\n * @param {Uint32Array} col_indices\n * @param {MoveDirection} direction\n */\n move_horizontal(row_indices, col_indices, direction) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray32ToWasm0(col_indices, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_horizontal(this.__wbg_ptr, ptr0, len0, ptr1, len1, direction);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Move the specified rows down by 1 position, preserving relative spacing.\n * Rows already at the bottom are skipped.\n * Returns success without creating an undo entry if no row moved.\n * @param {Uint32Array} row_indices\n */\n move_rows_down(row_indices) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_down(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Move the specified rows and simultaneously group them into a contiguous\n * block placed starting at `target_row`. Selected rows preserve their\n * relative order within the group. Unselected rows preserve their relative\n * order around the inserted group.\n *\n * Clamps `target_row` to `0..=(N - selected_count)`.\n * Records at most ONE `StructuralSnapshot` on the undo stack, and NO snapshot\n * if the resulting order is unchanged.\n * @param {Uint32Array} row_indices\n * @param {number} target_row\n */\n move_rows_grouped(row_indices, target_row) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_grouped(this.__wbg_ptr, ptr0, len0, target_row);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Move the specified rows relative to their current positions by `delta`\n * steps (+ for down, - for up). Disjoint rows preserve their relative spacing\n * unless blocked by alignment boundaries. Rows hitting boundaries remain at\n * their boundary while other rows continue shifting.\n *\n * Even for multi-step shifts, this records at most ONE `StructuralSnapshot`\n * on the undo stack, and records NO snapshot if no rows actually move.\n * @param {Uint32Array} row_indices\n * @param {number} delta\n */\n move_rows_relative(row_indices, delta) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_relative(this.__wbg_ptr, ptr0, len0, delta);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Snap the specified rows to the bottom as a grouped contiguous block,\n * preserving their relative order.\n * @param {Uint32Array} row_indices\n */\n move_rows_to_bottom(row_indices) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_to_bottom(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Snap the specified rows to the top (index 0) as a grouped contiguous block,\n * preserving their relative order.\n * @param {Uint32Array} row_indices\n */\n move_rows_to_top(row_indices) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_to_top(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Move the specified rows up by 1 position, preserving relative spacing.\n * Rows already at the top (index 0) are skipped.\n * Returns success without creating an undo entry if no row moved.\n * @param {Uint32Array} row_indices\n */\n move_rows_up(row_indices) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_up(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Simultaneous block character change (substitution) on a subset of rows\n * and columns. Rows and columns outside `row_indices` and `col_indices`\n * are untouched. Out-of-range rows or columns are silently skipped.\n *\n * The entire operation is recorded as a single transaction in the undo stack.\n * Returns a typed error on validation failure; no rows are modified.\n * @param {Uint32Array} row_indices\n * @param {Uint32Array} col_indices\n * @param {number} new_base\n */\n mutate_base(row_indices, col_indices, new_base) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray32ToWasm0(col_indices, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_mutate_base(this.__wbg_ptr, ptr0, len0, ptr1, len1, new_base);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Construct an empty engine.\n */\n constructor() {\n const ret = wasm.msaengine_new();\n this.__wbg_ptr = ret;\n MsaEngineFinalization.register(this, this.__wbg_ptr, this);\n return this;\n }\n /**\n * Re-align all sequences in the matrix using MAFFT FFT-NS-1.\n * To use FFT-NS-1, initialize the MAFFT engine with `AlignmentMode::FftNs2` and set `with_retree(1)`.\n * This forces the number of tree build steps to 1, ensuring FFT-NS-1 behavior.\n *\n * Preserves all-gap or empty rows mid-edit by padding them with gaps to the resulting\n * alignment width. Explicitly strips existing gaps from sequences containing nucleotide\n * residues before progressive alignment.\n *\n * Captures a structural snapshot before modification so that the\n * entire re-alignment can be undone and redone via `undo()` and `redo()`.\n *\n * If there are fewer than 2 sequences, this is a safe no-op.\n */\n realign() {\n const ret = wasm.msaengine_realign(this.__wbg_ptr);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Redo the most recently undone command. Returns `true` if a redo was\n * applied, `false` if the redo stack is empty.\n * @returns {boolean}\n */\n redo() {\n const ret = wasm.msaengine_redo(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Number of commands on the redo stack.\n * @returns {number}\n */\n redo_depth() {\n const ret = wasm.msaengine_redo_depth(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @param {string} query\n * @param {boolean} check_record_names\n * @returns {any}\n */\n search(query, check_record_names) {\n const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_search(this.__wbg_ptr, ptr0, len0, check_record_names);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * When the translate function is called, it will check if there are any untranslated sequences and then translate all rows of nucleotide sequences for all reading frames.\n * Afterwards it will select the viewport of the translated amino acid sequences for the specified range and reading frame.\n *\n * Mirrors `update_viewport`'s conventions exactly: rows and columns are\n * inclusive (`[start, end]`), and every row contributes exactly\n * `(end_col - start_col + 1)` bytes, padding short rows with `b' '`.\n * Without this fixed stride, the worker's `bytes / cols` row count would\n * be wrong whenever a translated row is shorter than the requested\n * column range (which it almost always is, since amino acid frames are\n * ~1/3 the length of the nucleotide sequence).\n * @param {number} start_row\n * @param {number} end_row\n * @param {number} start_col\n * @param {number} end_col\n * @param {number} reading_frame\n * @returns {Uint8Array}\n */\n translate(start_row, end_row, start_col, end_col, reading_frame) {\n const ret = wasm.msaengine_translate(this.__wbg_ptr, start_row, end_row, start_col, end_col, reading_frame);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * Undo the most recent command. Returns `true` if an undo was applied,\n * `false` if the undo stack is empty.\n *\n * For `Substitutions`, the old bases are restored and the command is\n * pushed onto the redo stack. For `StructuralSnapshot`, the snapshot\n * becomes the current state and the *current* (post-edit) state is\n * captured as a new `StructuralSnapshot` on the redo stack so that redo\n * can re-apply the structural change.\n * @returns {boolean}\n */\n undo() {\n const ret = wasm.msaengine_undo(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Number of commands on the undo stack.\n * @returns {number}\n */\n undo_depth() {\n const ret = wasm.msaengine_undo_depth(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * Extract a windowed slice of the matrix into the reusable viewport buffer\n * and return it as a `Uint8Array`.\n *\n * The slice covers rows `[start_row, end_row]` inclusive and columns\n * `[start_col, end_col]` inclusive. Row indices are clamped to the\n * number of loaded sequences. Every row always contributes exactly\n * `(end_col - start_col + 1)` bytes; columns that lie beyond the end of\n * the sequence are filled with `b' '` (space). This keeps the buffer\n * strictly row-major with a fixed stride, so callers can index\n * `bytes[r * cols + c]` without inspecting per-row lengths.\n * @param {number} start_row\n * @param {number} end_row\n * @param {number} start_col\n * @param {number} end_col\n * @returns {Uint8Array}\n */\n update_viewport(start_row, end_row, start_col, end_col) {\n const ret = wasm.msaengine_update_viewport(this.__wbg_ptr, start_row, end_row, start_col, end_col);\n return ret;\n }\n /**\n * Extract a windowed slice and write it directly into a caller-provided\n * buffer (e.g. a `SharedArrayBuffer` view). Returns the number of bytes\n * written, or 0 if the slice is empty or out of range.\n *\n * This is the zero-copy-across-boundary path: the worker passes a\n * `Uint8Array` view backed by a `SharedArrayBuffer` that the main thread\n * also holds. The WASM engine writes into it via a single `memcpy` per\n * row, and the main thread reads the same memory directly. There is no\n * `postMessage` transfer of binary data, structured clone, or `ArrayBuffer.slice`.\n *\n * `out` must be at least as large as the worst-case slice\n * (`(end_row - start_row + 1) * (end_col - start_col + 1)` bytes).\n * @param {number} start_row\n * @param {number} end_row\n * @param {number} start_col\n * @param {number} end_col\n * @param {Uint8Array} out\n * @returns {number}\n */\n update_viewport_into(start_row, end_row, start_col, end_col, out) {\n var ptr0 = passArray8ToWasm0(out, wasm.__wbindgen_malloc);\n var len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_update_viewport_into(this.__wbg_ptr, start_row, end_row, start_col, end_col, ptr0, len0, out);\n return ret >>> 0;\n }\n}\nif (Symbol.dispose) MsaEngine.prototype[Symbol.dispose] = MsaEngine.prototype.free;\n\n/**\n * Standalone sequence alignment function for off-thread execution (e.g. AlignerWorker).\n * Takes a FASTA string (gapped or ungapped), re-aligns all sequences using MAFFT FFT-NS-1,\n * and returns the aligned result as a gapped FASTA string.\n * @param {string} fasta_content\n * @returns {string}\n */\nexport function align_fasta(fasta_content) {\n let deferred3_0;\n let deferred3_1;\n try {\n const ptr0 = passStringToWasm0(fasta_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.align_fasta(ptr0, len0);\n var ptr2 = ret[0];\n var len2 = ret[1];\n if (ret[3]) {\n ptr2 = 0; len2 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\nfunction __wbg_get_imports() {\n const import0 = {\n __proto__: null,\n __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {\n const ret = Error(getStringFromWasm0(arg0, arg1));\n return ret;\n },\n __wbg_String_8564e559799eccda: function(arg0, arg1) {\n const ret = String(arg1);\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n },\n __wbg___wbindgen_copy_to_typed_array_88899a52af046901: function(arg0, arg1, arg2) {\n new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));\n },\n __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n },\n __wbg_log_2778eeb36efc90b4: function(arg0, arg1) {\n console.log(getStringFromWasm0(arg0, arg1));\n },\n __wbg_new_1dbf7428bba60a42: function(arg0) {\n const ret = new Uint8Array(arg0);\n return ret;\n },\n __wbg_new_617a8cdb8bb1130e: function() {\n const ret = new Object();\n return ret;\n },\n __wbg_new_9e5d7afc79ed97a7: function(arg0) {\n const ret = new ArrayBuffer(arg0 >>> 0);\n return ret;\n },\n __wbg_new_ee2291f50781bf1d: function() {\n const ret = new Array();\n return ret;\n },\n __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {\n const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));\n return ret;\n },\n __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {\n arg0[arg1] = arg2;\n },\n __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {\n arg0[arg1 >>> 0] = arg2;\n },\n __wbindgen_generic_0000000000000001: function(arg0) {\n // Cast intrinsic for `F64 -> Externref`.\n const ret = arg0;\n return ret;\n },\n __wbindgen_generic_0000000000000002: function(arg0, arg1) {\n // Cast intrinsic for `Ref(String) -> Externref`.\n const ret = getStringFromWasm0(arg0, arg1);\n return ret;\n },\n __wbindgen_generic_0000000000000003: function(arg0) {\n // Cast intrinsic for `U64 -> Externref`.\n const ret = BigInt.asUintN(64, arg0);\n return ret;\n },\n __wbindgen_init_externref_table: function() {\n const table = wasm.__wbindgen_externrefs;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n },\n };\n return {\n __proto__: null,\n \"./sequence_editor_bg.js\": import0,\n };\n}\n\nconst MsaEngineFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_msaengine_free(ptr, 1));\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n\nlet cachedDataViewMemory0 = null;\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n return decodeText(ptr >>> 0, len);\n}\n\nlet cachedUint32ArrayMemory0 = null;\nfunction getUint32ArrayMemory0() {\n if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {\n cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);\n }\n return cachedUint32ArrayMemory0;\n}\n\nlet cachedUint8ArrayMemory0 = null;\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction passArray32ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 4, 4) >>> 0;\n getUint32ArrayMemory0().set(arg, ptr / 4);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1, 1) >>> 0;\n getUint8ArrayMemory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction takeFromExternrefTable0(idx) {\n const value = wasm.__wbindgen_externrefs.get(idx);\n wasm.__externref_table_dealloc(idx);\n return value;\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\ncachedTextDecoder.decode();\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst cachedTextEncoder = new TextEncoder();\n\nif (!('encodeInto' in cachedTextEncoder)) {\n cachedTextEncoder.encodeInto = function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n };\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet wasmModule, wasmInstance, wasm;\nfunction __wbg_finalize_init(instance, module) {\n wasmInstance = instance;\n wasm = instance.exports;\n wasmModule = module;\n cachedDataViewMemory0 = null;\n cachedUint32ArrayMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (!module.ok) {\n throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);\n }\n\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n const validResponse = expectedResponseType(module.type);\n\n if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {\n 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);\n\n } else { throw e; }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n\n function expectedResponseType(type) {\n switch (type) {\n case 'basic': case 'cors': case 'default': return true;\n }\n return false;\n }\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (module !== undefined) {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n const instance = new WebAssembly.Instance(module, imports);\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (module_or_path !== undefined) {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (module_or_path === undefined) {\n module_or_path = new URL('sequence_editor_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync, __wbg_init as default };\n"],"ignoreList":[0],"mappings":";AAKA,IAAMC,IAAc,OAAO,eAAe,GACpCC,IAAiB,OAAO,kBAAkB,GAC1CC,IAAe,OAAO,sBAAsB,GAC5CC,IAAY,OAAO,mBAAmB,GACtCC,IAAc,OAAO,gBAAgB,GACrCC,KAAY,MAAS,OAAOC,KAAQ,cAAYA,KAAiB,OAAOA,KAAQ,YAgDhFC,oBAAmB,IAAI,IAAI,CAC7B,CAAC,SAAS;CA5CV,YAAY,MAAQF,EAASC,CAAG,KAAKA,EAAIN;CACzC,UAAU,GAAK;EACX,IAAM,EAAE,UAAO,aAAU,IAAI,eAAe;EAE5C,OADAQ,EAAOC,GAAKC,CAAK,GACV,CAACC,GAAO,CAACA,CAAK,CAAC;CAC1B;CACA,YAAY,GAAM;EAEd,OADAC,EAAK,MAAM,GACJC,EAAKD,CAAI;CACpB;AAmC6B,CAAC,GAC9B,CAAC,SAAS;CA9BV,YAAY,MAAUP,EAASS,CAAK,KAAKV,KAAeU;CACxD,UAAU,EAAE,YAAS;EACjB,IAAIC;EAcJ,OAbA,AAWIA,IAXAD,aAAiB,QACJ;GACT,SAAS;GACT,OAAO;IACH,SAASA,EAAM;IACf,MAAMA,EAAM;IACZ,OAAOA,EAAM;GACjB;EACJ,IAGa;GAAE,SAAS;GAAO;EAAM,GAElC,CAACC,GAAY,CAAC,CAAC;CAC1B;CACA,YAAY,GAAY;EAIpB,MAHIA,EAAW,UACL,OAA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,OAAOoC,KAAmB,YAAa,OAAO,WAAY,cAAcA,aAA0B,WAAa,OAAO,OAAQ,cAAcA,aAA0B,SACtK,IAAiB,MAAMA,CAAc;CAGzC,IAAM,EAAE,aAAU,cAAW,MAAMP,EAAW,MAAMO,GAAgBL,CAAO;CAE3E,OAAOJ,EAAoBC,GAAUE,CAAM;AAC/C"}
|
|
1
|
+
{"version":3,"file":"sequence_editor.js","names":["ret","proxyMarker","createEndpoint","releaseProxy","finalizer","throwMarker","isObject","val","transferHandlers","expose","obj","port1","port2","port","wrap","value","serialized","isAllowedOrigin","allowedOrigin","allowedOrigins","origin","ep","callback","ev","argumentList","fromWireValue","returnValue","parent","path","prop","rawValue","type","proxy","transfer","wireValue","transferables","toWireValue","closeEndPoint","isMessagePort","endpoint","pendingListeners","data","resolver","createProxy","target","throwIfProxyReleased","isReleased","releaseEndpoint","requestResponseMessage","proxyCounter","proxyFinalizers","newCount","registerProxy","unregisterProxy","isProxyReleased","r","p","last","processArguments","rawArgumentList","myFlat","arr","processed","v","transferCache","transfers","name","handler","serializedValue","id","generateUUID","resolve","msg","MoveDirection","MsaEngine","ptr","MsaEngineFinalization","ptr0","passStringToWasm0","fasta_content","wasm","len0","WASM_VECTOR_LEN","ret","takeFromExternrefTable0","passArray32ToWasm0","row_indices","col_idx","row","col","deferred1_0","deferred1_1","getStringFromWasm0","ptr1","col_indices","len1","direction","target_row","delta","new_base","query","check_record_names","start_row","end_row","start_col","end_col","reading_frame","passArray8ToWasm0","out","align_fasta","deferred3_0","deferred3_1","ptr2","len2","__wbg_get_imports","arg0","arg1","getDataViewMemory0","arg2","getArrayU8FromWasm0","table","offset","getUint8ArrayMemory0","len","cachedDataViewMemory0","decodeText","cachedUint32ArrayMemory0","getUint32ArrayMemory0","cachedUint8ArrayMemory0","malloc","arg","realloc","buf","cachedTextEncoder","mem","code","view","idx","cachedTextDecoder","MAX_SAFARI_DECODE_BYTES","numBytesDecoded","__wbg_finalize_init","instance","__wbg_load","module","imports","e","expectedResponseType","bytes","__wbg_init","module_or_path"],"sources":["../../../../../../node_modules/.pnpm/comlink@4.4.2/node_modules/comlink/dist/esm/comlink.mjs","../../../engine/wasm/sequence_editor.js"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\nconst proxyMarker = Symbol(\"Comlink.proxy\");\nconst createEndpoint = Symbol(\"Comlink.endpoint\");\nconst releaseProxy = Symbol(\"Comlink.releaseProxy\");\nconst finalizer = Symbol(\"Comlink.finalizer\");\nconst throwMarker = Symbol(\"Comlink.thrown\");\nconst isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n/**\n * Internal transfer handle to handle objects marked to proxy.\n */\nconst proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n};\n/**\n * Internal transfer handler to handle thrown exceptions.\n */\nconst throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n};\n/**\n * Allows customizing the serialization of certain values.\n */\nconst transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n]);\nfunction isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n}\nfunction expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n}\nfunction isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n}\nfunction closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n}\nfunction wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener(\"message\", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n}\nfunction throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n}\nfunction releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n}\nconst proxyCounter = new WeakMap();\nconst proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\nfunction registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n}\nfunction unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n}\nfunction createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n}\nfunction myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n}\nfunction processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n}\nconst transferCache = new WeakMap();\nfunction transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n}\nfunction proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n}\nfunction windowEndpoint(w, context = globalThis, targetOrigin = \"*\") {\n return {\n postMessage: (msg, transferables) => w.postMessage(msg, targetOrigin, transferables),\n addEventListener: context.addEventListener.bind(context),\n removeEventListener: context.removeEventListener.bind(context),\n };\n}\nfunction toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n}\nfunction fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n}\nfunction requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n}\nfunction generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n}\n\nexport { createEndpoint, expose, finalizer, proxy, proxyMarker, releaseProxy, transfer, transferHandlers, windowEndpoint, wrap };\n//# sourceMappingURL=comlink.mjs.map\n","/* @ts-self-types=\"./sequence_editor.d.ts\" */\n\n/**\n * @enum {0 | 1 | 2 | 3}\n */\nexport const EditError = Object.freeze({\n DeleteNotGap: 0, \"0\": \"DeleteNotGap\",\n MutateNotIupac: 1, \"1\": \"MutateNotIupac\",\n MoveNoGapTarget: 2, \"2\": \"MoveNoGapTarget\",\n MoveNotIupac: 3, \"3\": \"MoveNotIupac\",\n});\n\n/**\n * Direction for horizontal character movement.\n * @enum {0 | 1}\n */\nexport const MoveDirection = Object.freeze({\n Left: 0, \"0\": \"Left\",\n Right: 1, \"1\": \"Right\",\n});\n\n/**\n * The core MSA engine. Owns the alignment matrix, row names, the reusable\n * viewport buffer, and the undo/redo stacks.\n */\nexport class MsaEngine {\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n MsaEngineFinalization.unregister(this);\n return ptr;\n }\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_msaengine_free(ptr, 0);\n }\n /**\n * Apply an externally aligned FASTA into the engine, recording a single\n * structural undo transaction so the alignment can be undone and redone\n * via `undo()` and `redo()`.\n *\n * Enforces strict validation:\n * - Sequence count must match the currently loaded matrix.\n * - All rows in the aligned FASTA must have equal length (uniform alignment width).\n * - Sequence headers and ordering must strictly match `self.names`.\n * - Ungapped nucleotide residue identities must be conserved for each sequence.\n * @param {string} fasta_content\n */\n apply_aligned_fasta(fasta_content) {\n const ptr0 = passStringToWasm0(fasta_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_apply_aligned_fasta(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Simultaneous deletion at a single column index on a subset of rows.\n * Only rows in `row_indices` are affected: the character at `col_idx`\n * is removed and a `-` is appended at the end to keep width unchanged.\n * Non-target rows are completely untouched.\n *\n * Returns `DeleteNotGap` if any target position contains a non-`-`\n * character; the operation is all-or-nothing.\n * @param {Uint32Array} row_indices\n * @param {number} col_idx\n */\n delete_at_subset(row_indices, col_idx) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_delete_at_subset(this.__wbg_ptr, ptr0, len0, col_idx);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Delete a column from every row, shrinking `alignment_width` by 1.\n * This is the width-preserving inverse of a full-column insert.\n * Returns success.\n * @param {number} col_idx\n */\n delete_column(col_idx) {\n const ret = wasm.msaengine_delete_column(this.__wbg_ptr, col_idx);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Delete one or more rows from the matrix by row index.\n *\n * Out-of-bounds indices are ignored, and duplicate indices are deduplicated.\n * If no valid in-bounds rows are specified or the matrix is already empty,\n * this is a safe no-op and records no undo snapshot.\n *\n * Otherwise, records a `StructuralSnapshot` before removing the rows,\n * removes the rows from both `nucleotide_sequences` and `names`, recomputes\n * `alignment_width` from the remaining sequences (or sets it to 0 if all\n * rows were deleted).\n * @param {Uint32Array} row_indices\n */\n delete_rows(row_indices) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_delete_rows(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Serialize the full matrix as a gapped FASTA.\n * Returns the bytes wrapped in a `js_sys::Uint8Array`.\n * Each record is emitted in its current row order and ends with a newline.\n * An empty engine exports an empty buffer.\n * @returns {Uint8Array}\n */\n export_gapped_fasta() {\n const ret = wasm.msaengine_export_gapped_fasta(this.__wbg_ptr);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * Serialize the current full matrix as an ungapped FASTA.\n * Meaning that all gap characters (`-`) are stripped from every sequence.\n * Returns the bytes wrapped in a `js_sys::Uint8Array`.\n * Each record is emitted in its current row order and ends with a newline.\n * An empty engine exports an empty buffer.\n * @returns {Uint8Array}\n */\n export_ungapped_fasta() {\n const ret = wasm.msaengine_export_ungapped_fasta(this.__wbg_ptr);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * Global alignment width (columns). Zero if nothing is loaded.\n * @returns {number}\n */\n get_alignment_width() {\n const ret = wasm.msaengine_get_alignment_width(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} row\n * @returns {Uint8Array}\n */\n get_aminoacid_view(row) {\n const ret = wasm.msaengine_get_aminoacid_view(this.__wbg_ptr, row);\n return ret;\n }\n /**\n * Return the raw byte at `(row, col)`, or `0` if out of range.\n * Useful for the test harness to spot-check individual cells.\n * @param {number} row\n * @param {number} col\n * @returns {number}\n */\n get_base(row, col) {\n const ret = wasm.msaengine_get_base(this.__wbg_ptr, row, col);\n return ret;\n }\n /**\n * Return the name/identifier of a given row, or an empty string if the\n * index is out of range.\n * @param {number} row\n * @returns {string}\n */\n get_name(row) {\n let deferred1_0;\n let deferred1_1;\n try {\n const ret = wasm.msaengine_get_name(this.__wbg_ptr, row);\n deferred1_0 = ret[0];\n deferred1_1 = ret[1];\n return getStringFromWasm0(ret[0], ret[1]);\n } finally {\n wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * Return the length of a specific row, or `0` if the row index is invalid.\n * @param {number} row\n * @returns {number}\n */\n get_row_length(row) {\n const ret = wasm.msaengine_get_row_length(this.__wbg_ptr, row);\n return ret >>> 0;\n }\n /**\n * Number of sequences currently loaded.\n * @returns {number}\n */\n get_sequence_count() {\n const ret = wasm.msaengine_get_sequence_count(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * Number of bytes currently held in the viewport buffer.\n * @returns {number}\n */\n get_viewport_len() {\n const ret = wasm.msaengine_get_viewport_len(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * Simultaneous gap insertion at a single column index on a subset of\n * rows. The inserted character is always `-` (gap). Target rows receive\n * the gap at the clamped insertion column; non-target rows have a `-`\n * appended at the end to keep matrix width consistent.\n *\n * Returns success; no validation is needed since only `-` can be inserted.\n * @param {Uint32Array} row_indices\n * @param {number} col_idx\n */\n insert_at_subset(row_indices, col_idx) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_insert_at_subset(this.__wbg_ptr, ptr0, len0, col_idx);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Parse FASTA content and prepend the parsed sequences in order ahead\n * of any existing rows.\n *\n * If the engine already contains state (sequences or undo/redo history),\n * a `StructuralSnapshot` is recorded so the addition can be undone.\n * If the engine is empty and has no history, no undo record is created\n * (`undo_depth == 0`).\n *\n * The global `alignment_width` is updated to `max(existing_width, batch_width)`.\n * Shorter sequences are NOT automatically padded in memory; callers can\n * detect ragged alignments via `get_row_length` and viewport extractions\n * pad with spaces.\n *\n * Returns the total sequence count on success. Invalid sequence characters\n * reject the load without changing the current engine state.\n * @param {string} fasta_content\n * @returns {number}\n */\n load_fasta(fasta_content) {\n const ptr0 = passStringToWasm0(fasta_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_load_fasta(this.__wbg_ptr, ptr0, len0);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return ret[0] >>> 0;\n }\n /**\n * Move a contiguous block of IUPAC characters horizontally by 1 position\n * across one or more rows. Each call moves exactly 1 position; callers must\n * issue multiple calls for multi-position moves.\n *\n * `col_indices` is treated as a range `[min, max]`, non-contiguous\n * indices are clamped to their min/max.\n *\n * **Left move:** validates the selected chars are IUPAC and the position\n * to the left is `-`, then rotates the block left by 1.\n *\n * **Right move:** validates the selected chars are IUPAC and the position\n * to the right is `-`, then rotates the block right by 1.\n *\n * The entire operation is recorded as a single transaction in the undo stack.\n * Returns a typed error on failure; the operation is all-or-nothing.\n * @param {Uint32Array} row_indices\n * @param {Uint32Array} col_indices\n * @param {MoveDirection} direction\n */\n move_horizontal(row_indices, col_indices, direction) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray32ToWasm0(col_indices, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_horizontal(this.__wbg_ptr, ptr0, len0, ptr1, len1, direction);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Move the specified rows down by 1 position, preserving relative spacing.\n * Rows already at the bottom are skipped.\n * Returns success without creating an undo entry if no row moved.\n * @param {Uint32Array} row_indices\n */\n move_rows_down(row_indices) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_down(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Move the specified rows and simultaneously group them into a contiguous\n * block placed starting at `target_row`. Selected rows preserve their\n * relative order within the group. Unselected rows preserve their relative\n * order around the inserted group.\n *\n * Clamps `target_row` to `0..=(N - selected_count)`.\n * Records at most ONE `StructuralSnapshot` on the undo stack, and NO snapshot\n * if the resulting order is unchanged.\n * @param {Uint32Array} row_indices\n * @param {number} target_row\n */\n move_rows_grouped(row_indices, target_row) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_grouped(this.__wbg_ptr, ptr0, len0, target_row);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Move the specified rows relative to their current positions by `delta`\n * steps (+ for down, - for up). Disjoint rows preserve their relative spacing\n * unless blocked by alignment boundaries. Rows hitting boundaries remain at\n * their boundary while other rows continue shifting.\n *\n * Even for multi-step shifts, this records at most ONE `StructuralSnapshot`\n * on the undo stack, and records NO snapshot if no rows actually move.\n * @param {Uint32Array} row_indices\n * @param {number} delta\n */\n move_rows_relative(row_indices, delta) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_relative(this.__wbg_ptr, ptr0, len0, delta);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Snap the specified rows to the bottom as a grouped contiguous block,\n * preserving their relative order.\n * @param {Uint32Array} row_indices\n */\n move_rows_to_bottom(row_indices) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_to_bottom(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Snap the specified rows to the top (index 0) as a grouped contiguous block,\n * preserving their relative order.\n * @param {Uint32Array} row_indices\n */\n move_rows_to_top(row_indices) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_to_top(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Move the specified rows up by 1 position, preserving relative spacing.\n * Rows already at the top (index 0) are skipped.\n * Returns success without creating an undo entry if no row moved.\n * @param {Uint32Array} row_indices\n */\n move_rows_up(row_indices) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_move_rows_up(this.__wbg_ptr, ptr0, len0);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Simultaneous block character change (substitution) on a subset of rows\n * and columns. Rows and columns outside `row_indices` and `col_indices`\n * are untouched. Out-of-range rows or columns are silently skipped.\n *\n * The entire operation is recorded as a single transaction in the undo stack.\n * Returns a typed error on validation failure; no rows are modified.\n * @param {Uint32Array} row_indices\n * @param {Uint32Array} col_indices\n * @param {number} new_base\n */\n mutate_base(row_indices, col_indices, new_base) {\n const ptr0 = passArray32ToWasm0(row_indices, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray32ToWasm0(col_indices, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_mutate_base(this.__wbg_ptr, ptr0, len0, ptr1, len1, new_base);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Construct an empty engine.\n */\n constructor() {\n const ret = wasm.msaengine_new();\n this.__wbg_ptr = ret;\n MsaEngineFinalization.register(this, this.__wbg_ptr, this);\n return this;\n }\n /**\n * Re-align all sequences in the matrix using MAFFT FFT-NS-1.\n * To use FFT-NS-1, initialize the MAFFT engine with `AlignmentMode::FftNs2` and set `with_retree(1)`.\n * This forces the number of tree build steps to 1, ensuring FFT-NS-1 behavior.\n *\n * Preserves all-gap or empty rows mid-edit by padding them with gaps to the resulting\n * alignment width. Explicitly strips existing gaps from sequences containing nucleotide\n * residues before progressive alignment.\n *\n * Captures a structural snapshot before modification so that the\n * entire re-alignment can be undone and redone via `undo()` and `redo()`.\n *\n * If there are fewer than 2 sequences, this is a safe no-op.\n */\n realign() {\n const ret = wasm.msaengine_realign(this.__wbg_ptr);\n if (ret[1]) {\n throw takeFromExternrefTable0(ret[0]);\n }\n }\n /**\n * Redo the most recently undone command. Returns `true` if a redo was\n * applied, `false` if the redo stack is empty.\n * @returns {boolean}\n */\n redo() {\n const ret = wasm.msaengine_redo(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Number of commands on the redo stack.\n * @returns {number}\n */\n redo_depth() {\n const ret = wasm.msaengine_redo_depth(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * Reset the engine to its initial empty state, clearing all sequences,\n * names, cached amino-acid translations, viewport buffer, and undo/redo history.\n */\n reset() {\n wasm.msaengine_reset(this.__wbg_ptr);\n }\n /**\n * @param {string} query\n * @param {boolean} check_record_names\n * @returns {any}\n */\n search(query, check_record_names) {\n const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_search(this.__wbg_ptr, ptr0, len0, check_record_names);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * When the translate function is called, it will check if there are any untranslated sequences and then translate all rows of nucleotide sequences for all reading frames.\n * Afterwards it will select the viewport of the translated amino acid sequences for the specified range and reading frame.\n *\n * Mirrors `update_viewport`'s conventions exactly: rows and columns are\n * inclusive (`[start, end]`), and every row contributes exactly\n * `(end_col - start_col + 1)` bytes, padding short rows with `b' '`.\n * Without this fixed stride, the worker's `bytes / cols` row count would\n * be wrong whenever a translated row is shorter than the requested\n * column range (which it almost always is, since amino acid frames are\n * ~1/3 the length of the nucleotide sequence).\n * @param {number} start_row\n * @param {number} end_row\n * @param {number} start_col\n * @param {number} end_col\n * @param {number} reading_frame\n * @returns {Uint8Array}\n */\n translate(start_row, end_row, start_col, end_col, reading_frame) {\n const ret = wasm.msaengine_translate(this.__wbg_ptr, start_row, end_row, start_col, end_col, reading_frame);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * Undo the most recent command. Returns `true` if an undo was applied,\n * `false` if the undo stack is empty.\n *\n * For `Substitutions`, the old bases are restored and the command is\n * pushed onto the redo stack. For `StructuralSnapshot`, the snapshot\n * becomes the current state and the *current* (post-edit) state is\n * captured as a new `StructuralSnapshot` on the redo stack so that redo\n * can re-apply the structural change.\n * @returns {boolean}\n */\n undo() {\n const ret = wasm.msaengine_undo(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Number of commands on the undo stack.\n * @returns {number}\n */\n undo_depth() {\n const ret = wasm.msaengine_undo_depth(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * Extract a windowed slice of the matrix into the reusable viewport buffer\n * and return it as a `Uint8Array`.\n *\n * The slice covers rows `[start_row, end_row]` inclusive and columns\n * `[start_col, end_col]` inclusive. Row indices are clamped to the\n * number of loaded sequences. Every row always contributes exactly\n * `(end_col - start_col + 1)` bytes; columns that lie beyond the end of\n * the sequence are filled with `b' '` (space). This keeps the buffer\n * strictly row-major with a fixed stride, so callers can index\n * `bytes[r * cols + c]` without inspecting per-row lengths.\n * @param {number} start_row\n * @param {number} end_row\n * @param {number} start_col\n * @param {number} end_col\n * @returns {Uint8Array}\n */\n update_viewport(start_row, end_row, start_col, end_col) {\n const ret = wasm.msaengine_update_viewport(this.__wbg_ptr, start_row, end_row, start_col, end_col);\n return ret;\n }\n /**\n * Extract a windowed slice and write it directly into a caller-provided\n * buffer (e.g. a `SharedArrayBuffer` view). Returns the number of bytes\n * written, or 0 if the slice is empty or out of range.\n *\n * This is the zero-copy-across-boundary path: the worker passes a\n * `Uint8Array` view backed by a `SharedArrayBuffer` that the main thread\n * also holds. The WASM engine writes into it via a single `memcpy` per\n * row, and the main thread reads the same memory directly. There is no\n * `postMessage` transfer of binary data, structured clone, or `ArrayBuffer.slice`.\n *\n * `out` must be at least as large as the worst-case slice\n * (`(end_row - start_row + 1) * (end_col - start_col + 1)` bytes).\n * @param {number} start_row\n * @param {number} end_row\n * @param {number} start_col\n * @param {number} end_col\n * @param {Uint8Array} out\n * @returns {number}\n */\n update_viewport_into(start_row, end_row, start_col, end_col, out) {\n var ptr0 = passArray8ToWasm0(out, wasm.__wbindgen_malloc);\n var len0 = WASM_VECTOR_LEN;\n const ret = wasm.msaengine_update_viewport_into(this.__wbg_ptr, start_row, end_row, start_col, end_col, ptr0, len0, out);\n return ret >>> 0;\n }\n}\nif (Symbol.dispose) MsaEngine.prototype[Symbol.dispose] = MsaEngine.prototype.free;\n\n/**\n * Standalone sequence alignment function for off-thread execution (e.g. AlignerWorker).\n * Takes a FASTA string (gapped or ungapped), re-aligns all sequences using MAFFT FFT-NS-1,\n * and returns the aligned result as a gapped FASTA string.\n * @param {string} fasta_content\n * @returns {string}\n */\nexport function align_fasta(fasta_content) {\n let deferred3_0;\n let deferred3_1;\n try {\n const ptr0 = passStringToWasm0(fasta_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.align_fasta(ptr0, len0);\n var ptr2 = ret[0];\n var len2 = ret[1];\n if (ret[3]) {\n ptr2 = 0; len2 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\nfunction __wbg_get_imports() {\n const import0 = {\n __proto__: null,\n __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {\n const ret = Error(getStringFromWasm0(arg0, arg1));\n return ret;\n },\n __wbg_String_8564e559799eccda: function(arg0, arg1) {\n const ret = String(arg1);\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n },\n __wbg___wbindgen_copy_to_typed_array_88899a52af046901: function(arg0, arg1, arg2) {\n new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));\n },\n __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n },\n __wbg_log_2778eeb36efc90b4: function(arg0, arg1) {\n console.log(getStringFromWasm0(arg0, arg1));\n },\n __wbg_new_1dbf7428bba60a42: function(arg0) {\n const ret = new Uint8Array(arg0);\n return ret;\n },\n __wbg_new_617a8cdb8bb1130e: function() {\n const ret = new Object();\n return ret;\n },\n __wbg_new_9e5d7afc79ed97a7: function(arg0) {\n const ret = new ArrayBuffer(arg0 >>> 0);\n return ret;\n },\n __wbg_new_ee2291f50781bf1d: function() {\n const ret = new Array();\n return ret;\n },\n __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {\n const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));\n return ret;\n },\n __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {\n arg0[arg1] = arg2;\n },\n __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {\n arg0[arg1 >>> 0] = arg2;\n },\n __wbindgen_generic_0000000000000001: function(arg0) {\n // Cast intrinsic for `F64 -> Externref`.\n const ret = arg0;\n return ret;\n },\n __wbindgen_generic_0000000000000002: function(arg0, arg1) {\n // Cast intrinsic for `Ref(String) -> Externref`.\n const ret = getStringFromWasm0(arg0, arg1);\n return ret;\n },\n __wbindgen_generic_0000000000000003: function(arg0) {\n // Cast intrinsic for `U64 -> Externref`.\n const ret = BigInt.asUintN(64, arg0);\n return ret;\n },\n __wbindgen_init_externref_table: function() {\n const table = wasm.__wbindgen_externrefs;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n },\n };\n return {\n __proto__: null,\n \"./sequence_editor_bg.js\": import0,\n };\n}\n\nconst MsaEngineFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_msaengine_free(ptr, 1));\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n\nlet cachedDataViewMemory0 = null;\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n return decodeText(ptr >>> 0, len);\n}\n\nlet cachedUint32ArrayMemory0 = null;\nfunction getUint32ArrayMemory0() {\n if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {\n cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);\n }\n return cachedUint32ArrayMemory0;\n}\n\nlet cachedUint8ArrayMemory0 = null;\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction passArray32ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 4, 4) >>> 0;\n getUint32ArrayMemory0().set(arg, ptr / 4);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1, 1) >>> 0;\n getUint8ArrayMemory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction takeFromExternrefTable0(idx) {\n const value = wasm.__wbindgen_externrefs.get(idx);\n wasm.__externref_table_dealloc(idx);\n return value;\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\ncachedTextDecoder.decode();\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst cachedTextEncoder = new TextEncoder();\n\nif (!('encodeInto' in cachedTextEncoder)) {\n cachedTextEncoder.encodeInto = function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n };\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet wasmModule, wasmInstance, wasm;\nfunction __wbg_finalize_init(instance, module) {\n wasmInstance = instance;\n wasm = instance.exports;\n wasmModule = module;\n cachedDataViewMemory0 = null;\n cachedUint32ArrayMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (!module.ok) {\n throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);\n }\n\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n const validResponse = expectedResponseType(module.type);\n\n if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {\n 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);\n\n } else { throw e; }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n\n function expectedResponseType(type) {\n switch (type) {\n case 'basic': case 'cors': case 'default': return true;\n }\n return false;\n }\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (module !== undefined) {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n const instance = new WebAssembly.Instance(module, imports);\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (module_or_path !== undefined) {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (module_or_path === undefined) {\n module_or_path = new URL('sequence_editor_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync, __wbg_init as default };\n"],"ignoreList":[0],"mappings":";AAKA,IAAMC,IAAc,OAAO,eAAe,GACpCC,IAAiB,OAAO,kBAAkB,GAC1CC,IAAe,OAAO,sBAAsB,GAC5CC,IAAY,OAAO,mBAAmB,GACtCC,IAAc,OAAO,gBAAgB,GACrCC,KAAY,MAAS,OAAOC,KAAQ,cAAYA,KAAiB,OAAOA,KAAQ,YAgDhFC,oBAAmB,IAAI,IAAI,CAC7B,CAAC,SAAS;CA5CV,YAAY,MAAQF,EAASC,CAAG,KAAKA,EAAIN;CACzC,UAAU,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