Comparing version 1.10.0 to 1.10.1
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msgpackr={})}(this,(function(e){"use strict";var t,r,n;try{t=new TextDecoder}catch(e){}var i,s,o,u,a,l=0,c={},f=0,h=0,g=[],p={useRecords:!1,mapsAsObjects:!0};class d{}const y=new d;y.name="MessagePack 0xC1";var w,b=!1,m=2;try{new w("")}catch(e){m=1/0}class S{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.sequential&&!1!==e.trusted&&(e.trusted=!0,e.structures||0==e.useRecords||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(r)return K((()=>(Z(),this?this.unpack(e,t):S.prototype.unpack.call(p,e,t))));e.buffer||e.constructor!==ArrayBuffer||(e="undefined"!=typeof Buffer?Buffer.from(e):new Uint8Array(e)),"object"==typeof t?(n=t.end||e.length,l=t.start||0):(l=0,n=t>-1?t:e.length),h=0,s=null,o=null,r=e;try{a=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(t){if(r=null,e instanceof Uint8Array)throw t;throw new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof S){if(c=this,this.structures)return i=this.structures,U(t);(!i||i.length>0)&&(i=[])}else c=p,(!i||i.length>0)&&(i=[]);return U(t)}unpackMultiple(e,t){let r,n=0;try{b=!0;let i=e.length,s=this?this.unpack(e,i):Q.unpack(e,i);if(!t){for(r=[s];l<i;)n=l,r.push(U());return r}if(!1===t(s,n,l))return;for(;l<i;)if(n=l,!1===t(U(),n,l))return}catch(e){throw e.lastPosition=n,e.values=r,e}finally{b=!1,Z()}}_mergeStructures(e,t){e=e||[],Object.isFrozen(e)&&(e=e.map((e=>e.slice(0))));for(let t=0,r=e.length;t<r;t++){let r=e[t];r&&(r.isShared=!0,t>=32&&(r.highByte=t-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],i=t[r];i&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function U(e){try{if(!c.trusted&&!b){let e=i.sharedLength||0;e<i.length&&(i.length=e)}let e;if(c.randomAccessStructure&&r[l]<64&&r[l],e=I(),o&&(l=o.postBundlePosition,o=null),b&&(i.restoreStructures=null),l==n)i&&i.restoreStructures&&A(),i=null,r=null,u&&(u=null);else{if(l>n)throw new Error("Unexpected end of MessagePack data");if(!b){let t;try{t=JSON.stringify(e,((e,t)=>"bigint"==typeof t?`${t}n`:t)).slice(0,100)}catch(e){t="(JSON view not available "+e+")"}throw new Error("Data read, but end of buffer not reached "+t)}}return e}catch(e){throw i&&i.restoreStructures&&A(),Z(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||l>n)&&(e.incomplete=!0),e}}function A(){for(let e in i.restoreStructures)i[e]=i.restoreStructures[e];i.restoreStructures=null}function I(){let e=r[l++];if(e<160){if(e<128){if(e<64)return e;{let t=i[63&e]||c.getStructures&&O()[63&e];return t?(t.read||(t.read=E(t,63&e)),t.read()):e}}if(e<144){if(e-=128,c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=z();"__proto__"===e&&(e="__proto_"),t[e]=I()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(I(),I());return t}}{e-=144;let t=new Array(e);for(let r=0;r<e;r++)t[r]=I();return c.freezeData?Object.freeze(t):t}}if(e<192){let t=e-160;if(h>=l)return s.slice(l-f,(l+=t)-f);if(0==h&&n<140){let e=t<16?R(t):L(t);if(null!=e)return e}return B(t)}{let t;switch(e){case 192:return null;case 193:return o?(t=I(),t>0?o[1].slice(o.position1,o.position1+=t):o[0].slice(o.position0,o.position0-=t)):y;case 194:return!1;case 195:return!0;case 196:if(t=r[l++],void 0===t)throw new Error("Unexpected end of buffer");return V(t);case 197:return t=a.getUint16(l),l+=2,V(t);case 198:return t=a.getUint32(l),l+=4,V(t);case 199:return P(r[l++]);case 200:return t=a.getUint16(l),l+=2,P(t);case 201:return t=a.getUint32(l),l+=4,P(t);case 202:if(t=a.getFloat32(l),c.useFloat32>2){let e=G[(127&r[l])<<1|r[l+1]>>7];return l+=4,(e*t+(t>0?.5:-.5)>>0)/e}return l+=4,t;case 203:return t=a.getFloat64(l),l+=8,t;case 204:return r[l++];case 205:return t=a.getUint16(l),l+=2,t;case 206:return t=a.getUint32(l),l+=4,t;case 207:return"number"===c.int64AsType?(t=4294967296*a.getUint32(l),t+=a.getUint32(l+4)):"string"===c.int64AsType?t=a.getBigUint64(l).toString():"auto"===c.int64AsType?(t=a.getBigUint64(l),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=a.getBigUint64(l),l+=8,t;case 208:return a.getInt8(l++);case 209:return t=a.getInt16(l),l+=2,t;case 210:return t=a.getInt32(l),l+=4,t;case 211:return"number"===c.int64AsType?(t=4294967296*a.getInt32(l),t+=a.getUint32(l+4)):"string"===c.int64AsType?t=a.getBigInt64(l).toString():"auto"===c.int64AsType?(t=a.getBigInt64(l),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=a.getBigInt64(l),l+=8,t;case 212:if(t=r[l++],114==t)return W(63&r[l++]);{let e=g[t];if(e)return e.read?(l++,e.read(I())):e.noBuffer?(l++,e()):e(r.subarray(l,++l));throw new Error("Unknown extension "+t)}case 213:return t=r[l],114==t?(l++,W(63&r[l++],r[l++])):P(2);case 214:return P(4);case 215:return P(8);case 216:return P(16);case 217:return t=r[l++],h>=l?s.slice(l-f,(l+=t)-f):_(t);case 218:return t=a.getUint16(l),h>=(l+=2)?s.slice(l-f,(l+=t)-f):x(t);case 219:return t=a.getUint32(l),h>=(l+=4)?s.slice(l-f,(l+=t)-f):T(t);case 220:return t=a.getUint16(l),l+=2,M(t);case 221:return t=a.getUint32(l),l+=4,M(t);case 222:return t=a.getUint16(l),l+=2,D(t);case 223:return t=a.getUint32(l),l+=4,D(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}const k=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function E(e,t){function r(){if(r.count++>m){let r=e.read=new w("r","return function(){return "+(c.freezeData?"Object.freeze":"")+"({"+e.map((e=>"__proto__"===e?"__proto_:r()":k.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"})}")(I);return 0===e.highByte&&(e.read=v(t,e.read)),r()}let n={};for(let t=0,r=e.length;t<r;t++){let r=e[t];"__proto__"===r&&(r="__proto_"),n[r]=I()}return c.freezeData?Object.freeze(n):n}return r.count=0,0===e.highByte?v(t,r):r}const v=(e,t)=>function(){let n=r[l++];if(0===n)return t();let s=e<32?-(e+(n<<5)):e+(n<<5),o=i[s]||O()[s];if(!o)throw new Error("Record id is not defined for "+s);return o.read||(o.read=E(o,e)),o.read()};function O(){let e=K((()=>(r=null,c.getStructures())));return i=c._mergeStructures(e,i)}var B=j,_=j,x=j,T=j;function j(e){let n;if(e<16&&(n=R(e)))return n;if(e>64&&t)return t.decode(r.subarray(l,l+=e));const i=l+e,s=[];for(n="";l<i;){const e=r[l++];if(0==(128&e))s.push(e);else if(192==(224&e)){const t=63&r[l++];s.push((31&e)<<6|t)}else if(224==(240&e)){const t=63&r[l++],n=63&r[l++];s.push((31&e)<<12|t<<6|n)}else if(240==(248&e)){let t=(7&e)<<18|(63&r[l++])<<12|(63&r[l++])<<6|63&r[l++];t>65535&&(t-=65536,s.push(t>>>10&1023|55296),t=56320|1023&t),s.push(t)}else s.push(e);s.length>=4096&&(n+=N.apply(String,s),s.length=0)}return s.length>0&&(n+=N.apply(String,s)),n}function M(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=I();return c.freezeData?Object.freeze(t):t}function D(e){if(c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=z();"__proto__"===e&&(e="__proto_"),t[e]=I()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(I(),I());return t}}var N=String.fromCharCode;function L(e){let t=l,n=new Array(e);for(let i=0;i<e;i++){const e=r[l++];if((128&e)>0)return void(l=t);n[i]=e}return N.apply(String,n)}function R(e){if(e<4){if(e<2){if(0===e)return"";{let e=r[l++];return(128&e)>1?void(l-=1):N(e)}}{let t=r[l++],n=r[l++];if((128&t)>0||(128&n)>0)return void(l-=2);if(e<3)return N(t,n);let i=r[l++];return(128&i)>0?void(l-=3):N(t,n,i)}}{let t=r[l++],n=r[l++],i=r[l++],s=r[l++];if((128&t)>0||(128&n)>0||(128&i)>0||(128&s)>0)return void(l-=4);if(e<6){if(4===e)return N(t,n,i,s);{let e=r[l++];return(128&e)>0?void(l-=5):N(t,n,i,s,e)}}if(e<8){let o=r[l++],u=r[l++];if((128&o)>0||(128&u)>0)return void(l-=6);if(e<7)return N(t,n,i,s,o,u);let a=r[l++];return(128&a)>0?void(l-=7):N(t,n,i,s,o,u,a)}{let o=r[l++],u=r[l++],a=r[l++],c=r[l++];if((128&o)>0||(128&u)>0||(128&a)>0||(128&c)>0)return void(l-=8);if(e<10){if(8===e)return N(t,n,i,s,o,u,a,c);{let e=r[l++];return(128&e)>0?void(l-=9):N(t,n,i,s,o,u,a,c,e)}}if(e<12){let f=r[l++],h=r[l++];if((128&f)>0||(128&h)>0)return void(l-=10);if(e<11)return N(t,n,i,s,o,u,a,c,f,h);let g=r[l++];return(128&g)>0?void(l-=11):N(t,n,i,s,o,u,a,c,f,h,g)}{let f=r[l++],h=r[l++],g=r[l++],p=r[l++];if((128&f)>0||(128&h)>0||(128&g)>0||(128&p)>0)return void(l-=12);if(e<14){if(12===e)return N(t,n,i,s,o,u,a,c,f,h,g,p);{let e=r[l++];return(128&e)>0?void(l-=13):N(t,n,i,s,o,u,a,c,f,h,g,p,e)}}{let d=r[l++],y=r[l++];if((128&d)>0||(128&y)>0)return void(l-=14);if(e<15)return N(t,n,i,s,o,u,a,c,f,h,g,p,d,y);let w=r[l++];return(128&w)>0?void(l-=15):N(t,n,i,s,o,u,a,c,f,h,g,p,d,y,w)}}}}}function F(){let e,t=r[l++];if(t<192)e=t-160;else switch(t){case 217:e=r[l++];break;case 218:e=a.getUint16(l),l+=2;break;case 219:e=a.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return j(e)}function V(e){return c.copyBuffers?Uint8Array.prototype.slice.call(r,l,l+=e):r.subarray(l,l+=e)}function P(e){let t=r[l++];if(g[t]){let n;return g[t](r.subarray(l,n=l+=e),(e=>{l=e;try{return I()}finally{l=n}}))}throw new Error("Unknown extension type "+t)}var C=new Array(4096);function z(){let e=r[l++];if(!(e>=160&&e<192))return l--,I().toString();if(e-=160,h>=l)return s.slice(l-f,(l+=e)-f);if(!(0==h&&n<180))return B(e);let t,i=4095&(e<<5^(e>1?a.getUint16(l):e>0?r[l]:0)),o=C[i],u=l,c=l+e-3,g=0;if(o&&o.bytes==e){for(;u<c;){if(t=a.getUint32(u),t!=o[g++]){u=1879048192;break}u+=4}for(c+=3;u<c;)if(t=r[u++],t!=o[g++]){u=1879048192;break}if(u===c)return l=u,o.string;c-=3,u=l}for(o=[],C[i]=o,o.bytes=e;u<c;)t=a.getUint32(u),o.push(t),u+=4;for(c+=3;u<c;)t=r[u++],o.push(t);let p=e<16?R(e):L(e);return o.string=null!=p?p:B(e)}const W=(e,t)=>{let r=I().map((e=>e.toString())),n=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,r.highByte=t);let s=i[e];return s&&(s.isShared||b)&&((i.restoreStructures||(i.restoreStructures=[]))[e]=s),i[e]=r,r.read=E(r,n),r.read()};g[0]=()=>{},g[0].noBuffer=!0,g[66]=e=>{let t=e.length,r=BigInt(128&e[0]?e[0]-256:e[0]);for(let n=1;n<t;n++)r<<=8n,r+=BigInt(e[n]);return r};let J={Error:Error,TypeError:TypeError,ReferenceError:ReferenceError};g[101]=()=>{let e=I();return(J[e[0]]||Error)(e[1])},g[105]=e=>{let t=a.getUint32(l-4);u||(u=new Map);let n,i=r[l];n=i>=144&&i<160||220==i||221==i?[]:{};let s={target:n};u.set(t,s);let o=I();return s.used?Object.assign(n,o):(s.target=o,o)},g[112]=e=>{let t=a.getUint32(l-4),r=u.get(t);return r.used=!0,r.target},g[115]=()=>new Set(I());const $=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));let Y="object"==typeof globalThis?globalThis:window;g[116]=e=>{let t=e[0],r=$[t];if(!r)throw new Error("Could not find typed array for code "+t);return new Y[r](Uint8Array.prototype.slice.call(e,1).buffer)},g[120]=()=>{let e=I();return new RegExp(e[0],e[1])};const q=[];function K(e){let t=n,g=l,p=f,d=h,y=s,w=u,m=o,S=new Uint8Array(r.slice(0,n)),U=i,A=i.slice(0,i.length),I=c,k=b,E=e();return n=t,l=g,f=p,h=d,s=y,u=w,o=m,r=S,b=k,(i=U).splice(0,i.length,...A),c=I,a=new DataView(r.buffer,r.byteOffset,r.byteLength),E}function Z(){r=null,u=null,i=null}g[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],r=l;return l+=t-e.length,o=q,(o=[F(),F()]).position0=0,o.position1=0,o.postBundlePosition=l,l=r,I()},g[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");const G=new Array(147);for(let e=0;e<256;e++)G[e]=+("1e"+Math.floor(45.15-.30103*e));const H=S;var Q=new S({useRecords:!1});const X=Q.unpack,ee=Q.unpackMultiple,te=Q.unpack,re={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let ne,ie,se,oe=new Float32Array(1),ue=new Uint8Array(oe.buffer,0,4);try{ne=new TextEncoder}catch(e){}const ae="undefined"!=typeof Buffer,le=ae?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,ce=ae?Buffer:Uint8Array,fe=ae?4294967296:2144337920;let he,ge,pe,de,ye=0,we=null;const be=/[\u0080-\uFFFF]/,me=Symbol("record-id");class Se extends S{constructor(e){let t,r,n,i;super(e),this.offset=0;let s=ce.prototype.utf8Write?function(e,t){return he.utf8Write(e,t,4294967295)}:!(!ne||!ne.encodeInto)&&function(e,t){return ne.encodeInto(e,he.subarray(t)).written},o=this;e||(e={});let u=e&&e.sequential,a=e.structures||e.saveStructures,l=e.maxSharedStructures;if(null==l&&(l=a?32:0),l>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&null==e.moreTypes&&(this.moreTypes=!0);let c=e.maxOwnStructures;null==c&&(c=a?32:64),this.structures||0==e.useRecords||(this.structures=[]);let f=l>32||c+l>64,h=l+64,g=l+c+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],d=0,y=0;this.pack=this.encode=function(e,s){if(he||(he=new le(8192),pe=he.dataView||(he.dataView=new DataView(he.buffer,0,8192)),ye=0),de=he.length-10,de-ye<2048?(he=new le(he.length),pe=he.dataView||(he.dataView=new DataView(he.buffer,0,he.length)),de=he.length-10,ye=0):ye=ye+7&2147483640,t=ye,s&Ne&&(ye+=255&s),i=o.structuredClone?new Map:null,o.bundleStrings&&"string"!=typeof e?(we=[],we.size=1/0):we=null,n=o.structures,n){n.uninitialized&&(n=o._mergeStructures(o.getStructures()));let e=n.sharedLength||0;if(e>l)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let t=0,n=e.length;t<n;t++){let n=e[t];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[me]=t+64}this.lastNamedStructuresLength=e}u||(n.nextId=e+64)}let a;r&&(r=!1);try{o.randomAccessStructure&&e&&e.constructor&&e.constructor===Object?O(e):m(e);let u=we;if(we&&ke(t,m,0),i&&i.idsToInsert){let e=i.idsToInsert.sort(((e,t)=>e.offset>t.offset?1:-1)),r=e.length,n=-1;for(;u&&r>0;){let i=e[--r].offset+t;i<u.stringsPosition+t&&-1===n&&(n=0),i>u.position+t?n>=0&&(n+=6):(n>=0&&(pe.setUint32(u.position+t,pe.getUint32(u.position+t)+n),n=-1),u=u.previous,r++)}n>=0&&u&&pe.setUint32(u.position+t,pe.getUint32(u.position+t)+n),ye+=6*e.length,ye>de&&k(ye),o.offset=ye;let s=function(e,t){let r,n=6*t.length,i=e.length-n;for(;r=t.pop();){let t=r.offset,s=r.id;e.copyWithin(t+n,t,i),n-=6;let o=t+n;e[o++]=214,e[o++]=105,e[o++]=s>>24,e[o++]=s>>16&255,e[o++]=s>>8&255,e[o++]=255&s,i=t}return e}(he.subarray(t,ye),e);return i=null,s}return o.offset=ye,s&Me?(he.start=t,he.end=ye,he):he.subarray(t,ye)}catch(e){throw a=e,e}finally{if(n&&(w(),r&&o.saveStructures)){let r=n.sharedLength||0,i=he.subarray(t,ye),u=function(e,t){return e.isCompatible=e=>{let r=!e||(t.lastNamedStructuresLength||0)===e.length;return r||t._mergeStructures(e),r},e}(n,o);if(!a)return!1===o.saveStructures(u,u.isCompatible)?o.pack(e,s):(o.lastNamedStructuresLength=r,i)}s&De&&(ye=t)}};const w=()=>{y<10&&y++;let e=n.sharedLength||0;if(n.length>e&&!u&&(n.length=e),d>1e4)n.transitions=null,y=0,d=0,p.length>0&&(p=[]);else if(p.length>0&&!u){for(let e=0,t=p.length;e<t;e++)p[e][me]=0;p=[]}},b=e=>{var t=e.length;t<16?he[ye++]=144|t:t<65536?(he[ye++]=220,he[ye++]=t>>8,he[ye++]=255&t):(he[ye++]=221,pe.setUint32(ye,t),ye+=4);for(let r=0;r<t;r++)m(e[r])},m=e=>{ye>de&&(he=k(ye));var r,n=typeof e;if("string"===n){let n,i=e.length;if(we&&i>=4&&i<4096){if((we.size+=i)>21760){let e,r,n=(we[0]?3*we[0].length+we[1].length:0)+10;ye+n>de&&(he=k(ye+n)),we.position?(r=we,he[ye]=200,ye+=3,he[ye++]=98,e=ye-t,ye+=4,ke(t,m,0),pe.setUint16(e+t-3,ye-t-e)):(he[ye++]=214,he[ye++]=98,e=ye-t,ye+=4),we=["",""],we.previous=r,we.size=0,we.position=e}let r=be.test(e);return we[r?0:1]+=e,he[ye++]=193,void m(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let o=3*i;if(ye+o>de&&(he=k(ye+o)),i<64||!s){let t,s,o,u=ye+n;for(t=0;t<i;t++)s=e.charCodeAt(t),s<128?he[u++]=s:s<2048?(he[u++]=s>>6|192,he[u++]=63&s|128):55296==(64512&s)&&56320==(64512&(o=e.charCodeAt(t+1)))?(s=65536+((1023&s)<<10)+(1023&o),t++,he[u++]=s>>18|240,he[u++]=s>>12&63|128,he[u++]=s>>6&63|128,he[u++]=63&s|128):(he[u++]=s>>12|224,he[u++]=s>>6&63|128,he[u++]=63&s|128);r=u-ye-n}else r=s(e,ye+n);r<32?he[ye++]=160|r:r<256?(n<2&&he.copyWithin(ye+2,ye+1,ye+1+r),he[ye++]=217,he[ye++]=r):r<65536?(n<3&&he.copyWithin(ye+3,ye+2,ye+2+r),he[ye++]=218,he[ye++]=r>>8,he[ye++]=255&r):(n<5&&he.copyWithin(ye+5,ye+3,ye+3+r),he[ye++]=219,pe.setUint32(ye,r),ye+=4),ye+=r}else if("number"===n)if(e>>>0===e)e<32||e<128&&!1===this.useRecords||e<64&&!this.randomAccessStructure?he[ye++]=e:e<256?(he[ye++]=204,he[ye++]=e):e<65536?(he[ye++]=205,he[ye++]=e>>8,he[ye++]=255&e):(he[ye++]=206,pe.setUint32(ye,e),ye+=4);else if(e>>0===e)e>=-32?he[ye++]=256+e:e>=-128?(he[ye++]=208,he[ye++]=e+256):e>=-32768?(he[ye++]=209,pe.setInt16(ye,e),ye+=2):(he[ye++]=210,pe.setInt32(ye,e),ye+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let r;if(he[ye++]=202,pe.setFloat32(ye,e),t<4||(r=e*G[(127&he[ye])<<1|he[ye+1]>>7])>>0===r)return void(ye+=4);ye--}he[ye++]=203,pe.setFloat64(ye,e),ye+=8}else if("object"===n||"function"===n)if(e){if(i){let r=i.get(e);if(r){if(!r.id){let e=i.idsToInsert||(i.idsToInsert=[]);r.id=e.push(r)}return he[ye++]=214,he[ye++]=112,pe.setUint32(ye,r.id),void(ye+=4)}i.set(e,{offset:ye-t})}let s=e.constructor;if(s===Object)I(e,!0);else if(s===Array)b(e);else if(s===Map)if(this.mapAsEmptyObject)he[ye++]=128;else{(r=e.size)<16?he[ye++]=128|r:r<65536?(he[ye++]=222,he[ye++]=r>>8,he[ye++]=255&r):(he[ye++]=223,pe.setUint32(ye,r),ye+=4);for(let[t,r]of e)m(t),m(r)}else{for(let t=0,r=ie.length;t<r;t++){if(e instanceof se[t]){let r=ie[t];if(r.write){r.type&&(he[ye++]=212,he[ye++]=r.type,he[ye++]=0);let t=r.write.call(this,e);return void(t===e?Array.isArray(e)?b(e):I(e):m(t))}let n,i=he,s=pe,o=ye;he=null;try{n=r.pack.call(this,e,(e=>(he=i,i=null,ye+=e,ye>de&&k(ye),{target:he,targetView:pe,position:ye-e})),m)}finally{i&&(he=i,pe=s,ye=o,de=he.length-10)}return void(n&&(n.length+ye>de&&k(n.length+ye),ye=Ie(n,he,ye,r.type)))}}if(Array.isArray(e))b(e);else{if(e.toJSON){const t=e.toJSON();if(t!==e)return m(t)}if("function"===n)return m(this.writeFunction&&this.writeFunction(e));I(e,!e.hasOwnProperty)}}}else he[ye++]=192;else if("boolean"===n)he[ye++]=e?195:194;else if("bigint"===n){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))he[ye++]=211,pe.setBigInt64(ye,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)he[ye++]=207,pe.setBigUint64(ye,e);else{if(!this.largeBigIntToFloat){if(this.useBigIntExtension&&e<2n**1023n&&e>-(2n**1023n)){he[ye++]=199,ye++,he[ye++]=66;let t,r=[];do{let n=0xffn&e;t=(0x80n&n)===(e<0n?0x80n:0n),r.push(n),e>>=8n}while(0n!==e&&-1n!==e||!t);he[ye-2]=r.length;for(let e=r.length;e>0;)he[ye++]=Number(r[--e]);return}throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension or set largeBigIntToFloat to convert to float-64")}he[ye++]=203,pe.setFloat64(ye,Number(e))}ye+=8}else{if("undefined"!==n)throw new Error("Unknown type: "+n);this.encodeUndefinedAsNil?he[ye++]=192:(he[ye++]=212,he[ye++]=0,he[ye++]=0)}},S=this.variableMapSize||this.coercibleKeyAsNumber?e=>{let t,r=Object.keys(e),n=r.length;if(n<16?he[ye++]=128|n:n<65536?(he[ye++]=222,he[ye++]=n>>8,he[ye++]=255&n):(he[ye++]=223,pe.setUint32(ye,n),ye+=4),this.coercibleKeyAsNumber)for(let i=0;i<n;i++){t=r[i];let n=Number(t);m(isNaN(n)?t:n),m(e[t])}else for(let i=0;i<n;i++)m(t=r[i]),m(e[t])}:(e,r)=>{he[ye++]=222;let n=ye-t;ye+=2;let i=0;for(let t in e)(r||e.hasOwnProperty(t))&&(m(t),m(e[t]),i++);he[n+++t]=i>>8,he[n+t]=255&i},U=!1===this.useRecords?S:e.progressiveRecords&&!f?(e,r)=>{let i,s,o=n.transitions||(n.transitions=Object.create(null)),u=ye++-t;for(let a in e)if(r||e.hasOwnProperty(a)){if(i=o[a],i)o=i;else{let r=Object.keys(e),l=o;o=n.transitions;let c=0;for(let e=0,t=r.length;e<t;e++){let t=r[e];i=o[t],i||(i=o[t]=Object.create(null),c++),o=i}u+t+1==ye?(ye--,E(o,r,c)):v(o,r,u,c),s=!0,o=l[a]}m(e[a])}if(!s){let r=o[me];r?he[u+t]=r:v(o,Object.keys(e),u,0)}}:(e,t)=>{let r,i=n.transitions||(n.transitions=Object.create(null)),s=0;for(let n in e)(t||e.hasOwnProperty(n))&&(r=i[n],r||(r=i[n]=Object.create(null),s++),i=r);let o=i[me];o?o>=96&&f?(he[ye++]=96+(31&(o-=96)),he[ye++]=o>>5):he[ye++]=o:E(i,i.__keys__||Object.keys(e),s);for(let r in e)(t||e.hasOwnProperty(r))&&m(e[r])},A="function"==typeof this.useRecords&&this.useRecords,I=A?(e,t)=>{A(e)?U(e,t):S(e,t)}:U,k=e=>{let r;if(e>16777216){if(e-t>fe)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(fe,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(e-t<<2,he.length-1)>>12)<<12;let n=new le(r);return pe=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),e=Math.min(e,he.length),he.copy?he.copy(n,0,t,e):n.set(he.slice(t,e)),ye-=t,t=0,de=n.length-10,he=n},E=(e,t,i)=>{let s=n.nextId;s||(s=64),s<h&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(s=n.nextOwnId,s<g||(s=h),n.nextOwnId=s+1):(s>=g&&(s=h),n.nextId=s+1);let o=t.highByte=s>=96&&f?s-96>>5:-1;e[me]=s,e.__keys__=t,n[s-64]=t,s<h?(t.isShared=!0,n.sharedLength=s-63,r=!0,o>=0?(he[ye++]=96+(31&s),he[ye++]=o):he[ye++]=s):(o>=0?(he[ye++]=213,he[ye++]=114,he[ye++]=96+(31&s),he[ye++]=o):(he[ye++]=212,he[ye++]=114,he[ye++]=s),i&&(d+=y*i),p.length>=c&&(p.shift()[me]=0),p.push(e),m(t))},v=(e,r,n,i)=>{let s=he,o=ye,u=de,a=t;he=ge,ye=0,t=0,he||(ge=he=new le(8192)),de=he.length-10,E(e,r,i),ge=he;let l=ye;if(he=s,ye=o,de=u,t=a,l>1){let e=ye+l-1;e>de&&k(e);let r=n+t;he.copyWithin(r+l,r+1,ye),he.set(ge.slice(0,l),r),ye=e}else he[n+t]=ge[0]},O=(e,i)=>{let s=undefined(e,he,t,ye,n,k,((e,t,n)=>{if(n)return r=!0;ye=t;let i=he;return m(e),w(),i!==he?{position:ye,targetView:pe,target:he}:ye}),this);if(0===s)return I(e,!0);ye=s}}useBuffer(e){he=e,pe=new DataView(he.buffer,he.byteOffset,he.byteLength),ye=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function Ue(e,t,r,n){let i=e.byteLength;if(i+1<256){var{target:s,position:o}=r(4+i);s[o++]=199,s[o++]=i+1}else if(i+1<65536){var{target:s,position:o}=r(5+i);s[o++]=200,s[o++]=i+1>>8,s[o++]=i+1&255}else{var{target:s,position:o,targetView:u}=r(7+i);s[o++]=201,u.setUint32(o,i+1),o+=4}s[o++]=116,s[o++]=t,s.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o)}function Ae(e,t){let r=e.byteLength;var n,i;if(r<256){var{target:n,position:i}=t(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=t(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:s}=t(r+5);n[i++]=198,s.setUint32(i,r),i+=4}n.set(e,i)}function Ie(e,t,r,n){let i=e.length;switch(i){case 1:t[r++]=212;break;case 2:t[r++]=213;break;case 4:t[r++]=214;break;case 8:t[r++]=215;break;case 16:t[r++]=216;break;default:i<256?(t[r++]=199,t[r++]=i):i<65536?(t[r++]=200,t[r++]=i>>8,t[r++]=255&i):(t[r++]=201,t[r++]=i>>24,t[r++]=i>>16&255,t[r++]=i>>8&255,t[r++]=255&i)}return t[r++]=n,t.set(e,r),r+=i}function ke(e,t,r){if(we.length>0){pe.setUint32(we.position+e,ye+r-we.position-e),we.stringsPosition=ye-e;let n=we;we=null,t(n[0]),t(n[1])}}se=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,d],ie=[{pack(e,t,r){let n=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&n>=0&&n<4294967296){let{target:e,targetView:r,position:i}=t(6);e[i++]=214,e[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:s}=t(10);r[s++]=215,r[s++]=255,i.setUint32(s,4e6*e.getMilliseconds()+(n/1e3/4294967296>>0)),i.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return t(0),r(this.onInvalidDate());let{target:e,targetView:n,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:r,targetView:i,position:s}=t(15);r[s++]=199,r[s++]=12,r[s++]=255,i.setUint32(s,1e6*e.getMilliseconds()),i.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(e,t,r){if(this.setAsEmptyObject)return t(0),r({});let n=Array.from(e),{target:i,position:s}=t(this.moreTypes?3:0);this.moreTypes&&(i[s++]=212,i[s++]=115,i[s++]=0),r(n)}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([e.name,e.message])}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([e.source,e.flags])}},{pack(e,t){this.moreTypes?Ue(e,16,t):Ae(ae?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let r=e.constructor;r!==ce&&this.moreTypes?Ue(e,$.indexOf(r.name),t):Ae(e,t)}},{pack(e,t){let{target:r,position:n}=t(1);r[n]=193}}];let Ee=new Se({useRecords:!1});const ve=Ee.pack,Oe=Ee.pack,Be=Se,{NEVER:_e,ALWAYS:xe,DECIMAL_ROUND:Te,DECIMAL_FIT:je}=re,Me=512,De=1024,Ne=2048;const Le=function(e,t={}){if(!e||"object"!=typeof e)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new S(t);let n;const i=e=>{let t;n&&(e=Buffer.concat([n,e]),n=void 0);try{t=r.unpackMultiple(e)}catch(r){if(!r.incomplete)throw r;n=e.slice(r.lastPosition),t=r.values}return t};return"function"==typeof e[Symbol.iterator]?function*(){for(const t of e)yield*i(t)}():"function"==typeof e[Symbol.asyncIterator]?async function*(){for await(const t of e)yield*i(t)}():void 0},Re=function(e,t={}){if(e&&"object"==typeof e){if("function"==typeof e[Symbol.iterator])return function*(e,t){const r=new Se(t);for(const t of e)yield r.pack(t)}(e,t);if("function"==typeof e.then||"function"==typeof e[Symbol.asyncIterator])return async function*(e,t){const r=new Se(t);for await(const t of e)yield r.pack(t)}(e,t);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")};e.ALWAYS=xe,e.C1=y,e.DECIMAL_FIT=je,e.DECIMAL_ROUND=Te,e.Decoder=H,e.Encoder=Be,e.FLOAT32_OPTIONS=re,e.NEVER=_e,e.Packr=Se,e.REUSE_BUFFER_MODE=Me,e.Unpackr=S,e.addExtension=function(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");se.unshift(e.Class),ie.unshift(e)}!function(e){e.unpack?g[e.type]=e.unpack:g[e.type]=e}(e)},e.clearSource=Z,e.decode=te,e.decodeIter=Le,e.encode=Oe,e.encodeIter=Re,e.isNativeAccelerationEnabled=!1,e.mapsAsObjects=!0,e.pack=ve,e.roundFloat32=function(e){oe[0]=e;let t=G[(127&ue[3])<<1|ue[2]>>7];return(t*e+(e>0?.5:-.5)>>0)/t},e.unpack=X,e.unpackMultiple=ee,e.useRecords=!1})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msgpackr={})}(this,(function(e){"use strict";var t,r,n;try{t=new TextDecoder}catch(e){}var i,s,o,u,a,l=0,c={},f=0,h=0,g=[],p={useRecords:!1,mapsAsObjects:!0};class d{}const y=new d;y.name="MessagePack 0xC1";var w,b=!1,m=2;try{new w("")}catch(e){m=1/0}class S{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.sequential&&!1!==e.trusted&&(e.trusted=!0,e.structures||0==e.useRecords||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(r)return Z((()=>(G(),this?this.unpack(e,t):S.prototype.unpack.call(p,e,t))));e.buffer||e.constructor!==ArrayBuffer||(e="undefined"!=typeof Buffer?Buffer.from(e):new Uint8Array(e)),"object"==typeof t?(n=t.end||e.length,l=t.start||0):(l=0,n=t>-1?t:e.length),h=0,s=null,o=null,r=e;try{a=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(t){if(r=null,e instanceof Uint8Array)throw t;throw new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof S){if(c=this,this.structures)return i=this.structures,U(t);(!i||i.length>0)&&(i=[])}else c=p,(!i||i.length>0)&&(i=[]);return U(t)}unpackMultiple(e,t){let r,n=0;try{b=!0;let i=e.length,s=this?this.unpack(e,i):X.unpack(e,i);if(!t){for(r=[s];l<i;)n=l,r.push(U());return r}if(!1===t(s,n,l))return;for(;l<i;)if(n=l,!1===t(U(),n,l))return}catch(e){throw e.lastPosition=n,e.values=r,e}finally{b=!1,G()}}_mergeStructures(e,t){e=e||[],Object.isFrozen(e)&&(e=e.map((e=>e.slice(0))));for(let t=0,r=e.length;t<r;t++){let r=e[t];r&&(r.isShared=!0,t>=32&&(r.highByte=t-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],i=t[r];i&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function U(e){try{if(!c.trusted&&!b){let e=i.sharedLength||0;e<i.length&&(i.length=e)}let e;if(c.randomAccessStructure&&r[l]<64&&r[l],e=I(),o&&(l=o.postBundlePosition,o=null),b&&(i.restoreStructures=null),l==n)i&&i.restoreStructures&&A(),i=null,r=null,u&&(u=null);else{if(l>n)throw new Error("Unexpected end of MessagePack data");if(!b){let t;try{t=JSON.stringify(e,((e,t)=>"bigint"==typeof t?`${t}n`:t)).slice(0,100)}catch(e){t="(JSON view not available "+e+")"}throw new Error("Data read, but end of buffer not reached "+t)}}return e}catch(e){throw i&&i.restoreStructures&&A(),G(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||l>n)&&(e.incomplete=!0),e}}function A(){for(let e in i.restoreStructures)i[e]=i.restoreStructures[e];i.restoreStructures=null}function I(){let e=r[l++];if(e<160){if(e<128){if(e<64)return e;{let t=i[63&e]||c.getStructures&&O()[63&e];return t?(t.read||(t.read=E(t,63&e)),t.read()):e}}if(e<144){if(e-=128,c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=z();"__proto__"===e&&(e="__proto_"),t[e]=I()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(I(),I());return t}}{e-=144;let t=new Array(e);for(let r=0;r<e;r++)t[r]=I();return c.freezeData?Object.freeze(t):t}}if(e<192){let t=e-160;if(h>=l)return s.slice(l-f,(l+=t)-f);if(0==h&&n<140){let e=t<16?R(t):L(t);if(null!=e)return e}return B(t)}{let t;switch(e){case 192:return null;case 193:return o?(t=I(),t>0?o[1].slice(o.position1,o.position1+=t):o[0].slice(o.position0,o.position0-=t)):y;case 194:return!1;case 195:return!0;case 196:if(t=r[l++],void 0===t)throw new Error("Unexpected end of buffer");return V(t);case 197:return t=a.getUint16(l),l+=2,V(t);case 198:return t=a.getUint32(l),l+=4,V(t);case 199:return C(r[l++]);case 200:return t=a.getUint16(l),l+=2,C(t);case 201:return t=a.getUint32(l),l+=4,C(t);case 202:if(t=a.getFloat32(l),c.useFloat32>2){let e=H[(127&r[l])<<1|r[l+1]>>7];return l+=4,(e*t+(t>0?.5:-.5)>>0)/e}return l+=4,t;case 203:return t=a.getFloat64(l),l+=8,t;case 204:return r[l++];case 205:return t=a.getUint16(l),l+=2,t;case 206:return t=a.getUint32(l),l+=4,t;case 207:return"number"===c.int64AsType?(t=4294967296*a.getUint32(l),t+=a.getUint32(l+4)):"string"===c.int64AsType?t=a.getBigUint64(l).toString():"auto"===c.int64AsType?(t=a.getBigUint64(l),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=a.getBigUint64(l),l+=8,t;case 208:return a.getInt8(l++);case 209:return t=a.getInt16(l),l+=2,t;case 210:return t=a.getInt32(l),l+=4,t;case 211:return"number"===c.int64AsType?(t=4294967296*a.getInt32(l),t+=a.getUint32(l+4)):"string"===c.int64AsType?t=a.getBigInt64(l).toString():"auto"===c.int64AsType?(t=a.getBigInt64(l),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=a.getBigInt64(l),l+=8,t;case 212:if(t=r[l++],114==t)return J(63&r[l++]);{let e=g[t];if(e)return e.read?(l++,e.read(I())):e.noBuffer?(l++,e()):e(r.subarray(l,++l));throw new Error("Unknown extension "+t)}case 213:return t=r[l],114==t?(l++,J(63&r[l++],r[l++])):C(2);case 214:return C(4);case 215:return C(8);case 216:return C(16);case 217:return t=r[l++],h>=l?s.slice(l-f,(l+=t)-f):_(t);case 218:return t=a.getUint16(l),h>=(l+=2)?s.slice(l-f,(l+=t)-f):x(t);case 219:return t=a.getUint32(l),h>=(l+=4)?s.slice(l-f,(l+=t)-f):T(t);case 220:return t=a.getUint16(l),l+=2,M(t);case 221:return t=a.getUint32(l),l+=4,M(t);case 222:return t=a.getUint16(l),l+=2,D(t);case 223:return t=a.getUint32(l),l+=4,D(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}const k=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function E(e,t){function r(){if(r.count++>m){let r=e.read=new w("r","return function(){return "+(c.freezeData?"Object.freeze":"")+"({"+e.map((e=>"__proto__"===e?"__proto_:r()":k.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"})}")(I);return 0===e.highByte&&(e.read=v(t,e.read)),r()}let n={};for(let t=0,r=e.length;t<r;t++){let r=e[t];"__proto__"===r&&(r="__proto_"),n[r]=I()}return c.freezeData?Object.freeze(n):n}return r.count=0,0===e.highByte?v(t,r):r}const v=(e,t)=>function(){let n=r[l++];if(0===n)return t();let s=e<32?-(e+(n<<5)):e+(n<<5),o=i[s]||O()[s];if(!o)throw new Error("Record id is not defined for "+s);return o.read||(o.read=E(o,e)),o.read()};function O(){let e=Z((()=>(r=null,c.getStructures())));return i=c._mergeStructures(e,i)}var B=j,_=j,x=j,T=j;function j(e){let n;if(e<16&&(n=R(e)))return n;if(e>64&&t)return t.decode(r.subarray(l,l+=e));const i=l+e,s=[];for(n="";l<i;){const e=r[l++];if(0==(128&e))s.push(e);else if(192==(224&e)){const t=63&r[l++];s.push((31&e)<<6|t)}else if(224==(240&e)){const t=63&r[l++],n=63&r[l++];s.push((31&e)<<12|t<<6|n)}else if(240==(248&e)){let t=(7&e)<<18|(63&r[l++])<<12|(63&r[l++])<<6|63&r[l++];t>65535&&(t-=65536,s.push(t>>>10&1023|55296),t=56320|1023&t),s.push(t)}else s.push(e);s.length>=4096&&(n+=N.apply(String,s),s.length=0)}return s.length>0&&(n+=N.apply(String,s)),n}function M(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=I();return c.freezeData?Object.freeze(t):t}function D(e){if(c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=z();"__proto__"===e&&(e="__proto_"),t[e]=I()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(I(),I());return t}}var N=String.fromCharCode;function L(e){let t=l,n=new Array(e);for(let i=0;i<e;i++){const e=r[l++];if((128&e)>0)return void(l=t);n[i]=e}return N.apply(String,n)}function R(e){if(e<4){if(e<2){if(0===e)return"";{let e=r[l++];return(128&e)>1?void(l-=1):N(e)}}{let t=r[l++],n=r[l++];if((128&t)>0||(128&n)>0)return void(l-=2);if(e<3)return N(t,n);let i=r[l++];return(128&i)>0?void(l-=3):N(t,n,i)}}{let t=r[l++],n=r[l++],i=r[l++],s=r[l++];if((128&t)>0||(128&n)>0||(128&i)>0||(128&s)>0)return void(l-=4);if(e<6){if(4===e)return N(t,n,i,s);{let e=r[l++];return(128&e)>0?void(l-=5):N(t,n,i,s,e)}}if(e<8){let o=r[l++],u=r[l++];if((128&o)>0||(128&u)>0)return void(l-=6);if(e<7)return N(t,n,i,s,o,u);let a=r[l++];return(128&a)>0?void(l-=7):N(t,n,i,s,o,u,a)}{let o=r[l++],u=r[l++],a=r[l++],c=r[l++];if((128&o)>0||(128&u)>0||(128&a)>0||(128&c)>0)return void(l-=8);if(e<10){if(8===e)return N(t,n,i,s,o,u,a,c);{let e=r[l++];return(128&e)>0?void(l-=9):N(t,n,i,s,o,u,a,c,e)}}if(e<12){let f=r[l++],h=r[l++];if((128&f)>0||(128&h)>0)return void(l-=10);if(e<11)return N(t,n,i,s,o,u,a,c,f,h);let g=r[l++];return(128&g)>0?void(l-=11):N(t,n,i,s,o,u,a,c,f,h,g)}{let f=r[l++],h=r[l++],g=r[l++],p=r[l++];if((128&f)>0||(128&h)>0||(128&g)>0||(128&p)>0)return void(l-=12);if(e<14){if(12===e)return N(t,n,i,s,o,u,a,c,f,h,g,p);{let e=r[l++];return(128&e)>0?void(l-=13):N(t,n,i,s,o,u,a,c,f,h,g,p,e)}}{let d=r[l++],y=r[l++];if((128&d)>0||(128&y)>0)return void(l-=14);if(e<15)return N(t,n,i,s,o,u,a,c,f,h,g,p,d,y);let w=r[l++];return(128&w)>0?void(l-=15):N(t,n,i,s,o,u,a,c,f,h,g,p,d,y,w)}}}}}function F(){let e,t=r[l++];if(t<192)e=t-160;else switch(t){case 217:e=r[l++];break;case 218:e=a.getUint16(l),l+=2;break;case 219:e=a.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return j(e)}function V(e){return c.copyBuffers?Uint8Array.prototype.slice.call(r,l,l+=e):r.subarray(l,l+=e)}function C(e){let t=r[l++];if(g[t]){let n;return g[t](r.subarray(l,n=l+=e),(e=>{l=e;try{return I()}finally{l=n}}))}throw new Error("Unknown extension type "+t)}var P=new Array(4096);function z(){let e=r[l++];if(!(e>=160&&e<192))return l--,W(I());if(e-=160,h>=l)return s.slice(l-f,(l+=e)-f);if(!(0==h&&n<180))return B(e);let t,i=4095&(e<<5^(e>1?a.getUint16(l):e>0?r[l]:0)),o=P[i],u=l,c=l+e-3,g=0;if(o&&o.bytes==e){for(;u<c;){if(t=a.getUint32(u),t!=o[g++]){u=1879048192;break}u+=4}for(c+=3;u<c;)if(t=r[u++],t!=o[g++]){u=1879048192;break}if(u===c)return l=u,o.string;c-=3,u=l}for(o=[],P[i]=o,o.bytes=e;u<c;)t=a.getUint32(u),o.push(t),u+=4;for(c+=3;u<c;)t=r[u++],o.push(t);let p=e<16?R(e):L(e);return o.string=null!=p?p:B(e)}function W(e){if("string"==typeof e)return e;if("number"==typeof e)return e.toString();throw new Error("Invalid property type for record",typeof e)}const J=(e,t)=>{let r=I().map(W),n=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,r.highByte=t);let s=i[e];return s&&(s.isShared||b)&&((i.restoreStructures||(i.restoreStructures=[]))[e]=s),i[e]=r,r.read=E(r,n),r.read()};g[0]=()=>{},g[0].noBuffer=!0,g[66]=e=>{let t=e.length,r=BigInt(128&e[0]?e[0]-256:e[0]);for(let n=1;n<t;n++)r<<=8n,r+=BigInt(e[n]);return r};let $={Error:Error,TypeError:TypeError,ReferenceError:ReferenceError};g[101]=()=>{let e=I();return($[e[0]]||Error)(e[1])},g[105]=e=>{if(!1===c.structuredClone)throw new Error("Structured clone extension is disabled");let t=a.getUint32(l-4);u||(u=new Map);let n,i=r[l];n=i>=144&&i<160||220==i||221==i?[]:{};let s={target:n};u.set(t,s);let o=I();return s.used?Object.assign(n,o):(s.target=o,o)},g[112]=e=>{if(!1===c.structuredClone)throw new Error("Structured clone extension is disabled");let t=a.getUint32(l-4),r=u.get(t);return r.used=!0,r.target},g[115]=()=>new Set(I());const Y=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));let q="object"==typeof globalThis?globalThis:window;g[116]=e=>{let t=e[0],r=Y[t];if(!r)throw new Error("Could not find typed array for code "+t);return new q[r](Uint8Array.prototype.slice.call(e,1).buffer)},g[120]=()=>{let e=I();return new RegExp(e[0],e[1])};const K=[];function Z(e){let t=n,g=l,p=f,d=h,y=s,w=u,m=o,S=new Uint8Array(r.slice(0,n)),U=i,A=i.slice(0,i.length),I=c,k=b,E=e();return n=t,l=g,f=p,h=d,s=y,u=w,o=m,r=S,b=k,(i=U).splice(0,i.length,...A),c=I,a=new DataView(r.buffer,r.byteOffset,r.byteLength),E}function G(){r=null,u=null,i=null}g[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],r=l;return l+=t-e.length,o=K,(o=[F(),F()]).position0=0,o.position1=0,o.postBundlePosition=l,l=r,I()},g[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");const H=new Array(147);for(let e=0;e<256;e++)H[e]=+("1e"+Math.floor(45.15-.30103*e));const Q=S;var X=new S({useRecords:!1});const ee=X.unpack,te=X.unpackMultiple,re=X.unpack,ne={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let ie,se,oe,ue=new Float32Array(1),ae=new Uint8Array(ue.buffer,0,4);try{ie=new TextEncoder}catch(e){}const le="undefined"!=typeof Buffer,ce=le?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,fe=le?Buffer:Uint8Array,he=le?4294967296:2144337920;let ge,pe,de,ye,we=0,be=null;const me=/[\u0080-\uFFFF]/,Se=Symbol("record-id");class Ue extends S{constructor(e){let t,r,n,i;super(e),this.offset=0;let s=fe.prototype.utf8Write?function(e,t){return ge.utf8Write(e,t,4294967295)}:!(!ie||!ie.encodeInto)&&function(e,t){return ie.encodeInto(e,ge.subarray(t)).written},o=this;e||(e={});let u=e&&e.sequential,a=e.structures||e.saveStructures,l=e.maxSharedStructures;if(null==l&&(l=a?32:0),l>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&null==e.moreTypes&&(this.moreTypes=!0);let c=e.maxOwnStructures;null==c&&(c=a?32:64),this.structures||0==e.useRecords||(this.structures=[]);let f=l>32||c+l>64,h=l+64,g=l+c+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],d=0,y=0;this.pack=this.encode=function(e,s){if(ge||(ge=new ce(8192),de=ge.dataView||(ge.dataView=new DataView(ge.buffer,0,8192)),we=0),ye=ge.length-10,ye-we<2048?(ge=new ce(ge.length),de=ge.dataView||(ge.dataView=new DataView(ge.buffer,0,ge.length)),ye=ge.length-10,we=0):we=we+7&2147483640,t=we,s&Le&&(we+=255&s),i=o.structuredClone?new Map:null,o.bundleStrings&&"string"!=typeof e?(be=[],be.size=1/0):be=null,n=o.structures,n){n.uninitialized&&(n=o._mergeStructures(o.getStructures()));let e=n.sharedLength||0;if(e>l)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let t=0,n=e.length;t<n;t++){let n=e[t];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[Se]=t+64}this.lastNamedStructuresLength=e}u||(n.nextId=e+64)}let a;r&&(r=!1);try{o.randomAccessStructure&&e&&e.constructor&&e.constructor===Object?O(e):m(e);let u=be;if(be&&Ee(t,m,0),i&&i.idsToInsert){let e=i.idsToInsert.sort(((e,t)=>e.offset>t.offset?1:-1)),r=e.length,n=-1;for(;u&&r>0;){let i=e[--r].offset+t;i<u.stringsPosition+t&&-1===n&&(n=0),i>u.position+t?n>=0&&(n+=6):(n>=0&&(de.setUint32(u.position+t,de.getUint32(u.position+t)+n),n=-1),u=u.previous,r++)}n>=0&&u&&de.setUint32(u.position+t,de.getUint32(u.position+t)+n),we+=6*e.length,we>ye&&k(we),o.offset=we;let s=function(e,t){let r,n=6*t.length,i=e.length-n;for(;r=t.pop();){let t=r.offset,s=r.id;e.copyWithin(t+n,t,i),n-=6;let o=t+n;e[o++]=214,e[o++]=105,e[o++]=s>>24,e[o++]=s>>16&255,e[o++]=s>>8&255,e[o++]=255&s,i=t}return e}(ge.subarray(t,we),e);return i=null,s}return o.offset=we,s&De?(ge.start=t,ge.end=we,ge):ge.subarray(t,we)}catch(e){throw a=e,e}finally{if(n&&(w(),r&&o.saveStructures)){let r=n.sharedLength||0,i=ge.subarray(t,we),u=function(e,t){return e.isCompatible=e=>{let r=!e||(t.lastNamedStructuresLength||0)===e.length;return r||t._mergeStructures(e),r},e}(n,o);if(!a)return!1===o.saveStructures(u,u.isCompatible)?o.pack(e,s):(o.lastNamedStructuresLength=r,i)}s&Ne&&(we=t)}};const w=()=>{y<10&&y++;let e=n.sharedLength||0;if(n.length>e&&!u&&(n.length=e),d>1e4)n.transitions=null,y=0,d=0,p.length>0&&(p=[]);else if(p.length>0&&!u){for(let e=0,t=p.length;e<t;e++)p[e][Se]=0;p=[]}},b=e=>{var t=e.length;t<16?ge[we++]=144|t:t<65536?(ge[we++]=220,ge[we++]=t>>8,ge[we++]=255&t):(ge[we++]=221,de.setUint32(we,t),we+=4);for(let r=0;r<t;r++)m(e[r])},m=e=>{we>ye&&(ge=k(we));var r,n=typeof e;if("string"===n){let n,i=e.length;if(be&&i>=4&&i<4096){if((be.size+=i)>21760){let e,r,n=(be[0]?3*be[0].length+be[1].length:0)+10;we+n>ye&&(ge=k(we+n)),be.position?(r=be,ge[we]=200,we+=3,ge[we++]=98,e=we-t,we+=4,Ee(t,m,0),de.setUint16(e+t-3,we-t-e)):(ge[we++]=214,ge[we++]=98,e=we-t,we+=4),be=["",""],be.previous=r,be.size=0,be.position=e}let r=me.test(e);return be[r?0:1]+=e,ge[we++]=193,void m(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let o=3*i;if(we+o>ye&&(ge=k(we+o)),i<64||!s){let t,s,o,u=we+n;for(t=0;t<i;t++)s=e.charCodeAt(t),s<128?ge[u++]=s:s<2048?(ge[u++]=s>>6|192,ge[u++]=63&s|128):55296==(64512&s)&&56320==(64512&(o=e.charCodeAt(t+1)))?(s=65536+((1023&s)<<10)+(1023&o),t++,ge[u++]=s>>18|240,ge[u++]=s>>12&63|128,ge[u++]=s>>6&63|128,ge[u++]=63&s|128):(ge[u++]=s>>12|224,ge[u++]=s>>6&63|128,ge[u++]=63&s|128);r=u-we-n}else r=s(e,we+n);r<32?ge[we++]=160|r:r<256?(n<2&&ge.copyWithin(we+2,we+1,we+1+r),ge[we++]=217,ge[we++]=r):r<65536?(n<3&&ge.copyWithin(we+3,we+2,we+2+r),ge[we++]=218,ge[we++]=r>>8,ge[we++]=255&r):(n<5&&ge.copyWithin(we+5,we+3,we+3+r),ge[we++]=219,de.setUint32(we,r),we+=4),we+=r}else if("number"===n)if(e>>>0===e)e<32||e<128&&!1===this.useRecords||e<64&&!this.randomAccessStructure?ge[we++]=e:e<256?(ge[we++]=204,ge[we++]=e):e<65536?(ge[we++]=205,ge[we++]=e>>8,ge[we++]=255&e):(ge[we++]=206,de.setUint32(we,e),we+=4);else if(e>>0===e)e>=-32?ge[we++]=256+e:e>=-128?(ge[we++]=208,ge[we++]=e+256):e>=-32768?(ge[we++]=209,de.setInt16(we,e),we+=2):(ge[we++]=210,de.setInt32(we,e),we+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let r;if(ge[we++]=202,de.setFloat32(we,e),t<4||(r=e*H[(127&ge[we])<<1|ge[we+1]>>7])>>0===r)return void(we+=4);we--}ge[we++]=203,de.setFloat64(we,e),we+=8}else if("object"===n||"function"===n)if(e){if(i){let r=i.get(e);if(r){if(!r.id){let e=i.idsToInsert||(i.idsToInsert=[]);r.id=e.push(r)}return ge[we++]=214,ge[we++]=112,de.setUint32(we,r.id),void(we+=4)}i.set(e,{offset:we-t})}let s=e.constructor;if(s===Object)I(e,!0);else if(s===Array)b(e);else if(s===Map)if(this.mapAsEmptyObject)ge[we++]=128;else{(r=e.size)<16?ge[we++]=128|r:r<65536?(ge[we++]=222,ge[we++]=r>>8,ge[we++]=255&r):(ge[we++]=223,de.setUint32(we,r),we+=4);for(let[t,r]of e)m(t),m(r)}else{for(let t=0,r=se.length;t<r;t++){if(e instanceof oe[t]){let r=se[t];if(r.write){r.type&&(ge[we++]=212,ge[we++]=r.type,ge[we++]=0);let t=r.write.call(this,e);return void(t===e?Array.isArray(e)?b(e):I(e):m(t))}let n,i=ge,s=de,o=we;ge=null;try{n=r.pack.call(this,e,(e=>(ge=i,i=null,we+=e,we>ye&&k(we),{target:ge,targetView:de,position:we-e})),m)}finally{i&&(ge=i,de=s,we=o,ye=ge.length-10)}return void(n&&(n.length+we>ye&&k(n.length+we),we=ke(n,ge,we,r.type)))}}if(Array.isArray(e))b(e);else{if(e.toJSON){const t=e.toJSON();if(t!==e)return m(t)}if("function"===n)return m(this.writeFunction&&this.writeFunction(e));I(e,!e.hasOwnProperty)}}}else ge[we++]=192;else if("boolean"===n)ge[we++]=e?195:194;else if("bigint"===n){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))ge[we++]=211,de.setBigInt64(we,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)ge[we++]=207,de.setBigUint64(we,e);else{if(!this.largeBigIntToFloat){if(this.useBigIntExtension&&e<2n**1023n&&e>-(2n**1023n)){ge[we++]=199,we++,ge[we++]=66;let t,r=[];do{let n=0xffn&e;t=(0x80n&n)===(e<0n?0x80n:0n),r.push(n),e>>=8n}while(0n!==e&&-1n!==e||!t);ge[we-2]=r.length;for(let e=r.length;e>0;)ge[we++]=Number(r[--e]);return}throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension or set largeBigIntToFloat to convert to float-64")}ge[we++]=203,de.setFloat64(we,Number(e))}we+=8}else{if("undefined"!==n)throw new Error("Unknown type: "+n);this.encodeUndefinedAsNil?ge[we++]=192:(ge[we++]=212,ge[we++]=0,ge[we++]=0)}},S=this.variableMapSize||this.coercibleKeyAsNumber?e=>{let t,r=Object.keys(e),n=r.length;if(n<16?ge[we++]=128|n:n<65536?(ge[we++]=222,ge[we++]=n>>8,ge[we++]=255&n):(ge[we++]=223,de.setUint32(we,n),we+=4),this.coercibleKeyAsNumber)for(let i=0;i<n;i++){t=r[i];let n=Number(t);m(isNaN(n)?t:n),m(e[t])}else for(let i=0;i<n;i++)m(t=r[i]),m(e[t])}:(e,r)=>{ge[we++]=222;let n=we-t;we+=2;let i=0;for(let t in e)(r||e.hasOwnProperty(t))&&(m(t),m(e[t]),i++);ge[n+++t]=i>>8,ge[n+t]=255&i},U=!1===this.useRecords?S:e.progressiveRecords&&!f?(e,r)=>{let i,s,o=n.transitions||(n.transitions=Object.create(null)),u=we++-t;for(let a in e)if(r||e.hasOwnProperty(a)){if(i=o[a],i)o=i;else{let r=Object.keys(e),l=o;o=n.transitions;let c=0;for(let e=0,t=r.length;e<t;e++){let t=r[e];i=o[t],i||(i=o[t]=Object.create(null),c++),o=i}u+t+1==we?(we--,E(o,r,c)):v(o,r,u,c),s=!0,o=l[a]}m(e[a])}if(!s){let r=o[Se];r?ge[u+t]=r:v(o,Object.keys(e),u,0)}}:(e,t)=>{let r,i=n.transitions||(n.transitions=Object.create(null)),s=0;for(let n in e)(t||e.hasOwnProperty(n))&&(r=i[n],r||(r=i[n]=Object.create(null),s++),i=r);let o=i[Se];o?o>=96&&f?(ge[we++]=96+(31&(o-=96)),ge[we++]=o>>5):ge[we++]=o:E(i,i.__keys__||Object.keys(e),s);for(let r in e)(t||e.hasOwnProperty(r))&&m(e[r])},A="function"==typeof this.useRecords&&this.useRecords,I=A?(e,t)=>{A(e)?U(e,t):S(e,t)}:U,k=e=>{let r;if(e>16777216){if(e-t>he)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(he,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(e-t<<2,ge.length-1)>>12)<<12;let n=new ce(r);return de=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),e=Math.min(e,ge.length),ge.copy?ge.copy(n,0,t,e):n.set(ge.slice(t,e)),we-=t,t=0,ye=n.length-10,ge=n},E=(e,t,i)=>{let s=n.nextId;s||(s=64),s<h&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(s=n.nextOwnId,s<g||(s=h),n.nextOwnId=s+1):(s>=g&&(s=h),n.nextId=s+1);let o=t.highByte=s>=96&&f?s-96>>5:-1;e[Se]=s,e.__keys__=t,n[s-64]=t,s<h?(t.isShared=!0,n.sharedLength=s-63,r=!0,o>=0?(ge[we++]=96+(31&s),ge[we++]=o):ge[we++]=s):(o>=0?(ge[we++]=213,ge[we++]=114,ge[we++]=96+(31&s),ge[we++]=o):(ge[we++]=212,ge[we++]=114,ge[we++]=s),i&&(d+=y*i),p.length>=c&&(p.shift()[Se]=0),p.push(e),m(t))},v=(e,r,n,i)=>{let s=ge,o=we,u=ye,a=t;ge=pe,we=0,t=0,ge||(pe=ge=new ce(8192)),ye=ge.length-10,E(e,r,i),pe=ge;let l=we;if(ge=s,we=o,ye=u,t=a,l>1){let e=we+l-1;e>ye&&k(e);let r=n+t;ge.copyWithin(r+l,r+1,we),ge.set(pe.slice(0,l),r),we=e}else ge[n+t]=pe[0]},O=(e,i)=>{let s=undefined(e,ge,t,we,n,k,((e,t,n)=>{if(n)return r=!0;we=t;let i=ge;return m(e),w(),i!==ge?{position:we,targetView:de,target:ge}:we}),this);if(0===s)return I(e,!0);we=s}}useBuffer(e){ge=e,de=new DataView(ge.buffer,ge.byteOffset,ge.byteLength),we=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function Ae(e,t,r,n){let i=e.byteLength;if(i+1<256){var{target:s,position:o}=r(4+i);s[o++]=199,s[o++]=i+1}else if(i+1<65536){var{target:s,position:o}=r(5+i);s[o++]=200,s[o++]=i+1>>8,s[o++]=i+1&255}else{var{target:s,position:o,targetView:u}=r(7+i);s[o++]=201,u.setUint32(o,i+1),o+=4}s[o++]=116,s[o++]=t,s.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o)}function Ie(e,t){let r=e.byteLength;var n,i;if(r<256){var{target:n,position:i}=t(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=t(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:s}=t(r+5);n[i++]=198,s.setUint32(i,r),i+=4}n.set(e,i)}function ke(e,t,r,n){let i=e.length;switch(i){case 1:t[r++]=212;break;case 2:t[r++]=213;break;case 4:t[r++]=214;break;case 8:t[r++]=215;break;case 16:t[r++]=216;break;default:i<256?(t[r++]=199,t[r++]=i):i<65536?(t[r++]=200,t[r++]=i>>8,t[r++]=255&i):(t[r++]=201,t[r++]=i>>24,t[r++]=i>>16&255,t[r++]=i>>8&255,t[r++]=255&i)}return t[r++]=n,t.set(e,r),r+=i}function Ee(e,t,r){if(be.length>0){de.setUint32(be.position+e,we+r-be.position-e),be.stringsPosition=we-e;let n=be;be=null,t(n[0]),t(n[1])}}oe=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,d],se=[{pack(e,t,r){let n=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&n>=0&&n<4294967296){let{target:e,targetView:r,position:i}=t(6);e[i++]=214,e[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:s}=t(10);r[s++]=215,r[s++]=255,i.setUint32(s,4e6*e.getMilliseconds()+(n/1e3/4294967296>>0)),i.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return t(0),r(this.onInvalidDate());let{target:e,targetView:n,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:r,targetView:i,position:s}=t(15);r[s++]=199,r[s++]=12,r[s++]=255,i.setUint32(s,1e6*e.getMilliseconds()),i.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(e,t,r){if(this.setAsEmptyObject)return t(0),r({});let n=Array.from(e),{target:i,position:s}=t(this.moreTypes?3:0);this.moreTypes&&(i[s++]=212,i[s++]=115,i[s++]=0),r(n)}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([e.name,e.message])}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([e.source,e.flags])}},{pack(e,t){this.moreTypes?Ae(e,16,t):Ie(le?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let r=e.constructor;r!==fe&&this.moreTypes?Ae(e,Y.indexOf(r.name),t):Ie(e,t)}},{pack(e,t){let{target:r,position:n}=t(1);r[n]=193}}];let ve=new Ue({useRecords:!1});const Oe=ve.pack,Be=ve.pack,_e=Ue,{NEVER:xe,ALWAYS:Te,DECIMAL_ROUND:je,DECIMAL_FIT:Me}=ne,De=512,Ne=1024,Le=2048;const Re=function(e,t={}){if(!e||"object"!=typeof e)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new S(t);let n;const i=e=>{let t;n&&(e=Buffer.concat([n,e]),n=void 0);try{t=r.unpackMultiple(e)}catch(r){if(!r.incomplete)throw r;n=e.slice(r.lastPosition),t=r.values}return t};return"function"==typeof e[Symbol.iterator]?function*(){for(const t of e)yield*i(t)}():"function"==typeof e[Symbol.asyncIterator]?async function*(){for await(const t of e)yield*i(t)}():void 0},Fe=function(e,t={}){if(e&&"object"==typeof e){if("function"==typeof e[Symbol.iterator])return function*(e,t){const r=new Ue(t);for(const t of e)yield r.pack(t)}(e,t);if("function"==typeof e.then||"function"==typeof e[Symbol.asyncIterator])return async function*(e,t){const r=new Ue(t);for await(const t of e)yield r.pack(t)}(e,t);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")};e.ALWAYS=Te,e.C1=y,e.DECIMAL_FIT=Me,e.DECIMAL_ROUND=je,e.Decoder=Q,e.Encoder=_e,e.FLOAT32_OPTIONS=ne,e.NEVER=xe,e.Packr=Ue,e.REUSE_BUFFER_MODE=De,e.Unpackr=S,e.addExtension=function(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");oe.unshift(e.Class),se.unshift(e)}!function(e){e.unpack?g[e.type]=e.unpack:g[e.type]=e}(e)},e.clearSource=G,e.decode=re,e.decodeIter=Re,e.encode=Be,e.encodeIter=Fe,e.isNativeAccelerationEnabled=!1,e.mapsAsObjects=!0,e.pack=Oe,e.roundFloat32=function(e){ue[0]=e;let t=H[(127&ae[3])<<1|ae[2]>>7];return(t*e+(e>0?.5:-.5)>>0)/t},e.unpack=ee,e.unpackMultiple=te,e.useRecords=!1})); | ||
//# sourceMappingURL=index-no-eval.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msgpackr={})}(this,(function(e){"use strict";var t,r,n;try{t=new TextDecoder}catch(e){}var i,s,o,u,a,l=0,c={},f=0,h=0,g=[],p={useRecords:!1,mapsAsObjects:!0};class d{}const y=new d;y.name="MessagePack 0xC1";var w=!1,b=2;try{new Function("")}catch(e){b=1/0}class m{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.sequential&&!1!==e.trusted&&(e.trusted=!0,e.structures||0==e.useRecords||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(r)return q((()=>(K(),this?this.unpack(e,t):m.prototype.unpack.call(p,e,t))));e.buffer||e.constructor!==ArrayBuffer||(e="undefined"!=typeof Buffer?Buffer.from(e):new Uint8Array(e)),"object"==typeof t?(n=t.end||e.length,l=t.start||0):(l=0,n=t>-1?t:e.length),h=0,s=null,o=null,r=e;try{a=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(t){if(r=null,e instanceof Uint8Array)throw t;throw new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof m){if(c=this,this.structures)return i=this.structures,S(t);(!i||i.length>0)&&(i=[])}else c=p,(!i||i.length>0)&&(i=[]);return S(t)}unpackMultiple(e,t){let r,n=0;try{w=!0;let i=e.length,s=this?this.unpack(e,i):H.unpack(e,i);if(!t){for(r=[s];l<i;)n=l,r.push(S());return r}if(!1===t(s,n,l))return;for(;l<i;)if(n=l,!1===t(S(),n,l))return}catch(e){throw e.lastPosition=n,e.values=r,e}finally{w=!1,K()}}_mergeStructures(e,t){e=e||[],Object.isFrozen(e)&&(e=e.map((e=>e.slice(0))));for(let t=0,r=e.length;t<r;t++){let r=e[t];r&&(r.isShared=!0,t>=32&&(r.highByte=t-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],i=t[r];i&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function S(e){try{if(!c.trusted&&!w){let e=i.sharedLength||0;e<i.length&&(i.length=e)}let e;if(c.randomAccessStructure&&r[l]<64&&r[l],e=A(),o&&(l=o.postBundlePosition,o=null),w&&(i.restoreStructures=null),l==n)i&&i.restoreStructures&&U(),i=null,r=null,u&&(u=null);else{if(l>n)throw new Error("Unexpected end of MessagePack data");if(!w){let t;try{t=JSON.stringify(e,((e,t)=>"bigint"==typeof t?`${t}n`:t)).slice(0,100)}catch(e){t="(JSON view not available "+e+")"}throw new Error("Data read, but end of buffer not reached "+t)}}return e}catch(e){throw i&&i.restoreStructures&&U(),K(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||l>n)&&(e.incomplete=!0),e}}function U(){for(let e in i.restoreStructures)i[e]=i.restoreStructures[e];i.restoreStructures=null}function A(){let e=r[l++];if(e<160){if(e<128){if(e<64)return e;{let t=i[63&e]||c.getStructures&&v()[63&e];return t?(t.read||(t.read=k(t,63&e)),t.read()):e}}if(e<144){if(e-=128,c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=C();"__proto__"===e&&(e="__proto_"),t[e]=A()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(A(),A());return t}}{e-=144;let t=new Array(e);for(let r=0;r<e;r++)t[r]=A();return c.freezeData?Object.freeze(t):t}}if(e<192){let t=e-160;if(h>=l)return s.slice(l-f,(l+=t)-f);if(0==h&&n<140){let e=t<16?F(t):N(t);if(null!=e)return e}return O(t)}{let t;switch(e){case 192:return null;case 193:return o?(t=A(),t>0?o[1].slice(o.position1,o.position1+=t):o[0].slice(o.position0,o.position0-=t)):y;case 194:return!1;case 195:return!0;case 196:if(t=r[l++],void 0===t)throw new Error("Unexpected end of buffer");return R(t);case 197:return t=a.getUint16(l),l+=2,R(t);case 198:return t=a.getUint32(l),l+=4,R(t);case 199:return V(r[l++]);case 200:return t=a.getUint16(l),l+=2,V(t);case 201:return t=a.getUint32(l),l+=4,V(t);case 202:if(t=a.getFloat32(l),c.useFloat32>2){let e=Z[(127&r[l])<<1|r[l+1]>>7];return l+=4,(e*t+(t>0?.5:-.5)>>0)/e}return l+=4,t;case 203:return t=a.getFloat64(l),l+=8,t;case 204:return r[l++];case 205:return t=a.getUint16(l),l+=2,t;case 206:return t=a.getUint32(l),l+=4,t;case 207:return"number"===c.int64AsType?(t=4294967296*a.getUint32(l),t+=a.getUint32(l+4)):"string"===c.int64AsType?t=a.getBigUint64(l).toString():"auto"===c.int64AsType?(t=a.getBigUint64(l),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=a.getBigUint64(l),l+=8,t;case 208:return a.getInt8(l++);case 209:return t=a.getInt16(l),l+=2,t;case 210:return t=a.getInt32(l),l+=4,t;case 211:return"number"===c.int64AsType?(t=4294967296*a.getInt32(l),t+=a.getUint32(l+4)):"string"===c.int64AsType?t=a.getBigInt64(l).toString():"auto"===c.int64AsType?(t=a.getBigInt64(l),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=a.getBigInt64(l),l+=8,t;case 212:if(t=r[l++],114==t)return z(63&r[l++]);{let e=g[t];if(e)return e.read?(l++,e.read(A())):e.noBuffer?(l++,e()):e(r.subarray(l,++l));throw new Error("Unknown extension "+t)}case 213:return t=r[l],114==t?(l++,z(63&r[l++],r[l++])):V(2);case 214:return V(4);case 215:return V(8);case 216:return V(16);case 217:return t=r[l++],h>=l?s.slice(l-f,(l+=t)-f):B(t);case 218:return t=a.getUint16(l),h>=(l+=2)?s.slice(l-f,(l+=t)-f):_(t);case 219:return t=a.getUint32(l),h>=(l+=4)?s.slice(l-f,(l+=t)-f):x(t);case 220:return t=a.getUint16(l),l+=2,j(t);case 221:return t=a.getUint32(l),l+=4,j(t);case 222:return t=a.getUint16(l),l+=2,M(t);case 223:return t=a.getUint32(l),l+=4,M(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}const I=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function k(e,t){function r(){if(r.count++>b){let r=e.read=new Function("r","return function(){return "+(c.freezeData?"Object.freeze":"")+"({"+e.map((e=>"__proto__"===e?"__proto_:r()":I.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"})}")(A);return 0===e.highByte&&(e.read=E(t,e.read)),r()}let n={};for(let t=0,r=e.length;t<r;t++){let r=e[t];"__proto__"===r&&(r="__proto_"),n[r]=A()}return c.freezeData?Object.freeze(n):n}return r.count=0,0===e.highByte?E(t,r):r}const E=(e,t)=>function(){let n=r[l++];if(0===n)return t();let s=e<32?-(e+(n<<5)):e+(n<<5),o=i[s]||v()[s];if(!o)throw new Error("Record id is not defined for "+s);return o.read||(o.read=k(o,e)),o.read()};function v(){let e=q((()=>(r=null,c.getStructures())));return i=c._mergeStructures(e,i)}var O=T,B=T,_=T,x=T;function T(e){let n;if(e<16&&(n=F(e)))return n;if(e>64&&t)return t.decode(r.subarray(l,l+=e));const i=l+e,s=[];for(n="";l<i;){const e=r[l++];if(0==(128&e))s.push(e);else if(192==(224&e)){const t=63&r[l++];s.push((31&e)<<6|t)}else if(224==(240&e)){const t=63&r[l++],n=63&r[l++];s.push((31&e)<<12|t<<6|n)}else if(240==(248&e)){let t=(7&e)<<18|(63&r[l++])<<12|(63&r[l++])<<6|63&r[l++];t>65535&&(t-=65536,s.push(t>>>10&1023|55296),t=56320|1023&t),s.push(t)}else s.push(e);s.length>=4096&&(n+=D.apply(String,s),s.length=0)}return s.length>0&&(n+=D.apply(String,s)),n}function j(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=A();return c.freezeData?Object.freeze(t):t}function M(e){if(c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=C();"__proto__"===e&&(e="__proto_"),t[e]=A()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(A(),A());return t}}var D=String.fromCharCode;function N(e){let t=l,n=new Array(e);for(let i=0;i<e;i++){const e=r[l++];if((128&e)>0)return void(l=t);n[i]=e}return D.apply(String,n)}function F(e){if(e<4){if(e<2){if(0===e)return"";{let e=r[l++];return(128&e)>1?void(l-=1):D(e)}}{let t=r[l++],n=r[l++];if((128&t)>0||(128&n)>0)return void(l-=2);if(e<3)return D(t,n);let i=r[l++];return(128&i)>0?void(l-=3):D(t,n,i)}}{let t=r[l++],n=r[l++],i=r[l++],s=r[l++];if((128&t)>0||(128&n)>0||(128&i)>0||(128&s)>0)return void(l-=4);if(e<6){if(4===e)return D(t,n,i,s);{let e=r[l++];return(128&e)>0?void(l-=5):D(t,n,i,s,e)}}if(e<8){let o=r[l++],u=r[l++];if((128&o)>0||(128&u)>0)return void(l-=6);if(e<7)return D(t,n,i,s,o,u);let a=r[l++];return(128&a)>0?void(l-=7):D(t,n,i,s,o,u,a)}{let o=r[l++],u=r[l++],a=r[l++],c=r[l++];if((128&o)>0||(128&u)>0||(128&a)>0||(128&c)>0)return void(l-=8);if(e<10){if(8===e)return D(t,n,i,s,o,u,a,c);{let e=r[l++];return(128&e)>0?void(l-=9):D(t,n,i,s,o,u,a,c,e)}}if(e<12){let f=r[l++],h=r[l++];if((128&f)>0||(128&h)>0)return void(l-=10);if(e<11)return D(t,n,i,s,o,u,a,c,f,h);let g=r[l++];return(128&g)>0?void(l-=11):D(t,n,i,s,o,u,a,c,f,h,g)}{let f=r[l++],h=r[l++],g=r[l++],p=r[l++];if((128&f)>0||(128&h)>0||(128&g)>0||(128&p)>0)return void(l-=12);if(e<14){if(12===e)return D(t,n,i,s,o,u,a,c,f,h,g,p);{let e=r[l++];return(128&e)>0?void(l-=13):D(t,n,i,s,o,u,a,c,f,h,g,p,e)}}{let d=r[l++],y=r[l++];if((128&d)>0||(128&y)>0)return void(l-=14);if(e<15)return D(t,n,i,s,o,u,a,c,f,h,g,p,d,y);let w=r[l++];return(128&w)>0?void(l-=15):D(t,n,i,s,o,u,a,c,f,h,g,p,d,y,w)}}}}}function L(){let e,t=r[l++];if(t<192)e=t-160;else switch(t){case 217:e=r[l++];break;case 218:e=a.getUint16(l),l+=2;break;case 219:e=a.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return T(e)}function R(e){return c.copyBuffers?Uint8Array.prototype.slice.call(r,l,l+=e):r.subarray(l,l+=e)}function V(e){let t=r[l++];if(g[t]){let n;return g[t](r.subarray(l,n=l+=e),(e=>{l=e;try{return A()}finally{l=n}}))}throw new Error("Unknown extension type "+t)}var P=new Array(4096);function C(){let e=r[l++];if(!(e>=160&&e<192))return l--,A().toString();if(e-=160,h>=l)return s.slice(l-f,(l+=e)-f);if(!(0==h&&n<180))return O(e);let t,i=4095&(e<<5^(e>1?a.getUint16(l):e>0?r[l]:0)),o=P[i],u=l,c=l+e-3,g=0;if(o&&o.bytes==e){for(;u<c;){if(t=a.getUint32(u),t!=o[g++]){u=1879048192;break}u+=4}for(c+=3;u<c;)if(t=r[u++],t!=o[g++]){u=1879048192;break}if(u===c)return l=u,o.string;c-=3,u=l}for(o=[],P[i]=o,o.bytes=e;u<c;)t=a.getUint32(u),o.push(t),u+=4;for(c+=3;u<c;)t=r[u++],o.push(t);let p=e<16?F(e):N(e);return o.string=null!=p?p:O(e)}const z=(e,t)=>{let r=A().map((e=>e.toString())),n=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,r.highByte=t);let s=i[e];return s&&(s.isShared||w)&&((i.restoreStructures||(i.restoreStructures=[]))[e]=s),i[e]=r,r.read=k(r,n),r.read()};g[0]=()=>{},g[0].noBuffer=!0,g[66]=e=>{let t=e.length,r=BigInt(128&e[0]?e[0]-256:e[0]);for(let n=1;n<t;n++)r<<=8n,r+=BigInt(e[n]);return r};let W={Error:Error,TypeError:TypeError,ReferenceError:ReferenceError};g[101]=()=>{let e=A();return(W[e[0]]||Error)(e[1])},g[105]=e=>{let t=a.getUint32(l-4);u||(u=new Map);let n,i=r[l];n=i>=144&&i<160||220==i||221==i?[]:{};let s={target:n};u.set(t,s);let o=A();return s.used?Object.assign(n,o):(s.target=o,o)},g[112]=e=>{let t=a.getUint32(l-4),r=u.get(t);return r.used=!0,r.target},g[115]=()=>new Set(A());const J=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));let $="object"==typeof globalThis?globalThis:window;g[116]=e=>{let t=e[0],r=J[t];if(!r)throw new Error("Could not find typed array for code "+t);return new $[r](Uint8Array.prototype.slice.call(e,1).buffer)},g[120]=()=>{let e=A();return new RegExp(e[0],e[1])};const Y=[];function q(e){let t=n,g=l,p=f,d=h,y=s,b=u,m=o,S=new Uint8Array(r.slice(0,n)),U=i,A=i.slice(0,i.length),I=c,k=w,E=e();return n=t,l=g,f=p,h=d,s=y,u=b,o=m,r=S,w=k,(i=U).splice(0,i.length,...A),c=I,a=new DataView(r.buffer,r.byteOffset,r.byteLength),E}function K(){r=null,u=null,i=null}g[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],r=l;return l+=t-e.length,o=Y,(o=[L(),L()]).position0=0,o.position1=0,o.postBundlePosition=l,l=r,A()},g[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");const Z=new Array(147);for(let e=0;e<256;e++)Z[e]=+("1e"+Math.floor(45.15-.30103*e));const G=m;var H=new m({useRecords:!1});const Q=H.unpack,X=H.unpackMultiple,ee=H.unpack,te={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let re,ne,ie,se=new Float32Array(1),oe=new Uint8Array(se.buffer,0,4);try{re=new TextEncoder}catch(e){}const ue="undefined"!=typeof Buffer,ae=ue?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,le=ue?Buffer:Uint8Array,ce=ue?4294967296:2144337920;let fe,he,ge,pe,de=0,ye=null;const we=/[\u0080-\uFFFF]/,be=Symbol("record-id");class me extends m{constructor(e){let t,r,n,i;super(e),this.offset=0;let s=le.prototype.utf8Write?function(e,t){return fe.utf8Write(e,t,4294967295)}:!(!re||!re.encodeInto)&&function(e,t){return re.encodeInto(e,fe.subarray(t)).written},o=this;e||(e={});let u=e&&e.sequential,a=e.structures||e.saveStructures,l=e.maxSharedStructures;if(null==l&&(l=a?32:0),l>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&null==e.moreTypes&&(this.moreTypes=!0);let c=e.maxOwnStructures;null==c&&(c=a?32:64),this.structures||0==e.useRecords||(this.structures=[]);let f=l>32||c+l>64,h=l+64,g=l+c+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],d=0,y=0;this.pack=this.encode=function(e,s){if(fe||(fe=new ae(8192),ge=fe.dataView||(fe.dataView=new DataView(fe.buffer,0,8192)),de=0),pe=fe.length-10,pe-de<2048?(fe=new ae(fe.length),ge=fe.dataView||(fe.dataView=new DataView(fe.buffer,0,fe.length)),pe=fe.length-10,de=0):de=de+7&2147483640,t=de,s&De&&(de+=255&s),i=o.structuredClone?new Map:null,o.bundleStrings&&"string"!=typeof e?(ye=[],ye.size=1/0):ye=null,n=o.structures,n){n.uninitialized&&(n=o._mergeStructures(o.getStructures()));let e=n.sharedLength||0;if(e>l)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let t=0,n=e.length;t<n;t++){let n=e[t];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[be]=t+64}this.lastNamedStructuresLength=e}u||(n.nextId=e+64)}let a;r&&(r=!1);try{o.randomAccessStructure&&e&&e.constructor&&e.constructor===Object?O(e):m(e);let u=ye;if(ye&&Ie(t,m,0),i&&i.idsToInsert){let e=i.idsToInsert.sort(((e,t)=>e.offset>t.offset?1:-1)),r=e.length,n=-1;for(;u&&r>0;){let i=e[--r].offset+t;i<u.stringsPosition+t&&-1===n&&(n=0),i>u.position+t?n>=0&&(n+=6):(n>=0&&(ge.setUint32(u.position+t,ge.getUint32(u.position+t)+n),n=-1),u=u.previous,r++)}n>=0&&u&&ge.setUint32(u.position+t,ge.getUint32(u.position+t)+n),de+=6*e.length,de>pe&&k(de),o.offset=de;let s=function(e,t){let r,n=6*t.length,i=e.length-n;for(;r=t.pop();){let t=r.offset,s=r.id;e.copyWithin(t+n,t,i),n-=6;let o=t+n;e[o++]=214,e[o++]=105,e[o++]=s>>24,e[o++]=s>>16&255,e[o++]=s>>8&255,e[o++]=255&s,i=t}return e}(fe.subarray(t,de),e);return i=null,s}return o.offset=de,s&je?(fe.start=t,fe.end=de,fe):fe.subarray(t,de)}catch(e){throw a=e,e}finally{if(n&&(w(),r&&o.saveStructures)){let r=n.sharedLength||0,i=fe.subarray(t,de),u=function(e,t){return e.isCompatible=e=>{let r=!e||(t.lastNamedStructuresLength||0)===e.length;return r||t._mergeStructures(e),r},e}(n,o);if(!a)return!1===o.saveStructures(u,u.isCompatible)?o.pack(e,s):(o.lastNamedStructuresLength=r,i)}s&Me&&(de=t)}};const w=()=>{y<10&&y++;let e=n.sharedLength||0;if(n.length>e&&!u&&(n.length=e),d>1e4)n.transitions=null,y=0,d=0,p.length>0&&(p=[]);else if(p.length>0&&!u){for(let e=0,t=p.length;e<t;e++)p[e][be]=0;p=[]}},b=e=>{var t=e.length;t<16?fe[de++]=144|t:t<65536?(fe[de++]=220,fe[de++]=t>>8,fe[de++]=255&t):(fe[de++]=221,ge.setUint32(de,t),de+=4);for(let r=0;r<t;r++)m(e[r])},m=e=>{de>pe&&(fe=k(de));var r,n=typeof e;if("string"===n){let n,i=e.length;if(ye&&i>=4&&i<4096){if((ye.size+=i)>21760){let e,r,n=(ye[0]?3*ye[0].length+ye[1].length:0)+10;de+n>pe&&(fe=k(de+n)),ye.position?(r=ye,fe[de]=200,de+=3,fe[de++]=98,e=de-t,de+=4,Ie(t,m,0),ge.setUint16(e+t-3,de-t-e)):(fe[de++]=214,fe[de++]=98,e=de-t,de+=4),ye=["",""],ye.previous=r,ye.size=0,ye.position=e}let r=we.test(e);return ye[r?0:1]+=e,fe[de++]=193,void m(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let o=3*i;if(de+o>pe&&(fe=k(de+o)),i<64||!s){let t,s,o,u=de+n;for(t=0;t<i;t++)s=e.charCodeAt(t),s<128?fe[u++]=s:s<2048?(fe[u++]=s>>6|192,fe[u++]=63&s|128):55296==(64512&s)&&56320==(64512&(o=e.charCodeAt(t+1)))?(s=65536+((1023&s)<<10)+(1023&o),t++,fe[u++]=s>>18|240,fe[u++]=s>>12&63|128,fe[u++]=s>>6&63|128,fe[u++]=63&s|128):(fe[u++]=s>>12|224,fe[u++]=s>>6&63|128,fe[u++]=63&s|128);r=u-de-n}else r=s(e,de+n);r<32?fe[de++]=160|r:r<256?(n<2&&fe.copyWithin(de+2,de+1,de+1+r),fe[de++]=217,fe[de++]=r):r<65536?(n<3&&fe.copyWithin(de+3,de+2,de+2+r),fe[de++]=218,fe[de++]=r>>8,fe[de++]=255&r):(n<5&&fe.copyWithin(de+5,de+3,de+3+r),fe[de++]=219,ge.setUint32(de,r),de+=4),de+=r}else if("number"===n)if(e>>>0===e)e<32||e<128&&!1===this.useRecords||e<64&&!this.randomAccessStructure?fe[de++]=e:e<256?(fe[de++]=204,fe[de++]=e):e<65536?(fe[de++]=205,fe[de++]=e>>8,fe[de++]=255&e):(fe[de++]=206,ge.setUint32(de,e),de+=4);else if(e>>0===e)e>=-32?fe[de++]=256+e:e>=-128?(fe[de++]=208,fe[de++]=e+256):e>=-32768?(fe[de++]=209,ge.setInt16(de,e),de+=2):(fe[de++]=210,ge.setInt32(de,e),de+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let r;if(fe[de++]=202,ge.setFloat32(de,e),t<4||(r=e*Z[(127&fe[de])<<1|fe[de+1]>>7])>>0===r)return void(de+=4);de--}fe[de++]=203,ge.setFloat64(de,e),de+=8}else if("object"===n||"function"===n)if(e){if(i){let r=i.get(e);if(r){if(!r.id){let e=i.idsToInsert||(i.idsToInsert=[]);r.id=e.push(r)}return fe[de++]=214,fe[de++]=112,ge.setUint32(de,r.id),void(de+=4)}i.set(e,{offset:de-t})}let s=e.constructor;if(s===Object)I(e,!0);else if(s===Array)b(e);else if(s===Map)if(this.mapAsEmptyObject)fe[de++]=128;else{(r=e.size)<16?fe[de++]=128|r:r<65536?(fe[de++]=222,fe[de++]=r>>8,fe[de++]=255&r):(fe[de++]=223,ge.setUint32(de,r),de+=4);for(let[t,r]of e)m(t),m(r)}else{for(let t=0,r=ne.length;t<r;t++){if(e instanceof ie[t]){let r=ne[t];if(r.write){r.type&&(fe[de++]=212,fe[de++]=r.type,fe[de++]=0);let t=r.write.call(this,e);return void(t===e?Array.isArray(e)?b(e):I(e):m(t))}let n,i=fe,s=ge,o=de;fe=null;try{n=r.pack.call(this,e,(e=>(fe=i,i=null,de+=e,de>pe&&k(de),{target:fe,targetView:ge,position:de-e})),m)}finally{i&&(fe=i,ge=s,de=o,pe=fe.length-10)}return void(n&&(n.length+de>pe&&k(n.length+de),de=Ae(n,fe,de,r.type)))}}if(Array.isArray(e))b(e);else{if(e.toJSON){const t=e.toJSON();if(t!==e)return m(t)}if("function"===n)return m(this.writeFunction&&this.writeFunction(e));I(e,!e.hasOwnProperty)}}}else fe[de++]=192;else if("boolean"===n)fe[de++]=e?195:194;else if("bigint"===n){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))fe[de++]=211,ge.setBigInt64(de,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)fe[de++]=207,ge.setBigUint64(de,e);else{if(!this.largeBigIntToFloat){if(this.useBigIntExtension&&e<2n**1023n&&e>-(2n**1023n)){fe[de++]=199,de++,fe[de++]=66;let t,r=[];do{let n=0xffn&e;t=(0x80n&n)===(e<0n?0x80n:0n),r.push(n),e>>=8n}while(0n!==e&&-1n!==e||!t);fe[de-2]=r.length;for(let e=r.length;e>0;)fe[de++]=Number(r[--e]);return}throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension or set largeBigIntToFloat to convert to float-64")}fe[de++]=203,ge.setFloat64(de,Number(e))}de+=8}else{if("undefined"!==n)throw new Error("Unknown type: "+n);this.encodeUndefinedAsNil?fe[de++]=192:(fe[de++]=212,fe[de++]=0,fe[de++]=0)}},S=this.variableMapSize||this.coercibleKeyAsNumber?e=>{let t,r=Object.keys(e),n=r.length;if(n<16?fe[de++]=128|n:n<65536?(fe[de++]=222,fe[de++]=n>>8,fe[de++]=255&n):(fe[de++]=223,ge.setUint32(de,n),de+=4),this.coercibleKeyAsNumber)for(let i=0;i<n;i++){t=r[i];let n=Number(t);m(isNaN(n)?t:n),m(e[t])}else for(let i=0;i<n;i++)m(t=r[i]),m(e[t])}:(e,r)=>{fe[de++]=222;let n=de-t;de+=2;let i=0;for(let t in e)(r||e.hasOwnProperty(t))&&(m(t),m(e[t]),i++);fe[n+++t]=i>>8,fe[n+t]=255&i},U=!1===this.useRecords?S:e.progressiveRecords&&!f?(e,r)=>{let i,s,o=n.transitions||(n.transitions=Object.create(null)),u=de++-t;for(let a in e)if(r||e.hasOwnProperty(a)){if(i=o[a],i)o=i;else{let r=Object.keys(e),l=o;o=n.transitions;let c=0;for(let e=0,t=r.length;e<t;e++){let t=r[e];i=o[t],i||(i=o[t]=Object.create(null),c++),o=i}u+t+1==de?(de--,E(o,r,c)):v(o,r,u,c),s=!0,o=l[a]}m(e[a])}if(!s){let r=o[be];r?fe[u+t]=r:v(o,Object.keys(e),u,0)}}:(e,t)=>{let r,i=n.transitions||(n.transitions=Object.create(null)),s=0;for(let n in e)(t||e.hasOwnProperty(n))&&(r=i[n],r||(r=i[n]=Object.create(null),s++),i=r);let o=i[be];o?o>=96&&f?(fe[de++]=96+(31&(o-=96)),fe[de++]=o>>5):fe[de++]=o:E(i,i.__keys__||Object.keys(e),s);for(let r in e)(t||e.hasOwnProperty(r))&&m(e[r])},A="function"==typeof this.useRecords&&this.useRecords,I=A?(e,t)=>{A(e)?U(e,t):S(e,t)}:U,k=e=>{let r;if(e>16777216){if(e-t>ce)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(ce,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(e-t<<2,fe.length-1)>>12)<<12;let n=new ae(r);return ge=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),e=Math.min(e,fe.length),fe.copy?fe.copy(n,0,t,e):n.set(fe.slice(t,e)),de-=t,t=0,pe=n.length-10,fe=n},E=(e,t,i)=>{let s=n.nextId;s||(s=64),s<h&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(s=n.nextOwnId,s<g||(s=h),n.nextOwnId=s+1):(s>=g&&(s=h),n.nextId=s+1);let o=t.highByte=s>=96&&f?s-96>>5:-1;e[be]=s,e.__keys__=t,n[s-64]=t,s<h?(t.isShared=!0,n.sharedLength=s-63,r=!0,o>=0?(fe[de++]=96+(31&s),fe[de++]=o):fe[de++]=s):(o>=0?(fe[de++]=213,fe[de++]=114,fe[de++]=96+(31&s),fe[de++]=o):(fe[de++]=212,fe[de++]=114,fe[de++]=s),i&&(d+=y*i),p.length>=c&&(p.shift()[be]=0),p.push(e),m(t))},v=(e,r,n,i)=>{let s=fe,o=de,u=pe,a=t;fe=he,de=0,t=0,fe||(he=fe=new ae(8192)),pe=fe.length-10,E(e,r,i),he=fe;let l=de;if(fe=s,de=o,pe=u,t=a,l>1){let e=de+l-1;e>pe&&k(e);let r=n+t;fe.copyWithin(r+l,r+1,de),fe.set(he.slice(0,l),r),de=e}else fe[n+t]=he[0]},O=(e,i)=>{let s=undefined(e,fe,t,de,n,k,((e,t,n)=>{if(n)return r=!0;de=t;let i=fe;return m(e),w(),i!==fe?{position:de,targetView:ge,target:fe}:de}),this);if(0===s)return I(e,!0);de=s}}useBuffer(e){fe=e,ge=new DataView(fe.buffer,fe.byteOffset,fe.byteLength),de=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function Se(e,t,r,n){let i=e.byteLength;if(i+1<256){var{target:s,position:o}=r(4+i);s[o++]=199,s[o++]=i+1}else if(i+1<65536){var{target:s,position:o}=r(5+i);s[o++]=200,s[o++]=i+1>>8,s[o++]=i+1&255}else{var{target:s,position:o,targetView:u}=r(7+i);s[o++]=201,u.setUint32(o,i+1),o+=4}s[o++]=116,s[o++]=t,s.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o)}function Ue(e,t){let r=e.byteLength;var n,i;if(r<256){var{target:n,position:i}=t(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=t(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:s}=t(r+5);n[i++]=198,s.setUint32(i,r),i+=4}n.set(e,i)}function Ae(e,t,r,n){let i=e.length;switch(i){case 1:t[r++]=212;break;case 2:t[r++]=213;break;case 4:t[r++]=214;break;case 8:t[r++]=215;break;case 16:t[r++]=216;break;default:i<256?(t[r++]=199,t[r++]=i):i<65536?(t[r++]=200,t[r++]=i>>8,t[r++]=255&i):(t[r++]=201,t[r++]=i>>24,t[r++]=i>>16&255,t[r++]=i>>8&255,t[r++]=255&i)}return t[r++]=n,t.set(e,r),r+=i}function Ie(e,t,r){if(ye.length>0){ge.setUint32(ye.position+e,de+r-ye.position-e),ye.stringsPosition=de-e;let n=ye;ye=null,t(n[0]),t(n[1])}}ie=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,d],ne=[{pack(e,t,r){let n=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&n>=0&&n<4294967296){let{target:e,targetView:r,position:i}=t(6);e[i++]=214,e[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:s}=t(10);r[s++]=215,r[s++]=255,i.setUint32(s,4e6*e.getMilliseconds()+(n/1e3/4294967296>>0)),i.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return t(0),r(this.onInvalidDate());let{target:e,targetView:n,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:r,targetView:i,position:s}=t(15);r[s++]=199,r[s++]=12,r[s++]=255,i.setUint32(s,1e6*e.getMilliseconds()),i.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(e,t,r){if(this.setAsEmptyObject)return t(0),r({});let n=Array.from(e),{target:i,position:s}=t(this.moreTypes?3:0);this.moreTypes&&(i[s++]=212,i[s++]=115,i[s++]=0),r(n)}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([e.name,e.message])}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([e.source,e.flags])}},{pack(e,t){this.moreTypes?Se(e,16,t):Ue(ue?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let r=e.constructor;r!==le&&this.moreTypes?Se(e,J.indexOf(r.name),t):Ue(e,t)}},{pack(e,t){let{target:r,position:n}=t(1);r[n]=193}}];let ke=new me({useRecords:!1});const Ee=ke.pack,ve=ke.pack,Oe=me,{NEVER:Be,ALWAYS:_e,DECIMAL_ROUND:xe,DECIMAL_FIT:Te}=te,je=512,Me=1024,De=2048;const Ne=function(e,t={}){if(!e||"object"!=typeof e)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new m(t);let n;const i=e=>{let t;n&&(e=Buffer.concat([n,e]),n=void 0);try{t=r.unpackMultiple(e)}catch(r){if(!r.incomplete)throw r;n=e.slice(r.lastPosition),t=r.values}return t};return"function"==typeof e[Symbol.iterator]?function*(){for(const t of e)yield*i(t)}():"function"==typeof e[Symbol.asyncIterator]?async function*(){for await(const t of e)yield*i(t)}():void 0},Fe=function(e,t={}){if(e&&"object"==typeof e){if("function"==typeof e[Symbol.iterator])return function*(e,t){const r=new me(t);for(const t of e)yield r.pack(t)}(e,t);if("function"==typeof e.then||"function"==typeof e[Symbol.asyncIterator])return async function*(e,t){const r=new me(t);for await(const t of e)yield r.pack(t)}(e,t);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")};e.ALWAYS=_e,e.C1=y,e.DECIMAL_FIT=Te,e.DECIMAL_ROUND=xe,e.Decoder=G,e.Encoder=Oe,e.FLOAT32_OPTIONS=te,e.NEVER=Be,e.Packr=me,e.REUSE_BUFFER_MODE=je,e.Unpackr=m,e.addExtension=function(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");ie.unshift(e.Class),ne.unshift(e)}!function(e){e.unpack?g[e.type]=e.unpack:g[e.type]=e}(e)},e.clearSource=K,e.decode=ee,e.decodeIter=Ne,e.encode=ve,e.encodeIter=Fe,e.isNativeAccelerationEnabled=!1,e.mapsAsObjects=!0,e.pack=Ee,e.roundFloat32=function(e){se[0]=e;let t=Z[(127&oe[3])<<1|oe[2]>>7];return(t*e+(e>0?.5:-.5)>>0)/t},e.unpack=Q,e.unpackMultiple=X,e.useRecords=!1})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msgpackr={})}(this,(function(e){"use strict";var t,r,n;try{t=new TextDecoder}catch(e){}var i,s,o,u,a,l=0,c={},f=0,h=0,g=[],p={useRecords:!1,mapsAsObjects:!0};class d{}const y=new d;y.name="MessagePack 0xC1";var w=!1,b=2;try{new Function("")}catch(e){b=1/0}class m{constructor(e){e&&(!1===e.useRecords&&void 0===e.mapsAsObjects&&(e.mapsAsObjects=!0),e.sequential&&!1!==e.trusted&&(e.trusted=!0,e.structures||0==e.useRecords||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(r)return K((()=>(Z(),this?this.unpack(e,t):m.prototype.unpack.call(p,e,t))));e.buffer||e.constructor!==ArrayBuffer||(e="undefined"!=typeof Buffer?Buffer.from(e):new Uint8Array(e)),"object"==typeof t?(n=t.end||e.length,l=t.start||0):(l=0,n=t>-1?t:e.length),h=0,s=null,o=null,r=e;try{a=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(t){if(r=null,e instanceof Uint8Array)throw t;throw new Error("Source must be a Uint8Array or Buffer but was a "+(e&&"object"==typeof e?e.constructor.name:typeof e))}if(this instanceof m){if(c=this,this.structures)return i=this.structures,S(t);(!i||i.length>0)&&(i=[])}else c=p,(!i||i.length>0)&&(i=[]);return S(t)}unpackMultiple(e,t){let r,n=0;try{w=!0;let i=e.length,s=this?this.unpack(e,i):Q.unpack(e,i);if(!t){for(r=[s];l<i;)n=l,r.push(S());return r}if(!1===t(s,n,l))return;for(;l<i;)if(n=l,!1===t(S(),n,l))return}catch(e){throw e.lastPosition=n,e.values=r,e}finally{w=!1,Z()}}_mergeStructures(e,t){e=e||[],Object.isFrozen(e)&&(e=e.map((e=>e.slice(0))));for(let t=0,r=e.length;t<r;t++){let r=e[t];r&&(r.isShared=!0,t>=32&&(r.highByte=t-32>>5))}e.sharedLength=e.length;for(let r in t||[])if(r>=0){let n=e[r],i=t[r];i&&(n&&((e.restoreStructures||(e.restoreStructures=[]))[r]=n),e[r]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function S(e){try{if(!c.trusted&&!w){let e=i.sharedLength||0;e<i.length&&(i.length=e)}let e;if(c.randomAccessStructure&&r[l]<64&&r[l],e=A(),o&&(l=o.postBundlePosition,o=null),w&&(i.restoreStructures=null),l==n)i&&i.restoreStructures&&U(),i=null,r=null,u&&(u=null);else{if(l>n)throw new Error("Unexpected end of MessagePack data");if(!w){let t;try{t=JSON.stringify(e,((e,t)=>"bigint"==typeof t?`${t}n`:t)).slice(0,100)}catch(e){t="(JSON view not available "+e+")"}throw new Error("Data read, but end of buffer not reached "+t)}}return e}catch(e){throw i&&i.restoreStructures&&U(),Z(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||l>n)&&(e.incomplete=!0),e}}function U(){for(let e in i.restoreStructures)i[e]=i.restoreStructures[e];i.restoreStructures=null}function A(){let e=r[l++];if(e<160){if(e<128){if(e<64)return e;{let t=i[63&e]||c.getStructures&&v()[63&e];return t?(t.read||(t.read=k(t,63&e)),t.read()):e}}if(e<144){if(e-=128,c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=P();"__proto__"===e&&(e="__proto_"),t[e]=A()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(A(),A());return t}}{e-=144;let t=new Array(e);for(let r=0;r<e;r++)t[r]=A();return c.freezeData?Object.freeze(t):t}}if(e<192){let t=e-160;if(h>=l)return s.slice(l-f,(l+=t)-f);if(0==h&&n<140){let e=t<16?F(t):N(t);if(null!=e)return e}return O(t)}{let t;switch(e){case 192:return null;case 193:return o?(t=A(),t>0?o[1].slice(o.position1,o.position1+=t):o[0].slice(o.position0,o.position0-=t)):y;case 194:return!1;case 195:return!0;case 196:if(t=r[l++],void 0===t)throw new Error("Unexpected end of buffer");return R(t);case 197:return t=a.getUint16(l),l+=2,R(t);case 198:return t=a.getUint32(l),l+=4,R(t);case 199:return V(r[l++]);case 200:return t=a.getUint16(l),l+=2,V(t);case 201:return t=a.getUint32(l),l+=4,V(t);case 202:if(t=a.getFloat32(l),c.useFloat32>2){let e=G[(127&r[l])<<1|r[l+1]>>7];return l+=4,(e*t+(t>0?.5:-.5)>>0)/e}return l+=4,t;case 203:return t=a.getFloat64(l),l+=8,t;case 204:return r[l++];case 205:return t=a.getUint16(l),l+=2,t;case 206:return t=a.getUint32(l),l+=4,t;case 207:return"number"===c.int64AsType?(t=4294967296*a.getUint32(l),t+=a.getUint32(l+4)):"string"===c.int64AsType?t=a.getBigUint64(l).toString():"auto"===c.int64AsType?(t=a.getBigUint64(l),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=a.getBigUint64(l),l+=8,t;case 208:return a.getInt8(l++);case 209:return t=a.getInt16(l),l+=2,t;case 210:return t=a.getInt32(l),l+=4,t;case 211:return"number"===c.int64AsType?(t=4294967296*a.getInt32(l),t+=a.getUint32(l+4)):"string"===c.int64AsType?t=a.getBigInt64(l).toString():"auto"===c.int64AsType?(t=a.getBigInt64(l),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=a.getBigInt64(l),l+=8,t;case 212:if(t=r[l++],114==t)return W(63&r[l++]);{let e=g[t];if(e)return e.read?(l++,e.read(A())):e.noBuffer?(l++,e()):e(r.subarray(l,++l));throw new Error("Unknown extension "+t)}case 213:return t=r[l],114==t?(l++,W(63&r[l++],r[l++])):V(2);case 214:return V(4);case 215:return V(8);case 216:return V(16);case 217:return t=r[l++],h>=l?s.slice(l-f,(l+=t)-f):B(t);case 218:return t=a.getUint16(l),h>=(l+=2)?s.slice(l-f,(l+=t)-f):_(t);case 219:return t=a.getUint32(l),h>=(l+=4)?s.slice(l-f,(l+=t)-f):x(t);case 220:return t=a.getUint16(l),l+=2,j(t);case 221:return t=a.getUint32(l),l+=4,j(t);case 222:return t=a.getUint16(l),l+=2,M(t);case 223:return t=a.getUint32(l),l+=4,M(t);default:if(e>=224)return e-256;if(void 0===e){let e=new Error("Unexpected end of MessagePack data");throw e.incomplete=!0,e}throw new Error("Unknown MessagePack token "+e)}}}const I=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function k(e,t){function r(){if(r.count++>b){let r=e.read=new Function("r","return function(){return "+(c.freezeData?"Object.freeze":"")+"({"+e.map((e=>"__proto__"===e?"__proto_:r()":I.test(e)?e+":r()":"["+JSON.stringify(e)+"]:r()")).join(",")+"})}")(A);return 0===e.highByte&&(e.read=E(t,e.read)),r()}let n={};for(let t=0,r=e.length;t<r;t++){let r=e[t];"__proto__"===r&&(r="__proto_"),n[r]=A()}return c.freezeData?Object.freeze(n):n}return r.count=0,0===e.highByte?E(t,r):r}const E=(e,t)=>function(){let n=r[l++];if(0===n)return t();let s=e<32?-(e+(n<<5)):e+(n<<5),o=i[s]||v()[s];if(!o)throw new Error("Record id is not defined for "+s);return o.read||(o.read=k(o,e)),o.read()};function v(){let e=K((()=>(r=null,c.getStructures())));return i=c._mergeStructures(e,i)}var O=T,B=T,_=T,x=T;function T(e){let n;if(e<16&&(n=F(e)))return n;if(e>64&&t)return t.decode(r.subarray(l,l+=e));const i=l+e,s=[];for(n="";l<i;){const e=r[l++];if(0==(128&e))s.push(e);else if(192==(224&e)){const t=63&r[l++];s.push((31&e)<<6|t)}else if(224==(240&e)){const t=63&r[l++],n=63&r[l++];s.push((31&e)<<12|t<<6|n)}else if(240==(248&e)){let t=(7&e)<<18|(63&r[l++])<<12|(63&r[l++])<<6|63&r[l++];t>65535&&(t-=65536,s.push(t>>>10&1023|55296),t=56320|1023&t),s.push(t)}else s.push(e);s.length>=4096&&(n+=D.apply(String,s),s.length=0)}return s.length>0&&(n+=D.apply(String,s)),n}function j(e){let t=new Array(e);for(let r=0;r<e;r++)t[r]=A();return c.freezeData?Object.freeze(t):t}function M(e){if(c.mapsAsObjects){let t={};for(let r=0;r<e;r++){let e=P();"__proto__"===e&&(e="__proto_"),t[e]=A()}return t}{let t=new Map;for(let r=0;r<e;r++)t.set(A(),A());return t}}var D=String.fromCharCode;function N(e){let t=l,n=new Array(e);for(let i=0;i<e;i++){const e=r[l++];if((128&e)>0)return void(l=t);n[i]=e}return D.apply(String,n)}function F(e){if(e<4){if(e<2){if(0===e)return"";{let e=r[l++];return(128&e)>1?void(l-=1):D(e)}}{let t=r[l++],n=r[l++];if((128&t)>0||(128&n)>0)return void(l-=2);if(e<3)return D(t,n);let i=r[l++];return(128&i)>0?void(l-=3):D(t,n,i)}}{let t=r[l++],n=r[l++],i=r[l++],s=r[l++];if((128&t)>0||(128&n)>0||(128&i)>0||(128&s)>0)return void(l-=4);if(e<6){if(4===e)return D(t,n,i,s);{let e=r[l++];return(128&e)>0?void(l-=5):D(t,n,i,s,e)}}if(e<8){let o=r[l++],u=r[l++];if((128&o)>0||(128&u)>0)return void(l-=6);if(e<7)return D(t,n,i,s,o,u);let a=r[l++];return(128&a)>0?void(l-=7):D(t,n,i,s,o,u,a)}{let o=r[l++],u=r[l++],a=r[l++],c=r[l++];if((128&o)>0||(128&u)>0||(128&a)>0||(128&c)>0)return void(l-=8);if(e<10){if(8===e)return D(t,n,i,s,o,u,a,c);{let e=r[l++];return(128&e)>0?void(l-=9):D(t,n,i,s,o,u,a,c,e)}}if(e<12){let f=r[l++],h=r[l++];if((128&f)>0||(128&h)>0)return void(l-=10);if(e<11)return D(t,n,i,s,o,u,a,c,f,h);let g=r[l++];return(128&g)>0?void(l-=11):D(t,n,i,s,o,u,a,c,f,h,g)}{let f=r[l++],h=r[l++],g=r[l++],p=r[l++];if((128&f)>0||(128&h)>0||(128&g)>0||(128&p)>0)return void(l-=12);if(e<14){if(12===e)return D(t,n,i,s,o,u,a,c,f,h,g,p);{let e=r[l++];return(128&e)>0?void(l-=13):D(t,n,i,s,o,u,a,c,f,h,g,p,e)}}{let d=r[l++],y=r[l++];if((128&d)>0||(128&y)>0)return void(l-=14);if(e<15)return D(t,n,i,s,o,u,a,c,f,h,g,p,d,y);let w=r[l++];return(128&w)>0?void(l-=15):D(t,n,i,s,o,u,a,c,f,h,g,p,d,y,w)}}}}}function L(){let e,t=r[l++];if(t<192)e=t-160;else switch(t){case 217:e=r[l++];break;case 218:e=a.getUint16(l),l+=2;break;case 219:e=a.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return T(e)}function R(e){return c.copyBuffers?Uint8Array.prototype.slice.call(r,l,l+=e):r.subarray(l,l+=e)}function V(e){let t=r[l++];if(g[t]){let n;return g[t](r.subarray(l,n=l+=e),(e=>{l=e;try{return A()}finally{l=n}}))}throw new Error("Unknown extension type "+t)}var C=new Array(4096);function P(){let e=r[l++];if(!(e>=160&&e<192))return l--,z(A());if(e-=160,h>=l)return s.slice(l-f,(l+=e)-f);if(!(0==h&&n<180))return O(e);let t,i=4095&(e<<5^(e>1?a.getUint16(l):e>0?r[l]:0)),o=C[i],u=l,c=l+e-3,g=0;if(o&&o.bytes==e){for(;u<c;){if(t=a.getUint32(u),t!=o[g++]){u=1879048192;break}u+=4}for(c+=3;u<c;)if(t=r[u++],t!=o[g++]){u=1879048192;break}if(u===c)return l=u,o.string;c-=3,u=l}for(o=[],C[i]=o,o.bytes=e;u<c;)t=a.getUint32(u),o.push(t),u+=4;for(c+=3;u<c;)t=r[u++],o.push(t);let p=e<16?F(e):N(e);return o.string=null!=p?p:O(e)}function z(e){if("string"==typeof e)return e;if("number"==typeof e)return e.toString();throw new Error("Invalid property type for record",typeof e)}const W=(e,t)=>{let r=A().map(z),n=e;void 0!==t&&(e=e<32?-((t<<5)+e):(t<<5)+e,r.highByte=t);let s=i[e];return s&&(s.isShared||w)&&((i.restoreStructures||(i.restoreStructures=[]))[e]=s),i[e]=r,r.read=k(r,n),r.read()};g[0]=()=>{},g[0].noBuffer=!0,g[66]=e=>{let t=e.length,r=BigInt(128&e[0]?e[0]-256:e[0]);for(let n=1;n<t;n++)r<<=8n,r+=BigInt(e[n]);return r};let J={Error:Error,TypeError:TypeError,ReferenceError:ReferenceError};g[101]=()=>{let e=A();return(J[e[0]]||Error)(e[1])},g[105]=e=>{if(!1===c.structuredClone)throw new Error("Structured clone extension is disabled");let t=a.getUint32(l-4);u||(u=new Map);let n,i=r[l];n=i>=144&&i<160||220==i||221==i?[]:{};let s={target:n};u.set(t,s);let o=A();return s.used?Object.assign(n,o):(s.target=o,o)},g[112]=e=>{if(!1===c.structuredClone)throw new Error("Structured clone extension is disabled");let t=a.getUint32(l-4),r=u.get(t);return r.used=!0,r.target},g[115]=()=>new Set(A());const $=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((e=>e+"Array"));let Y="object"==typeof globalThis?globalThis:window;g[116]=e=>{let t=e[0],r=$[t];if(!r)throw new Error("Could not find typed array for code "+t);return new Y[r](Uint8Array.prototype.slice.call(e,1).buffer)},g[120]=()=>{let e=A();return new RegExp(e[0],e[1])};const q=[];function K(e){let t=n,g=l,p=f,d=h,y=s,b=u,m=o,S=new Uint8Array(r.slice(0,n)),U=i,A=i.slice(0,i.length),I=c,k=w,E=e();return n=t,l=g,f=p,h=d,s=y,u=b,o=m,r=S,w=k,(i=U).splice(0,i.length,...A),c=I,a=new DataView(r.buffer,r.byteOffset,r.byteLength),E}function Z(){r=null,u=null,i=null}g[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],r=l;return l+=t-e.length,o=q,(o=[L(),L()]).position0=0,o.position1=0,o.postBundlePosition=l,l=r,A()},g[255]=e=>4==e.length?new Date(1e3*(16777216*e[0]+(e[1]<<16)+(e[2]<<8)+e[3])):8==e.length?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+1e3*(4294967296*(3&e[3])+16777216*e[4]+(e[5]<<16)+(e[6]<<8)+e[7])):12==e.length?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+1e3*((128&e[4]?-281474976710656:0)+1099511627776*e[6]+4294967296*e[7]+16777216*e[8]+(e[9]<<16)+(e[10]<<8)+e[11])):new Date("invalid");const G=new Array(147);for(let e=0;e<256;e++)G[e]=+("1e"+Math.floor(45.15-.30103*e));const H=m;var Q=new m({useRecords:!1});const X=Q.unpack,ee=Q.unpackMultiple,te=Q.unpack,re={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let ne,ie,se,oe=new Float32Array(1),ue=new Uint8Array(oe.buffer,0,4);try{ne=new TextEncoder}catch(e){}const ae="undefined"!=typeof Buffer,le=ae?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,ce=ae?Buffer:Uint8Array,fe=ae?4294967296:2144337920;let he,ge,pe,de,ye=0,we=null;const be=/[\u0080-\uFFFF]/,me=Symbol("record-id");class Se extends m{constructor(e){let t,r,n,i;super(e),this.offset=0;let s=ce.prototype.utf8Write?function(e,t){return he.utf8Write(e,t,4294967295)}:!(!ne||!ne.encodeInto)&&function(e,t){return ne.encodeInto(e,he.subarray(t)).written},o=this;e||(e={});let u=e&&e.sequential,a=e.structures||e.saveStructures,l=e.maxSharedStructures;if(null==l&&(l=a?32:0),l>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&null==e.moreTypes&&(this.moreTypes=!0);let c=e.maxOwnStructures;null==c&&(c=a?32:64),this.structures||0==e.useRecords||(this.structures=[]);let f=l>32||c+l>64,h=l+64,g=l+c+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],d=0,y=0;this.pack=this.encode=function(e,s){if(he||(he=new le(8192),pe=he.dataView||(he.dataView=new DataView(he.buffer,0,8192)),ye=0),de=he.length-10,de-ye<2048?(he=new le(he.length),pe=he.dataView||(he.dataView=new DataView(he.buffer,0,he.length)),de=he.length-10,ye=0):ye=ye+7&2147483640,t=ye,s&Ne&&(ye+=255&s),i=o.structuredClone?new Map:null,o.bundleStrings&&"string"!=typeof e?(we=[],we.size=1/0):we=null,n=o.structures,n){n.uninitialized&&(n=o._mergeStructures(o.getStructures()));let e=n.sharedLength||0;if(e>l)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let t=0;t<e;t++){let e=n[t];if(!e)continue;let r,i=n.transitions;for(let t=0,n=e.length;t<n;t++){let n=e[t];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[me]=t+64}this.lastNamedStructuresLength=e}u||(n.nextId=e+64)}let a;r&&(r=!1);try{o.randomAccessStructure&&e&&e.constructor&&e.constructor===Object?O(e):m(e);let u=we;if(we&&ke(t,m,0),i&&i.idsToInsert){let e=i.idsToInsert.sort(((e,t)=>e.offset>t.offset?1:-1)),r=e.length,n=-1;for(;u&&r>0;){let i=e[--r].offset+t;i<u.stringsPosition+t&&-1===n&&(n=0),i>u.position+t?n>=0&&(n+=6):(n>=0&&(pe.setUint32(u.position+t,pe.getUint32(u.position+t)+n),n=-1),u=u.previous,r++)}n>=0&&u&&pe.setUint32(u.position+t,pe.getUint32(u.position+t)+n),ye+=6*e.length,ye>de&&k(ye),o.offset=ye;let s=function(e,t){let r,n=6*t.length,i=e.length-n;for(;r=t.pop();){let t=r.offset,s=r.id;e.copyWithin(t+n,t,i),n-=6;let o=t+n;e[o++]=214,e[o++]=105,e[o++]=s>>24,e[o++]=s>>16&255,e[o++]=s>>8&255,e[o++]=255&s,i=t}return e}(he.subarray(t,ye),e);return i=null,s}return o.offset=ye,s&Me?(he.start=t,he.end=ye,he):he.subarray(t,ye)}catch(e){throw a=e,e}finally{if(n&&(w(),r&&o.saveStructures)){let r=n.sharedLength||0,i=he.subarray(t,ye),u=function(e,t){return e.isCompatible=e=>{let r=!e||(t.lastNamedStructuresLength||0)===e.length;return r||t._mergeStructures(e),r},e}(n,o);if(!a)return!1===o.saveStructures(u,u.isCompatible)?o.pack(e,s):(o.lastNamedStructuresLength=r,i)}s&De&&(ye=t)}};const w=()=>{y<10&&y++;let e=n.sharedLength||0;if(n.length>e&&!u&&(n.length=e),d>1e4)n.transitions=null,y=0,d=0,p.length>0&&(p=[]);else if(p.length>0&&!u){for(let e=0,t=p.length;e<t;e++)p[e][me]=0;p=[]}},b=e=>{var t=e.length;t<16?he[ye++]=144|t:t<65536?(he[ye++]=220,he[ye++]=t>>8,he[ye++]=255&t):(he[ye++]=221,pe.setUint32(ye,t),ye+=4);for(let r=0;r<t;r++)m(e[r])},m=e=>{ye>de&&(he=k(ye));var r,n=typeof e;if("string"===n){let n,i=e.length;if(we&&i>=4&&i<4096){if((we.size+=i)>21760){let e,r,n=(we[0]?3*we[0].length+we[1].length:0)+10;ye+n>de&&(he=k(ye+n)),we.position?(r=we,he[ye]=200,ye+=3,he[ye++]=98,e=ye-t,ye+=4,ke(t,m,0),pe.setUint16(e+t-3,ye-t-e)):(he[ye++]=214,he[ye++]=98,e=ye-t,ye+=4),we=["",""],we.previous=r,we.size=0,we.position=e}let r=be.test(e);return we[r?0:1]+=e,he[ye++]=193,void m(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let o=3*i;if(ye+o>de&&(he=k(ye+o)),i<64||!s){let t,s,o,u=ye+n;for(t=0;t<i;t++)s=e.charCodeAt(t),s<128?he[u++]=s:s<2048?(he[u++]=s>>6|192,he[u++]=63&s|128):55296==(64512&s)&&56320==(64512&(o=e.charCodeAt(t+1)))?(s=65536+((1023&s)<<10)+(1023&o),t++,he[u++]=s>>18|240,he[u++]=s>>12&63|128,he[u++]=s>>6&63|128,he[u++]=63&s|128):(he[u++]=s>>12|224,he[u++]=s>>6&63|128,he[u++]=63&s|128);r=u-ye-n}else r=s(e,ye+n);r<32?he[ye++]=160|r:r<256?(n<2&&he.copyWithin(ye+2,ye+1,ye+1+r),he[ye++]=217,he[ye++]=r):r<65536?(n<3&&he.copyWithin(ye+3,ye+2,ye+2+r),he[ye++]=218,he[ye++]=r>>8,he[ye++]=255&r):(n<5&&he.copyWithin(ye+5,ye+3,ye+3+r),he[ye++]=219,pe.setUint32(ye,r),ye+=4),ye+=r}else if("number"===n)if(e>>>0===e)e<32||e<128&&!1===this.useRecords||e<64&&!this.randomAccessStructure?he[ye++]=e:e<256?(he[ye++]=204,he[ye++]=e):e<65536?(he[ye++]=205,he[ye++]=e>>8,he[ye++]=255&e):(he[ye++]=206,pe.setUint32(ye,e),ye+=4);else if(e>>0===e)e>=-32?he[ye++]=256+e:e>=-128?(he[ye++]=208,he[ye++]=e+256):e>=-32768?(he[ye++]=209,pe.setInt16(ye,e),ye+=2):(he[ye++]=210,pe.setInt32(ye,e),ye+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){let r;if(he[ye++]=202,pe.setFloat32(ye,e),t<4||(r=e*G[(127&he[ye])<<1|he[ye+1]>>7])>>0===r)return void(ye+=4);ye--}he[ye++]=203,pe.setFloat64(ye,e),ye+=8}else if("object"===n||"function"===n)if(e){if(i){let r=i.get(e);if(r){if(!r.id){let e=i.idsToInsert||(i.idsToInsert=[]);r.id=e.push(r)}return he[ye++]=214,he[ye++]=112,pe.setUint32(ye,r.id),void(ye+=4)}i.set(e,{offset:ye-t})}let s=e.constructor;if(s===Object)I(e,!0);else if(s===Array)b(e);else if(s===Map)if(this.mapAsEmptyObject)he[ye++]=128;else{(r=e.size)<16?he[ye++]=128|r:r<65536?(he[ye++]=222,he[ye++]=r>>8,he[ye++]=255&r):(he[ye++]=223,pe.setUint32(ye,r),ye+=4);for(let[t,r]of e)m(t),m(r)}else{for(let t=0,r=ie.length;t<r;t++){if(e instanceof se[t]){let r=ie[t];if(r.write){r.type&&(he[ye++]=212,he[ye++]=r.type,he[ye++]=0);let t=r.write.call(this,e);return void(t===e?Array.isArray(e)?b(e):I(e):m(t))}let n,i=he,s=pe,o=ye;he=null;try{n=r.pack.call(this,e,(e=>(he=i,i=null,ye+=e,ye>de&&k(ye),{target:he,targetView:pe,position:ye-e})),m)}finally{i&&(he=i,pe=s,ye=o,de=he.length-10)}return void(n&&(n.length+ye>de&&k(n.length+ye),ye=Ie(n,he,ye,r.type)))}}if(Array.isArray(e))b(e);else{if(e.toJSON){const t=e.toJSON();if(t!==e)return m(t)}if("function"===n)return m(this.writeFunction&&this.writeFunction(e));I(e,!e.hasOwnProperty)}}}else he[ye++]=192;else if("boolean"===n)he[ye++]=e?195:194;else if("bigint"===n){if(e<BigInt(1)<<BigInt(63)&&e>=-(BigInt(1)<<BigInt(63)))he[ye++]=211,pe.setBigInt64(ye,e);else if(e<BigInt(1)<<BigInt(64)&&e>0)he[ye++]=207,pe.setBigUint64(ye,e);else{if(!this.largeBigIntToFloat){if(this.useBigIntExtension&&e<2n**1023n&&e>-(2n**1023n)){he[ye++]=199,ye++,he[ye++]=66;let t,r=[];do{let n=0xffn&e;t=(0x80n&n)===(e<0n?0x80n:0n),r.push(n),e>>=8n}while(0n!==e&&-1n!==e||!t);he[ye-2]=r.length;for(let e=r.length;e>0;)he[ye++]=Number(r[--e]);return}throw new RangeError(e+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension or set largeBigIntToFloat to convert to float-64")}he[ye++]=203,pe.setFloat64(ye,Number(e))}ye+=8}else{if("undefined"!==n)throw new Error("Unknown type: "+n);this.encodeUndefinedAsNil?he[ye++]=192:(he[ye++]=212,he[ye++]=0,he[ye++]=0)}},S=this.variableMapSize||this.coercibleKeyAsNumber?e=>{let t,r=Object.keys(e),n=r.length;if(n<16?he[ye++]=128|n:n<65536?(he[ye++]=222,he[ye++]=n>>8,he[ye++]=255&n):(he[ye++]=223,pe.setUint32(ye,n),ye+=4),this.coercibleKeyAsNumber)for(let i=0;i<n;i++){t=r[i];let n=Number(t);m(isNaN(n)?t:n),m(e[t])}else for(let i=0;i<n;i++)m(t=r[i]),m(e[t])}:(e,r)=>{he[ye++]=222;let n=ye-t;ye+=2;let i=0;for(let t in e)(r||e.hasOwnProperty(t))&&(m(t),m(e[t]),i++);he[n+++t]=i>>8,he[n+t]=255&i},U=!1===this.useRecords?S:e.progressiveRecords&&!f?(e,r)=>{let i,s,o=n.transitions||(n.transitions=Object.create(null)),u=ye++-t;for(let a in e)if(r||e.hasOwnProperty(a)){if(i=o[a],i)o=i;else{let r=Object.keys(e),l=o;o=n.transitions;let c=0;for(let e=0,t=r.length;e<t;e++){let t=r[e];i=o[t],i||(i=o[t]=Object.create(null),c++),o=i}u+t+1==ye?(ye--,E(o,r,c)):v(o,r,u,c),s=!0,o=l[a]}m(e[a])}if(!s){let r=o[me];r?he[u+t]=r:v(o,Object.keys(e),u,0)}}:(e,t)=>{let r,i=n.transitions||(n.transitions=Object.create(null)),s=0;for(let n in e)(t||e.hasOwnProperty(n))&&(r=i[n],r||(r=i[n]=Object.create(null),s++),i=r);let o=i[me];o?o>=96&&f?(he[ye++]=96+(31&(o-=96)),he[ye++]=o>>5):he[ye++]=o:E(i,i.__keys__||Object.keys(e),s);for(let r in e)(t||e.hasOwnProperty(r))&&m(e[r])},A="function"==typeof this.useRecords&&this.useRecords,I=A?(e,t)=>{A(e)?U(e,t):S(e,t)}:U,k=e=>{let r;if(e>16777216){if(e-t>fe)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(fe,4096*Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(e-t<<2,he.length-1)>>12)<<12;let n=new le(r);return pe=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),e=Math.min(e,he.length),he.copy?he.copy(n,0,t,e):n.set(he.slice(t,e)),ye-=t,t=0,de=n.length-10,he=n},E=(e,t,i)=>{let s=n.nextId;s||(s=64),s<h&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(s=n.nextOwnId,s<g||(s=h),n.nextOwnId=s+1):(s>=g&&(s=h),n.nextId=s+1);let o=t.highByte=s>=96&&f?s-96>>5:-1;e[me]=s,e.__keys__=t,n[s-64]=t,s<h?(t.isShared=!0,n.sharedLength=s-63,r=!0,o>=0?(he[ye++]=96+(31&s),he[ye++]=o):he[ye++]=s):(o>=0?(he[ye++]=213,he[ye++]=114,he[ye++]=96+(31&s),he[ye++]=o):(he[ye++]=212,he[ye++]=114,he[ye++]=s),i&&(d+=y*i),p.length>=c&&(p.shift()[me]=0),p.push(e),m(t))},v=(e,r,n,i)=>{let s=he,o=ye,u=de,a=t;he=ge,ye=0,t=0,he||(ge=he=new le(8192)),de=he.length-10,E(e,r,i),ge=he;let l=ye;if(he=s,ye=o,de=u,t=a,l>1){let e=ye+l-1;e>de&&k(e);let r=n+t;he.copyWithin(r+l,r+1,ye),he.set(ge.slice(0,l),r),ye=e}else he[n+t]=ge[0]},O=(e,i)=>{let s=undefined(e,he,t,ye,n,k,((e,t,n)=>{if(n)return r=!0;ye=t;let i=he;return m(e),w(),i!==he?{position:ye,targetView:pe,target:he}:ye}),this);if(0===s)return I(e,!0);ye=s}}useBuffer(e){he=e,pe=new DataView(he.buffer,he.byteOffset,he.byteLength),ye=0}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function Ue(e,t,r,n){let i=e.byteLength;if(i+1<256){var{target:s,position:o}=r(4+i);s[o++]=199,s[o++]=i+1}else if(i+1<65536){var{target:s,position:o}=r(5+i);s[o++]=200,s[o++]=i+1>>8,s[o++]=i+1&255}else{var{target:s,position:o,targetView:u}=r(7+i);s[o++]=201,u.setUint32(o,i+1),o+=4}s[o++]=116,s[o++]=t,s.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o)}function Ae(e,t){let r=e.byteLength;var n,i;if(r<256){var{target:n,position:i}=t(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=t(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:s}=t(r+5);n[i++]=198,s.setUint32(i,r),i+=4}n.set(e,i)}function Ie(e,t,r,n){let i=e.length;switch(i){case 1:t[r++]=212;break;case 2:t[r++]=213;break;case 4:t[r++]=214;break;case 8:t[r++]=215;break;case 16:t[r++]=216;break;default:i<256?(t[r++]=199,t[r++]=i):i<65536?(t[r++]=200,t[r++]=i>>8,t[r++]=255&i):(t[r++]=201,t[r++]=i>>24,t[r++]=i>>16&255,t[r++]=i>>8&255,t[r++]=255&i)}return t[r++]=n,t.set(e,r),r+=i}function ke(e,t,r){if(we.length>0){pe.setUint32(we.position+e,ye+r-we.position-e),we.stringsPosition=ye-e;let n=we;we=null,t(n[0]),t(n[1])}}se=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,d],ie=[{pack(e,t,r){let n=e.getTime()/1e3;if((this.useTimestamp32||0===e.getMilliseconds())&&n>=0&&n<4294967296){let{target:e,targetView:r,position:i}=t(6);e[i++]=214,e[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:s}=t(10);r[s++]=215,r[s++]=255,i.setUint32(s,4e6*e.getMilliseconds()+(n/1e3/4294967296>>0)),i.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return t(0),r(this.onInvalidDate());let{target:e,targetView:n,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:r,targetView:i,position:s}=t(15);r[s++]=199,r[s++]=12,r[s++]=255,i.setUint32(s,1e6*e.getMilliseconds()),i.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(e,t,r){if(this.setAsEmptyObject)return t(0),r({});let n=Array.from(e),{target:i,position:s}=t(this.moreTypes?3:0);this.moreTypes&&(i[s++]=212,i[s++]=115,i[s++]=0),r(n)}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([e.name,e.message])}},{pack(e,t,r){let{target:n,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([e.source,e.flags])}},{pack(e,t){this.moreTypes?Ue(e,16,t):Ae(ae?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let r=e.constructor;r!==ce&&this.moreTypes?Ue(e,$.indexOf(r.name),t):Ae(e,t)}},{pack(e,t){let{target:r,position:n}=t(1);r[n]=193}}];let Ee=new Se({useRecords:!1});const ve=Ee.pack,Oe=Ee.pack,Be=Se,{NEVER:_e,ALWAYS:xe,DECIMAL_ROUND:Te,DECIMAL_FIT:je}=re,Me=512,De=1024,Ne=2048;const Fe=function(e,t={}){if(!e||"object"!=typeof e)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new m(t);let n;const i=e=>{let t;n&&(e=Buffer.concat([n,e]),n=void 0);try{t=r.unpackMultiple(e)}catch(r){if(!r.incomplete)throw r;n=e.slice(r.lastPosition),t=r.values}return t};return"function"==typeof e[Symbol.iterator]?function*(){for(const t of e)yield*i(t)}():"function"==typeof e[Symbol.asyncIterator]?async function*(){for await(const t of e)yield*i(t)}():void 0},Le=function(e,t={}){if(e&&"object"==typeof e){if("function"==typeof e[Symbol.iterator])return function*(e,t){const r=new Se(t);for(const t of e)yield r.pack(t)}(e,t);if("function"==typeof e.then||"function"==typeof e[Symbol.asyncIterator])return async function*(e,t){const r=new Se(t);for await(const t of e)yield r.pack(t)}(e,t);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")};e.ALWAYS=xe,e.C1=y,e.DECIMAL_FIT=je,e.DECIMAL_ROUND=Te,e.Decoder=H,e.Encoder=Be,e.FLOAT32_OPTIONS=re,e.NEVER=_e,e.Packr=Se,e.REUSE_BUFFER_MODE=Me,e.Unpackr=m,e.addExtension=function(e){if(e.Class){if(!e.pack&&!e.write)throw new Error("Extension has no pack or write function");if(e.pack&&!e.type)throw new Error("Extension has no type (numeric code to identify the extension)");se.unshift(e.Class),ie.unshift(e)}!function(e){e.unpack?g[e.type]=e.unpack:g[e.type]=e}(e)},e.clearSource=Z,e.decode=te,e.decodeIter=Fe,e.encode=Oe,e.encodeIter=Le,e.isNativeAccelerationEnabled=!1,e.mapsAsObjects=!0,e.pack=ve,e.roundFloat32=function(e){oe[0]=e;let t=G[(127&ue[3])<<1|ue[2]>>7];return(t*e+(e>0?.5:-.5)>>0)/t},e.unpack=X,e.unpackMultiple=ee,e.useRecords=!1})); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "msgpackr", | ||
"author": "Kris Zyp", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "Ultra-fast MessagePack implementation with extensions for records and structured cloning", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -917,3 +917,3 @@ var decoder | ||
position-- | ||
return read().toString() | ||
return asSafeString(read()) | ||
} | ||
@@ -970,5 +970,11 @@ let key = ((length << 5) ^ (length > 1 ? dataView.getUint16(position) : length > 0 ? src[position] : 0)) & 0xfff | ||
function asSafeString(property) { | ||
if (typeof property === 'string') return property; | ||
if (typeof property === 'number') return property.toString(); | ||
throw new Error('Invalid property type for record', typeof property); | ||
} | ||
// the registration of the record definition extension (as "r") | ||
const recordDefinition = (id, highByte) => { | ||
let structure = read().map(property => property.toString()) // ensure that all keys are strings and that the array is mutable | ||
let structure = read().map(asSafeString) // ensure that all keys are strings and | ||
// that the array is mutable | ||
let firstByte = id | ||
@@ -1012,2 +1018,3 @@ if (highByte !== undefined) { | ||
// id extension (for structured clones) | ||
if (currentUnpackr.structuredClone === false) throw new Error('Structured clone extension is disabled') | ||
let id = dataView.getUint32(position - 4) | ||
@@ -1036,2 +1043,3 @@ if (!referenceMap) | ||
// pointer extension (for structured clones) | ||
if (currentUnpackr.structuredClone === false) throw new Error('Structured clone extension is disabled') | ||
let id = dataView.getUint32(position - 4) | ||
@@ -1038,0 +1046,0 @@ let refEntry = referenceMap.get(id) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1885224
16330