@dcl/sdk 7.0.0-2906745229.commit-d06bc1c → 7.0.0-2906812801.commit-277a94d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(exports){"use strict";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},dist$1={},Quaternion={},Vector3$1={},hasRequiredVector3;function requireVector3(){return hasRequiredVector3||(hasRequiredVector3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Vector3=void 0,function(e){function t(e=0,t=0,n=0){return{x:e,y:t,z:n}}function n(e,t){t.x=e.x,t.y=e.y,t.z=e.z}function r(e){return Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z)}function o(e,t,n){n.x=e.x*t,n.y=e.y*t,n.z=e.z*t}function i(e,n){const r=t(0,0,0);return a(e,n,r),r}function a(e,t,r){0!==t&&1!==t?o(e,1/t,r):n(e,r)}function s(e,t,n,r){r.x=e.x+(t.x-e.x)*n,r.y=e.y+(t.y-e.y)*n,r.z=e.z+(t.z-e.z)*n}e.create=t,e.add=function(e,t){return{x:e.x+t.x,y:e.y+t.y,z:e.z+t.z}},e.subtract=function(e,t){return{x:e.x-t.x,y:e.y-t.y,z:e.z-t.z}},e.subtractToRef=function(e,t,n){n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z},e.opposite=function(e){return{x:-e.x,y:-e.y,z:-e.z}},e.copy=n,e.clone=function(e){return Object.assign({},e)},e.length=r,e.lengthSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},e.scaleToRef=o,e.scale=function(e,n){return t(e.x*n,e.y*n,e.z*n)},e.normalizeFromLength=i,e.normalizeFromLengthToRef=a,e.normalize=function(e){return i(e,r(e))},e.normalizeToRef=function(e,t){a(e,r(e),t)},e.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},e.rotate=function(e,t){const{x:n,y:r,z:o}=e,{x:i,y:a,z:s,w:c}=t,u=c*n+a*o-s*r,l=c*r+s*n-i*o,f=c*o+i*r-a*n,d=-i*n-a*r-s*o;return{x:u*c+d*-i+l*-s-f*-a,y:l*c+d*-a+f*-i-u*-s,z:f*c+d*-s+u*-a-l*-i}},e.lerp=function(e,n,r){const o=t(0,0,0);return s(e,n,r,o),o},e.lerpToRef=s,e.cross=function(t,n){const r=e.Zero();return e.crossToRef(t,n,r),r},e.crossToRef=function(e,t,n){n.x=e.y*t.z-e.z*t.y,n.y=e.z*t.x-e.x*t.z,n.z=e.x*t.y-e.y*t.x},e.Zero=function(){return t(0,0,0)},e.One=function(){return t(1,1,1)},e.Up=function(){return t(0,1,0)},e.Down=function(){return t(0,-1,0)},e.Forward=function(){return t(0,0,1)},e.Backward=function(){return t(0,0,-1)},e.Right=function(){return t(1,0,0)},e.Left=function(){return t(-1,0,0)}}(e.Vector3||(e.Vector3={}))}(Vector3$1)),Vector3$1}var Scalar={},hasRequiredScalar;function requireScalar(){if(hasRequiredScalar)return Scalar;hasRequiredScalar=1,Object.defineProperty(Scalar,"__esModule",{value:!0}),Scalar.Scalar=void 0;const e=2*Math.PI;function t(e){const t=+e;return 0===t||isNaN(t)?t:t>0?1:-1}function n(e,t=0,n=1){return Math.min(n,Math.max(t,e))}function r(e,t){return e-Math.floor(e/t)*t}function o(e,t){let n=r(t-e,360);return n>180&&(n-=360),n}function i(e,n,r){let o=0;return o=Math.abs(n-e)<=r?n:e+t(n-e)*r,o}return Scalar.Scalar={withinEpsilon:function(e,t,n=1401298e-51){const r=e-t;return-n<=r&&r<=n},toHex:function(e){const t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()},sign:t,clamp:n,log2:function(e){return Math.log(e)*Math.LOG2E},repeat:r,normalize:function(e,t,n){return(e-t)/(n-t)},denormalize:function(e,t,n){return e*(n-t)+t},deltaAngle:o,pingPong:function(e,t){const n=r(e,2*t);return t-Math.abs(n-t)},smoothStep:function(e,t,r){let o=n(r);return o=-2*o*o*o+3*o*o,t*o+e*(1-o)},moveTowards:i,moveTowardsAngle:function(e,t,n){const r=o(e,t);let a=0;return a=-n<r&&r<n?t:i(e,e+r,n),a},lerp:function(e,t,n){return e+(t-e)*n},lerpAngle:function(e,t,o){let i=r(t-e,360);return i>180&&(i-=360),e+i*n(o)},inverseLerp:function(e,t,r){let o=0;return o=e!==t?n((r-e)/(t-e)):0,o},hermite:function(e,t,n,r,o){const i=o*o,a=o*i;return e*(2*a-3*i+1)+n*(-2*a+3*i)+t*(a-2*i+o)+r*(a-i)},randomRange:function(e,t){return e===t?e:Math.random()*(t-e)+e},rangeToPercent:function(e,t,n){return(e-t)/(n-t)},percentToRange:function(e,t,n){return(n-t)*e+t},normalizeRadians:function(t){return t-e*Math.floor((t+Math.PI)/e)},TwoPi:e},Scalar}var types$1={},hasRequiredTypes$1,hasRequiredQuaternion,hasRequiredDist$1;function requireTypes$1(){return hasRequiredTypes$1||(hasRequiredTypes$1=1,function(e){var t,n;Object.defineProperty(e,"__esModule",{value:!0}),e.RAD2DEG=e.DEG2RAD=e.Epsilon=e.ToLinearSpace=e.ToGammaSpace=e.Space=e.Orientation=void 0,(t=e.Orientation||(e.Orientation={}))[t.CW=0]="CW",t[t.CCW=1]="CCW",(n=e.Space||(e.Space={}))[n.LOCAL=0]="LOCAL",n[n.WORLD=1]="WORLD",n[n.BONE=2]="BONE",e.ToGammaSpace=1/2.2,e.ToLinearSpace=2.2,e.Epsilon=1e-6,e.DEG2RAD=Math.PI/180,e.RAD2DEG=360/(2*Math.PI)}(types$1)),types$1}function requireQuaternion(){return hasRequiredQuaternion||(hasRequiredQuaternion=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Quaternion=void 0;const t=requireVector3(),n=requireScalar(),r=requireTypes$1();!function(e){function o(e=0,t=0,n=0,r=1){return{x:e,y:t,z:n,w:r}}function i(e,t,n){const r=.5*t,i=.5*e,a=.5*n,s=Math.cos(r),c=Math.cos(i),u=Math.cos(a),l=Math.sin(r),f=Math.sin(i),d=Math.sin(a);return o(c*l*u+f*s*d,f*s*u-c*l*d,c*s*d-f*l*u,c*s*u+f*l*d)}function a(e){return Math.sqrt(s(e))}function s(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w}function c(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w}function u(e,t){const n=c(e,t);return 2*Math.acos(Math.min(Math.abs(n),1))*r.RAD2DEG}function l(e){const t=1/a(e);return o(e.x*t,e.y*t,e.z*t,e.w*t)}function f(){return o(0,0,0,1)}function d(t,n,r){const o=e.Identity();return e.slerpToRef(t,n,r,o),o}function p(e,t,n){n.x=e.x*t.w+e.y*t.z-e.z*t.y+e.w*t.x,n.y=-e.x*t.z+e.y*t.w+e.z*t.x+e.w*t.y,n.z=e.x*t.y-e.y*t.x+e.z*t.w+e.w*t.z,n.w=-e.x*t.x-e.y*t.y-e.z*t.z+e.w*t.w}e.create=o,e.add=function(e,t){return{x:e.x+t.x,y:e.y+t.y,z:e.z+t.z,w:e.w+t.w}},e.rotationYawPitchRoll=i,e.euler=function(e,t,n){return i(t*r.DEG2RAD,e*r.DEG2RAD,n*r.DEG2RAD)},e.length=a,e.lengthSquared=s,e.dot=c,e.angle=u,e.rotateTowards=function(e,t,n){const r=u(e,t);return 0===r?t:d(e,t,Math.min(1,n/r))},e.lookRotation=function(e,n={x:0,y:1,z:0}){const r=t.Vector3.normalize(e),i=t.Vector3.normalize(t.Vector3.cross(n,r)),a=t.Vector3.cross(r,i),s=i.x,c=i.y,u=i.z,l=a.x,f=a.y,d=a.z,p=r.x,h=r.y,m=r.z,y=s+f+m,g=o();if(y>0){let e=Math.sqrt(y+1);return g.w=.5*e,e=.5/e,g.x=(d-h)*e,g.y=(p-u)*e,g.z=(c-l)*e,g}if(s>=f&&s>=m){const e=Math.sqrt(1+s-f-m),t=.5/e;return g.x=.5*e,g.y=(c+l)*t,g.z=(u+p)*t,g.w=(d-h)*t,g}if(f>m){const e=Math.sqrt(1+f-s-m),t=.5/e;return g.x=(l+c)*t,g.y=.5*e,g.z=(h+d)*t,g.w=(p-u)*t,g}const b=Math.sqrt(1+m-s-f),v=.5/b;return g.x=(p+u)*v,g.y=(h+d)*v,g.z=.5*b,g.w=(c-l)*v,g},e.normalize=l,e.fromToRotation=function(e,n,r=t.Vector3.Up()){const i=t.Vector3.normalize(e),a=t.Vector3.normalize(n),s=t.Vector3.cross(i,a),c=Math.sqrt(t.Vector3.lengthSquared(i)*t.Vector3.lengthSquared(a))+t.Vector3.dot(i,a);return t.Vector3.lengthSquared(s)<1e-4?Math.abs(c)<1e-4?l(o(r.x,r.y,r.z,0)):f():l(o(s.x,s.y,s.z,c))},e.Identity=f,e.eulerAngles=function(e){const o=t.Vector3.create(),i=e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w,a=e.x*e.w-e.y*e.z;return a>.4995*i?(o.x=Math.PI/2,o.y=2*Math.atan2(e.y,e.x),o.z=0):a<-.4995*i?(o.x=-Math.PI/2,o.y=-2*Math.atan2(e.y,e.x),o.z=0):(o.x=Math.asin(2*(e.w*e.x-e.y*e.z)),o.y=Math.atan2(2*e.w*e.y+2*e.z*e.x,1-2*(e.x*e.x+e.y*e.y)),o.z=Math.atan2(2*e.w*e.z+2*e.x*e.y,1-2*(e.z*e.z+e.x*e.x))),o.x*=r.RAD2DEG,o.y*=r.RAD2DEG,o.z*=r.RAD2DEG,o.x=n.Scalar.repeat(o.x,360),o.y=n.Scalar.repeat(o.y,360),o.z=n.Scalar.repeat(o.z,360),o},e.rotationYawPitchRollToRef=function(e,t,n,r){const o=.5*t,i=.5*e,a=.5*n,s=Math.cos(o),c=Math.cos(i),u=Math.cos(a),l=Math.sin(o),f=Math.sin(i),d=Math.sin(a);r.x=c*l*u+f*s*d,r.y=f*s*u-c*l*d,r.z=c*s*d-f*l*u,r.w=c*s*u+f*l*d},e.fromRotationMatrixToRef=function(e,t){const n=e._m,r=n[0],o=n[4],i=n[8],a=n[1],s=n[5],c=n[9],u=n[2],l=n[6],f=n[10],d=r+s+f;let p;d>0?(p=.5/Math.sqrt(d+1),t.w=.25/p,t.x=(l-c)*p,t.y=(i-u)*p,t.z=(a-o)*p):r>s&&r>f?(p=2*Math.sqrt(1+r-s-f),t.w=(l-c)/p,t.x=.25*p,t.y=(o+a)/p,t.z=(i+u)/p):s>f?(p=2*Math.sqrt(1+s-r-f),t.w=(i-u)/p,t.x=(o+a)/p,t.y=.25*p,t.z=(c+l)/p):(p=2*Math.sqrt(1+f-r-s),t.w=(a-o)/p,t.x=(i+u)/p,t.y=(c+l)/p,t.z=.25*p)},e.slerp=d,e.slerpToRef=function(e,t,n,r){let o,i,a=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w,s=!1;if(a<0&&(s=!0,a=-a),a>.999999)i=1-n,o=s?-n:n;else{const e=Math.acos(a),t=1/Math.sin(e);i=Math.sin((1-n)*e)*t,o=s?-Math.sin(n*e)*t:Math.sin(n*e)*t}r.x=i*e.x+o*t.x,r.y=i*e.y+o*t.y,r.z=i*e.z+o*t.z,r.w=i*e.w+o*t.w},e.multiply=function(e,t){const n=o(0,0,0,1);return p(e,t,n),n},e.multiplyToRef=p,e.angleAxis=function(n,o){if(0===t.Vector3.lengthSquared(o))return e.Identity();const i=f();let a=n*r.DEG2RAD;a*=.5;const s=t.Vector3.normalize(o);return t.Vector3.scaleToRef(s,Math.sin(a),s),i.x=s.x,i.y=s.y,i.z=s.z,i.w=Math.cos(a),l(i)},e.Zero=function(){return o(0,0,0,0)}}(e.Quaternion||(e.Quaternion={}))}(Quaternion)),Quaternion}function requireDist$1(){return hasRequiredDist$1||(hasRequiredDist$1=1,function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(requireQuaternion(),e),n(requireVector3(),e),n(requireTypes$1(),e),n(requireDist$1(),e)}(dist$1)),dist$1}var distExports$1=requireDist$1(),dist={},types={},hasRequiredTypes,hasRequiredDist;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,Object.defineProperty(types,"__esModule",{value:!0})),types}function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};function r(e,t){if(e===t)return!0;if(e instanceof Uint8Array&&t instanceof Uint8Array){if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}return!!(globalThis.Buffer&&e instanceof Buffer&&t instanceof Buffer)&&e.equals(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.crdtProtocol=e.stateIterator=e.sameData=void 0,n(requireTypes(),e),e.sameData=r,e.stateIterator=function*(e){for(const[t,n]of e.entries())for(const[e,r]of n.entries())yield[t,e,r]},e.crdtProtocol=function(){const e=new Map;function t(t,n,r,o){const i=e.get(t),a=Math.max(o,i?.get(n)?.timestamp||0);if(i)i.set(n,{timestamp:a,data:r});else{const o=new Map;o.set(n,{timestamp:a,data:r}),e.set(t,o)}return{timestamp:a,data:r}}return{createEvent:function(n,r,o){const i=(e.get(n)?.get(r)?.timestamp||0)+1;return t(n,r,o,i),{key1:n,key2:r,data:o,timestamp:i}},processMessage:function(n){const{key1:o,key2:i,data:a,timestamp:s}=n,c=e.get(o)?.get(i);return!c||c.timestamp<s?(t(o,i,a,s),n):c.timestamp>s?{key1:o,key2:i,data:c.data,timestamp:c.timestamp}:r(c.data,a)?n:function(e,t){return e>t}(c.data,a)?{key1:o,key2:i,data:c.data,timestamp:c.timestamp}:(t(o,i,a,s).data,n)},getState:function(){return e}}}}(dist)),dist}var distExports=requireDist();function getNextSize(e,t){const n=Math.max(e,t)+1024;return 1024*Math.ceil(n/1024)}const defaultInitialCapacity=10240;function createByteBuffer(e={}){var t;const n=(null===(t=e.reading)||void 0===t?void 0:t.currentOffset)||0;let r=null,o=0;e.writing?(r=e.writing.buffer,e.writing.currentOffset&&(o=e.writing.currentOffset)):e.reading?(r=e.reading.buffer,o=e.reading.length||e.reading.buffer.length):r=new Uint8Array(e.initialCapacity||defaultInitialCapacity);let i=r,a=new DataView(i.buffer,i.byteOffset),s=o,c=n;const u=e=>{if(s+e>i.byteLength){const t=getNextSize(i.byteLength,s+e),n=new Uint8Array(t);n.set(i),i=n,a=new DataView(i.buffer)}return s+=e,s-e},l=e=>{if(c+e>s)throw new Error("Outside of the bounds of writen data.");return c+=e,c-e};return{buffer:()=>i,bufferLength:()=>i.length,resetBuffer(){c=0,s=0},currentReadOffset:()=>c,currentWriteOffset:()=>s,incrementReadOffset:e=>l(e),remainingBytes:()=>s-c,readFloat32:()=>a.getFloat32(l(4)),readFloat64:()=>a.getFloat64(l(8)),readInt8:()=>a.getInt8(l(1)),readInt16:()=>a.getInt16(l(2)),readInt32:()=>a.getInt32(l(4)),readInt64:()=>a.getBigInt64(l(8)),readUint8:()=>a.getUint8(l(1)),readUint16:()=>a.getUint16(l(2)),readUint32:()=>a.getUint32(l(4)),readUint64:()=>a.getBigUint64(l(8)),readBuffer(){const e=a.getUint32(l(4));return i.subarray(l(e),l(0))},incrementWriteOffset:e=>u(e),size:()=>s,toBinary:()=>i.subarray(0,s),toCopiedBinary(){return new Uint8Array(this.toBinary())},writeBuffer(e,t=!0){t&&this.writeUint32(e.byteLength);const n=u(e.byteLength);i.set(e,n)},writeFloat32(e){const t=u(4);a.setFloat32(t,e)},writeFloat64(e){const t=u(8);a.setFloat64(t,e)},writeInt8(e){const t=u(1);a.setInt8(t,e)},writeInt16(e){const t=u(2);a.setInt16(t,e)},writeInt32(e){const t=u(4);a.setInt32(t,e)},writeInt64(e){const t=u(8);a.setBigInt64(t,e)},writeUint8(e){const t=u(1);a.setUint8(t,e)},writeUint16(e){const t=u(2);a.setUint16(t,e)},writeUint32(e){const t=u(4);a.setUint32(t,e)},writeUint64(e){const t=u(8);a.setBigUint64(t,e)},getFloat32:e=>a.getFloat32(e),getFloat64:e=>a.getFloat64(e),getInt8:e=>a.getInt8(e),getInt16:e=>a.getInt16(e),getInt32:e=>a.getInt32(e),getInt64:e=>a.getBigInt64(e),getUint8:e=>a.getUint8(e),getUint16:e=>a.getUint16(e),getUint32:e=>a.getUint32(e),getUint64:e=>a.getBigUint64(e),setFloat32(e,t){a.setFloat32(e,t)},setFloat64(e,t){a.setFloat64(e,t)},setInt8(e,t){a.setInt8(e,t)},setInt16(e,t){a.setInt16(e,t)},setInt32(e,t){a.setInt32(e,t)},setInt64(e,t){a.setBigInt64(e,t)},setUint8(e,t){a.setUint8(e,t)},setUint16(e,t){a.setUint16(e,t)},setUint32(e,t){a.setUint32(e,t)},setUint64(e,t){a.setBigUint64(e,t)}}}var WireMessage;!function(e){var t;function n(t){const n=t.remainingBytes();if(n<e.HEADER_LENGTH)return!1;return!(n<t.getUint32(t.currentReadOffset()))}(t=e.Enum||(e.Enum={}))[t.RESERVED=0]="RESERVED",t[t.PUT_COMPONENT=1]="PUT_COMPONENT",t[t.DELETE_COMPONENT=2]="DELETE_COMPONENT",t[t.MAX_MESSAGE_TYPE=3]="MAX_MESSAGE_TYPE",e.HEADER_LENGTH=8,e.validate=n,e.readHeader=function(e){return n(e)?{length:e.readUint32(),type:e.readUint32()}:null}}(WireMessage||(WireMessage={}));var WireMessage$1=WireMessage,ComponentOperation,EntityUtils;function crdtSceneSystem({engine:e,transports:t}){const n=distExports.crdtProtocol(),r=[],o=[];function i(e){const t=Array.from(e);return e.length=0,t}return t.forEach((e=>{return e.onmessage=(t=e.type,function(e){const n=createByteBuffer({reading:{buffer:e,currentOffset:0}});for(;WireMessage$1.validate(n);){const e=n.currentReadOffset(),o=ComponentOperation.read(n),{type:i,entity:a,componentId:s,data:c,timestamp:u}=o;r.push({type:i,entity:a,componentId:s,data:c,timestamp:u,transportType:t,messageBuffer:n.buffer().subarray(e,n.currentReadOffset())})}});var t})),{createMessages:function(r){const a=i(o),s=createByteBuffer();for(const[o,i]of r)for(const r of i){const i=e.getComponent(r),c=i.has(o)?i.toBinary(o).toBinary():null,u=n.createEvent(o,r,c),l=s.currentWriteOffset(),f=i.has(o)?WireMessage$1.Enum.PUT_COMPONENT:WireMessage$1.Enum.DELETE_COMPONENT,d={type:f,componentId:r,entity:o,timestamp:u.timestamp};t.some((e=>e.filter(d)))&&(ComponentOperation.write(f,o,u.timestamp,i,s),a.push({...d,messageBuffer:s.buffer().subarray(l,s.currentWriteOffset())}))}const c=createByteBuffer();for(const e of t){c.resetBuffer();for(const t of a)e.filter(t)&&c.writeBuffer(t.messageBuffer,!1);c.size()&&e.send(c.toBinary())}},receiveMessages:function(){const a=i(r);for(const r of t){const t=createByteBuffer();for(const r of a){const{data:i,timestamp:a,componentId:s,entity:c,type:u}=r,l={key1:c,key2:s,data:i||null,timestamp:a},f=e.getComponent(s),d=n.processMessage(l);if(l!==d){const e=f.has(c)?WireMessage$1.Enum.PUT_COMPONENT:WireMessage$1.Enum.DELETE_COMPONENT;ComponentOperation.write(e,c,d.timestamp,f,t)}else{if(u===WireMessage$1.Enum.DELETE_COMPONENT)f.deleteFrom(c);else{const e=createByteBuffer({reading:{buffer:r.data,currentOffset:0}});f.upsertFromBinary(r.entity,e),f.clearDirty()}o.push(r)}}t.size()&&r.send(t.toBinary())}}}}function EntityContainer(){const e=Entity(EntityUtils.STATIC_ENTITIES_RANGE),t=Entity(EntityUtils.DYNAMIC_ENTITIES_RANGE);return{generateEntity:(n=!1)=>n?t.generateEntity():e.generateEntity(),removeEntity:n=>e.removeEntity(n)||t.removeEntity(n),isEntityExists:n=>EntityUtils.isReservedEntity(n)||e.getExistingEntities().has(n)||t.getExistingEntities().has(n),getExistingEntities:()=>new Set([...e.getExistingEntities(),...t.getExistingEntities()])}}function Entity(e){let t=e[0];const n=new Set;return{getExistingEntities:()=>new Set(n),generateEntity:function(){if(t>=e[1])throw new Error(`It fails trying to generate an entity out of range [${e[0]}, ${e[1]}].`);const r=t;return t++,n.add(r),r},removeEntity:function(e){return n.delete(e)}}}function deepReadonly(e){return Object.freeze({...e})}function defineComponent(e,t){const n=new Map,r=new Set;return{_id:e,default:function(){return t.create()},isDirty:function(e){return r.has(e)},has:function(e){return n.has(e)},deleteFrom:function(e){const t=n.get(e);return n.delete(e),r.add(e),t||null},getOrNull:function(e){const t=n.get(e);return t?deepReadonly(t):null},get:function(t){const r=n.get(t);if(!r)throw new Error(`[getFrom] Component ${e} for ${t} not found`);return deepReadonly(r)},create:function(o,i){if(n.get(o))throw new Error(`[create] Component ${e} for ${o} already exists`);const a=void 0===i?t.create():i;return n.set(o,a),r.add(o),a},createOrReplace:function(e,o){const i=void 0===o?t.create():o;return n.set(e,i),r.add(e),i},getMutableOrNull:function(e){const t=n.get(e);return t?(r.add(e),t):null},getMutable:function(t){const n=this.getMutableOrNull(t);if(null===n)throw new Error(`[mutable] Component ${e} for ${t} not found`);return n},iterator:function*(){for(const[e,t]of n)yield[e,t]},dirtyIterator:function*(){for(const e of r)yield e},toBinary(r){const o=n.get(r);if(!o)throw new Error(`[toBinary] Component ${e} for ${r} not found`);const i=createByteBuffer();return t.serialize(o,i),i},writeToByteBuffer(r,o){const i=n.get(r);if(!i)throw new Error(`[writeToByteBuffer] Component ${e} for ${r} not found`);t.serialize(i,o)},updateFromBinary(t,r){if(!n.get(t))throw new Error(`[updateFromBinary] Component ${e} for ${t} not found`);return this.upsertFromBinary(t,r)},upsertFromBinary(e,o){const i=t.deserialize(o);return n.set(e,i),r.add(e),i},clearDirty:function(){r.clear()}}}!function(e){e.MESSAGE_HEADER_LENGTH=20,e.write=function(t,n,r,o,i){const a=i.incrementWriteOffset(WireMessage$1.HEADER_LENGTH+e.MESSAGE_HEADER_LENGTH);t===WireMessage$1.Enum.PUT_COMPONENT&&o.writeToByteBuffer(n,i);const s=i.size()-a;i.setUint32(a,s),i.setUint32(a+4,t),i.setUint32(a+8,n),i.setUint32(a+12,o._id),i.setUint64(a+16,BigInt(r)),i.setUint32(a+24,s-e.MESSAGE_HEADER_LENGTH-WireMessage$1.HEADER_LENGTH)},e.read=function(e){const t=WireMessage$1.readHeader(e);if(!t)return null;const n={...t,entity:e.readUint32(),componentId:e.readInt32(),timestamp:Number(e.readUint64())};return t.type===WireMessage$1.Enum.DELETE_COMPONENT?n:{...n,data:e.readBuffer()}}}(ComponentOperation||(ComponentOperation={})),function(e){function t(e,t){return e>=t[0]&&e<=t[1]}e.MAX_ENTITIES=4294967295,e.DYNAMIC_ENTITIES_START_AT=1e5,e.RESERVED_STATIC_ENTITIES=512,e.RESERVED_ENTITIES_RANGE=[0,e.RESERVED_STATIC_ENTITIES-1],e.STATIC_ENTITIES_RANGE=[e.RESERVED_STATIC_ENTITIES,e.DYNAMIC_ENTITIES_START_AT-1],e.DYNAMIC_ENTITIES_RANGE=[e.DYNAMIC_ENTITIES_START_AT,e.MAX_ENTITIES],e.isDynamicEntity=function(n){return t(n,e.DYNAMIC_ENTITIES_RANGE)},e.isStaticEntity=function(n){return t(n,e.STATIC_ENTITIES_RANGE)},e.isReservedEntity=function(n){return t(n,e.RESERVED_ENTITIES_RANGE)}}(EntityUtils||(EntityUtils={}));const SYSTEMS_REGULAR_PRIORITY=1e5;function SystemContainer(){const e=[];function t(){e.sort(((e,t)=>t.priority-e.priority))}return{add:function(n,r,o){if(e.find((e=>e.fn===n)))throw new Error("System already added");if(o&&e.find((e=>e.name===o)))throw new Error("System name already used");e.push({fn:n,priority:r,name:o}),t()},remove:function(n){let r=-1;return r="string"==typeof n?e.findIndex((e=>e.name===n)):e.findIndex((e=>e.fn===n)),-1!==r&&(e.splice(r,1),t(),!0)},getSystems:()=>e}}const COMPONENT_ID$j=1,TRANSFORM_LENGTH=44,TransformSchema={serialize(e,t){const n=t.incrementWriteOffset(TRANSFORM_LENGTH);t.setFloat32(n,e.position.x),t.setFloat32(n+4,e.position.y),t.setFloat32(n+8,e.position.z),t.setFloat32(n+12,e.rotation.x),t.setFloat32(n+16,e.rotation.y),t.setFloat32(n+20,e.rotation.z),t.setFloat32(n+24,e.rotation.w),t.setFloat32(n+28,e.scale.x),t.setFloat32(n+32,e.scale.y),t.setFloat32(n+36,e.scale.z),t.setUint32(n+40,e.parent||0)},deserialize(e){const t=e.incrementReadOffset(TRANSFORM_LENGTH);return{position:{x:e.getFloat32(t),y:e.getFloat32(t+4),z:e.getFloat32(t+8)},rotation:{x:e.getFloat32(t+12),y:e.getFloat32(t+16),z:e.getFloat32(t+20),w:e.getFloat32(t+24)},scale:{x:e.getFloat32(t+28),y:e.getFloat32(t+32),z:e.getFloat32(t+36)},parent:e.getUint32(t+40)}},create:()=>({position:{x:0,y:0,z:0},scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0,w:1},parent:void 0})};var minimal$1={exports:{}},indexMinimal={},minimal={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var n=new Array(arguments.length-1),r=0,o=2,i=!0;for(;o<arguments.length;)n[r++]=arguments[o++];return new Promise((function(o,a){n[r]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];o.apply(null,t)}};try{e.apply(t||null,n)}catch(e){i&&(i=!1,a(e))}}))}}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var n=new Array(64),r=new Array(123),o=0;o<64;)r[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;t.encode=function(e,t,r){for(var o,i=null,a=[],s=0,c=0;t<r;){var u=e[t++];switch(c){case 0:a[s++]=n[u>>2],o=(3&u)<<4,c=1;break;case 1:a[s++]=n[o|u>>4],o=(15&u)<<2,c=2;break;case 2:a[s++]=n[o|u>>6],a[s++]=n[63&u],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[o],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,n){for(var o,a=n,s=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&s>1)break;if(void 0===(u=r[u]))throw Error(i);switch(s){case 0:o=u,s=1;break;case 1:t[n++]=o<<2|(48&u)>>4,o=u,s=2;break;case 2:t[n++]=(15&o)<<4|(60&u)>>2,o=u,s=3;break;case 3:t[n++]=(3&o)<<6|u,s=0}}if(1===s)throw Error(i);return n-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64)),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function i(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:i,e.writeFloatBE=r?i:o,e.readFloatLE=r?a:s,e.readFloatBE=r?s:a}():function(){function i(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),o=2*(r>>31)+1,i=r>>>23&255,a=8388607&r;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=i.bind(null,t),e.writeFloatBE=i.bind(null,n),e.readFloatLE=a.bind(null,r),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function i(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:i,e.writeDoubleBE=r?i:o,e.readDoubleLE=r?a:s,e.readDoubleBE=r?s:a}():function(){function i(e,t,n,r,o,i){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,o,i+t),e(1/r>0?0:2147483648,o,i+n);else if(isNaN(r))e(0,o,i+t),e(2146959360,o,i+n);else if(r>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=r*Math.pow(2,-c))>>>0,o,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,o,i+n)}}}function a(e,t,n,r,o){var i=e(r,o+t),a=e(r,o+n),s=2*(a>>31)+1,c=a>>>20&2047,u=4294967296*(1048575&a)+i;return 2047===c?u?NaN:s*(1/0):0===c?5e-324*s*u:s*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=i.bind(null,t,0,4),e.writeDoubleBE=i.bind(null,n,4,0),e.readDoubleLE=a.bind(null,r,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function t(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function n(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function r(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal$1,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(e){var t=e;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},t.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,i=[],a=0;t<n;)(r=e[t++])<128?i[a++]=r:r>191&&r<224?i[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(r>>10),i[a++]=56320+(1023&r)):i[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},t.write=function(e,t,n){for(var r,o,i=n,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&o),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-i}}(utf8)),utf8}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,n){var r=n||8192,o=r>>>1,i=null,a=r;return function(n){if(n<1||n>o)return e(n);a+n>r&&(i=e(r),a=0);var s=t.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var r=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return n;var r=e<0;r&&(e=-e);var o=e>>>0,i=(e-o)/4294967296>>>0;return r&&(i=~i>>>0,o=~o>>>0,++o>4294967295&&(o=0,++i>4294967295&&(i=0))),new t(o,i)},t.from=function(r){if("number"==typeof r)return t.fromNumber(r);if(e.isString(r)){if(!e.Long)return t.fromNumber(parseInt(r,10));r=e.Long.fromString(r)}return r.low||r.high?new t(r.low>>>0,r.high>>>0):n},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var o=String.prototype.charCodeAt;return t.fromHash=function(e){return e===r?n:new t((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10},longbits}function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(e){var t=e;function n(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;++o)void 0!==e[r[o]]&&n||(e[r[o]]=t[r[o]]);return e}function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}t.asPromise=requireAspromise(),t.base64=requireBase64(),t.EventEmitter=requireEventemitter(),t.float=requireFloat(),t.inquire=requireInquire(),t.utf8=requireUtf8(),t.pool=requirePool(),t.LongBits=requireLongbits(),t.isNode=Boolean(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||commonjsGlobal,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(Boolean(n))},t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;e?(t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):t._Buffer_from=t._Buffer_allocUnsafe=null}}(minimal)),minimal}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=c;var e,t=requireMinimal$1(),n=t.LongBits,r=t.base64,o=t.utf8;function i(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function a(){}function s(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function c(){this.len=0,this.head=new i(a,0,0),this.tail=this.head,this.states=null}var u=function(){return t.Buffer?function(){return(c.create=function(){return new e})()}:function(){return new c}};function l(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function d(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function p(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}c.create=u(),c.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(c.alloc=t.pool(c.alloc,t.Array.prototype.subarray)),c.prototype._push=function(e,t,n){return this.tail=this.tail.next=new i(e,t,n),this.len+=t,this},f.prototype=Object.create(i.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},c.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},c.prototype.int32=function(e){return e<0?this._push(d,10,n.fromNumber(e)):this.uint32(e)},c.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},c.prototype.uint64=function(e){var t=n.from(e);return this._push(d,t.length(),t)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(e){var t=n.from(e).zzEncode();return this._push(d,t.length(),t)},c.prototype.bool=function(e){return this._push(l,1,e?1:0)},c.prototype.fixed32=function(e){return this._push(p,4,e>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(e){var t=n.from(e);return this._push(p,4,t.lo)._push(p,4,t.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},c.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var h=t.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};return c.prototype.bytes=function(e){var n=e.length>>>0;if(!n)return this._push(l,1,0);if(t.isString(e)){var o=c.alloc(n=r.length(e));r.decode(e,o,0),e=o}return this.uint32(n)._push(h,n,e)},c.prototype.string=function(e){var t=o.length(e);return t?this.uint32(t)._push(o.write,t,e):this._push(l,1,0)},c.prototype.fork=function(){return this.states=new s(this),this.head=this.tail=new i(a,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(a,0,0),this.len=0),this},c.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},c.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},c._configure=function(t){e=t,c.create=u(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=n;var e=requireWriter();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(){e.call(this)}function r(e,n,r){e.length<40?t.utf8.write(e,n,r):n.utf8Write?n.utf8Write(e,r):n.write(e,r)}return n._configure=function(){n.alloc=t._Buffer_allocUnsafe,n.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},n.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(n.writeBytesBuffer,r,e),this},n.prototype.string=function(e){var n=t.Buffer.byteLength(e);return this.uint32(n),n&&this._push(r,n,e),this},n._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=i;var e,t=requireMinimal$1(),n=t.LongBits,r=t.utf8;function o(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function i(e){this.buf=e,this.pos=0,this.len=e.length}var a,s="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new i(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new i(e);throw Error("illegal buffer")},c=function(){return t.Buffer?function(n){return(i.create=function(n){return t.Buffer.isBuffer(n)?new e(n):s(n)})(n)}:s};function u(){var e=new n(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw o(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw o(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw o(this,8);return new n(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}return i.create=c(),i.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,i.prototype.uint32=(a=4294967295,function(){if(a=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return a;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return a}),i.prototype.int32=function(){return 0|this.uint32()},i.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},i.prototype.bool=function(){return 0!==this.uint32()},i.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return l(this.buf,this.pos+=4)},i.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|l(this.buf,this.pos+=4)},i.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},i.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},i.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw o(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},i.prototype.string=function(){var e=this.bytes();return r.read(e,0,e.length)},i.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw o(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},i.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},i._configure=function(n){e=n,i.create=c(),e._configure();var r=t.Long?"toLong":"toNumber";t.merge(i.prototype,{int64:function(){return u.call(this)[r](!1)},uint64:function(){return u.call(this)[r](!0)},sint64:function(){return u.call(this).zzDecode()[r](!1)},fixed64:function(){return f.call(this)[r](!0)},sfixed64:function(){return f.call(this)[r](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=n;var e=requireReader();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(t){e.call(this,t)}return n._configure=function(){t.Buffer&&(n.prototype._slice=t.Buffer.prototype.slice)},n.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},n._configure(),reader_buffer}var rpc={},service,hasRequiredService,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal,hasRequiredMinimal;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=t;var e=requireMinimal$1();function t(t,n,r){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(r)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(n,r,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return e.asPromise(t,s,n,r,o,i);if(s.rpcImpl)try{return s.rpcImpl(n,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,t){if(e)return s.emit("error",e,n),a(e);if(null!==t){if(!(t instanceof o))try{t=o[s.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return s.emit("error",e,n),a(e)}return s.emit("data",t,n),a(null,t)}s.end(!0)}))}catch(e){return s.emit("error",e,n),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(e){e.Service=requireService()}(rpc)),rpc}function requireRoots(){return hasRequiredRoots?roots:(hasRequiredRoots=1,roots={})}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(e){var t=e;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}t.build="minimal",t.Writer=requireWriter(),t.BufferWriter=requireWriter_buffer(),t.Reader=requireReader(),t.BufferReader=requireReader_buffer(),t.util=requireMinimal$1(),t.rpc=requireRpc(),t.roots=requireRoots(),t.configure=n,n()}(indexMinimal)),indexMinimal}function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal$1.exports=requireIndexMinimal()),minimal$1.exports}var minimalExports=requireMinimal();function createBasePBAnimator(){return{states:[]}}const PBAnimator={encode(e,t=minimalExports.Writer.create()){for(const n of e.states)PBAnimationState.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBAnimator();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.states.push(PBAnimationState.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o}};function createBasePBAnimationState(){return{name:"",clip:"",playing:void 0,weight:void 0,speed:void 0,loop:void 0,shouldReset:void 0}}const PBAnimationState={encode:(e,t=minimalExports.Writer.create())=>(""!==e.name&&t.uint32(10).string(e.name),""!==e.clip&&t.uint32(18).string(e.clip),void 0!==e.playing&&t.uint32(24).bool(e.playing),void 0!==e.weight&&t.uint32(37).float(e.weight),void 0!==e.speed&&t.uint32(45).float(e.speed),void 0!==e.loop&&t.uint32(48).bool(e.loop),void 0!==e.shouldReset&&t.uint32(56).bool(e.shouldReset),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBAnimationState();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.name=n.string();break;case 2:o.clip=n.string();break;case 3:o.playing=n.bool();break;case 4:o.weight=n.float();break;case 5:o.speed=n.float();break;case 6:o.loop=n.bool();break;case 7:o.shouldReset=n.bool();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$i=1042,AnimatorSchema={serialize(e,t){const n=PBAnimator.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBAnimator.decode(e.buffer(),e.remainingBytes()),create:()=>PBAnimator.decode(new Uint8Array)};function createBasePBAudioSource(){return{playing:void 0,volume:void 0,loop:void 0,pitch:void 0,audioClipUrl:""}}const PBAudioSource={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.playing&&t.uint32(8).bool(e.playing),void 0!==e.volume&&t.uint32(21).float(e.volume),void 0!==e.loop&&t.uint32(24).bool(e.loop),void 0!==e.pitch&&t.uint32(37).float(e.pitch),""!==e.audioClipUrl&&t.uint32(42).string(e.audioClipUrl),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBAudioSource();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.playing=n.bool();break;case 2:o.volume=n.float();break;case 3:o.loop=n.bool();break;case 4:o.pitch=n.float();break;case 5:o.audioClipUrl=n.string();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$h=1020,AudioSourceSchema={serialize(e,t){const n=PBAudioSource.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBAudioSource.decode(e.buffer(),e.remainingBytes()),create:()=>PBAudioSource.decode(new Uint8Array)};var AvatarAnchorPoint;function createBasePBAvatarAttach(){return{avatarId:"",anchorPointId:0}}!function(e){e[e.POSITION=0]="POSITION",e[e.NAME_TAG=1]="NAME_TAG",e[e.LEFT_HAND=2]="LEFT_HAND",e[e.RIGHT_HAND=3]="RIGHT_HAND",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(AvatarAnchorPoint||(AvatarAnchorPoint={}));const PBAvatarAttach={encode:(e,t=minimalExports.Writer.create())=>(""!==e.avatarId&&t.uint32(10).string(e.avatarId),0!==e.anchorPointId&&t.uint32(16).int32(e.anchorPointId),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBAvatarAttach();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.avatarId=n.string();break;case 2:o.anchorPointId=n.int32();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$g=1073,AvatarAttachSchema={serialize(e,t){const n=PBAvatarAttach.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBAvatarAttach.decode(e.buffer(),e.remainingBytes()),create:()=>PBAvatarAttach.decode(new Uint8Array)};function createBaseColor3(){return{r:0,g:0,b:0}}const Color3={encode:(e,t=minimalExports.Writer.create())=>(0!==e.r&&t.uint32(13).float(e.r),0!==e.g&&t.uint32(21).float(e.g),0!==e.b&&t.uint32(29).float(e.b),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBaseColor3();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.r=n.float();break;case 2:o.g=n.float();break;case 3:o.b=n.float();break;default:n.skipType(7&e)}}return o}};function createBasePBAvatarShape(){return{id:"",name:void 0,bodyShape:void 0,skinColor:void 0,hairColor:void 0,eyeColor:void 0,wearables:[],expressionTriggerId:void 0,expressionTriggerTimestamp:void 0,stickerTriggerId:void 0,stickerTriggerTimestamp:void 0,talking:void 0}}const PBAvatarShape={encode(e,t=minimalExports.Writer.create()){""!==e.id&&t.uint32(10).string(e.id),void 0!==e.name&&t.uint32(18).string(e.name),void 0!==e.bodyShape&&t.uint32(26).string(e.bodyShape),void 0!==e.skinColor&&Color3.encode(e.skinColor,t.uint32(34).fork()).ldelim(),void 0!==e.hairColor&&Color3.encode(e.hairColor,t.uint32(42).fork()).ldelim(),void 0!==e.eyeColor&&Color3.encode(e.eyeColor,t.uint32(50).fork()).ldelim();for(const n of e.wearables)t.uint32(58).string(n);return void 0!==e.expressionTriggerId&&t.uint32(66).string(e.expressionTriggerId),void 0!==e.expressionTriggerTimestamp&&t.uint32(72).int64(e.expressionTriggerTimestamp),void 0!==e.stickerTriggerId&&t.uint32(82).string(e.stickerTriggerId),void 0!==e.stickerTriggerTimestamp&&t.uint32(88).int64(e.stickerTriggerTimestamp),void 0!==e.talking&&t.uint32(96).bool(e.talking),t},decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBAvatarShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.id=n.string();break;case 2:o.name=n.string();break;case 3:o.bodyShape=n.string();break;case 4:o.skinColor=Color3.decode(n,n.uint32());break;case 5:o.hairColor=Color3.decode(n,n.uint32());break;case 6:o.eyeColor=Color3.decode(n,n.uint32());break;case 7:o.wearables.push(n.string());break;case 8:o.expressionTriggerId=n.string();break;case 9:o.expressionTriggerTimestamp=longToNumber(n.int64());break;case 10:o.stickerTriggerId=n.string();break;case 11:o.stickerTriggerTimestamp=longToNumber(n.int64());break;case 12:o.talking=n.bool();break;default:n.skipType(7&e)}}return o}};var globalThis$1=(()=>{if(void 0!==globalThis$1)return globalThis$1;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw"Unable to locate global object"})();function longToNumber(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}const COMPONENT_ID$f=1080,AvatarShapeSchema={serialize(e,t){const n=PBAvatarShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBAvatarShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBAvatarShape.decode(new Uint8Array)};function createBasePBBillboard(){return{x:void 0,y:void 0,z:void 0}}const PBBillboard={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.x&&t.uint32(8).bool(e.x),void 0!==e.y&&t.uint32(16).bool(e.y),void 0!==e.z&&t.uint32(24).bool(e.z),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBBillboard();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.x=n.bool();break;case 2:o.y=n.bool();break;case 3:o.z=n.bool();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$e=1090,BillboardSchema={serialize(e,t){const n=PBBillboard.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBBillboard.decode(e.buffer(),e.remainingBytes()),create:()=>PBBillboard.decode(new Uint8Array)};function createBasePBBoxShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,uvs:[]}}const PBBoxShape={encode(e,t=minimalExports.Writer.create()){void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),t.uint32(34).fork();for(const n of e.uvs)t.float(n);return t.ldelim(),t},decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBBoxShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.withCollisions=n.bool();break;case 2:o.isPointerBlocker=n.bool();break;case 3:o.visible=n.bool();break;case 4:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos<e;)o.uvs.push(n.float())}else o.uvs.push(n.float());break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$d=1013,BoxShapeSchema={serialize(e,t){const n=PBBoxShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBBoxShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBBoxShape.decode(new Uint8Array)};function createBasePBCameraMode(){return{mode:0}}const PBCameraMode={encode:(e,t=minimalExports.Writer.create())=>(0!==e.mode&&t.uint32(8).int32(e.mode),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBCameraMode();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.mode=n.int32();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$c=1072,CameraModeSchema={serialize(e,t){const n=PBCameraMode.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBCameraMode.decode(e.buffer(),e.remainingBytes()),create:()=>PBCameraMode.decode(new Uint8Array)};function createBaseVector3(){return{x:0,y:0,z:0}}const Vector3={encode:(e,t=minimalExports.Writer.create())=>(0!==e.x&&t.uint32(13).float(e.x),0!==e.y&&t.uint32(21).float(e.y),0!==e.z&&t.uint32(29).float(e.z),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBaseVector3();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.x=n.float();break;case 2:o.y=n.float();break;case 3:o.z=n.float();break;default:n.skipType(7&e)}}return o}};function createBasePBCameraModeArea(){return{area:void 0,mode:0}}const PBCameraModeArea={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.area&&Vector3.encode(e.area,t.uint32(10).fork()).ldelim(),0!==e.mode&&t.uint32(16).int32(e.mode),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBCameraModeArea();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.area=Vector3.decode(n,n.uint32());break;case 2:o.mode=n.int32();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$b=1071,CameraModeAreaSchema={serialize(e,t){const n=PBCameraModeArea.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBCameraModeArea.decode(e.buffer(),e.remainingBytes()),create:()=>PBCameraModeArea.decode(new Uint8Array)};function createBasePBCylinderShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,radiusTop:void 0,radiusBottom:void 0}}const PBCylinderShape={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),void 0!==e.radiusTop&&t.uint32(37).float(e.radiusTop),void 0!==e.radiusBottom&&t.uint32(45).float(e.radiusBottom),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBCylinderShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.withCollisions=n.bool();break;case 2:o.isPointerBlocker=n.bool();break;case 3:o.visible=n.bool();break;case 4:o.radiusTop=n.float();break;case 5:o.radiusBottom=n.float();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$a=1016,CylinderShapeSchema={serialize(e,t){const n=PBCylinderShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBCylinderShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBCylinderShape.decode(new Uint8Array)};function createBasePBGLTFShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,src:""}}const PBGLTFShape={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),""!==e.src&&t.uint32(34).string(e.src),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBGLTFShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.withCollisions=n.bool();break;case 2:o.isPointerBlocker=n.bool();break;case 3:o.visible=n.bool();break;case 4:o.src=n.string();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$9=1041,GLTFShapeSchema={serialize(e,t){const n=PBGLTFShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBGLTFShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBGLTFShape.decode(new Uint8Array)};function createBasePBNFTShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,src:"",assetId:void 0,style:void 0,color:void 0}}const PBNFTShape={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),""!==e.src&&t.uint32(34).string(e.src),void 0!==e.assetId&&t.uint32(42).string(e.assetId),void 0!==e.style&&t.uint32(48).int32(e.style),void 0!==e.color&&Color3.encode(e.color,t.uint32(58).fork()).ldelim(),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBNFTShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.withCollisions=n.bool();break;case 2:o.isPointerBlocker=n.bool();break;case 3:o.visible=n.bool();break;case 4:o.src=n.string();break;case 5:o.assetId=n.string();break;case 6:o.style=n.int32();break;case 7:o.color=Color3.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$8=1040,NFTShapeSchema={serialize(e,t){const n=PBNFTShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBNFTShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBNFTShape.decode(new Uint8Array)};function createBasePBOnPointerDown(){return{button:void 0,hoverText:void 0,maxDistance:void 0,showFeedback:void 0}}const PBOnPointerDown={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.button&&t.uint32(8).int32(e.button),void 0!==e.hoverText&&t.uint32(18).string(e.hoverText),void 0!==e.maxDistance&&t.uint32(29).float(e.maxDistance),void 0!==e.showFeedback&&t.uint32(32).bool(e.showFeedback),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBOnPointerDown();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.button=n.int32();break;case 2:o.hoverText=n.string();break;case 3:o.maxDistance=n.float();break;case 4:o.showFeedback=n.bool();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$7=1060,OnPointerDownSchema={serialize(e,t){const n=PBOnPointerDown.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBOnPointerDown.decode(e.buffer(),e.remainingBytes()),create:()=>PBOnPointerDown.decode(new Uint8Array)};function createBasePBOnPointerDownResult(){return{button:0,meshName:"",origin:void 0,direction:void 0,point:void 0,normal:void 0,distance:0,timestamp:0}}const PBOnPointerDownResult={encode:(e,t=minimalExports.Writer.create())=>(0!==e.button&&t.uint32(16).int32(e.button),""!==e.meshName&&t.uint32(26).string(e.meshName),void 0!==e.origin&&Vector3.encode(e.origin,t.uint32(34).fork()).ldelim(),void 0!==e.direction&&Vector3.encode(e.direction,t.uint32(42).fork()).ldelim(),void 0!==e.point&&Vector3.encode(e.point,t.uint32(50).fork()).ldelim(),void 0!==e.normal&&Vector3.encode(e.normal,t.uint32(58).fork()).ldelim(),0!==e.distance&&t.uint32(69).float(e.distance),0!==e.timestamp&&t.uint32(72).int32(e.timestamp),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBOnPointerDownResult();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 2:o.button=n.int32();break;case 3:o.meshName=n.string();break;case 4:o.origin=Vector3.decode(n,n.uint32());break;case 5:o.direction=Vector3.decode(n,n.uint32());break;case 6:o.point=Vector3.decode(n,n.uint32());break;case 7:o.normal=Vector3.decode(n,n.uint32());break;case 8:o.distance=n.float();break;case 9:o.timestamp=n.int32();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$6=1066,OnPointerDownResultSchema={serialize(e,t){const n=PBOnPointerDownResult.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBOnPointerDownResult.decode(e.buffer(),e.remainingBytes()),create:()=>PBOnPointerDownResult.decode(new Uint8Array)};function createBasePBOnPointerUp(){return{button:void 0,hoverText:void 0,maxDistance:void 0,showFeedback:void 0}}const PBOnPointerUp={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.button&&t.uint32(8).int32(e.button),void 0!==e.hoverText&&t.uint32(18).string(e.hoverText),void 0!==e.maxDistance&&t.uint32(29).float(e.maxDistance),void 0!==e.showFeedback&&t.uint32(32).bool(e.showFeedback),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBOnPointerUp();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.button=n.int32();break;case 2:o.hoverText=n.string();break;case 3:o.maxDistance=n.float();break;case 4:o.showFeedback=n.bool();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$5=1061,OnPointerUpSchema={serialize(e,t){const n=PBOnPointerUp.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBOnPointerUp.decode(e.buffer(),e.remainingBytes()),create:()=>PBOnPointerUp.decode(new Uint8Array)};function createBasePBOnPointerUpResult(){return{button:0,meshName:"",origin:void 0,direction:void 0,point:void 0,normal:void 0,distance:0,timestamp:0}}const PBOnPointerUpResult={encode:(e,t=minimalExports.Writer.create())=>(0!==e.button&&t.uint32(16).int32(e.button),""!==e.meshName&&t.uint32(26).string(e.meshName),void 0!==e.origin&&Vector3.encode(e.origin,t.uint32(34).fork()).ldelim(),void 0!==e.direction&&Vector3.encode(e.direction,t.uint32(42).fork()).ldelim(),void 0!==e.point&&Vector3.encode(e.point,t.uint32(50).fork()).ldelim(),void 0!==e.normal&&Vector3.encode(e.normal,t.uint32(58).fork()).ldelim(),0!==e.distance&&t.uint32(69).float(e.distance),0!==e.timestamp&&t.uint32(72).int32(e.timestamp),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBOnPointerUpResult();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 2:o.button=n.int32();break;case 3:o.meshName=n.string();break;case 4:o.origin=Vector3.decode(n,n.uint32());break;case 5:o.direction=Vector3.decode(n,n.uint32());break;case 6:o.point=Vector3.decode(n,n.uint32());break;case 7:o.normal=Vector3.decode(n,n.uint32());break;case 8:o.distance=n.float();break;case 9:o.timestamp=n.int32();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$4=1065,OnPointerUpResultSchema={serialize(e,t){const n=PBOnPointerUpResult.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBOnPointerUpResult.decode(e.buffer(),e.remainingBytes()),create:()=>PBOnPointerUpResult.decode(new Uint8Array)};function createBasePBPlaneShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,uvs:[]}}const PBPlaneShape={encode(e,t=minimalExports.Writer.create()){void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),t.uint32(34).fork();for(const n of e.uvs)t.float(n);return t.ldelim(),t},decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBPlaneShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.withCollisions=n.bool();break;case 2:o.isPointerBlocker=n.bool();break;case 3:o.visible=n.bool();break;case 4:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos<e;)o.uvs.push(n.float())}else o.uvs.push(n.float());break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$3=1014,PlaneShapeSchema={serialize(e,t){const n=PBPlaneShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBPlaneShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBPlaneShape.decode(new Uint8Array)};function createBasePBPointerLock(){return{isPointerLocked:!1}}const PBPointerLock={encode:(e,t=minimalExports.Writer.create())=>(!0===e.isPointerLocked&&t.uint32(8).bool(e.isPointerLocked),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBPointerLock();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.isPointerLocked=n.bool();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$2=1074,PointerLockSchema={serialize(e,t){const n=PBPointerLock.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBPointerLock.decode(e.buffer(),e.remainingBytes()),create:()=>PBPointerLock.decode(new Uint8Array)};function createBasePBSphereShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0}}const PBSphereShape={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBSphereShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.withCollisions=n.bool();break;case 2:o.isPointerBlocker=n.bool();break;case 3:o.visible=n.bool();break;default:n.skipType(7&e)}}return o}},COMPONENT_ID$1=1015,SphereShapeSchema={serialize(e,t){const n=PBSphereShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBSphereShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBSphereShape.decode(new Uint8Array)};function createBasePBTextShape(){return{text:"",visible:void 0,font:void 0,opacity:void 0,fontSize:void 0,fontAutoSize:void 0,hTextAlign:void 0,vTextAlign:void 0,width:void 0,height:void 0,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0,lineSpacing:void 0,lineCount:void 0,textWrapping:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,outlineWidth:void 0,shadowColor:void 0,outlineColor:void 0,textColor:void 0}}const PBTextShape={encode:(e,t=minimalExports.Writer.create())=>(""!==e.text&&t.uint32(10).string(e.text),void 0!==e.visible&&t.uint32(16).bool(e.visible),void 0!==e.font&&t.uint32(26).string(e.font),void 0!==e.opacity&&t.uint32(37).float(e.opacity),void 0!==e.fontSize&&t.uint32(45).float(e.fontSize),void 0!==e.fontAutoSize&&t.uint32(48).bool(e.fontAutoSize),void 0!==e.hTextAlign&&t.uint32(58).string(e.hTextAlign),void 0!==e.vTextAlign&&t.uint32(66).string(e.vTextAlign),void 0!==e.width&&t.uint32(77).float(e.width),void 0!==e.height&&t.uint32(85).float(e.height),void 0!==e.paddingTop&&t.uint32(93).float(e.paddingTop),void 0!==e.paddingRight&&t.uint32(101).float(e.paddingRight),void 0!==e.paddingBottom&&t.uint32(109).float(e.paddingBottom),void 0!==e.paddingLeft&&t.uint32(117).float(e.paddingLeft),void 0!==e.lineSpacing&&t.uint32(125).float(e.lineSpacing),void 0!==e.lineCount&&t.uint32(128).int32(e.lineCount),void 0!==e.textWrapping&&t.uint32(136).bool(e.textWrapping),void 0!==e.shadowBlur&&t.uint32(149).float(e.shadowBlur),void 0!==e.shadowOffsetX&&t.uint32(157).float(e.shadowOffsetX),void 0!==e.shadowOffsetY&&t.uint32(165).float(e.shadowOffsetY),void 0!==e.outlineWidth&&t.uint32(173).float(e.outlineWidth),void 0!==e.shadowColor&&Color3.encode(e.shadowColor,t.uint32(178).fork()).ldelim(),void 0!==e.outlineColor&&Color3.encode(e.outlineColor,t.uint32(186).fork()).ldelim(),void 0!==e.textColor&&Color3.encode(e.textColor,t.uint32(194).fork()).ldelim(),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=createBasePBTextShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:o.text=n.string();break;case 2:o.visible=n.bool();break;case 3:o.font=n.string();break;case 4:o.opacity=n.float();break;case 5:o.fontSize=n.float();break;case 6:o.fontAutoSize=n.bool();break;case 7:o.hTextAlign=n.string();break;case 8:o.vTextAlign=n.string();break;case 9:o.width=n.float();break;case 10:o.height=n.float();break;case 11:o.paddingTop=n.float();break;case 12:o.paddingRight=n.float();break;case 13:o.paddingBottom=n.float();break;case 14:o.paddingLeft=n.float();break;case 15:o.lineSpacing=n.float();break;case 16:o.lineCount=n.int32();break;case 17:o.textWrapping=n.bool();break;case 18:o.shadowBlur=n.float();break;case 19:o.shadowOffsetX=n.float();break;case 20:o.shadowOffsetY=n.float();break;case 21:o.outlineWidth=n.float();break;case 22:o.shadowColor=Color3.decode(n,n.uint32());break;case 23:o.outlineColor=Color3.decode(n,n.uint32());break;case 24:o.textColor=Color3.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o}},COMPONENT_ID=1030,TextShapeSchema={serialize(e,t){const n=PBTextShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBTextShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBTextShape.decode(new Uint8Array)};function defineLibraryComponents({defineComponentFromSchema:e}){return{Transform:e(TransformSchema,COMPONENT_ID$j),Animator:e(AnimatorSchema,COMPONENT_ID$i),AudioSource:e(AudioSourceSchema,COMPONENT_ID$h),AvatarAttach:e(AvatarAttachSchema,COMPONENT_ID$g),AvatarShape:e(AvatarShapeSchema,COMPONENT_ID$f),Billboard:e(BillboardSchema,COMPONENT_ID$e),BoxShape:e(BoxShapeSchema,COMPONENT_ID$d),CameraMode:e(CameraModeSchema,COMPONENT_ID$c),CameraModeArea:e(CameraModeAreaSchema,COMPONENT_ID$b),CylinderShape:e(CylinderShapeSchema,COMPONENT_ID$a),GLTFShape:e(GLTFShapeSchema,COMPONENT_ID$9),NFTShape:e(NFTShapeSchema,COMPONENT_ID$8),OnPointerDown:e(OnPointerDownSchema,COMPONENT_ID$7),OnPointerDownResult:e(OnPointerDownResultSchema,COMPONENT_ID$6),OnPointerUp:e(OnPointerUpSchema,COMPONENT_ID$5),OnPointerUpResult:e(OnPointerUpResultSchema,COMPONENT_ID$4),PlaneShape:e(PlaneShapeSchema,COMPONENT_ID$3),PointerLock:e(PointerLockSchema,COMPONENT_ID$2),SphereShape:e(SphereShapeSchema,COMPONENT_ID$1),TextShape:e(TextShapeSchema,COMPONENT_ID)}}function IArray(e){return{serialize(t,n){n.writeUint32(t.length);for(const r of t)e.serialize(r,n)},deserialize(t){const n=[],r=t.readUint32();for(let o=0;o<r;o++)n.push(e.deserialize(t));return n},create:()=>[]}}const Bool={serialize(e,t){t.writeInt8(e?1:0)},deserialize:e=>1===e.readInt8(),create:()=>!1};function IEnum(e){return{serialize(t,n){e.serialize(t,n)},deserialize:t=>e.deserialize(t),create:()=>e.create()}}const Float32={serialize(e,t){t.writeFloat32(e)},deserialize:e=>e.readFloat32(),create:()=>0},Float64={serialize(e,t){t.writeFloat64(e)},deserialize:e=>e.readFloat64(),create:()=>0},Int64={serialize(e,t){t.writeInt64(BigInt(e))},deserialize:e=>Number(e.readInt64()),create:()=>0},Int32={serialize(e,t){t.writeInt32(e)},deserialize:e=>e.readInt32(),create:()=>0},Int16={serialize(e,t){t.writeInt16(e)},deserialize:e=>e.readInt16(),create:()=>0},Int8={serialize(e,t){t.writeInt8(e)},deserialize:e=>e.readInt8(),create:()=>0},FlatString={serialize(e,t){t.writeBuffer((new TextEncoder).encode(e))},deserialize:e=>(new TextDecoder).decode(e.readBuffer()),create:()=>""},EcsString=FlatString;function IMap(e){return{serialize(t,n){for(const r in e)e[r].serialize(t[r],n)},deserialize(t){const n={};for(const r in e)n[r]=e[r].deserialize(t);return n},create(){const t={};for(const n in e)t[n]=e[n].create();return t}}}function IOptional(e){return{serialize(t,n){t?(n.writeInt8(1),e.serialize(t,n)):n.writeInt8(0)},deserialize(t){if(t.readInt8())return e.deserialize(t)},create(){}}}var Schemas,ECSComponentIDs;function preEngine(){const e=EntityContainer(),t=new Map,n=new Map,r=SystemContainer();function o(t=!1){return e.generateEntity(t)}function i(e,n){if(t.get(n))throw new Error(`Component ${n} already declared`);const r=defineComponent(n,e);return t.set(n,r),r}return{entitiesComponent:n,componentsDefinition:t,addEntity:o,addDynamicEntity:function(){return o(!0)},removeEntity:function(n){for(const[,e]of t)e.has(n)&&e.deleteFrom(n);return e.removeEntity(n)},addSystem:function(e,t=SYSTEMS_REGULAR_PRIORITY,n){r.add(e,t,n)},getSystems:function(){return r.getSystems()},removeSystem:function(e){return r.remove(e)},defineComponent:function(e,t){return i(exports.Schemas.Map(e),t)},defineComponentFromSchema:i,getEntitiesWith:function*(...e){for(const[t,...n]of function*(...e){const[t,...n]=e;for(const[r]of t.iterator()){let t=!0;for(const e of n)if(!e.has(r)){t=!1;break}t&&(yield[r,...e])}}(...e))yield[t,...n.map((e=>e.get(t)))]},getComponent:function(e){const n=t.get(e);if(!n)throw new Error("Component not found. You need to declare the components at the beginnig of the engine declaration");return n}}}function Engine({transports:e}={}){const t=preEngine(),n=crdtSceneSystem({engine:t,transports:e||[]}),r=defineLibraryComponents(t);return{addEntity:t.addEntity,addDynamicEntity:t.addDynamicEntity,removeEntity:t.removeEntity,addSystem:t.addSystem,removeSystem:t.removeSystem,defineComponent:t.defineComponent,defineComponentFromSchema:t.defineComponentFromSchema,getEntitiesWith:t.getEntitiesWith,getComponent:t.getComponent,update:function(e){n.receiveMessages();for(const n of t.getSystems())n.fn(e);const o=[r.OnPointerDownResult,r.OnPointerUpResult],i=o.map((e=>e._id));for(const e of o)for(const[n]of t.getEntitiesWith(e))e.deleteFrom(n);const a=new Map;for(const[e,n]of t.componentsDefinition)if(!i.includes(e))for(const t of n.dirtyIterator())a.has(t)||a.set(t,new Set),a.get(t).add(e);n.createMessages(a);for(const[e,n]of t.componentsDefinition)n.clearDirty()},baseComponents:r}}exports.Schemas=void 0,Schemas=exports.Schemas||(exports.Schemas={}),Schemas.Boolean=Bool,Schemas.String=EcsString,Schemas.Float=Float32,Schemas.Double=Float64,Schemas.Byte=Int8,Schemas.Short=Int16,Schemas.Int=Int32,Schemas.Int64=Int64,Schemas.Number=Float32,Schemas.Enum=IEnum,Schemas.Array=IArray,Schemas.Map=IMap,Schemas.Optional=IOptional,function(e){e[e.Transform=1]="Transform",e[e.Animator=1042]="Animator",e[e.AudioSource=1020]="AudioSource",e[e.AvatarAttach=1073]="AvatarAttach",e[e.AvatarShape=1080]="AvatarShape",e[e.Billboard=1090]="Billboard",e[e.BoxShape=1013]="BoxShape",e[e.CameraMode=1072]="CameraMode",e[e.CameraModeArea=1071]="CameraModeArea",e[e.CylinderShape=1016]="CylinderShape",e[e.GLTFShape=1041]="GLTFShape",e[e.NFTShape=1040]="NFTShape",e[e.OnPointerDown=1060]="OnPointerDown",e[e.OnPointerDownResult=1066]="OnPointerDownResult",e[e.OnPointerUp=1061]="OnPointerUp",e[e.OnPointerUpResult=1065]="OnPointerUpResult",e[e.PlaneShape=1014]="PlaneShape",e[e.PointerLock=1074]="PointerLock",e[e.SphereShape=1015]="SphereShape",e[e.TextShape=1030]="TextShape"}(ECSComponentIDs||(ECSComponentIDs={}));const componentIds=Object.values(ECSComponentIDs).filter((e=>"number"==typeof e)).map(Number);function createRendererTransport(){const e="renderer";return{type:e,send(e){dcl.callRpc("@decentraland/ExperimentalAPI","sendToRenderer",[{data:new Uint8Array(e)}]).catch(dcl.error)},filter:t=>t.transportType!==e&&(!!componentIds.includes(t.componentId)&&!!t)}}function createNetworkTransport(){const e="network-transport";return{send:function(...e){},type:e,filter:t=>t.transportType!==e&&!!t}}const rendererTransport=createRendererTransport(),engine=Engine({transports:[rendererTransport,createNetworkTransport()]});if(dcl){async function pullRendererMessages(){var e;const t=await dcl.callRpc("@decentraland/ExperimentalAPI","messageFromRenderer",[]);if((null===(e=t.data)||void 0===e?void 0:e.length)&&rendererTransport.onmessage)for(const e of t.data)rendererTransport.onmessage(e)}dcl.loadModule("@decentraland/ExperimentalAPI",{}).catch(dcl.error),dcl.onUpdate((e=>{pullRendererMessages().catch(dcl.error).finally((()=>engine.update(e)))}))}const log=dcl.log,error=dcl.error,Transform=engine.baseComponents.Transform,Animator=engine.baseComponents.Animator,AudioSource=engine.baseComponents.AudioSource,AvatarAttach=engine.baseComponents.AvatarAttach,AvatarShape=engine.baseComponents.AvatarShape,Billboard=engine.baseComponents.Billboard,BoxShape=engine.baseComponents.BoxShape,CameraMode=engine.baseComponents.CameraMode,CameraModeArea=engine.baseComponents.CameraModeArea,CylinderShape=engine.baseComponents.CylinderShape,GLTFShape=engine.baseComponents.GLTFShape,NFTShape=engine.baseComponents.NFTShape,OnPointerDown=engine.baseComponents.OnPointerDown,OnPointerDownResult=engine.baseComponents.OnPointerDownResult,OnPointerUp=engine.baseComponents.OnPointerUp,OnPointerUpResult=engine.baseComponents.OnPointerUpResult,PlaneShape=engine.baseComponents.PlaneShape,PointerLock=engine.baseComponents.PointerLock,SphereShape=engine.baseComponents.SphereShape,TextShape=engine.baseComponents.TextShape;var Components;exports.Components=void 0,Components=exports.Components||(exports.Components={}),Components.Transform=engine.baseComponents.Transform,Components.Animator=engine.baseComponents.Animator,Components.AudioSource=engine.baseComponents.AudioSource,Components.AvatarAttach=engine.baseComponents.AvatarAttach,Components.AvatarShape=engine.baseComponents.AvatarShape,Components.Billboard=engine.baseComponents.Billboard,Components.BoxShape=engine.baseComponents.BoxShape,Components.CameraMode=engine.baseComponents.CameraMode,Components.CameraModeArea=engine.baseComponents.CameraModeArea,Components.CylinderShape=engine.baseComponents.CylinderShape,Components.GLTFShape=engine.baseComponents.GLTFShape,Components.NFTShape=engine.baseComponents.NFTShape,Components.OnPointerDown=engine.baseComponents.OnPointerDown,Components.OnPointerDownResult=engine.baseComponents.OnPointerDownResult,Components.OnPointerUp=engine.baseComponents.OnPointerUp,Components.OnPointerUpResult=engine.baseComponents.OnPointerUpResult,Components.PlaneShape=engine.baseComponents.PlaneShape,Components.PointerLock=engine.baseComponents.PointerLock,Components.SphereShape=engine.baseComponents.SphereShape,Components.TextShape=engine.baseComponents.TextShape,exports.Animator=Animator,exports.AudioSource=AudioSource,exports.AvatarAttach=AvatarAttach,exports.AvatarShape=AvatarShape,exports.Billboard=Billboard,exports.BoxShape=BoxShape,exports.CameraMode=CameraMode,exports.CameraModeArea=CameraModeArea,exports.CylinderShape=CylinderShape,exports.DEG2RAD=distExports$1.DEG2RAD,exports.Engine=Engine,exports.Epsilon=distExports$1.Epsilon,exports.GLTFShape=GLTFShape,exports.NFTShape=NFTShape,exports.OnPointerDown=OnPointerDown,exports.OnPointerDownResult=OnPointerDownResult,exports.OnPointerUp=OnPointerUp,exports.OnPointerUpResult=OnPointerUpResult,exports.Orientation=distExports$1.Orientation,exports.PlaneShape=PlaneShape,exports.PointerLock=PointerLock,exports.Quaternion=distExports$1.Quaternion,exports.RAD2DEG=distExports$1.RAD2DEG,exports.Space=distExports$1.Space,exports.SphereShape=SphereShape,exports.TextShape=TextShape,exports.ToGammaSpace=distExports$1.ToGammaSpace,exports.ToLinearSpace=distExports$1.ToLinearSpace,exports.Transform=Transform,exports.Vector3=distExports$1.Vector3,exports.engine=engine,exports.error=error,exports.log=log,Object.defineProperty(exports,"__esModule",{value:!0})})(this.self=this.self||{});
1
+ (function(exports){"use strict";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},dist$1={},Quaternion={},Vector3$1={},hasRequiredVector3;function requireVector3(){return hasRequiredVector3||(hasRequiredVector3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Vector3=void 0,function(e){function t(e=0,t=0,n=0){return{x:e,y:t,z:n}}function n(e,t){t.x=e.x,t.y=e.y,t.z=e.z}function r(e){return Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z)}function i(e,t,n){n.x=e.x*t,n.y=e.y*t,n.z=e.z*t}function o(e,n){const r=t(0,0,0);return a(e,n,r),r}function a(e,t,r){0!==t&&1!==t?i(e,1/t,r):n(e,r)}function s(e,t,n,r){r.x=e.x+(t.x-e.x)*n,r.y=e.y+(t.y-e.y)*n,r.z=e.z+(t.z-e.z)*n}e.create=t,e.add=function(e,t){return{x:e.x+t.x,y:e.y+t.y,z:e.z+t.z}},e.subtract=function(e,t){return{x:e.x-t.x,y:e.y-t.y,z:e.z-t.z}},e.subtractToRef=function(e,t,n){n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z},e.opposite=function(e){return{x:-e.x,y:-e.y,z:-e.z}},e.copy=n,e.clone=function(e){return Object.assign({},e)},e.length=r,e.lengthSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},e.scaleToRef=i,e.scale=function(e,n){return t(e.x*n,e.y*n,e.z*n)},e.normalizeFromLength=o,e.normalizeFromLengthToRef=a,e.normalize=function(e){return o(e,r(e))},e.normalizeToRef=function(e,t){a(e,r(e),t)},e.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},e.rotate=function(e,t){const{x:n,y:r,z:i}=e,{x:o,y:a,z:s,w:c}=t,u=c*n+a*i-s*r,l=c*r+s*n-o*i,d=c*i+o*r-a*n,f=-o*n-a*r-s*i;return{x:u*c+f*-o+l*-s-d*-a,y:l*c+f*-a+d*-o-u*-s,z:d*c+f*-s+u*-a-l*-o}},e.lerp=function(e,n,r){const i=t(0,0,0);return s(e,n,r,i),i},e.lerpToRef=s,e.cross=function(t,n){const r=e.Zero();return e.crossToRef(t,n,r),r},e.crossToRef=function(e,t,n){n.x=e.y*t.z-e.z*t.y,n.y=e.z*t.x-e.x*t.z,n.z=e.x*t.y-e.y*t.x},e.Zero=function(){return t(0,0,0)},e.One=function(){return t(1,1,1)},e.Up=function(){return t(0,1,0)},e.Down=function(){return t(0,-1,0)},e.Forward=function(){return t(0,0,1)},e.Backward=function(){return t(0,0,-1)},e.Right=function(){return t(1,0,0)},e.Left=function(){return t(-1,0,0)}}(e.Vector3||(e.Vector3={}))}(Vector3$1)),Vector3$1}var Scalar={},hasRequiredScalar;function requireScalar(){if(hasRequiredScalar)return Scalar;hasRequiredScalar=1,Object.defineProperty(Scalar,"__esModule",{value:!0}),Scalar.Scalar=void 0;const e=2*Math.PI;function t(e){const t=+e;return 0===t||isNaN(t)?t:t>0?1:-1}function n(e,t=0,n=1){return Math.min(n,Math.max(t,e))}function r(e,t){return e-Math.floor(e/t)*t}function i(e,t){let n=r(t-e,360);return n>180&&(n-=360),n}function o(e,n,r){let i=0;return i=Math.abs(n-e)<=r?n:e+t(n-e)*r,i}return Scalar.Scalar={withinEpsilon:function(e,t,n=1401298e-51){const r=e-t;return-n<=r&&r<=n},toHex:function(e){const t=e.toString(16);return e<=15?("0"+t).toUpperCase():t.toUpperCase()},sign:t,clamp:n,log2:function(e){return Math.log(e)*Math.LOG2E},repeat:r,normalize:function(e,t,n){return(e-t)/(n-t)},denormalize:function(e,t,n){return e*(n-t)+t},deltaAngle:i,pingPong:function(e,t){const n=r(e,2*t);return t-Math.abs(n-t)},smoothStep:function(e,t,r){let i=n(r);return i=-2*i*i*i+3*i*i,t*i+e*(1-i)},moveTowards:o,moveTowardsAngle:function(e,t,n){const r=i(e,t);let a=0;return a=-n<r&&r<n?t:o(e,e+r,n),a},lerp:function(e,t,n){return e+(t-e)*n},lerpAngle:function(e,t,i){let o=r(t-e,360);return o>180&&(o-=360),e+o*n(i)},inverseLerp:function(e,t,r){let i=0;return i=e!==t?n((r-e)/(t-e)):0,i},hermite:function(e,t,n,r,i){const o=i*i,a=i*o;return e*(2*a-3*o+1)+n*(-2*a+3*o)+t*(a-2*o+i)+r*(a-o)},randomRange:function(e,t){return e===t?e:Math.random()*(t-e)+e},rangeToPercent:function(e,t,n){return(e-t)/(n-t)},percentToRange:function(e,t,n){return(n-t)*e+t},normalizeRadians:function(t){return t-e*Math.floor((t+Math.PI)/e)},TwoPi:e},Scalar}var types$1={},hasRequiredTypes$1,hasRequiredQuaternion,hasRequiredDist$1;function requireTypes$1(){return hasRequiredTypes$1||(hasRequiredTypes$1=1,function(e){var t,n;Object.defineProperty(e,"__esModule",{value:!0}),e.RAD2DEG=e.DEG2RAD=e.Epsilon=e.ToLinearSpace=e.ToGammaSpace=e.Space=e.Orientation=void 0,(t=e.Orientation||(e.Orientation={}))[t.CW=0]="CW",t[t.CCW=1]="CCW",(n=e.Space||(e.Space={}))[n.LOCAL=0]="LOCAL",n[n.WORLD=1]="WORLD",n[n.BONE=2]="BONE",e.ToGammaSpace=1/2.2,e.ToLinearSpace=2.2,e.Epsilon=1e-6,e.DEG2RAD=Math.PI/180,e.RAD2DEG=360/(2*Math.PI)}(types$1)),types$1}function requireQuaternion(){return hasRequiredQuaternion||(hasRequiredQuaternion=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Quaternion=void 0;const t=requireVector3(),n=requireScalar(),r=requireTypes$1();!function(e){function i(e=0,t=0,n=0,r=1){return{x:e,y:t,z:n,w:r}}function o(e,t,n){const r=.5*t,o=.5*e,a=.5*n,s=Math.cos(r),c=Math.cos(o),u=Math.cos(a),l=Math.sin(r),d=Math.sin(o),f=Math.sin(a);return i(c*l*u+d*s*f,d*s*u-c*l*f,c*s*f-d*l*u,c*s*u+d*l*f)}function a(e){return Math.sqrt(s(e))}function s(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w}function c(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w}function u(e,t){const n=c(e,t);return 2*Math.acos(Math.min(Math.abs(n),1))*r.RAD2DEG}function l(e){const t=1/a(e);return i(e.x*t,e.y*t,e.z*t,e.w*t)}function d(){return i(0,0,0,1)}function f(t,n,r){const i=e.Identity();return e.slerpToRef(t,n,r,i),i}function p(e,t,n){n.x=e.x*t.w+e.y*t.z-e.z*t.y+e.w*t.x,n.y=-e.x*t.z+e.y*t.w+e.z*t.x+e.w*t.y,n.z=e.x*t.y-e.y*t.x+e.z*t.w+e.w*t.z,n.w=-e.x*t.x-e.y*t.y-e.z*t.z+e.w*t.w}e.create=i,e.add=function(e,t){return{x:e.x+t.x,y:e.y+t.y,z:e.z+t.z,w:e.w+t.w}},e.rotationYawPitchRoll=o,e.euler=function(e,t,n){return o(t*r.DEG2RAD,e*r.DEG2RAD,n*r.DEG2RAD)},e.length=a,e.lengthSquared=s,e.dot=c,e.angle=u,e.rotateTowards=function(e,t,n){const r=u(e,t);return 0===r?t:f(e,t,Math.min(1,n/r))},e.lookRotation=function(e,n={x:0,y:1,z:0}){const r=t.Vector3.normalize(e),o=t.Vector3.normalize(t.Vector3.cross(n,r)),a=t.Vector3.cross(r,o),s=o.x,c=o.y,u=o.z,l=a.x,d=a.y,f=a.z,p=r.x,h=r.y,m=r.z,y=s+d+m,b=i();if(y>0){let e=Math.sqrt(y+1);return b.w=.5*e,e=.5/e,b.x=(f-h)*e,b.y=(p-u)*e,b.z=(c-l)*e,b}if(s>=d&&s>=m){const e=Math.sqrt(1+s-d-m),t=.5/e;return b.x=.5*e,b.y=(c+l)*t,b.z=(u+p)*t,b.w=(f-h)*t,b}if(d>m){const e=Math.sqrt(1+d-s-m),t=.5/e;return b.x=(l+c)*t,b.y=.5*e,b.z=(h+f)*t,b.w=(p-u)*t,b}const g=Math.sqrt(1+m-s-d),v=.5/g;return b.x=(p+u)*v,b.y=(h+f)*v,b.z=.5*g,b.w=(c-l)*v,b},e.normalize=l,e.fromToRotation=function(e,n,r=t.Vector3.Up()){const o=t.Vector3.normalize(e),a=t.Vector3.normalize(n),s=t.Vector3.cross(o,a),c=Math.sqrt(t.Vector3.lengthSquared(o)*t.Vector3.lengthSquared(a))+t.Vector3.dot(o,a);return t.Vector3.lengthSquared(s)<1e-4?Math.abs(c)<1e-4?l(i(r.x,r.y,r.z,0)):d():l(i(s.x,s.y,s.z,c))},e.Identity=d,e.eulerAngles=function(e){const i=t.Vector3.create(),o=e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w,a=e.x*e.w-e.y*e.z;return a>.4995*o?(i.x=Math.PI/2,i.y=2*Math.atan2(e.y,e.x),i.z=0):a<-.4995*o?(i.x=-Math.PI/2,i.y=-2*Math.atan2(e.y,e.x),i.z=0):(i.x=Math.asin(2*(e.w*e.x-e.y*e.z)),i.y=Math.atan2(2*e.w*e.y+2*e.z*e.x,1-2*(e.x*e.x+e.y*e.y)),i.z=Math.atan2(2*e.w*e.z+2*e.x*e.y,1-2*(e.z*e.z+e.x*e.x))),i.x*=r.RAD2DEG,i.y*=r.RAD2DEG,i.z*=r.RAD2DEG,i.x=n.Scalar.repeat(i.x,360),i.y=n.Scalar.repeat(i.y,360),i.z=n.Scalar.repeat(i.z,360),i},e.rotationYawPitchRollToRef=function(e,t,n,r){const i=.5*t,o=.5*e,a=.5*n,s=Math.cos(i),c=Math.cos(o),u=Math.cos(a),l=Math.sin(i),d=Math.sin(o),f=Math.sin(a);r.x=c*l*u+d*s*f,r.y=d*s*u-c*l*f,r.z=c*s*f-d*l*u,r.w=c*s*u+d*l*f},e.fromRotationMatrixToRef=function(e,t){const n=e._m,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],c=n[9],u=n[2],l=n[6],d=n[10],f=r+s+d;let p;f>0?(p=.5/Math.sqrt(f+1),t.w=.25/p,t.x=(l-c)*p,t.y=(o-u)*p,t.z=(a-i)*p):r>s&&r>d?(p=2*Math.sqrt(1+r-s-d),t.w=(l-c)/p,t.x=.25*p,t.y=(i+a)/p,t.z=(o+u)/p):s>d?(p=2*Math.sqrt(1+s-r-d),t.w=(o-u)/p,t.x=(i+a)/p,t.y=.25*p,t.z=(c+l)/p):(p=2*Math.sqrt(1+d-r-s),t.w=(a-i)/p,t.x=(o+u)/p,t.y=(c+l)/p,t.z=.25*p)},e.slerp=f,e.slerpToRef=function(e,t,n,r){let i,o,a=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w,s=!1;if(a<0&&(s=!0,a=-a),a>.999999)o=1-n,i=s?-n:n;else{const e=Math.acos(a),t=1/Math.sin(e);o=Math.sin((1-n)*e)*t,i=s?-Math.sin(n*e)*t:Math.sin(n*e)*t}r.x=o*e.x+i*t.x,r.y=o*e.y+i*t.y,r.z=o*e.z+i*t.z,r.w=o*e.w+i*t.w},e.multiply=function(e,t){const n=i(0,0,0,1);return p(e,t,n),n},e.multiplyToRef=p,e.angleAxis=function(n,i){if(0===t.Vector3.lengthSquared(i))return e.Identity();const o=d();let a=n*r.DEG2RAD;a*=.5;const s=t.Vector3.normalize(i);return t.Vector3.scaleToRef(s,Math.sin(a),s),o.x=s.x,o.y=s.y,o.z=s.z,o.w=Math.cos(a),l(o)},e.Zero=function(){return i(0,0,0,0)}}(e.Quaternion||(e.Quaternion={}))}(Quaternion)),Quaternion}function requireDist$1(){return hasRequiredDist$1||(hasRequiredDist$1=1,function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(requireQuaternion(),e),n(requireVector3(),e),n(requireTypes$1(),e),n(requireDist$1(),e)}(dist$1)),dist$1}var distExports$1=requireDist$1(),dist={},types={},hasRequiredTypes,hasRequiredDist;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,Object.defineProperty(types,"__esModule",{value:!0})),types}function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};function r(e,t){if(e===t)return!0;if(e instanceof Uint8Array&&t instanceof Uint8Array){if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}return!!(globalThis.Buffer&&e instanceof Buffer&&t instanceof Buffer)&&e.equals(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.crdtProtocol=e.stateIterator=e.sameData=void 0,n(requireTypes(),e),e.sameData=r,e.stateIterator=function*(e){for(const[t,n]of e.entries())for(const[e,r]of n.entries())yield[t,e,r]},e.crdtProtocol=function(){const e=new Map;function t(t,n,r,i){const o=e.get(t),a=Math.max(i,o?.get(n)?.timestamp||0);if(o)o.set(n,{timestamp:a,data:r});else{const i=new Map;i.set(n,{timestamp:a,data:r}),e.set(t,i)}return{timestamp:a,data:r}}return{createEvent:function(n,r,i){const o=(e.get(n)?.get(r)?.timestamp||0)+1;return t(n,r,i,o),{key1:n,key2:r,data:i,timestamp:o}},processMessage:function(n){const{key1:i,key2:o,data:a,timestamp:s}=n,c=e.get(i)?.get(o);return!c||c.timestamp<s?(t(i,o,a,s),n):c.timestamp>s?{key1:i,key2:o,data:c.data,timestamp:c.timestamp}:r(c.data,a)?n:function(e,t){return e>t}(c.data,a)?{key1:i,key2:o,data:c.data,timestamp:c.timestamp}:(t(i,o,a,s).data,n)},getState:function(){return e}}}}(dist)),dist}var distExports=requireDist();function getNextSize(e,t){const n=Math.max(e,t)+1024;return 1024*Math.ceil(n/1024)}const defaultInitialCapacity=10240;function createByteBuffer(e={}){var t;const n=(null===(t=e.reading)||void 0===t?void 0:t.currentOffset)||0;let r=null,i=0;e.writing?(r=e.writing.buffer,e.writing.currentOffset&&(i=e.writing.currentOffset)):e.reading?(r=e.reading.buffer,i=e.reading.length||e.reading.buffer.length):r=new Uint8Array(e.initialCapacity||defaultInitialCapacity);let o=r,a=new DataView(o.buffer,o.byteOffset),s=i,c=n;const u=e=>{if(s+e>o.byteLength){const t=getNextSize(o.byteLength,s+e),n=new Uint8Array(t);n.set(o),o=n,a=new DataView(o.buffer)}return s+=e,s-e},l=e=>{if(c+e>s)throw new Error("Outside of the bounds of writen data.");return c+=e,c-e};return{buffer:()=>o,bufferLength:()=>o.length,resetBuffer(){c=0,s=0},currentReadOffset:()=>c,currentWriteOffset:()=>s,incrementReadOffset:e=>l(e),remainingBytes:()=>s-c,readFloat32:()=>a.getFloat32(l(4)),readFloat64:()=>a.getFloat64(l(8)),readInt8:()=>a.getInt8(l(1)),readInt16:()=>a.getInt16(l(2)),readInt32:()=>a.getInt32(l(4)),readInt64:()=>a.getBigInt64(l(8)),readUint8:()=>a.getUint8(l(1)),readUint16:()=>a.getUint16(l(2)),readUint32:()=>a.getUint32(l(4)),readUint64:()=>a.getBigUint64(l(8)),readBuffer(){const e=a.getUint32(l(4));return o.subarray(l(e),l(0))},incrementWriteOffset:e=>u(e),size:()=>s,toBinary:()=>o.subarray(0,s),toCopiedBinary(){return new Uint8Array(this.toBinary())},writeBuffer(e,t=!0){t&&this.writeUint32(e.byteLength);const n=u(e.byteLength);o.set(e,n)},writeFloat32(e){const t=u(4);a.setFloat32(t,e)},writeFloat64(e){const t=u(8);a.setFloat64(t,e)},writeInt8(e){const t=u(1);a.setInt8(t,e)},writeInt16(e){const t=u(2);a.setInt16(t,e)},writeInt32(e){const t=u(4);a.setInt32(t,e)},writeInt64(e){const t=u(8);a.setBigInt64(t,e)},writeUint8(e){const t=u(1);a.setUint8(t,e)},writeUint16(e){const t=u(2);a.setUint16(t,e)},writeUint32(e){const t=u(4);a.setUint32(t,e)},writeUint64(e){const t=u(8);a.setBigUint64(t,e)},getFloat32:e=>a.getFloat32(e),getFloat64:e=>a.getFloat64(e),getInt8:e=>a.getInt8(e),getInt16:e=>a.getInt16(e),getInt32:e=>a.getInt32(e),getInt64:e=>a.getBigInt64(e),getUint8:e=>a.getUint8(e),getUint16:e=>a.getUint16(e),getUint32:e=>a.getUint32(e),getUint64:e=>a.getBigUint64(e),setFloat32(e,t){a.setFloat32(e,t)},setFloat64(e,t){a.setFloat64(e,t)},setInt8(e,t){a.setInt8(e,t)},setInt16(e,t){a.setInt16(e,t)},setInt32(e,t){a.setInt32(e,t)},setInt64(e,t){a.setBigInt64(e,t)},setUint8(e,t){a.setUint8(e,t)},setUint16(e,t){a.setUint16(e,t)},setUint32(e,t){a.setUint32(e,t)},setUint64(e,t){a.setBigUint64(e,t)}}}var WireMessage;!function(e){var t;function n(t){const n=t.remainingBytes();if(n<e.HEADER_LENGTH)return!1;return!(n<t.getUint32(t.currentReadOffset()))}(t=e.Enum||(e.Enum={}))[t.RESERVED=0]="RESERVED",t[t.PUT_COMPONENT=1]="PUT_COMPONENT",t[t.DELETE_COMPONENT=2]="DELETE_COMPONENT",t[t.MAX_MESSAGE_TYPE=3]="MAX_MESSAGE_TYPE",e.HEADER_LENGTH=8,e.validate=n,e.readHeader=function(e){return n(e)?{length:e.readUint32(),type:e.readUint32()}:null}}(WireMessage||(WireMessage={}));var WireMessage$1=WireMessage,ComponentOperation,EntityUtils;function crdtSceneSystem({engine:e,transports:t}){const n=distExports.crdtProtocol(),r=[],i=[];function o(e){const t=Array.from(e);return e.length=0,t}return t.forEach((e=>{return e.onmessage=(t=e.type,function(e){const n=createByteBuffer({reading:{buffer:e,currentOffset:0}});for(;WireMessage$1.validate(n);){const e=n.currentReadOffset(),i=ComponentOperation.read(n),{type:o,entity:a,componentId:s,data:c,timestamp:u}=i;r.push({type:o,entity:a,componentId:s,data:c,timestamp:u,transportType:t,messageBuffer:n.buffer().subarray(e,n.currentReadOffset())})}});var t})),{createMessages:function(r){const a=o(i),s=createByteBuffer();for(const[i,o]of r)for(const r of o){const o=e.getComponent(r),c=o.has(i)?o.toBinary(i).toBinary():null,u=n.createEvent(i,r,c),l=s.currentWriteOffset(),d=o.has(i)?WireMessage$1.Enum.PUT_COMPONENT:WireMessage$1.Enum.DELETE_COMPONENT,f={type:d,componentId:r,entity:i,timestamp:u.timestamp};t.some((e=>e.filter(f)))&&(ComponentOperation.write(d,i,u.timestamp,o,s),a.push({...f,messageBuffer:s.buffer().subarray(l,s.currentWriteOffset())}))}const c=createByteBuffer();for(const e of t){c.resetBuffer();for(const t of a)e.filter(t)&&c.writeBuffer(t.messageBuffer,!1);c.size()&&e.send(c.toBinary())}},receiveMessages:function(){const a=o(r);for(const r of t){const t=createByteBuffer();for(const r of a){const{data:o,timestamp:a,componentId:s,entity:c,type:u}=r,l={key1:c,key2:s,data:o||null,timestamp:a},d=e.getComponent(s),f=n.processMessage(l);if(l!==f){const e=d.has(c)?WireMessage$1.Enum.PUT_COMPONENT:WireMessage$1.Enum.DELETE_COMPONENT;ComponentOperation.write(e,c,f.timestamp,d,t)}else{if(u===WireMessage$1.Enum.DELETE_COMPONENT)d.deleteFrom(c);else{const e=createByteBuffer({reading:{buffer:r.data,currentOffset:0}});d.upsertFromBinary(r.entity,e),d.clearDirty()}i.push(r)}}t.size()&&r.send(t.toBinary())}}}}function EntityContainer(){const e=Entity(EntityUtils.STATIC_ENTITIES_RANGE),t=Entity(EntityUtils.DYNAMIC_ENTITIES_RANGE);return{generateEntity:(n=!1)=>n?t.generateEntity():e.generateEntity(),removeEntity:n=>e.removeEntity(n)||t.removeEntity(n),isEntityExists:n=>EntityUtils.isReservedEntity(n)||e.getExistingEntities().has(n)||t.getExistingEntities().has(n),getExistingEntities:()=>new Set([...e.getExistingEntities(),...t.getExistingEntities()])}}function Entity(e){let t=e[0];const n=new Set;return{getExistingEntities:()=>new Set(n),generateEntity:function(){if(t>=e[1])throw new Error(`It fails trying to generate an entity out of range [${e[0]}, ${e[1]}].`);const r=t;return t++,n.add(r),r},removeEntity:function(e){return n.delete(e)}}}function deepReadonly(e){return Object.freeze({...e})}function defineComponent(e,t){const n=new Map,r=new Set;return{_id:e,default:function(){return t.create()},isDirty:function(e){return r.has(e)},has:function(e){return n.has(e)},deleteFrom:function(e){const t=n.get(e);return n.delete(e),r.add(e),t||null},getOrNull:function(e){const t=n.get(e);return t?deepReadonly(t):null},get:function(t){const r=n.get(t);if(!r)throw new Error(`[getFrom] Component ${e} for ${t} not found`);return deepReadonly(r)},create:function(i,o){if(n.get(i))throw new Error(`[create] Component ${e} for ${i} already exists`);const a=void 0===o?t.create():o;return n.set(i,a),r.add(i),a},createOrReplace:function(e,i){const o=void 0===i?t.create():i;return n.set(e,o),r.add(e),o},getMutableOrNull:function(e){const t=n.get(e);return t?(r.add(e),t):null},getMutable:function(t){const n=this.getMutableOrNull(t);if(null===n)throw new Error(`[mutable] Component ${e} for ${t} not found`);return n},iterator:function*(){for(const[e,t]of n)yield[e,t]},dirtyIterator:function*(){for(const e of r)yield e},toBinary(r){const i=n.get(r);if(!i)throw new Error(`[toBinary] Component ${e} for ${r} not found`);const o=createByteBuffer();return t.serialize(i,o),o},writeToByteBuffer(r,i){const o=n.get(r);if(!o)throw new Error(`[writeToByteBuffer] Component ${e} for ${r} not found`);t.serialize(o,i)},updateFromBinary(t,r){if(!n.get(t))throw new Error(`[updateFromBinary] Component ${e} for ${t} not found`);return this.upsertFromBinary(t,r)},upsertFromBinary(e,i){const o=t.deserialize(i);return n.set(e,o),r.add(e),o},clearDirty:function(){r.clear()}}}!function(e){e.MESSAGE_HEADER_LENGTH=20,e.write=function(t,n,r,i,o){const a=o.incrementWriteOffset(WireMessage$1.HEADER_LENGTH+e.MESSAGE_HEADER_LENGTH);t===WireMessage$1.Enum.PUT_COMPONENT&&i.writeToByteBuffer(n,o);const s=o.size()-a;o.setUint32(a,s),o.setUint32(a+4,t),o.setUint32(a+8,n),o.setUint32(a+12,i._id),o.setUint64(a+16,BigInt(r)),o.setUint32(a+24,s-e.MESSAGE_HEADER_LENGTH-WireMessage$1.HEADER_LENGTH)},e.read=function(e){const t=WireMessage$1.readHeader(e);if(!t)return null;const n={...t,entity:e.readUint32(),componentId:e.readInt32(),timestamp:Number(e.readUint64())};return t.type===WireMessage$1.Enum.DELETE_COMPONENT?n:{...n,data:e.readBuffer()}}}(ComponentOperation||(ComponentOperation={})),function(e){function t(e,t){return e>=t[0]&&e<=t[1]}e.MAX_ENTITIES=4294967295,e.DYNAMIC_ENTITIES_START_AT=1e5,e.RESERVED_STATIC_ENTITIES=512,e.RESERVED_ENTITIES_RANGE=[0,e.RESERVED_STATIC_ENTITIES-1],e.STATIC_ENTITIES_RANGE=[e.RESERVED_STATIC_ENTITIES,e.DYNAMIC_ENTITIES_START_AT-1],e.DYNAMIC_ENTITIES_RANGE=[e.DYNAMIC_ENTITIES_START_AT,e.MAX_ENTITIES],e.isDynamicEntity=function(n){return t(n,e.DYNAMIC_ENTITIES_RANGE)},e.isStaticEntity=function(n){return t(n,e.STATIC_ENTITIES_RANGE)},e.isReservedEntity=function(n){return t(n,e.RESERVED_ENTITIES_RANGE)}}(EntityUtils||(EntityUtils={}));const SYSTEMS_REGULAR_PRIORITY=1e5;function SystemContainer(){const e=[];function t(){e.sort(((e,t)=>t.priority-e.priority))}return{add:function(n,r,i){if(e.find((e=>e.fn===n)))throw new Error("System already added");if(i&&e.find((e=>e.name===i)))throw new Error("System name already used");e.push({fn:n,priority:r,name:i}),t()},remove:function(n){let r=-1;return r="string"==typeof n?e.findIndex((e=>e.name===n)):e.findIndex((e=>e.fn===n)),-1!==r&&(e.splice(r,1),t(),!0)},getSystems:()=>e}}const COMPONENT_ID$k=1,TRANSFORM_LENGTH=44,TransformSchema={serialize(e,t){const n=t.incrementWriteOffset(TRANSFORM_LENGTH);t.setFloat32(n,e.position.x),t.setFloat32(n+4,e.position.y),t.setFloat32(n+8,e.position.z),t.setFloat32(n+12,e.rotation.x),t.setFloat32(n+16,e.rotation.y),t.setFloat32(n+20,e.rotation.z),t.setFloat32(n+24,e.rotation.w),t.setFloat32(n+28,e.scale.x),t.setFloat32(n+32,e.scale.y),t.setFloat32(n+36,e.scale.z),t.setUint32(n+40,e.parent||0)},deserialize(e){const t=e.incrementReadOffset(TRANSFORM_LENGTH);return{position:{x:e.getFloat32(t),y:e.getFloat32(t+4),z:e.getFloat32(t+8)},rotation:{x:e.getFloat32(t+12),y:e.getFloat32(t+16),z:e.getFloat32(t+20),w:e.getFloat32(t+24)},scale:{x:e.getFloat32(t+28),y:e.getFloat32(t+32),z:e.getFloat32(t+36)},parent:e.getUint32(t+40)}},create:()=>({position:{x:0,y:0,z:0},scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0,w:1},parent:void 0})};var minimal$1={exports:{}},indexMinimal={},minimal={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;return hasRequiredAspromise=1,aspromise=function(e,t){var n=new Array(arguments.length-1),r=0,i=2,o=!0;for(;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,a){n[r]=function(e){if(o)if(o=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,a(e))}}))}}var base64={},hasRequiredBase64,eventemitter,hasRequiredEventemitter,float,hasRequiredFloat,inquire_1,hasRequiredInquire;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(e){var t=e;t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var n=new Array(64),r=new Array(123),i=0;i<64;)r[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;t.encode=function(e,t,r){for(var i,o=null,a=[],s=0,c=0;t<r;){var u=e[t++];switch(c){case 0:a[s++]=n[u>>2],i=(3&u)<<4,c=1;break;case 1:a[s++]=n[i|u>>4],i=(15&u)<<2,c=2;break;case 2:a[s++]=n[i|u>>6],a[s++]=n[63&u],c=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[i],a[s++]=61,1===c&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var o="invalid encoding";t.decode=function(e,t,n){for(var i,a=n,s=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&s>1)break;if(void 0===(u=r[u]))throw Error(o);switch(s){case 0:i=u,s=1;break;case 1:t[n++]=i<<2|(48&u)>>4,i=u,s=2;break;case 2:t[n++]=(15&i)<<4|(60&u)>>2,i=u,s=3;break;case 3:t[n++]=(3&i)<<6|u,s=0}}if(1===s)throw Error(o);return n-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(base64)),base64}function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;function e(){this._listeners={}}return hasRequiredEventemitter=1,eventemitter=e,e.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},e.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},e.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this},eventemitter}function requireFloat(){if(hasRequiredFloat)return float;function e(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function o(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?i:o,e.writeFloatBE=r?o:i,e.readFloatLE=r?a:s,e.readFloatBE=r?s:a}():function(){function o(e,t,n,r){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),i=2*(r>>31)+1,o=r>>>23&255,a=8388607&r;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=o.bind(null,t),e.writeFloatBE=o.bind(null,n),e.readFloatLE=a.bind(null,r),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function o(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?i:o,e.writeDoubleBE=r?o:i,e.readDoubleLE=r?a:s,e.readDoubleBE=r?s:a}():function(){function o(e,t,n,r,i,o){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,i,o+t),e(1/r>0?0:2147483648,i,o+n);else if(isNaN(r))e(0,i,o+t),e(2146959360,i,o+n);else if(r>17976931348623157e292)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+n);else{var c=Math.floor(Math.log(r)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=r*Math.pow(2,-c))>>>0,i,o+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,i,o+n)}}}function a(e,t,n,r,i){var o=e(r,i+t),a=e(r,i+n),s=2*(a>>31)+1,c=a>>>20&2047,u=4294967296*(1048575&a)+o;return 2047===c?u?NaN:s*(1/0):0===c?5e-324*s*u:s*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=o.bind(null,t,0,4),e.writeDoubleBE=o.bind(null,n,4,0),e.readDoubleLE=a.bind(null,r,0,4),e.readDoubleBE=a.bind(null,i,4,0)}(),e}function t(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function n(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function r(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}return hasRequiredFloat=1,float=e(e)}function requireInquire(){if(hasRequiredInquire)return inquire_1;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}return hasRequiredInquire=1,inquire_1=inquire,inquire_1}var utf8={},hasRequiredUtf8,pool_1,hasRequiredPool,longbits,hasRequiredLongbits,hasRequiredMinimal$1,writer,hasRequiredWriter,writer_buffer,hasRequiredWriter_buffer,reader,hasRequiredReader,reader_buffer,hasRequiredReader_buffer;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(e){var t=e;t.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},t.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,o=[],a=0;t<n;)(r=e[t++])<128?o[a++]=r:r>191&&r<224?o[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},t.write=function(e,t,n){for(var r,i,o=n,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-o}}(utf8)),utf8}function requirePool(){if(hasRequiredPool)return pool_1;return hasRequiredPool=1,pool_1=function(e,t,n){var r=n||8192,i=r>>>1,o=null,a=r;return function(n){if(n<1||n>i)return e(n);a+n>r&&(o=e(r),a=0);var s=t.call(o,a,a+=n);return 7&a&&(a=1+(7|a)),s}}}function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=t;var e=requireMinimal$1();function t(e,t){this.lo=e>>>0,this.hi=t>>>0}var n=t.zero=new t(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var r=t.zeroHash="\0\0\0\0\0\0\0\0";t.fromNumber=function(e){if(0===e)return n;var r=e<0;r&&(e=-e);var i=e>>>0,o=(e-i)/4294967296>>>0;return r&&(o=~o>>>0,i=~i>>>0,++i>4294967295&&(i=0,++o>4294967295&&(o=0))),new t(i,o)},t.from=function(r){if("number"==typeof r)return t.fromNumber(r);if(e.isString(r)){if(!e.Long)return t.fromNumber(parseInt(r,10));r=e.Long.fromString(r)}return r.low||r.high?new t(r.low>>>0,r.high>>>0):n},t.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},t.prototype.toLong=function(t){return e.Long?new e.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var i=String.prototype.charCodeAt;return t.fromHash=function(e){return e===r?n:new t((i.call(e,0)|i.call(e,1)<<8|i.call(e,2)<<16|i.call(e,3)<<24)>>>0,(i.call(e,4)|i.call(e,5)<<8|i.call(e,6)<<16|i.call(e,7)<<24)>>>0)},t.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},t.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},t.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},t.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10},longbits}function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(e){var t=e;function n(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}t.asPromise=requireAspromise(),t.base64=requireBase64(),t.EventEmitter=requireEventemitter(),t.float=requireFloat(),t.inquire=requireInquire(),t.utf8=requireUtf8(),t.pool=requirePool(),t.LongBits=requireLongbits(),t.isNode=Boolean(void 0!==commonjsGlobal&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),t.global=t.isNode&&commonjsGlobal||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||commonjsGlobal,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"==typeof e},t.isset=t.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){var r=t.LongBits.fromHash(e);return t.Long?t.Long.fromBits(r.lo,r.hi,n):r.toNumber(Boolean(n))},t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;e?(t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):t._Buffer_from=t._Buffer_allocUnsafe=null}}(minimal)),minimal}function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=c;var e,t=requireMinimal$1(),n=t.LongBits,r=t.base64,i=t.utf8;function o(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function a(){}function s(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function c(){this.len=0,this.head=new o(a,0,0),this.tail=this.head,this.states=null}var u=function(){return t.Buffer?function(){return(c.create=function(){return new e})()}:function(){return new c}};function l(e,t,n){t[n]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function f(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function p(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}c.create=u(),c.alloc=function(e){return new t.Array(e)},t.Array!==Array&&(c.alloc=t.pool(c.alloc,t.Array.prototype.subarray)),c.prototype._push=function(e,t,n){return this.tail=this.tail.next=new o(e,t,n),this.len+=t,this},d.prototype=Object.create(o.prototype),d.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},c.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},c.prototype.int32=function(e){return e<0?this._push(f,10,n.fromNumber(e)):this.uint32(e)},c.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},c.prototype.uint64=function(e){var t=n.from(e);return this._push(f,t.length(),t)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(e){var t=n.from(e).zzEncode();return this._push(f,t.length(),t)},c.prototype.bool=function(e){return this._push(l,1,e?1:0)},c.prototype.fixed32=function(e){return this._push(p,4,e>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(e){var t=n.from(e);return this._push(p,4,t.lo)._push(p,4,t.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(e){return this._push(t.float.writeFloatLE,4,e)},c.prototype.double=function(e){return this._push(t.float.writeDoubleLE,8,e)};var h=t.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};return c.prototype.bytes=function(e){var n=e.length>>>0;if(!n)return this._push(l,1,0);if(t.isString(e)){var i=c.alloc(n=r.length(e));r.decode(e,i,0),e=i}return this.uint32(n)._push(h,n,e)},c.prototype.string=function(e){var t=i.length(e);return t?this.uint32(t)._push(i.write,t,e):this._push(l,1,0)},c.prototype.fork=function(){return this.states=new s(this),this.head=this.tail=new o(a,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new o(a,0,0),this.len=0),this},c.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},c.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},c._configure=function(t){e=t,c.create=u(),e._configure()},writer}function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=n;var e=requireWriter();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(){e.call(this)}function r(e,n,r){e.length<40?t.utf8.write(e,n,r):n.utf8Write?n.utf8Write(e,r):n.write(e,r)}return n._configure=function(){n.alloc=t._Buffer_allocUnsafe,n.writeBytesBuffer=t.Buffer&&t.Buffer.prototype instanceof Uint8Array&&"set"===t.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},n.prototype.bytes=function(e){t.isString(e)&&(e=t._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(n.writeBytesBuffer,r,e),this},n.prototype.string=function(e){var n=t.Buffer.byteLength(e);return this.uint32(n),n&&this._push(r,n,e),this},n._configure(),writer_buffer}function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=o;var e,t=requireMinimal$1(),n=t.LongBits,r=t.utf8;function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function o(e){this.buf=e,this.pos=0,this.len=e.length}var a,s="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new o(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new o(e);throw Error("illegal buffer")},c=function(){return t.Buffer?function(n){return(o.create=function(n){return t.Buffer.isBuffer(n)?new e(n):s(n)})(n)}:s};function u(){var e=new n(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw i(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw i(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw i(this,8);return new n(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}return o.create=c(),o.prototype._slice=t.Array.prototype.subarray||t.Array.prototype.slice,o.prototype.uint32=(a=4294967295,function(){if(a=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return a;if(a=(a|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return a;if((this.pos+=5)>this.len)throw this.pos=this.len,i(this,10);return a}),o.prototype.int32=function(){return 0|this.uint32()},o.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},o.prototype.bool=function(){return 0!==this.uint32()},o.prototype.fixed32=function(){if(this.pos+4>this.len)throw i(this,4);return l(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw i(this,4);return 0|l(this.buf,this.pos+=4)},o.prototype.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=t.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},o.prototype.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=t.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},o.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw i(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},o.prototype.string=function(){var e=this.bytes();return r.read(e,0,e.length)},o.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw i(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw i(this)}while(128&this.buf[this.pos++]);return this},o.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},o._configure=function(n){e=n,o.create=c(),e._configure();var r=t.Long?"toLong":"toNumber";t.merge(o.prototype,{int64:function(){return u.call(this)[r](!1)},uint64:function(){return u.call(this)[r](!0)},sint64:function(){return u.call(this).zzDecode()[r](!1)},fixed64:function(){return d.call(this)[r](!0)},sfixed64:function(){return d.call(this)[r](!1)}})},reader}function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=n;var e=requireReader();(n.prototype=Object.create(e.prototype)).constructor=n;var t=requireMinimal$1();function n(t){e.call(this,t)}return n._configure=function(){t.Buffer&&(n.prototype._slice=t.Buffer.prototype.slice)},n.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},n._configure(),reader_buffer}var rpc={},service,hasRequiredService,hasRequiredRpc,roots,hasRequiredRoots,hasRequiredIndexMinimal,hasRequiredMinimal;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=t;var e=requireMinimal$1();function t(t,n,r){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");e.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(n),this.responseDelimited=Boolean(r)}return(t.prototype=Object.create(e.EventEmitter.prototype)).constructor=t,t.prototype.rpcCall=function t(n,r,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return e.asPromise(t,s,n,r,i,o);if(s.rpcImpl)try{return s.rpcImpl(n,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,t){if(e)return s.emit("error",e,n),a(e);if(null!==t){if(!(t instanceof i))try{t=i[s.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return s.emit("error",e,n),a(e)}return s.emit("data",t,n),a(null,t)}s.end(!0)}))}catch(e){return s.emit("error",e,n),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},t.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(e){e.Service=requireService()}(rpc)),rpc}function requireRoots(){return hasRequiredRoots?roots:(hasRequiredRoots=1,roots={})}function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(e){var t=e;function n(){t.util._configure(),t.Writer._configure(t.BufferWriter),t.Reader._configure(t.BufferReader)}t.build="minimal",t.Writer=requireWriter(),t.BufferWriter=requireWriter_buffer(),t.Reader=requireReader(),t.BufferReader=requireReader_buffer(),t.util=requireMinimal$1(),t.rpc=requireRpc(),t.roots=requireRoots(),t.configure=n,n()}(indexMinimal)),indexMinimal}function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal$1.exports=requireIndexMinimal()),minimal$1.exports}var minimalExports=requireMinimal();function createBasePBAnimator(){return{states:[]}}const PBAnimator={encode(e,t=minimalExports.Writer.create()){for(const n of e.states)PBAnimationState.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBAnimator();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.states.push(PBAnimationState.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return i}};function createBasePBAnimationState(){return{name:"",clip:"",playing:void 0,weight:void 0,speed:void 0,loop:void 0,shouldReset:void 0}}const PBAnimationState={encode:(e,t=minimalExports.Writer.create())=>(""!==e.name&&t.uint32(10).string(e.name),""!==e.clip&&t.uint32(18).string(e.clip),void 0!==e.playing&&t.uint32(24).bool(e.playing),void 0!==e.weight&&t.uint32(37).float(e.weight),void 0!==e.speed&&t.uint32(45).float(e.speed),void 0!==e.loop&&t.uint32(48).bool(e.loop),void 0!==e.shouldReset&&t.uint32(56).bool(e.shouldReset),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBAnimationState();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.name=n.string();break;case 2:i.clip=n.string();break;case 3:i.playing=n.bool();break;case 4:i.weight=n.float();break;case 5:i.speed=n.float();break;case 6:i.loop=n.bool();break;case 7:i.shouldReset=n.bool();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$j=1042,AnimatorSchema={serialize(e,t){const n=PBAnimator.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBAnimator.decode(e.buffer(),e.remainingBytes()),create:()=>PBAnimator.decode(new Uint8Array)};function createBasePBAudioSource(){return{playing:void 0,volume:void 0,loop:void 0,pitch:void 0,audioClipUrl:""}}const PBAudioSource={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.playing&&t.uint32(8).bool(e.playing),void 0!==e.volume&&t.uint32(21).float(e.volume),void 0!==e.loop&&t.uint32(24).bool(e.loop),void 0!==e.pitch&&t.uint32(37).float(e.pitch),""!==e.audioClipUrl&&t.uint32(42).string(e.audioClipUrl),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBAudioSource();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.playing=n.bool();break;case 2:i.volume=n.float();break;case 3:i.loop=n.bool();break;case 4:i.pitch=n.float();break;case 5:i.audioClipUrl=n.string();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$i=1020,AudioSourceSchema={serialize(e,t){const n=PBAudioSource.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBAudioSource.decode(e.buffer(),e.remainingBytes()),create:()=>PBAudioSource.decode(new Uint8Array)};var AvatarAnchorPoint;function createBasePBAvatarAttach(){return{avatarId:"",anchorPointId:0}}!function(e){e[e.POSITION=0]="POSITION",e[e.NAME_TAG=1]="NAME_TAG",e[e.LEFT_HAND=2]="LEFT_HAND",e[e.RIGHT_HAND=3]="RIGHT_HAND",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(AvatarAnchorPoint||(AvatarAnchorPoint={}));const PBAvatarAttach={encode:(e,t=minimalExports.Writer.create())=>(""!==e.avatarId&&t.uint32(10).string(e.avatarId),0!==e.anchorPointId&&t.uint32(16).int32(e.anchorPointId),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBAvatarAttach();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.avatarId=n.string();break;case 2:i.anchorPointId=n.int32();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$h=1073,AvatarAttachSchema={serialize(e,t){const n=PBAvatarAttach.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBAvatarAttach.decode(e.buffer(),e.remainingBytes()),create:()=>PBAvatarAttach.decode(new Uint8Array)};function createBaseColor3(){return{r:0,g:0,b:0}}const Color3={encode:(e,t=minimalExports.Writer.create())=>(0!==e.r&&t.uint32(13).float(e.r),0!==e.g&&t.uint32(21).float(e.g),0!==e.b&&t.uint32(29).float(e.b),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBaseColor3();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.r=n.float();break;case 2:i.g=n.float();break;case 3:i.b=n.float();break;default:n.skipType(7&e)}}return i}};function createBasePBAvatarShape(){return{id:"",name:void 0,bodyShape:void 0,skinColor:void 0,hairColor:void 0,eyeColor:void 0,wearables:[],expressionTriggerId:void 0,expressionTriggerTimestamp:void 0,stickerTriggerId:void 0,stickerTriggerTimestamp:void 0,talking:void 0}}const PBAvatarShape={encode(e,t=minimalExports.Writer.create()){""!==e.id&&t.uint32(10).string(e.id),void 0!==e.name&&t.uint32(18).string(e.name),void 0!==e.bodyShape&&t.uint32(26).string(e.bodyShape),void 0!==e.skinColor&&Color3.encode(e.skinColor,t.uint32(34).fork()).ldelim(),void 0!==e.hairColor&&Color3.encode(e.hairColor,t.uint32(42).fork()).ldelim(),void 0!==e.eyeColor&&Color3.encode(e.eyeColor,t.uint32(50).fork()).ldelim();for(const n of e.wearables)t.uint32(58).string(n);return void 0!==e.expressionTriggerId&&t.uint32(66).string(e.expressionTriggerId),void 0!==e.expressionTriggerTimestamp&&t.uint32(72).int64(e.expressionTriggerTimestamp),void 0!==e.stickerTriggerId&&t.uint32(82).string(e.stickerTriggerId),void 0!==e.stickerTriggerTimestamp&&t.uint32(88).int64(e.stickerTriggerTimestamp),void 0!==e.talking&&t.uint32(96).bool(e.talking),t},decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBAvatarShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.id=n.string();break;case 2:i.name=n.string();break;case 3:i.bodyShape=n.string();break;case 4:i.skinColor=Color3.decode(n,n.uint32());break;case 5:i.hairColor=Color3.decode(n,n.uint32());break;case 6:i.eyeColor=Color3.decode(n,n.uint32());break;case 7:i.wearables.push(n.string());break;case 8:i.expressionTriggerId=n.string();break;case 9:i.expressionTriggerTimestamp=longToNumber(n.int64());break;case 10:i.stickerTriggerId=n.string();break;case 11:i.stickerTriggerTimestamp=longToNumber(n.int64());break;case 12:i.talking=n.bool();break;default:n.skipType(7&e)}}return i}};var globalThis$1=(()=>{if(void 0!==globalThis$1)return globalThis$1;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw"Unable to locate global object"})();function longToNumber(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new globalThis$1.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}const COMPONENT_ID$g=1080,AvatarShapeSchema={serialize(e,t){const n=PBAvatarShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBAvatarShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBAvatarShape.decode(new Uint8Array)};function createBasePBBillboard(){return{x:void 0,y:void 0,z:void 0}}const PBBillboard={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.x&&t.uint32(8).bool(e.x),void 0!==e.y&&t.uint32(16).bool(e.y),void 0!==e.z&&t.uint32(24).bool(e.z),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBBillboard();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.x=n.bool();break;case 2:i.y=n.bool();break;case 3:i.z=n.bool();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$f=1090,BillboardSchema={serialize(e,t){const n=PBBillboard.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBBillboard.decode(e.buffer(),e.remainingBytes()),create:()=>PBBillboard.decode(new Uint8Array)};function createBasePBBoxShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,uvs:[]}}const PBBoxShape={encode(e,t=minimalExports.Writer.create()){void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),t.uint32(34).fork();for(const n of e.uvs)t.float(n);return t.ldelim(),t},decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBBoxShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.withCollisions=n.bool();break;case 2:i.isPointerBlocker=n.bool();break;case 3:i.visible=n.bool();break;case 4:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos<e;)i.uvs.push(n.float())}else i.uvs.push(n.float());break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$e=1013,BoxShapeSchema={serialize(e,t){const n=PBBoxShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBBoxShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBBoxShape.decode(new Uint8Array)};function createBasePBCameraMode(){return{mode:0}}const PBCameraMode={encode:(e,t=minimalExports.Writer.create())=>(0!==e.mode&&t.uint32(8).int32(e.mode),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBCameraMode();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.mode=n.int32();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$d=1072,CameraModeSchema={serialize(e,t){const n=PBCameraMode.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBCameraMode.decode(e.buffer(),e.remainingBytes()),create:()=>PBCameraMode.decode(new Uint8Array)};function createBaseVector3(){return{x:0,y:0,z:0}}const Vector3={encode:(e,t=minimalExports.Writer.create())=>(0!==e.x&&t.uint32(13).float(e.x),0!==e.y&&t.uint32(21).float(e.y),0!==e.z&&t.uint32(29).float(e.z),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBaseVector3();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.x=n.float();break;case 2:i.y=n.float();break;case 3:i.z=n.float();break;default:n.skipType(7&e)}}return i}};function createBasePBCameraModeArea(){return{area:void 0,mode:0}}const PBCameraModeArea={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.area&&Vector3.encode(e.area,t.uint32(10).fork()).ldelim(),0!==e.mode&&t.uint32(16).int32(e.mode),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBCameraModeArea();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.area=Vector3.decode(n,n.uint32());break;case 2:i.mode=n.int32();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$c=1071,CameraModeAreaSchema={serialize(e,t){const n=PBCameraModeArea.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBCameraModeArea.decode(e.buffer(),e.remainingBytes()),create:()=>PBCameraModeArea.decode(new Uint8Array)};function createBasePBCylinderShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,radiusTop:void 0,radiusBottom:void 0}}const PBCylinderShape={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),void 0!==e.radiusTop&&t.uint32(37).float(e.radiusTop),void 0!==e.radiusBottom&&t.uint32(45).float(e.radiusBottom),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBCylinderShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.withCollisions=n.bool();break;case 2:i.isPointerBlocker=n.bool();break;case 3:i.visible=n.bool();break;case 4:i.radiusTop=n.float();break;case 5:i.radiusBottom=n.float();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$b=1016,CylinderShapeSchema={serialize(e,t){const n=PBCylinderShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBCylinderShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBCylinderShape.decode(new Uint8Array)};function createBasePBGLTFShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,src:""}}const PBGLTFShape={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),""!==e.src&&t.uint32(34).string(e.src),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBGLTFShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.withCollisions=n.bool();break;case 2:i.isPointerBlocker=n.bool();break;case 3:i.visible=n.bool();break;case 4:i.src=n.string();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$a=1041,GLTFShapeSchema={serialize(e,t){const n=PBGLTFShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBGLTFShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBGLTFShape.decode(new Uint8Array)};var TextureWrapMode,FilterMode,TransparencyMode;function createBasePBMaterial(){return{texture:void 0,alphaTest:void 0,castShadows:void 0,alphaTexture:void 0,emissiveTexture:void 0,bumpTexture:void 0,albedoColor:void 0,emissiveColor:void 0,reflectivityColor:void 0,transparencyMode:void 0,metallic:void 0,roughness:void 0,glossiness:void 0,specularIntensity:void 0,emissiveIntensity:void 0,directIntensity:void 0}}!function(e){e[e.Repeat=0]="Repeat",e[e.Clamp=1]="Clamp",e[e.Mirror=2]="Mirror",e[e.MirrorOnce=3]="MirrorOnce",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(TextureWrapMode||(TextureWrapMode={})),function(e){e[e.Point=0]="Point",e[e.Bilinear=1]="Bilinear",e[e.Trilinear=2]="Trilinear",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(FilterMode||(FilterMode={})),function(e){e[e.Opaque=0]="Opaque",e[e.AlphaTest=1]="AlphaTest",e[e.AlphaBlend=2]="AlphaBlend",e[e.AlphaTestAndAlphaBlend=3]="AlphaTestAndAlphaBlend",e[e.Auto=4]="Auto",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(TransparencyMode||(TransparencyMode={}));const PBMaterial={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.texture&&PBMaterial_Texture.encode(e.texture,t.uint32(10).fork()).ldelim(),void 0!==e.alphaTest&&t.uint32(21).float(e.alphaTest),void 0!==e.castShadows&&t.uint32(24).bool(e.castShadows),void 0!==e.alphaTexture&&PBMaterial_Texture.encode(e.alphaTexture,t.uint32(34).fork()).ldelim(),void 0!==e.emissiveTexture&&PBMaterial_Texture.encode(e.emissiveTexture,t.uint32(42).fork()).ldelim(),void 0!==e.bumpTexture&&PBMaterial_Texture.encode(e.bumpTexture,t.uint32(50).fork()).ldelim(),void 0!==e.albedoColor&&Color3.encode(e.albedoColor,t.uint32(58).fork()).ldelim(),void 0!==e.emissiveColor&&Color3.encode(e.emissiveColor,t.uint32(66).fork()).ldelim(),void 0!==e.reflectivityColor&&Color3.encode(e.reflectivityColor,t.uint32(74).fork()).ldelim(),void 0!==e.transparencyMode&&t.uint32(80).int32(e.transparencyMode),void 0!==e.metallic&&t.uint32(93).float(e.metallic),void 0!==e.roughness&&t.uint32(101).float(e.roughness),void 0!==e.glossiness&&t.uint32(109).float(e.glossiness),void 0!==e.specularIntensity&&t.uint32(117).float(e.specularIntensity),void 0!==e.emissiveIntensity&&t.uint32(125).float(e.emissiveIntensity),void 0!==e.directIntensity&&t.uint32(133).float(e.directIntensity),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBMaterial();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.texture=PBMaterial_Texture.decode(n,n.uint32());break;case 2:i.alphaTest=n.float();break;case 3:i.castShadows=n.bool();break;case 4:i.alphaTexture=PBMaterial_Texture.decode(n,n.uint32());break;case 5:i.emissiveTexture=PBMaterial_Texture.decode(n,n.uint32());break;case 6:i.bumpTexture=PBMaterial_Texture.decode(n,n.uint32());break;case 7:i.albedoColor=Color3.decode(n,n.uint32());break;case 8:i.emissiveColor=Color3.decode(n,n.uint32());break;case 9:i.reflectivityColor=Color3.decode(n,n.uint32());break;case 10:i.transparencyMode=n.int32();break;case 11:i.metallic=n.float();break;case 12:i.roughness=n.float();break;case 13:i.glossiness=n.float();break;case 14:i.specularIntensity=n.float();break;case 15:i.emissiveIntensity=n.float();break;case 16:i.directIntensity=n.float();break;default:n.skipType(7&e)}}return i}};function createBasePBMaterial_Texture(){return{src:"",wrapMode:void 0,filterMode:void 0}}const PBMaterial_Texture={encode:(e,t=minimalExports.Writer.create())=>(""!==e.src&&t.uint32(10).string(e.src),void 0!==e.wrapMode&&t.uint32(16).int32(e.wrapMode),void 0!==e.filterMode&&t.uint32(24).int32(e.filterMode),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBMaterial_Texture();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.src=n.string();break;case 2:i.wrapMode=n.int32();break;case 3:i.filterMode=n.int32();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$9=1017,MaterialSchema={serialize(e,t){const n=PBMaterial.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBMaterial.decode(e.buffer(),e.remainingBytes()),create:()=>PBMaterial.decode(new Uint8Array)};function createBasePBNFTShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,src:"",assetId:void 0,style:void 0,color:void 0}}const PBNFTShape={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),""!==e.src&&t.uint32(34).string(e.src),void 0!==e.assetId&&t.uint32(42).string(e.assetId),void 0!==e.style&&t.uint32(48).int32(e.style),void 0!==e.color&&Color3.encode(e.color,t.uint32(58).fork()).ldelim(),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBNFTShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.withCollisions=n.bool();break;case 2:i.isPointerBlocker=n.bool();break;case 3:i.visible=n.bool();break;case 4:i.src=n.string();break;case 5:i.assetId=n.string();break;case 6:i.style=n.int32();break;case 7:i.color=Color3.decode(n,n.uint32());break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$8=1040,NFTShapeSchema={serialize(e,t){const n=PBNFTShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBNFTShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBNFTShape.decode(new Uint8Array)};function createBasePBOnPointerDown(){return{button:void 0,hoverText:void 0,maxDistance:void 0,showFeedback:void 0}}const PBOnPointerDown={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.button&&t.uint32(8).int32(e.button),void 0!==e.hoverText&&t.uint32(18).string(e.hoverText),void 0!==e.maxDistance&&t.uint32(29).float(e.maxDistance),void 0!==e.showFeedback&&t.uint32(32).bool(e.showFeedback),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBOnPointerDown();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.button=n.int32();break;case 2:i.hoverText=n.string();break;case 3:i.maxDistance=n.float();break;case 4:i.showFeedback=n.bool();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$7=1060,OnPointerDownSchema={serialize(e,t){const n=PBOnPointerDown.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBOnPointerDown.decode(e.buffer(),e.remainingBytes()),create:()=>PBOnPointerDown.decode(new Uint8Array)};function createBasePBOnPointerDownResult(){return{button:0,meshName:"",origin:void 0,direction:void 0,point:void 0,normal:void 0,distance:0,timestamp:0}}const PBOnPointerDownResult={encode:(e,t=minimalExports.Writer.create())=>(0!==e.button&&t.uint32(16).int32(e.button),""!==e.meshName&&t.uint32(26).string(e.meshName),void 0!==e.origin&&Vector3.encode(e.origin,t.uint32(34).fork()).ldelim(),void 0!==e.direction&&Vector3.encode(e.direction,t.uint32(42).fork()).ldelim(),void 0!==e.point&&Vector3.encode(e.point,t.uint32(50).fork()).ldelim(),void 0!==e.normal&&Vector3.encode(e.normal,t.uint32(58).fork()).ldelim(),0!==e.distance&&t.uint32(69).float(e.distance),0!==e.timestamp&&t.uint32(72).int32(e.timestamp),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBOnPointerDownResult();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 2:i.button=n.int32();break;case 3:i.meshName=n.string();break;case 4:i.origin=Vector3.decode(n,n.uint32());break;case 5:i.direction=Vector3.decode(n,n.uint32());break;case 6:i.point=Vector3.decode(n,n.uint32());break;case 7:i.normal=Vector3.decode(n,n.uint32());break;case 8:i.distance=n.float();break;case 9:i.timestamp=n.int32();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$6=1066,OnPointerDownResultSchema={serialize(e,t){const n=PBOnPointerDownResult.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBOnPointerDownResult.decode(e.buffer(),e.remainingBytes()),create:()=>PBOnPointerDownResult.decode(new Uint8Array)};function createBasePBOnPointerUp(){return{button:void 0,hoverText:void 0,maxDistance:void 0,showFeedback:void 0}}const PBOnPointerUp={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.button&&t.uint32(8).int32(e.button),void 0!==e.hoverText&&t.uint32(18).string(e.hoverText),void 0!==e.maxDistance&&t.uint32(29).float(e.maxDistance),void 0!==e.showFeedback&&t.uint32(32).bool(e.showFeedback),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBOnPointerUp();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.button=n.int32();break;case 2:i.hoverText=n.string();break;case 3:i.maxDistance=n.float();break;case 4:i.showFeedback=n.bool();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$5=1061,OnPointerUpSchema={serialize(e,t){const n=PBOnPointerUp.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBOnPointerUp.decode(e.buffer(),e.remainingBytes()),create:()=>PBOnPointerUp.decode(new Uint8Array)};function createBasePBOnPointerUpResult(){return{button:0,meshName:"",origin:void 0,direction:void 0,point:void 0,normal:void 0,distance:0,timestamp:0}}const PBOnPointerUpResult={encode:(e,t=minimalExports.Writer.create())=>(0!==e.button&&t.uint32(16).int32(e.button),""!==e.meshName&&t.uint32(26).string(e.meshName),void 0!==e.origin&&Vector3.encode(e.origin,t.uint32(34).fork()).ldelim(),void 0!==e.direction&&Vector3.encode(e.direction,t.uint32(42).fork()).ldelim(),void 0!==e.point&&Vector3.encode(e.point,t.uint32(50).fork()).ldelim(),void 0!==e.normal&&Vector3.encode(e.normal,t.uint32(58).fork()).ldelim(),0!==e.distance&&t.uint32(69).float(e.distance),0!==e.timestamp&&t.uint32(72).int32(e.timestamp),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBOnPointerUpResult();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 2:i.button=n.int32();break;case 3:i.meshName=n.string();break;case 4:i.origin=Vector3.decode(n,n.uint32());break;case 5:i.direction=Vector3.decode(n,n.uint32());break;case 6:i.point=Vector3.decode(n,n.uint32());break;case 7:i.normal=Vector3.decode(n,n.uint32());break;case 8:i.distance=n.float();break;case 9:i.timestamp=n.int32();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$4=1065,OnPointerUpResultSchema={serialize(e,t){const n=PBOnPointerUpResult.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBOnPointerUpResult.decode(e.buffer(),e.remainingBytes()),create:()=>PBOnPointerUpResult.decode(new Uint8Array)};function createBasePBPlaneShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0,uvs:[]}}const PBPlaneShape={encode(e,t=minimalExports.Writer.create()){void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),t.uint32(34).fork();for(const n of e.uvs)t.float(n);return t.ldelim(),t},decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBPlaneShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.withCollisions=n.bool();break;case 2:i.isPointerBlocker=n.bool();break;case 3:i.visible=n.bool();break;case 4:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.pos<e;)i.uvs.push(n.float())}else i.uvs.push(n.float());break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$3=1014,PlaneShapeSchema={serialize(e,t){const n=PBPlaneShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBPlaneShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBPlaneShape.decode(new Uint8Array)};function createBasePBPointerLock(){return{isPointerLocked:!1}}const PBPointerLock={encode:(e,t=minimalExports.Writer.create())=>(!0===e.isPointerLocked&&t.uint32(8).bool(e.isPointerLocked),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBPointerLock();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.isPointerLocked=n.bool();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$2=1074,PointerLockSchema={serialize(e,t){const n=PBPointerLock.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBPointerLock.decode(e.buffer(),e.remainingBytes()),create:()=>PBPointerLock.decode(new Uint8Array)};function createBasePBSphereShape(){return{withCollisions:void 0,isPointerBlocker:void 0,visible:void 0}}const PBSphereShape={encode:(e,t=minimalExports.Writer.create())=>(void 0!==e.withCollisions&&t.uint32(8).bool(e.withCollisions),void 0!==e.isPointerBlocker&&t.uint32(16).bool(e.isPointerBlocker),void 0!==e.visible&&t.uint32(24).bool(e.visible),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBSphereShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.withCollisions=n.bool();break;case 2:i.isPointerBlocker=n.bool();break;case 3:i.visible=n.bool();break;default:n.skipType(7&e)}}return i}},COMPONENT_ID$1=1015,SphereShapeSchema={serialize(e,t){const n=PBSphereShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBSphereShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBSphereShape.decode(new Uint8Array)};function createBasePBTextShape(){return{text:"",visible:void 0,font:void 0,opacity:void 0,fontSize:void 0,fontAutoSize:void 0,hTextAlign:void 0,vTextAlign:void 0,width:void 0,height:void 0,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0,lineSpacing:void 0,lineCount:void 0,textWrapping:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,outlineWidth:void 0,shadowColor:void 0,outlineColor:void 0,textColor:void 0}}const PBTextShape={encode:(e,t=minimalExports.Writer.create())=>(""!==e.text&&t.uint32(10).string(e.text),void 0!==e.visible&&t.uint32(16).bool(e.visible),void 0!==e.font&&t.uint32(26).string(e.font),void 0!==e.opacity&&t.uint32(37).float(e.opacity),void 0!==e.fontSize&&t.uint32(45).float(e.fontSize),void 0!==e.fontAutoSize&&t.uint32(48).bool(e.fontAutoSize),void 0!==e.hTextAlign&&t.uint32(58).string(e.hTextAlign),void 0!==e.vTextAlign&&t.uint32(66).string(e.vTextAlign),void 0!==e.width&&t.uint32(77).float(e.width),void 0!==e.height&&t.uint32(85).float(e.height),void 0!==e.paddingTop&&t.uint32(93).float(e.paddingTop),void 0!==e.paddingRight&&t.uint32(101).float(e.paddingRight),void 0!==e.paddingBottom&&t.uint32(109).float(e.paddingBottom),void 0!==e.paddingLeft&&t.uint32(117).float(e.paddingLeft),void 0!==e.lineSpacing&&t.uint32(125).float(e.lineSpacing),void 0!==e.lineCount&&t.uint32(128).int32(e.lineCount),void 0!==e.textWrapping&&t.uint32(136).bool(e.textWrapping),void 0!==e.shadowBlur&&t.uint32(149).float(e.shadowBlur),void 0!==e.shadowOffsetX&&t.uint32(157).float(e.shadowOffsetX),void 0!==e.shadowOffsetY&&t.uint32(165).float(e.shadowOffsetY),void 0!==e.outlineWidth&&t.uint32(173).float(e.outlineWidth),void 0!==e.shadowColor&&Color3.encode(e.shadowColor,t.uint32(178).fork()).ldelim(),void 0!==e.outlineColor&&Color3.encode(e.outlineColor,t.uint32(186).fork()).ldelim(),void 0!==e.textColor&&Color3.encode(e.textColor,t.uint32(194).fork()).ldelim(),t),decode(e,t){const n=e instanceof minimalExports.Reader?e:new minimalExports.Reader(e);let r=void 0===t?n.len:n.pos+t;const i=createBasePBTextShape();for(;n.pos<r;){const e=n.uint32();switch(e>>>3){case 1:i.text=n.string();break;case 2:i.visible=n.bool();break;case 3:i.font=n.string();break;case 4:i.opacity=n.float();break;case 5:i.fontSize=n.float();break;case 6:i.fontAutoSize=n.bool();break;case 7:i.hTextAlign=n.string();break;case 8:i.vTextAlign=n.string();break;case 9:i.width=n.float();break;case 10:i.height=n.float();break;case 11:i.paddingTop=n.float();break;case 12:i.paddingRight=n.float();break;case 13:i.paddingBottom=n.float();break;case 14:i.paddingLeft=n.float();break;case 15:i.lineSpacing=n.float();break;case 16:i.lineCount=n.int32();break;case 17:i.textWrapping=n.bool();break;case 18:i.shadowBlur=n.float();break;case 19:i.shadowOffsetX=n.float();break;case 20:i.shadowOffsetY=n.float();break;case 21:i.outlineWidth=n.float();break;case 22:i.shadowColor=Color3.decode(n,n.uint32());break;case 23:i.outlineColor=Color3.decode(n,n.uint32());break;case 24:i.textColor=Color3.decode(n,n.uint32());break;default:n.skipType(7&e)}}return i}},COMPONENT_ID=1030,TextShapeSchema={serialize(e,t){const n=PBTextShape.encode(e),r=new Uint8Array(n.finish(),0,n.len);t.writeBuffer(r,!1)},deserialize:e=>PBTextShape.decode(e.buffer(),e.remainingBytes()),create:()=>PBTextShape.decode(new Uint8Array)};function defineLibraryComponents({defineComponentFromSchema:e}){return{Transform:e(TransformSchema,COMPONENT_ID$k),Animator:e(AnimatorSchema,COMPONENT_ID$j),AudioSource:e(AudioSourceSchema,COMPONENT_ID$i),AvatarAttach:e(AvatarAttachSchema,COMPONENT_ID$h),AvatarShape:e(AvatarShapeSchema,COMPONENT_ID$g),Billboard:e(BillboardSchema,COMPONENT_ID$f),BoxShape:e(BoxShapeSchema,COMPONENT_ID$e),CameraMode:e(CameraModeSchema,COMPONENT_ID$d),CameraModeArea:e(CameraModeAreaSchema,COMPONENT_ID$c),CylinderShape:e(CylinderShapeSchema,COMPONENT_ID$b),GLTFShape:e(GLTFShapeSchema,COMPONENT_ID$a),Material:e(MaterialSchema,COMPONENT_ID$9),NFTShape:e(NFTShapeSchema,COMPONENT_ID$8),OnPointerDown:e(OnPointerDownSchema,COMPONENT_ID$7),OnPointerDownResult:e(OnPointerDownResultSchema,COMPONENT_ID$6),OnPointerUp:e(OnPointerUpSchema,COMPONENT_ID$5),OnPointerUpResult:e(OnPointerUpResultSchema,COMPONENT_ID$4),PlaneShape:e(PlaneShapeSchema,COMPONENT_ID$3),PointerLock:e(PointerLockSchema,COMPONENT_ID$2),SphereShape:e(SphereShapeSchema,COMPONENT_ID$1),TextShape:e(TextShapeSchema,COMPONENT_ID)}}function IArray(e){return{serialize(t,n){n.writeUint32(t.length);for(const r of t)e.serialize(r,n)},deserialize(t){const n=[],r=t.readUint32();for(let i=0;i<r;i++)n.push(e.deserialize(t));return n},create:()=>[]}}const Bool={serialize(e,t){t.writeInt8(e?1:0)},deserialize:e=>1===e.readInt8(),create:()=>!1};function IEnum(e){return{serialize(t,n){e.serialize(t,n)},deserialize:t=>e.deserialize(t),create:()=>e.create()}}const Float32={serialize(e,t){t.writeFloat32(e)},deserialize:e=>e.readFloat32(),create:()=>0},Float64={serialize(e,t){t.writeFloat64(e)},deserialize:e=>e.readFloat64(),create:()=>0},Int64={serialize(e,t){t.writeInt64(BigInt(e))},deserialize:e=>Number(e.readInt64()),create:()=>0},Int32={serialize(e,t){t.writeInt32(e)},deserialize:e=>e.readInt32(),create:()=>0},Int16={serialize(e,t){t.writeInt16(e)},deserialize:e=>e.readInt16(),create:()=>0},Int8={serialize(e,t){t.writeInt8(e)},deserialize:e=>e.readInt8(),create:()=>0},FlatString={serialize(e,t){t.writeBuffer((new TextEncoder).encode(e))},deserialize:e=>(new TextDecoder).decode(e.readBuffer()),create:()=>""},EcsString=FlatString;function IMap(e){return{serialize(t,n){for(const r in e)e[r].serialize(t[r],n)},deserialize(t){const n={};for(const r in e)n[r]=e[r].deserialize(t);return n},create(){const t={};for(const n in e)t[n]=e[n].create();return t}}}function IOptional(e){return{serialize(t,n){t?(n.writeInt8(1),e.serialize(t,n)):n.writeInt8(0)},deserialize(t){if(t.readInt8())return e.deserialize(t)},create(){}}}var Schemas,ECSComponentIDs;function preEngine(){const e=EntityContainer(),t=new Map,n=new Map,r=SystemContainer();function i(t=!1){return e.generateEntity(t)}function o(e,n){if(t.get(n))throw new Error(`Component ${n} already declared`);const r=defineComponent(n,e);return t.set(n,r),r}return{entitiesComponent:n,componentsDefinition:t,addEntity:i,addDynamicEntity:function(){return i(!0)},removeEntity:function(n){for(const[,e]of t)e.has(n)&&e.deleteFrom(n);return e.removeEntity(n)},addSystem:function(e,t=SYSTEMS_REGULAR_PRIORITY,n){r.add(e,t,n)},getSystems:function(){return r.getSystems()},removeSystem:function(e){return r.remove(e)},defineComponent:function(e,t){return o(exports.Schemas.Map(e),t)},defineComponentFromSchema:o,getEntitiesWith:function*(...e){for(const[t,...n]of function*(...e){const[t,...n]=e;for(const[r]of t.iterator()){let t=!0;for(const e of n)if(!e.has(r)){t=!1;break}t&&(yield[r,...e])}}(...e))yield[t,...n.map((e=>e.get(t)))]},getComponent:function(e){const n=t.get(e);if(!n)throw new Error("Component not found. You need to declare the components at the beginnig of the engine declaration");return n}}}function Engine({transports:e}={}){const t=preEngine(),n=crdtSceneSystem({engine:t,transports:e||[]}),r=defineLibraryComponents(t);return{addEntity:t.addEntity,addDynamicEntity:t.addDynamicEntity,removeEntity:t.removeEntity,addSystem:t.addSystem,removeSystem:t.removeSystem,defineComponent:t.defineComponent,defineComponentFromSchema:t.defineComponentFromSchema,getEntitiesWith:t.getEntitiesWith,getComponent:t.getComponent,update:function(e){n.receiveMessages();for(const n of t.getSystems())n.fn(e);const i=[r.OnPointerDownResult,r.OnPointerUpResult],o=i.map((e=>e._id));for(const e of i)for(const[n]of t.getEntitiesWith(e))e.deleteFrom(n);const a=new Map;for(const[e,n]of t.componentsDefinition)if(!o.includes(e))for(const t of n.dirtyIterator())a.has(t)||a.set(t,new Set),a.get(t).add(e);n.createMessages(a);for(const[e,n]of t.componentsDefinition)n.clearDirty()},baseComponents:r}}exports.Schemas=void 0,Schemas=exports.Schemas||(exports.Schemas={}),Schemas.Boolean=Bool,Schemas.String=EcsString,Schemas.Float=Float32,Schemas.Double=Float64,Schemas.Byte=Int8,Schemas.Short=Int16,Schemas.Int=Int32,Schemas.Int64=Int64,Schemas.Number=Float32,Schemas.Enum=IEnum,Schemas.Array=IArray,Schemas.Map=IMap,Schemas.Optional=IOptional,function(e){e[e.Transform=1]="Transform",e[e.Animator=1042]="Animator",e[e.AudioSource=1020]="AudioSource",e[e.AvatarAttach=1073]="AvatarAttach",e[e.AvatarShape=1080]="AvatarShape",e[e.Billboard=1090]="Billboard",e[e.BoxShape=1013]="BoxShape",e[e.CameraMode=1072]="CameraMode",e[e.CameraModeArea=1071]="CameraModeArea",e[e.CylinderShape=1016]="CylinderShape",e[e.GLTFShape=1041]="GLTFShape",e[e.Material=1017]="Material",e[e.NFTShape=1040]="NFTShape",e[e.OnPointerDown=1060]="OnPointerDown",e[e.OnPointerDownResult=1066]="OnPointerDownResult",e[e.OnPointerUp=1061]="OnPointerUp",e[e.OnPointerUpResult=1065]="OnPointerUpResult",e[e.PlaneShape=1014]="PlaneShape",e[e.PointerLock=1074]="PointerLock",e[e.SphereShape=1015]="SphereShape",e[e.TextShape=1030]="TextShape"}(ECSComponentIDs||(ECSComponentIDs={}));const componentIds=Object.values(ECSComponentIDs).filter((e=>"number"==typeof e)).map(Number);function createRendererTransport(){const e="renderer";return{type:e,send(e){dcl.callRpc("@decentraland/ExperimentalAPI","sendToRenderer",[{data:new Uint8Array(e)}]).catch(dcl.error)},filter:t=>t.transportType!==e&&(!!componentIds.includes(t.componentId)&&!!t)}}function createNetworkTransport(){const e="network-transport";return{send:function(...e){},type:e,filter:t=>t.transportType!==e&&!!t}}const rendererTransport=createRendererTransport(),engine=Engine({transports:[rendererTransport,createNetworkTransport()]});if(dcl){async function pullRendererMessages(){var e;const t=await dcl.callRpc("@decentraland/ExperimentalAPI","messageFromRenderer",[]);if((null===(e=t.data)||void 0===e?void 0:e.length)&&rendererTransport.onmessage)for(const e of t.data)rendererTransport.onmessage(e)}dcl.loadModule("@decentraland/ExperimentalAPI",{}).catch(dcl.error),dcl.onUpdate((e=>{pullRendererMessages().catch(dcl.error).finally((()=>engine.update(e)))}))}const log=dcl.log,error=dcl.error,Transform=engine.baseComponents.Transform,Animator=engine.baseComponents.Animator,AudioSource=engine.baseComponents.AudioSource,AvatarAttach=engine.baseComponents.AvatarAttach,AvatarShape=engine.baseComponents.AvatarShape,Billboard=engine.baseComponents.Billboard,BoxShape=engine.baseComponents.BoxShape,CameraMode=engine.baseComponents.CameraMode,CameraModeArea=engine.baseComponents.CameraModeArea,CylinderShape=engine.baseComponents.CylinderShape,GLTFShape=engine.baseComponents.GLTFShape,Material=engine.baseComponents.Material,NFTShape=engine.baseComponents.NFTShape,OnPointerDown=engine.baseComponents.OnPointerDown,OnPointerDownResult=engine.baseComponents.OnPointerDownResult,OnPointerUp=engine.baseComponents.OnPointerUp,OnPointerUpResult=engine.baseComponents.OnPointerUpResult,PlaneShape=engine.baseComponents.PlaneShape,PointerLock=engine.baseComponents.PointerLock,SphereShape=engine.baseComponents.SphereShape,TextShape=engine.baseComponents.TextShape;var Components;exports.Components=void 0,Components=exports.Components||(exports.Components={}),Components.Transform=engine.baseComponents.Transform,Components.Animator=engine.baseComponents.Animator,Components.AudioSource=engine.baseComponents.AudioSource,Components.AvatarAttach=engine.baseComponents.AvatarAttach,Components.AvatarShape=engine.baseComponents.AvatarShape,Components.Billboard=engine.baseComponents.Billboard,Components.BoxShape=engine.baseComponents.BoxShape,Components.CameraMode=engine.baseComponents.CameraMode,Components.CameraModeArea=engine.baseComponents.CameraModeArea,Components.CylinderShape=engine.baseComponents.CylinderShape,Components.GLTFShape=engine.baseComponents.GLTFShape,Components.Material=engine.baseComponents.Material,Components.NFTShape=engine.baseComponents.NFTShape,Components.OnPointerDown=engine.baseComponents.OnPointerDown,Components.OnPointerDownResult=engine.baseComponents.OnPointerDownResult,Components.OnPointerUp=engine.baseComponents.OnPointerUp,Components.OnPointerUpResult=engine.baseComponents.OnPointerUpResult,Components.PlaneShape=engine.baseComponents.PlaneShape,Components.PointerLock=engine.baseComponents.PointerLock,Components.SphereShape=engine.baseComponents.SphereShape,Components.TextShape=engine.baseComponents.TextShape,exports.Animator=Animator,exports.AudioSource=AudioSource,exports.AvatarAttach=AvatarAttach,exports.AvatarShape=AvatarShape,exports.Billboard=Billboard,exports.BoxShape=BoxShape,exports.CameraMode=CameraMode,exports.CameraModeArea=CameraModeArea,exports.CylinderShape=CylinderShape,exports.DEG2RAD=distExports$1.DEG2RAD,exports.Engine=Engine,exports.Epsilon=distExports$1.Epsilon,exports.GLTFShape=GLTFShape,exports.Material=Material,exports.NFTShape=NFTShape,exports.OnPointerDown=OnPointerDown,exports.OnPointerDownResult=OnPointerDownResult,exports.OnPointerUp=OnPointerUp,exports.OnPointerUpResult=OnPointerUpResult,exports.Orientation=distExports$1.Orientation,exports.PlaneShape=PlaneShape,exports.PointerLock=PointerLock,exports.Quaternion=distExports$1.Quaternion,exports.RAD2DEG=distExports$1.RAD2DEG,exports.Space=distExports$1.Space,exports.SphereShape=SphereShape,exports.TextShape=TextShape,exports.ToGammaSpace=distExports$1.ToGammaSpace,exports.ToLinearSpace=distExports$1.ToLinearSpace,exports.Transform=Transform,exports.Vector3=distExports$1.Vector3,exports.engine=engine,exports.error=error,exports.log=log,Object.defineProperty(exports,"__esModule",{value:!0})})(this.self=this.self||{});