/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/fhevmjs@0.6.2/lib/web.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{JsonRpcProvider,BrowserProvider,Contract,isAddress,getAddress,ethers}from"ethers";import{toBigIntBE}from"bigint-buffer";import createKeccakHash from"keccak";import{threads}from"wasm-feature-detect";var global$1="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};async function startWorkers(t,e,a){if(0===a.numThreads())throw new Error("num_threads must be > 0.");const _={module:t,memory:e,receiver:a.receiver()};await Promise.all(Array.from({length:a.numThreads()},(async()=>{const t=new Worker(new URL("./workerHelpers.worker.js",import.meta.url),{type:"module"});return t.postMessage(_),await new Promise((e=>t.addEventListener("message",e,{once:!0}))),t}))),a.build()}let wasm$1;const heap=new Array(128).fill(void 0);heap.push(void 0,null,!0,!1);let heap_next=heap.length;function addHeapObject(t){heap_next===heap.length&&heap.push(heap.length+1);const e=heap_next;return heap_next=heap[e],heap[e]=t,e}function getObject(t){return heap[t]}function dropObject(t){t<132||(heap[t]=heap_next,heap_next=t)}function takeObject(t){const e=getObject(t);return dropObject(t),e}const cachedTextDecoder$1="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&cachedTextDecoder$1.decode();let cachedUint8ArrayMemory0$1=null;function getUint8ArrayMemory0$1(){return null!==cachedUint8ArrayMemory0$1&&cachedUint8ArrayMemory0$1.buffer===wasm$1.memory.buffer||(cachedUint8ArrayMemory0$1=new Uint8Array(wasm$1.memory.buffer)),cachedUint8ArrayMemory0$1}function getStringFromWasm0$1(t,e){return t>>>=0,cachedTextDecoder$1.decode(getUint8ArrayMemory0$1().slice(t,t+e))}let WASM_VECTOR_LEN$1=0;const cachedTextEncoder$1="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},encodeString$1=function(t,e){const a=cachedTextEncoder$1.encode(t);return e.set(a),{read:t.length,written:a.length}};function passStringToWasm0$1(t,e,a){if(void 0===a){const a=cachedTextEncoder$1.encode(t),_=e(a.length,1)>>>0;return getUint8ArrayMemory0$1().subarray(_,_+a.length).set(a),WASM_VECTOR_LEN$1=a.length,_}let _=t.length,n=e(_,1)>>>0;const i=getUint8ArrayMemory0$1();let r=0;for(;r<_;r++){const e=t.charCodeAt(r);if(e>127)break;i[n+r]=e}if(r!==_){0!==r&&(t=t.slice(r)),n=a(n,_,_=r+3*t.length,1)>>>0;const e=getUint8ArrayMemory0$1().subarray(n+r,n+_);r+=encodeString$1(t,e).written,n=a(n,_,r,1)>>>0}return WASM_VECTOR_LEN$1=r,n}function isLikeNone$1(t){return null==t}let cachedDataViewMemory0$1=null;function getDataViewMemory0$1(){return null!==cachedDataViewMemory0$1&&cachedDataViewMemory0$1.buffer===wasm$1.memory.buffer||(cachedDataViewMemory0$1=new DataView(wasm$1.memory.buffer)),cachedDataViewMemory0$1}function debugString$1(t){const e=typeof t;if("number"==e||"boolean"==e||null==t)return`${t}`;if("string"==e)return`"${t}"`;if("symbol"==e){const e=t.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=t.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(t)){const e=t.length;let a="[";e>0&&(a+=debugString$1(t[0]));for(let _=1;_<e;_++)a+=", "+debugString$1(t[_]);return a+="]",a}const a=/\[object ([^\]]+)\]/.exec(toString.call(t));let _;if(!(a.length>1))return toString.call(t);if(_=a[1],"Object"==_)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:_}function _assertClass$1(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);return t.ptr}function getArrayU8FromWasm0$1(t,e){return t>>>=0,getUint8ArrayMemory0$1().subarray(t/1,t/1+e)}function passArray8ToWasm0$1(t,e){const a=e(1*t.length,1)>>>0;return getUint8ArrayMemory0$1().set(t,a/1),WASM_VECTOR_LEN$1=t.length,a}function init_panic_hook(){wasm$1.init_panic_hook()}function handleError$1(t,e){try{return t.apply(this,e)}catch(t){wasm$1.__wbindgen_exn_store(addHeapObject(t))}}function initThreadPool(t){return takeObject(wasm$1.initThreadPool(t))}const ZkComputeLoad=Object.freeze({Proof:0,0:"Proof",Verify:1,1:"Verify"});"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_boolean_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_booleanciphertext_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_booleanclientkey_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_booleancompressedciphertext_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_booleancompressedserverkey_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_booleannoisedistribution_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_booleanparameters_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_booleanpublickey_free(t>>>0,1)));const CompactCiphertextListFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_compactciphertextlist_free(t>>>0,1)));class CompactCiphertextList{static __wrap(t){t>>>=0;const e=Object.create(CompactCiphertextList.prototype);return e.__wbg_ptr=t,CompactCiphertextListFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,CompactCiphertextListFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_compactciphertextlist_free(t,0)}static builder(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheCompactPublicKey),wasm$1.compactciphertextlist_builder(_,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return CompactCiphertextListBuilder.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}len(){return wasm$1.compactciphertextlist_len(this.__wbg_ptr)>>>0}is_empty(){return 0!==wasm$1.compactciphertextlist_is_empty(this.__wbg_ptr)}get_kind_of(t){const e=wasm$1.compactciphertextlist_get_kind_of(this.__wbg_ptr,t);return 30===e?void 0:e}expand(){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlist_expand(a,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(a+0,!0),e=getDataViewMemory0$1().getInt32(a+4,!0);if(getDataViewMemory0$1().getInt32(a+8,!0))throw takeObject(e);return CompactCiphertextListExpander.__wrap(t)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlist_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.compactciphertextlist_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return CompactCiphertextList.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlist_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.compactciphertextlist_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return CompactCiphertextList.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const CompactCiphertextListBuilderFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_compactciphertextlistbuilder_free(t>>>0,1)));class CompactCiphertextListBuilder{static __wrap(t){t>>>=0;const e=Object.create(CompactCiphertextListBuilder.prototype);return e.__wbg_ptr=t,CompactCiphertextListBuilderFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,CompactCiphertextListBuilderFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_compactciphertextlistbuilder_free(t,0)}push_u2(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u2(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u4(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u4(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u6(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u6(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u8(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u8(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u10(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u10(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u12(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u12(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u14(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u14(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u16(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u16(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u32(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u32(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u64(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u64(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i2(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i2(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i4(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i4(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i6(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i6(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i8(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i8(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i10(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i10(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i12(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i12(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i14(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i14(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i16(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i16(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i32(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i32(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i64(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i64(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u128(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u128(a,this.__wbg_ptr,addHeapObject(t));var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u160(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u160(a,this.__wbg_ptr,addHeapObject(t));var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u256(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u256(a,this.__wbg_ptr,addHeapObject(t));var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u512(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u512(a,this.__wbg_ptr,addHeapObject(t));var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u1024(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u1024(a,this.__wbg_ptr,addHeapObject(t));var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_u2048(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_u2048(a,this.__wbg_ptr,addHeapObject(t));var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i128(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i128(a,this.__wbg_ptr,addHeapObject(t));var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i160(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i160(a,this.__wbg_ptr,addHeapObject(t));var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_i256(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_i256(a,this.__wbg_ptr,addHeapObject(t));var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}push_boolean(t){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_push_boolean(a,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(a+0,!0);if(getDataViewMemory0$1().getInt32(a+4,!0))throw takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}build(){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_build(a,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(a+0,!0),e=getDataViewMemory0$1().getInt32(a+4,!0);if(getDataViewMemory0$1().getInt32(a+8,!0))throw takeObject(e);return CompactCiphertextList.__wrap(t)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}build_packed(){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistbuilder_build_packed(a,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(a+0,!0),e=getDataViewMemory0$1().getInt32(a+4,!0);if(getDataViewMemory0$1().getInt32(a+8,!0))throw takeObject(e);return CompactCiphertextList.__wrap(t)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}build_with_proof_packed(t,e,a){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,CompactPkePublicParams);const r=passArray8ToWasm0$1(e,wasm$1.__wbindgen_malloc),s=WASM_VECTOR_LEN$1;wasm$1.compactciphertextlistbuilder_build_with_proof_packed(i,this.__wbg_ptr,t.__wbg_ptr,r,s,a);var _=getDataViewMemory0$1().getInt32(i+0,!0),n=getDataViewMemory0$1().getInt32(i+4,!0);if(getDataViewMemory0$1().getInt32(i+8,!0))throw takeObject(n);return ProvenCompactCiphertextList.__wrap(_)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const CompactCiphertextListExpanderFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_compactciphertextlistexpander_free(t>>>0,1)));class CompactCiphertextListExpander{static __wrap(t){t>>>=0;const e=Object.create(CompactCiphertextListExpander.prototype);return e.__wbg_ptr=t,CompactCiphertextListExpanderFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,CompactCiphertextListExpanderFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_compactciphertextlistexpander_free(t,0)}get_uint2(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint2(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint2.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint4(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint4(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint4.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint6(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint6(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint6.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint8(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint8(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint8.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint10(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint10(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint10.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint12(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint12(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint12.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint14(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint14(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint14.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint16(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint16(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint16.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint32(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint32(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint32.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint64(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint64(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint64.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint128(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint128(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint128.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint160(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint160(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint160.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint256(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint256(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint256.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint512(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint512(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint512.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint1024(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint1024(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint1024.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_uint2048(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_uint2048(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint2048.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int2(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int2(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt2.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int4(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int4(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt4.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int6(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int6(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt6.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int8(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int8(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt8.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int10(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int10(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt10.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int12(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int12(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt12.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int14(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int14(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt14.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int16(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int16(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt16.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int32(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int32(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt32.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int64(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int64(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt64.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int128(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int128(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt128.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int160(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int160(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt160.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_int256(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_int256(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt256.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}get_bool(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactciphertextlistexpander_get_bool(_,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheBool.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}len(){return wasm$1.compactciphertextlistexpander_len(this.__wbg_ptr)>>>0}is_empty(){return 0!==wasm$1.compactciphertextlistexpander_is_empty(this.__wbg_ptr)}get_kind_of(t){const e=wasm$1.compactciphertextlistexpander_get_kind_of(this.__wbg_ptr,t);return 30===e?void 0:e}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compactpkecrs_free(t>>>0,1)));const CompactPkePublicParamsFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_compactpkepublicparams_free(t>>>0,1)));class CompactPkePublicParams{static __wrap(t){t>>>=0;const e=Object.create(CompactPkePublicParams.prototype);return e.__wbg_ptr=t,CompactPkePublicParamsFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,CompactPkePublicParamsFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_compactpkepublicparams_free(t,0)}serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactpkepublicparams_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.compactpkepublicparams_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return CompactPkePublicParams.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.compactpkepublicparams_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.compactpkepublicparams_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return CompactPkePublicParams.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfhebool_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint10_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint12_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint128_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint14_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint16_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint160_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint2_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint256_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint32_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint4_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint6_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint64_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheint8_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint10_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint1024_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint12_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint128_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint14_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint16_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint160_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint2_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint2048_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint256_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint32_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint4_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint512_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint6_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint64_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_compressedfheuint8_free(t>>>0,1)));const FheBoolFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fhebool_free(t>>>0,1)));class FheBool{static __wrap(t){t>>>=0;const e=Object.create(FheBool.prototype);return e.__wbg_ptr=t,FheBoolFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheBoolFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fhebool_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fhebool_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheBool.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fhebool_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheBool.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fhebool_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheBool.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fhebool_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return 0!==e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fhebool_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fhebool_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheBool.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fhebool_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fhebool_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheBool.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt10Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint10_free(t>>>0,1)));class FheInt10{static __wrap(t){t>>>=0;const e=Object.create(FheInt10.prototype);return e.__wbg_ptr=t,FheInt10Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt10Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint10_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint10_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt10.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint10_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt10.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint10_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt10.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint10_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint10_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint10_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt10.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint10_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint10_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt10.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt12Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint12_free(t>>>0,1)));class FheInt12{static __wrap(t){t>>>=0;const e=Object.create(FheInt12.prototype);return e.__wbg_ptr=t,FheInt12Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt12Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint12_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint12_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt12.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint12_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt12.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint12_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt12.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint10_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint12_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint12_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt12.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint12_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint12_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt12.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt128Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint128_free(t>>>0,1)));class FheInt128{static __wrap(t){t>>>=0;const e=Object.create(FheInt128.prototype);return e.__wbg_ptr=t,FheInt128Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt128Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint128_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint128_encrypt_with_client_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt128.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint128_encrypt_with_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt128.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint128_encrypt_with_compressed_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt128.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint128_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint128_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint128_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt128.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint128_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint128_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt128.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt14Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint14_free(t>>>0,1)));class FheInt14{static __wrap(t){t>>>=0;const e=Object.create(FheInt14.prototype);return e.__wbg_ptr=t,FheInt14Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt14Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint14_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint14_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt14.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint14_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt14.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint14_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt14.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint10_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint14_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint14_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt14.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint14_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint14_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt14.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt16Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint16_free(t>>>0,1)));class FheInt16{static __wrap(t){t>>>=0;const e=Object.create(FheInt16.prototype);return e.__wbg_ptr=t,FheInt16Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt16Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint16_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint16_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt16.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint16_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt16.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint16_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt16.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint10_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint16_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint16_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt16.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint16_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint16_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt16.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt160Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint160_free(t>>>0,1)));class FheInt160{static __wrap(t){t>>>=0;const e=Object.create(FheInt160.prototype);return e.__wbg_ptr=t,FheInt160Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt160Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint160_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint160_encrypt_with_client_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt160.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint160_encrypt_with_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt160.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint160_encrypt_with_compressed_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt160.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint160_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint160_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint160_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt160.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint160_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint160_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt160.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt2Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint2_free(t>>>0,1)));class FheInt2{static __wrap(t){t>>>=0;const e=Object.create(FheInt2.prototype);return e.__wbg_ptr=t,FheInt2Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt2Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint2_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint2_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt2.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint2_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt2.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint2_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt2.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint2_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint2_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint2_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt2.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint2_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint2_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt2.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt256Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint256_free(t>>>0,1)));class FheInt256{static __wrap(t){t>>>=0;const e=Object.create(FheInt256.prototype);return e.__wbg_ptr=t,FheInt256Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt256Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint256_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint256_encrypt_with_client_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt256.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint256_encrypt_with_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt256.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint256_encrypt_with_compressed_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt256.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint160_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint256_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint256_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt256.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint256_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint256_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt256.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt32Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint32_free(t>>>0,1)));class FheInt32{static __wrap(t){t>>>=0;const e=Object.create(FheInt32.prototype);return e.__wbg_ptr=t,FheInt32Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt32Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint32_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint32_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt32.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint32_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt32.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint32_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt32.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint32_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint32_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint32_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt32.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint32_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint32_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt32.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt4Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint4_free(t>>>0,1)));class FheInt4{static __wrap(t){t>>>=0;const e=Object.create(FheInt4.prototype);return e.__wbg_ptr=t,FheInt4Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt4Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint4_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint4_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt4.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint4_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt4.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint4_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt4.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint2_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint4_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint4_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt4.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint4_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint4_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt4.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt6Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint6_free(t>>>0,1)));class FheInt6{static __wrap(t){t>>>=0;const e=Object.create(FheInt6.prototype);return e.__wbg_ptr=t,FheInt6Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt6Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint6_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint6_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt6.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint6_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt6.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint6_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt6.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint2_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint6_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint6_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt6.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint6_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint6_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt6.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt64Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint64_free(t>>>0,1)));class FheInt64{static __wrap(t){t>>>=0;const e=Object.create(FheInt64.prototype);return e.__wbg_ptr=t,FheInt64Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt64Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint64_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint64_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt64.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint64_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt64.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint64_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt64.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint64_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getBigInt64(_+0,!0),a=getDataViewMemory0$1().getInt32(_+8,!0);if(getDataViewMemory0$1().getInt32(_+12,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint64_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint64_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt64.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint64_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint64_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt64.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheInt8Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheint8_free(t>>>0,1)));class FheInt8{static __wrap(t){t>>>=0;const e=Object.create(FheInt8.prototype);return e.__wbg_ptr=t,FheInt8Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheInt8Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheint8_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheint8_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt8.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheint8_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt8.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheint8_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt8.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheint2_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint8_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheint8_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheInt8.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheint8_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheint8_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheInt8.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint10Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint10_free(t>>>0,1)));class FheUint10{static __wrap(t){t>>>=0;const e=Object.create(FheUint10.prototype);return e.__wbg_ptr=t,FheUint10Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint10Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint10_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint10_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint10.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint10_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint10.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint10_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint10.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint10_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint10_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint10_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint10.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint10_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint10_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint10.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint1024Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint1024_free(t>>>0,1)));class FheUint1024{static __wrap(t){t>>>=0;const e=Object.create(FheUint1024.prototype);return e.__wbg_ptr=t,FheUint1024Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint1024Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint1024_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint1024_encrypt_with_client_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint1024.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint1024_encrypt_with_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint1024.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint1024_encrypt_with_compressed_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint1024.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint1024_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint1024_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint1024_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint1024.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint1024_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint1024_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint1024.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint12Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint12_free(t>>>0,1)));class FheUint12{static __wrap(t){t>>>=0;const e=Object.create(FheUint12.prototype);return e.__wbg_ptr=t,FheUint12Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint12Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint12_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint12_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint12.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint12_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint12.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint12_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint12.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint10_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint12_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint12_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint12.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint12_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint12_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint12.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint128Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint128_free(t>>>0,1)));class FheUint128{static __wrap(t){t>>>=0;const e=Object.create(FheUint128.prototype);return e.__wbg_ptr=t,FheUint128Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint128Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint128_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint128_encrypt_with_client_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint128.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint128_encrypt_with_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint128.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint128_encrypt_with_compressed_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint128.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint128_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint128_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint128_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint128.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint128_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint128_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint128.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint14Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint14_free(t>>>0,1)));class FheUint14{static __wrap(t){t>>>=0;const e=Object.create(FheUint14.prototype);return e.__wbg_ptr=t,FheUint14Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint14Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint14_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint14_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint14.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint14_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint14.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint14_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint14.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint10_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint14_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint14_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint14.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint14_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint14_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint14.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint16Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint16_free(t>>>0,1)));class FheUint16{static __wrap(t){t>>>=0;const e=Object.create(FheUint16.prototype);return e.__wbg_ptr=t,FheUint16Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint16Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint16_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint16_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint16.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint16_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint16.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint16_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint16.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint10_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint16_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint16_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint16.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint16_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint16_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint16.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint160Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint160_free(t>>>0,1)));class FheUint160{static __wrap(t){t>>>=0;const e=Object.create(FheUint160.prototype);return e.__wbg_ptr=t,FheUint160Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint160Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint160_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint160_encrypt_with_client_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint160.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint160_encrypt_with_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint160.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint160_encrypt_with_compressed_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint160.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint160_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint160_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint160_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint160.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint160_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint160_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint160.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint2Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint2_free(t>>>0,1)));class FheUint2{static __wrap(t){t>>>=0;const e=Object.create(FheUint2.prototype);return e.__wbg_ptr=t,FheUint2Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint2Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint2_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint2_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint2.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint2_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint2.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint2_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint2.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint2_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint2_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint2_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint2.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint2_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint2_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint2.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint2048Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint2048_free(t>>>0,1)));class FheUint2048{static __wrap(t){t>>>=0;const e=Object.create(FheUint2048.prototype);return e.__wbg_ptr=t,FheUint2048Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint2048Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint2048_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint2048_encrypt_with_client_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint2048.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint2048_encrypt_with_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint2048.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint2048_encrypt_with_compressed_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint2048.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint2048_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint2048_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint2048_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint2048.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint2048_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint2048_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint2048.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint256Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint256_free(t>>>0,1)));class FheUint256{static __wrap(t){t>>>=0;const e=Object.create(FheUint256.prototype);return e.__wbg_ptr=t,FheUint256Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint256Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint256_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint256_encrypt_with_client_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint256.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint256_encrypt_with_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint256.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint256_encrypt_with_compressed_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint256.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint160_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint256_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint256_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint256.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint256_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint256_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint256.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint32Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint32_free(t>>>0,1)));class FheUint32{static __wrap(t){t>>>=0;const e=Object.create(FheUint32.prototype);return e.__wbg_ptr=t,FheUint32Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint32Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint32_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint32_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint32.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint32_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint32.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint32_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint32.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint32_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e>>>0}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint32_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint32_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint32.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint32_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint32_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint32.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint4Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint4_free(t>>>0,1)));class FheUint4{static __wrap(t){t>>>=0;const e=Object.create(FheUint4.prototype);return e.__wbg_ptr=t,FheUint4Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint4Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint4_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint4_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint4.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint4_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint4.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint4_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint4.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint2_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint4_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint4_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint4.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint4_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint4_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint4.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint512Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint512_free(t>>>0,1)));class FheUint512{static __wrap(t){t>>>=0;const e=Object.create(FheUint512.prototype);return e.__wbg_ptr=t,FheUint512Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint512Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint512_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint512_encrypt_with_client_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint512.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint512_encrypt_with_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint512.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint512_encrypt_with_compressed_public_key(n,addHeapObject(t),e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint512.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint512_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return takeObject(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint512_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint512_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint512.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint512_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint512_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint512.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint6Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint6_free(t>>>0,1)));class FheUint6{static __wrap(t){t>>>=0;const e=Object.create(FheUint6.prototype);return e.__wbg_ptr=t,FheUint6Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint6Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint6_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint6_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint6.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint6_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint6.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint6_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint6.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint2_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint6_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint6_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint6.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint6_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint6_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint6.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint64Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint64_free(t>>>0,1)));class FheUint64{static __wrap(t){t>>>=0;const e=Object.create(FheUint64.prototype);return e.__wbg_ptr=t,FheUint64Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint64Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint64_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint64_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint64.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint64_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint64.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint64_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint64.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint64_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getBigInt64(_+0,!0),a=getDataViewMemory0$1().getInt32(_+8,!0);if(getDataViewMemory0$1().getInt32(_+12,!0))throw takeObject(a);return BigInt.asUintN(64,e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint64_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint64_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint64.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint64_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint64_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint64.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const FheUint8Finalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_fheuint8_free(t>>>0,1)));class FheUint8{static __wrap(t){t>>>=0;const e=Object.create(FheUint8.prototype);return e.__wbg_ptr=t,FheUint8Finalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,FheUint8Finalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_fheuint8_free(t,0)}static encrypt_with_client_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheClientKey),wasm$1.fheuint8_encrypt_with_client_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint8.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfhePublicKey),wasm$1.fheuint8_encrypt_with_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint8.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static encrypt_with_compressed_public_key(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,TfheCompressedPublicKey),wasm$1.fheuint8_encrypt_with_compressed_public_key(n,t,e.__wbg_ptr);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint8.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.fheuint2_decrypt(_,this.__wbg_ptr,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return e}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint8_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.fheuint8_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return FheUint8.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.fheuint8_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.fheuint8_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return FheUint8.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const ProvenCompactCiphertextListFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_provencompactciphertextlist_free(t>>>0,1)));class ProvenCompactCiphertextList{static __wrap(t){t>>>=0;const e=Object.create(ProvenCompactCiphertextList.prototype);return e.__wbg_ptr=t,ProvenCompactCiphertextListFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ProvenCompactCiphertextListFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_provencompactciphertextlist_free(t,0)}static builder(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheCompactPublicKey),wasm$1.provencompactciphertextlist_builder(_,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return CompactCiphertextListBuilder.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}len(){return wasm$1.provencompactciphertextlist_len(this.__wbg_ptr)>>>0}is_empty(){return 0!==wasm$1.provencompactciphertextlist_is_empty(this.__wbg_ptr)}get_kind_of(t){const e=wasm$1.provencompactciphertextlist_get_kind_of(this.__wbg_ptr,t);return 30===e?void 0:e}verify_and_expand(t,e,a){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,CompactPkePublicParams),_assertClass$1(e,TfheCompactPublicKey);const r=passArray8ToWasm0$1(a,wasm$1.__wbindgen_malloc),s=WASM_VECTOR_LEN$1;wasm$1.provencompactciphertextlist_verify_and_expand(i,this.__wbg_ptr,t.__wbg_ptr,e.__wbg_ptr,r,s);var _=getDataViewMemory0$1().getInt32(i+0,!0),n=getDataViewMemory0$1().getInt32(i+4,!0);if(getDataViewMemory0$1().getInt32(i+8,!0))throw takeObject(n);return CompactCiphertextListExpander.__wrap(_)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}expand_without_verification(){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.provencompactciphertextlist_expand_without_verification(a,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(a+0,!0),e=getDataViewMemory0$1().getInt32(a+4,!0);if(getDataViewMemory0$1().getInt32(a+8,!0))throw takeObject(e);return CompactCiphertextListExpander.__wrap(t)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.provencompactciphertextlist_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.provencompactciphertextlist_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return ProvenCompactCiphertextList.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.provencompactciphertextlist_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.provencompactciphertextlist_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return ProvenCompactCiphertextList.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_shortint_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_shortintciphertext_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_shortintclientkey_free(t>>>0,1)));const ShortintCompactPublicKeyEncryptionParametersFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_shortintcompactpublickeyencryptionparameters_free(t>>>0,1)));class ShortintCompactPublicKeyEncryptionParameters{static __wrap(t){t>>>=0;const e=Object.create(ShortintCompactPublicKeyEncryptionParameters.prototype);return e.__wbg_ptr=t,ShortintCompactPublicKeyEncryptionParametersFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ShortintCompactPublicKeyEncryptionParametersFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_shortintcompactpublickeyencryptionparameters_free(t,0)}constructor(t){const e=wasm$1.shortintcompactpublickeyencryptionparameters_new(t);return this.__wbg_ptr=e>>>0,ShortintCompactPublicKeyEncryptionParametersFinalization.register(this,this.__wbg_ptr,this),this}static new_parameters(t,e,a,_,n,i,r,s){try{const g=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(e,ShortintNoiseDistribution),wasm$1.shortintcompactpublickeyencryptionparameters_new_parameters(g,t,e.__wbg_ptr,a,_,n,i,r,s);var o=getDataViewMemory0$1().getInt32(g+0,!0),w=getDataViewMemory0$1().getInt32(g+4,!0);if(getDataViewMemory0$1().getInt32(g+8,!0))throw takeObject(w);return ShortintCompactPublicKeyEncryptionParameters.__wrap(o)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_shortintcompressedciphertext_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_shortintcompressedpublickey_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_shortintcompressedserverkey_free(t>>>0,1)));const ShortintNoiseDistributionFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_shortintnoisedistribution_free(t>>>0,1)));class ShortintNoiseDistribution{static __wrap(t){t>>>=0;const e=Object.create(ShortintNoiseDistribution.prototype);return e.__wbg_ptr=t,ShortintNoiseDistributionFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ShortintNoiseDistributionFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_shortintnoisedistribution_free(t,0)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_shortintparameters_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_shortintpublickey_free(t>>>0,1)));const TfheClientKeyFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_tfheclientkey_free(t>>>0,1)));class TfheClientKey{static __wrap(t){t>>>=0;const e=Object.create(TfheClientKey.prototype);return e.__wbg_ptr=t,TfheClientKeyFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,TfheClientKeyFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_tfheclientkey_free(t,0)}static generate(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheConfig),wasm$1.tfheclientkey_generate(_,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return TfheClientKey.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static generate_with_seed(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheConfig),wasm$1.tfheclientkey_generate_with_seed(n,t.__wbg_ptr,addHeapObject(e));var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return TfheClientKey.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.tfheclientkey_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.tfheclientkey_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return TfheClientKey.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.tfheclientkey_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.tfheclientkey_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return TfheClientKey.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}const TfheCompactPublicKeyFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_tfhecompactpublickey_free(t>>>0,1)));class TfheCompactPublicKey{static __wrap(t){t>>>=0;const e=Object.create(TfheCompactPublicKey.prototype);return e.__wbg_ptr=t,TfheCompactPublicKeyFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,TfheCompactPublicKeyFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_tfhecompactpublickey_free(t,0)}static new(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.tfhecompactpublickey_new(_,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return TfheCompactPublicKey.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.tfhecompactpublickey_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.tfhecompactpublickey_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return TfheCompactPublicKey.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.tfhecompactpublickey_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.tfhecompactpublickey_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return TfheCompactPublicKey.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize_conformant(t,e,a){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16),r=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),s=WASM_VECTOR_LEN$1;_assertClass$1(a,ShortintCompactPublicKeyEncryptionParameters),wasm$1.tfhecompactpublickey_safe_deserialize_conformant(i,r,s,e,a.__wbg_ptr);var _=getDataViewMemory0$1().getInt32(i+0,!0),n=getDataViewMemory0$1().getInt32(i+4,!0);if(getDataViewMemory0$1().getInt32(i+8,!0))throw takeObject(n);return TfheCompactPublicKey.__wrap(_)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_tfhecompressedcompactpublickey_free(t>>>0,1)));const TfheCompressedPublicKeyFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_tfhecompressedpublickey_free(t>>>0,1)));class TfheCompressedPublicKey{static __wrap(t){t>>>=0;const e=Object.create(TfheCompressedPublicKey.prototype);return e.__wbg_ptr=t,TfheCompressedPublicKeyFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,TfheCompressedPublicKeyFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_tfhecompressedpublickey_free(t,0)}static new(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.tfhecompressedpublickey_new(_,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return TfheCompressedPublicKey.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}decompress(){try{const a=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.tfhecompressedpublickey_decompress(a,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(a+0,!0),e=getDataViewMemory0$1().getInt32(a+4,!0);if(getDataViewMemory0$1().getInt32(a+8,!0))throw takeObject(e);return TfhePublicKey.__wrap(t)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.tfhecompressedpublickey_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.tfhecompressedpublickey_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return TfheCompressedPublicKey.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.tfhecompressedpublickey_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.tfhecompressedpublickey_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return TfheCompressedPublicKey.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_tfhecompressedserverkey_free(t>>>0,1)));const TfheConfigFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_tfheconfig_free(t>>>0,1)));class TfheConfig{static __wrap(t){t>>>=0;const e=Object.create(TfheConfig.prototype);return e.__wbg_ptr=t,TfheConfigFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,TfheConfigFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_tfheconfig_free(t,0)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_tfheconfigbuilder_free(t>>>0,1)));const TfhePublicKeyFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_tfhepublickey_free(t>>>0,1)));class TfhePublicKey{static __wrap(t){t>>>=0;const e=Object.create(TfhePublicKey.prototype);return e.__wbg_ptr=t,TfhePublicKeyFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,TfhePublicKeyFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_tfhepublickey_free(t,0)}static new(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16);_assertClass$1(t,TfheClientKey),wasm$1.tfhepublickey_new(_,t.__wbg_ptr);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return TfhePublicKey.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}serialize(){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.tfhepublickey_serialize(n,this.__wbg_ptr);var t=getDataViewMemory0$1().getInt32(n+0,!0),e=getDataViewMemory0$1().getInt32(n+4,!0),a=getDataViewMemory0$1().getInt32(n+8,!0);if(getDataViewMemory0$1().getInt32(n+12,!0))throw takeObject(a);var _=getArrayU8FromWasm0$1(t,e).slice();return wasm$1.__wbindgen_free(t,1*e,1),_}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static deserialize(t){try{const _=wasm$1.__wbindgen_add_to_stack_pointer(-16),n=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),i=WASM_VECTOR_LEN$1;wasm$1.tfhepublickey_deserialize(_,n,i);var e=getDataViewMemory0$1().getInt32(_+0,!0),a=getDataViewMemory0$1().getInt32(_+4,!0);if(getDataViewMemory0$1().getInt32(_+8,!0))throw takeObject(a);return TfhePublicKey.__wrap(e)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}safe_serialize(t){try{const i=wasm$1.__wbindgen_add_to_stack_pointer(-16);wasm$1.tfhepublickey_safe_serialize(i,this.__wbg_ptr,t);var e=getDataViewMemory0$1().getInt32(i+0,!0),a=getDataViewMemory0$1().getInt32(i+4,!0),_=getDataViewMemory0$1().getInt32(i+8,!0);if(getDataViewMemory0$1().getInt32(i+12,!0))throw takeObject(_);var n=getArrayU8FromWasm0$1(e,a).slice();return wasm$1.__wbindgen_free(e,1*a,1),n}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}static safe_deserialize(t,e){try{const n=wasm$1.__wbindgen_add_to_stack_pointer(-16),i=passArray8ToWasm0$1(t,wasm$1.__wbindgen_malloc),r=WASM_VECTOR_LEN$1;wasm$1.tfhepublickey_safe_deserialize(n,i,r,e);var a=getDataViewMemory0$1().getInt32(n+0,!0),_=getDataViewMemory0$1().getInt32(n+4,!0);if(getDataViewMemory0$1().getInt32(n+8,!0))throw takeObject(_);return TfhePublicKey.__wrap(a)}finally{wasm$1.__wbindgen_add_to_stack_pointer(16)}}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_tfheserverkey_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm$1.__wbg_tfhe_free(t>>>0,1)));const wbg_rayon_PoolBuilderFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm$1.__wbg_wbg_rayon_poolbuilder_free(t>>>0,1)));class wbg_rayon_PoolBuilder{static __wrap(t){t>>>=0;const e=Object.create(wbg_rayon_PoolBuilder.prototype);return e.__wbg_ptr=t,wbg_rayon_PoolBuilderFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,wbg_rayon_PoolBuilderFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm$1.__wbg_wbg_rayon_poolbuilder_free(t,0)}numThreads(){return wasm$1.wbg_rayon_poolbuilder_numThreads(this.__wbg_ptr)>>>0}receiver(){return wasm$1.wbg_rayon_poolbuilder_receiver(this.__wbg_ptr)>>>0}build(){wasm$1.wbg_rayon_poolbuilder_build(this.__wbg_ptr)}}async function __wbg_load$1(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(e){if("application/wasm"==t.headers.get("Content-Type"))throw e;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)}const a=await t.arrayBuffer();return await WebAssembly.instantiate(a,e)}{const a=await WebAssembly.instantiate(t,e);return a instanceof WebAssembly.Instance?{instance:a,module:t}:a}}function __wbg_get_imports$1(){const t={wbg:{}};return t.wbg.__wbindgen_number_new=function(t){return addHeapObject(t)},t.wbg.__wbindgen_object_drop_ref=function(t){takeObject(t)},t.wbg.__wbindgen_error_new=function(t,e){return addHeapObject(new Error(getStringFromWasm0$1(t,e)))},t.wbg.__wbindgen_bigint_from_u64=function(t){return addHeapObject(BigInt.asUintN(64,t))},t.wbg.__wbindgen_shr=function(t,e){return addHeapObject(getObject(t)>>getObject(e))},t.wbg.__wbindgen_jsval_eq=function(t,e){return getObject(t)===getObject(e)},t.wbg.__wbindgen_lt=function(t,e){return getObject(t)<getObject(e)},t.wbg.__wbindgen_neg=function(t){return addHeapObject(-getObject(t))},t.wbg.__wbindgen_bigint_from_str=function(t,e){return addHeapObject(BigInt(getStringFromWasm0$1(t,e)))},t.wbg.__wbindgen_bit_and=function(t,e){return addHeapObject(getObject(t)&getObject(e))},t.wbg.__wbindgen_bigint_from_i128=function(t,e){return addHeapObject(t<<BigInt(64)|BigInt.asUintN(64,e))},t.wbg.__wbindgen_bigint_from_i64=function(t){return addHeapObject(t)},t.wbg.__wbindgen_ge=function(t,e){return getObject(t)>=getObject(e)},t.wbg.__wbindgen_object_clone_ref=function(t){return addHeapObject(getObject(t))},t.wbg.__wbindgen_bigint_from_u128=function(t,e){return addHeapObject(BigInt.asUintN(64,t)<<BigInt(64)|BigInt.asUintN(64,e))},t.wbg.__wbindgen_shl=function(t,e){return addHeapObject(getObject(t)<<getObject(e))},t.wbg.__wbindgen_bit_or=function(t,e){return addHeapObject(getObject(t)|getObject(e))},t.wbg.__wbg_new_abda76e883ba8a5f=function(){return addHeapObject(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(t,e){const a=passStringToWasm0$1(getObject(e).stack,wasm$1.__wbindgen_malloc,wasm$1.__wbindgen_realloc),_=WASM_VECTOR_LEN$1;getDataViewMemory0$1().setInt32(t+4,_,!0),getDataViewMemory0$1().setInt32(t+0,a,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(t,e){let a,_;try{a=t,_=e,console.error(getStringFromWasm0$1(t,e))}finally{wasm$1.__wbindgen_free(a,_,1)}},t.wbg.__wbg_crypto_1d1f22824a6a080c=function(t){return addHeapObject(getObject(t).crypto)},t.wbg.__wbindgen_is_object=function(t){const e=getObject(t);return"object"==typeof e&&null!==e},t.wbg.__wbg_process_4a72847cc503995b=function(t){return addHeapObject(getObject(t).process)},t.wbg.__wbg_versions_f686565e586dd935=function(t){return addHeapObject(getObject(t).versions)},t.wbg.__wbg_node_104a2ff8d6ea03a2=function(t){return addHeapObject(getObject(t).node)},t.wbg.__wbindgen_is_string=function(t){return"string"==typeof getObject(t)},t.wbg.__wbg_require_cca90b1a94a0255b=function(){return handleError$1((function(){return addHeapObject(module.require)}),arguments)},t.wbg.__wbindgen_is_function=function(t){return"function"==typeof getObject(t)},t.wbg.__wbindgen_string_new=function(t,e){return addHeapObject(getStringFromWasm0$1(t,e))},t.wbg.__wbg_msCrypto_eb05e62b530a1508=function(t){return addHeapObject(getObject(t).msCrypto)},t.wbg.__wbg_randomFillSync_5c9c955aa56b6049=function(){return handleError$1((function(t,e){getObject(t).randomFillSync(takeObject(e))}),arguments)},t.wbg.__wbg_getRandomValues_3aa56aa6edec874c=function(){return handleError$1((function(t,e){getObject(t).getRandomValues(getObject(e))}),arguments)},t.wbg.__wbg_instanceof_Window_5012736c80a01584=function(t){let e;try{e=getObject(t)instanceof Window}catch(t){e=!1}return e},t.wbg.__wbg_BigInt_c180ff1ada0e172c=function(t){return addHeapObject(BigInt(getObject(t)))},t.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(t,e){return addHeapObject(new Function(getStringFromWasm0$1(t,e)))},t.wbg.__wbg_call_1084a111329e68ce=function(){return handleError$1((function(t,e){return addHeapObject(getObject(t).call(getObject(e)))}),arguments)},t.wbg.__wbindgen_string_get=function(t,e){const a=getObject(e),_="string"==typeof a?a:void 0;var n=isLikeNone$1(_)?0:passStringToWasm0$1(_,wasm$1.__wbindgen_malloc,wasm$1.__wbindgen_realloc),i=WASM_VECTOR_LEN$1;getDataViewMemory0$1().setInt32(t+4,i,!0),getDataViewMemory0$1().setInt32(t+0,n,!0)},t.wbg.__wbg_self_3093d5d1f7bcb682=function(){return handleError$1((function(){return addHeapObject(self.self)}),arguments)},t.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return handleError$1((function(){return addHeapObject(window.window)}),arguments)},t.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return handleError$1((function(){return addHeapObject(globalThis.globalThis)}),arguments)},t.wbg.__wbg_global_e5a3fe56f8be9485=function(){return handleError$1((function(){return addHeapObject(global$1.global)}),arguments)},t.wbg.__wbindgen_is_undefined=function(t){return void 0===getObject(t)},t.wbg.__wbg_BigInt_38f8da7386bbae76=function(){return handleError$1((function(t){return addHeapObject(BigInt(getObject(t)))}),arguments)},t.wbg.__wbg_toString_515790fe476e2613=function(t,e,a){const _=passStringToWasm0$1(getObject(e).toString(a),wasm$1.__wbindgen_malloc,wasm$1.__wbindgen_realloc),n=WASM_VECTOR_LEN$1;getDataViewMemory0$1().setInt32(t+4,n,!0),getDataViewMemory0$1().setInt32(t+0,_,!0)},t.wbg.__wbg_toString_9d18e102ca933e68=function(t){return addHeapObject(getObject(t).toString())},t.wbg.__wbg_call_89af060b4e1523f2=function(){return handleError$1((function(t,e,a){return addHeapObject(getObject(t).call(getObject(e),getObject(a)))}),arguments)},t.wbg.__wbg_getTime_91058879093a1589=function(t){return getObject(t).getTime()},t.wbg.__wbg_new0_65387337a95cf44d=function(){return addHeapObject(new Date)},t.wbg.__wbg_buffer_b7b08af79b0b0974=function(t){return addHeapObject(getObject(t).buffer)},t.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9=function(t,e,a){return addHeapObject(new Uint8Array(getObject(t),e>>>0,a>>>0))},t.wbg.__wbg_new_ea1883e1e5e86686=function(t){return addHeapObject(new Uint8Array(getObject(t)))},t.wbg.__wbg_set_d1e79e2388520f18=function(t,e,a){getObject(t).set(getObject(e),a>>>0)},t.wbg.__wbg_newwithlength_ec548f448387c968=function(t){return addHeapObject(new Uint8Array(t>>>0))},t.wbg.__wbg_subarray_7c2e3576afe181d1=function(t,e,a){return addHeapObject(getObject(t).subarray(e>>>0,a>>>0))},t.wbg.__wbindgen_bigint_get_as_i64=function(t,e){const a=getObject(e),_="bigint"==typeof a?a:void 0;getDataViewMemory0$1().setBigInt64(t+8,isLikeNone$1(_)?BigInt(0):_,!0),getDataViewMemory0$1().setInt32(t+0,!isLikeNone$1(_),!0)},t.wbg.__wbindgen_debug_string=function(t,e){const a=passStringToWasm0$1(debugString$1(getObject(e)),wasm$1.__wbindgen_malloc,wasm$1.__wbindgen_realloc),_=WASM_VECTOR_LEN$1;getDataViewMemory0$1().setInt32(t+4,_,!0),getDataViewMemory0$1().setInt32(t+0,a,!0)},t.wbg.__wbindgen_throw=function(t,e){throw new Error(getStringFromWasm0$1(t,e))},t.wbg.__wbindgen_module=function(){return addHeapObject(__wbg_init$1.__wbindgen_wasm_module)},t.wbg.__wbindgen_memory=function(){return addHeapObject(wasm$1.memory)},t.wbg.__wbg_startWorkers_d587c7d659590d3c=function(t,e,a){return addHeapObject(startWorkers(takeObject(t),takeObject(e),wbg_rayon_PoolBuilder.__wrap(a)))},t}function __wbg_init_memory(t,e){t.wbg.memory=e||new WebAssembly.Memory({initial:19,maximum:16384,shared:!0})}function __wbg_finalize_init$1(t,e,a){if(wasm$1=t.exports,__wbg_init$1.__wbindgen_wasm_module=e,cachedDataViewMemory0$1=null,cachedUint8ArrayMemory0$1=null,void 0!==a&&("number"!=typeof a||0===a||a%65536!=0))throw"invalid stack size";return wasm$1.__wbindgen_start(a),wasm$1}async function __wbg_init$1(t,e){if(void 0!==wasm$1)return wasm$1;let a;void 0!==t&&Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t,memory:e,thread_stack_size:a}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead"),void 0===t&&(t=new URL("tfhe_bg.wasm",import.meta.url));const _=__wbg_get_imports$1();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t)),__wbg_init_memory(_,e);const{instance:n,module:i}=await __wbg_load$1(await t,_);return __wbg_finalize_init$1(n,i,a)}const SERIALIZED_SIZE_LIMIT_CIPHERTEXT=BigInt(536870912),SERIALIZED_SIZE_LIMIT_PK=BigInt(536870912),SERIALIZED_SIZE_LIMIT_CRS=BigInt(536870912),cleanURL=t=>t?new URL(t).href:"",numberToHex=t=>{let e=t.toString(16);return e.length%2?"0"+e:e},fromHexString=t=>{const e=t.replace(/^(0x)/,"").match(/.{1,2}/g);return e?Uint8Array.from(e.map((t=>parseInt(t,16)))):new Uint8Array},toHexString=t=>t.reduce(((t,e)=>t+e.toString(16).padStart(2,"0")),""),bytesToBigInt=function(t){if(!t||0===t?.length)return BigInt(0);const e=Buffer.from(t);return toBigIntBE(e)},keyurlCache={},getKeysFromGateway=async(t,e)=>{if(keyurlCache[t])return keyurlCache[t];try{const a=await fetch(`${t}keyurl`);if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);const _=await a.json();if(_){let a;if(e){const t=_.response.fhe_key_info.find((t=>t.fhe_public_key.data_id===e));if(!t)throw new Error(`Could not find FHE key info with data_id ${e}`);a=t.fhe_public_key.urls[0]}else a=_.response.fhe_key_info[0].fhe_public_key.urls[0],e=_.response.fhe_key_info[0].fhe_public_key.data_id;const n=await fetch(a),i=await n.arrayBuffer(),r=_.response.crs[2048].urls[0],s=_.response.crs[2048].data_id,o=await(await fetch(r)).arrayBuffer(),w={publicKey:TfheCompactPublicKey.safe_deserialize(new Uint8Array(i),SERIALIZED_SIZE_LIMIT_PK),publicKeyId:e,publicParams:{2048:{publicParams:CompactPkePublicParams.safe_deserialize(new Uint8Array(o),SERIALIZED_SIZE_LIMIT_CRS),publicParamsId:s}}};return keyurlCache[t]=w,w}throw new Error("No public key available")}catch(t){throw new Error("Impossible to fetch public key: wrong gateway url.",{cause:t})}};var abi=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"AddressEmptyCode",type:"error"},{inputs:[],name:"ECDSAInvalidSignature",type:"error"},{inputs:[{internalType:"uint256",name:"length",type:"uint256"}],name:"ECDSAInvalidSignatureLength",type:"error"},{inputs:[{internalType:"bytes32",name:"s",type:"bytes32"}],name:"ECDSAInvalidSignatureS",type:"error"},{inputs:[{internalType:"address",name:"implementation",type:"address"}],name:"ERC1967InvalidImplementation",type:"error"},{inputs:[],name:"ERC1967NonPayable",type:"error"},{inputs:[],name:"FailedInnerCall",type:"error"},{inputs:[],name:"InvalidInitialization",type:"error"},{inputs:[],name:"NotInitializing",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[],name:"UUPSUnauthorizedCallContext",type:"error"},{inputs:[{internalType:"bytes32",name:"slot",type:"bytes32"}],name:"UUPSUnsupportedProxiableUUID",type:"error"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint64",name:"version",type:"uint64"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferStarted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"signer",type:"address"}],name:"SignerAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"signer",type:"address"}],name:"SignerRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{inputs:[],name:"UPGRADE_INTERFACE_VERSION",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"acceptOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"signer",type:"address"}],name:"addSigner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getSigners",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getThreshold",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getVersion",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[],name:"get_DECRYPTIONRESULT_TYPE",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"initialOwner",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"isSigner",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pendingOwner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"proxiableUUID",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"signer",type:"address"}],name:"removeSigner",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newImplementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"aclAddress",type:"address"},{internalType:"uint256[]",name:"handlesList",type:"uint256[]"},{internalType:"bytes",name:"decryptedResult",type:"bytes"},{internalType:"bytes[]",name:"signatures",type:"bytes[]"}],name:"verifySignatures",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];const getProvider=t=>{if(t.networkUrl)return new JsonRpcProvider(t.networkUrl);if(t.network)return new BrowserProvider(t.network);throw new Error("You must provide a network URL or a EIP1193 object (eg: window.ethereum)")},getChainId=async(t,e)=>{if(e.chainId&&"number"==typeof e.chainId)return e.chainId;if(e.chainId&&"number"!=typeof e.chainId)throw new Error("chainId must be a number.");{const e=(await t.getNetwork()).chainId;return Number(e)}},getTfheCompactPublicKey=async t=>{if(t.gatewayUrl&&!t.publicKey){const e=await getKeysFromGateway(cleanURL(t.gatewayUrl),t.publicKeyId);return{publicKey:e.publicKey,publicKeyId:e.publicKeyId}}if(!t.publicKey||!t.publicKeyId)throw new Error("You must provide a public key with its public key ID.");{const e=t.publicKey;try{return{publicKey:TfheCompactPublicKey.safe_deserialize(e,SERIALIZED_SIZE_LIMIT_PK),publicKeyId:t.publicKeyId}}catch(t){throw new Error("Invalid public key (deserialization failed)",{cause:t})}}},getPublicParams=async t=>{if(t.gatewayUrl&&!t.publicParams){return(await getKeysFromGateway(cleanURL(t.gatewayUrl),t.publicKeyId)).publicParams}if(!t.publicParams||!t.publicParams[2048])throw new Error("You must provide a valid CRS with its CRS ID.");{const e=t.publicParams[2048].publicParams;try{return{2048:{publicParams:CompactPkePublicParams.safe_deserialize(e,SERIALIZED_SIZE_LIMIT_CRS),publicParamsId:t.publicParams[2048].publicParamsId}}}catch(t){throw new Error("Invalid public key (deserialization failed)",{cause:t})}}},getKMSSigners=async(t,e)=>{const a=new Contract(e.kmsContractAddress,abi,t);return await a.getSigners()},checkEncryptedValue=(t,e)=>{if(null==t)throw new Error("Missing value");let a;if(a=e>=8?BigInt(`0x${new Array(e/8).fill(null).reduce((t=>`${t}ff`),"")}`):BigInt(2**e-1),"number"!=typeof t&&"bigint"!=typeof t)throw new Error("Value must be a number or a bigint.");if(t>a)throw new Error(`The value exceeds the limit for ${e}bits integer (${a.toString()}).`)},createEncryptedInput=(t,e,a,_,n,i)=>(r,s)=>{if(!isAddress(r))throw new Error("Contract address is not a valid address.");if(!isAddress(s))throw new Error("User address is not a valid address.");const o=_,w=[],g=CompactCiphertextList.builder(o),c=t=>{if(w.reduce(((t,e)=>t+Math.max(2,e)),0)+t>2048)throw Error("Packing more than 2048 bits in a single input ciphertext is unsupported");if(w.length+1>256)throw Error("Packing more than 256 variables in a single input ciphertext is unsupported")};return{addBool(t){if(null==t)throw new Error("Missing value");if("boolean"!=typeof t&&"number"!=typeof t&&"bigint"!=typeof t)throw new Error("The value must be a boolean, a number or a bigint.");if(("bigint"!=typeof t||"number"!=typeof t)&&Number(t)>1)throw new Error("The value must be 1 or 0.");return checkEncryptedValue(Number(t),1),c(2),g.push_boolean(!!t),w.push(1),this},add4(t){return checkEncryptedValue(t,4),c(4),g.push_u4(Number(t)),w.push(4),this},add8(t){return checkEncryptedValue(t,8),c(8),g.push_u8(Number(t)),w.push(8),this},add16(t){return checkEncryptedValue(t,16),c(16),g.push_u16(Number(t)),w.push(16),this},add32(t){return checkEncryptedValue(t,32),c(32),g.push_u32(Number(t)),w.push(32),this},add64(t){return checkEncryptedValue(t,64),c(64),g.push_u64(BigInt(t)),w.push(64),this},add128(t){return checkEncryptedValue(t,128),c(128),g.push_u128(BigInt(t)),w.push(128),this},addAddress(t){if(!isAddress(t))throw new Error("The value must be a valid address.");return c(160),g.push_u160(BigInt(t)),w.push(160),this},add256(t){return checkEncryptedValue(t,256),c(256),g.push_u256(BigInt(t)),w.push(256),this},addBytes64(t){if(64!==t.length)throw Error("Uncorrect length of input Uint8Array, should be 64 for an ebytes64");const e=bytesToBigInt(t);return checkEncryptedValue(e,512),c(512),g.push_u512(e),w.push(512),this},addBytes128(t){if(128!==t.length)throw Error("Uncorrect length of input Uint8Array, should be 128 for an ebytes128");const e=bytesToBigInt(t);return checkEncryptedValue(e,1024),c(1024),g.push_u1024(e),w.push(1024),this},addBytes256(t){if(256!==t.length)throw Error("Uncorrect length of input Uint8Array, should be 256 for an ebytes256");const e=bytesToBigInt(t);return checkEncryptedValue(e,2048),c(2048),g.push_u2048(e),w.push(2048),this},getBits:()=>w,_getClosestPP(){const t=w.reduce(((t,e)=>t+e),0),e=(a=i,Object.keys(a));var a;const _=e.find((e=>Number(e)>=t));if(!_)throw new Error(`Too many bits in provided values. Maximum is ${e[e.length-1]}.`);return _},async _prove(){const a=this._getClosestPP(),_=i[a].publicParams,n=fromHexString(r),o=fromHexString(s),w=fromHexString(t),c=fromHexString(e.toString(16)),d=new Uint8Array(n.length+o.length+w.length+32);d.set(n,0),d.set(o,20),d.set(w,40),d.set(c,d.length-c.length);const y=g.build_with_proof_packed(_,d,ZkComputeLoad.Verify);return Buffer.from(y.safe_serialize(SERIALIZED_SIZE_LIMIT_CIPHERTEXT))},async _verify(t){const e=this._getClosestPP(),_=i[e].publicParamsId,o={contract_address:getAddress(r),caller_address:getAddress(s),ct_proof:t.toString("hex"),key_id:n,crs_id:_},w={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)};let g;try{const t=await fetch(`${a}verify_proven_ct`,w);g=await t.json()}catch(t){throw new Error("Gateway didn't response correctly",{cause:t})}let c=[];g.response.handles&&g.response.handles.length>0&&(c=g.response.handles.map(fromHexString));const d=g.response.kms_signatures;let y=numberToHex(c.length);const m=d.length;if(y+=numberToHex(m),g.response.proof_of_storage){const e=createKeccakHash("keccak256").update(Buffer.from(t)).digest();y+=e.toString("hex");c.map((t=>toHexString(t))).map((t=>y+=t)),y+=g.response.proof_of_storage,d.map((t=>y+=t))}else{c.map((t=>toHexString(t))).map((t=>y+=t)),d.map((t=>y+=t)),y+=toHexString(t)}return{handles:c,inputProof:fromHexString(y)}},async encrypt(){let t=Date.now();const e=await this._prove();console.log(`Encrypting and proving in ${Math.round((Date.now()-t)/100)/10}s`),t=Date.now();const a=await this._verify(e);return console.log(`Verifying in ${Math.round((Date.now()-t)/100)/10}s`),a}}};let wasm;const cachedTextDecoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&cachedTextDecoder.decode();let cachedUint8ArrayMemory0=null;function getUint8ArrayMemory0(){return null!==cachedUint8ArrayMemory0&&0!==cachedUint8ArrayMemory0.byteLength||(cachedUint8ArrayMemory0=new Uint8Array(wasm.memory.buffer)),cachedUint8ArrayMemory0}function getStringFromWasm0(t,e){return t>>>=0,cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(t,t+e))}let WASM_VECTOR_LEN=0;const cachedTextEncoder="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},encodeString="function"==typeof cachedTextEncoder.encodeInto?function(t,e){return cachedTextEncoder.encodeInto(t,e)}:function(t,e){const a=cachedTextEncoder.encode(t);return e.set(a),{read:t.length,written:a.length}};function passStringToWasm0(t,e,a){if(void 0===a){const a=cachedTextEncoder.encode(t),_=e(a.length,1)>>>0;return getUint8ArrayMemory0().subarray(_,_+a.length).set(a),WASM_VECTOR_LEN=a.length,_}let _=t.length,n=e(_,1)>>>0;const i=getUint8ArrayMemory0();let r=0;for(;r<_;r++){const e=t.charCodeAt(r);if(e>127)break;i[n+r]=e}if(r!==_){0!==r&&(t=t.slice(r)),n=a(n,_,_=r+3*t.length,1)>>>0;const e=getUint8ArrayMemory0().subarray(n+r,n+_);r+=encodeString(t,e).written,n=a(n,_,r,1)>>>0}return WASM_VECTOR_LEN=r,n}function isLikeNone(t){return null==t}let cachedDataViewMemory0=null;function getDataViewMemory0(){return(null===cachedDataViewMemory0||!0===cachedDataViewMemory0.buffer.detached||void 0===cachedDataViewMemory0.buffer.detached&&cachedDataViewMemory0.buffer!==wasm.memory.buffer)&&(cachedDataViewMemory0=new DataView(wasm.memory.buffer)),cachedDataViewMemory0}function debugString(t){const e=typeof t;if("number"==e||"boolean"==e||null==t)return`${t}`;if("string"==e)return`"${t}"`;if("symbol"==e){const e=t.description;return null==e?"Symbol":`Symbol(${e})`}if("function"==e){const e=t.name;return"string"==typeof e&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(t)){const e=t.length;let a="[";e>0&&(a+=debugString(t[0]));for(let _=1;_<e;_++)a+=", "+debugString(t[_]);return a+="]",a}const a=/\[object ([^\]]+)\]/.exec(toString.call(t));let _;if(!(a.length>1))return toString.call(t);if(_=a[1],"Object"==_)try{return"Object("+JSON.stringify(t)+")"}catch(t){return"Object"}return t instanceof Error?`${t.name}: ${t.message}\n${t.stack}`:_}function _assertClass(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);return t.ptr}function getArrayU8FromWasm0(t,e){return t>>>=0,getUint8ArrayMemory0().subarray(t/1,t/1+e)}function passArray8ToWasm0(t,e){const a=e(1*t.length,1)>>>0;return getUint8ArrayMemory0().set(t,a/1),WASM_VECTOR_LEN=t.length,a}function takeFromExternrefTable0(t){const e=wasm.__wbindgen_export_2.get(t);return wasm.__externref_table_dealloc(t),e}function addToExternrefTable0(t){const e=wasm.__externref_table_alloc();return wasm.__wbindgen_export_2.set(e,t),e}function passArrayJsValueToWasm0(t,e){const a=e(4*t.length,4)>>>0,_=getDataViewMemory0();for(let e=0;e<t.length;e++)_.setUint32(a+4*e,addToExternrefTable0(t[e]),!0);return WASM_VECTOR_LEN=t.length,a}function new_client(t,e,a){const _=passArrayJsValueToWasm0(t,wasm.__wbindgen_malloc),n=WASM_VECTOR_LEN,i=passStringToWasm0(e,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),r=WASM_VECTOR_LEN,s=passStringToWasm0(a,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),o=WASM_VECTOR_LEN,w=wasm.new_client(_,n,i,r,s,o);if(w[2])throw takeFromExternrefTable0(w[1]);return Client.__wrap(w[0])}function cryptobox_keygen(){const t=wasm.cryptobox_keygen();return PrivateEncKey.__wrap(t)}function cryptobox_get_pk(t){_assertClass(t,PrivateEncKey);const e=wasm.cryptobox_get_pk(t.__wbg_ptr);return PublicEncKey.__wrap(e)}function cryptobox_pk_to_u8vec(t){_assertClass(t,PublicEncKey);const e=wasm.cryptobox_pk_to_u8vec(t.__wbg_ptr);if(e[3])throw takeFromExternrefTable0(e[2]);var a=getArrayU8FromWasm0(e[0],e[1]).slice();return wasm.__wbindgen_free(e[0],1*e[1],1),a}function cryptobox_sk_to_u8vec(t){_assertClass(t,PrivateEncKey);const e=wasm.cryptobox_sk_to_u8vec(t.__wbg_ptr);if(e[3])throw takeFromExternrefTable0(e[2]);var a=getArrayU8FromWasm0(e[0],e[1]).slice();return wasm.__wbindgen_free(e[0],1*e[1],1),a}function u8vec_to_cryptobox_pk(t){const e=passArray8ToWasm0(t,wasm.__wbindgen_malloc),a=WASM_VECTOR_LEN,_=wasm.u8vec_to_cryptobox_pk(e,a);if(_[2])throw takeFromExternrefTable0(_[1]);return PublicEncKey.__wrap(_[0])}function u8vec_to_cryptobox_sk(t){const e=passArray8ToWasm0(t,wasm.__wbindgen_malloc),a=WASM_VECTOR_LEN,_=wasm.u8vec_to_cryptobox_sk(e,a);if(_[2])throw takeFromExternrefTable0(_[1]);return PrivateEncKey.__wrap(_[0])}function process_reencryption_resp_from_js(t,e,a,_,n,i,r){_assertClass(t,Client),_assertClass(n,PublicEncKey),_assertClass(i,PrivateEncKey);const s=wasm.process_reencryption_resp_from_js(t.__wbg_ptr,e,a,_,n.__wbg_ptr,i.__wbg_ptr,r);if(s[3])throw takeFromExternrefTable0(s[2]);var o=getArrayU8FromWasm0(s[0],s[1]).slice();return wasm.__wbindgen_free(s[0],1*s[1],1),o}function handleError(t,e){try{return t.apply(this,e)}catch(t){const e=addToExternrefTable0(t);wasm.__wbindgen_exn_store(e)}}const ClientFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm.__wbg_client_free(t>>>0,1)));class Client{static __wrap(t){t>>>=0;const e=Object.create(Client.prototype);return e.__wbg_ptr=t,ClientFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ClientFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm.__wbg_client_free(t,0)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm.__wbg_cryptoboxct_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm.__wbg_eip712domainmsg_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm.__wbg_parsedreencryptionrequest_free(t>>>0,1)));const PrivateEncKeyFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm.__wbg_privateenckey_free(t>>>0,1)));class PrivateEncKey{static __wrap(t){t>>>=0;const e=Object.create(PrivateEncKey.prototype);return e.__wbg_ptr=t,PrivateEncKeyFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,PrivateEncKeyFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm.__wbg_privateenckey_free(t,0)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm.__wbg_privatesigkey_free(t>>>0,1)));const PublicEncKeyFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm.__wbg_publicenckey_free(t>>>0,1)));class PublicEncKey{static __wrap(t){t>>>=0;const e=Object.create(PublicEncKey.prototype);return e.__wbg_ptr=t,PublicEncKeyFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,PublicEncKeyFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm.__wbg_publicenckey_free(t,0)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm.__wbg_publicsigkey_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm.__wbg_reencryptionrequest_free(t>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm.__wbg_reencryptionrequestpayload_free(t>>>0,1)));const ReencryptionResponseFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm.__wbg_reencryptionresponse_free(t>>>0,1)));class ReencryptionResponse{static __unwrap(t){return t instanceof ReencryptionResponse?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ReencryptionResponseFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm.__wbg_reencryptionresponse_free(t,0)}get signature(){const t=wasm.__wbg_get_reencryptionresponse_signature(this.__wbg_ptr);var e=getArrayU8FromWasm0(t[0],t[1]).slice();return wasm.__wbindgen_free(t[0],1*t[1],1),e}set signature(t){const e=passArray8ToWasm0(t,wasm.__wbindgen_malloc),a=WASM_VECTOR_LEN;wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,a)}get payload(){const t=wasm.__wbg_get_reencryptionresponse_payload(this.__wbg_ptr);return 0===t?void 0:ReencryptionResponsePayload.__wrap(t)}set payload(t){let e=0;isLikeNone(t)||(_assertClass(t,ReencryptionResponsePayload),e=t.__destroy_into_raw()),wasm.__wbg_set_reencryptionresponse_payload(this.__wbg_ptr,e)}}const ReencryptionResponsePayloadFinalization="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>wasm.__wbg_reencryptionresponsepayload_free(t>>>0,1)));class ReencryptionResponsePayload{static __wrap(t){t>>>=0;const e=Object.create(ReencryptionResponsePayload.prototype);return e.__wbg_ptr=t,ReencryptionResponsePayloadFinalization.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ReencryptionResponsePayloadFinalization.unregister(this),t}free(){const t=this.__destroy_into_raw();wasm.__wbg_reencryptionresponsepayload_free(t,0)}get version(){return wasm.__wbg_get_reencryptionresponsepayload_version(this.__wbg_ptr)>>>0}set version(t){wasm.__wbg_set_reencryptionresponsepayload_version(this.__wbg_ptr,t)}get verification_key(){const t=wasm.__wbg_get_reencryptionresponsepayload_verification_key(this.__wbg_ptr);var e=getArrayU8FromWasm0(t[0],t[1]).slice();return wasm.__wbindgen_free(t[0],1*t[1],1),e}set verification_key(t){const e=passArray8ToWasm0(t,wasm.__wbindgen_malloc),a=WASM_VECTOR_LEN;wasm.__wbg_set_eip712domainmsg_name(this.__wbg_ptr,e,a)}get digest(){const t=wasm.__wbg_get_reencryptionresponsepayload_digest(this.__wbg_ptr);var e=getArrayU8FromWasm0(t[0],t[1]).slice();return wasm.__wbindgen_free(t[0],1*t[1],1),e}set digest(t){const e=passArray8ToWasm0(t,wasm.__wbindgen_malloc),a=WASM_VECTOR_LEN;wasm.__wbg_set_eip712domainmsg_version(this.__wbg_ptr,e,a)}get fhe_type(){return wasm.__wbg_get_reencryptionresponsepayload_fhe_type(this.__wbg_ptr)}set fhe_type(t){wasm.__wbg_set_reencryptionresponsepayload_fhe_type(this.__wbg_ptr,t)}get signcrypted_ciphertext(){const t=wasm.__wbg_get_reencryptionresponsepayload_signcrypted_ciphertext(this.__wbg_ptr);var e=getArrayU8FromWasm0(t[0],t[1]).slice();return wasm.__wbindgen_free(t[0],1*t[1],1),e}set signcrypted_ciphertext(t){const e=passArray8ToWasm0(t,wasm.__wbindgen_malloc),a=WASM_VECTOR_LEN;wasm.__wbg_set_eip712domainmsg_chain_id(this.__wbg_ptr,e,a)}get party_id(){return wasm.__wbg_get_reencryptionresponsepayload_party_id(this.__wbg_ptr)>>>0}set party_id(t){wasm.__wbg_set_reencryptionresponsepayload_party_id(this.__wbg_ptr,t)}get degree(){return wasm.__wbg_get_reencryptionresponsepayload_degree(this.__wbg_ptr)>>>0}set degree(t){wasm.__wbg_set_reencryptionresponsepayload_degree(this.__wbg_ptr,t)}}async function __wbg_load(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(e){if("application/wasm"==t.headers.get("Content-Type"))throw e;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)}const a=await t.arrayBuffer();return await WebAssembly.instantiate(a,e)}{const a=await WebAssembly.instantiate(t,e);return a instanceof WebAssembly.Instance?{instance:a,module:t}:a}}function __wbg_get_imports(){const t={wbg:{}};return t.wbg.__wbindgen_error_new=function(t,e){return new Error(getStringFromWasm0(t,e))},t.wbg.__wbindgen_string_get=function(t,e){const a="string"==typeof e?e:void 0;var _=isLikeNone(a)?0:passStringToWasm0(a,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),n=WASM_VECTOR_LEN;getDataViewMemory0().setInt32(t+4,n,!0),getDataViewMemory0().setInt32(t+0,_,!0)},t.wbg.__wbindgen_is_object=function(t){return"object"==typeof t&&null!==t},t.wbg.__wbindgen_is_undefined=function(t){return void 0===t},t.wbg.__wbindgen_in=function(t,e){return t in e},t.wbg.__wbindgen_is_null=function(t){return null===t},t.wbg.__wbg_reencryptionresponse_unwrap=function(t){return ReencryptionResponse.__unwrap(t)},t.wbg.__wbindgen_number_get=function(t,e){const a="number"==typeof e?e:void 0;getDataViewMemory0().setFloat64(t+8,isLikeNone(a)?0:a,!0),getDataViewMemory0().setInt32(t+0,!isLikeNone(a),!0)},t.wbg.__wbindgen_jsval_loose_eq=function(t,e){return t==e},t.wbg.__wbindgen_boolean_get=function(t){return"boolean"==typeof t?t?1:0:2},t.wbg.__wbindgen_as_number=function(t){return+t},t.wbg.__wbg_String_b9412f8799faab3e=function(t,e){const a=passStringToWasm0(String(e),wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),_=WASM_VECTOR_LEN;getDataViewMemory0().setInt32(t+4,_,!0),getDataViewMemory0().setInt32(t+0,a,!0)},t.wbg.__wbindgen_string_new=function(t,e){return getStringFromWasm0(t,e)},t.wbg.__wbg_getwithrefkey_edc2c8960f0f1191=function(t,e){return t[e]},t.wbg.__wbg_new_abda76e883ba8a5f=function(){return new Error},t.wbg.__wbg_stack_658279fe44541cf6=function(t,e){const a=passStringToWasm0(e.stack,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),_=WASM_VECTOR_LEN;getDataViewMemory0().setInt32(t+4,_,!0),getDataViewMemory0().setInt32(t+0,a,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(t,e){let a,_;try{a=t,_=e,console.error(getStringFromWasm0(t,e))}finally{wasm.__wbindgen_free(a,_,1)}},t.wbg.__wbg_crypto_1d1f22824a6a080c=function(t){return t.crypto},t.wbg.__wbg_process_4a72847cc503995b=function(t){return t.process},t.wbg.__wbg_versions_f686565e586dd935=function(t){return t.versions},t.wbg.__wbg_node_104a2ff8d6ea03a2=function(t){return t.node},t.wbg.__wbindgen_is_string=function(t){return"string"==typeof t},t.wbg.__wbg_require_cca90b1a94a0255b=function(){return handleError((function(){return module.require}),arguments)},t.wbg.__wbindgen_is_function=function(t){return"function"==typeof t},t.wbg.__wbg_msCrypto_eb05e62b530a1508=function(t){return t.msCrypto},t.wbg.__wbg_randomFillSync_5c9c955aa56b6049=function(){return handleError((function(t,e){t.randomFillSync(e)}),arguments)},t.wbg.__wbg_getRandomValues_3aa56aa6edec874c=function(){return handleError((function(t,e){t.getRandomValues(e)}),arguments)},t.wbg.__wbg_get_5419cf6b954aa11d=function(t,e){return t[e>>>0]},t.wbg.__wbg_length_f217bbbf7e8e4df4=function(t){return t.length},t.wbg.__wbg_newnoargs_1ede4bf2ebbaaf43=function(t,e){return new Function(getStringFromWasm0(t,e))},t.wbg.__wbg_next_13b477da1eaa3897=function(t){return t.next},t.wbg.__wbg_next_b06e115d1b01e10b=function(){return handleError((function(t){return t.next()}),arguments)},t.wbg.__wbg_done_983b5ffcaec8c583=function(t){return t.done},t.wbg.__wbg_value_2ab8a198c834c26a=function(t){return t.value},t.wbg.__wbg_iterator_695d699a44d6234c=function(){return Symbol.iterator},t.wbg.__wbg_get_ef828680c64da212=function(){return handleError((function(t,e){return Reflect.get(t,e)}),arguments)},t.wbg.__wbg_call_a9ef466721e824f2=function(){return handleError((function(t,e){return t.call(e)}),arguments)},t.wbg.__wbg_self_bf91bf94d9e04084=function(){return handleError((function(){return self.self}),arguments)},t.wbg.__wbg_window_52dd9f07d03fd5f8=function(){return handleError((function(){return window.window}),arguments)},t.wbg.__wbg_globalThis_05c129bf37fcf1be=function(){return handleError((function(){return globalThis.globalThis}),arguments)},t.wbg.__wbg_global_3eca19bb09e9c484=function(){return handleError((function(){return global$1.global}),arguments)},t.wbg.__wbg_isArray_6f3b47f09adb61b5=function(t){return Array.isArray(t)},t.wbg.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7=function(t){let e;try{e=t instanceof ArrayBuffer}catch(t){e=!1}return e},t.wbg.__wbg_call_3bfa248576352471=function(){return handleError((function(t,e,a){return t.call(e,a)}),arguments)},t.wbg.__wbg_isSafeInteger_b9dff570f01a9100=function(t){return Number.isSafeInteger(t)},t.wbg.__wbg_buffer_ccaed51a635d8a2d=function(t){return t.buffer},t.wbg.__wbg_newwithbyteoffsetandlength_7e3eb787208af730=function(t,e,a){return new Uint8Array(t,e>>>0,a>>>0)},t.wbg.__wbg_new_fec2611eb9180f95=function(t){return new Uint8Array(t)},t.wbg.__wbg_set_ec2fcf81bc573fd9=function(t,e,a){t.set(e,a>>>0)},t.wbg.__wbg_length_9254c4bd3b9f23c4=function(t){return t.length},t.wbg.__wbg_instanceof_Uint8Array_df0761410414ef36=function(t){let e;try{e=t instanceof Uint8Array}catch(t){e=!1}return e},t.wbg.__wbg_newwithlength_76462a666eca145f=function(t){return new Uint8Array(t>>>0)},t.wbg.__wbg_subarray_975a06f9dbd16995=function(t,e,a){return t.subarray(e>>>0,a>>>0)},t.wbg.__wbindgen_debug_string=function(t,e){const a=passStringToWasm0(debugString(e),wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),_=WASM_VECTOR_LEN;getDataViewMemory0().setInt32(t+4,_,!0),getDataViewMemory0().setInt32(t+0,a,!0)},t.wbg.__wbindgen_throw=function(t,e){throw new Error(getStringFromWasm0(t,e))},t.wbg.__wbindgen_memory=function(){return wasm.memory},t.wbg.__wbindgen_init_externref_table=function(){const t=wasm.__wbindgen_export_2,e=t.grow(4);t.set(0,void 0),t.set(e+0,void 0),t.set(e+1,null),t.set(e+2,!0),t.set(e+3,!1)},t}function __wbg_finalize_init(t,e){return wasm=t.exports,__wbg_init.__wbindgen_wasm_module=e,cachedDataViewMemory0=null,cachedUint8ArrayMemory0=null,wasm.__wbindgen_start(),wasm}async function __wbg_init(t){if(void 0!==wasm)return wasm;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===t&&(t=new URL("kms_lib_bg.wasm",import.meta.url));const e=__wbg_get_imports();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:a,module:_}=await __wbg_load(await t,e);return __wbg_finalize_init(a,_)}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((t=>wasm.__wbg_requestid_free(t>>>0,1)));const createEIP712=t=>(e,a,_)=>{if(!isAddress(a))throw new Error("Invalid contract address.");if(_&&!isAddress(_))throw new Error("Invalid delegated account.");const n={types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Reencrypt:[{name:"publicKey",type:"bytes"}]},primaryType:"Reencrypt",domain:{name:"Authorization token",version:"1",chainId:t,verifyingContract:a},message:{publicKey:`0x${e}`}};return _&&(n.message.delegatedAccount=_,n.types.Reencrypt.push({name:"delegatedAccount",type:"address"})),n},generateKeypair=()=>{const t=cryptobox_keygen();return{publicKey:toHexString(cryptobox_pk_to_u8vec(cryptobox_get_pk(t))),privateKey:toHexString(cryptobox_sk_to_u8vec(t))}},aclABI=["function persistAllowed(uint256 handle, address account) view returns (bool)"],reencryptRequest=(t,e,a,_,n,i)=>async(a,r,s,o,w,g)=>{const c=new ethers.Contract(_,aclABI,i),d=await c.persistAllowed(a,g),y=await c.persistAllowed(a,w);if(!d)throw new Error("User is not authorized to reencrypt this handle!");if(!y)throw new Error("dApp contract is not authorized to reencrypt this handle!");if(g===w)throw new Error("userAddress should not be equal to contractAddress when requesting reencryption!");const m={signature:o.replace(/^(0x)/,""),client_address:getAddress(g),enc_key:s.replace(/^(0x)/,""),ciphertext_handle:a.toString(16).padStart(64,"0"),eip712_verifying_contract:getAddress(w)},p={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)};let b,l,$,f;try{b=u8vec_to_cryptobox_pk(fromHexString(s)),l=u8vec_to_cryptobox_sk(fromHexString(r))}catch(t){throw new Error("Invalid public or private key",{cause:t})}try{if($=await fetch(`${n}reencrypt`,p),!$.ok)throw new Error(`Reencrypt failed: gateway respond with HTTP code ${$.status}`)}catch(t){throw new Error("Reencrypt failed: Gateway didn't respond",{cause:t})}try{f=await $.json()}catch(t){throw new Error("Reencrypt failed: Gateway didn't return a JSON",{cause:t})}if("failure"===f.status)throw new Error("Reencrypt failed: the reencryption didn't succeed for an unknown reason",{cause:f});const h=new_client(t,g,"default");try{const t=new ArrayBuffer(32);new DataView(t).setUint32(28,e,!1);const a={name:"Authorization token",version:"1",chain_id:new Uint8Array(t),verifying_contract:w,salt:null},{ciphertext_handle:_,...n}=m,i=process_reencryption_resp_from_js(h,{...n,ciphertext_digest:f.response[0].ciphertext_digest},a,f.response,b,l,!0);return bytesToBigInt(i)}catch(t){throw new Error("An error occured during decryption",{cause:t})}},createInstance=async t=>{const{publicKey:e,kmsContractAddress:a,aclContractAddress:_}=t;if(!a||!isAddress(a))throw new Error("KMS contract address is not valid or empty");if(!_||!isAddress(_))throw new Error("ACL contract address is not valid or empty");if(e&&!(e instanceof Uint8Array))throw new Error("publicKey must be a Uint8Array");const n=getProvider(t);if(!n)throw new Error("No network has been provided!");const i=await getChainId(n,t),r=await getTfheCompactPublicKey(t),s=await getPublicParams(t),o=await getKMSSigners(n,t);return{createEncryptedInput:createEncryptedInput(_,i,cleanURL(t.gatewayUrl),r.publicKey,r.publicKeyId,s),generateKeypair:generateKeypair,createEIP712:createEIP712(i),reencrypt:reencryptRequest(o,i,0,_,cleanURL(t.gatewayUrl),n),getPublicKey:()=>r.publicKey?{publicKey:r.publicKey.safe_serialize(SERIALIZED_SIZE_LIMIT_PK),publicKeyId:r.publicKeyId}:null,getPublicParams:t=>s[t]?{publicParams:s[t].publicParams.safe_serialize(SERIALIZED_SIZE_LIMIT_CRS),publicParamsId:s[t].publicParamsId}:null}};let initialized=!1;const initFhevm=async({tfheParams:t,kmsParams:e,thread:a}={})=>(null==a&&(a=navigator.hardwareConcurrency),await threads()||(console.warn("This browser does not support threads. Verify that your server returns correct headers:\n","'Cross-Origin-Opener-Policy': 'same-origin'\n","'Cross-Origin-Embedder-Policy': 'require-corp'"),a=void 0),initialized||(await __wbg_init$1({module_or_path:t}),await __wbg_init({module_or_path:e}),a&&(init_panic_hook(),await initThreadPool(a)),initialized=!0),!0);export{createEIP712,createInstance,generateKeypair,initFhevm};
//# sourceMappingURL=/sm/171da7057b9854235f04192a827a601cbeeeb9990c6bc37749d4886e45743bc3.map