import{_ as CI}from"./chunk-INHXZS53-D3tQiqtZ.js";var EI=(typeof document<"u"&&document.currentScript&&document.currentScript.src,function(BA={}){var Q=BA,R,d;Q.ready=new Promise((A,I)=>{R=A,d=I});var W=Object.assign({},Q),p=Q.printErr||console.error.bind(console);Object.assign(Q,W),W=null;var b;Q.wasmBinary&&(b=Q.wasmBinary),typeof WebAssembly!="object"&&O("no native wasm support detected");var T,gA=!1,j,D,L,q,S,h,QA,CA;function EA(){var A=T.buffer;Q.HEAP8=j=new Int8Array(A),Q.HEAP16=L=new Int16Array(A),Q.HEAPU8=D=new Uint8Array(A),Q.HEAPU16=q=new Uint16Array(A),Q.HEAP32=S=new Int32Array(A),Q.HEAPU32=h=new Uint32Array(A),Q.HEAPF32=QA=new Float32Array(A),Q.HEAPF64=CA=new Float64Array(A)}var iA=[],rA=[],tA=[];function kA(){var A=Q.preRun.shift();iA.unshift(A)}var U=0,Z=null;function O(A){throw Q.onAbort?.(A),A="Aborted("+A+")",p(A),gA=!0,A=new WebAssembly.RuntimeError(A+". Build with -sASSERTIONS for more info."),d(A),A}var eA=A=>A.startsWith("data:application/octet-stream;base64,"),WA=A=>A.startsWith("file://"),m;if(m="lz4_codec.wasm",!eA(m)){var oA=m;m=Q.locateFile?Q.locateFile(oA,""):""+oA}function SA(A){return Promise.resolve().then(()=>{if(A==m&&b)var I=new Uint8Array(b);else throw"both async and sync fetching of the wasm failed";return I})}function aA(A,I,B){return SA(A).then(g=>WebAssembly.instantiate(g,I)).then(g=>g).then(B,g=>{p(`failed to asynchronously prepare wasm: ${g}`),O(g)})}function mA(A,I){var B=m;return b||typeof WebAssembly.instantiateStreaming!="function"||eA(B)||WA(B)||typeof fetch!="function"?aA(B,A,I):fetch(B,{credentials:"same-origin"}).then(g=>WebAssembly.instantiateStreaming(g,A).then(I,function(C){return p(`wasm streaming compile failed: ${C}`),p("falling back to ArrayBuffer instantiation"),aA(B,A,I)}))}var V=A=>{for(;0>2]=I},this.J=function(I){h[this.D+8>>2]=I},this.F=function(I,B){this.G(),this.K(I),this.J(B)},this.G=function(){h[this.D+16>>2]=0}}var nA=0,sA,F=A=>{for(var I="";D[A];)I+=sA[D[A++]];return I},Y={},k={},X={},f,HA=A=>{throw new f(A)},x,vA=(A,I)=>{function B(t){if(t=I(t),t.length!==g.length)throw new x("Mismatched type converter count");for(var E=0;E{k.hasOwnProperty(t)?C[E]=k[t]:(i.push(t),Y.hasOwnProperty(t)||(Y[t]=[]),Y[t].push(()=>{C[E]=k[t],++r,r===i.length&&B(C)}))}),i.length===0&&B(C)};function MA(A,I,B={}){var g=I.name;if(!A)throw new f(`type "${g}" must have a positive integer typeid pointer`);if(k.hasOwnProperty(A)){if(B.M)return;throw new f(`Cannot register type '${g}' twice`)}k[A]=I,delete X[A],Y.hasOwnProperty(A)&&(I=Y[A],delete Y[A],I.forEach(C=>C()))}function N(A,I,B={}){if(!("argPackAdvance"in I))throw new TypeError("registerType registeredInstance requires argPackAdvance");MA(A,I,B)}function DA(){this.B=[void 0],this.H=[]}var c=new DA,hA=A=>{A>=c.D&&--c.get(A).I===0&&c.G(A)},fA=A=>{switch(A){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return c.F({I:1,value:A})}};function wA(A){return this.fromWireType(S[A>>2])}var LA=(A,I)=>{switch(I){case 4:return function(B){return this.fromWireType(QA[B>>2])};case 8:return function(B){return this.fromWireType(CA[B>>3])};default:throw new TypeError(`invalid float width (${I}): ${A}`)}},z=(A,I)=>Object.defineProperty(I,"name",{value:A}),ZA=A=>{for(;A.length;){var I=A.pop();A.pop()(I)}};function cA(A){for(var I=1;I{if(Q[A].A===void 0){var B=Q[A];Q[A]=function(){if(!Q[A].A.hasOwnProperty(arguments.length))throw new f(`Function '${I}' called with an invalid number of arguments (${arguments.length}) - expects one of (${Q[A].A})!`);return Q[A].A[arguments.length].apply(this,arguments)},Q[A].A=[],Q[A].A[B.L]=B}},qA=(A,I,B)=>{if(Q.hasOwnProperty(A)){if(B===void 0||Q[A].A!==void 0&&Q[A].A[B]!==void 0)throw new f(`Cannot register public name '${A}' twice`);if(TA(A,A),Q.hasOwnProperty(B))throw new f(`Cannot register multiple overloads of a function with the same number of arguments (${B})!`);Q[A].A[B]=I}else Q[A]=I,B!==void 0&&(Q[A].O=B)},XA=(A,I)=>{for(var B=[],g=0;g>2]);return B},$,PA=(A,I)=>{var B=[];return function(){if(B.length=0,Object.assign(B,arguments),A.includes("j")){var g=Q["dynCall_"+A];g=B&&B.length?g.apply(null,[I].concat(B)):g.call(null,I)}else g=$.get(I).apply(null,B);return g}},KA=(A,I)=>{A=F(A);var B=A.includes("j")?PA(A,I):$.get(I);if(typeof B!="function")throw new f(`unknown function pointer with signature ${A}: ${I}`);return B},lA,FA=A=>{A=dA(A);var I=F(A);return G(A),I},jA=(A,I)=>{function B(i){C[i]||k[i]||(X[i]?X[i].forEach(B):(g.push(i),C[i]=!0))}var g=[],C={};throw I.forEach(B),new lA(`${A}: `+g.map(FA).join([", "]))},OA=A=>{A=A.trim();const I=A.indexOf("(");return I!==-1?A.substr(0,I):A},VA=(A,I,B)=>{switch(I){case 1:return B?g=>j[g>>0]:g=>D[g>>0];case 2:return B?g=>L[g>>1]:g=>q[g>>1];case 4:return B?g=>S[g>>2]:g=>h[g>>2];default:throw new TypeError(`invalid integer width (${I}): ${A}`)}};function xA(A){return this.fromWireType(h[A>>2])}for(var yA=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,uA=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,zA=(A,I)=>{for(var B=A>>1,g=B+I/2;!(B>=g)&&q[B];)++B;if(B<<=1,32=I/2);++g){var C=L[A+2*g>>1];if(C==0)break;B+=String.fromCharCode(C)}return B},$A=(A,I,B)=>{if(B??=2147483647,2>B)return 0;B-=2;var g=I;B=B<2*A.length?B/2:A.length;for(var C=0;C>1]=A.charCodeAt(C),I+=2;return L[I>>1]=0,I-g},_A=A=>2*A.length,AI=(A,I)=>{for(var B=0,g="";!(B>=I/4);){var C=S[A+4*B>>2];if(C==0)break;++B,65536<=C?(C-=65536,g+=String.fromCharCode(55296|C>>10,56320|C&1023)):g+=String.fromCharCode(C)}return g},II=(A,I,B)=>{if(B??=2147483647,4>B)return 0;var g=I;B=g+B-4;for(var C=0;C=i){var r=A.charCodeAt(++C);i=65536+((i&1023)<<10)|r&1023}if(S[I>>2]=i,I+=4,I+4>B)break}return S[I>>2]=0,I-g},BI=A=>{for(var I=0,B=0;B=g&&++B,I+=4}return I},RA=Array(256),P=0;256>P;++P)RA[P]=String.fromCharCode(P);sA=RA,f=Q.BindingError=class extends Error{constructor(A){super(A),this.name="BindingError"}},x=Q.InternalError=class extends Error{constructor(A){super(A),this.name="InternalError"}},Object.assign(DA.prototype,{get(A){return this.B[A]},has(A){return this.B[A]!==void 0},F(A){var I=this.H.pop()||this.B.length;return this.B[I]=A,I},G(A){this.B[A]=void 0,this.H.push(A)}}),c.B.push({value:void 0},{value:null},{value:!0},{value:!1}),c.D=c.B.length,Q.count_emval_handles=()=>{for(var A=0,I=c.D;I{var B=z(I,function(g){this.name=I,this.message=g,g=Error(g).stack,g!==void 0&&(this.stack=this.toString()+` `+g.replace(/^Error(:[^\n]*)?\n/,""))});return B.prototype=Object.create(A.prototype),B.prototype.constructor=B,B.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},B})(Error,"UnboundTypeError");var gI={n:(A,I,B)=>{throw new YA(A).F(I,B),nA=A,nA},o:()=>{},l:(A,I,B,g)=>{I=F(I),N(A,{name:I,fromWireType:function(C){return!!C},toWireType:function(C,i){return i?B:g},argPackAdvance:8,readValueFromPointer:function(C){return this.fromWireType(D[C])},C:null})},k:(A,I)=>{I=F(I),N(A,{name:I,fromWireType:B=>{if(!B)throw new f("Cannot use deleted val. handle = "+B);var g=c.get(B).value;return hA(B),g},toWireType:(B,g)=>fA(g),argPackAdvance:8,readValueFromPointer:wA,C:null})},i:(A,I,B)=>{I=F(I),N(A,{name:I,fromWireType:g=>g,toWireType:(g,C)=>C,argPackAdvance:8,readValueFromPointer:LA(I,B),C:null})},d:(A,I,B,g,C,i,r)=>{var t=XA(I,B);A=F(A),A=OA(A),C=KA(g,C),qA(A,function(){jA(`Cannot call ${A} due to unbound types`,t)},I-1),vA(t,function(E){var o=A,a=A;E=[E[0],null].concat(E.slice(1));var n=C,e=E.length;if(2>e)throw new f("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=E[1]!==null&&!1,l=cA(E),y=E[0].name!=="void";n=[HA,n,i,ZA,E[0],E[1]];for(var w=0;w{if(I=F(I),C===-1&&(C=4294967295),C=t=>t,g===0){var i=32-8*B;C=t=>t<>>i}var r=I.includes("unsigned")?function(t,E){return E>>>0}:function(t,E){return E};N(A,{name:I,fromWireType:C,toWireType:r,argPackAdvance:8,readValueFromPointer:VA(I,B,g!==0),C:null})},a:(A,I,B)=>{function g(i){return new C(j.buffer,h[i+4>>2],h[i>>2])}var C=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][I];B=F(B),N(A,{name:B,fromWireType:g,argPackAdvance:8,readValueFromPointer:g},{M:!0})},e:(A,I)=>{I=F(I);var B=I==="std::string";N(A,{name:I,fromWireType:function(g){var C=h[g>>2],i=g+4;if(B)for(var r=i,t=0;t<=C;++t){var E=i+t;if(t==C||D[E]==0){if(r){var o=r,a=D,n=o+(E-r);for(r=o;a[r]&&!(r>=n);)++r;if(16e?n+=String.fromCharCode(e):(e-=65536,n+=String.fromCharCode(55296|e>>10,56320|e&1023))}}else n+=String.fromCharCode(e)}o=n}}else o="";if(y===void 0)var y=o;else y+="\0",y+=o;r=E+1}}else{for(y=Array(C),t=0;t=E?t++:2047>=E?t+=2:55296<=E&&57343>=E?(t+=4,++i):t+=3}else t=C.length;if(i=t,t=_(4+i+1),E=t+4,h[t>>2]=i,B&&r){if(r=E,E=i+1,i=D,0=a){var n=C.charCodeAt(++o);a=65536+((a&1023)<<10)|n&1023}if(127>=a){if(r>=E)break;i[r++]=a}else{if(2047>=a){if(r+1>=E)break;i[r++]=192|a>>6}else{if(65535>=a){if(r+2>=E)break;i[r++]=224|a>>12}else{if(r+3>=E)break;i[r++]=240|a>>18,i[r++]=128|a>>12&63}i[r++]=128|a>>6&63}i[r++]=128|a&63}}i[r]=0}}else if(r)for(r=0;r{if(B=F(B),I===2)var g=zA,C=$A,i=_A,r=()=>q,t=1;else I===4&&(g=AI,C=II,i=BI,r=()=>h,t=2);N(A,{name:B,fromWireType:E=>{for(var o=h[E>>2],a=r(),n,e=E+4,s=0;s<=o;++s){var l=E+4+s*I;(s==o||a[l>>t]==0)&&(e=g(e,l-e),n===void 0?n=e:(n+="\0",n+=e),e=l+I)}return G(E),n},toWireType:(E,o)=>{if(typeof o!="string")throw new f(`Cannot pass non-string to C++ string type ${B}`);var a=i(o),n=_(4+a+I);return h[n>>2]=a>>t,C(o,n+4,a+I),E!==null&&E.push(G,n),n},argPackAdvance:8,readValueFromPointer:wA,C(E){G(E)}})},m:(A,I)=>{I=F(I),N(A,{N:!0,name:I,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},g:hA,j:A=>{4{var B=k[A];if(B===void 0)throw A="_emval_take_value has unknown type "+FA(A),new f(A);return A=B,A=A.readValueFromPointer(I),fA(A)},h:()=>{O("")},q:(A,I,B)=>D.copyWithin(A,I,I+B),p:A=>{var I=D.length;if(A>>>=0,2147483648=B;B*=2){var g=I*(1+.2/B);g=Math.min(g,A+100663296);var C=Math;g=Math.max(A,g);A:{C=(C.min.call(C,2147483648,g+(65536-g%65536)%65536)-T.buffer.byteLength+65535)/65536;try{T.grow(C),EA();var i=1;break A}catch{}i=void 0}if(i)return!0}return!1}},J=(function(){function A(B){return J=B.exports,T=J.r,EA(),$=J.w,rA.unshift(J.s),U--,Q.monitorRunDependencies?.(U),U==0&&Z&&(B=Z,Z=null,B()),J}var I={a:gI};if(U++,Q.monitorRunDependencies?.(U),Q.instantiateWasm)try{return Q.instantiateWasm(I,A)}catch(B){p(`Module.instantiateWasm callback failed with error: ${B}`),d(B)}return mA(I,function(B){A(B.instance)}).catch(d),{}})(),_=A=>(_=J.t)(A),G=A=>(G=J.u)(A),dA=A=>(dA=J.v)(A),K;Z=function A(){K||NA(),K||(Z=A)};function NA(){function A(){if(!K&&(K=!0,Q.calledRun=!0,!gA)){if(V(rA),R(Q),Q.onRuntimeInitialized&&Q.onRuntimeInitialized(),Q.postRun)for(typeof Q.postRun=="function"&&(Q.postRun=[Q.postRun]);Q.postRun.length;){var I=Q.postRun.shift();tA.unshift(I)}V(tA)}}if(!(0iI({noInitialRun:!0,wasmBinary:rI}),tI=class UA{static codecId="lz4";static DEFAULT_ACCELERATION=IA;static max_buffer_size=v;max_buffer_size=v;acceleration;constructor(Q=IA){if(!Number.isInteger(Q))throw Error(`Invalid acceleration "${Q}". Must be a positive integer.`);this.acceleration=Q<=0?IA:Q}static fromConfig({acceleration:Q}){return new UA(Q)}async encode(Q){if(M||(M=JA()),Q.length>v)throw Error(`Codec does not support buffers of > ${v} bytes.`);const R=await M,d=R.compress(Q,this.acceleration),W=new Uint8Array(d);return R.free_result(),W}async decode(Q,R){if(M||(M=JA()),Q.length>v)throw Error(`Codec does not support buffers of > ${v} bytes.`);const d=await M,W=d.decompress(Q),p=new Uint8Array(W);return d.free_result(),R!==void 0?(R.set(p),R):p}},oI=tI;export{oI as default};