UNPKG

@nutrient-sdk/node

Version:

Convert documents in your Node.js apps.

13 lines 218 kB
/*! * Nutrient for Node.js 1.0.0 (https://www.nutrient.io/nodejs) * * Copyright © 2024-2025 PSPDFKit GmbH. All rights reserved. * * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT. * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. * This notice may not be removed from this file. * * Nutrient uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/nodejs-acknowledgements/ */ let e,t,n,r,o,a,i,s,l,c,u,p,d,_,f,m;var h,b,g,y,w,S,k="8.0.13";let v="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,E="function"==typeof importScripts,U="object"==typeof window||E&&!v,I=!U&&!v&&!E,x,T=null,j=null,A=null,R=!1,L=!0,$=!0,C=!1,N=!1,D=!1;function B(e){x=e.isPThread,R=e.linkerDisableLegacyJsInterop,L=e.linkerWasmEnableSIMD,$=e.linkerWasmEnableEH,C=e.linkerEnableAotProfiler,N=e.linkerEnableBrowserProfiler,j.quit=e.quit_,j.ExitStatus=e.ExitStatus,j.moduleGitHash=e.gitHash}function O(n){if(D)throw Error("Runtime module already loaded");D=!0,e=n.module,t=n.internal,j=n.runtimeHelpers,A=n.loaderHelpers,T=n.api,Object.assign(j,{gitHash:"eba546b0f0d448e0176a2222548fd7a2fbf464c0",allAssetsInMemory:M(),dotnetReady:M(),afterInstantiateWasm:M(),beforePreInit:M(),afterPreInit:M(),afterPreRun:M(),beforeOnRuntimeInitialized:M(),afterOnRuntimeInitialized:M(),afterPostRun:M(),mono_wasm_exit:()=>{throw Error("Mono shutdown")},abort:e=>{throw e}}),Object.assign(n.module.config,{}),Object.assign(n.api,{Module:n.module,...n.module}),Object.assign(n.api,{INTERNAL:n.internal})}function M(e,t){return A.createPromiseController(e,t)}function F(e,t){if(e)return;let n="Assert failed: "+("function"==typeof t?t():t),r=Error(n);j.abort(r)}function P(e){return null==e}(h=y||(y={}))[h.None=0]="None",h[h.Void=1]="Void",h[h.Discard=2]="Discard",h[h.Boolean=3]="Boolean",h[h.Byte=4]="Byte",h[h.Char=5]="Char",h[h.Int16=6]="Int16",h[h.Int32=7]="Int32",h[h.Int52=8]="Int52",h[h.BigInt64=9]="BigInt64",h[h.Double=10]="Double",h[h.Single=11]="Single",h[h.IntPtr=12]="IntPtr",h[h.JSObject=13]="JSObject",h[h.Object=14]="Object",h[h.String=15]="String",h[h.Exception=16]="Exception",h[h.DateTime=17]="DateTime",h[h.DateTimeOffset=18]="DateTimeOffset",h[h.Nullable=19]="Nullable",h[h.Task=20]="Task",h[h.Array=21]="Array",h[h.ArraySegment=22]="ArraySegment",h[h.Span=23]="Span",h[h.Action=24]="Action",h[h.Function=25]="Function",h[h.JSException=26]="JSException";let z=[],V=BigInt("9223372036854775807"),W=BigInt("-9223372036854775808");function H(){n||(r=n=e._malloc(32768)),z.push(r)}function G(e,t,n){if(!Number.isSafeInteger(e))throw Error(`Assert failed: Value is not an integer: ${e} (${typeof e})`);if(!(e>=t&&e<=n))throw Error(`Assert failed: Overflow: value ${e} is out of ${t} ${n} range`)}function q(e,t){ej().fill(0,e,e+t)}function J(t,n){let r=!!n;"number"==typeof n&&G(n,0,1),e.HEAP32[t>>>2]=r?1:0}function Y(t,n){G(n,0,255),e.HEAPU8[t]=n}function X(t,n){G(n,0,65535),e.HEAPU16[t>>>1]=n}function Z(e,t,n){G(n,0,65535),e[t>>>1]=n}function K(t,n){e.HEAPU32[t>>>2]=n}function Q(t,n){G(n,0,4294967295),e.HEAPU32[t>>>2]=n}function ee(t,n){G(n,-128,127),e.HEAP8[t]=n}function et(t,n){G(n,-32768,32767),e.HEAP16[t>>>1]=n}function en(t,n){e.HEAP32[t>>>2]=n}function er(t,n){G(n,-2147483648,2147483647),e.HEAP32[t>>>2]=n}function eo(e){if(0!==e)switch(e){case 1:throw Error("value was not an integer");case 2:throw Error("value out of range");default:throw Error("unknown internal error")}}function ea(e,t){if(!Number.isSafeInteger(t))throw Error(`Assert failed: Value is not a safe integer: ${t} (${typeof t})`);eo(t_.mono_wasm_f64_to_i52(e,t))}function ei(e,t){if(!Number.isSafeInteger(t))throw Error(`Assert failed: Value is not a safe integer: ${t} (${typeof t})`);if(!(t>=0))throw Error("Assert failed: Can't convert negative Number into UInt64");eo(t_.mono_wasm_f64_to_u52(e,t))}function es(t,n){if("bigint"!=typeof n)throw Error(`Assert failed: Value is not an bigint: ${n} (${typeof n})`);if(!(n>=W&&n<=V))throw Error(`Assert failed: Overflow: value ${n} is out of ${W} ${V} range`);e.HEAP64[t>>>3]=n}function el(t,n){if("number"!=typeof n)throw Error(`Assert failed: Value is not a Number: ${n} (${typeof n})`);e.HEAPF32[t>>>2]=n}function ec(t,n){if("number"!=typeof n)throw Error(`Assert failed: Value is not a Number: ${n} (${typeof n})`);e.HEAPF64[t>>>3]=n}function eu(t){return!!e.HEAP32[t>>>2]}function ep(t){return e.HEAPU8[t]}function ed(t){return e.HEAPU16[t>>>1]}function e_(t){return e.HEAPU32[t>>>2]}function ef(e){return t_.mono_wasm_get_i32_unaligned(e)}function em(e){return t_.mono_wasm_get_i32_unaligned(e)>>>0}function eh(t){return e.HEAP8[t]}function eb(t){return e.HEAP16[t>>>1]}function eg(t){return e.HEAP32[t>>>2]}function ey(e){let t=t_.mono_wasm_i52_to_f64(e,j._i52_error_scratch_buffer);return eo(eg(j._i52_error_scratch_buffer)),t}function ew(e){let t=t_.mono_wasm_u52_to_f64(e,j._i52_error_scratch_buffer);return eo(eg(j._i52_error_scratch_buffer)),t}function eS(t){return e.HEAP64[t>>>3]}function ek(t){return e.HEAPF32[t>>>2]}function ev(t){return e.HEAPF64[t>>>3]}function eE(t){let n=e._malloc(t.length);return new Uint8Array(ej().buffer,n,t.length).set(t),n}function eU(){return e.HEAP8}function eI(){return e.HEAP16}function ex(){return e.HEAP32}function eT(){return e.HEAP64}function ej(){return e.HEAPU8}function eA(){return e.HEAPU16}function eR(){return e.HEAPU32}function eL(){return e.HEAPF32}function e$(){return e.HEAPF64}let eC=null,eN=null,eD=0,eB=[],eO=[];function eM(t,n){if(t<=0)throw Error("capacity >= 1");let r=4*(t|=0),o=e._malloc(r);if(o%4!=0)throw Error("Malloc returned an unaligned offset");return q(o,r),new eV(o,t,!0,n)}function eF(e){let t;if(!e)throw Error("address must be a location in the native heap");return eO.length>0?(t=eO.pop())._set_address(e):t=new eH(e),t}function eP(e){let t;if(eB.length>0)t=eB.pop();else{let e=function(){if(P(eC)||!eN){eC=eM(8192,"js roots"),eN=new Int32Array(8192),eD=8192;for(let e=0;e<8192;e++)eN[e]=8192-e-1}if(eD<1)throw Error("Out of scratch root space");let e=eN[eD-1];return eD--,e}();t=new eW(eC,e)}if(void 0!==e){if("number"!=typeof e)throw Error("value must be an address in the managed heap");t.set(e)}else t.set(0);return t}function ez(...e){for(let t=0;t<e.length;t++)P(e[t])||e[t].release()}class eV{constructor(e,t,n,r){this.__offset=e,this.__offset32=e>>>2,this.__count=t,this.length=t,this.__handle=t_.mono_wasm_register_root(e,4*t,r||"noname"),this.__ownsAllocation=n}_throw_index_out_of_range(){throw Error("index out of range")}_check_in_range(e){(e>=this.__count||e<0)&&this._throw_index_out_of_range()}get_address(e){return this._check_in_range(e),this.__offset+4*e}get_address_32(e){return this._check_in_range(e),this.__offset32+e}get(e){this._check_in_range(e);let t=this.get_address_32(e);return eR()[t]}set(e,t){let n=this.get_address(e);return t_.mono_wasm_write_managed_pointer_unsafe(n,t),t}copy_value_from_address(e,t){let n=this.get_address(e);t_.mono_wasm_copy_managed_pointer(n,t)}_unsafe_get(e){return eR()[this.__offset32+e]}_unsafe_set(e,t){let n=this.__offset+e;t_.mono_wasm_write_managed_pointer_unsafe(n,t)}clear(){this.__offset&&q(this.__offset,4*this.__count)}release(){this.__offset&&this.__ownsAllocation&&(t_.mono_wasm_deregister_root(this.__offset),q(this.__offset,4*this.__count),e._free(this.__offset)),this.__handle=this.__offset=this.__count=this.__offset32=0}toString(){return`[root buffer @${this.get_address(0)}, size ${this.__count} ]`}}class eW{constructor(e,t){this.__buffer=e,this.__index=t}get_address(){return this.__buffer.get_address(this.__index)}get_address_32(){return this.__buffer.get_address_32(this.__index)}get address(){return this.__buffer.get_address(this.__index)}get(){return this.__buffer._unsafe_get(this.__index)}set(e){let t=this.__buffer.get_address(this.__index);return t_.mono_wasm_write_managed_pointer_unsafe(t,e),e}copy_from(e){let t=e.address,n=this.address;t_.mono_wasm_copy_managed_pointer(n,t)}copy_to(e){let t=this.address,n=e.address;t_.mono_wasm_copy_managed_pointer(n,t)}copy_from_address(e){let t=this.address;t_.mono_wasm_copy_managed_pointer(t,e)}copy_to_address(e){let t=this.address;t_.mono_wasm_copy_managed_pointer(e,t)}get value(){return this.get()}set value(e){this.set(e)}valueOf(){throw Error("Implicit conversion of roots to pointers is no longer supported. Use .value or .address as appropriate")}clear(){let e=this.__buffer.get_address_32(this.__index);eR()[e]=0}release(){var e;if(!this.__buffer)throw Error("No buffer");eB.length>128?(void 0!==(e=this.__index)&&(eC.set(e,0),eN[eD]=e,eD++),this.__buffer=null,this.__index=0):(this.set(0),eB.push(this))}toString(){return`[root @${this.address}]`}}class eH{constructor(e){this.__external_address=0,this.__external_address_32=0,this._set_address(e)}_set_address(e){this.__external_address=e,this.__external_address_32=e>>>2}get address(){return this.__external_address}get_address(){return this.__external_address}get_address_32(){return this.__external_address_32}get(){return eR()[this.__external_address_32]}set(e){return t_.mono_wasm_write_managed_pointer_unsafe(this.__external_address,e),e}copy_from(e){let t=e.address,n=this.__external_address;t_.mono_wasm_copy_managed_pointer(n,t)}copy_to(e){let t=this.__external_address,n=e.address;t_.mono_wasm_copy_managed_pointer(n,t)}copy_from_address(e){let t=this.__external_address;t_.mono_wasm_copy_managed_pointer(t,e)}copy_to_address(e){let t=this.__external_address;t_.mono_wasm_copy_managed_pointer(e,t)}get value(){return this.get()}set value(e){this.set(e)}valueOf(){throw Error("Implicit conversion of roots to pointers is no longer supported. Use .value or .address as appropriate")}clear(){eR()[this.__external_address>>>2]=0}release(){eO.length<128&&eO.push(this)}toString(){return`[external root @${this.address}]`}}let eG=new Map,eq=new Map,eJ,eY,eX,eZ,eK=0,eQ=null,e1=0;function e0(t){let n=ej();return function(t,n,r){let o=n+r,a=n;for(;t[a]&&!(a>=o);)++a;if(a-n<=16||void 0===eX)return e.UTF8ArrayToString(t,n,r);let i=e9(t,n,a);return eX.decode(i)}(n,t,n.length-t)}function e2(e,t){if(eJ){let n=e9(ej(),e,t);return eJ.decode(n)}return e4(e,t)}function e4(e,t){let n="",r=eA();for(let o=e;o<t;o+=2){let e=r[o>>>1];n+=String.fromCharCode(e)}return n}function e3(e,t,n){let r=eA(),o=n.length;for(let a=0;a<o&&(Z(r,e,n.charCodeAt(a)),!((e+=2)>=t));a++);}function e8(e){let t;if(0===e.value)return null;let n=o+0,r=o+4,a=o+8;t_.mono_wasm_string_get_data_ref(e.address,n,r,a);let i=eR(),s=i[r>>>2],l=i[n>>>2],c=i[a>>>2];if(c&&(t=eq.get(e.value)),void 0===t&&(s&&l?(t=e2(l,l+s),c&&eq.set(e.value,t)):t=""),void 0===t)throw Error(`internal error when decoding string at location ${e.value}`);return t}function e5(e,t){if(t.clear(),null!==e){if("symbol"==typeof e)e6(e,t);else{if("string"!=typeof e)throw Error("Expected string argument, got "+typeof e);if(0===e.length)e6(e,t);else{if(e.length<=256){let n=eG.get(e);if(n)return void t.set(n)}e7(e,t)}}}}function e6(e,t){let n;if("symbol"==typeof e?("string"!=typeof(n=e.description)&&(n=Symbol.keyFor(e)),"string"!=typeof n&&(n="<unknown Symbol>")):"string"==typeof e&&(n=e),"string"!=typeof n)throw Error(`Argument to stringToInternedMonoStringRoot must be a string but was ${e}`);if(0===n.length&&eK)return void t.set(eK);let r=eG.get(n);r?t.set(r):(e7(n,t),function(e,t,n){if(!t.value)throw Error("null pointer passed to _store_string_in_intern_table");e1>=8192&&(eQ=null),eQ||(eQ=eM(8192,"interned strings"),e1=0);let r=eQ,o=e1++;if(t_.mono_wasm_intern_string_ref(t.address),!t.value)throw Error("mono_wasm_intern_string_ref produced a null pointer");eG.set(e,t.value),eq.set(t.value,e),0!==e.length||eK||(eK=t.value),r.copy_value_from_address(o,t.address)}(n,t))}function e7(t,n){let r=2*(t.length+1),o=e._malloc(r);e3(o,o+r,t),t_.mono_wasm_string_from_utf16_ref(o,t.length,n.address),e._free(o)}function e9(e,t,n){return e.buffer,e.subarray(t,n)}let te="MONO_WASM: ";function tt(e,...t){j.diagnosticTracing&&console.debug(te+e,...t)}function tn(e,...t){console.info(te+e,...t)}function tr(e,...t){console.warn(te+e,...t)}function to(e,...t){t&&t.length>0&&t[0]&&"object"==typeof t[0]&&t[0].silent||console.error(te+e,...t)}let ta=new Map,ti=[];function ts(e){try{if(0==ta.size)return e;for(let t=0;t<ti.length;t++){let n=e.replace(RegExp(ti[t],"g"),(e,...t)=>{let n=t.find(e=>"object"==typeof e&&void 0!==e.replaceSection);if(void 0===n)return e;let r=n.funcNum,o=n.replaceSection,a=ta.get(Number(r));return void 0===a?e:e.replace(o,`${a} (${o})`)});if(n!==e)return n}return e}catch(t){return console.debug(`failed to symbolicate: ${t}`),e}}function tl(e){let t=e;return t&&t.stack||(t=Error(t?""+t:"Unknown error")),ts(t.stack)}function tc(){return[...ta.values()]}ti.push(/at (?<replaceSection>[^:()]+:wasm-function\[(?<funcNum>\d+)\]:0x[a-fA-F\d]+)((?![^)a-fA-F\d])|$)/),ti.push(/(?:WASM \[[\da-zA-Z]+\], (?<replaceSection>function #(?<funcNum>[\d]+) \(''\)))/),ti.push(/(?<replaceSection>[a-z]+:\/\/[^ )]*:wasm-function\[(?<funcNum>\d+)\]:0x[a-fA-F\d]+)/),ti.push(/(?<replaceSection><[^ >]+>[.:]wasm-function\[(?<funcNum>[0-9]+)\])/);let tu=[[!0,"mono_wasm_array_get_ref","void",["number","number","number"]],[!0,"mono_wasm_obj_array_new_ref","void",["number","number"]],[!0,"mono_wasm_obj_array_set_ref","void",["number","number","number"]],[!0,"mono_wasm_try_unbox_primitive_and_get_type_ref","number",["number","number","number"]],[!0,"mono_wasm_box_primitive_ref","void",["number","number","number","number"]],[!0,"mono_wasm_string_array_new_ref","void",["number","number"]],[!0,"mono_wasm_typed_array_new_ref","void",["number","number","number","number","number"]],[!0,"mono_wasm_get_delegate_invoke_ref","number",["number"]],[!0,"mono_wasm_get_type_name","string",["number"]],[!0,"mono_wasm_get_type_aqn","string",["number"]],[!0,"mono_wasm_obj_array_new","number",["number"]],[!0,"mono_wasm_obj_array_set","void",["number","number","number"]],[!0,"mono_wasm_array_length_ref","number",["number"]]],tp=[[!0,"mono_wasm_register_root","number",["number","number","string"]],[!0,"mono_wasm_deregister_root",null,["number"]],[!0,"mono_wasm_string_get_data_ref",null,["number","number","number","number"]],[!0,"mono_wasm_set_is_debugger_attached","void",["bool"]],[!0,"mono_wasm_send_dbg_command","bool",["number","number","number","number","number"]],[!0,"mono_wasm_send_dbg_command_with_parms","bool",["number","number","number","number","number","number","string"]],[!0,"mono_wasm_setenv",null,["string","string"]],[!0,"mono_wasm_parse_runtime_options",null,["number","number"]],[!0,"mono_wasm_strdup","number",["string"]],[!0,"mono_background_exec",null,[]],[!0,"mono_wasm_execute_timer",null,[]],[!0,"mono_wasm_load_icu_data","number",["number"]],[!1,"mono_wasm_add_assembly","number",["string","number","number"]],[!0,"mono_wasm_add_satellite_assembly","void",["string","string","number","number"]],[!1,"mono_wasm_load_runtime",null,["string","number"]],[!0,"mono_wasm_change_debugger_log_level","void",["number"]],[!0,"mono_wasm_get_corlib","number",[]],[!0,"mono_wasm_assembly_load","number",["string"]],[!0,"mono_wasm_assembly_find_class","number",["number","string","string"]],[!0,"mono_wasm_runtime_run_module_cctor","void",["number"]],[!0,"mono_wasm_assembly_find_method","number",["number","string","number"]],[!1,"mono_wasm_invoke_method_ref","void",["number","number","number","number","number"]],[!0,"mono_wasm_string_from_utf16_ref","void",["number","number","number"]],[!0,"mono_wasm_intern_string_ref","void",["number"]],[!0,"mono_wasm_assembly_get_entry_point","number",["number","number"]],[!0,"mono_wasm_class_get_type","number",["number"]],[!1,"mono_wasm_exit","void",["number"]],[!1,"mono_wasm_abort","void",[]],[!0,"mono_wasm_getenv","number",["string"]],[!0,"mono_wasm_set_main_args","void",["number","number"]],[!1,"mono_wasm_enable_on_demand_gc","void",["number"]],[()=>!C,"mono_wasm_profiler_init_aot","void",["string"]],[()=>!N,"mono_wasm_profiler_init_aot","void",["string"]],[!0,"mono_wasm_profiler_init_browser","void",["number"]],[!1,"mono_wasm_exec_regression","number",["number","string"]],[!1,"mono_wasm_invoke_method_bound","number",["number","number","number"]],[!0,"mono_wasm_write_managed_pointer_unsafe","void",["number","number"]],[!0,"mono_wasm_copy_managed_pointer","void",["number","number"]],[!0,"mono_wasm_i52_to_f64","number",["number","number"]],[!0,"mono_wasm_u52_to_f64","number",["number","number"]],[!0,"mono_wasm_f64_to_i52","number",["number","number"]],[!0,"mono_wasm_f64_to_u52","number",["number","number"]],[!0,"mono_wasm_method_get_name","number",["number"]],[!0,"mono_wasm_method_get_full_name","number",["number"]],[!0,"mono_wasm_gc_lock","void",[]],[!0,"mono_wasm_gc_unlock","void",[]],[!0,"mono_wasm_get_i32_unaligned","number",["number"]],[!0,"mono_wasm_get_f32_unaligned","number",["number"]],[!0,"mono_wasm_get_f64_unaligned","number",["number"]],[!0,"mono_jiterp_trace_bailout","void",["number"]],[!0,"mono_jiterp_get_trace_bailout_count","number",["number"]],[!0,"mono_jiterp_value_copy","void",["number","number","number"]],[!0,"mono_jiterp_get_member_offset","number",["number"]],[!0,"mono_jiterp_encode_leb52","number",["number","number","number"]],[!0,"mono_jiterp_encode_leb64_ref","number",["number","number","number"]],[!0,"mono_jiterp_encode_leb_signed_boundary","number",["number","number","number"]],[!0,"mono_jiterp_write_number_unaligned","void",["number","number","number"]],[!0,"mono_jiterp_type_is_byref","number",["number"]],[!0,"mono_jiterp_get_size_of_stackval","number",[]],[!0,"mono_jiterp_parse_option","number",["string"]],[!0,"mono_jiterp_get_options_as_json","number",[]],[!0,"mono_jiterp_get_options_version","number",[]],[!0,"mono_jiterp_adjust_abort_count","number",["number","number"]],[!0,"mono_jiterp_register_jit_call_thunk","void",["number","number"]],[!0,"mono_jiterp_type_get_raw_value_size","number",["number"]],[!0,"mono_jiterp_update_jit_call_dispatcher","void",["number"]],[!0,"mono_jiterp_get_signature_has_this","number",["number"]],[!0,"mono_jiterp_get_signature_return_type","number",["number"]],[!0,"mono_jiterp_get_signature_param_count","number",["number"]],[!0,"mono_jiterp_get_signature_params","number",["number"]],[!0,"mono_jiterp_type_to_ldind","number",["number"]],[!0,"mono_jiterp_type_to_stind","number",["number"]],[!0,"mono_jiterp_imethod_to_ftnptr","number",["number"]],[!0,"mono_jiterp_debug_count","number",[]],[!0,"mono_jiterp_get_trace_hit_count","number",["number"]],[!0,"mono_jiterp_get_polling_required_address","number",[]],[!0,"mono_jiterp_get_rejected_trace_count","number",[]],[!0,"mono_jiterp_boost_back_branch_target","void",["number"]],[!0,"mono_jiterp_is_imethod_var_address_taken","number",["number","number"]],[!0,"mono_jiterp_get_opcode_value_table_entry","number",["number"]],[!0,"mono_jiterp_get_simd_intrinsic","number",["number","number"]],[!0,"mono_jiterp_get_simd_opcode","number",["number","number"]],[!0,"mono_jiterp_get_arg_offset","number",["number","number","number"]],[!0,"mono_jiterp_get_opcode_info","number",["number","number"]],[!0,"mono_wasm_is_zero_page_reserved","number",[]],[!0,"mono_jiterp_is_special_interface","number",["number"]],...tu],td={};var t_=td;let tf=["void","number",null];function tm(t,n,r,o){let a=void 0===o&&tf.indexOf(n)>=0&&(!r||r.every(e=>tf.indexOf(e)>=0))&&e.asm?e.asm[t]:void 0;if(a&&r&&a.length!==r.length&&(to(`argument count mismatch for cwrap ${t}`),a=void 0),"function"!=typeof a&&(a=e.cwrap(t,n,r,o)),"function"!=typeof a)throw Error(`cwrap ${t} not found or not a function`);return a}function th(e,t,n){let r=function(e,t,n){let r,o="number"==typeof t?t:0;r="number"==typeof n?o+n:e.length-o;let a={read:function(){if(o>=r)return null;let t=e[o];return o+=1,t}};return Object.defineProperty(a,"eof",{get:function(){return o>=r},configurable:!0,enumerable:!0}),a}(e,t,n),o="",a=0,i=0,s=0,l=0,c=0;for(;a=r.read(),i=r.read(),s=r.read(),null!==a;)null===i&&(i=0,l+=1),null===s&&(s=0,l+=1),o+=tb[(16777215&(c=a<<16|i<<8|s<<0))>>18]+tb[(262143&c)>>12],l<2&&(o+=tb[(4095&c)>>6]),2===l?o+="==":1===l?o+="=":o+=tb[(63&c)>>0];return o}let tb=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],tg=new Map;tg.remove=function(e){let t=this.get(e);return this.delete(e),t};let ty,tw,tS,tk={},tv=0,tE=-1;function tU(){t.mono_wasm_runtime_is_ready=j.mono_wasm_runtime_is_ready=!0,tv=0,tk={},tE=-1}function tI(e){console.assert(!0,`mono_wasm_fire_debugger_agent_message_with_data ${e}`)}function tx(t){t.length>tE&&(ty&&e._free(ty),tE=Math.max(t.length,tE,256),ty=e._malloc(tE));let n=atob(t),r=ej();for(let e=0;e<n.length;e++)r[ty+e]=n.charCodeAt(e)}function tT(e,t,n,r,o,a,i){tx(r),t_.mono_wasm_send_dbg_command_with_parms(e,t,n,ty,o,a,i.toString());let{res_ok:s,res:l}=tg.remove(e);if(!s)throw Error("Failed on mono_wasm_invoke_method_debugger_agent_with_parms");return l}function tj(e,t,n,r){tx(r),t_.mono_wasm_send_dbg_command(e,t,n,ty,r.length);let{res_ok:o,res:a}=tg.remove(e);if(!o)throw Error("Failed on mono_wasm_send_dbg_command");return a}function tA(){let{res_ok:e,res:t}=tg.remove(0);if(!e)throw Error("Failed on mono_wasm_get_dbg_command_info");return t}function tR(){}function tL(){t_.mono_wasm_set_is_debugger_attached(!1)}function t$(e){t_.mono_wasm_change_debugger_log_level(e)}function tC(e,t={}){if("object"!=typeof e)throw Error(`event must be an object, but got ${JSON.stringify(e)}`);if(void 0===e.eventName)throw Error(`event.eventName is a required parameter, in event: ${JSON.stringify(e)}`);if("object"!=typeof t)throw Error(`args must be an object, but got ${JSON.stringify(t)}`);console.debug("mono_wasm_debug_event_raised:aef14bca-5519-4dfe-b35a-f867abc123ae",JSON.stringify(e),JSON.stringify(t))}function tN(){-1==j.waitForDebugger&&(j.waitForDebugger=1),t_.mono_wasm_set_is_debugger_attached(!0)}function tD(e){if(null!=e.arguments&&!Array.isArray(e.arguments))throw Error(`"arguments" should be an array, but was ${e.arguments}`);let t=e.objectId,n=e.details,r={};if(t.startsWith("dotnet:cfo_res:")){if(!(t in tk))throw Error(`Unknown object id ${t}`);r=tk[t]}else r=function(e,t){if(e.startsWith("dotnet:array:")){if(void 0===t.items)return t.map(e=>e.value);if(void 0===t.dimensionsDetails||1===t.dimensionsDetails.length)return t.items.map(e=>e.value)}let n={};return Object.keys(t).forEach(e=>{let r=t[e];void 0!==r.get?Object.defineProperty(n,r.name,{get:()=>tj(r.get.id,r.get.commandSet,r.get.command,r.get.buffer),set:function(e){return tT(r.set.id,r.set.commandSet,r.set.command,r.set.buffer,r.set.length,r.set.valtype,e),!0}}):void 0!==r.set?Object.defineProperty(n,r.name,{get:()=>r.value,set:function(e){return tT(r.set.id,r.set.commandSet,r.set.command,r.set.buffer,r.set.length,r.set.valtype,e),!0}}):n[r.name]=r.value}),n}(t,n);let o=null!=e.arguments?e.arguments.map(e=>JSON.stringify(e.value)):[],a=`const fn = ${e.functionDeclaration}; return fn.apply(proxy, [${o}]);`,i=Function("proxy",a)(r);if(void 0===i)return{type:"undefined"};if(Object(i)!==i)return"object"==typeof i&&null==i?{type:typeof i,subtype:`${i}`,value:null}:{type:typeof i,description:`${i}`,value:`${i}`};if(e.returnByValue&&null==i.subtype)return{type:"object",value:i};if(Object.getPrototypeOf(i)==Array.prototype){let e=tO(i);return{type:"object",subtype:"array",className:"Array",description:`Array(${i.length})`,objectId:e}}return void 0!==i.value||void 0!==i.subtype?i:i==r?{type:"object",className:"Object",description:"Object",objectId:t}:{type:"object",className:"Object",description:"Object",objectId:tO(i)}}function tB(e,t={}){return function(e,t){if(!(e in tk))throw Error(`Could not find any object with id ${e}`);let n=tk[e],r=Object.getOwnPropertyDescriptors(n);t.accessorPropertiesOnly&&Object.keys(r).forEach(e=>{void 0===r[e].get&&Reflect.deleteProperty(r,e)});let o=[];return Object.keys(r).forEach(e=>{let t;let n=r[e];t="object"==typeof n.value?Object.assign({name:e},n):void 0!==n.value?{name:e,value:Object.assign({type:typeof n.value,description:""+n.value},n)}:void 0!==n.get?{name:e,get:{className:"Function",description:`get ${e} () {}`,type:"function"}}:{name:e,value:{type:"symbol",value:"<Unknown>",description:"<Unknown>"}},o.push(t)}),{__value_as_json_string__:JSON.stringify(o)}}(`dotnet:cfo_res:${e}`,t)}function tO(e){let t="dotnet:cfo_res:"+tv++;return tk[t]=e,t}function tM(e){e in tk&&delete tk[e]}function tF(){if(j.enablePerfMeasure)return globalThis.performance.now()}function tP(e,t,n){if(j.enablePerfMeasure&&e){let r=U?{start:e}:{startTime:e},o=n?`${t}${n} `:t;globalThis.performance.measure(o,r)}}let tz=[],tV=new Map,tW=new Map,tH=new Map,tG=Symbol.for("wasm bound_cs_function"),tq=Symbol.for("wasm bound_js_function"),tJ=Symbol.for("wasm imported_js_function");function tY(t){let n=e.stackAlloc(16*t);return n&&n%8==0||F(!1,"Arg alignment"),t5(tX(n,0),y.None),t5(tX(n,1),y.None),n}function tX(e,t){return e||F(!1,"Null args"),e+16*t}function tZ(e,t){return e||F(!1,"Null signatures"),e+32*t+8}function tK(e){return e||F(!1,"Null sig"),e_(e)}function tQ(e){return e||F(!1,"Null sig"),e_(e+16)}function t1(e){return e||F(!1,"Null sig"),e_(e+20)}function t0(e){return e||F(!1,"Null sig"),e_(e+24)}function t2(e){return e||F(!1,"Null sig"),e_(e+28)}function t4(e){return e||F(!1,"Null signatures"),eg(e+4)}function t3(e){return e||F(!1,"Null signatures"),eg(e)}function t8(e){return e||F(!1,"Null arg"),e_(e+12)}function t5(e,t){e||F(!1,"Null arg"),Q(e+12,t)}function t6(e){return e||F(!1,"Null arg"),e_(e)}function t7(e,t){if(e||F(!1,"Null arg"),"boolean"!=typeof t)throw Error(`Assert failed: Value is not a Boolean: ${t} (${typeof t})`);Y(e,t?1:0)}function t9(e,t){e||F(!1,"Null arg"),Q(e,t)}function ne(e,t){e||F(!1,"Null arg"),ec(e,t.getTime())}function nt(e,t){e||F(!1,"Null arg"),ec(e,t)}function nn(e){return e||F(!1,"Null arg"),e_(e+4)}function nr(e,t){e||F(!1,"Null arg"),Q(e+4,t)}function no(e){return e||F(!1,"Null arg"),e_(e+4)}function na(e,t){e||F(!1,"Null arg"),Q(e+4,t)}function ni(e){return e||F(!1,"Null arg"),eF(e)}function ns(e){return e||F(!1,"Null arg"),eg(e+8)}function nl(e,t){e||F(!1,"Null arg"),er(e+8,t)}class nc{dispose(){rp(this,0)}get isDisposed(){return 0===this[ro]}toString(){return`CsObject(gc_handle: ${this[ro]})`}}class nu extends Error{constructor(e){super(e),this.superStack=Object.getOwnPropertyDescriptor(this,"stack"),Object.defineProperty(this,"stack",{get:this.getManageStack})}getSuperStack(){if(this.superStack){if(void 0!==this.superStack.value)return this.superStack.value;if(void 0!==this.superStack.get)return this.superStack.get.call(this)}return super.stack}getManageStack(){if(this.managed_stack)return this.managed_stack;if(A.is_runtime_running()){let e=this[ro];if(0!==e){let t=j.javaScriptExports.get_managed_stack_trace(e);if(t)return this.managed_stack=t+"\n"+this.getSuperStack(),this.managed_stack}}return this.getSuperStack()}dispose(){rp(this,0)}get isDisposed(){return 0===this[ro]}}function np(e){return e==y.Byte?1:e==y.Int32?4:e==y.Int52||e==y.Double?8:e==y.String||e==y.Object||e==y.JSObject?16:-1}class nd{constructor(e,t,n){this._pointer=e,this._length=t,this._viewType=n}_unsafe_create_view(){let e=0==this._viewType?new Uint8Array(ej().buffer,this._pointer,this._length):1==this._viewType?new Int32Array(ex().buffer,this._pointer,this._length):2==this._viewType?new Float64Array(e$().buffer,this._pointer,this._length):null;if(!e)throw Error("NotImplementedException");return e}set(e,t){if(this.isDisposed)throw Error("Assert failed: ObjectDisposedException");let n=this._unsafe_create_view();if(!e||!n||e.constructor!==n.constructor)throw Error(`Assert failed: Expected ${n.constructor}`);n.set(e,t)}copyTo(e,t){if(this.isDisposed)throw Error("Assert failed: ObjectDisposedException");let n=this._unsafe_create_view();if(!e||!n||e.constructor!==n.constructor)throw Error(`Assert failed: Expected ${n.constructor}`);let r=n.subarray(t);e.set(r)}slice(e,t){if(this.isDisposed)throw Error("Assert failed: ObjectDisposedException");return this._unsafe_create_view().slice(e,t)}get length(){if(this.isDisposed)throw Error("Assert failed: ObjectDisposedException");return this._length}get byteLength(){if(this.isDisposed)throw Error("Assert failed: ObjectDisposedException");return 0==this._viewType?this._length:1==this._viewType?this._length<<2:2==this._viewType?this._length<<3:0}}class n_ extends nd{constructor(e,t,n){super(e,t,n),this.is_disposed=!1}dispose(){this.is_disposed=!0}get isDisposed(){return this.is_disposed}}class nf extends nd{constructor(e,t,n){super(e,t,n)}dispose(){rp(this,0)}get isDisposed(){return 0===this[ro]}}function nm(e,t,n){let r,o,a,i;if(t===y.None||t===y.Void)return;o=rk(t1(e)),a=rk(t0(e)),i=rk(t2(e));let s=tQ(e);r=nh(s),t===y.Nullable&&(t=s);let l=nh(t),c=t1(e),u=16*n;return e=>l(e+u,c,r,o,a,i)}function nh(e){if(e===y.None||e===y.Void)return;let t=tW.get(e);return t&&"function"==typeof t||F(!1,`ERR41: Unknown converter for type ${e}. ${rw}`),t}function nb(e){return t8(e)==y.None?null:(e||F(!1,"Null arg"),!!ep(e))}function ng(e){return t8(e)==y.None?null:(e||F(!1,"Null arg"),ep(e))}function ny(e){return t8(e)==y.None?null:(e||F(!1,"Null arg"),ed(e))}function nw(e){return t8(e)==y.None?null:(e||F(!1,"Null arg"),eb(e))}function nS(e){return t8(e)==y.None?null:(e||F(!1,"Null arg"),eg(e))}function nk(e){return t8(e)==y.None?null:(e||F(!1,"Null arg"),ev(e))}function nv(e){return t8(e)==y.None?null:(e||F(!1,"Null arg"),eS(e))}function nE(e){return t8(e)==y.None?null:(e||F(!1,"Null arg"),ek(e))}function nU(e){return t8(e)==y.None?null:(e||F(!1,"Null arg"),ev(e))}function nI(e){return t8(e)==y.None?null:t6(e)}function nx(){return null}function nT(e){return t8(e)===y.None?null:function(e){e||F(!1,"Null arg");let t=ev(e);return new Date(t)}(e)}function nj(e,t,n,r,o,a){if(t8(e)===y.None)return null;let i=no(e),s=rf(i);return null==s&&((s=(e,t,s)=>j.javaScriptExports.call_delegate(i,e,t,s,n,r,o,a)).dispose=()=>{s.isDisposed||(s.isDisposed=!0,rp(s,i))},s.isDisposed=!1,ru(s,i)),s}function nA(e,t,n){let r=t8(e);if(r===y.None)return null;if(r!==y.Task){n||(n=tW.get(r)),n||F(!1,`Unknown sub_converter for type ${y[r]}. ${rw}`);let t=n(e);return new Promise(e=>e(t))}let o=nn(e);if(0==o)return new Promise(e=>e(void 0));let a=rs(o);a||F(!1,`ERR28: promise not found for js_handle: ${o} `),A.assertIsControllablePromise(a);let i=A.getPromiseController(a),s=i.resolve;return i.resolve=e=>{let t=t8(e);if(t===y.None)return void s(null);n||(n=tW.get(t)),n||F(!1,`Unknown sub_converter for type ${y[t]}. ${rw}`);let r=n(e);s(r)},a}function nR(e){if(t8(e)==y.None)return null;let t=ni(e);try{return e8(t)}finally{t.release()}}function nL(e){let t=t8(e);if(t==y.None)return null;if(t==y.JSException)return rs(nn(e));let n=no(e),r=rf(n);if(null==r){let t=nR(e);ru(r=new nu(t),n)}return r}function n$(e){return t8(e)==y.None?null:rs(nn(e))}function nC(e){let t=t8(e);if(t==y.None)return null;if(t==y.JSObject)return rs(nn(e));if(t==y.Array){let t=(e||F(!1,"Null arg"),e_(e+4));return nD(e,t)}if(t==y.Object){let t=no(e);if(0===t)return null;let n=rf(t);return n||ru(n=new nc,t),n}let n=tW.get(t);return n||F(!1,`Unknown converter for type ${y[t]}. ${rw}`),n(e)}function nN(e,t){return t||F(!1,"Expected valid element_type parameter"),nD(e,t)}function nD(t,n){if(t8(t)==y.None)return null;-1==np(n)&&F(!1,`Element type ${y[n]} not supported`);let r=t6(t),o=ns(t),a=null;if(n==y.String){a=Array(o);for(let e=0;e<o;e++){let t=tX(r,e);a[e]=nR(t)}t_.mono_wasm_deregister_root(r)}else if(n==y.Object){a=Array(o);for(let e=0;e<o;e++){let t=tX(r,e);a[e]=nC(t)}t_.mono_wasm_deregister_root(r)}else if(n==y.JSObject){a=Array(o);for(let e=0;e<o;e++){let t=tX(r,e);a[e]=n$(t)}}else if(n==y.Byte)a=ej().subarray(r,r+o).slice();else if(n==y.Int32)a=ex().subarray(r>>2,(r>>2)+o).slice();else{if(n!=y.Double)throw Error(`NotImplementedException ${y[n]}. ${rw}`);a=e$().subarray(r>>3,(r>>3)+o).slice()}return e._free(r),a}function nB(e,t){t||F(!1,"Expected valid element_type parameter");let n=t6(e),r=ns(e),o=null;if(t==y.Byte)o=new n_(n,r,0);else if(t==y.Int32)o=new n_(n,r,1);else{if(t!=y.Double)throw Error(`NotImplementedException ${y[t]}. ${rw}`);o=new n_(n,r,2)}return o}function nO(e,t){t||F(!1,"Expected valid element_type parameter");let n=t6(e),r=ns(e),o=null;if(t==y.Byte)o=new nf(n,r,0);else if(t==y.Int32)o=new nf(n,r,1);else{if(t!=y.Double)throw Error(`NotImplementedException ${y[t]}. ${rw}`);o=new nf(n,r,2)}return ru(o,no(e)),o}let nM=[null];function nF(e,t){nq.set(e,t),tt(`added module imports '${e}'`)}function nP(e,t,n){if(!e)throw Error("Assert failed: Null reference");e[t]=n}function nz(e,t){if(!e)throw Error("Assert failed: Null reference");return e[t]}function nV(e,t){if(!e)throw Error("Assert failed: Null reference");return t in e}function nW(e,t){if(!e)throw Error("Assert failed: Null reference");return typeof e[t]}function nH(){return globalThis}let nG=new Map,nq=new Map;function nJ(e,t){e&&"string"==typeof e||F(!1,"module_name must be string"),t&&"string"==typeof t||F(!1,"module_url must be string");let n=nG.get(e),r=!n;return r&&(tt(`importing ES6 module '${e}' from '${t}'`),n=import(t),nG.set(e,n)),rg(async()=>{let o=await n;return r&&(nq.set(e,o),tt(`imported ES6 module '${e}' from '${t}'`)),o})}function nY(e,t,n){let r=function(e,t){let n="unknown exception";if(t){n=t.toString();let e=t.stack;e&&(e.startsWith(n)?n=e:n+="\n"+e),n=ts(n)}return e&&en(e,1),n}(e,t);e5(r,n)}function nX(e,t){e&&en(e,0),t&&t.clear()}function nZ(){A.assert_runtime_running(),j.mono_wasm_bindings_is_ready||F(!1,"The runtime must be initialized.")}let nK="function"==typeof globalThis.WeakRef;function nQ(e){return nK?new WeakRef(e):{deref:()=>e,dispose:()=>{e=null}}}let n1=new Map,n0=new Map,n2=0;function n4(e){if(n1.has(e))return n1.get(e);let t=t_.mono_wasm_assembly_load(e);return n1.set(e,t),t}function n3(e,t){var n;let r,o;n2||(n2=t_.mono_wasm_get_corlib());let a=(n=n2,(r=n0.get(n))||n0.set(n,r=new Map),(o=r.get(e))||(o=new Map,r.set(e,o)),o.get(t));if(void 0!==a)return a;if(!(a=t_.mono_wasm_assembly_find_class(n2,e,t)))throw Error(`Failed to find corlib class ${e}.${t}`);return function(e,t,n,r){let o=n0.get(e);if(!o)throw Error("internal error");let a=o.get(t);if(!a)throw Error("internal error");a.set(n,r)}(n2,e,t,a),a}function n8(e,t){nZ();let n=eP();try{if(t_.mono_wasm_invoke_method_bound(e,t,n.address))throw Error("ERR24: Unexpected error: "+e8(n));if(t||F(!1,"Null args"),t8(t)!==y.None)throw nL(tX(t,0))}finally{n.release()}}let n5=new Map;async function n6(e){if(nZ(),!n5.get(e)){let t=tF(),n=n4(e);if(!n)throw Error("Could not find assembly: "+e);let r=t_.mono_wasm_assembly_find_class(n,j.runtime_interop_namespace,"__GeneratedInitializer");if(r){let e=t_.mono_wasm_assembly_find_method(r,"__Register_",-1);if(e){let t=eP(),n=eP();try{if(t_.mono_wasm_invoke_method_ref(e,0,0,t.address,n.address),0!==t.value){let e=e8(n);throw Error(e)}}finally{t.release(),n.release()}}}else t_.mono_wasm_runtime_run_module_cctor(n);tP(t,"mono.getAssemblyExports:",e)}return n5.get(e)||{}}function n7(e){let t=e.substring(e.indexOf("[")+1,e.indexOf("]")).trim(),n=(e=e.substring(e.indexOf("]")+1).trim()).substring(e.indexOf(":")+1),r="",o=e=e.substring(0,e.indexOf(":")).trim();if(-1!=e.indexOf(".")){let t=e.lastIndexOf(".");r=e.substring(0,t),o=e.substring(t+1)}if(!t.trim())throw Error("No assembly name specified "+e);if(!o.trim())throw Error("No class name specified "+e);if(!n.trim())throw Error("No method name specified "+e);return{assembly:t,namespace:r,classname:o,methodname:n}}let n9="function"==typeof globalThis.FinalizationRegistry,re=[null],rt=[],rn=1,rr=new Map;n9&&(a=new globalThis.FinalizationRegistry(r_));let ro=Symbol.for("wasm js_owned_gc_handle"),ra=Symbol.for("wasm cs_owned_js_handle"),ri=Symbol.for("wasm do_not_force_dispose");function rs(e){return 0!==e&&-1!==e?re[e]:null}function rl(e){if(e[ra])return e[ra];let t=rt.length?rt.pop():rn++;return re[t]=e,Object.isExtensible(e)&&(e[ra]=t),t}function rc(e){let t=re[e];null!=t&&(void 0!==t[ra]&&(t[ra]=void 0),re[e]=void 0,rt.push(e))}function ru(e,t){e[ro]=t,n9&&a.register(e,t,e);let n=nQ(e);rr.set(t,n)}function rp(e,t){e&&(t=e[ro],e[ro]=0,n9&&a.unregister(e)),0!==t&&rr.delete(t)&&j.javaScriptExports.release_js_owned_object_by_gc_handle(t)}function rd(e){let t=e[ro];if(0==t)throw Error("Assert failed: ObjectDisposedException");return t}function r_(e){A.is_exited()||rp(null,e)}function rf(e){if(!e)return null;let t=rr.get(e);return t?t.deref():null}function rm(e,t){let n=!1,r=!1,o=0,i=0,s=0,l=0,c=[...rr.keys()];for(let e of c){let r=rr.get(e),o=r.deref();if(n9&&o&&a.unregister(o),o){let a="boolean"==typeof o[ri]&&o[ri];if(t&&tr(`Proxy of C# ${typeof o} with GCHandle ${e} was still alive. ${a?"keeping":"disposing"}.`),a)n=!0;else{let t=A.getPromiseController(o);t&&t.reject(Error("WebWorker which is origin of the Task is being terminated.")),"function"==typeof o.dispose&&o.dispose(),o[ro]===e&&(o[ro]=0),!nK&&r&&r.dispose(),s++}}}n||(rr.clear(),n9&&(a=new globalThis.FinalizationRegistry(r_)));for(let e=0;e<re.length;e++){let n=re[e],o=n&&"boolean"==typeof n[ri]&&n[ri];if(o||(re[e]=void 0),n){if(t&&tr(`Proxy of JS ${typeof n} with JSHandle ${e} was still alive. ${o?"keeping":"disposing"}.`),o)r=!0;else{let t=A.getPromiseController(n);t&&t.reject(Error("WebWorker which is origin of the Task is being terminated.")),"function"==typeof n.dispose&&n.dispose(),n[ra]===e&&(n[ra]=void 0),l++}}}if(r||(re.length=1,rn=1,rt.length=0),e){for(let e of nM)if(e){let t=e[tJ];t&&(t.disposed=!0,o++)}nM.length=1;let e=[...n5.values()];for(let t of e)for(let e in t){let n=t[e][tG];n&&(n.disposed=!0,i++)}n5.clear()}tn(`forceDisposeProxies done: ${o} imports, ${i} exports, ${s} GCHandles, ${l} JSHandles.`)}let rh=("object"==typeof Promise||"function"==typeof Promise)&&"function"==typeof Promise.resolve;function rb(e){return Promise.resolve(e)===e||("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}function rg(e){let{promise:t,promise_control:n}=M();return e().then(e=>n.resolve(e)).catch(e=>n.reject(e)),t}function ry(e){let t=rf(e);if(!t)return;let n=t.promise;n||F(!1,`Expected Promise for GCHandle ${e}`),A.assertIsControllablePromise(n),A.getPromiseController(n).reject(Error("OperationCanceledException"))}let rw="For more information see https://aka.ms/dotnet-wasm-jsinterop";function rS(e,t,n){let r,o,a,i;if(t===y.None||t===y.Void)return;o=nh(t1(e)),a=nh(t0(e)),i=nh(t2(e));let s=tQ(e);r=rk(s),t===y.Nullable&&(t=s);let l=rk(t),c=t1(e),u=16*n;return(e,t)=>{l(e+u,t,c,r,o,a,i)}}function rk(e){if(e===y.None||e===y.Void)return;let t=tH.get(e);return t&&"function"==typeof t||F(!1,`ERR30: Unknown converter for type ${e}`),t}function rv(e,t){null==t?t5(e,y.None):(t5(e,y.Boolean),t7(e,t))}function rE(e,t){null==t?t5(e,y.None):(t5(e,y.Byte),e||F(!1,"Null arg"),Y(e,t))}function rU(e,t){null==t?t5(e,y.None):(t5(e,y.Char),e||F(!1,"Null arg"),X(e,t))}function rI(e,t){null==t?t5(e,y.None):(t5(e,y.Int16),e||F(!1,"Null arg"),et(e,t))}function rx(e,t){null==t?t5(e,y.None):(t5(e,y.Int32),e||F(!1,"Null arg"),er(e,t))}function rT(e,t){null==t?t5(e,y.None):(t5(e,y.Int52),function(e,t){if(e||F(!1,"Null arg"),!Number.isSafeInteger(t))throw Error(`Assert failed: Value is not an integer: ${t} (${typeof t})`);ec(e,t)}(e,t))}function rj(e,t){null==t?t5(e,y.None):(t5(e,y.BigInt64),e||F(!1,"Null arg"),es(e,t))}function rA(e,t){null==t?t5(e,y.None):(t5(e,y.Double),nt(e,t))}function rR(e,t){null==t?t5(e,y.None):(t5(e,y.Single),e||F(!1,"Null arg"),el(e,t))}function rL(e,t){null==t?t5(e,y.None):(t5(e,y.IntPtr),t9(e,t))}function r$(e,t){if(null==t)t5(e,y.None);else{if(!(t instanceof Date))throw Error("Assert failed: Value is not a Date");t5(e,y.DateTime),ne(e,t)}}function rC(e,t){if(null==t)t5(e,y.None);else{if(!(t instanceof Date))throw Error("Assert failed: Value is not a Date");t5(e,y.DateTimeOffset),ne(e,t)}}function rN(e,t){if(null==t)t5(e,y.None);else{if(t5(e,y.String),"string"!=typeof t)throw Error("Assert failed: Value is not a String");rD(e,t)}}function rD(e,t){let n=ni(e);try{e5(t,n)}finally{n.release()}}function rB(e){t5(e,y.None)}function rO(e,t,n,r,o,a,i){if(null==t)return void t5(e,y.None);if(!(t&&t instanceof Function))throw Error("Assert failed: Value is not a Function");let s=e=>{let n=tX(e,0),s=tX(e,1),l=tX(e,2),c=tX(e,3),u=tX(e,4);try{let e,n,p;o&&(e=o(l)),a&&(n=a(c)),i&&(p=i(u));let d=t(e,n,p);r&&r(s,d)}catch(e){rP(n,e)}};s[tq]=!0,s.isDisposed=!1,s.dispose=()=>{s.isDisposed=!0},nr(e,rl(s)),t5(e,y.Function)}class rM{constructor(e){this.promise=e}dispose(){rp(this,0)}get isDisposed(){return 0===this[ro]}}function rF(e,t,n,r){if(null==t)return void t5(e,y.None);if(!rb(t))throw Error("Assert failed: Value is not a Promise");let o=j.javaScriptExports.create_task_callback();na(e,o),t5(e,y.Task);let a=new rM(t);ru(a,o),t.then(e=>{try{A.assert_runtime_running(),a.isDisposed&&F(!1,"This promise can't be propagated to managed code, because the Task was already freed."),j.javaScriptExports.complete_task(o,null,e,r||rV),rp(a,o)}catch(e){tr("Exception marshalling result of JS promise to CS: ",e)}}).catch(e=>{try{A.assert_runtime_running(),a.isDisposed&&F(!1,"This promise can't be propagated to managed code, because the Task was already freed."),j.javaScriptExports.complete_task(o,e,null,void 0),rp(a,o)}catch(e){A.is_exited()||tr("Exception marshalling error of JS promise to CS: ",e)}})}function rP(e,t){if(null==t)t5(e,y.None);else if(t instanceof nu)t5(e,y.Exception),na(e,rd(t));else{if("object"!=typeof t&&"string"!=typeof t)throw Error("Assert failed: Value is not an Error "+typeof t);t5(e,y.JSException),rD(e,t.toString());let n=t[ra];nr(e,n||rl(t))}}function rz(e,t){if(null==t)t5(e,y.None);else{if(void 0!==t[ro])throw Error(`Assert failed: JSObject proxy of ManagedObject proxy is not supported. ${rw}`);if("function"!=typeof t&&"object"!=typeof t)throw Error(`Assert failed: JSObject proxy of ${typeof t} is not supported`);t5(e,y.JSObject),nr(e,rl(t))}}function rV(e,t){if(null==t)t5(e,y.None);else{let n=t[ro],r=typeof t;if(void 0===n){if("string"===r||"symbol"===r)t5(e,y.String),rD(e,t);else if("number"===r)t5(e,y.Double),nt(e,t);else{if("bigint"===r)throw Error("NotImplementedException: bigint");if("boolean"===r)t5(e,y.Boolean),t7(e,t);else if(t instanceof Date)t5(e,y.DateTime),ne(e,t);else if(t instanceof Error)rP(e,t);else if(t instanceof Uint8Array)rH(e,t,y.Byte);else if(t instanceof Float64Array)rH(e,t,y.Double);else if(t instanceof Int32Array)rH(e,t,y.Int32);else if(Array.isArray(t))rH(e,t,y.Object);else{if(t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array)throw Error("NotImplementedException: TypedArray");if(rb(t))rF(e,t);else{if(t instanceof n_)throw Error("NotImplementedException: Span");if("object"!=r)throw Error(`JSObject proxy is not supported for ${r} ${t}`);{let n=rl(t);t5(e,y.JSObject),nr(e,n)}}}}}else{if(rd(t),t instanceof nf)throw Error("NotImplementedException: ArraySegment. "+rw);if(t instanceof nu)t5(e,y.Exception),na(e,n);else{if(!(t instanceof nc))throw Error("NotImplementedException "+r+". "+rw);t5(e,y.Object),na(e,n)}}}}function rW(e,t,n){n||F(!1,"Expected valid element_type parameter"),rH(e,t,n)}function rH(t,n,r){if(null==n)t5(t,y.None);else{let o=np(r);-1==o&&F(!1,`Element type ${y[r]} not supported`);let a=n.length,i=o*a,s=e._malloc(i);if(r==y.String){if(!Array.isArray(n))throw Error("Assert failed: Value is not an Array");q(s,i),t_.mono_wasm_register_root(s,i,"marshal_array_to_cs");for(let e=0;e<a;e++)rN(tX(s,e),n[e])}else if(r==y.Object){if(!Array.isArray(n))throw Error("Assert failed: Value is not an Array");q(s,i),t_.mono_wasm_register_root(s,i,"marshal_array_to_cs");for(let e=0;e<a;e++)rV(tX(s,e),n[e])}else if(r==y.JSObject){if(!Array.isArray(n))throw Error("Assert failed: Value is not an Array");q(s,i);for(let e=0;e<a;e++)rz(tX(s,e),n[e])}else if(r==y.Byte){if(!(Array.isArray(n)||n instanceof Uint8Array))throw Error("Assert failed: Value is not an Array or Uint8Array");ej().subarray(s,s+a).set(n)}else if(r==y.Int32){if(!(Array.isArray(n)||n instanceof Int32Array))throw Error("Assert failed: Value is not an Array or Int32Array");ex().subarray(s>>2,(s>>2)+a).set(n)}else{if(r!=y.Double)throw Error("not implemented");if(!(Array.isArray(n)||n instanceof Float64Array))throw Error("Assert failed: Value is not an Array or Float64Array");e$().subarray(s>>3,(s>>3)+a).set(n)}t9(t,s),t5(t,y.Array),t||F(!1,"Null arg"),Q(t+4,r),nl(t,n.length)}}function rG(e,t,n){if(n||F(!1,"Expected valid element_type parameter"),t.isDisposed)throw Error("Assert failed: ObjectDisposedException");rJ(n,t._viewType),t5(e,y.Span),t9(e,t._pointer),nl(e,t.length)}function rq(e,t,n){n||F(!1,"Expected valid element_type parameter");let r=rd(t);r||F(!1,"Only roundtrip of ArraySegment instance created by C#"),rJ(n,t._viewType),t5(e,y.ArraySegment),t9(e,t._pointer),nl(e,t.length),na(e,r)}function rJ(e,t){if(e==y.Byte){if(0!=t)throw Error("Assert failed: Expected MemoryViewType.Byte")}else if(e==y.Int32){if(1!=t)throw Error("Assert failed: Expected MemoryViewType.Int32")}else{if(e!=y.Double)throw Error(`NotImplementedException ${y[e]} `);if(2!=t)throw Error("Assert failed: Expected MemoryViewType.Double")}}let rY={now:function(){return Date.now()}};function rX(n){void 0===globalThis.performance&&(globalThis.performance=rY),n.require=t.require,n.scriptDirectory=A.scriptDirectory,e.locateFile===e.__locateFile&&(e.locateFile=A.locateFile),n.fetch=A.fetch_like,n.noExitRuntime=U&&!x;let r=n.updateMemoryViews;j.updateMemoryViews=n.updateMemoryViews=()=>{r()}}async function rZ(){var e;if(v){if(globalThis.performance===rY){let{performance:e}=t.require("perf_hooks");globalThis.performance=e}if(t.process=await import("process"),globalThis.crypto||(globalThis.crypto={}),!globalThis.crypto.getRandomValues){let e;try{e=t.require("node:crypto")}catch(e){}e?e.webcrypto?globalThis.crypto=e.webcrypto:e.randomBytes&&(globalThis.crypto.getRandomValues=t=>{t&&t.set(e.randomBytes(t.length))}):globalThis.crypto.getRandomValues=()=>{throw Error("Using node without crypto support. To enable current operation, either provide polyfill for 'globalThis.crypto.getRandomValues' or enable 'node:crypto' module.")}}}j.subtle=null===(e=globalThis.crypto)||void 0===e?void 0:e.subtle}function rK(e){let t=t_.mono_wasm_assembly_find_method(j.runtime_interop_exports_class,e,-1);if(!t)throw"Can't find method "+j.runtime_interop_namespace+"."+j.runtime_interop_exports_classname+"."+e;return t}function rQ(){if("function"!=typeof globalThis.fetch||"function"!=typeof globalThis.AbortController)throw Error(v?"Please install `node-fetch` and `node-abort-controller` npm packages to enable HTTP client support. See also https://aka.ms/dotnet-wasm-features":"This browser doesn't support fetch API. Please use a modern browser. See also https://aka.ms/dotnet-wasm-features")}function r1(){return"undefined"!=typeof Response&&"body"in Response.prototype&&"function"==typeof ReadableStream}function r0(){return rQ(),new AbortController}function r2(e){e.abort()}function r4(t){t.__abort_controller.abort(),t.__reader&&t.__reader.cancel().catch(t=>{t&&"AbortError"!==t.name&&e.err("Error in http_wasm_abort_response: "+t)})}function r3(e,t,n,r,o,a,i,s){return r8(e,t,n,r,o,a,new n_(i,s,0).slice())}function r8(e,t,n,r,o,a,i){rQ(),e&&"string"==typeof e||F(!1,"expected url string"),t&&n&&Array.isArray(t)&&Array.isArray(n)&&t.length===n.length||F(!1,"expected headerNames and headerValues arrays"),r&&o&&Array.isArray(r)&&Array.isArray(o)&&r.length===o.length||F(!1,"expected headerNames and headerValues arrays");let s=new Headers;for(let e=0;e<t.length;e++)s.append(t[e],n[e]);let l={body:i,headers:s,signal:a.signal};for(let e=0;e<r.length;e++)l[r[e]]=o[e];return rg(async()=>{let t=await A.fetch_like(e,l);return t.__abort_controller=a,t})}function r5(e){if(!e.__headerNames&&(e.__headerNames=[],e.__headerValues=[],e.headers&&e.headers.entries)){let t=e.headers.entries();for(let n of t)e.__headerNames.push(n[0]),e.__headerValues.push(n[1])}}function r6(e){return r5(e),e.__headerNames}function r7(e){return r5(e),e.__headerValues}function r9(e){return rg(async()=>{let t=await e.arrayBuffer();return e.__buffer=t,e.__source_offset=0,t.byteLength})}function oe(e,t){if(e.__buffer||F(!1,"expected resoved arrayBuffer"),e.__source_offset==e.__buffer.byteLength)return 0;let n=new Uint8Array(e.__buffer,e.__source_offset);t.set(n,0);let r=Math.min(t.byteLength,n.byteLength);return e.__source_offset+=r,r}function ot(e,t,n){let r=new n_(t,n,0);return rg(async()=>{if(e.__reader||(e.__reader=e.body.getReader()),e.__chunk||(e.__chunk=await e.__reader.read(),e.__source_offset=0),e.__chunk.done)return 0;let t=e.__chunk.value.byteLength-e.__source_offset;t>0||F(!1,"expected remaining_source to be greater than 0");let n=Math.min(t,r.byteLength),o=e.__chunk.value.subarray(e.__source_offset,e.__source_offset+n);return r.set(o,0),e.__source_offset+=n,t==n&&(e.__chunk=void 0),n})}let on,or=0,oo=0;function oa(){if(!A.isChromium)return;let e=(new Date).valueOf(),t=e+36e4;for(let n=Math.max(e+1e3,or);n<t;n+=1e3){let t=n-e;globalThis.setTimeout(oi,t)}or=t}function oi(){e.maybeExit(),A.is_runtime_running()&&(t_.mono_wasm_execute_timer(),oo++,os())}function os(){if(e.maybeExit(),A.is_runtime_running())for(;oo>0;)--oo,t_.mono_background_exec()}function ol(){e.maybeExit(),A.is_runtime_running()&&(on=void 0,t_.mono_wasm_execute_timer())}class oc{constructor(){this.queue=[],this.offset=0}getLength(){return this.queue.length-this.offset}isEmpty(){return 0==this.queue.length}enqueue(e){this.queue.push(e)}dequeue(){if(0===this.queue.length)return;let e=this.queue[this.offset];return this.que