@pixagram/lacerta-db 0.13.4 → 0.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (e=>{var t={};function i(s){var r;return(t[s]||(r=t[s]={i:s,l:!1,exports:{}},e[s].call(r.exports,r,r.exports,i),r.l=!0,r)).exports}i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(s,r,function(t){return e[t]}.bind(null,r));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=2)})([function(e,t){var i={},s=new Float32Array(4);function r(e,t){if((0|e)!==e)throw new TypeError("Lane index must be an int32");if(e<0||t<=e)throw new RangeError("Lane index must be in bounds")}new Int32Array(s.buffer),new Int16Array(s.buffer),new Int8Array(s.buffer),new Uint32Array(s.buffer),new Uint16Array(s.buffer),new Uint8Array(s.buffer),void 0!==i.Int8x16&&void 0!==i.Int8x16.extractLane||(i.Int8x16=function(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m){if(!(this instanceof i.Int8x16))return new i.Int8x16(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m);this.s_=new Int8Array([e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m])},i.Int8x16.check=function(e){if(e instanceof i.Int8x16)return e;throw new TypeError("Argument is not a Int8x16.")},i.Int8x16.splat=function(e){return new i.Int8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Int8x16.extractLane=function(e,t){return e=i.Int8x16.check(e),r(t,16),e.s_[t]},i.Int8x16.replaceLane=function(e,t,s){return e=i.Int8x16.check(e),r(t,16),(e=Array.from(e.s_))[t]=s,new i.Int8x16(...e)},i.Int8x16.shuffle=function(e,t,s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g){var v=[s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g],b=[];e=i.Int8x16.check(e),t=i.Int8x16.check(t);for(var A=0;A<16;A++){var S=v[A];r(S,32),b[A]=S<16?e.s_[S]:t.s_[S-16]}return new i.Int8x16(...b)}),void 0!==i.Uint8x16&&void 0!==i.Uint8x16.extractLane||(i.Uint8x16=function(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m){if(!(this instanceof i.Uint8x16))return new i.Uint8x16(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m);this.s_=new Uint8Array([e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m])},i.Uint8x16.check=function(e){if(e instanceof i.Uint8x16)return e;throw new TypeError("Argument is not a Uint8x16.")},i.Uint8x16.splat=function(e){return new i.Uint8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Uint8x16.extractLane=function(e,t){return e=i.Uint8x16.check(e),r(t,16),e.s_[t]},i.Uint8x16.load=function(e,t){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return new i.Uint8x16(...e.subarray(t,t+16))},i.Uint8x16.store=function(e,t,i){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return e.set(i.s_,t),i},i.Uint8x16.shuffle=function(e,t,s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g){var v=[s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g],b=[];e=i.Uint8x16.check(e),t=i.Uint8x16.check(t);for(var A=0;A<16;A++){var S=v[A];r(S,32),b[A]=S<16?e.s_[S]:t.s_[S-16]}return new i.Uint8x16(...b)},i.Uint8x16.and=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]&t.s_[r];return new i.Uint8x16(...s)},i.Uint8x16.or=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]|t.s_[r];return new i.Uint8x16(...s)},i.Uint8x16.shiftLeftByScalar=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]<<t;return new i.Uint8x16(...s)},i.Uint8x16.shiftRightByScalar=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]>>>t;return new i.Uint8x16(...s)}),e.exports=class{constructor(){this.ENC_SHUFFLE=i.Int8x16(10,11,9,10,7,8,6,7,4,5,3,4,1,2,0,1),this.ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.ENC_LUT_SIMD=[i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0)];for(let t=0;t<4;t++){var e=this.ENC_LUT.substring(16*t,16*(t+1));this.ENC_LUT_SIMD[t]=i.Uint8x16(...Array.from(e).map(e=>e.charCodeAt(0)))}this.DEC_DELTA_ASSO=i.Uint8x16(1,1,1,1,1,1,1,1,0,0,0,0,0,15,0,15),this.DEC_DELTA_VALUES=i.Int8x16(0,0,0,19,4,191,191,185,185,0,16,195,191,191,185,185),this.DEC_SHUFFLE=i.Int8x16(-1,-1,-1,-1,12,13,14,8,9,10,4,5,6,0,1,2),this.SCALAR_ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.SCALAR_DEC_LUT={};for(let e=0;e<this.SCALAR_ENC_LUT.length;e++)this.SCALAR_DEC_LUT[this.SCALAR_ENC_LUT.charAt(e)]=e;this.SCALAR_DEC_LUT["="]=0}_scalar_encode(e){let t="";for(let a=0;a<e.length;a+=3){var i=e[a],s=a+1<e.length?e[a+1]:0,r=a+2<e.length?e[a+2]:0;t+=this.SCALAR_ENC_LUT[i>>2]+this.SCALAR_ENC_LUT[(3&i)<<4|s>>4],a+1<e.length?t+=this.SCALAR_ENC_LUT[(15&s)<<2|r>>6]:t+="=",a+2<e.length?t+=this.SCALAR_ENC_LUT[63&r]:t+="="}return t}encode(e){var t=e.length,i=4*Math.ceil(t/3),s=new Uint8Array(i);let r=0,a=0;for(;r+12<=t;){var n=e.subarray(r,r+12),o=new Uint8Array(16);o[0]=n[0]>>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],o[4]=n[3]>>2,o[5]=(3&n[3])<<4|n[4]>>4,o[6]=(15&n[4])<<2|n[5]>>6,o[7]=63&n[5],o[8]=n[6]>>2,o[9]=(3&n[6])<<4|n[7]>>4,o[10]=(15&n[7])<<2|n[8]>>6,o[11]=63&n[8],o[12]=n[9]>>2,o[13]=(3&n[9])<<4|n[10]>>4,o[14]=(15&n[10])<<2|n[11]>>6,o[15]=63&n[11];for(let e=0;e<16;e++)s[a+e]=this.SCALAR_ENC_LUT.charCodeAt(o[e]);r+=12,a+=16}let h=(new TextDecoder).decode(s.subarray(0,a));return r<t&&(h+=this._scalar_encode(e.subarray(r))),h}_scalar_decode(e){e=e.replace(/=+$/,"");var t=Math.floor(3*e.length/4),i=new Uint8Array(t);let s=0;for(let h=0;h<e.length;h+=4){var r=this.SCALAR_DEC_LUT[e[h]],a=this.SCALAR_DEC_LUT[e[h+1]],n=h+2<e.length?this.SCALAR_DEC_LUT[e[h+2]]:0,o=h+3<e.length?this.SCALAR_DEC_LUT[e[h+3]]:0;i[s++]=r<<2|a>>4,s<t&&(i[s++]=(15&a)<<4|n>>2),s<t&&(i[s++]=(3&n)<<6|o)}return i}decode(e){var t=e.length;if(t%4!=0)throw new Error("Invalid Base64 string length.");var i=(e.match(/=/g)||[]).length,s=new Uint8Array(3*t/4-i);let r=0,a=0;for(var n;r+16<=t-i;){var o=Array.from(e.substring(r,r+16)).map(e=>this.SCALAR_DEC_LUT[e]),h=new Uint8Array(12);h[0]=o[0]<<2|o[1]>>4,h[1]=(15&o[1])<<4|o[2]>>2,h[2]=(3&o[2])<<6|o[3],h[3]=o[4]<<2|o[5]>>4,h[4]=(15&o[5])<<4|o[6]>>2,h[5]=(3&o[6])<<6|o[7],h[6]=o[8]<<2|o[9]>>4,h[7]=(15&o[9])<<4|o[10]>>2,h[8]=(3&o[10])<<6|o[11],h[9]=o[12]<<2|o[13]>>4,h[10]=(15&o[13])<<4|o[14]>>2,h[11]=(3&o[14])<<6|o[15],s.set(h,a),r+=16,a+=12}return r<t&&(n=this._scalar_decode(e.substring(r)),s.set(n,a)),s}}},function(e,t,i){i.r(t);let s=new Array(128);for(let e=0;e<128;e++){var r=[];for(let t=0;t<e;t++)r.push(`b[o+${t}]`);s[e]=new Function("b","o",`return String.fromCharCode(${r.join(",")});`)}let a=new Float32Array(1),n=new Uint8Array(64),o=new Int8Array(256).fill(-1);var h,l,c,d;for(let e=0;e<64;e++){var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(e);n[e]=_,o[_]=e}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;let u=new Map,f=new Map;for(h of["asyncIterator","hasInstance","isConcatSpreadable","iterator","match","matchAll","replace","search","species","split","toPrimitive","toStringTag","unscopables"]){var p=Symbol[h];p&&(u.set(p,h),f.set(h,p))}let m=1,y=16,w=17,g=18,v=19,b=20,A=21,S=22,x=23,I=24,z=25,k=26,D=32,C=33,M=34,E=35,T=48,B=49,V=50,U=51,L=52,F=53,P=54,O=55,K=56,N=64,$=65,j=66,R=67,q=68,H=69,G=70,W=71,X=80,Q=81,Y=82,J=83,Z=84,ee=85,te=105,ie=106,se=112,re=113,ae=114,ne=128,oe=129,he=144,le=145,ce=160,de=161,_e=162,ue=163,fe=164,pe=165,me=166,ye=167,we=168,ge=176,ve=192,be=193,Ae=208,Se=209,xe=224,Ie=225,ze=226,ke=227,De=240,Ce=[],Me=[];for([l,c,d]of[[96,1,"Uint8Array"],[97,1,"Int8Array"],[98,1,"Uint8ClampedArray"],[99,2,"Uint16Array"],[100,2,"Int16Array"],[101,4,"Uint32Array"],[102,4,"Int32Array"],[103,4,"Float32Array"],[104,8,"Float64Array"],[105,8,"BigInt64Array"],[106,8,"BigUint64Array"],[107,1,"DataView"],[67,1,null],[68,2,null],[69,4,null],[70,4,null],[71,8,null]])Ce[l]=c,d&&globalThis[d]&&(Me[l]=globalThis[d]);let Ee=new Map;var Te,Be,Ve=["Uint8Array","Int8Array","Uint8ClampedArray","Uint16Array","Int16Array","Uint32Array","Int32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","DataView"];for([Te,Be]of[[Date,he],[RegExp,ge],[Map,ne],[Set,oe],[ArrayBuffer,se]])Ee.set(Te,Be);for(let e=0;e<Ve.length;e++){var Ue=globalThis[Ve[e]];Ue&&Ee.set(Ue,96+e)}globalThis.SharedArrayBuffer&&Ee.set(SharedArrayBuffer,ae);let Le={[ce]:Error,[de]:EvalError,[_e]:RangeError,[ue]:ReferenceError,[fe]:SyntaxError,[pe]:TypeError,[me]:URIError},Fe=new Map([["Error",ce],["EvalError",de],["RangeError",_e],["ReferenceError",ue],["SyntaxError",fe],["TypeError",pe],["URIError",me],["AggregateError",ye]]),Pe=1413632566,Oe=Symbol.for("__TurboSerial_Ctor");var Ke=class{constructor(e={}){this.options={compression:e.compression||!1,deduplication:!1!==e.deduplication,shareArrayBuffers:!1!==e.shareArrayBuffers,simdOptimization:!1!==e.simdOptimization,detectCircular:!1!==e.detectCircular,allowFunction:e.allowFunction||!1,serializeFunctions:e.serializeFunctions||!1,preservePropertyDescriptors:!1!==e.preservePropertyDescriptors,assumePlainObjects:e.assumePlainObjects||!1,sortKeys:e.sortKeys||!1,memoryPoolSize:e.memoryPoolSize||65536,...e},this.options.allowFunction||(this.options.serializeFunctions=!1),e=this.options,this._dedup=e.deduplication,this._detectCircular=e.detectCircular,this._shareBufs=e.shareArrayBuffers,this._allowFn=e.allowFunction,this._serializeFn=e.serializeFunctions,this._preserveDescs=e.preservePropertyDescriptors,this._assumePlain=e.assumePlainObjects,this._sortKeys=e.sortKeys,this._simd=e.simdOptimization,e=Math.max(this.options.memoryPoolSize,65536),this.buf=new Uint8Array(e),this.dv=new DataView(this.buf.buffer),this.f64=new Float64Array(this.buf.buffer),this.f32=new Float32Array(this.buf.buffer),this.i32=new Int32Array(this.buf.buffer),this.i16=new Int16Array(this.buf.buffer),this.pos=0,this.enc=new TextEncoder,this.dec=new TextDecoder,this.refs=new Map,this.ancestors=new WeakSet,this.strings=new Map,this.buffers=new Map,this.deserializeRefs=null,this.deserializeStrings=null,this.deserializeBuffers=null,this.buffer=null,this.view=null}_grow(e){var t=this.pos+e;if(!(t<=this.buf.length)){let i=this.buf.length;for(;i<t;)i<<=1;(e=new Uint8Array(i)).set(this.buf.subarray(0,this.pos)),this.buf=e,this.dv=new DataView(e.buffer),this.f64=new Float64Array(e.buffer),this.f32=new Float32Array(e.buffer),this.i32=new Int32Array(e.buffer),this.i16=new Int16Array(e.buffer)}}_writeAll(e){this.resetState(),this._grow(17),this.dv.setUint32(0,Pe,!0),this.buf[4]=7,this.pos=17,this.writeValue(e),this.dv.setUint32(5,this.refs.size,!0),this.dv.setUint32(9,this.strings.size,!0),this.dv.setUint32(13,this.buffers.size,!0)}serialize(e){return this._writeAll(e),this.buf.slice(0,this.pos)}serializeView(e){return this._writeAll(e),this.buf.subarray(0,this.pos)}deserialize(e){if(this.buffer=e.constructor===Uint8Array?e:new Uint8Array(e),this.view=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.pos=0,this.view.getUint32(0,!0)!==Pe)throw new Error("Invalid TurboSerial data");if(7===(e=this.buffer[4])){var t=this.view.getUint32(5,!0),i=this.view.getUint32(9,!0),s=this.view.getUint32(13,!0);this.deserializeRefs=new Array(t),this.deserializeStrings=new Array(i),this.deserializeBuffers=new Array(s),this._drIdx=0,this._dsIdx=0,this._dbIdx=0,this.pos=17}else{if(6!==e)throw new Error("Unsupported version: "+e);this.deserializeRefs=[],this.deserializeStrings=[],this.deserializeBuffers=[],this._drIdx=-1,this.pos=5}return this.readValue()}resetState(){this.pos=0,this.refs.clear(),this.ancestors=new WeakSet,this.strings.clear(),this.buffers.clear()}resetMemory(e={}){return e=e.shrink?Math.max(this.options.memoryPoolSize||65536,256):this.buf.length,this.buf=new Uint8Array(e),this.dv=new DataView(this.buf.buffer),this.f64=new Float64Array(this.buf.buffer),this.f32=new Float32Array(this.buf.buffer),this.i32=new Int32Array(this.buf.buffer),this.i16=new Int16Array(this.buf.buffer),this.pos=0,this.refs.clear(),this.ancestors=new WeakSet,this.strings.clear(),this.buffers.clear(),this.deserializeRefs&&(this.deserializeRefs.length=0,this.deserializeRefs=null),this.deserializeStrings&&(this.deserializeStrings.length=0,this.deserializeStrings=null),this.deserializeBuffers&&(this.deserializeBuffers.length=0,this.deserializeBuffers=null),this}_wV(e){var t=this.buf;let i=this.pos;if((e>>>=0)<128)t[i]=e,this.pos=i+1;else if(e<16384)t[i]=127&e|128,t[i+1]=e>>>7,this.pos=i+2;else{for(;128<=e;)t[i++]=127&e|128,e>>>=7;t[i++]=e,this.pos=i}}writeValue(e){if(null===e)this._grow(1),this.buf[this.pos++]=0;else if(void 0===e)this._grow(1),this.buf[this.pos++]=1;else{var t=typeof e;if("boolean"==t)this._grow(1),this.buf[this.pos++]=e?3:2;else if("number"==t)this._wNum(e);else if("string"==t)this._wStrDedup(e);else if("bigint"==t)this._wBigInt(e);else if("symbol"==t)this._grow(2),void 0!==(i=Symbol.keyFor(e))?(this.buf[this.pos++]=Ie,this.writeValue(i)):u.has(e)?(this.buf[this.pos++]=ze,this.writeValue(u.get(e))):void 0===e.description?this.buf[this.pos++]=ke:(this.buf[this.pos++]=xe,this.writeValue(e.description));else if("function"==t)this._grow(1),this.buf[this.pos++]=this._allowFn?De:m;else{var i=this.refs.get(e);if(void 0!==i)this._grow(6),this._detectCircular&&this.ancestors.has(e)?this.buf[this.pos++]=Se:this.buf[this.pos++]=Ae,this._wV(i);else{if((this._dedup||this._detectCircular)&&this.refs.set(e,this.refs.size),this._shareBufs&&e.constructor===ArrayBuffer){if(void 0!==(t=this.buffers.get(e)))return this._grow(6),this.buf[this.pos++]=re,void this._wV(t);this.buffers.set(e,this.buffers.size)}this._detectCircular&&this.ancestors.add(e),this._wObj(e),this._detectCircular&&this.ancestors.delete(e)}}}}_wStrDedup(e){if(this._dedup&&3<e.length){var t=this.strings.get(e);if(void 0!==t)return this._grow(6),this.buf[this.pos++]=O,void this._wV(t);this.strings.set(e,this.strings.size)}this._wStr(e)}_wNum(e){this._grow(10);var t,i=this.pos;e!=e?(this.buf[i]=S,this.pos=i+1):e===1/0?(this.buf[i]=x,this.pos=i+1):e===-1/0?(this.buf[i]=I,this.pos=i+1):0===e&&1/e<0?(this.buf[i]=z,this.pos=i+1):e===(t=0|e)?-128<=t&&t<=127?(this.buf[i]=y,this.buf[i+1]=255&t,this.pos=i+2):-32768<=t&&t<=32767?(this.buf[i]=w,this.dv.setInt16(i+1,t,!0),this.pos=i+3):(this.buf[i]=g,this.dv.setInt32(i+1,t,!0),this.pos=i+5):e===(t=e>>>0)?(this.buf[i]=v,this.dv.setUint32(i+1,t,!0),this.pos=i+5):(a[0]=e,a[0]===e?(this.buf[i]=b,this.dv.setFloat32(i+1,e,!0),this.pos=i+5):(this.buf[i]=A,this.dv.setFloat64(i+1,e,!0),this.pos=i+9))}_wBigInt(e){this._grow(10);var t=e<0n,i=t?-e:e;if(i<=0x7fffffffffffffffn)this.buf[this.pos++]=t?C:D,this.dv.setBigInt64(this.pos,e,!0),this.pos+=8;else{this.buf[this.pos++]=t?E:M;let e=i,s=0,r=i;for(;0n<r;)s++,r>>=8n;this._grow(s+5),this._wV(s);for(let t=0;t<s;t++)this.buf[this.pos++]=Number(0xffn&e),e>>=8n}}_wStr(e){var t=e.length;if(0===t)this._grow(1),this.buf[this.pos++]=T;else{if(64<t&&100===e.charCodeAt(0)&&97===e.charCodeAt(1)&&116===e.charCodeAt(2)&&97===e.charCodeAt(3)&&58===e.charCodeAt(4))if(5<(i=e.indexOf(";base64,",5))){var i,s=i=i+8;if(32<=t-i){var r=((e,t,i)=>{var s=i-t;if(0==s||0!=(3&s))return-1;let r=s;61===e.charCodeAt(i-1)&&(r--,61===e.charCodeAt(i-2))&&r--;for(let i=t;i<t+r;i++)if(o[e.charCodeAt(i)]<0)return-1;return(3*(r+(i=s-r))>>2)-i})(e,i,t);if(0<r){this._grow(6+s+5+r),this.buf[this.pos++]=K,this._wV(s);var a=this.pos;for(let t=0;t<s;t++)this.buf[a+t]=e.charCodeAt(t);return this.pos=a+s,this._wV(r),r=((e,t,i,s,r)=>{var a=o,n=i-t;let h=n,l=(61===e.charCodeAt(i-1)&&(h--,61===e.charCodeAt(i-2))&&h--,i=n-h,r),c=t;for(var d=t+(0<i?h-4:h);c<d;c+=4){var _=a[e.charCodeAt(c)]<<18|a[e.charCodeAt(c+1)]<<12|a[e.charCodeAt(c+2)]<<6|a[e.charCodeAt(c+3)];s[l++]=_>>16&255,s[l++]=_>>8&255,s[l++]=255&_}return 2==i?(n=a[e.charCodeAt(c)]<<2|a[e.charCodeAt(c+1)]>>4,s[l++]=255&n):1==i&&(t=a[e.charCodeAt(c)]<<10|a[e.charCodeAt(c+1)]<<4|a[e.charCodeAt(c+2)]>>2,s[l++]=t>>8&255,s[l++]=255&t),l-r})(e,i,t,this.buf,this.pos),void(this.pos+=r)}}}if(t<128){let i=1;for(let s=0;s<t;s++)if(127<e.charCodeAt(s)){i=0;break}if(i){this._grow(t+2);var n=this.pos;this.buf[n++]=t<16?B:V,this.buf[n++]=t;for(let i=0;i<t;i++)this.buf[n+i]=e.charCodeAt(i);return void(this.pos=n+t)}let s=3*t,r=(this._grow(7+s),this.pos+2),a=this.enc.encodeInto(e,this.buf.subarray(r,r+s)).written,o=this.pos;this.buf[o++]=a<16?L:a<256?F:P,a<256?(this.buf[o++]=a,this.pos=r+a):(this.pos=o,this._wV(a),o=this.pos,this.buf.copyWithin(o,r,r+a),this.pos=o+a)}else{let i=3*t;this._grow(i+7);let s=this.pos+6,r=this.enc.encodeInto(e,this.buf.subarray(s,s+i)).written,a=this.pos;r===t?(this.buf[a++]=t<256?V:U,t<256?this.buf[a++]=t:(this.pos=a,this._wV(t),a=this.pos)):(this.buf[a++]=r<256?F:P,r<256?this.buf[a++]=r:(this.pos=a,this._wV(r),a=this.pos)),a!==s&&this.buf.copyWithin(a,s,s+r),this.pos=a+r}}}_wObj(e){if(Array.isArray(e))this._wArr(e);else{var t=e.constructor;if(t===Object)return this._allowFn||this._preserveDescs&&!this._assumePlain?void this._wPlainObj(e):void this._wFastPlainObj(e);if(void 0!==(t=Ee.get(t))){if(t===he)return this._grow(9),void((a=e.getTime())!=a?this.buf[this.pos++]=le:(this.buf[this.pos++]=he,this.dv.setFloat64(this.pos,a,!0),this.pos+=8));if(t===ge)return this._grow(1),this.buf[this.pos++]=ge,this.writeValue(e.source),void this.writeValue(e.flags);if(t===ne){for(var[i,s]of(this._grow(6),this.buf[this.pos++]=ne,this._wV(e.size),e))this.writeValue(i),this.writeValue(s);return}if(t===oe){for(var r of(this._grow(6),this.buf[this.pos++]=oe,this._wV(e.size),e))this.writeValue(r);return}if(t===se||t===ae)return this._grow(6),this.buf[this.pos++]=t,a=new Uint8Array(e),this._wV(a.length),this._grow(a.length),this.buf.set(a,this.pos),void(this.pos+=a.length);if(96==(240&t))return void this._wTypedArr(e,t)}if(e.constructor===Error||e.constructor&&Fe.has(e.constructor.name)){this._grow(2);var a=Fe.get(e.constructor.name)||we;if(this.buf[this.pos++]=a,this.writeValue(e.message||""),this.writeValue(e.stack||""),a===ye&&e.errors)for(var n of(this._wV(e.errors.length),e.errors))this.writeValue(n)}else"undefined"==typeof Blob||e.constructor!==Blob&&e.constructor!==("undefined"!=typeof File?File:null)?this._wPlainObj(e):(this._grow(12),this.buf[this.pos++]="undefined"!=typeof File&&e.constructor===File?be:ve,this._wV(0),this._wV(0))}}_wArr(e){var t=e.length;if(0===t)this._grow(1),this.buf[this.pos++]=N;else if(Object.keys(e).length!==t){this._grow(12),this.buf[this.pos++]=j,this._wV(t);var i,s=[];for(let i=0;i<t;i++)i in e&&s.push(i);for(i of(this._wV(s.length),s))this._wV(i),this.writeValue(e[i])}else if(!(this._simd&&8<=t&&"number"==typeof e[0]&&this._wPackedArr(e,t))){this._grow(6),this.buf[this.pos++]=$,this._wV(t);for(let i=0;i<t;i++)this.writeValue(e[i])}}_wPackedArr(e,t){let i,s=1,r=e[0],n=e[0],o=1;for(let i=0;i<t;i++){var h=e[i];if("number"!=typeof h)return!1;h!==(0|h)&&(s=0),h<r&&(r=h),h>n&&(n=h),o&&(a[0]=h,a[0]!==h)&&(o=0)}i=s?(l=Math.max(Math.abs(r),Math.abs(n)))<=127?R:l<=32767?q:H:o?G:W;var l=Ce[i]||1;this._grow(6+t*l),this.buf[this.pos++]=i,this._wV(t);let c=this.pos;switch(i){case R:for(let i=0;i<t;i++)this.buf[c++]=255&e[i];break;case q:for(let i=0;i<t;i++)this.dv.setInt16(c,e[i],!0),c+=2;break;case H:for(let i=0;i<t;i++)this.dv.setInt32(c,e[i],!0),c+=4;break;case G:for(let i=0;i<t;i++)this.dv.setFloat32(c,e[i],!0),c+=4;break;case W:for(let i=0;i<t;i++)this.dv.setFloat64(c,e[i],!0),c+=8}return this.pos=c,!0}_wTypedArr(e,t){this._grow(12),this.buf[this.pos++]=t;var i=e.buffer;if(this._shareBufs){var s=this.buffers.get(i);if(void 0!==s)return this.buf[this.pos++]=1,this._wV(s),this._wV(e.byteOffset),void this._wV(e.length);this.buffers.set(i,this.buffers.size)}if(this.buf[this.pos++]=0,this._wV(e.byteOffset),this._wV(e.length),s=Ce[t]||1,t===te||t===ie){this._grow(8*e.length);for(let t=0;t<e.length;t++)this.dv.setBigInt64(this.pos,e[t],!0),this.pos+=8}else t=e.length*s,this._grow(t),s=new Uint8Array(i,e.byteOffset,t),this.buf.set(s,this.pos),this.pos+=t}_wPlainObj(e){var t=Object.getPrototypeOf(e),i=(t=e.constructor===Object||t===Object.prototype||null===t,Object.keys(e));if(0===i.length&&t)this._grow(1),this.buf[this.pos++]=X;else if(t){if(this._preserveDescs){var s;t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];let i=!1;for(s of t){var r=Object.getOwnPropertyDescriptor(e,s);if(r.get||r.set||!r.enumerable||!r.writable||!r.configurable){i=!0;break}}if(i)return void this._wDescriptorObj(e,t)}let n=!1;if(this._allowFn)for(let t=0;t<i.length;t++)if("function"==typeof e[i[t]]){n=!0;break}if(n)this._wMethodObj(e,i);else{this._grow(6),this.buf[this.pos++]=Y,this._sortKeys&&i.sort();let t=i.length;if(!this._serializeFn)for(let s=t=0;s<i.length;s++)"function"!=typeof e[i[s]]&&t++;this._wV(t);for(let t=0;t<i.length;t++){var a=e[i[t]];!this._serializeFn&&"function"==typeof a||(this.writeValue(i[t]),this.writeValue(a))}}}else this._wConstructorObj(e,i)}_wFastPlainObj(e){var t=Object.keys(e),i=t.length;if(0===i)this._grow(1),this.buf[this.pos++]=X;else{this._grow(6),this.buf[this.pos++]=Y,this._sortKeys&&t.sort(),this._wV(i);for(let r=0;r<i;r++){var s=t[r];this.writeValue(s),this.writeValue(e[s])}}}_wDescriptorObj(e,t){this._grow(6),this.buf[this.pos++]=Z;let i=this._serializeFn;var s;t=t.filter(t=>{try{var s=Object.getOwnPropertyDescriptor(e,t);return s&&(i||!s.get&&!s.set&&"function"!=typeof s.value)}catch(t){return!1}});for(s of(this._wV(t.length),t)){this.writeValue(s);var r=Object.getOwnPropertyDescriptor(e,s);let t=0;r.enumerable&&(t|=1),r.writable&&(t|=2),r.configurable&&(t|=4),r.get&&(t|=8),r.set&&(t|=16),this._grow(1),this.buf[this.pos++]=t,r.get||r.set?(r.get&&this.writeValue(r.get),r.set&&this.writeValue(r.set)):this.writeValue(r.value)}}_wMethodObj(e,t){this._grow(6),this.buf[this.pos++]=ee;var i,s=[];for(i of t)try{var r=e[i];s.push([i,r,"function"==typeof r])}catch(e){}this._wV(s.length);var a,n,o,h=this._serializeFn;for([a,n,o]of s)this.writeValue(a),this._grow(1),this.buf[this.pos++]=o?1:0,o&&h?(this.writeValue(n.toString()),this.writeValue(n.name||"")):o?(this._grow(1),this.buf[this.pos++]=De):this.writeValue(n)}_wConstructorObj(e,t){this._grow(6),this.buf[this.pos++]=J,this.writeValue((null==(s=e.constructor)?void 0:s.name)||"");var i,s=this._serializeFn?t:t.filter(t=>{try{return"function"!=typeof e[t]}catch(t){return!1}});for(i of(this._wV(s.length),s))this.writeValue(i),this.writeValue(e[i])}_pushRef(e){0<=this._drIdx?this.deserializeRefs[this._drIdx++]=e:this.deserializeRefs.push(e)}_pushStr(e){0<=this._dsIdx?this.deserializeStrings[this._dsIdx++]=e:this.deserializeStrings.push(e)}_pushBuf(e){0<=this._dbIdx?this.deserializeBuffers[this._dbIdx++]=e:this.deserializeBuffers.push(e)}readValue(){var e=this.buffer[this.pos++];if(e===Ae||e===Se)return this.deserializeRefs[this._rV()];if(e===O)return this.deserializeStrings[this._rV()];if(e===re)return this.deserializeBuffers[this._rV()];var t,i=240&e;if(0==i)return 0===e?null:1===e?void 0:3===e;if(16==i)return this._rNum(e);if(32==i)return this._rBigInt(e);if(48==i)return this._rStr(e);if(64==i||80==i||128==i){let t;return t=64==i?[]:128==i?new(e===ne?Map:Set):{},this._pushRef(t),this._rFill(t,e,i),t}if(96==i)return t=this._rTypedArr(e),this._pushRef(t),t;if(112==i)return t=this._rArrayBuf(e),this._pushBuf(t),t;if(144==i)return e===le?new Date(NaN):(t=this.view.getFloat64(this.pos,!0),this.pos+=8,new Date(t));if(160==i)return this._rError(e);if(176==i)return new RegExp(this.readValue(),this.readValue());if(192==i)return this._rV(),this._rV(),{_type:"Binary"};if(224==i)return this._rSpecial(e);if(240==i)return this._allowFn?function(){throw new Error("Function not serialized")}:void 0;throw new Error("Unknown type: 0x"+e.toString(16))}_rV(){let e=this.pos,t=this.buffer[e++];if(!(128&t))return this.pos=e,t;let i=127&t,s=7;for(;t=this.buffer[e++],i|=(127&t)<<s,s+=7,128&t;);return this.pos=e,i>>>0}_rFill(e,t,i){if(64===i){if(t!==N)if(t===$){var s=this._rV();for(let t=0;t<s;t++)e[t]=this.readValue()}else if(t===j){e.length=this._rV();var r=this._rV();for(let t=0;t<r;t++)e[this._rV()]=this.readValue()}else{var a=this._rPacked(t);for(let t=0;t<a.length;t++)e.push(a[t])}}else if(80===i)this.fillObject(e,t);else if(128===i){var n=this._rV();if(t===ne)for(let t=0;t<n;t++)e.set(this.readValue(),this.readValue());else for(let t=0;t<n;t++)e.add(this.readValue())}}fillObject(e,t){t!==X&&(t===Y||t===Q?this._fillLiteralObj(e):t===Z?this._fillDescriptorObj(e):t===ee?this._fillMethodObj(e):t===J&&this._fillConstructorObj(e))}_fillLiteralObj(e){var t=this._rV();for(let i=0;i<t;i++)e[this.readValue()]=this.readValue()}_fillDescriptorObj(e){var t=this._rV();for(let a=0;a<t;a++){var i=this.readValue(),s=this.buffer[this.pos++],r={enumerable:!!(1&s),writable:!!(2&s),configurable:!!(4&s)};8&s||16&s?(8&s&&(r.get=this.readValue()),16&s&&(r.set=this.readValue())):r.value=this.readValue(),Object.defineProperty(e,i,r)}}_fillMethodObj(e){var t=this._rV();for(let r=0;r<t;r++){var i=this.readValue();if(this.buffer[this.pos++])if(this._allowFn&&this._serializeFn){var s=this.readValue();this.readValue();try{e[i]=new Function("return "+s)()}catch(t){e[i]=void 0}}else this._serializeFn?(this.readValue(),this.readValue(),e[i]=void 0):(this.pos++,e[i]=this._allowFn?function(){throw new Error("Not serialized")}:void 0);else e[i]=this.readValue()}}_fillConstructorObj(e){var t=this.readValue(),i=this._rV();for(let t=0;t<i;t++)e[this.readValue()]=this.readValue();e[Oe]=t}_rNum(e){let t,i=this.pos;switch(e){case y:return t=this.buffer[i]<<24>>24,this.pos=i+1,t;case w:return t=this.view.getInt16(i,!0),this.pos=i+2,t;case g:return t=this.view.getInt32(i,!0),this.pos=i+4,t;case v:return t=this.view.getUint32(i,!0),this.pos=i+4,t;case b:return t=this.view.getFloat32(i,!0),this.pos=i+4,t;case A:return t=this.view.getFloat64(i,!0),this.pos=i+8,t;case S:return NaN;case x:return 1/0;case I:return-1/0;case z:return-0;case k:return t=this._rV(),this.buffer[this.pos++]?-t:t}}_rBigInt(e){if(e===D||e===C){let e=this.view.getBigInt64(this.pos,!0);return this.pos+=8,e}e=e===E;var t=this._rV();let i="";for(let e=t-1;0<=e;e--)i+=this.buffer[this.pos+e].toString(16).padStart(2,"0");this.pos+=t;let s=BigInt("0x"+(i||"0"));return e?-s:s}_rStr(e){if(e===T)return"";var t=this.buffer;if(e===K){let e;e=(i=this._rV())<128?s[i](t,this.pos):this.dec.decode(t.subarray(this.pos,this.pos+i)),this.pos+=i;var i=this._rV(),r=((e,t,i)=>{var s=n,r=i%3,a=i-r,o=4*((i+2)/3|0),h=new Uint8Array(o);let l=0;var c=t+a;for(let i=t;i<c;i+=3){var d=e[i]<<16&16711680|e[i+1]<<8&65280|255&e[i+2];h[l++]=s[d>>18&63],h[l++]=s[d>>12&63],h[l++]=s[d>>6&63],h[l++]=s[63&d]}1==r?(a=e[t+i-1],h[l++]=s[a>>2],h[l++]=s[a<<4&63],h[l++]=61,h[l++]=61):2==r&&(a=e[t+i-2]<<8|e[t+i-1],h[l++]=s[a>>10],h[l++]=s[a>>4&63],h[l++]=s[a<<2&63],h[l++]=61);let _="";for(let e=0;e<o;e+=8192)_+=String.fromCharCode.apply(null,h.subarray(e,Math.min(e+8192,o)));return _})(t,this.pos,i);this.pos+=i;let a=e+r;return 3<a.length&&this._pushStr(a),a}let a,o;return a=e===B||e===V||e===L||e===F?this.buffer[this.pos++]:this._rV(),o=(i=e===B||e===V||e===U)&&a<128?s[a](t,this.pos):this.dec.decode(t.subarray(this.pos,this.pos+a)),this.pos+=a,3<o.length&&this._pushStr(o),o}_rPacked(e){var t=this._rV(),i=new Array(t);let s=this.pos;switch(e){case R:for(let e=0;e<t;e++)i[e]=this.buffer[s++]<<24>>24;break;case q:for(let e=0;e<t;e++)i[e]=this.view.getInt16(s,!0),s+=2;break;case H:for(let e=0;e<t;e++)i[e]=this.view.getInt32(s,!0),s+=4;break;case G:for(let e=0;e<t;e++)i[e]=this.view.getFloat32(s,!0),s+=4;break;case W:for(let e=0;e<t;e++)i[e]=this.view.getFloat64(s,!0),s+=8}return this.pos=s,i}_rTypedArr(e){if(this.buffer[this.pos++]){let t=this._rV(),i=this._rV(),s=this._rV();return new Me[e](this.deserializeBuffers[t],i,s)}this._rV();let t=this._rV(),i=Ce[e]||1;if(e===te||e===ie){var s=[];for(let e=0;e<t;e++)s.push(this.view.getBigInt64(this.pos,!0)),this.pos+=8;return new Me[e](s)}var r=t*i,a=new ArrayBuffer(r);return new Uint8Array(a).set(this.buffer.subarray(this.pos,this.pos+r)),this.pos+=r,this._pushBuf(a),new Me[e](a,0,t)}_rArrayBuf(e){var t=this._rV(),i=this.buffer.buffer.slice(this.buffer.byteOffset+this.pos,this.buffer.byteOffset+this.pos+t);return this.pos+=t,i}_rError(e){var t=this.readValue(),i=this.readValue();let s;if(e===ye){var r=this._rV(),a=[];for(let e=0;e<r;e++)a.push(this.readValue());s=new AggregateError(a,t)}else s=new(Le[e]||Error)(t);return i&&(s.stack=i),s}_rSpecial(e){if(e===xe)return Symbol(this.readValue());if(e===ke)return Symbol();if(e===Ie)return Symbol.for(this.readValue());if(e===ze)return f.get(this.readValue())||Symbol();throw new Error("Unknown special type: 0x"+e.toString(16))}},Ne=i(0),$e=i.n(Ne);i.d(t,"LacertaDB",(function(){return It})),i.d(t,"Database",(function(){return xt})),i.d(t,"Collection",(function(){return St})),i.d(t,"Document",(function(){return pt})),i.d(t,"MigrationManager",(function(){return bt})),i.d(t,"PerformanceMonitor",(function(){return At})),i.d(t,"LacertaDBError",(function(){return Ge})),i.d(t,"OPFSUtility",(function(){return ct})),i.d(t,"IndexManager",(function(){return lt})),i.d(t,"CacheStrategy",(function(){return Ye})),i.d(t,"LRUCache",(function(){return We})),i.d(t,"LFUCache",(function(){return Xe})),i.d(t,"TTLCache",(function(){return Qe})),i.d(t,"BTreeIndex",(function(){return at})),i.d(t,"TextIndex",(function(){return nt})),i.d(t,"GeoIndex",(function(){return ot})),i.d(t,"HashIndex",(function(){return ht})),i.d(t,"SecureDatabaseEncryption",(function(){return tt})),i.d(t,"QuickStore",(function(){return Re})),i.d(t,"AsyncMutex",(function(){return He})),i.d(t,"IndexedDBConnectionPool",(function(){return qe})),i.d(t,"BrowserCompressionUtility",(function(){return Je})),i.d(t,"BrowserEncryptionUtility",(function(){return et})),
1
+ (e=>{var t={};function i(s){var r;return(t[s]||(r=t[s]={i:s,l:!1,exports:{}},e[s].call(r.exports,r,r.exports,i),r.l=!0,r)).exports}i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(s,r,function(t){return e[t]}.bind(null,r));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=2)})([function(e,t){var i={},s=new Float32Array(4);function r(e,t){if((0|e)!==e)throw new TypeError("Lane index must be an int32");if(e<0||t<=e)throw new RangeError("Lane index must be in bounds")}new Int32Array(s.buffer),new Int16Array(s.buffer),new Int8Array(s.buffer),new Uint32Array(s.buffer),new Uint16Array(s.buffer),new Uint8Array(s.buffer),void 0!==i.Int8x16&&void 0!==i.Int8x16.extractLane||(i.Int8x16=function(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m){if(!(this instanceof i.Int8x16))return new i.Int8x16(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m);this.s_=new Int8Array([e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m])},i.Int8x16.check=function(e){if(e instanceof i.Int8x16)return e;throw new TypeError("Argument is not a Int8x16.")},i.Int8x16.splat=function(e){return new i.Int8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Int8x16.extractLane=function(e,t){return e=i.Int8x16.check(e),r(t,16),e.s_[t]},i.Int8x16.replaceLane=function(e,t,s){return e=i.Int8x16.check(e),r(t,16),(e=Array.from(e.s_))[t]=s,new i.Int8x16(...e)},i.Int8x16.shuffle=function(e,t,s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g){var v=[s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g],b=[];e=i.Int8x16.check(e),t=i.Int8x16.check(t);for(var A=0;A<16;A++){var S=v[A];r(S,32),b[A]=S<16?e.s_[S]:t.s_[S-16]}return new i.Int8x16(...b)}),void 0!==i.Uint8x16&&void 0!==i.Uint8x16.extractLane||(i.Uint8x16=function(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m){if(!(this instanceof i.Uint8x16))return new i.Uint8x16(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m);this.s_=new Uint8Array([e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m])},i.Uint8x16.check=function(e){if(e instanceof i.Uint8x16)return e;throw new TypeError("Argument is not a Uint8x16.")},i.Uint8x16.splat=function(e){return new i.Uint8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Uint8x16.extractLane=function(e,t){return e=i.Uint8x16.check(e),r(t,16),e.s_[t]},i.Uint8x16.load=function(e,t){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return new i.Uint8x16(...e.subarray(t,t+16))},i.Uint8x16.store=function(e,t,i){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return e.set(i.s_,t),i},i.Uint8x16.shuffle=function(e,t,s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g){var v=[s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g],b=[];e=i.Uint8x16.check(e),t=i.Uint8x16.check(t);for(var A=0;A<16;A++){var S=v[A];r(S,32),b[A]=S<16?e.s_[S]:t.s_[S-16]}return new i.Uint8x16(...b)},i.Uint8x16.and=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]&t.s_[r];return new i.Uint8x16(...s)},i.Uint8x16.or=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]|t.s_[r];return new i.Uint8x16(...s)},i.Uint8x16.shiftLeftByScalar=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]<<t;return new i.Uint8x16(...s)},i.Uint8x16.shiftRightByScalar=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]>>>t;return new i.Uint8x16(...s)}),e.exports=class{constructor(){this.ENC_SHUFFLE=i.Int8x16(10,11,9,10,7,8,6,7,4,5,3,4,1,2,0,1),this.ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.ENC_LUT_SIMD=[i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0)];for(let t=0;t<4;t++){var e=this.ENC_LUT.substring(16*t,16*(t+1));this.ENC_LUT_SIMD[t]=i.Uint8x16(...Array.from(e).map(e=>e.charCodeAt(0)))}this.DEC_DELTA_ASSO=i.Uint8x16(1,1,1,1,1,1,1,1,0,0,0,0,0,15,0,15),this.DEC_DELTA_VALUES=i.Int8x16(0,0,0,19,4,191,191,185,185,0,16,195,191,191,185,185),this.DEC_SHUFFLE=i.Int8x16(-1,-1,-1,-1,12,13,14,8,9,10,4,5,6,0,1,2),this.SCALAR_ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.SCALAR_DEC_LUT={};for(let e=0;e<this.SCALAR_ENC_LUT.length;e++)this.SCALAR_DEC_LUT[this.SCALAR_ENC_LUT.charAt(e)]=e;this.SCALAR_DEC_LUT["="]=0}_scalar_encode(e){let t="";for(let a=0;a<e.length;a+=3){var i=e[a],s=a+1<e.length?e[a+1]:0,r=a+2<e.length?e[a+2]:0;t+=this.SCALAR_ENC_LUT[i>>2]+this.SCALAR_ENC_LUT[(3&i)<<4|s>>4],a+1<e.length?t+=this.SCALAR_ENC_LUT[(15&s)<<2|r>>6]:t+="=",a+2<e.length?t+=this.SCALAR_ENC_LUT[63&r]:t+="="}return t}encode(e){var t=e.length,i=4*Math.ceil(t/3),s=new Uint8Array(i);let r=0,a=0;for(;r+12<=t;){var n=e.subarray(r,r+12),o=new Uint8Array(16);o[0]=n[0]>>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],o[4]=n[3]>>2,o[5]=(3&n[3])<<4|n[4]>>4,o[6]=(15&n[4])<<2|n[5]>>6,o[7]=63&n[5],o[8]=n[6]>>2,o[9]=(3&n[6])<<4|n[7]>>4,o[10]=(15&n[7])<<2|n[8]>>6,o[11]=63&n[8],o[12]=n[9]>>2,o[13]=(3&n[9])<<4|n[10]>>4,o[14]=(15&n[10])<<2|n[11]>>6,o[15]=63&n[11];for(let e=0;e<16;e++)s[a+e]=this.SCALAR_ENC_LUT.charCodeAt(o[e]);r+=12,a+=16}let h=(new TextDecoder).decode(s.subarray(0,a));return r<t&&(h+=this._scalar_encode(e.subarray(r))),h}_scalar_decode(e){e=e.replace(/=+$/,"");var t=Math.floor(3*e.length/4),i=new Uint8Array(t);let s=0;for(let h=0;h<e.length;h+=4){var r=this.SCALAR_DEC_LUT[e[h]],a=this.SCALAR_DEC_LUT[e[h+1]],n=h+2<e.length?this.SCALAR_DEC_LUT[e[h+2]]:0,o=h+3<e.length?this.SCALAR_DEC_LUT[e[h+3]]:0;i[s++]=r<<2|a>>4,s<t&&(i[s++]=(15&a)<<4|n>>2),s<t&&(i[s++]=(3&n)<<6|o)}return i}decode(e){var t=e.length;if(t%4!=0)throw new Error("Invalid Base64 string length.");var i=(e.match(/=/g)||[]).length,s=new Uint8Array(3*t/4-i);let r=0,a=0;for(var n;r+16<=t-i;){var o=Array.from(e.substring(r,r+16)).map(e=>this.SCALAR_DEC_LUT[e]),h=new Uint8Array(12);h[0]=o[0]<<2|o[1]>>4,h[1]=(15&o[1])<<4|o[2]>>2,h[2]=(3&o[2])<<6|o[3],h[3]=o[4]<<2|o[5]>>4,h[4]=(15&o[5])<<4|o[6]>>2,h[5]=(3&o[6])<<6|o[7],h[6]=o[8]<<2|o[9]>>4,h[7]=(15&o[9])<<4|o[10]>>2,h[8]=(3&o[10])<<6|o[11],h[9]=o[12]<<2|o[13]>>4,h[10]=(15&o[13])<<4|o[14]>>2,h[11]=(3&o[14])<<6|o[15],s.set(h,a),r+=16,a+=12}return r<t&&(n=this._scalar_decode(e.substring(r)),s.set(n,a)),s}}},function(e,t,i){i.r(t);let s=new Array(128);for(let e=0;e<128;e++){var r=[];for(let t=0;t<e;t++)r.push(`b[o+${t}]`);s[e]=new Function("b","o",`return String.fromCharCode(${r.join(",")});`)}let a=new Float32Array(1),n=new Uint8Array(64),o=new Int8Array(256).fill(-1);var h,l,c,d;for(let e=0;e<64;e++){var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(e);n[e]=_,o[_]=e}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;let u=new Map,f=new Map;for(h of["asyncIterator","hasInstance","isConcatSpreadable","iterator","match","matchAll","replace","search","species","split","toPrimitive","toStringTag","unscopables"]){var p=Symbol[h];p&&(u.set(p,h),f.set(h,p))}let m=1,y=16,w=17,g=18,v=19,b=20,A=21,S=22,x=23,I=24,z=25,k=26,D=32,C=33,M=34,E=35,T=48,B=49,V=50,U=51,L=52,F=53,P=54,O=55,K=56,N=64,$=65,j=66,R=67,q=68,H=69,G=70,W=71,X=80,Q=81,Y=82,J=83,Z=84,ee=85,te=105,ie=106,se=112,re=113,ae=114,ne=128,oe=129,he=144,le=145,ce=160,de=161,_e=162,ue=163,fe=164,pe=165,me=166,ye=167,we=168,ge=176,ve=192,be=193,Ae=208,Se=209,xe=224,Ie=225,ze=226,ke=227,De=240,Ce=[],Me=[];for([l,c,d]of[[96,1,"Uint8Array"],[97,1,"Int8Array"],[98,1,"Uint8ClampedArray"],[99,2,"Uint16Array"],[100,2,"Int16Array"],[101,4,"Uint32Array"],[102,4,"Int32Array"],[103,4,"Float32Array"],[104,8,"Float64Array"],[105,8,"BigInt64Array"],[106,8,"BigUint64Array"],[107,1,"DataView"],[67,1,null],[68,2,null],[69,4,null],[70,4,null],[71,8,null]])Ce[l]=c,d&&globalThis[d]&&(Me[l]=globalThis[d]);let Ee=new Map;var Te,Be,Ve=["Uint8Array","Int8Array","Uint8ClampedArray","Uint16Array","Int16Array","Uint32Array","Int32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","DataView"];for([Te,Be]of[[Date,he],[RegExp,ge],[Map,ne],[Set,oe],[ArrayBuffer,se]])Ee.set(Te,Be);for(let e=0;e<Ve.length;e++){var Ue=globalThis[Ve[e]];Ue&&Ee.set(Ue,96+e)}globalThis.SharedArrayBuffer&&Ee.set(SharedArrayBuffer,ae);let Le={[ce]:Error,[de]:EvalError,[_e]:RangeError,[ue]:ReferenceError,[fe]:SyntaxError,[pe]:TypeError,[me]:URIError},Fe=new Map([["Error",ce],["EvalError",de],["RangeError",_e],["ReferenceError",ue],["SyntaxError",fe],["TypeError",pe],["URIError",me],["AggregateError",ye]]),Pe=1413632566,Oe=Symbol.for("__TurboSerial_Ctor");var Ke=class{constructor(e={}){this.options={compression:e.compression||!1,deduplication:!1!==e.deduplication,shareArrayBuffers:!1!==e.shareArrayBuffers,simdOptimization:!1!==e.simdOptimization,detectCircular:!1!==e.detectCircular,allowFunction:e.allowFunction||!1,serializeFunctions:e.serializeFunctions||!1,preservePropertyDescriptors:!1!==e.preservePropertyDescriptors,assumePlainObjects:e.assumePlainObjects||!1,sortKeys:e.sortKeys||!1,memoryPoolSize:e.memoryPoolSize||65536,...e},this.options.allowFunction||(this.options.serializeFunctions=!1),e=this.options,this._dedup=e.deduplication,this._detectCircular=e.detectCircular,this._shareBufs=e.shareArrayBuffers,this._allowFn=e.allowFunction,this._serializeFn=e.serializeFunctions,this._preserveDescs=e.preservePropertyDescriptors,this._assumePlain=e.assumePlainObjects,this._sortKeys=e.sortKeys,this._simd=e.simdOptimization,e=Math.max(this.options.memoryPoolSize,65536),this.buf=new Uint8Array(e),this.dv=new DataView(this.buf.buffer),this.f64=new Float64Array(this.buf.buffer),this.f32=new Float32Array(this.buf.buffer),this.i32=new Int32Array(this.buf.buffer),this.i16=new Int16Array(this.buf.buffer),this.pos=0,this.enc=new TextEncoder,this.dec=new TextDecoder,this.refs=new Map,this.ancestors=new WeakSet,this.strings=new Map,this.buffers=new Map,this.deserializeRefs=null,this.deserializeStrings=null,this.deserializeBuffers=null,this.buffer=null,this.view=null}_grow(e){var t=this.pos+e;if(!(t<=this.buf.length)){let i=this.buf.length;for(;i<t;)i<<=1;(e=new Uint8Array(i)).set(this.buf.subarray(0,this.pos)),this.buf=e,this.dv=new DataView(e.buffer),this.f64=new Float64Array(e.buffer),this.f32=new Float32Array(e.buffer),this.i32=new Int32Array(e.buffer),this.i16=new Int16Array(e.buffer)}}_writeAll(e){this.resetState(),this._grow(17),this.dv.setUint32(0,Pe,!0),this.buf[4]=7,this.pos=17,this.writeValue(e),this.dv.setUint32(5,this.refs.size,!0),this.dv.setUint32(9,this.strings.size,!0),this.dv.setUint32(13,this.buffers.size,!0)}serialize(e){return this._writeAll(e),this.buf.slice(0,this.pos)}serializeView(e){return this._writeAll(e),this.buf.subarray(0,this.pos)}deserialize(e){if(this.buffer=e.constructor===Uint8Array?e:new Uint8Array(e),this.view=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.pos=0,this.view.getUint32(0,!0)!==Pe)throw new Error("Invalid TurboSerial data");if(7===(e=this.buffer[4])){var t=this.view.getUint32(5,!0),i=this.view.getUint32(9,!0),s=this.view.getUint32(13,!0);this.deserializeRefs=new Array(t),this.deserializeStrings=new Array(i),this.deserializeBuffers=new Array(s),this._drIdx=0,this._dsIdx=0,this._dbIdx=0,this.pos=17}else{if(6!==e)throw new Error("Unsupported version: "+e);this.deserializeRefs=[],this.deserializeStrings=[],this.deserializeBuffers=[],this._drIdx=-1,this.pos=5}return this.readValue()}resetState(){this.pos=0,this.refs.clear(),this.ancestors=new WeakSet,this.strings.clear(),this.buffers.clear()}resetMemory(e={}){return e=e.shrink?Math.max(this.options.memoryPoolSize||65536,256):this.buf.length,this.buf=new Uint8Array(e),this.dv=new DataView(this.buf.buffer),this.f64=new Float64Array(this.buf.buffer),this.f32=new Float32Array(this.buf.buffer),this.i32=new Int32Array(this.buf.buffer),this.i16=new Int16Array(this.buf.buffer),this.pos=0,this.refs.clear(),this.ancestors=new WeakSet,this.strings.clear(),this.buffers.clear(),this.deserializeRefs&&(this.deserializeRefs.length=0,this.deserializeRefs=null),this.deserializeStrings&&(this.deserializeStrings.length=0,this.deserializeStrings=null),this.deserializeBuffers&&(this.deserializeBuffers.length=0,this.deserializeBuffers=null),this}_wV(e){var t=this.buf;let i=this.pos;if((e>>>=0)<128)t[i]=e,this.pos=i+1;else if(e<16384)t[i]=127&e|128,t[i+1]=e>>>7,this.pos=i+2;else{for(;128<=e;)t[i++]=127&e|128,e>>>=7;t[i++]=e,this.pos=i}}writeValue(e){if(null===e)this._grow(1),this.buf[this.pos++]=0;else if(void 0===e)this._grow(1),this.buf[this.pos++]=1;else{var t=typeof e;if("boolean"==t)this._grow(1),this.buf[this.pos++]=e?3:2;else if("number"==t)this._wNum(e);else if("string"==t)this._wStrDedup(e);else if("bigint"==t)this._wBigInt(e);else if("symbol"==t)this._grow(2),void 0!==(i=Symbol.keyFor(e))?(this.buf[this.pos++]=Ie,this.writeValue(i)):u.has(e)?(this.buf[this.pos++]=ze,this.writeValue(u.get(e))):void 0===e.description?this.buf[this.pos++]=ke:(this.buf[this.pos++]=xe,this.writeValue(e.description));else if("function"==t)this._grow(1),this.buf[this.pos++]=this._allowFn?De:m;else{var i=this.refs.get(e);if(void 0!==i)this._grow(6),this._detectCircular&&this.ancestors.has(e)?this.buf[this.pos++]=Se:this.buf[this.pos++]=Ae,this._wV(i);else{if((this._dedup||this._detectCircular)&&this.refs.set(e,this.refs.size),this._shareBufs&&e.constructor===ArrayBuffer){if(void 0!==(t=this.buffers.get(e)))return this._grow(6),this.buf[this.pos++]=re,void this._wV(t);this.buffers.set(e,this.buffers.size)}this._detectCircular&&this.ancestors.add(e),this._wObj(e),this._detectCircular&&this.ancestors.delete(e)}}}}_wStrDedup(e){if(this._dedup&&3<e.length){var t=this.strings.get(e);if(void 0!==t)return this._grow(6),this.buf[this.pos++]=O,void this._wV(t);this.strings.set(e,this.strings.size)}this._wStr(e)}_wNum(e){if(0<=e&&e<128&&(0|e)===e&&0<=1/e){this._grow(2);let t=this.pos;this.buf[t]=y,this.buf[t+1]=e,this.pos=t+2}else{this._grow(10);let i=this.pos;var t;e!=e?(this.buf[i]=S,this.pos=i+1):e===1/0?(this.buf[i]=x,this.pos=i+1):e===-1/0?(this.buf[i]=I,this.pos=i+1):0===e&&1/e<0?(this.buf[i]=z,this.pos=i+1):e===(t=0|e)?-128<=t&&t<=127?(this.buf[i]=y,this.buf[i+1]=255&t,this.pos=i+2):-32768<=t&&t<=32767?(this.buf[i]=w,this.dv.setInt16(i+1,t,!0),this.pos=i+3):(this.buf[i]=g,this.dv.setInt32(i+1,t,!0),this.pos=i+5):e===(t=e>>>0)?(this.buf[i]=v,this.dv.setUint32(i+1,t,!0),this.pos=i+5):(a[0]=e,a[0]===e?(this.buf[i]=b,this.dv.setFloat32(i+1,e,!0),this.pos=i+5):(this.buf[i]=A,this.dv.setFloat64(i+1,e,!0),this.pos=i+9))}}_wBigInt(e){this._grow(10);var t=e<0n,i=t?-e:e;if(i<=0x7fffffffffffffffn)this.buf[this.pos++]=t?C:D,this.dv.setBigInt64(this.pos,e,!0),this.pos+=8;else{this.buf[this.pos++]=t?E:M;let e=i,s=0,r=i;for(;0n<r;)s++,r>>=8n;this._grow(s+5),this._wV(s);for(let t=0;t<s;t++)this.buf[this.pos++]=Number(0xffn&e),e>>=8n}}_wStr(e){var t=e.length;if(0===t)this._grow(1),this.buf[this.pos++]=T;else{if(64<t&&100===e.charCodeAt(0)&&97===e.charCodeAt(1)&&116===e.charCodeAt(2)&&97===e.charCodeAt(3)&&58===e.charCodeAt(4))if(5<(i=e.indexOf(";base64,",5))){var i,s=i=i+8;if(32<=t-i){var r=((e,t,i)=>{var s=i-t;if(0==s||0!=(3&s))return-1;let r=s;61===e.charCodeAt(i-1)&&(r--,61===e.charCodeAt(i-2))&&r--;for(let i=t;i<t+r;i++)if(o[e.charCodeAt(i)]<0)return-1;return(3*(r+(i=s-r))>>2)-i})(e,i,t);if(0<r){this._grow(6+s+5+r),this.buf[this.pos++]=K,this._wV(s);var a=this.pos;for(let t=0;t<s;t++)this.buf[a+t]=e.charCodeAt(t);return this.pos=a+s,this._wV(r),r=((e,t,i,s,r)=>{var a=o,n=i-t;let h=n,l=(61===e.charCodeAt(i-1)&&(h--,61===e.charCodeAt(i-2))&&h--,i=n-h,r),c=t;for(var d=t+(0<i?h-4:h);c<d;c+=4){var _=a[e.charCodeAt(c)]<<18|a[e.charCodeAt(c+1)]<<12|a[e.charCodeAt(c+2)]<<6|a[e.charCodeAt(c+3)];s[l++]=_>>16&255,s[l++]=_>>8&255,s[l++]=255&_}return 2==i?(n=a[e.charCodeAt(c)]<<2|a[e.charCodeAt(c+1)]>>4,s[l++]=255&n):1==i&&(t=a[e.charCodeAt(c)]<<10|a[e.charCodeAt(c+1)]<<4|a[e.charCodeAt(c+2)]>>2,s[l++]=t>>8&255,s[l++]=255&t),l-r})(e,i,t,this.buf,this.pos),void(this.pos+=r)}}}if(t<128){let i=1;for(let s=0;s<t;s++)if(127<e.charCodeAt(s)){i=0;break}if(i){this._grow(t+2);var n=this.pos;this.buf[n++]=t<16?B:V,this.buf[n++]=t;for(let i=0;i<t;i++)this.buf[n+i]=e.charCodeAt(i);return void(this.pos=n+t)}let s=3*t,r=(this._grow(7+s),this.pos+2),a=this.enc.encodeInto(e,this.buf.subarray(r,r+s)).written,o=this.pos;this.buf[o++]=a<16?L:a<256?F:P,a<256?(this.buf[o++]=a,this.pos=r+a):(this.pos=o,this._wV(a),o=this.pos,this.buf.copyWithin(o,r,r+a),this.pos=o+a)}else{let i=3*t;this._grow(i+7);let s=this.pos+6,r=this.enc.encodeInto(e,this.buf.subarray(s,s+i)).written,a=this.pos;r===t?(this.buf[a++]=t<256?V:U,t<256?this.buf[a++]=t:(this.pos=a,this._wV(t),a=this.pos)):(this.buf[a++]=r<256?F:P,r<256?this.buf[a++]=r:(this.pos=a,this._wV(r),a=this.pos)),a!==s&&this.buf.copyWithin(a,s,s+r),this.pos=a+r}}}_wObj(e){if(Array.isArray(e))this._wArr(e);else{var t=e.constructor;if(t===Object)return this._allowFn||this._preserveDescs&&!this._assumePlain?void this._wPlainObj(e):void this._wFastPlainObj(e);if(void 0!==(t=Ee.get(t))){if(t===he)return this._grow(9),void((a=e.getTime())!=a?this.buf[this.pos++]=le:(this.buf[this.pos++]=he,this.dv.setFloat64(this.pos,a,!0),this.pos+=8));if(t===ge)return this._grow(1),this.buf[this.pos++]=ge,this.writeValue(e.source),void this.writeValue(e.flags);if(t===ne){for(var[i,s]of(this._grow(6),this.buf[this.pos++]=ne,this._wV(e.size),e))this.writeValue(i),this.writeValue(s);return}if(t===oe){for(var r of(this._grow(6),this.buf[this.pos++]=oe,this._wV(e.size),e))this.writeValue(r);return}if(t===se||t===ae)return this._grow(6),this.buf[this.pos++]=t,a=new Uint8Array(e),this._wV(a.length),this._grow(a.length),this.buf.set(a,this.pos),void(this.pos+=a.length);if(96==(240&t))return void this._wTypedArr(e,t)}if(e.constructor===Error||e.constructor&&Fe.has(e.constructor.name)){this._grow(2);var a=Fe.get(e.constructor.name)||we;if(this.buf[this.pos++]=a,this.writeValue(e.message||""),this.writeValue(e.stack||""),a===ye&&e.errors)for(var n of(this._wV(e.errors.length),e.errors))this.writeValue(n)}else"undefined"==typeof Blob||e.constructor!==Blob&&e.constructor!==("undefined"!=typeof File?File:null)?this._wPlainObj(e):(this._grow(12),this.buf[this.pos++]="undefined"!=typeof File&&e.constructor===File?be:ve,this._wV(0),this._wV(0))}}_wArr(e){var t=e.length;if(0===t)this._grow(1),this.buf[this.pos++]=N;else if(Object.keys(e).length!==t){this._grow(12),this.buf[this.pos++]=j,this._wV(t);var i,s=[];for(let i=0;i<t;i++)i in e&&s.push(i);for(i of(this._wV(s.length),s))this._wV(i),this.writeValue(e[i])}else if(!(this._simd&&8<=t&&"number"==typeof e[0]&&this._wPackedArr(e,t))){this._grow(6),this.buf[this.pos++]=$,this._wV(t);for(let i=0;i<t;i++)this.writeValue(e[i])}}_wPackedArr(e,t){let i,s=1,r=e[0],n=e[0],o=1;for(let i=0;i<t;i++){var h=e[i];if("number"!=typeof h)return!1;h!==(0|h)&&(s=0),h<r&&(r=h),h>n&&(n=h),o&&(a[0]=h,a[0]!==h)&&(o=0)}i=s?(l=Math.max(Math.abs(r),Math.abs(n)))<=127?R:l<=32767?q:H:o?G:W;var l=Ce[i]||1;this._grow(6+t*l),this.buf[this.pos++]=i,this._wV(t);let c=this.pos;switch(i){case R:for(let i=0;i<t;i++)this.buf[c++]=255&e[i];break;case q:for(let i=0;i<t;i++)this.dv.setInt16(c,e[i],!0),c+=2;break;case H:for(let i=0;i<t;i++)this.dv.setInt32(c,e[i],!0),c+=4;break;case G:for(let i=0;i<t;i++)this.dv.setFloat32(c,e[i],!0),c+=4;break;case W:for(let i=0;i<t;i++)this.dv.setFloat64(c,e[i],!0),c+=8}return this.pos=c,!0}_wTypedArr(e,t){this._grow(12),this.buf[this.pos++]=t;var i=e.buffer;if(this._shareBufs){var s=this.buffers.get(i);if(void 0!==s)return this.buf[this.pos++]=1,this._wV(s),this._wV(e.byteOffset),void this._wV(e.length);this.buffers.set(i,this.buffers.size)}if(this.buf[this.pos++]=0,this._wV(e.byteOffset),this._wV(e.length),s=Ce[t]||1,t===te||t===ie){this._grow(8*e.length);for(let t=0;t<e.length;t++)this.dv.setBigInt64(this.pos,e[t],!0),this.pos+=8}else t=e.length*s,this._grow(t),s=new Uint8Array(i,e.byteOffset,t),this.buf.set(s,this.pos),this.pos+=t}_wPlainObj(e){var t=Object.getPrototypeOf(e),i=(t=e.constructor===Object||t===Object.prototype||null===t,Object.keys(e));if(0===i.length&&t)this._grow(1),this.buf[this.pos++]=X;else if(t){if(this._preserveDescs){var s;t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];let i=!1;for(s of t){var r=Object.getOwnPropertyDescriptor(e,s);if(r.get||r.set||!r.enumerable||!r.writable||!r.configurable){i=!0;break}}if(i)return void this._wDescriptorObj(e,t)}let n=!1;if(this._allowFn)for(let t=0;t<i.length;t++)if("function"==typeof e[i[t]]){n=!0;break}if(n)this._wMethodObj(e,i);else{this._grow(6),this.buf[this.pos++]=Y,this._sortKeys&&i.sort();let t=i.length;if(!this._serializeFn)for(let s=t=0;s<i.length;s++)"function"!=typeof e[i[s]]&&t++;this._wV(t);for(let t=0;t<i.length;t++){var a=e[i[t]];!this._serializeFn&&"function"==typeof a||(this.writeValue(i[t]),this.writeValue(a))}}}else this._wConstructorObj(e,i)}_wFastPlainObj(e){var t=Object.keys(e),i=t.length;if(0===i)this._grow(1),this.buf[this.pos++]=X;else{this._grow(6),this.buf[this.pos++]=Y,this._sortKeys&&t.sort(),this._wV(i);for(let r=0;r<i;r++){var s=t[r];this.writeValue(s),this.writeValue(e[s])}}}_wDescriptorObj(e,t){this._grow(6),this.buf[this.pos++]=Z;let i=this._serializeFn;var s;t=t.filter(t=>{try{var s=Object.getOwnPropertyDescriptor(e,t);return s&&(i||!s.get&&!s.set&&"function"!=typeof s.value)}catch(t){return!1}});for(s of(this._wV(t.length),t)){this.writeValue(s);var r=Object.getOwnPropertyDescriptor(e,s);let t=0;r.enumerable&&(t|=1),r.writable&&(t|=2),r.configurable&&(t|=4),r.get&&(t|=8),r.set&&(t|=16),this._grow(1),this.buf[this.pos++]=t,r.get||r.set?(r.get&&this.writeValue(r.get),r.set&&this.writeValue(r.set)):this.writeValue(r.value)}}_wMethodObj(e,t){this._grow(6),this.buf[this.pos++]=ee;var i,s=[];for(i of t)try{var r=e[i];s.push([i,r,"function"==typeof r])}catch(e){}this._wV(s.length);var a,n,o,h=this._serializeFn;for([a,n,o]of s)this.writeValue(a),this._grow(1),this.buf[this.pos++]=o?1:0,o&&h?(this.writeValue(n.toString()),this.writeValue(n.name||"")):o?(this._grow(1),this.buf[this.pos++]=De):this.writeValue(n)}_wConstructorObj(e,t){this._grow(6),this.buf[this.pos++]=J,this.writeValue((null==(s=e.constructor)?void 0:s.name)||"");var i,s=this._serializeFn?t:t.filter(t=>{try{return"function"!=typeof e[t]}catch(t){return!1}});for(i of(this._wV(s.length),s))this.writeValue(i),this.writeValue(e[i])}_pushRef(e){0<=this._drIdx?this.deserializeRefs[this._drIdx++]=e:this.deserializeRefs.push(e)}_pushStr(e){0<=this._dsIdx?this.deserializeStrings[this._dsIdx++]=e:this.deserializeStrings.push(e)}_pushBuf(e){0<=this._dbIdx?this.deserializeBuffers[this._dbIdx++]=e:this.deserializeBuffers.push(e)}readValue(){var e=this.buffer[this.pos++];if(e===Ae||e===Se)return this.deserializeRefs[this._rV()];if(e===O)return this.deserializeStrings[this._rV()];if(e===re)return this.deserializeBuffers[this._rV()];var t,i=240&e;if(0==i)return 0===e?null:1===e?void 0:3===e;if(16==i)return this._rNum(e);if(32==i)return this._rBigInt(e);if(48==i)return this._rStr(e);if(64==i||80==i||128==i){let t;return t=64==i?[]:128==i?new(e===ne?Map:Set):{},this._pushRef(t),this._rFill(t,e,i),t}if(96==i)return t=this._rTypedArr(e),this._pushRef(t),t;if(112==i)return t=this._rArrayBuf(e),this._pushBuf(t),t;if(144==i)return e===le?new Date(NaN):(t=this.view.getFloat64(this.pos,!0),this.pos+=8,new Date(t));if(160==i)return this._rError(e);if(176==i)return new RegExp(this.readValue(),this.readValue());if(192==i)return this._rV(),this._rV(),{_type:"Binary"};if(224==i)return this._rSpecial(e);if(240==i)return this._allowFn?function(){throw new Error("Function not serialized")}:void 0;throw new Error("Unknown type: 0x"+e.toString(16))}_rV(){let e=this.pos,t=this.buffer[e++];if(!(128&t))return this.pos=e,t;let i=127&t,s=7;for(;t=this.buffer[e++],i|=(127&t)<<s,s+=7,128&t;);return this.pos=e,i>>>0}_rFill(e,t,i){if(64===i){if(t!==N)if(t===$){var s=this._rV();for(let t=0;t<s;t++)e[t]=this.readValue()}else if(t===j){e.length=this._rV();var r=this._rV();for(let t=0;t<r;t++)e[this._rV()]=this.readValue()}else{var a=this._rPacked(t);for(let t=0;t<a.length;t++)e.push(a[t])}}else if(80===i)this.fillObject(e,t);else if(128===i){var n=this._rV();if(t===ne)for(let t=0;t<n;t++)e.set(this.readValue(),this.readValue());else for(let t=0;t<n;t++)e.add(this.readValue())}}fillObject(e,t){t!==X&&(t===Y||t===Q?this._fillLiteralObj(e):t===Z?this._fillDescriptorObj(e):t===ee?this._fillMethodObj(e):t===J&&this._fillConstructorObj(e))}_fillLiteralObj(e){var t=this._rV();for(let i=0;i<t;i++)e[this.readValue()]=this.readValue()}_fillDescriptorObj(e){var t=this._rV();for(let a=0;a<t;a++){var i=this.readValue(),s=this.buffer[this.pos++],r={enumerable:!!(1&s),writable:!!(2&s),configurable:!!(4&s)};8&s||16&s?(8&s&&(r.get=this.readValue()),16&s&&(r.set=this.readValue())):r.value=this.readValue(),Object.defineProperty(e,i,r)}}_fillMethodObj(e){var t=this._rV();for(let r=0;r<t;r++){var i=this.readValue();if(this.buffer[this.pos++])if(this._allowFn&&this._serializeFn){var s=this.readValue();this.readValue();try{e[i]=new Function("return "+s)()}catch(t){e[i]=void 0}}else this._serializeFn?(this.readValue(),this.readValue(),e[i]=void 0):(this.pos++,e[i]=this._allowFn?function(){throw new Error("Not serialized")}:void 0);else e[i]=this.readValue()}}_fillConstructorObj(e){var t=this.readValue(),i=this._rV();for(let t=0;t<i;t++)e[this.readValue()]=this.readValue();e[Oe]=t}_rNum(e){let t,i=this.pos;switch(e){case y:return t=this.buffer[i]<<24>>24,this.pos=i+1,t;case w:return t=this.view.getInt16(i,!0),this.pos=i+2,t;case g:return t=this.view.getInt32(i,!0),this.pos=i+4,t;case v:return t=this.view.getUint32(i,!0),this.pos=i+4,t;case b:return t=this.view.getFloat32(i,!0),this.pos=i+4,t;case A:return t=this.view.getFloat64(i,!0),this.pos=i+8,t;case S:return NaN;case x:return 1/0;case I:return-1/0;case z:return-0;case k:return t=this._rV(),this.buffer[this.pos++]?-t:t}}_rBigInt(e){if(e===D||e===C){let e=this.view.getBigInt64(this.pos,!0);return this.pos+=8,e}e=e===E;var t=this._rV();let i="";for(let e=t-1;0<=e;e--)i+=this.buffer[this.pos+e].toString(16).padStart(2,"0");this.pos+=t;let s=BigInt("0x"+(i||"0"));return e?-s:s}_rStr(e){if(e===T)return"";var t=this.buffer;if(e===K){let e;e=(i=this._rV())<128?s[i](t,this.pos):this.dec.decode(t.subarray(this.pos,this.pos+i)),this.pos+=i;var i=this._rV(),r=((e,t,i)=>{var s=n,r=i%3,a=i-r,o=4*((i+2)/3|0),h=new Uint8Array(o);let l=0;var c=t+a;for(let i=t;i<c;i+=3){var d=e[i]<<16&16711680|e[i+1]<<8&65280|255&e[i+2];h[l++]=s[d>>18&63],h[l++]=s[d>>12&63],h[l++]=s[d>>6&63],h[l++]=s[63&d]}1==r?(a=e[t+i-1],h[l++]=s[a>>2],h[l++]=s[a<<4&63],h[l++]=61,h[l++]=61):2==r&&(a=e[t+i-2]<<8|e[t+i-1],h[l++]=s[a>>10],h[l++]=s[a>>4&63],h[l++]=s[a<<2&63],h[l++]=61);let _="";for(let e=0;e<o;e+=8192)_+=String.fromCharCode.apply(null,h.subarray(e,Math.min(e+8192,o)));return _})(t,this.pos,i);this.pos+=i;let a=e+r;return 3<a.length&&this._pushStr(a),a}let a,o;return a=e===B||e===V||e===L||e===F?this.buffer[this.pos++]:this._rV(),o=(i=e===B||e===V||e===U)&&a<128?s[a](t,this.pos):this.dec.decode(t.subarray(this.pos,this.pos+a)),this.pos+=a,3<o.length&&this._pushStr(o),o}_rPacked(e){var t=this._rV(),i=new Array(t);let s=this.pos;switch(e){case R:for(let e=0;e<t;e++)i[e]=this.buffer[s++]<<24>>24;break;case q:for(let e=0;e<t;e++)i[e]=this.view.getInt16(s,!0),s+=2;break;case H:for(let e=0;e<t;e++)i[e]=this.view.getInt32(s,!0),s+=4;break;case G:for(let e=0;e<t;e++)i[e]=this.view.getFloat32(s,!0),s+=4;break;case W:for(let e=0;e<t;e++)i[e]=this.view.getFloat64(s,!0),s+=8}return this.pos=s,i}_rTypedArr(e){if(this.buffer[this.pos++]){let t=this._rV(),i=this._rV(),s=this._rV();return new Me[e](this.deserializeBuffers[t],i,s)}this._rV();let t=this._rV(),i=Ce[e]||1;if(e===te||e===ie){var s=[];for(let e=0;e<t;e++)s.push(this.view.getBigInt64(this.pos,!0)),this.pos+=8;return new Me[e](s)}var r=t*i,a=new ArrayBuffer(r);return new Uint8Array(a).set(this.buffer.subarray(this.pos,this.pos+r)),this.pos+=r,this._pushBuf(a),new Me[e](a,0,t)}_rArrayBuf(e){var t=this._rV(),i=this.buffer.buffer.slice(this.buffer.byteOffset+this.pos,this.buffer.byteOffset+this.pos+t);return this.pos+=t,i}_rError(e){var t=this.readValue(),i=this.readValue();let s;if(e===ye){var r=this._rV(),a=[];for(let e=0;e<r;e++)a.push(this.readValue());s=new AggregateError(a,t)}else s=new(Le[e]||Error)(t);return i&&(s.stack=i),s}_rSpecial(e){if(e===xe)return Symbol(this.readValue());if(e===ke)return Symbol();if(e===Ie)return Symbol.for(this.readValue());if(e===ze)return f.get(this.readValue())||Symbol();throw new Error("Unknown special type: 0x"+e.toString(16))}},Ne=i(0),$e=i.n(Ne);i.d(t,"LacertaDB",(function(){return It})),i.d(t,"Database",(function(){return xt})),i.d(t,"Collection",(function(){return St})),i.d(t,"Document",(function(){return pt})),i.d(t,"MigrationManager",(function(){return bt})),i.d(t,"PerformanceMonitor",(function(){return At})),i.d(t,"LacertaDBError",(function(){return Ge})),i.d(t,"OPFSUtility",(function(){return ct})),i.d(t,"IndexManager",(function(){return lt})),i.d(t,"CacheStrategy",(function(){return Ye})),i.d(t,"LRUCache",(function(){return We})),i.d(t,"LFUCache",(function(){return Xe})),i.d(t,"TTLCache",(function(){return Qe})),i.d(t,"BTreeIndex",(function(){return at})),i.d(t,"TextIndex",(function(){return nt})),i.d(t,"GeoIndex",(function(){return ot})),i.d(t,"HashIndex",(function(){return ht})),i.d(t,"SecureDatabaseEncryption",(function(){return tt})),i.d(t,"QuickStore",(function(){return Re})),i.d(t,"AsyncMutex",(function(){return He})),i.d(t,"IndexedDBConnectionPool",(function(){return qe})),i.d(t,"BrowserCompressionUtility",(function(){return Je})),i.d(t,"BrowserEncryptionUtility",(function(){return et})),
2
2
  /**
3
3
  * LacertaDB V0.13.0 - Production Library
4
4
  * @module LacertaDB
package/dist/index.min.js CHANGED
@@ -1,4 +1,4 @@
1
- (e=>{var t={};function i(s){var r;return(t[s]||(r=t[s]={i:s,l:!1,exports:{}},e[s].call(r.exports,r,r.exports,i),r.l=!0,r)).exports}i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(s,r,function(t){return e[t]}.bind(null,r));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)})([function(e,t){var i={},s=new Float32Array(4);function r(e,t){if((0|e)!==e)throw new TypeError("Lane index must be an int32");if(e<0||t<=e)throw new RangeError("Lane index must be in bounds")}new Int32Array(s.buffer),new Int16Array(s.buffer),new Int8Array(s.buffer),new Uint32Array(s.buffer),new Uint16Array(s.buffer),new Uint8Array(s.buffer),void 0!==i.Int8x16&&void 0!==i.Int8x16.extractLane||(i.Int8x16=function(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m){if(!(this instanceof i.Int8x16))return new i.Int8x16(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m);this.s_=new Int8Array([e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m])},i.Int8x16.check=function(e){if(e instanceof i.Int8x16)return e;throw new TypeError("Argument is not a Int8x16.")},i.Int8x16.splat=function(e){return new i.Int8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Int8x16.extractLane=function(e,t){return e=i.Int8x16.check(e),r(t,16),e.s_[t]},i.Int8x16.replaceLane=function(e,t,s){return e=i.Int8x16.check(e),r(t,16),(e=Array.from(e.s_))[t]=s,new i.Int8x16(...e)},i.Int8x16.shuffle=function(e,t,s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g){var v=[s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g],b=[];e=i.Int8x16.check(e),t=i.Int8x16.check(t);for(var A=0;A<16;A++){var S=v[A];r(S,32),b[A]=S<16?e.s_[S]:t.s_[S-16]}return new i.Int8x16(...b)}),void 0!==i.Uint8x16&&void 0!==i.Uint8x16.extractLane||(i.Uint8x16=function(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m){if(!(this instanceof i.Uint8x16))return new i.Uint8x16(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m);this.s_=new Uint8Array([e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m])},i.Uint8x16.check=function(e){if(e instanceof i.Uint8x16)return e;throw new TypeError("Argument is not a Uint8x16.")},i.Uint8x16.splat=function(e){return new i.Uint8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Uint8x16.extractLane=function(e,t){return e=i.Uint8x16.check(e),r(t,16),e.s_[t]},i.Uint8x16.load=function(e,t){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return new i.Uint8x16(...e.subarray(t,t+16))},i.Uint8x16.store=function(e,t,i){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return e.set(i.s_,t),i},i.Uint8x16.shuffle=function(e,t,s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g){var v=[s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g],b=[];e=i.Uint8x16.check(e),t=i.Uint8x16.check(t);for(var A=0;A<16;A++){var S=v[A];r(S,32),b[A]=S<16?e.s_[S]:t.s_[S-16]}return new i.Uint8x16(...b)},i.Uint8x16.and=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]&t.s_[r];return new i.Uint8x16(...s)},i.Uint8x16.or=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]|t.s_[r];return new i.Uint8x16(...s)},i.Uint8x16.shiftLeftByScalar=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]<<t;return new i.Uint8x16(...s)},i.Uint8x16.shiftRightByScalar=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]>>>t;return new i.Uint8x16(...s)}),e.exports=class{constructor(){this.ENC_SHUFFLE=i.Int8x16(10,11,9,10,7,8,6,7,4,5,3,4,1,2,0,1),this.ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.ENC_LUT_SIMD=[i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0)];for(let t=0;t<4;t++){var e=this.ENC_LUT.substring(16*t,16*(t+1));this.ENC_LUT_SIMD[t]=i.Uint8x16(...Array.from(e).map(e=>e.charCodeAt(0)))}this.DEC_DELTA_ASSO=i.Uint8x16(1,1,1,1,1,1,1,1,0,0,0,0,0,15,0,15),this.DEC_DELTA_VALUES=i.Int8x16(0,0,0,19,4,191,191,185,185,0,16,195,191,191,185,185),this.DEC_SHUFFLE=i.Int8x16(-1,-1,-1,-1,12,13,14,8,9,10,4,5,6,0,1,2),this.SCALAR_ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.SCALAR_DEC_LUT={};for(let e=0;e<this.SCALAR_ENC_LUT.length;e++)this.SCALAR_DEC_LUT[this.SCALAR_ENC_LUT.charAt(e)]=e;this.SCALAR_DEC_LUT["="]=0}_scalar_encode(e){let t="";for(let a=0;a<e.length;a+=3){var i=e[a],s=a+1<e.length?e[a+1]:0,r=a+2<e.length?e[a+2]:0;t+=this.SCALAR_ENC_LUT[i>>2]+this.SCALAR_ENC_LUT[(3&i)<<4|s>>4],a+1<e.length?t+=this.SCALAR_ENC_LUT[(15&s)<<2|r>>6]:t+="=",a+2<e.length?t+=this.SCALAR_ENC_LUT[63&r]:t+="="}return t}encode(e){var t=e.length,i=4*Math.ceil(t/3),s=new Uint8Array(i);let r=0,a=0;for(;r+12<=t;){var n=e.subarray(r,r+12),o=new Uint8Array(16);o[0]=n[0]>>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],o[4]=n[3]>>2,o[5]=(3&n[3])<<4|n[4]>>4,o[6]=(15&n[4])<<2|n[5]>>6,o[7]=63&n[5],o[8]=n[6]>>2,o[9]=(3&n[6])<<4|n[7]>>4,o[10]=(15&n[7])<<2|n[8]>>6,o[11]=63&n[8],o[12]=n[9]>>2,o[13]=(3&n[9])<<4|n[10]>>4,o[14]=(15&n[10])<<2|n[11]>>6,o[15]=63&n[11];for(let e=0;e<16;e++)s[a+e]=this.SCALAR_ENC_LUT.charCodeAt(o[e]);r+=12,a+=16}let h=(new TextDecoder).decode(s.subarray(0,a));return r<t&&(h+=this._scalar_encode(e.subarray(r))),h}_scalar_decode(e){e=e.replace(/=+$/,"");var t=Math.floor(3*e.length/4),i=new Uint8Array(t);let s=0;for(let h=0;h<e.length;h+=4){var r=this.SCALAR_DEC_LUT[e[h]],a=this.SCALAR_DEC_LUT[e[h+1]],n=h+2<e.length?this.SCALAR_DEC_LUT[e[h+2]]:0,o=h+3<e.length?this.SCALAR_DEC_LUT[e[h+3]]:0;i[s++]=r<<2|a>>4,s<t&&(i[s++]=(15&a)<<4|n>>2),s<t&&(i[s++]=(3&n)<<6|o)}return i}decode(e){var t=e.length;if(t%4!=0)throw new Error("Invalid Base64 string length.");var i=(e.match(/=/g)||[]).length,s=new Uint8Array(3*t/4-i);let r=0,a=0;for(var n;r+16<=t-i;){var o=Array.from(e.substring(r,r+16)).map(e=>this.SCALAR_DEC_LUT[e]),h=new Uint8Array(12);h[0]=o[0]<<2|o[1]>>4,h[1]=(15&o[1])<<4|o[2]>>2,h[2]=(3&o[2])<<6|o[3],h[3]=o[4]<<2|o[5]>>4,h[4]=(15&o[5])<<4|o[6]>>2,h[5]=(3&o[6])<<6|o[7],h[6]=o[8]<<2|o[9]>>4,h[7]=(15&o[9])<<4|o[10]>>2,h[8]=(3&o[10])<<6|o[11],h[9]=o[12]<<2|o[13]>>4,h[10]=(15&o[13])<<4|o[14]>>2,h[11]=(3&o[14])<<6|o[15],s.set(h,a),r+=16,a+=12}return r<t&&(n=this._scalar_decode(e.substring(r)),s.set(n,a)),s}}},function(e,t,i){i.r(t);let s=new Array(128);for(let e=0;e<128;e++){var r=[];for(let t=0;t<e;t++)r.push(`b[o+${t}]`);s[e]=new Function("b","o",`return String.fromCharCode(${r.join(",")});`)}let a=new Float32Array(1),n=new Uint8Array(64),o=new Int8Array(256).fill(-1);var h,l,c,d;for(let e=0;e<64;e++){var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(e);n[e]=_,o[_]=e}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;let u=new Map,f=new Map;for(h of["asyncIterator","hasInstance","isConcatSpreadable","iterator","match","matchAll","replace","search","species","split","toPrimitive","toStringTag","unscopables"]){var p=Symbol[h];p&&(u.set(p,h),f.set(h,p))}let m=1,y=16,w=17,g=18,v=19,b=20,A=21,S=22,x=23,I=24,z=25,k=26,D=32,C=33,M=34,E=35,T=48,B=49,V=50,U=51,F=52,L=53,P=54,O=55,K=56,N=64,$=65,j=66,R=67,q=68,H=69,G=70,W=71,X=80,Q=81,Y=82,J=83,Z=84,ee=85,te=105,ie=106,se=112,re=113,ae=114,ne=128,oe=129,he=144,le=145,ce=160,de=161,_e=162,ue=163,fe=164,pe=165,me=166,ye=167,we=168,ge=176,ve=192,be=193,Ae=208,Se=209,xe=224,Ie=225,ze=226,ke=227,De=240,Ce=[],Me=[];for([l,c,d]of[[96,1,"Uint8Array"],[97,1,"Int8Array"],[98,1,"Uint8ClampedArray"],[99,2,"Uint16Array"],[100,2,"Int16Array"],[101,4,"Uint32Array"],[102,4,"Int32Array"],[103,4,"Float32Array"],[104,8,"Float64Array"],[105,8,"BigInt64Array"],[106,8,"BigUint64Array"],[107,1,"DataView"],[67,1,null],[68,2,null],[69,4,null],[70,4,null],[71,8,null]])Ce[l]=c,d&&globalThis[d]&&(Me[l]=globalThis[d]);let Ee=new Map;var Te,Be,Ve=["Uint8Array","Int8Array","Uint8ClampedArray","Uint16Array","Int16Array","Uint32Array","Int32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","DataView"];for([Te,Be]of[[Date,he],[RegExp,ge],[Map,ne],[Set,oe],[ArrayBuffer,se]])Ee.set(Te,Be);for(let e=0;e<Ve.length;e++){var Ue=globalThis[Ve[e]];Ue&&Ee.set(Ue,96+e)}globalThis.SharedArrayBuffer&&Ee.set(SharedArrayBuffer,ae);let Fe={[ce]:Error,[de]:EvalError,[_e]:RangeError,[ue]:ReferenceError,[fe]:SyntaxError,[pe]:TypeError,[me]:URIError},Le=new Map([["Error",ce],["EvalError",de],["RangeError",_e],["ReferenceError",ue],["SyntaxError",fe],["TypeError",pe],["URIError",me],["AggregateError",ye]]),Pe=1413632566,Oe=Symbol.for("__TurboSerial_Ctor");var Ke=class{constructor(e={}){this.options={compression:e.compression||!1,deduplication:!1!==e.deduplication,shareArrayBuffers:!1!==e.shareArrayBuffers,simdOptimization:!1!==e.simdOptimization,detectCircular:!1!==e.detectCircular,allowFunction:e.allowFunction||!1,serializeFunctions:e.serializeFunctions||!1,preservePropertyDescriptors:!1!==e.preservePropertyDescriptors,assumePlainObjects:e.assumePlainObjects||!1,sortKeys:e.sortKeys||!1,memoryPoolSize:e.memoryPoolSize||65536,...e},this.options.allowFunction||(this.options.serializeFunctions=!1),e=this.options,this._dedup=e.deduplication,this._detectCircular=e.detectCircular,this._shareBufs=e.shareArrayBuffers,this._allowFn=e.allowFunction,this._serializeFn=e.serializeFunctions,this._preserveDescs=e.preservePropertyDescriptors,this._assumePlain=e.assumePlainObjects,this._sortKeys=e.sortKeys,this._simd=e.simdOptimization,e=Math.max(this.options.memoryPoolSize,65536),this.buf=new Uint8Array(e),this.dv=new DataView(this.buf.buffer),this.f64=new Float64Array(this.buf.buffer),this.f32=new Float32Array(this.buf.buffer),this.i32=new Int32Array(this.buf.buffer),this.i16=new Int16Array(this.buf.buffer),this.pos=0,this.enc=new TextEncoder,this.dec=new TextDecoder,this.refs=new Map,this.ancestors=new WeakSet,this.strings=new Map,this.buffers=new Map,this.deserializeRefs=null,this.deserializeStrings=null,this.deserializeBuffers=null,this.buffer=null,this.view=null}_grow(e){var t=this.pos+e;if(!(t<=this.buf.length)){let i=this.buf.length;for(;i<t;)i<<=1;(e=new Uint8Array(i)).set(this.buf.subarray(0,this.pos)),this.buf=e,this.dv=new DataView(e.buffer),this.f64=new Float64Array(e.buffer),this.f32=new Float32Array(e.buffer),this.i32=new Int32Array(e.buffer),this.i16=new Int16Array(e.buffer)}}_writeAll(e){this.resetState(),this._grow(17),this.dv.setUint32(0,Pe,!0),this.buf[4]=7,this.pos=17,this.writeValue(e),this.dv.setUint32(5,this.refs.size,!0),this.dv.setUint32(9,this.strings.size,!0),this.dv.setUint32(13,this.buffers.size,!0)}serialize(e){return this._writeAll(e),this.buf.slice(0,this.pos)}serializeView(e){return this._writeAll(e),this.buf.subarray(0,this.pos)}deserialize(e){if(this.buffer=e.constructor===Uint8Array?e:new Uint8Array(e),this.view=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.pos=0,this.view.getUint32(0,!0)!==Pe)throw new Error("Invalid TurboSerial data");if(7===(e=this.buffer[4])){var t=this.view.getUint32(5,!0),i=this.view.getUint32(9,!0),s=this.view.getUint32(13,!0);this.deserializeRefs=new Array(t),this.deserializeStrings=new Array(i),this.deserializeBuffers=new Array(s),this._drIdx=0,this._dsIdx=0,this._dbIdx=0,this.pos=17}else{if(6!==e)throw new Error("Unsupported version: "+e);this.deserializeRefs=[],this.deserializeStrings=[],this.deserializeBuffers=[],this._drIdx=-1,this.pos=5}return this.readValue()}resetState(){this.pos=0,this.refs.clear(),this.ancestors=new WeakSet,this.strings.clear(),this.buffers.clear()}resetMemory(e={}){return e=e.shrink?Math.max(this.options.memoryPoolSize||65536,256):this.buf.length,this.buf=new Uint8Array(e),this.dv=new DataView(this.buf.buffer),this.f64=new Float64Array(this.buf.buffer),this.f32=new Float32Array(this.buf.buffer),this.i32=new Int32Array(this.buf.buffer),this.i16=new Int16Array(this.buf.buffer),this.pos=0,this.refs.clear(),this.ancestors=new WeakSet,this.strings.clear(),this.buffers.clear(),this.deserializeRefs&&(this.deserializeRefs.length=0,this.deserializeRefs=null),this.deserializeStrings&&(this.deserializeStrings.length=0,this.deserializeStrings=null),this.deserializeBuffers&&(this.deserializeBuffers.length=0,this.deserializeBuffers=null),this}_wV(e){var t=this.buf;let i=this.pos;if((e>>>=0)<128)t[i]=e,this.pos=i+1;else if(e<16384)t[i]=127&e|128,t[i+1]=e>>>7,this.pos=i+2;else{for(;128<=e;)t[i++]=127&e|128,e>>>=7;t[i++]=e,this.pos=i}}writeValue(e){if(null===e)this._grow(1),this.buf[this.pos++]=0;else if(void 0===e)this._grow(1),this.buf[this.pos++]=1;else{var t=typeof e;if("boolean"==t)this._grow(1),this.buf[this.pos++]=e?3:2;else if("number"==t)this._wNum(e);else if("string"==t)this._wStrDedup(e);else if("bigint"==t)this._wBigInt(e);else if("symbol"==t)this._grow(2),void 0!==(i=Symbol.keyFor(e))?(this.buf[this.pos++]=Ie,this.writeValue(i)):u.has(e)?(this.buf[this.pos++]=ze,this.writeValue(u.get(e))):void 0===e.description?this.buf[this.pos++]=ke:(this.buf[this.pos++]=xe,this.writeValue(e.description));else if("function"==t)this._grow(1),this.buf[this.pos++]=this._allowFn?De:m;else{var i=this.refs.get(e);if(void 0!==i)this._grow(6),this._detectCircular&&this.ancestors.has(e)?this.buf[this.pos++]=Se:this.buf[this.pos++]=Ae,this._wV(i);else{if((this._dedup||this._detectCircular)&&this.refs.set(e,this.refs.size),this._shareBufs&&e.constructor===ArrayBuffer){if(void 0!==(t=this.buffers.get(e)))return this._grow(6),this.buf[this.pos++]=re,void this._wV(t);this.buffers.set(e,this.buffers.size)}this._detectCircular&&this.ancestors.add(e),this._wObj(e),this._detectCircular&&this.ancestors.delete(e)}}}}_wStrDedup(e){if(this._dedup&&3<e.length){var t=this.strings.get(e);if(void 0!==t)return this._grow(6),this.buf[this.pos++]=O,void this._wV(t);this.strings.set(e,this.strings.size)}this._wStr(e)}_wNum(e){this._grow(10);var t,i=this.pos;e!=e?(this.buf[i]=S,this.pos=i+1):e===1/0?(this.buf[i]=x,this.pos=i+1):e===-1/0?(this.buf[i]=I,this.pos=i+1):0===e&&1/e<0?(this.buf[i]=z,this.pos=i+1):e===(t=0|e)?-128<=t&&t<=127?(this.buf[i]=y,this.buf[i+1]=255&t,this.pos=i+2):-32768<=t&&t<=32767?(this.buf[i]=w,this.dv.setInt16(i+1,t,!0),this.pos=i+3):(this.buf[i]=g,this.dv.setInt32(i+1,t,!0),this.pos=i+5):e===(t=e>>>0)?(this.buf[i]=v,this.dv.setUint32(i+1,t,!0),this.pos=i+5):(a[0]=e,a[0]===e?(this.buf[i]=b,this.dv.setFloat32(i+1,e,!0),this.pos=i+5):(this.buf[i]=A,this.dv.setFloat64(i+1,e,!0),this.pos=i+9))}_wBigInt(e){this._grow(10);var t=e<0n,i=t?-e:e;if(i<=0x7fffffffffffffffn)this.buf[this.pos++]=t?C:D,this.dv.setBigInt64(this.pos,e,!0),this.pos+=8;else{this.buf[this.pos++]=t?E:M;let e=i,s=0,r=i;for(;0n<r;)s++,r>>=8n;this._grow(s+5),this._wV(s);for(let t=0;t<s;t++)this.buf[this.pos++]=Number(0xffn&e),e>>=8n}}_wStr(e){var t=e.length;if(0===t)this._grow(1),this.buf[this.pos++]=T;else{if(64<t&&100===e.charCodeAt(0)&&97===e.charCodeAt(1)&&116===e.charCodeAt(2)&&97===e.charCodeAt(3)&&58===e.charCodeAt(4))if(5<(i=e.indexOf(";base64,",5))){var i,s=i=i+8;if(32<=t-i){var r=((e,t,i)=>{var s=i-t;if(0==s||0!=(3&s))return-1;let r=s;61===e.charCodeAt(i-1)&&(r--,61===e.charCodeAt(i-2))&&r--;for(let i=t;i<t+r;i++)if(o[e.charCodeAt(i)]<0)return-1;return(3*(r+(i=s-r))>>2)-i})(e,i,t);if(0<r){this._grow(6+s+5+r),this.buf[this.pos++]=K,this._wV(s);var a=this.pos;for(let t=0;t<s;t++)this.buf[a+t]=e.charCodeAt(t);return this.pos=a+s,this._wV(r),r=((e,t,i,s,r)=>{var a=o,n=i-t;let h=n,l=(61===e.charCodeAt(i-1)&&(h--,61===e.charCodeAt(i-2))&&h--,i=n-h,r),c=t;for(var d=t+(0<i?h-4:h);c<d;c+=4){var _=a[e.charCodeAt(c)]<<18|a[e.charCodeAt(c+1)]<<12|a[e.charCodeAt(c+2)]<<6|a[e.charCodeAt(c+3)];s[l++]=_>>16&255,s[l++]=_>>8&255,s[l++]=255&_}return 2==i?(n=a[e.charCodeAt(c)]<<2|a[e.charCodeAt(c+1)]>>4,s[l++]=255&n):1==i&&(t=a[e.charCodeAt(c)]<<10|a[e.charCodeAt(c+1)]<<4|a[e.charCodeAt(c+2)]>>2,s[l++]=t>>8&255,s[l++]=255&t),l-r})(e,i,t,this.buf,this.pos),void(this.pos+=r)}}}if(t<128){let i=1;for(let s=0;s<t;s++)if(127<e.charCodeAt(s)){i=0;break}if(i){this._grow(t+2);var n=this.pos;this.buf[n++]=t<16?B:V,this.buf[n++]=t;for(let i=0;i<t;i++)this.buf[n+i]=e.charCodeAt(i);return void(this.pos=n+t)}let s=3*t,r=(this._grow(7+s),this.pos+2),a=this.enc.encodeInto(e,this.buf.subarray(r,r+s)).written,o=this.pos;this.buf[o++]=a<16?F:a<256?L:P,a<256?(this.buf[o++]=a,this.pos=r+a):(this.pos=o,this._wV(a),o=this.pos,this.buf.copyWithin(o,r,r+a),this.pos=o+a)}else{let i=3*t;this._grow(i+7);let s=this.pos+6,r=this.enc.encodeInto(e,this.buf.subarray(s,s+i)).written,a=this.pos;r===t?(this.buf[a++]=t<256?V:U,t<256?this.buf[a++]=t:(this.pos=a,this._wV(t),a=this.pos)):(this.buf[a++]=r<256?L:P,r<256?this.buf[a++]=r:(this.pos=a,this._wV(r),a=this.pos)),a!==s&&this.buf.copyWithin(a,s,s+r),this.pos=a+r}}}_wObj(e){if(Array.isArray(e))this._wArr(e);else{var t=e.constructor;if(t===Object)return this._allowFn||this._preserveDescs&&!this._assumePlain?void this._wPlainObj(e):void this._wFastPlainObj(e);if(void 0!==(t=Ee.get(t))){if(t===he)return this._grow(9),void((a=e.getTime())!=a?this.buf[this.pos++]=le:(this.buf[this.pos++]=he,this.dv.setFloat64(this.pos,a,!0),this.pos+=8));if(t===ge)return this._grow(1),this.buf[this.pos++]=ge,this.writeValue(e.source),void this.writeValue(e.flags);if(t===ne){for(var[i,s]of(this._grow(6),this.buf[this.pos++]=ne,this._wV(e.size),e))this.writeValue(i),this.writeValue(s);return}if(t===oe){for(var r of(this._grow(6),this.buf[this.pos++]=oe,this._wV(e.size),e))this.writeValue(r);return}if(t===se||t===ae)return this._grow(6),this.buf[this.pos++]=t,a=new Uint8Array(e),this._wV(a.length),this._grow(a.length),this.buf.set(a,this.pos),void(this.pos+=a.length);if(96==(240&t))return void this._wTypedArr(e,t)}if(e.constructor===Error||e.constructor&&Le.has(e.constructor.name)){this._grow(2);var a=Le.get(e.constructor.name)||we;if(this.buf[this.pos++]=a,this.writeValue(e.message||""),this.writeValue(e.stack||""),a===ye&&e.errors)for(var n of(this._wV(e.errors.length),e.errors))this.writeValue(n)}else"undefined"==typeof Blob||e.constructor!==Blob&&e.constructor!==("undefined"!=typeof File?File:null)?this._wPlainObj(e):(this._grow(12),this.buf[this.pos++]="undefined"!=typeof File&&e.constructor===File?be:ve,this._wV(0),this._wV(0))}}_wArr(e){var t=e.length;if(0===t)this._grow(1),this.buf[this.pos++]=N;else if(Object.keys(e).length!==t){this._grow(12),this.buf[this.pos++]=j,this._wV(t);var i,s=[];for(let i=0;i<t;i++)i in e&&s.push(i);for(i of(this._wV(s.length),s))this._wV(i),this.writeValue(e[i])}else if(!(this._simd&&8<=t&&"number"==typeof e[0]&&this._wPackedArr(e,t))){this._grow(6),this.buf[this.pos++]=$,this._wV(t);for(let i=0;i<t;i++)this.writeValue(e[i])}}_wPackedArr(e,t){let i,s=1,r=e[0],n=e[0],o=1;for(let i=0;i<t;i++){var h=e[i];if("number"!=typeof h)return!1;h!==(0|h)&&(s=0),h<r&&(r=h),h>n&&(n=h),o&&(a[0]=h,a[0]!==h)&&(o=0)}i=s?(l=Math.max(Math.abs(r),Math.abs(n)))<=127?R:l<=32767?q:H:o?G:W;var l=Ce[i]||1;this._grow(6+t*l),this.buf[this.pos++]=i,this._wV(t);let c=this.pos;switch(i){case R:for(let i=0;i<t;i++)this.buf[c++]=255&e[i];break;case q:for(let i=0;i<t;i++)this.dv.setInt16(c,e[i],!0),c+=2;break;case H:for(let i=0;i<t;i++)this.dv.setInt32(c,e[i],!0),c+=4;break;case G:for(let i=0;i<t;i++)this.dv.setFloat32(c,e[i],!0),c+=4;break;case W:for(let i=0;i<t;i++)this.dv.setFloat64(c,e[i],!0),c+=8}return this.pos=c,!0}_wTypedArr(e,t){this._grow(12),this.buf[this.pos++]=t;var i=e.buffer;if(this._shareBufs){var s=this.buffers.get(i);if(void 0!==s)return this.buf[this.pos++]=1,this._wV(s),this._wV(e.byteOffset),void this._wV(e.length);this.buffers.set(i,this.buffers.size)}if(this.buf[this.pos++]=0,this._wV(e.byteOffset),this._wV(e.length),s=Ce[t]||1,t===te||t===ie){this._grow(8*e.length);for(let t=0;t<e.length;t++)this.dv.setBigInt64(this.pos,e[t],!0),this.pos+=8}else t=e.length*s,this._grow(t),s=new Uint8Array(i,e.byteOffset,t),this.buf.set(s,this.pos),this.pos+=t}_wPlainObj(e){var t=Object.getPrototypeOf(e),i=(t=e.constructor===Object||t===Object.prototype||null===t,Object.keys(e));if(0===i.length&&t)this._grow(1),this.buf[this.pos++]=X;else if(t){if(this._preserveDescs){var s;t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];let i=!1;for(s of t){var r=Object.getOwnPropertyDescriptor(e,s);if(r.get||r.set||!r.enumerable||!r.writable||!r.configurable){i=!0;break}}if(i)return void this._wDescriptorObj(e,t)}let n=!1;if(this._allowFn)for(let t=0;t<i.length;t++)if("function"==typeof e[i[t]]){n=!0;break}if(n)this._wMethodObj(e,i);else{this._grow(6),this.buf[this.pos++]=Y,this._sortKeys&&i.sort();let t=i.length;if(!this._serializeFn)for(let s=t=0;s<i.length;s++)"function"!=typeof e[i[s]]&&t++;this._wV(t);for(let t=0;t<i.length;t++){var a=e[i[t]];!this._serializeFn&&"function"==typeof a||(this.writeValue(i[t]),this.writeValue(a))}}}else this._wConstructorObj(e,i)}_wFastPlainObj(e){var t=Object.keys(e),i=t.length;if(0===i)this._grow(1),this.buf[this.pos++]=X;else{this._grow(6),this.buf[this.pos++]=Y,this._sortKeys&&t.sort(),this._wV(i);for(let r=0;r<i;r++){var s=t[r];this.writeValue(s),this.writeValue(e[s])}}}_wDescriptorObj(e,t){this._grow(6),this.buf[this.pos++]=Z;let i=this._serializeFn;var s;t=t.filter(t=>{try{var s=Object.getOwnPropertyDescriptor(e,t);return s&&(i||!s.get&&!s.set&&"function"!=typeof s.value)}catch(t){return!1}});for(s of(this._wV(t.length),t)){this.writeValue(s);var r=Object.getOwnPropertyDescriptor(e,s);let t=0;r.enumerable&&(t|=1),r.writable&&(t|=2),r.configurable&&(t|=4),r.get&&(t|=8),r.set&&(t|=16),this._grow(1),this.buf[this.pos++]=t,r.get||r.set?(r.get&&this.writeValue(r.get),r.set&&this.writeValue(r.set)):this.writeValue(r.value)}}_wMethodObj(e,t){this._grow(6),this.buf[this.pos++]=ee;var i,s=[];for(i of t)try{var r=e[i];s.push([i,r,"function"==typeof r])}catch(e){}this._wV(s.length);var a,n,o,h=this._serializeFn;for([a,n,o]of s)this.writeValue(a),this._grow(1),this.buf[this.pos++]=o?1:0,o&&h?(this.writeValue(n.toString()),this.writeValue(n.name||"")):o?(this._grow(1),this.buf[this.pos++]=De):this.writeValue(n)}_wConstructorObj(e,t){this._grow(6),this.buf[this.pos++]=J,this.writeValue((null==(s=e.constructor)?void 0:s.name)||"");var i,s=this._serializeFn?t:t.filter(t=>{try{return"function"!=typeof e[t]}catch(t){return!1}});for(i of(this._wV(s.length),s))this.writeValue(i),this.writeValue(e[i])}_pushRef(e){0<=this._drIdx?this.deserializeRefs[this._drIdx++]=e:this.deserializeRefs.push(e)}_pushStr(e){0<=this._dsIdx?this.deserializeStrings[this._dsIdx++]=e:this.deserializeStrings.push(e)}_pushBuf(e){0<=this._dbIdx?this.deserializeBuffers[this._dbIdx++]=e:this.deserializeBuffers.push(e)}readValue(){var e=this.buffer[this.pos++];if(e===Ae||e===Se)return this.deserializeRefs[this._rV()];if(e===O)return this.deserializeStrings[this._rV()];if(e===re)return this.deserializeBuffers[this._rV()];var t,i=240&e;if(0==i)return 0===e?null:1===e?void 0:3===e;if(16==i)return this._rNum(e);if(32==i)return this._rBigInt(e);if(48==i)return this._rStr(e);if(64==i||80==i||128==i){let t;return t=64==i?[]:128==i?new(e===ne?Map:Set):{},this._pushRef(t),this._rFill(t,e,i),t}if(96==i)return t=this._rTypedArr(e),this._pushRef(t),t;if(112==i)return t=this._rArrayBuf(e),this._pushBuf(t),t;if(144==i)return e===le?new Date(NaN):(t=this.view.getFloat64(this.pos,!0),this.pos+=8,new Date(t));if(160==i)return this._rError(e);if(176==i)return new RegExp(this.readValue(),this.readValue());if(192==i)return this._rV(),this._rV(),{_type:"Binary"};if(224==i)return this._rSpecial(e);if(240==i)return this._allowFn?function(){throw new Error("Function not serialized")}:void 0;throw new Error("Unknown type: 0x"+e.toString(16))}_rV(){let e=this.pos,t=this.buffer[e++];if(!(128&t))return this.pos=e,t;let i=127&t,s=7;for(;t=this.buffer[e++],i|=(127&t)<<s,s+=7,128&t;);return this.pos=e,i>>>0}_rFill(e,t,i){if(64===i){if(t!==N)if(t===$){var s=this._rV();for(let t=0;t<s;t++)e[t]=this.readValue()}else if(t===j){e.length=this._rV();var r=this._rV();for(let t=0;t<r;t++)e[this._rV()]=this.readValue()}else{var a=this._rPacked(t);for(let t=0;t<a.length;t++)e.push(a[t])}}else if(80===i)this.fillObject(e,t);else if(128===i){var n=this._rV();if(t===ne)for(let t=0;t<n;t++)e.set(this.readValue(),this.readValue());else for(let t=0;t<n;t++)e.add(this.readValue())}}fillObject(e,t){t!==X&&(t===Y||t===Q?this._fillLiteralObj(e):t===Z?this._fillDescriptorObj(e):t===ee?this._fillMethodObj(e):t===J&&this._fillConstructorObj(e))}_fillLiteralObj(e){var t=this._rV();for(let i=0;i<t;i++)e[this.readValue()]=this.readValue()}_fillDescriptorObj(e){var t=this._rV();for(let a=0;a<t;a++){var i=this.readValue(),s=this.buffer[this.pos++],r={enumerable:!!(1&s),writable:!!(2&s),configurable:!!(4&s)};8&s||16&s?(8&s&&(r.get=this.readValue()),16&s&&(r.set=this.readValue())):r.value=this.readValue(),Object.defineProperty(e,i,r)}}_fillMethodObj(e){var t=this._rV();for(let r=0;r<t;r++){var i=this.readValue();if(this.buffer[this.pos++])if(this._allowFn&&this._serializeFn){var s=this.readValue();this.readValue();try{e[i]=new Function("return "+s)()}catch(t){e[i]=void 0}}else this._serializeFn?(this.readValue(),this.readValue(),e[i]=void 0):(this.pos++,e[i]=this._allowFn?function(){throw new Error("Not serialized")}:void 0);else e[i]=this.readValue()}}_fillConstructorObj(e){var t=this.readValue(),i=this._rV();for(let t=0;t<i;t++)e[this.readValue()]=this.readValue();e[Oe]=t}_rNum(e){let t,i=this.pos;switch(e){case y:return t=this.buffer[i]<<24>>24,this.pos=i+1,t;case w:return t=this.view.getInt16(i,!0),this.pos=i+2,t;case g:return t=this.view.getInt32(i,!0),this.pos=i+4,t;case v:return t=this.view.getUint32(i,!0),this.pos=i+4,t;case b:return t=this.view.getFloat32(i,!0),this.pos=i+4,t;case A:return t=this.view.getFloat64(i,!0),this.pos=i+8,t;case S:return NaN;case x:return 1/0;case I:return-1/0;case z:return-0;case k:return t=this._rV(),this.buffer[this.pos++]?-t:t}}_rBigInt(e){if(e===D||e===C){let e=this.view.getBigInt64(this.pos,!0);return this.pos+=8,e}e=e===E;var t=this._rV();let i="";for(let e=t-1;0<=e;e--)i+=this.buffer[this.pos+e].toString(16).padStart(2,"0");this.pos+=t;let s=BigInt("0x"+(i||"0"));return e?-s:s}_rStr(e){if(e===T)return"";var t=this.buffer;if(e===K){let e;e=(i=this._rV())<128?s[i](t,this.pos):this.dec.decode(t.subarray(this.pos,this.pos+i)),this.pos+=i;var i=this._rV(),r=((e,t,i)=>{var s=n,r=i%3,a=i-r,o=4*((i+2)/3|0),h=new Uint8Array(o);let l=0;var c=t+a;for(let i=t;i<c;i+=3){var d=e[i]<<16&16711680|e[i+1]<<8&65280|255&e[i+2];h[l++]=s[d>>18&63],h[l++]=s[d>>12&63],h[l++]=s[d>>6&63],h[l++]=s[63&d]}1==r?(a=e[t+i-1],h[l++]=s[a>>2],h[l++]=s[a<<4&63],h[l++]=61,h[l++]=61):2==r&&(a=e[t+i-2]<<8|e[t+i-1],h[l++]=s[a>>10],h[l++]=s[a>>4&63],h[l++]=s[a<<2&63],h[l++]=61);let _="";for(let e=0;e<o;e+=8192)_+=String.fromCharCode.apply(null,h.subarray(e,Math.min(e+8192,o)));return _})(t,this.pos,i);this.pos+=i;let a=e+r;return 3<a.length&&this._pushStr(a),a}let a,o;return a=e===B||e===V||e===F||e===L?this.buffer[this.pos++]:this._rV(),o=(i=e===B||e===V||e===U)&&a<128?s[a](t,this.pos):this.dec.decode(t.subarray(this.pos,this.pos+a)),this.pos+=a,3<o.length&&this._pushStr(o),o}_rPacked(e){var t=this._rV(),i=new Array(t);let s=this.pos;switch(e){case R:for(let e=0;e<t;e++)i[e]=this.buffer[s++]<<24>>24;break;case q:for(let e=0;e<t;e++)i[e]=this.view.getInt16(s,!0),s+=2;break;case H:for(let e=0;e<t;e++)i[e]=this.view.getInt32(s,!0),s+=4;break;case G:for(let e=0;e<t;e++)i[e]=this.view.getFloat32(s,!0),s+=4;break;case W:for(let e=0;e<t;e++)i[e]=this.view.getFloat64(s,!0),s+=8}return this.pos=s,i}_rTypedArr(e){if(this.buffer[this.pos++]){let t=this._rV(),i=this._rV(),s=this._rV();return new Me[e](this.deserializeBuffers[t],i,s)}this._rV();let t=this._rV(),i=Ce[e]||1;if(e===te||e===ie){var s=[];for(let e=0;e<t;e++)s.push(this.view.getBigInt64(this.pos,!0)),this.pos+=8;return new Me[e](s)}var r=t*i,a=new ArrayBuffer(r);return new Uint8Array(a).set(this.buffer.subarray(this.pos,this.pos+r)),this.pos+=r,this._pushBuf(a),new Me[e](a,0,t)}_rArrayBuf(e){var t=this._rV(),i=this.buffer.buffer.slice(this.buffer.byteOffset+this.pos,this.buffer.byteOffset+this.pos+t);return this.pos+=t,i}_rError(e){var t=this.readValue(),i=this.readValue();let s;if(e===ye){var r=this._rV(),a=[];for(let e=0;e<r;e++)a.push(this.readValue());s=new AggregateError(a,t)}else s=new(Fe[e]||Error)(t);return i&&(s.stack=i),s}_rSpecial(e){if(e===xe)return Symbol(this.readValue());if(e===ke)return Symbol();if(e===Ie)return Symbol.for(this.readValue());if(e===ze)return f.get(this.readValue())||Symbol();throw new Error("Unknown special type: 0x"+e.toString(16))}},Ne=i(0),$e=i.n(Ne);i.d(t,"LacertaDB",(function(){return It})),i.d(t,"Database",(function(){return xt})),i.d(t,"Collection",(function(){return St})),i.d(t,"Document",(function(){return pt})),i.d(t,"MigrationManager",(function(){return bt})),i.d(t,"PerformanceMonitor",(function(){return At})),i.d(t,"LacertaDBError",(function(){return Ge})),i.d(t,"OPFSUtility",(function(){return ct})),i.d(t,"IndexManager",(function(){return lt})),i.d(t,"CacheStrategy",(function(){return Ye})),i.d(t,"LRUCache",(function(){return We})),i.d(t,"LFUCache",(function(){return Xe})),i.d(t,"TTLCache",(function(){return Qe})),i.d(t,"BTreeIndex",(function(){return at})),i.d(t,"TextIndex",(function(){return nt})),i.d(t,"GeoIndex",(function(){return ot})),i.d(t,"HashIndex",(function(){return ht})),i.d(t,"SecureDatabaseEncryption",(function(){return tt})),i.d(t,"QuickStore",(function(){return Re})),i.d(t,"AsyncMutex",(function(){return He})),i.d(t,"IndexedDBConnectionPool",(function(){return qe})),i.d(t,"BrowserCompressionUtility",(function(){return Je})),i.d(t,"BrowserEncryptionUtility",(function(){return et})),
1
+ (e=>{var t={};function i(s){var r;return(t[s]||(r=t[s]={i:s,l:!1,exports:{}},e[s].call(r.exports,r,r.exports,i),r.l=!0,r)).exports}i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(s,r,function(t){return e[t]}.bind(null,r));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)})([function(e,t){var i={},s=new Float32Array(4);function r(e,t){if((0|e)!==e)throw new TypeError("Lane index must be an int32");if(e<0||t<=e)throw new RangeError("Lane index must be in bounds")}new Int32Array(s.buffer),new Int16Array(s.buffer),new Int8Array(s.buffer),new Uint32Array(s.buffer),new Uint16Array(s.buffer),new Uint8Array(s.buffer),void 0!==i.Int8x16&&void 0!==i.Int8x16.extractLane||(i.Int8x16=function(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m){if(!(this instanceof i.Int8x16))return new i.Int8x16(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m);this.s_=new Int8Array([e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m])},i.Int8x16.check=function(e){if(e instanceof i.Int8x16)return e;throw new TypeError("Argument is not a Int8x16.")},i.Int8x16.splat=function(e){return new i.Int8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Int8x16.extractLane=function(e,t){return e=i.Int8x16.check(e),r(t,16),e.s_[t]},i.Int8x16.replaceLane=function(e,t,s){return e=i.Int8x16.check(e),r(t,16),(e=Array.from(e.s_))[t]=s,new i.Int8x16(...e)},i.Int8x16.shuffle=function(e,t,s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g){var v=[s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g],b=[];e=i.Int8x16.check(e),t=i.Int8x16.check(t);for(var A=0;A<16;A++){var S=v[A];r(S,32),b[A]=S<16?e.s_[S]:t.s_[S-16]}return new i.Int8x16(...b)}),void 0!==i.Uint8x16&&void 0!==i.Uint8x16.extractLane||(i.Uint8x16=function(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m){if(!(this instanceof i.Uint8x16))return new i.Uint8x16(e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m);this.s_=new Uint8Array([e,t,s,r,a,n,o,h,l,c,d,_,u,f,p,m])},i.Uint8x16.check=function(e){if(e instanceof i.Uint8x16)return e;throw new TypeError("Argument is not a Uint8x16.")},i.Uint8x16.splat=function(e){return new i.Uint8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Uint8x16.extractLane=function(e,t){return e=i.Uint8x16.check(e),r(t,16),e.s_[t]},i.Uint8x16.load=function(e,t){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return new i.Uint8x16(...e.subarray(t,t+16))},i.Uint8x16.store=function(e,t,i){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return e.set(i.s_,t),i},i.Uint8x16.shuffle=function(e,t,s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g){var v=[s,a,n,o,h,l,c,d,_,u,f,p,m,y,w,g],b=[];e=i.Uint8x16.check(e),t=i.Uint8x16.check(t);for(var A=0;A<16;A++){var S=v[A];r(S,32),b[A]=S<16?e.s_[S]:t.s_[S-16]}return new i.Uint8x16(...b)},i.Uint8x16.and=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]&t.s_[r];return new i.Uint8x16(...s)},i.Uint8x16.or=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]|t.s_[r];return new i.Uint8x16(...s)},i.Uint8x16.shiftLeftByScalar=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]<<t;return new i.Uint8x16(...s)},i.Uint8x16.shiftRightByScalar=function(e,t){for(var s=[],r=0;r<16;++r)s[r]=e.s_[r]>>>t;return new i.Uint8x16(...s)}),e.exports=class{constructor(){this.ENC_SHUFFLE=i.Int8x16(10,11,9,10,7,8,6,7,4,5,3,4,1,2,0,1),this.ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.ENC_LUT_SIMD=[i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0)];for(let t=0;t<4;t++){var e=this.ENC_LUT.substring(16*t,16*(t+1));this.ENC_LUT_SIMD[t]=i.Uint8x16(...Array.from(e).map(e=>e.charCodeAt(0)))}this.DEC_DELTA_ASSO=i.Uint8x16(1,1,1,1,1,1,1,1,0,0,0,0,0,15,0,15),this.DEC_DELTA_VALUES=i.Int8x16(0,0,0,19,4,191,191,185,185,0,16,195,191,191,185,185),this.DEC_SHUFFLE=i.Int8x16(-1,-1,-1,-1,12,13,14,8,9,10,4,5,6,0,1,2),this.SCALAR_ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.SCALAR_DEC_LUT={};for(let e=0;e<this.SCALAR_ENC_LUT.length;e++)this.SCALAR_DEC_LUT[this.SCALAR_ENC_LUT.charAt(e)]=e;this.SCALAR_DEC_LUT["="]=0}_scalar_encode(e){let t="";for(let a=0;a<e.length;a+=3){var i=e[a],s=a+1<e.length?e[a+1]:0,r=a+2<e.length?e[a+2]:0;t+=this.SCALAR_ENC_LUT[i>>2]+this.SCALAR_ENC_LUT[(3&i)<<4|s>>4],a+1<e.length?t+=this.SCALAR_ENC_LUT[(15&s)<<2|r>>6]:t+="=",a+2<e.length?t+=this.SCALAR_ENC_LUT[63&r]:t+="="}return t}encode(e){var t=e.length,i=4*Math.ceil(t/3),s=new Uint8Array(i);let r=0,a=0;for(;r+12<=t;){var n=e.subarray(r,r+12),o=new Uint8Array(16);o[0]=n[0]>>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],o[4]=n[3]>>2,o[5]=(3&n[3])<<4|n[4]>>4,o[6]=(15&n[4])<<2|n[5]>>6,o[7]=63&n[5],o[8]=n[6]>>2,o[9]=(3&n[6])<<4|n[7]>>4,o[10]=(15&n[7])<<2|n[8]>>6,o[11]=63&n[8],o[12]=n[9]>>2,o[13]=(3&n[9])<<4|n[10]>>4,o[14]=(15&n[10])<<2|n[11]>>6,o[15]=63&n[11];for(let e=0;e<16;e++)s[a+e]=this.SCALAR_ENC_LUT.charCodeAt(o[e]);r+=12,a+=16}let h=(new TextDecoder).decode(s.subarray(0,a));return r<t&&(h+=this._scalar_encode(e.subarray(r))),h}_scalar_decode(e){e=e.replace(/=+$/,"");var t=Math.floor(3*e.length/4),i=new Uint8Array(t);let s=0;for(let h=0;h<e.length;h+=4){var r=this.SCALAR_DEC_LUT[e[h]],a=this.SCALAR_DEC_LUT[e[h+1]],n=h+2<e.length?this.SCALAR_DEC_LUT[e[h+2]]:0,o=h+3<e.length?this.SCALAR_DEC_LUT[e[h+3]]:0;i[s++]=r<<2|a>>4,s<t&&(i[s++]=(15&a)<<4|n>>2),s<t&&(i[s++]=(3&n)<<6|o)}return i}decode(e){var t=e.length;if(t%4!=0)throw new Error("Invalid Base64 string length.");var i=(e.match(/=/g)||[]).length,s=new Uint8Array(3*t/4-i);let r=0,a=0;for(var n;r+16<=t-i;){var o=Array.from(e.substring(r,r+16)).map(e=>this.SCALAR_DEC_LUT[e]),h=new Uint8Array(12);h[0]=o[0]<<2|o[1]>>4,h[1]=(15&o[1])<<4|o[2]>>2,h[2]=(3&o[2])<<6|o[3],h[3]=o[4]<<2|o[5]>>4,h[4]=(15&o[5])<<4|o[6]>>2,h[5]=(3&o[6])<<6|o[7],h[6]=o[8]<<2|o[9]>>4,h[7]=(15&o[9])<<4|o[10]>>2,h[8]=(3&o[10])<<6|o[11],h[9]=o[12]<<2|o[13]>>4,h[10]=(15&o[13])<<4|o[14]>>2,h[11]=(3&o[14])<<6|o[15],s.set(h,a),r+=16,a+=12}return r<t&&(n=this._scalar_decode(e.substring(r)),s.set(n,a)),s}}},function(e,t,i){i.r(t);let s=new Array(128);for(let e=0;e<128;e++){var r=[];for(let t=0;t<e;t++)r.push(`b[o+${t}]`);s[e]=new Function("b","o",`return String.fromCharCode(${r.join(",")});`)}let a=new Float32Array(1),n=new Uint8Array(64),o=new Int8Array(256).fill(-1);var h,l,c,d;for(let e=0;e<64;e++){var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(e);n[e]=_,o[_]=e}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;let u=new Map,f=new Map;for(h of["asyncIterator","hasInstance","isConcatSpreadable","iterator","match","matchAll","replace","search","species","split","toPrimitive","toStringTag","unscopables"]){var p=Symbol[h];p&&(u.set(p,h),f.set(h,p))}let m=1,y=16,w=17,g=18,v=19,b=20,A=21,S=22,x=23,I=24,z=25,k=26,D=32,C=33,M=34,E=35,T=48,B=49,V=50,U=51,F=52,L=53,P=54,O=55,K=56,N=64,$=65,j=66,R=67,q=68,H=69,G=70,W=71,X=80,Q=81,Y=82,J=83,Z=84,ee=85,te=105,ie=106,se=112,re=113,ae=114,ne=128,oe=129,he=144,le=145,ce=160,de=161,_e=162,ue=163,fe=164,pe=165,me=166,ye=167,we=168,ge=176,ve=192,be=193,Ae=208,Se=209,xe=224,Ie=225,ze=226,ke=227,De=240,Ce=[],Me=[];for([l,c,d]of[[96,1,"Uint8Array"],[97,1,"Int8Array"],[98,1,"Uint8ClampedArray"],[99,2,"Uint16Array"],[100,2,"Int16Array"],[101,4,"Uint32Array"],[102,4,"Int32Array"],[103,4,"Float32Array"],[104,8,"Float64Array"],[105,8,"BigInt64Array"],[106,8,"BigUint64Array"],[107,1,"DataView"],[67,1,null],[68,2,null],[69,4,null],[70,4,null],[71,8,null]])Ce[l]=c,d&&globalThis[d]&&(Me[l]=globalThis[d]);let Ee=new Map;var Te,Be,Ve=["Uint8Array","Int8Array","Uint8ClampedArray","Uint16Array","Int16Array","Uint32Array","Int32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","DataView"];for([Te,Be]of[[Date,he],[RegExp,ge],[Map,ne],[Set,oe],[ArrayBuffer,se]])Ee.set(Te,Be);for(let e=0;e<Ve.length;e++){var Ue=globalThis[Ve[e]];Ue&&Ee.set(Ue,96+e)}globalThis.SharedArrayBuffer&&Ee.set(SharedArrayBuffer,ae);let Fe={[ce]:Error,[de]:EvalError,[_e]:RangeError,[ue]:ReferenceError,[fe]:SyntaxError,[pe]:TypeError,[me]:URIError},Le=new Map([["Error",ce],["EvalError",de],["RangeError",_e],["ReferenceError",ue],["SyntaxError",fe],["TypeError",pe],["URIError",me],["AggregateError",ye]]),Pe=1413632566,Oe=Symbol.for("__TurboSerial_Ctor");var Ke=class{constructor(e={}){this.options={compression:e.compression||!1,deduplication:!1!==e.deduplication,shareArrayBuffers:!1!==e.shareArrayBuffers,simdOptimization:!1!==e.simdOptimization,detectCircular:!1!==e.detectCircular,allowFunction:e.allowFunction||!1,serializeFunctions:e.serializeFunctions||!1,preservePropertyDescriptors:!1!==e.preservePropertyDescriptors,assumePlainObjects:e.assumePlainObjects||!1,sortKeys:e.sortKeys||!1,memoryPoolSize:e.memoryPoolSize||65536,...e},this.options.allowFunction||(this.options.serializeFunctions=!1),e=this.options,this._dedup=e.deduplication,this._detectCircular=e.detectCircular,this._shareBufs=e.shareArrayBuffers,this._allowFn=e.allowFunction,this._serializeFn=e.serializeFunctions,this._preserveDescs=e.preservePropertyDescriptors,this._assumePlain=e.assumePlainObjects,this._sortKeys=e.sortKeys,this._simd=e.simdOptimization,e=Math.max(this.options.memoryPoolSize,65536),this.buf=new Uint8Array(e),this.dv=new DataView(this.buf.buffer),this.f64=new Float64Array(this.buf.buffer),this.f32=new Float32Array(this.buf.buffer),this.i32=new Int32Array(this.buf.buffer),this.i16=new Int16Array(this.buf.buffer),this.pos=0,this.enc=new TextEncoder,this.dec=new TextDecoder,this.refs=new Map,this.ancestors=new WeakSet,this.strings=new Map,this.buffers=new Map,this.deserializeRefs=null,this.deserializeStrings=null,this.deserializeBuffers=null,this.buffer=null,this.view=null}_grow(e){var t=this.pos+e;if(!(t<=this.buf.length)){let i=this.buf.length;for(;i<t;)i<<=1;(e=new Uint8Array(i)).set(this.buf.subarray(0,this.pos)),this.buf=e,this.dv=new DataView(e.buffer),this.f64=new Float64Array(e.buffer),this.f32=new Float32Array(e.buffer),this.i32=new Int32Array(e.buffer),this.i16=new Int16Array(e.buffer)}}_writeAll(e){this.resetState(),this._grow(17),this.dv.setUint32(0,Pe,!0),this.buf[4]=7,this.pos=17,this.writeValue(e),this.dv.setUint32(5,this.refs.size,!0),this.dv.setUint32(9,this.strings.size,!0),this.dv.setUint32(13,this.buffers.size,!0)}serialize(e){return this._writeAll(e),this.buf.slice(0,this.pos)}serializeView(e){return this._writeAll(e),this.buf.subarray(0,this.pos)}deserialize(e){if(this.buffer=e.constructor===Uint8Array?e:new Uint8Array(e),this.view=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.pos=0,this.view.getUint32(0,!0)!==Pe)throw new Error("Invalid TurboSerial data");if(7===(e=this.buffer[4])){var t=this.view.getUint32(5,!0),i=this.view.getUint32(9,!0),s=this.view.getUint32(13,!0);this.deserializeRefs=new Array(t),this.deserializeStrings=new Array(i),this.deserializeBuffers=new Array(s),this._drIdx=0,this._dsIdx=0,this._dbIdx=0,this.pos=17}else{if(6!==e)throw new Error("Unsupported version: "+e);this.deserializeRefs=[],this.deserializeStrings=[],this.deserializeBuffers=[],this._drIdx=-1,this.pos=5}return this.readValue()}resetState(){this.pos=0,this.refs.clear(),this.ancestors=new WeakSet,this.strings.clear(),this.buffers.clear()}resetMemory(e={}){return e=e.shrink?Math.max(this.options.memoryPoolSize||65536,256):this.buf.length,this.buf=new Uint8Array(e),this.dv=new DataView(this.buf.buffer),this.f64=new Float64Array(this.buf.buffer),this.f32=new Float32Array(this.buf.buffer),this.i32=new Int32Array(this.buf.buffer),this.i16=new Int16Array(this.buf.buffer),this.pos=0,this.refs.clear(),this.ancestors=new WeakSet,this.strings.clear(),this.buffers.clear(),this.deserializeRefs&&(this.deserializeRefs.length=0,this.deserializeRefs=null),this.deserializeStrings&&(this.deserializeStrings.length=0,this.deserializeStrings=null),this.deserializeBuffers&&(this.deserializeBuffers.length=0,this.deserializeBuffers=null),this}_wV(e){var t=this.buf;let i=this.pos;if((e>>>=0)<128)t[i]=e,this.pos=i+1;else if(e<16384)t[i]=127&e|128,t[i+1]=e>>>7,this.pos=i+2;else{for(;128<=e;)t[i++]=127&e|128,e>>>=7;t[i++]=e,this.pos=i}}writeValue(e){if(null===e)this._grow(1),this.buf[this.pos++]=0;else if(void 0===e)this._grow(1),this.buf[this.pos++]=1;else{var t=typeof e;if("boolean"==t)this._grow(1),this.buf[this.pos++]=e?3:2;else if("number"==t)this._wNum(e);else if("string"==t)this._wStrDedup(e);else if("bigint"==t)this._wBigInt(e);else if("symbol"==t)this._grow(2),void 0!==(i=Symbol.keyFor(e))?(this.buf[this.pos++]=Ie,this.writeValue(i)):u.has(e)?(this.buf[this.pos++]=ze,this.writeValue(u.get(e))):void 0===e.description?this.buf[this.pos++]=ke:(this.buf[this.pos++]=xe,this.writeValue(e.description));else if("function"==t)this._grow(1),this.buf[this.pos++]=this._allowFn?De:m;else{var i=this.refs.get(e);if(void 0!==i)this._grow(6),this._detectCircular&&this.ancestors.has(e)?this.buf[this.pos++]=Se:this.buf[this.pos++]=Ae,this._wV(i);else{if((this._dedup||this._detectCircular)&&this.refs.set(e,this.refs.size),this._shareBufs&&e.constructor===ArrayBuffer){if(void 0!==(t=this.buffers.get(e)))return this._grow(6),this.buf[this.pos++]=re,void this._wV(t);this.buffers.set(e,this.buffers.size)}this._detectCircular&&this.ancestors.add(e),this._wObj(e),this._detectCircular&&this.ancestors.delete(e)}}}}_wStrDedup(e){if(this._dedup&&3<e.length){var t=this.strings.get(e);if(void 0!==t)return this._grow(6),this.buf[this.pos++]=O,void this._wV(t);this.strings.set(e,this.strings.size)}this._wStr(e)}_wNum(e){if(0<=e&&e<128&&(0|e)===e&&0<=1/e){this._grow(2);let t=this.pos;this.buf[t]=y,this.buf[t+1]=e,this.pos=t+2}else{this._grow(10);let i=this.pos;var t;e!=e?(this.buf[i]=S,this.pos=i+1):e===1/0?(this.buf[i]=x,this.pos=i+1):e===-1/0?(this.buf[i]=I,this.pos=i+1):0===e&&1/e<0?(this.buf[i]=z,this.pos=i+1):e===(t=0|e)?-128<=t&&t<=127?(this.buf[i]=y,this.buf[i+1]=255&t,this.pos=i+2):-32768<=t&&t<=32767?(this.buf[i]=w,this.dv.setInt16(i+1,t,!0),this.pos=i+3):(this.buf[i]=g,this.dv.setInt32(i+1,t,!0),this.pos=i+5):e===(t=e>>>0)?(this.buf[i]=v,this.dv.setUint32(i+1,t,!0),this.pos=i+5):(a[0]=e,a[0]===e?(this.buf[i]=b,this.dv.setFloat32(i+1,e,!0),this.pos=i+5):(this.buf[i]=A,this.dv.setFloat64(i+1,e,!0),this.pos=i+9))}}_wBigInt(e){this._grow(10);var t=e<0n,i=t?-e:e;if(i<=0x7fffffffffffffffn)this.buf[this.pos++]=t?C:D,this.dv.setBigInt64(this.pos,e,!0),this.pos+=8;else{this.buf[this.pos++]=t?E:M;let e=i,s=0,r=i;for(;0n<r;)s++,r>>=8n;this._grow(s+5),this._wV(s);for(let t=0;t<s;t++)this.buf[this.pos++]=Number(0xffn&e),e>>=8n}}_wStr(e){var t=e.length;if(0===t)this._grow(1),this.buf[this.pos++]=T;else{if(64<t&&100===e.charCodeAt(0)&&97===e.charCodeAt(1)&&116===e.charCodeAt(2)&&97===e.charCodeAt(3)&&58===e.charCodeAt(4))if(5<(i=e.indexOf(";base64,",5))){var i,s=i=i+8;if(32<=t-i){var r=((e,t,i)=>{var s=i-t;if(0==s||0!=(3&s))return-1;let r=s;61===e.charCodeAt(i-1)&&(r--,61===e.charCodeAt(i-2))&&r--;for(let i=t;i<t+r;i++)if(o[e.charCodeAt(i)]<0)return-1;return(3*(r+(i=s-r))>>2)-i})(e,i,t);if(0<r){this._grow(6+s+5+r),this.buf[this.pos++]=K,this._wV(s);var a=this.pos;for(let t=0;t<s;t++)this.buf[a+t]=e.charCodeAt(t);return this.pos=a+s,this._wV(r),r=((e,t,i,s,r)=>{var a=o,n=i-t;let h=n,l=(61===e.charCodeAt(i-1)&&(h--,61===e.charCodeAt(i-2))&&h--,i=n-h,r),c=t;for(var d=t+(0<i?h-4:h);c<d;c+=4){var _=a[e.charCodeAt(c)]<<18|a[e.charCodeAt(c+1)]<<12|a[e.charCodeAt(c+2)]<<6|a[e.charCodeAt(c+3)];s[l++]=_>>16&255,s[l++]=_>>8&255,s[l++]=255&_}return 2==i?(n=a[e.charCodeAt(c)]<<2|a[e.charCodeAt(c+1)]>>4,s[l++]=255&n):1==i&&(t=a[e.charCodeAt(c)]<<10|a[e.charCodeAt(c+1)]<<4|a[e.charCodeAt(c+2)]>>2,s[l++]=t>>8&255,s[l++]=255&t),l-r})(e,i,t,this.buf,this.pos),void(this.pos+=r)}}}if(t<128){let i=1;for(let s=0;s<t;s++)if(127<e.charCodeAt(s)){i=0;break}if(i){this._grow(t+2);var n=this.pos;this.buf[n++]=t<16?B:V,this.buf[n++]=t;for(let i=0;i<t;i++)this.buf[n+i]=e.charCodeAt(i);return void(this.pos=n+t)}let s=3*t,r=(this._grow(7+s),this.pos+2),a=this.enc.encodeInto(e,this.buf.subarray(r,r+s)).written,o=this.pos;this.buf[o++]=a<16?F:a<256?L:P,a<256?(this.buf[o++]=a,this.pos=r+a):(this.pos=o,this._wV(a),o=this.pos,this.buf.copyWithin(o,r,r+a),this.pos=o+a)}else{let i=3*t;this._grow(i+7);let s=this.pos+6,r=this.enc.encodeInto(e,this.buf.subarray(s,s+i)).written,a=this.pos;r===t?(this.buf[a++]=t<256?V:U,t<256?this.buf[a++]=t:(this.pos=a,this._wV(t),a=this.pos)):(this.buf[a++]=r<256?L:P,r<256?this.buf[a++]=r:(this.pos=a,this._wV(r),a=this.pos)),a!==s&&this.buf.copyWithin(a,s,s+r),this.pos=a+r}}}_wObj(e){if(Array.isArray(e))this._wArr(e);else{var t=e.constructor;if(t===Object)return this._allowFn||this._preserveDescs&&!this._assumePlain?void this._wPlainObj(e):void this._wFastPlainObj(e);if(void 0!==(t=Ee.get(t))){if(t===he)return this._grow(9),void((a=e.getTime())!=a?this.buf[this.pos++]=le:(this.buf[this.pos++]=he,this.dv.setFloat64(this.pos,a,!0),this.pos+=8));if(t===ge)return this._grow(1),this.buf[this.pos++]=ge,this.writeValue(e.source),void this.writeValue(e.flags);if(t===ne){for(var[i,s]of(this._grow(6),this.buf[this.pos++]=ne,this._wV(e.size),e))this.writeValue(i),this.writeValue(s);return}if(t===oe){for(var r of(this._grow(6),this.buf[this.pos++]=oe,this._wV(e.size),e))this.writeValue(r);return}if(t===se||t===ae)return this._grow(6),this.buf[this.pos++]=t,a=new Uint8Array(e),this._wV(a.length),this._grow(a.length),this.buf.set(a,this.pos),void(this.pos+=a.length);if(96==(240&t))return void this._wTypedArr(e,t)}if(e.constructor===Error||e.constructor&&Le.has(e.constructor.name)){this._grow(2);var a=Le.get(e.constructor.name)||we;if(this.buf[this.pos++]=a,this.writeValue(e.message||""),this.writeValue(e.stack||""),a===ye&&e.errors)for(var n of(this._wV(e.errors.length),e.errors))this.writeValue(n)}else"undefined"==typeof Blob||e.constructor!==Blob&&e.constructor!==("undefined"!=typeof File?File:null)?this._wPlainObj(e):(this._grow(12),this.buf[this.pos++]="undefined"!=typeof File&&e.constructor===File?be:ve,this._wV(0),this._wV(0))}}_wArr(e){var t=e.length;if(0===t)this._grow(1),this.buf[this.pos++]=N;else if(Object.keys(e).length!==t){this._grow(12),this.buf[this.pos++]=j,this._wV(t);var i,s=[];for(let i=0;i<t;i++)i in e&&s.push(i);for(i of(this._wV(s.length),s))this._wV(i),this.writeValue(e[i])}else if(!(this._simd&&8<=t&&"number"==typeof e[0]&&this._wPackedArr(e,t))){this._grow(6),this.buf[this.pos++]=$,this._wV(t);for(let i=0;i<t;i++)this.writeValue(e[i])}}_wPackedArr(e,t){let i,s=1,r=e[0],n=e[0],o=1;for(let i=0;i<t;i++){var h=e[i];if("number"!=typeof h)return!1;h!==(0|h)&&(s=0),h<r&&(r=h),h>n&&(n=h),o&&(a[0]=h,a[0]!==h)&&(o=0)}i=s?(l=Math.max(Math.abs(r),Math.abs(n)))<=127?R:l<=32767?q:H:o?G:W;var l=Ce[i]||1;this._grow(6+t*l),this.buf[this.pos++]=i,this._wV(t);let c=this.pos;switch(i){case R:for(let i=0;i<t;i++)this.buf[c++]=255&e[i];break;case q:for(let i=0;i<t;i++)this.dv.setInt16(c,e[i],!0),c+=2;break;case H:for(let i=0;i<t;i++)this.dv.setInt32(c,e[i],!0),c+=4;break;case G:for(let i=0;i<t;i++)this.dv.setFloat32(c,e[i],!0),c+=4;break;case W:for(let i=0;i<t;i++)this.dv.setFloat64(c,e[i],!0),c+=8}return this.pos=c,!0}_wTypedArr(e,t){this._grow(12),this.buf[this.pos++]=t;var i=e.buffer;if(this._shareBufs){var s=this.buffers.get(i);if(void 0!==s)return this.buf[this.pos++]=1,this._wV(s),this._wV(e.byteOffset),void this._wV(e.length);this.buffers.set(i,this.buffers.size)}if(this.buf[this.pos++]=0,this._wV(e.byteOffset),this._wV(e.length),s=Ce[t]||1,t===te||t===ie){this._grow(8*e.length);for(let t=0;t<e.length;t++)this.dv.setBigInt64(this.pos,e[t],!0),this.pos+=8}else t=e.length*s,this._grow(t),s=new Uint8Array(i,e.byteOffset,t),this.buf.set(s,this.pos),this.pos+=t}_wPlainObj(e){var t=Object.getPrototypeOf(e),i=(t=e.constructor===Object||t===Object.prototype||null===t,Object.keys(e));if(0===i.length&&t)this._grow(1),this.buf[this.pos++]=X;else if(t){if(this._preserveDescs){var s;t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];let i=!1;for(s of t){var r=Object.getOwnPropertyDescriptor(e,s);if(r.get||r.set||!r.enumerable||!r.writable||!r.configurable){i=!0;break}}if(i)return void this._wDescriptorObj(e,t)}let n=!1;if(this._allowFn)for(let t=0;t<i.length;t++)if("function"==typeof e[i[t]]){n=!0;break}if(n)this._wMethodObj(e,i);else{this._grow(6),this.buf[this.pos++]=Y,this._sortKeys&&i.sort();let t=i.length;if(!this._serializeFn)for(let s=t=0;s<i.length;s++)"function"!=typeof e[i[s]]&&t++;this._wV(t);for(let t=0;t<i.length;t++){var a=e[i[t]];!this._serializeFn&&"function"==typeof a||(this.writeValue(i[t]),this.writeValue(a))}}}else this._wConstructorObj(e,i)}_wFastPlainObj(e){var t=Object.keys(e),i=t.length;if(0===i)this._grow(1),this.buf[this.pos++]=X;else{this._grow(6),this.buf[this.pos++]=Y,this._sortKeys&&t.sort(),this._wV(i);for(let r=0;r<i;r++){var s=t[r];this.writeValue(s),this.writeValue(e[s])}}}_wDescriptorObj(e,t){this._grow(6),this.buf[this.pos++]=Z;let i=this._serializeFn;var s;t=t.filter(t=>{try{var s=Object.getOwnPropertyDescriptor(e,t);return s&&(i||!s.get&&!s.set&&"function"!=typeof s.value)}catch(t){return!1}});for(s of(this._wV(t.length),t)){this.writeValue(s);var r=Object.getOwnPropertyDescriptor(e,s);let t=0;r.enumerable&&(t|=1),r.writable&&(t|=2),r.configurable&&(t|=4),r.get&&(t|=8),r.set&&(t|=16),this._grow(1),this.buf[this.pos++]=t,r.get||r.set?(r.get&&this.writeValue(r.get),r.set&&this.writeValue(r.set)):this.writeValue(r.value)}}_wMethodObj(e,t){this._grow(6),this.buf[this.pos++]=ee;var i,s=[];for(i of t)try{var r=e[i];s.push([i,r,"function"==typeof r])}catch(e){}this._wV(s.length);var a,n,o,h=this._serializeFn;for([a,n,o]of s)this.writeValue(a),this._grow(1),this.buf[this.pos++]=o?1:0,o&&h?(this.writeValue(n.toString()),this.writeValue(n.name||"")):o?(this._grow(1),this.buf[this.pos++]=De):this.writeValue(n)}_wConstructorObj(e,t){this._grow(6),this.buf[this.pos++]=J,this.writeValue((null==(s=e.constructor)?void 0:s.name)||"");var i,s=this._serializeFn?t:t.filter(t=>{try{return"function"!=typeof e[t]}catch(t){return!1}});for(i of(this._wV(s.length),s))this.writeValue(i),this.writeValue(e[i])}_pushRef(e){0<=this._drIdx?this.deserializeRefs[this._drIdx++]=e:this.deserializeRefs.push(e)}_pushStr(e){0<=this._dsIdx?this.deserializeStrings[this._dsIdx++]=e:this.deserializeStrings.push(e)}_pushBuf(e){0<=this._dbIdx?this.deserializeBuffers[this._dbIdx++]=e:this.deserializeBuffers.push(e)}readValue(){var e=this.buffer[this.pos++];if(e===Ae||e===Se)return this.deserializeRefs[this._rV()];if(e===O)return this.deserializeStrings[this._rV()];if(e===re)return this.deserializeBuffers[this._rV()];var t,i=240&e;if(0==i)return 0===e?null:1===e?void 0:3===e;if(16==i)return this._rNum(e);if(32==i)return this._rBigInt(e);if(48==i)return this._rStr(e);if(64==i||80==i||128==i){let t;return t=64==i?[]:128==i?new(e===ne?Map:Set):{},this._pushRef(t),this._rFill(t,e,i),t}if(96==i)return t=this._rTypedArr(e),this._pushRef(t),t;if(112==i)return t=this._rArrayBuf(e),this._pushBuf(t),t;if(144==i)return e===le?new Date(NaN):(t=this.view.getFloat64(this.pos,!0),this.pos+=8,new Date(t));if(160==i)return this._rError(e);if(176==i)return new RegExp(this.readValue(),this.readValue());if(192==i)return this._rV(),this._rV(),{_type:"Binary"};if(224==i)return this._rSpecial(e);if(240==i)return this._allowFn?function(){throw new Error("Function not serialized")}:void 0;throw new Error("Unknown type: 0x"+e.toString(16))}_rV(){let e=this.pos,t=this.buffer[e++];if(!(128&t))return this.pos=e,t;let i=127&t,s=7;for(;t=this.buffer[e++],i|=(127&t)<<s,s+=7,128&t;);return this.pos=e,i>>>0}_rFill(e,t,i){if(64===i){if(t!==N)if(t===$){var s=this._rV();for(let t=0;t<s;t++)e[t]=this.readValue()}else if(t===j){e.length=this._rV();var r=this._rV();for(let t=0;t<r;t++)e[this._rV()]=this.readValue()}else{var a=this._rPacked(t);for(let t=0;t<a.length;t++)e.push(a[t])}}else if(80===i)this.fillObject(e,t);else if(128===i){var n=this._rV();if(t===ne)for(let t=0;t<n;t++)e.set(this.readValue(),this.readValue());else for(let t=0;t<n;t++)e.add(this.readValue())}}fillObject(e,t){t!==X&&(t===Y||t===Q?this._fillLiteralObj(e):t===Z?this._fillDescriptorObj(e):t===ee?this._fillMethodObj(e):t===J&&this._fillConstructorObj(e))}_fillLiteralObj(e){var t=this._rV();for(let i=0;i<t;i++)e[this.readValue()]=this.readValue()}_fillDescriptorObj(e){var t=this._rV();for(let a=0;a<t;a++){var i=this.readValue(),s=this.buffer[this.pos++],r={enumerable:!!(1&s),writable:!!(2&s),configurable:!!(4&s)};8&s||16&s?(8&s&&(r.get=this.readValue()),16&s&&(r.set=this.readValue())):r.value=this.readValue(),Object.defineProperty(e,i,r)}}_fillMethodObj(e){var t=this._rV();for(let r=0;r<t;r++){var i=this.readValue();if(this.buffer[this.pos++])if(this._allowFn&&this._serializeFn){var s=this.readValue();this.readValue();try{e[i]=new Function("return "+s)()}catch(t){e[i]=void 0}}else this._serializeFn?(this.readValue(),this.readValue(),e[i]=void 0):(this.pos++,e[i]=this._allowFn?function(){throw new Error("Not serialized")}:void 0);else e[i]=this.readValue()}}_fillConstructorObj(e){var t=this.readValue(),i=this._rV();for(let t=0;t<i;t++)e[this.readValue()]=this.readValue();e[Oe]=t}_rNum(e){let t,i=this.pos;switch(e){case y:return t=this.buffer[i]<<24>>24,this.pos=i+1,t;case w:return t=this.view.getInt16(i,!0),this.pos=i+2,t;case g:return t=this.view.getInt32(i,!0),this.pos=i+4,t;case v:return t=this.view.getUint32(i,!0),this.pos=i+4,t;case b:return t=this.view.getFloat32(i,!0),this.pos=i+4,t;case A:return t=this.view.getFloat64(i,!0),this.pos=i+8,t;case S:return NaN;case x:return 1/0;case I:return-1/0;case z:return-0;case k:return t=this._rV(),this.buffer[this.pos++]?-t:t}}_rBigInt(e){if(e===D||e===C){let e=this.view.getBigInt64(this.pos,!0);return this.pos+=8,e}e=e===E;var t=this._rV();let i="";for(let e=t-1;0<=e;e--)i+=this.buffer[this.pos+e].toString(16).padStart(2,"0");this.pos+=t;let s=BigInt("0x"+(i||"0"));return e?-s:s}_rStr(e){if(e===T)return"";var t=this.buffer;if(e===K){let e;e=(i=this._rV())<128?s[i](t,this.pos):this.dec.decode(t.subarray(this.pos,this.pos+i)),this.pos+=i;var i=this._rV(),r=((e,t,i)=>{var s=n,r=i%3,a=i-r,o=4*((i+2)/3|0),h=new Uint8Array(o);let l=0;var c=t+a;for(let i=t;i<c;i+=3){var d=e[i]<<16&16711680|e[i+1]<<8&65280|255&e[i+2];h[l++]=s[d>>18&63],h[l++]=s[d>>12&63],h[l++]=s[d>>6&63],h[l++]=s[63&d]}1==r?(a=e[t+i-1],h[l++]=s[a>>2],h[l++]=s[a<<4&63],h[l++]=61,h[l++]=61):2==r&&(a=e[t+i-2]<<8|e[t+i-1],h[l++]=s[a>>10],h[l++]=s[a>>4&63],h[l++]=s[a<<2&63],h[l++]=61);let _="";for(let e=0;e<o;e+=8192)_+=String.fromCharCode.apply(null,h.subarray(e,Math.min(e+8192,o)));return _})(t,this.pos,i);this.pos+=i;let a=e+r;return 3<a.length&&this._pushStr(a),a}let a,o;return a=e===B||e===V||e===F||e===L?this.buffer[this.pos++]:this._rV(),o=(i=e===B||e===V||e===U)&&a<128?s[a](t,this.pos):this.dec.decode(t.subarray(this.pos,this.pos+a)),this.pos+=a,3<o.length&&this._pushStr(o),o}_rPacked(e){var t=this._rV(),i=new Array(t);let s=this.pos;switch(e){case R:for(let e=0;e<t;e++)i[e]=this.buffer[s++]<<24>>24;break;case q:for(let e=0;e<t;e++)i[e]=this.view.getInt16(s,!0),s+=2;break;case H:for(let e=0;e<t;e++)i[e]=this.view.getInt32(s,!0),s+=4;break;case G:for(let e=0;e<t;e++)i[e]=this.view.getFloat32(s,!0),s+=4;break;case W:for(let e=0;e<t;e++)i[e]=this.view.getFloat64(s,!0),s+=8}return this.pos=s,i}_rTypedArr(e){if(this.buffer[this.pos++]){let t=this._rV(),i=this._rV(),s=this._rV();return new Me[e](this.deserializeBuffers[t],i,s)}this._rV();let t=this._rV(),i=Ce[e]||1;if(e===te||e===ie){var s=[];for(let e=0;e<t;e++)s.push(this.view.getBigInt64(this.pos,!0)),this.pos+=8;return new Me[e](s)}var r=t*i,a=new ArrayBuffer(r);return new Uint8Array(a).set(this.buffer.subarray(this.pos,this.pos+r)),this.pos+=r,this._pushBuf(a),new Me[e](a,0,t)}_rArrayBuf(e){var t=this._rV(),i=this.buffer.buffer.slice(this.buffer.byteOffset+this.pos,this.buffer.byteOffset+this.pos+t);return this.pos+=t,i}_rError(e){var t=this.readValue(),i=this.readValue();let s;if(e===ye){var r=this._rV(),a=[];for(let e=0;e<r;e++)a.push(this.readValue());s=new AggregateError(a,t)}else s=new(Fe[e]||Error)(t);return i&&(s.stack=i),s}_rSpecial(e){if(e===xe)return Symbol(this.readValue());if(e===ke)return Symbol();if(e===Ie)return Symbol.for(this.readValue());if(e===ze)return f.get(this.readValue())||Symbol();throw new Error("Unknown special type: 0x"+e.toString(16))}},Ne=i(0),$e=i.n(Ne);i.d(t,"LacertaDB",(function(){return It})),i.d(t,"Database",(function(){return xt})),i.d(t,"Collection",(function(){return St})),i.d(t,"Document",(function(){return pt})),i.d(t,"MigrationManager",(function(){return bt})),i.d(t,"PerformanceMonitor",(function(){return At})),i.d(t,"LacertaDBError",(function(){return Ge})),i.d(t,"OPFSUtility",(function(){return ct})),i.d(t,"IndexManager",(function(){return lt})),i.d(t,"CacheStrategy",(function(){return Ye})),i.d(t,"LRUCache",(function(){return We})),i.d(t,"LFUCache",(function(){return Xe})),i.d(t,"TTLCache",(function(){return Qe})),i.d(t,"BTreeIndex",(function(){return at})),i.d(t,"TextIndex",(function(){return nt})),i.d(t,"GeoIndex",(function(){return ot})),i.d(t,"HashIndex",(function(){return ht})),i.d(t,"SecureDatabaseEncryption",(function(){return tt})),i.d(t,"QuickStore",(function(){return Re})),i.d(t,"AsyncMutex",(function(){return He})),i.d(t,"IndexedDBConnectionPool",(function(){return qe})),i.d(t,"BrowserCompressionUtility",(function(){return Je})),i.d(t,"BrowserEncryptionUtility",(function(){return et})),
2
2
  /**
3
3
  * LacertaDB V0.13.0 - Production Library
4
4
  * @module LacertaDB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixagram/lacerta-db",
3
- "version": "0.13.4",
3
+ "version": "0.13.5",
4
4
  "description": "LacertaDB is a JS Database for Web Browsers. Up to 10x faster than others. Simple, Fast, Secure.",
5
5
  "devDependencies": {
6
6
  "@babel/core": "^7.23.6",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@pixagram/turbobase64": "~0.0.2",
19
- "@pixagram/turboserial": "~0.3.4"
19
+ "@pixagram/turboserial": "~0.3.5"
20
20
  },
21
21
  "build": {},
22
22
  "author": "Affolter Matias",