@needle-tools/engine 4.12.0-next.0b39d59 → 4.12.0-next.c6c0281

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{Vector2 as ee,Vector3 as b,Vector4 as pe,Quaternion as U,PlaneGeometry as Un,WebGLRenderer as cr,PerspectiveCamera as re,OrthographicCamera as fd,Scene as vi,Mesh as G,Texture as Le,Uniform$1 as Ni,Color as ne,ShaderMaterial as zn,Box3 as wi,ShadowMaterial as K0,Euler as ot,MeshStandardMaterial as pt,Box3Helper as SS,GridHelper as um,Object3D as k,Material as ve,Matrix3 as J0,Matrix4 as K,Layers as ds,Ray as vo,MathUtils as wo,AxesHelper as xi,MeshBasicMaterial as xe,DoubleSide as Si,BufferGeometry as gn,Group as xo,CylinderGeometry as eb,SphereGeometry as yd,BoxGeometry as Pa,SpriteMaterial as CS,Sprite as PS,Shape as OS,ExtrudeGeometry as kS,Fog as tb,DirectionalLight as pm,PointLight as mm,EdgesGeometry as MS,LineSegments as ib,LineBasicMaterial as gm,Line as Oa,BufferAttribute as mt,Raycaster as bd,Sphere as _d,ArrayCamera as RS,Plane as hr,SkinnedMesh as us,InterleavedBufferAttribute as nb,Skeleton as TS,Bone as ES,WebGLCubeRenderTarget as AS,CubeCamera as IS,AnimationClip as Ci,FileLoader as fm,TextureLoader as Kl,PropertyBinding as ka,KeyframeTrack as LS,LinearSRGBColorSpace as So,ShaderChunk as qt,UniformsLib as jS,DataTexture as ym,RGBAFormat as vd,EquirectangularReflectionMapping as Nn,SRGBColorSpace as Co,Clock as DS,NeutralToneMapping as Ma,AgXToneMapping as wd,ACESFilmicToneMapping as xd,NoToneMapping as Sd,PCFSoftShadowMap$1 as BS,BasicNodeLibrary as FS,WebGLRenderTarget as Vn,DepthTexture as ob,NearestFilter as Cd,LoopRepeat as US,LoopOnce as bm,AnimationMixer as _m,CompressedTexture as zS,FrontSide as ps,Camera as NS,Frustum as sb,AudioListener as VS,PositionalAudio as WS,AudioLoader as vm,EventDispatcher as wm,BackSide as Pd,MeshDepthMaterial as $S,CustomBlending as HS,MaxEquation as GS,AlwaysStencilFunc as qS,GreaterEqualStencilFunc as XS,NotEqualStencilFunc as QS,GreaterStencilFunc as YS,LessEqualStencilFunc as ZS,EqualStencilFunc as KS,LessStencilFunc as JS,NeverStencilFunc as rb,InvertStencilOp as eC,DecrementWrapStencilOp as tC,IncrementWrapStencilOp as iC,DecrementStencilOp as nC,IncrementStencilOp as oC,ReplaceStencilOp as sC,ZeroStencilOp as rC,KeepStencilOp as aC,CubeTexture as ab,AmbientLight as lC,HemisphereLight as cC,RawShaderMaterial as lb,GLSL3 as hC,AlwaysDepth as dC,GreaterEqualDepth as uC,GreaterDepth as pC,LessEqualDepth as mC,LessDepth as gC,NotEqualDepth as fC,EqualDepth as yC,BatchedMesh as cb,MeshPhysicalMaterial as xm,LinearFilter as Od,UnsignedByteType as bC,RingGeometry as _C,Line3 as vC,AdditiveBlending as hb,BoxHelper as wC,SpotLight as xC,DirectionalLightHelper as SC,CameraHelper as CC,LOD as PC,Triangle as OC,NormalBlending as kC,ReinhardToneMapping as Sm,LinearToneMapping as Cm,HalfFloatType as Pm,VideoTexture as MC,CubeUVReflectionMapping as db,CompressedCubeTexture as RC,EquirectangularRefractionMapping as TC,CatmullRomCurve3 as EC,VectorKeyframeTrack as AC,QuaternionKeyframeTrack as IC,Audio as LC,ShaderLib as kd,UniformsUtils as ub,MirroredRepeatWrapping as pb,MeshNormalMaterial as jC,AudioContext as DC,PMREMGenerator$1 as BC}from"./three-W7zWTcfP.min.js";import{createLoaders as Om,getRaycastMesh as mb,LODsManager as dr,NEEDLE_progressive as Ve,addDracoAndKTX2Loaders as FC,configureLoader as UC,setKTX2TranscoderLocation as zC,setDracoDecoderLocation as NC}from"./gltf-progressive-BmSygnAC.min.js";import{GroundedSkybox as Ra,Font as VC,TextGeometry as WC,FontLoader as $C,GLTFLoader as Po,TransformControlsGizmo as gb,EXRLoader as km,RGBELoader as fb,Stats as HC,nodeFrame as yb,OrbitControls as bb,PositionalAudioHelper as GC,HorizontalBlurShader as qC,VerticalBlurShader as XC,GLTFExporter as _b,strToU8 as vb,zipSync as QC,XRControllerModelFactory as YC,XRHandMeshModel as ZC,Line2 as KC,LineGeometry as JC,LineMaterial as eP,TransformControls as tP,InteractiveGroup as iP,HTMLMesh as nP,VertexNormalsHelper as oP,OBJLoader as Mm,FBXLoader as wb,mergeVertices as sP}from"./three-examples-MsJjauyk.min.js";import{fetchProfile as rP,MotionController as aP,$70d766613f57b014$export$2e2bcd8739ae039 as xb,ByteBuffer as lP,v5 as Sb,md5 as Cb,SIZE_PREFIX_LENGTH as Pb,Builder as Rm,createNoise4D as cP,Matrix4 as Tm,BatchedParticleRenderer as hP,ParticleSystem as dP,RenderMode as Oo,ConstantColor as uP,Vector4 as pP,ConstantValue as mP,TrailParticle as Ob,WorkerBase as gP,MeshBVH as fP}from"./vendor-BiJQtqow.min.js";import{__webpack_exports__default as Ce,__webpack_exports__Text as kb,__webpack_exports__Block as Mb,__webpack_exports__update as yP,SimpleStateBehavior as bP,__webpack_exports__Inline as Em,__webpack_exports__FontLibrary as Rb,ThreeMeshUI as Tb}from"./three-mesh-ui-CIez6qJQ.min.js";import{EffectAttribute as _P}from"./postprocessing-BkY94MUG.min.js";const Am=new Map;function Vi(o=globalThis.location?.hostname){if(Am.has(o))return Am.get(o);const e=/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|localhost/.test(o);return Am.set(o,e),e===!0}function Eb(){return window.location.hostname.includes("glitch.me")}const Ab=typeof window!==void 0?window.location.search.includes("debugcontext"):!1;var de=(o=>(o.ContextRegistered="ContextRegistered",o.ContextCreationStart="ContextCreationStart",o.ContextCreated="ContextCreated",o.ContextFirstFrameRendered="ContextFirstFrameRendered",o.ContextDestroying="ContextDestroying",o.ContextDestroyed="ContextDestroyed",o.MissingCamera="MissingCamera",o.ContextClearing="ContextClearing",o.ContextCleared="ContextCleared",o))(de||{});class ue{static get Current(){return globalThis["NeedleEngine.Context.Current"]}static set Current(e){globalThis["NeedleEngine.Context.Current"]=e}static get All(){return this.Registered}static Registered=[];static register(e){this.Registered.indexOf(e)===-1&&(Ab&&console.warn("Registering context"),this.Registered.push(e),this.dispatchCallback("ContextRegistered",e))}static unregister(e){const t=this.Registered.indexOf(e);t!==-1&&(Ab&&console.warn("Unregistering context"),this.Registered.splice(t,1))}static _callbacks={};static registerCallback(e,t){this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t)}static unregisterCallback(e,t){if(!this._callbacks[e])return;const i=this._callbacks[e].indexOf(t);i!==-1&&this._callbacks[e].splice(i,1)}static dispatchCallback(e,t,i){if(!this._callbacks[e])return!0;const n={event:e,context:t};if(i)for(const r in i)n[r]=i[r];const s=new Array;return this._callbacks[e].forEach(r=>{const a=r(n);a instanceof Promise&&s.push(a)}),Promise.all(s)}static addContextCreatedCallback(e){this.registerCallback("ContextCreated",e)}static addContextDestroyedCallback(e){this.registerCallback("ContextDestroyed",e)}}const Ib=()=>o=>o;function vP(o){return Ib()(o)}function wP(){return!!v("debug")}class Pi{_factory;_cache=[];_maxSize;_index=0;constructor(e,t){this._factory=e,this._maxSize=t}get(){const e=this._index%this._maxSize;return this._index++,this._cache.length<=e&&(this._cache[e]=this._factory()),this._cache[e]}}let ur=!1;const Im=new Array;typeof window<"u"&&setTimeout(()=>{if(ur){const o={},e=new URL(window.location.href),t=new URL(e);t.searchParams.append("console","");const i=t.toString().replace(/=$|=(?=&)/g,"");for(const s of Im){const r=new URL(e);r.searchParams.append(s,""),o[s]=r.toString().replace(/=$|=(?=&)/g,"")}console.log(`\u{1F335} ?help: Debug Options for Needle Engine.
1
+ import{Vector2 as ee,Vector3 as b,Vector4 as pe,Quaternion as U,PlaneGeometry as Un,WebGLRenderer as cr,PerspectiveCamera as re,OrthographicCamera as fd,Scene as vi,Mesh as G,Texture as Le,Uniform$1 as Ni,Color as ne,ShaderMaterial as zn,Box3 as wi,ShadowMaterial as K0,Euler as ot,MeshStandardMaterial as pt,Box3Helper as SS,GridHelper as um,Object3D as k,Material as ve,Matrix3 as J0,Matrix4 as K,Layers as ds,Ray as vo,MathUtils as wo,AxesHelper as xi,MeshBasicMaterial as xe,DoubleSide as Si,BufferGeometry as gn,Group as xo,CylinderGeometry as eb,SphereGeometry as yd,BoxGeometry as Pa,SpriteMaterial as CS,Sprite as PS,Shape as OS,ExtrudeGeometry as kS,Fog as tb,DirectionalLight as pm,PointLight as mm,EdgesGeometry as MS,LineSegments as ib,LineBasicMaterial as gm,Line as Oa,BufferAttribute as mt,Raycaster as bd,Sphere as _d,ArrayCamera as RS,Plane as hr,SkinnedMesh as us,InterleavedBufferAttribute as nb,Skeleton as TS,Bone as ES,WebGLCubeRenderTarget as AS,CubeCamera as IS,AnimationClip as Ci,FileLoader as fm,TextureLoader as Kl,PropertyBinding as ka,KeyframeTrack as LS,LinearSRGBColorSpace as So,ShaderChunk as qt,UniformsLib as jS,DataTexture as ym,RGBAFormat as vd,EquirectangularReflectionMapping as Nn,SRGBColorSpace as Co,Clock as DS,NeutralToneMapping as Ma,AgXToneMapping as wd,ACESFilmicToneMapping as xd,NoToneMapping as Sd,PCFSoftShadowMap$1 as BS,BasicNodeLibrary as FS,WebGLRenderTarget as Vn,DepthTexture as ob,NearestFilter as Cd,LoopRepeat as US,LoopOnce as bm,AnimationMixer as _m,CompressedTexture as zS,FrontSide as ps,Camera as NS,Frustum as sb,AudioListener as VS,PositionalAudio as WS,AudioLoader as vm,EventDispatcher as wm,BackSide as Pd,MeshDepthMaterial as $S,CustomBlending as HS,MaxEquation as GS,AlwaysStencilFunc as qS,GreaterEqualStencilFunc as XS,NotEqualStencilFunc as QS,GreaterStencilFunc as YS,LessEqualStencilFunc as ZS,EqualStencilFunc as KS,LessStencilFunc as JS,NeverStencilFunc as rb,InvertStencilOp as eC,DecrementWrapStencilOp as tC,IncrementWrapStencilOp as iC,DecrementStencilOp as nC,IncrementStencilOp as oC,ReplaceStencilOp as sC,ZeroStencilOp as rC,KeepStencilOp as aC,CubeTexture as ab,AmbientLight as lC,HemisphereLight as cC,RawShaderMaterial as lb,GLSL3 as hC,AlwaysDepth as dC,GreaterEqualDepth as uC,GreaterDepth as pC,LessEqualDepth as mC,LessDepth as gC,NotEqualDepth as fC,EqualDepth as yC,BatchedMesh as cb,MeshPhysicalMaterial as xm,LinearFilter as Od,UnsignedByteType as bC,RingGeometry as _C,Line3 as vC,AdditiveBlending as hb,BoxHelper as wC,SpotLight as xC,DirectionalLightHelper as SC,CameraHelper as CC,LOD as PC,Triangle as OC,NormalBlending as kC,ReinhardToneMapping as Sm,LinearToneMapping as Cm,HalfFloatType as Pm,VideoTexture as MC,CubeUVReflectionMapping as db,CompressedCubeTexture as RC,EquirectangularRefractionMapping as TC,CatmullRomCurve3 as EC,VectorKeyframeTrack as AC,QuaternionKeyframeTrack as IC,Audio as LC,ShaderLib as kd,UniformsUtils as ub,MirroredRepeatWrapping as pb,MeshNormalMaterial as jC,AudioContext as DC,PMREMGenerator$1 as BC}from"./three-W7zWTcfP.min.js";import{createLoaders as Om,getRaycastMesh as mb,LODsManager as dr,NEEDLE_progressive as Ve,addDracoAndKTX2Loaders as FC,configureLoader as UC,setKTX2TranscoderLocation as zC,setDracoDecoderLocation as NC}from"./gltf-progressive-BmSygnAC.min.js";import{GroundedSkybox as Ra,Font as VC,TextGeometry as WC,FontLoader as $C,GLTFLoader as Po,TransformControlsGizmo as gb,EXRLoader as km,RGBELoader as fb,Stats as HC,nodeFrame as yb,OrbitControls as bb,PositionalAudioHelper as GC,HorizontalBlurShader as qC,VerticalBlurShader as XC,GLTFExporter as _b,strToU8 as vb,zipSync as QC,XRControllerModelFactory as YC,XRHandMeshModel as ZC,Line2 as KC,LineGeometry as JC,LineMaterial as eP,TransformControls as tP,InteractiveGroup as iP,HTMLMesh as nP,VertexNormalsHelper as oP,OBJLoader as Mm,FBXLoader as wb,mergeVertices as sP}from"./three-examples-MsJjauyk.min.js";import{fetchProfile as rP,MotionController as aP,$70d766613f57b014$export$2e2bcd8739ae039 as xb,ByteBuffer as lP,v5 as Sb,md5 as Cb,SIZE_PREFIX_LENGTH as Pb,Builder as Rm,createNoise4D as cP,Matrix4 as Tm,BatchedParticleRenderer as hP,ParticleSystem as dP,RenderMode as Oo,ConstantColor as uP,Vector4 as pP,ConstantValue as mP,TrailParticle as Ob,WorkerBase as gP,MeshBVH as fP}from"./vendor-BiJQtqow.min.js";import{__webpack_exports__default as Ce,__webpack_exports__Text as kb,__webpack_exports__Block as Mb,__webpack_exports__update as yP,SimpleStateBehavior as bP,__webpack_exports__Inline as Em,__webpack_exports__FontLibrary as Rb,ThreeMeshUI as Tb}from"./three-mesh-ui-CIez6qJQ.min.js";import{EffectAttribute as _P}from"./postprocessing-B5ksn9-G.min.js";const Am=new Map;function Vi(o=globalThis.location?.hostname){if(Am.has(o))return Am.get(o);const e=/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|localhost/.test(o);return Am.set(o,e),e===!0}function Eb(){return window.location.hostname.includes("glitch.me")}const Ab=typeof window!==void 0?window.location.search.includes("debugcontext"):!1;var de=(o=>(o.ContextRegistered="ContextRegistered",o.ContextCreationStart="ContextCreationStart",o.ContextCreated="ContextCreated",o.ContextFirstFrameRendered="ContextFirstFrameRendered",o.ContextDestroying="ContextDestroying",o.ContextDestroyed="ContextDestroyed",o.MissingCamera="MissingCamera",o.ContextClearing="ContextClearing",o.ContextCleared="ContextCleared",o))(de||{});class ue{static get Current(){return globalThis["NeedleEngine.Context.Current"]}static set Current(e){globalThis["NeedleEngine.Context.Current"]=e}static get All(){return this.Registered}static Registered=[];static register(e){this.Registered.indexOf(e)===-1&&(Ab&&console.warn("Registering context"),this.Registered.push(e),this.dispatchCallback("ContextRegistered",e))}static unregister(e){const t=this.Registered.indexOf(e);t!==-1&&(Ab&&console.warn("Unregistering context"),this.Registered.splice(t,1))}static _callbacks={};static registerCallback(e,t){this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t)}static unregisterCallback(e,t){if(!this._callbacks[e])return;const i=this._callbacks[e].indexOf(t);i!==-1&&this._callbacks[e].splice(i,1)}static dispatchCallback(e,t,i){if(!this._callbacks[e])return!0;const n={event:e,context:t};if(i)for(const r in i)n[r]=i[r];const s=new Array;return this._callbacks[e].forEach(r=>{const a=r(n);a instanceof Promise&&s.push(a)}),Promise.all(s)}static addContextCreatedCallback(e){this.registerCallback("ContextCreated",e)}static addContextDestroyedCallback(e){this.registerCallback("ContextDestroyed",e)}}const Ib=()=>o=>o;function vP(o){return Ib()(o)}function wP(){return!!v("debug")}class Pi{_factory;_cache=[];_maxSize;_index=0;constructor(e,t){this._factory=e,this._maxSize=t}get(){const e=this._index%this._maxSize;return this._index++,this._cache.length<=e&&(this._cache[e]=this._factory()),this._cache[e]}}let ur=!1;const Im=new Array;typeof window<"u"&&setTimeout(()=>{if(ur){const o={},e=new URL(window.location.href),t=new URL(e);t.searchParams.append("console","");const i=t.toString().replace(/=$|=(?=&)/g,"");for(const s of Im){const r=new URL(e);r.searchParams.append(s,""),o[s]=r.toString().replace(/=$|=(?=&)/g,"")}console.log(`\u{1F335} ?help: Debug Options for Needle Engine.
2
2
  Append any of these parameters to the URL to enable specific debug options.
3
3
  Example: ${i} will show an onscreen console window.`);const n=ur===!0?"":` (containing "${ur}")`;console.group("Available URL parameters:"+n);for(const s of Object.keys(o).sort())typeof ur=="string"&&!s.toLowerCase().includes(ur.toLowerCase())||(console.groupCollapsed(s),console.log("Reload with this flag enabled:"),console.log(o[s]),console.groupEnd());console.groupEnd()}},100);function Jl(){return new URLSearchParams(globalThis.location?.search)}function v(o){ur&&!Im.includes(o)&&Im.push(o);const e=Jl();if(e.has(o)){const t=e.get(o);if(t){const i=Number(t);return isNaN(i)?t:i}else return!0}return!1}ur=v("help");function xP(o,e){const t=Jl();t.has(o)?t.set(o,e):t.append(o,e),document.location.search=t.toString()}function ec(o,e,t=!0){const i=Jl();i.has(o)?e===null?i.delete(o):i.set(o,e):e!==null&&i.append(o,e),t?Lb(o,i):jm(o,i)}function Lm(o,e,t){o.has(e)?o.set(e,t.toString()):o.append(e,t.toString())}function Lb(o,e,t){window.history.pushState(t,o,"?"+e.toString())}function jm(o,e,t){window.history.replaceState(t,o,"?"+e.toString())}function SP(o){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=t.length,n=0;n<o;n++)e+=t.charAt(Math.floor(Math.random()*i));return e}function CP(o,e){return Math.floor(Math.random()*(e-o+1))+o}const jb=["smol","tiny","giant","interesting","smart","bright","dull","extreme","beautiful","pretty","dark","epic","salty","silly","funny","lame","lazy","loud","lucky","mad","mean","mighty","mysterious","nasty","odd","old","powerful","quiet","rapid","scary","shiny","shy","silly","smooth","sour","spicy","stupid","sweet","tasty","terrible","ugly","unusual","vast","wet","wild","witty","wrong","zany","zealous","zippy","zombie","zorro"],Db=["cat","dog","mouse","pig","cow","horse","sheep","chicken","duck","goat","panda","tiger","lion","elephant","monkey","bird","fish","snake","frog","turtle","hamster","penguin","kangaroo","whale","dolphin","crocodile","snail","ant","bee","beetle","butterfly","dragon","eagle","fish","giraffe","lizard","panda","penguin","rabbit","snake","spider","tiger","zebra"];function Bb(){const o=jb[Math.floor(Math.random()*jb.length)],e=Db[Math.floor(Math.random()*Db.length)];return o+"_"+e}function Fb(o){return o=o.replace(/[^a-z0-9áéíóúñü \.,_-]/gim,""),o.trim()}function Ta(o,e,t=!0,i=!1){if(e==null)return null;if(e.userData&&e.userData.guid===o||e.guid==o)return e;if(i&&e.userData?.components){for(const n of e.userData.components)if(n.guid===o)return n}if(t){if(e.scenes)for(const n in e.scenes){const s=e.scenes[n],r=Ta(o,s,t,i);if(r)return r}if(e.children)for(const n in e.children){const s=e.children[n],r=Ta(o,s,t,i);if(r)return r}}}function tc(o,e){if(o!=null&&typeof o=="object"){let t;Array.isArray(o)?t=[]:(t=Object.create(o),Object.assign(t,o));for(const i of Object.keys(o)){const n=o[i];e&&!e(o,i,n)?t[i]=n:n?.clone!==void 0&&typeof n.clone=="function"?t[i]=n.clone():t[i]=tc(n,e)}return t}return o}function Wn(o){return new Promise((e,t)=>{setTimeout(e,o)})}function ic(o,e){if(o<=0)return Promise.resolve();if(e||(e=ue.Current),!e)return Promise.reject("No context");const t=e.time.frameCount+o;return new Promise((i,n)=>{if(!e)return n("No context");const s=()=>{e.time.frameCount>=t&&(e.pre_update_callbacks.splice(e.pre_update_callbacks.indexOf(s),1),i())};e.pre_update_callbacks.push(s)})}const Md=v("debugresolveurl"),Ub="rel:";function PP(o,e){return ms(o,e)}function ms(o,e){if(e===void 0)return Md&&console.warn("getPath: uri is undefined, returning uri",e),e;if(e.startsWith("./"))return e;if(e.startsWith("http"))return Md&&console.warn("getPath: uri is absolute, returning uri",e),e;if(o===void 0)return Md&&console.warn("getPath: source is undefined, returning uri",e),e;e.startsWith(Ub)&&(e=e.substring(4));const t=o.lastIndexOf("/");if(t>=0){const i=o.substring(0,t+1);for(;i.endsWith("/")&&e.startsWith("/");)e=e.substring(1);const n=i+e;return Md&&console.log("source:",o,`changed uri
4
4
  from`,e,`
@@ -141,7 +141,7 @@ void main(){
141
141
  #__vconsole .vc-mask {
142
142
  overflow: hidden;
143
143
  }
144
- `,br?.prepend(i),o===!0&&Nb()<=0&&p_(),console.log("\u{1F335} Debug console has loaded")}},e.onerror=()=>{console.warn("\u{1F335} Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),cc=!1,Wi=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function TO(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const s=n.indexOf("?");s>-1&&(n=n.substring(0,s));const r=location.protocol+"//"+location.host+location.pathname+"/"+n,a=encodeURIComponent(r);o.fullUrl="https://viewer.needle.tools?inspect&file="+a;var l='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(l)}),o.on("show",function(){const t=e();t&&t.src!==o.fullUrl&&(t.src=o.fullUrl)}),o.on("hide",function(){const t=e();t&&(t.src="")}),o.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window \u2197",onClick:function(n){window.open(o.fullUrl,"_blank"),Wi?.hide()}}),i.push({name:"Reload",onClick:function(n){const s=e();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=e();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),t(i)}),o}function EO(){return document.querySelector("#__vconsole .vc-switch")||null}function AO(){return document.querySelector("#__vconsole")||null}const g_=v("debugdefines");fs('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),fs('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),fs('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),fs('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),fs('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.12.0-beta.1";'),fs('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),fs('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Fri Dec 19 2025 11:43:32 GMT+0000 (Coordinated Universal Time)";'),fs('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const bn="4.12.0-beta.1",Fd="undefined",sg="Fri Dec 19 2025 11:43:32 GMT+0000 (Coordinated Universal Time)";g_&&console.log(`Engine version: ${bn} (generator: ${Fd})
144
+ `,br?.prepend(i),o===!0&&Nb()<=0&&p_(),console.log("\u{1F335} Debug console has loaded")}},e.onerror=()=>{console.warn("\u{1F335} Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),cc=!1,Wi=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.15.1/dist/vconsole.min.js",document.body.appendChild(e)}function TO(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(t){const i=globalThis["needle:codegen_files"];if(!i||i.length===0)return;let n=globalThis["needle:codegen_files"][0];const s=n.indexOf("?");s>-1&&(n=n.substring(0,s));const r=location.protocol+"//"+location.host+location.pathname+"/"+n,a=encodeURIComponent(r);o.fullUrl="https://viewer.needle.tools?inspect&file="+a;var l='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(l)}),o.on("show",function(){const t=e();t&&t.src!==o.fullUrl&&(t.src=o.fullUrl)}),o.on("hide",function(){const t=e();t&&(t.src="")}),o.on("addTopBar",function(t){var i=new Array;i.push({name:"Open in new window \u2197",onClick:function(n){window.open(o.fullUrl,"_blank"),Wi?.hide()}}),i.push({name:"Reload",onClick:function(n){const s=e();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=e();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),t(i)}),o}function EO(){return document.querySelector("#__vconsole .vc-switch")||null}function AO(){return document.querySelector("#__vconsole")||null}const g_=v("debugdefines");fs('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),fs('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),fs('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),fs('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),fs('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.12.0-beta.1";'),fs('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),fs('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Wed Jan 07 2026 16:16:18 GMT+0000 (Coordinated Universal Time)";'),fs('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const bn="4.12.0-beta.1",Fd="undefined",sg="Wed Jan 07 2026 16:16:18 GMT+0000 (Coordinated Universal Time)";g_&&console.log(`Engine version: ${bn} (generator: ${Fd})
145
145
  Project built at ${sg}`);const Ia=NEEDLE_PUBLIC_KEY,ko="needle_isActiveInHierarchy",_r="builtin_components",hc="needle_editor_guid";function fs(o){try{(0,eval)(o)}catch(e){g_&&console.error(e)}}let f_,y_=null;function _n(){return f_}function rg(o){if(o==null){console.warn("Oh no: someone tried registering a non-existend gltf-loader. When you see this log it might mean that needle-engine is being imported multiple times. Please check your project setup.");return}y_!==o&&(y_=o,f_=new o)}function IO(o,e){if(typeof window!==void 0&&window.SPECTOR){console.log(window.SPECTOR);const t=new URLSearchParams(window.location.search);if(t.has("spector")){let i=function(){if(n>o.time.frame)return window.requestAnimationFrame(()=>i());const r=s.captureCanvas(e);r&&r instanceof Promise?r.then(()=>s.displayUI()):s.displayUI()};const n=Number.parseInt(t.get("spector")||"0")||0;console.log("Scheduled Spector capture at frame #"+n);const s=new window.SPECTOR.Spector;s.spyCanvases=!0,i();return}else A()&&console.debug("Spector available: Add '?spector=<frame>' to the URL to enable it and capture a frame.")}}const ki=Symbol("shadowDomOwner"),LO=v("debugpatch");function Ud(o,e,t,i){const n=LO===e;if(!t&&!i)return;const s=e+"___needle";DO(o,e,t,i);const r=Object.getOwnPropertyDescriptor(o,e),a=o[e];n&&console.log("Patch",o.constructor.name,e,r,a),r?(n&&console.log("Apply patch with existing descriptor",o.constructor.name,e,r),typeof r.value=="function"&&(o[e]=__(r.value,o,e))):(n&&console.log("Create patch with new property",o.constructor.name,e,r),Object.defineProperty(o,e,{set:function(l){if(typeof l=="function")this[s]=__(l,o,e);else{const c=this[s];v_(o,e,this,c,l),this[s]=l,w_(o,e,this,c,l)}},get:function(){const l=this[s];return typeof l=="function"&&l[s]?l[s]:l}}))}function jO(o,e,t){const i=lg(o,e);if(i)for(let n=i.length-1;n>=0;n--){const s=i[n];s.prefix===t&&(s.prefix=null),s.postfix===t&&(s.postfix=null),!s.prefix&&!s.postfix&&i.splice(n,1)}}const b_=Symbol("Needle:Patches:WrappedFunction");function __(o,e,t){if(o[b_])return o;const i=function(...n){v_(e,t,this,...n);const s=o.apply(this,n);return w_(e,t,this,s,...n),s};return i[b_]=!0,i}const zd="Needle:Patches";function ag(){return globalThis[zd]||(globalThis[zd]=new WeakMap),globalThis[zd]}function lg(o,e){const t=ag().get(o);return t?t.get(e):null}function DO(o,e,t,i){let n=ag().get(o);n||(n=new Map,ag().set(o,n));let s=n.get(e);s||(s=[],n.set(e,s)),s.push({prefix:t,postfix:i})}function v_(o,e,t,...i){if(!t)return;const n=lg(o,e);if(n)for(const s of n)s.prefix?.call(t,...i)}function w_(o,e,t,i,...n){if(!t)return;const s=lg(o,e);if(s)for(const r of s)r.postfix?.call(t,i,...n)}const La=[];function Nd(o){La.indexOf(o)===-1&&La.push(o)}function BO(o){const e=La.indexOf(o);e!==-1&&La.splice(e,1)}const ja=[];function cg(o){ja.indexOf(o)===-1&&ja.push(o)}function FO(o){const e=ja.indexOf(o);e!==-1&&ja.splice(e,1)}function x_(o){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-start",{detail:o}));for(let e=0;e<La.length;e++)La[e](o)}function S_(o){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-end",{detail:o}));for(let e=0;e<ja.length;e++)ja[e](o)}const st=v("debuginput");var Vd=(o=>(o.Mouse="mouse",o.Touch="touch",o.Controller="controller",o.Hand="hand",o))(Vd||{}),Ee=(o=>(o.PointerDown="pointerdown",o.PointerUp="pointerup",o.PointerMove="pointermove",o.KeyDown="keydown",o.KeyUp="keyup",o.KeyPressed="keypress",o))(Ee||{});class Mo extends PointerEvent{clientZ;deviceIndex;origin;source;mode;get isSpatial(){return this.mode!="screen"}get ray(){return this._ray||(this._ray=new vo(this.space.worldPosition.clone(),this.space.worldForward.clone())),this._ray}set ray(e){this._ray=e}get hasRay(){return this._ray!==void 0}_ray;space;isClick=!1;isDoubleClick=!1;get used(){return this._used}_used=!1;use(){this._used=!0}get pointerId(){return this._pointerid}_pointerid;get pointerType(){return this._pointerType}_pointerType;get type(){return this._type}_type;metadata={};intersections=new Array;constructor(e,t,i){super(e,i),this.clientZ=i.clientZ,this._pointerid=i.pointerId,this._pointerType=i.pointerType,this._type=e,this.deviceIndex=i.deviceIndex,this.origin=i.origin,this.source=t,this.mode=i.mode,this._ray=i.ray,this.space=i.device}_immediatePropagationStopped=!1;get immediatePropagationStopped(){return this._immediatePropagationStopped}_propagationStopped=!1;get propagationStopped(){return this._immediatePropagationStopped||this._propagationStopped}stopImmediatePropagation(){this._immediatePropagationStopped=!0,super.stopImmediatePropagation(),this.source?.stopImmediatePropagation()}stopPropagation(){this._propagationStopped=!0,super.stopPropagation(),this.source?.stopPropagation(),st&&console.warn("Stop propagation...",this.pointerId,this.pointerType)}}class dc extends KeyboardEvent{source;constructor(e,t,i){super(e,i),this.source=t}stopImmediatePropagation(){super.stopImmediatePropagation(),this.source?.stopImmediatePropagation()}}class UO{key;keyType;source;constructor(e){this.key=e.key,this.keyType=e.type,this.source=e}}var ai=(o=>(o[o.Early=-100]="Early",o[o.Default=0]="Default",o[o.Late=100]="Late",o))(ai||{});class C_{_eventListeners={};addEventListener(e,t,i){if(this._eventListeners[e]||(this._eventListeners[e]=[]),!t||typeof t!="function"){console.error("Invalid call to addEventListener: callback is required and must be a function!");return}i?i={...i}:i={};let n=0;i?.queue!=null&&(n=i.queue);const s=this._eventListeners[e],r=s.find(a=>a.priority===n);r?r.listeners.push({callback:t,options:i}):(s.push({priority:n,listeners:[{callback:t,options:i}]}),s.sort((a,l)=>a.priority-l.priority))}removeEventListener(e,t,i){if(!this._eventListeners[e]||!t)return;const n=this._eventListeners[e];if(i?.queue!=null){const s=n.find(a=>a.priority===i.queue);if(!s)return;const r=s.listeners.findIndex(a=>a.callback===t);r>=0&&s.listeners.splice(r,1)}else for(const s of n){const r=s.listeners.findIndex(a=>a.callback===t);r>=0&&s.listeners.splice(r,1)}}dispatchEvent(e){let t=!1;if(e instanceof dc){const i=this._eventListeners[e.type];if(i)for(const n of i)for(let s=0;s<n.listeners.length;s++){const r=n.listeners[s];if(r.options?.signal?.aborted){n.listeners.splice(s,1),s--;continue}r.options.once&&(n.listeners.splice(s,1),s--),r.callback(e)}}if(e instanceof Mo){const i=this._eventListeners[e.type];if(i)for(const n of i){if(t)break;for(let s=0;s<n.listeners.length;s++){const r=n.listeners[s];if(r.options?.signal?.aborted){n.listeners.splice(s,1),s--;continue}if(e.immediatePropagationStopped){t=!0,st&&console.log("immediatePropagationStopped",e.type);break}else e.propagationStopped&&(t=!0,st&&console.log("propagationStopped",e.type));r.options.once&&(n.listeners.splice(s,1),s--),r.callback(e)}}}}_doubleClickTimeThreshold=.2;_longPressTimeThreshold=1;get mousePosition(){return this._pointerPositions[0]}get mousePositionRC(){return this._pointerPositionsRC[0]}get mouseDown(){return this._pointerDown[0]}get mouseUp(){return this._pointerUp[0]}get mouseClick(){return this._pointerClick[0]}get mouseDoubleClick(){return this._pointerDoubleClick[0]}get mousePressed(){return this._pointerPressed[0]}get mouseWheelChanged(){return this.getMouseWheelChanged(0)}get click(){return this._pointerClick[0]}get doubleClick(){return this._pointerDoubleClick[0]}getGamepad(e=0){return typeof navigator<"u"&&"getGamepads"in navigator&&navigator.getGamepads()[e]||null}_setCursorTypes=[];setCursorPointer(){this.setCursor("pointer")}setCursorNormal(){this.unsetCursor("pointer")}setCursor(e){this._setCursorTypes.push(e),this._setCursorTypes.length>10&&this._setCursorTypes.shift(),this.updateCursor()}unsetCursor(e){for(let t=this._setCursorTypes.length-1;t>=0;t--)if(this._setCursorTypes[t]===e){this._setCursorTypes.splice(t,1),this.updateCursor();break}}updateCursor(){this._setCursorTypes?.length==0?this.context.domElement.style.cursor="default":this.context.domElement.style.cursor=this._setCursorTypes[this._setCursorTypes.length-1]}getIsPointerIdInUse(e){for(const t of this._pointerEventsPressed)if(t.pointerId===e&&t.used)return!0;return!1}getPointerPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&e++;return e}getPointerPosition(e){return e>=this._pointerPositions.length?null:this._pointerPositions[e]}getPointerPositionLastFrame(e){return e>=this._pointerPositionsLastFrame.length?null:this._pointerPositionsLastFrame[e]}getPointerPositionDelta(e){return e>=this._pointerPositionsDelta.length?null:this._pointerPositionsDelta[e]}getPointerPositionRC(e){return e>=this._pointerPositionsRC.length?null:this._pointerPositionsRC[e]}getPointerDown(e){return e>=this._pointerDown.length?!1:this._pointerDown[e]}getPointerUp(e){return e>=this._pointerUp.length?!1:this._pointerUp[e]}getPointerPressed(e){return e>=this._pointerPressed.length?!1:this._pointerPressed[e]}getPointerClicked(e){return e>=this._pointerClick.length?!1:this._pointerClick[e]}getPointerDoubleClicked(e){return e>=this._pointerDoubleClick.length?!1:this._pointerDoubleClick[e]}getPointerDownTime(e){return e>=this._pointerDownTime.length?-1:this._pointerDownTime[e]}getPointerUpTime(e){return e>=this._pointerUpTime.length?-1:this._pointerUpTime[e]}getPointerLongPress(e){return e>=this._pointerDownTime.length?!1:this.getPointerPressed(e)&&this.context.time.time-this._pointerDownTime[e]>this._longPressTimeThreshold}getIsMouse(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="mouse"}getIsTouch(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="touch"}getTouchesPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&this.getIsTouch(t)&&e++;return e}getMouseWheelChanged(e=0){return e>=this._mouseWheelChanged.length?!1:this._mouseWheelChanged[e]}getMouseWheelDeltaY(e=0){return e>=this._mouseWheelDeltaY.length?0:this._mouseWheelDeltaY[e]}getPointerEvent(e){if(!(e>=this._pointerEvent.length))return this._pointerEvent[e]??void 0}*foreachPointerId(e){for(let t=0;t<this._pointerTypes.length;t++)if(this._pointerIsActive(t)){if(e!==void 0){const i=this._pointerTypes[t];if(Array.isArray(e)){let n=!1;for(const s of e)if(i===s){n=!0;break}if(!n)continue}else if(e!==i)continue}yield t}}*foreachTouchId(){for(let e=0;e<this._pointerTypes.length;e++)this._pointerTypes[e]==="touch"&&this._pointerIsActive[e]&&(yield e)}_pointerIsActive(e){return e<0?!1:this._pointerPressed[e]||this._pointerDown[e]||this._pointerUp[e]}context;_pointerDown=[!1];_pointerUp=[!1];_pointerClick=[!1];_pointerDoubleClick=[!1];_pointerPressed=[!1];_pointerPositions=[new ee];_pointerPositionsLastFrame=[new ee];_pointerPositionsDelta=[new ee];_pointerPositionsRC=[new ee];_pointerPositionDown=[new b];_pointerDownTime=[];_pointerUpTime=[];_pointerUpTimestamp=[];_pointerIds=[];_pointerTypes=[""];_mouseWheelChanged=[!1];_mouseWheelDeltaY=[0];_pointerEvent=[];_pointerEventsPressed=[];_pointerSpace=[];_pressedStack=new Map;onDownButton(e,t){let i=this._pressedStack.get(e);i||(i=[],this._pressedStack.set(e,i)),i.push(t)}onReleaseButton(e,t){const i=this._pressedStack.get(e);if(!i)return;const n=i.indexOf(t);n>=0&&i.splice(n,1)}getFirstPressedButtonForPointer(e){const t=this._pressedStack.get(e);if(t)return t[0]}getLatestPressedButtonForPointer(e){const t=this._pressedStack.get(e);if(t)return t[t.length-1]}getKeyDown(e){if(e!==void 0)return this.isKeyDown(e);for(const t in this.keysPressed){const i=this.keysPressed[t];if(i.startFrame===this.context.time.frameCount)return i.key}return null}getKeyPressed(e){if(e!==void 0)return this.isKeyPressed(e);for(const t in this.keysPressed){const i=this.keysPressed[t];if(i.pressed)return i.key}return null}getKeyUp(e){if(e!==void 0)return this.isKeyUp(e);for(const t in this.keysPressed){const i=this.keysPressed[t];return i.pressed===!1&&i.frame===this.context.time.frameCount}return null}isKeyDown(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyDown(n))return!0;return!1}const i=this.keysPressed[e];return i?i.startFrame===this.context.time.frameCount&&i.pressed:!1}isKeyUp(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyUp(n))return!0;return!1}const i=this.keysPressed[e];return i?i.frame===this.context.time.frameCount&&i.pressed===!1:!1}isKeyPressed(e){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const n of t)if(this.isKeyPressed(n))return!0;return!1}const i=this.keysPressed[e];return i&&i.pressed||!1}getCodeForCommonKeyName(e){if(e.length===1){if(e>="0"&&e<="9")return["Digit"+e];if(e>="a"&&e<="z")return["Key"+e.toUpperCase()];if(e==" ")return["Space"]}switch(e){case"shift":case"Shift":return["ShiftLeft","ShiftRight"];case"control":case"Control":return["ControlLeft","ControlRight"];case"alt":case"Alt":return["AltLeft","AltRight"]}return null}createInputEvent(e){switch(e.type){case"pointerdown":st&&Te("Create Pointer down"),this.onDownButton(e.deviceIndex,e.button),this.onDown(e);break;case"pointermove":st&&Te("Create Pointer move"),this.onMove(e);break;case"pointerup":st&&Te("Create Pointer up"),this.onUp(e),this.onReleaseButton(e.deviceIndex,e.button);break}}convertScreenspaceToRaycastSpace(e){return e.x=(e.x-this.context.domX)/this.context.domWidth*2-1,e.y=-((e.y-this.context.domY)/this.context.domHeight)*2+1,e}constructor(e){this.context=e,this.context.post_render_callbacks.push(this.onEndOfFrame)}_htmlEventSource;bindEvents(){this.unbindEvents(),this._htmlEventSource=this.context.renderer.domElement,window.addEventListener("contextmenu",this.onContextMenu),this._htmlEventSource.addEventListener("pointerdown",this.onPointerDown,{passive:!0}),window.addEventListener("pointermove",this.onPointerMove,{passive:!0,capture:!0}),window.addEventListener("pointerup",this.onPointerUp,{passive:!0}),window.addEventListener("pointercancel",this.onPointerCancel,{passive:!0}),window.addEventListener("touchstart",this.onTouchStart,{passive:!0}),window.addEventListener("touchmove",this.onTouchMove,{passive:!0}),window.addEventListener("touchend",this.onTouchEnd,{passive:!0}),this._htmlEventSource.addEventListener("wheel",this.onMouseWheel,{passive:!0}),window.addEventListener("wheel",this.onWheelWindow,{passive:!0}),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keypress",this.onKeyPressed,!1),window.addEventListener("keyup",this.onKeyUp,!1),window.addEventListener("blur",this.onLostFocus)}unbindEvents(){for(const e in this._eventListeners)this._eventListeners[e].length=0;window.removeEventListener("contextmenu",this.onContextMenu),this._htmlEventSource?.removeEventListener("pointerdown",this.onPointerDown),window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerCancel),window.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd),this._htmlEventSource?.removeEventListener("wheel",this.onMouseWheel,!1),window.removeEventListener("wheel",this.onWheelWindow,!1),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keypress",this.onKeyPressed,!1),window.removeEventListener("keyup",this.onKeyUp,!1),window.removeEventListener("blur",this.onLostFocus)}dispose(){const e=this.context.post_render_callbacks.indexOf(this.onEndOfFrame);e>=0&&this.context.post_render_callbacks.splice(e,1),this.unbindEvents()}onLostFocus=()=>{for(const e in this.keysPressed)this.keysPressed[e].pressed=!1};_receivedPointerMoveEventsThisFrame=new Array;onEndOfFrame=()=>{this._receivedPointerMoveEventsThisFrame.length=0;for(let e=0;e<this._pointerUp.length;e++)this._pointerUp[e]=!1;for(let e=0;e<this._pointerDown.length;e++)this._pointerDown[e]=!1;for(let e=0;e<this._pointerClick.length;e++)this._pointerClick[e]=!1;for(let e=0;e<this._pointerDoubleClick.length;e++)this._pointerDoubleClick[e]=!1;for(const e of this._pointerPositionsDelta)e.set(0,0);for(let e=0;e<this._mouseWheelChanged.length;e++)this._mouseWheelChanged[e]=!1;for(let e=0;e<this._mouseWheelDeltaY.length;e++)this._mouseWheelDeltaY[e]=0};canReceiveInput(e){return e.target===this.context.renderer?.domElement||e.target===this.context.domElement||this.context.isInAR||this.context.isInAR&&e.target===document.body&&q.isMozillaXR()?!0:(st&&console.warn("CanReceiveInput:False for",e.target),!1)}onContextMenu=e=>{this.canReceiveInput(e)!==!1&&e instanceof PointerEvent&&e.pointerType};keysPressed={};onKeyDown=e=>{if(st&&console.log(`key down ${e.code}, ${this.context.application.hasFocus}`,e),!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(t&&t.pressed)return;this.keysPressed[e.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:e.key,code:e.code};const i=new dc("keydown",e,e);this.onDispatchEvent(i)};onKeyPressed=e=>{if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(!t)return;t.pressed=!0,t.frame=this.context.time.frameCount+1;const i=new dc("keypress",e,e);this.onDispatchEvent(i)};onKeyUp=e=>{if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];if(!t)return;t.pressed=!1,t.frame=this.context.time.frameCount+1;const i=new dc("keyup",e,e);this.onDispatchEvent(i)};onWheelWindow=e=>{document.pointerLockElement&&this.onMouseWheel(e)};onMouseWheel=e=>{if(this.canReceiveInput(e)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const t=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=t+e.deltaY};onPointerDown=e=>{if(this.context.isInAR||this.canReceiveInput(e)===!1)return;e.target instanceof HTMLElement&&e.target.setPointerCapture(e.pointerId);const t=this.getPointerId(e);st&&Te(`pointer down #${t}, identifier:${e.pointerId}`);const i=this.getAndUpdateSpatialObjectForScreenPosition(t,e.clientX,e.clientY),n=new Mo("pointerdown",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:t,button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:i,pressure:e.pressure});this.onDown(n)};onPointerMove=e=>{if(this.context.isInAR||this._receivedPointerMoveEventsThisFrame.includes(e.pointerId))return;this._receivedPointerMoveEventsThisFrame.push(e.pointerId);let t=e.button;e.pointerType==="mouse"&&(t=this.getFirstPressedButtonForPointer(0)??0);const i=this.getPointerId(e,t);t===-1&&(t=i);const n=this.getAndUpdateSpatialObjectForScreenPosition(i,e.clientX,e.clientY),s=new Mo("pointermove",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:i,button:t,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:n,pressure:e.pressure});this.onMove(s)};onPointerCancel=e=>{this.context.isInAR||(st&&console.log("Pointer cancel",e),this.onPointerUp(e))};onPointerUp=e=>{if(this.context.isInAR)return;e.target instanceof HTMLElement&&e.target.releasePointerCapture(e.pointerId);const t=this.getPointerId(e),i=new Mo("pointerup",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:t,button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,buttonName:this.getButtonName(e),device:this.getAndUpdateSpatialObjectForScreenPosition(t,e.clientX,e.clientY),pressure:e.pressure});this.onUp(i),this._pointerIds[t]=-1,st&&console.log("ID="+t,"PointerId="+e.pointerId,"ALL:",[...this._pointerIds])};getPointerId(e,t){return e.pointerType==="mouse"?0+(t??e.button):this.getPointerIndex(e.pointerId)}getButtonName(e){const t=e.button;if(e.pointerType==="mouse")switch(t){case 0:return"left";case 1:return"middle";case 2:return"right"}return"unknown"}onTouchStart=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),s=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),r=new Mo("pointerdown",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:s,pressure:i.force});this.onDown(r)}};onTouchMove=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),s=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),r=new Mo("pointermove",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:s,pressure:i.force});this.onMove(r)}};onTouchEnd=e=>{if(this.context.isInAR)for(let t=0;t<e.changedTouches.length;t++){const i=e.changedTouches[t],n=this.getPointerIndex(i.identifier),s=new Mo("pointerup",e,{origin:this,mode:"screen",deviceIndex:0,pointerId:n,button:0,clientX:i.clientX,clientY:i.clientY,pointerType:"touch",buttonName:"unknown",device:this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),pressure:i.force});this.onUp(s),this._pointerIds[n]=-1}};tempNearPlaneVector=new b;tempFarPlaneVector=new b;tempLookMatrix=new K;getAndUpdateSpatialObjectForScreenPosition(e,t,i){let n=this._pointerSpace[e];n||(n=new k,this._pointerSpace[e]=n),this._pointerSpace[e]=n;const s=this.context.mainCamera;if(s){const r=this.tempNearPlaneVector.set(t,i,-1);this.convertScreenspaceToRaycastSpace(r);const a=this.tempFarPlaneVector.set(r.x,r.y,1);r.unproject(s),a.unproject(s);const l=s.worldUp||D(0,1,0).applyQuaternion(be(s));this.tempLookMatrix.lookAt(a,r,l),n.position.set(r.x,r.y,r.z),n.quaternion.setFromRotationMatrix(this.tempLookMatrix)}return n}isInRect(e){if(this.context.isInXR)return!0;const t=this.context.domElement.getBoundingClientRect(),i=e.clientX,n=e.clientY,s=i>=t.x&&i<=t.right&&n>=t.y&&n<=t.bottom;return st&&!s&&console.log("Not in rect",t,i,n),s}onDown(e){const t=e.pointerId;if(this.getPointerPressed(t)&&console.warn(`Received pointerDown for pointerId that is already pressed: ${t}`,st?e:""),st&&console.log(e.pointerType,"DOWN",t),!!this.isInRect(e)){for(this.setPointerState(t,this._pointerPressed,!0),this.setPointerState(t,this._pointerDown,!0),this.setPointerStateT(t,this._pointerEvent,e.source);t>=this._pointerTypes.length;)this._pointerTypes.push(e.pointerType);for(this._pointerTypes[t]=e.pointerType;t>=this._pointerPositionDown.length;)this._pointerPositionDown.push(new b);for(this._pointerPositionDown[t].set(e.clientX,e.clientY,e.clientZ??0);t>=this._pointerPositions.length;)this._pointerPositions.push(new ee);this._pointerPositions[t].set(e.clientX,e.clientY),t>=this._pointerDownTime.length&&this._pointerDownTime.push(0),this._pointerDownTime[t]=this.context.time.realtimeSinceStartup,this.updatePointerPosition(e),this._pointerEventsPressed.push(e),this.onDispatchEvent(e)}}onMove(e){const t=e.pointerId,i=this.getPointerPressed(t);i===!1&&!this.isInRect(e)||e.pointerType==="touch"&&!i||(this.updatePointerPosition(e),this.setPointerStateT(t,this._pointerEvent,e.source),this.onDispatchEvent(e))}onUp(e){const t=e.pointerId;if(!this.getPointerPressed(t)){st&&console.log(e.pointerType,"UP",t,"was not down");return}st&&console.log(e.pointerType,"UP",t),this.setPointerState(t,this._pointerPressed,!1),this.setPointerStateT(t,this._pointerEvent,e.source),this.setPointerState(t,this._pointerUp,!0),this.updatePointerPosition(e);for(let a=this._pointerEventsPressed.length-1;a>=0;a--)if(this._pointerEventsPressed[a].pointerId===t){this._pointerEventsPressed.splice(a,1);break}if(!this._pointerPositionDown[t]){st&&ye("Received pointer up event without matching down event for button: "+t),console.warn("Received pointer up event without matching down event for button: "+t);return}const i=this._pointerUpTime[t],n=this._pointerDownTime[t],s=this.context.time.realtimeSinceStartup,r=s-n;if(t>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),this._pointerUpTime[t]=s,r<1){let a=e.clientX-this._pointerPositionDown[t].x,l=e.clientY-this._pointerPositionDown[t].y,c=0;if(e.isSpatial&&e.clientZ!=null&&(c=e.clientZ-this._pointerPositionDown[t].z,a*=200,l*=200,c*=200),Math.abs(a)<5&&Math.abs(l)<5&&Math.abs(c)<5){this.setPointerState(t,this._pointerClick,!0),e.isClick=!0;const h=s-i;st&&console.log("CLICK",t,a,l,c,h),h<this._doubleClickTimeThreshold&&h>0&&(this.setPointerState(t,this._pointerDoubleClick,!0),e.isDoubleClick=!0)}}this.onDispatchEvent(e)}updatePointerPosition(e){const t=e.pointerId;for(;t>=this._pointerPositions.length;)this._pointerPositions.push(new ee);for(;t>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new ee);for(;t>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new ee);const i=this._pointerPositionsLastFrame[t];i.copy(this._pointerPositions[t]);const n=this._pointerPositionsDelta[t];let s=e.clientX-i.x,r=e.clientY-i.y;if(e.source instanceof MouseEvent||e.source instanceof TouchEvent){const h=e.source;s===0&&h.movementX!==0&&(s=h.movementX||0),r===0&&h.movementY!==0&&(r=h.movementY||0)}n.x+=s,n.y+=r,this._pointerPositions[t].x=e.clientX,this._pointerPositions[t].y=e.clientY;const a=e.clientX,l=e.clientY;for(;t>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new ee);const c=this._pointerPositionsRC[t];c.set(a,l),this.convertScreenspaceToRaycastSpace(c)}getPointerIndex(e){let t=-1;for(let i=0;i<this._pointerIds.length;i++){if(this._pointerIds[i]===e)return i;t===-1&&this._pointerIds[i]===-1&&(t=i)}return t!==-1?(this._pointerIds[t]=e,t):(st&&console.log("PUSH pointerId:",e),this._pointerIds.push(e),this._pointerIds.length-1)}setPointerState(e,t,i){t[e]=i}setPointerStateT(e,t,i){return t[e]=i,i}onDispatchEvent(e){const t=z.Current;try{z.Current=this.context,this.dispatchEvent(e)}finally{z.Current=t}}}const Da=new K().makeRotationY(Math.PI),$i=new U().setFromAxisAngle(new b(0,1,0),Math.PI),zO=v("debugwebxr");class NO{priority=-1e5;gameObject;isXRRig(){return!0}get isActive(){return this.gameObject.visible}constructor(){if(this.gameObject=new k,this.gameObject.name="Implicit XR Rig",zO){const e=Cg(16733661);e.position.y+=.5,this.gameObject.add(e)}}}const Ro=v("debugwebxr"),Wd=v("debugcustomgesture"),VO="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",WO="generic-trigger",$O=new U().setFromEuler(new ot(wo.degToRad(0),wo.degToRad(-90),wo.degToRad(-90))),HO=new b(.04,-.04,0);class hg{xr;get context(){return this.xr.context}inputSource;index=0;emitEvents=!0;get connected(){return this._connected}_connected=!0;get isTracking(){return this._isTracking}_isTracking=!1;get gamepad(){return this.__gamepad??=this.inputSource.gamepad}__gamepad;get isHand(){return this.hand!=null}get hand(){return this.__hand??=this.inputSource.hand}__hand;get handObject(){return this.context.renderer.xr.getHand(this.index)}get profiles(){return this.inputSource.profiles}get layout(){return this._layout}get targetRayMode(){return this.inputSource.targetRayMode}get targetRaySpace(){return this.inputSource.targetRaySpace}get gripSpace(){return this.inputSource.gripSpace}get side(){return this.__side??=this.inputSource.handedness}__side=void 0;get isRight(){return this.side==="right"}get isLeft(){return this.side==="left"}get isStylus(){return this._isMxInk}getHitTestSource(){return this._hitTestSource||this._requestHitTestSource(),this._hitTestSource}get hasHitTestSource(){return this._hitTestSource}cancelHitTestSource(){this._hitTestSource&&(this._hitTestSource.cancel(),this._hitTestSource=void 0)}_hitTestSource=void 0;_hasSelectEvent=!1;get hasSelectEvent(){return this._hasSelectEvent}_isMxInk=!1;_isMetaQuestTouchController=!1;getHitTest(){return this.xr.getHitTest(this)}_handJointPoses=new Map;getHandJointPose(e,t){if(t=t||this.xr.frame,!this.hand||!t?.getJointPose||!this.xr.referenceSpace)return null;let i=this._handJointPoses?.get(e);return i||(i=t.getJointPose(e,this.xr.referenceSpace),i&&this._handJointPoses.set(e,i),i)}_gripMatrix=new K;_gripPosition=new b;_gripQuaternion=new U;_linearVelocity=new b;_rayPositionRaw=new b;_rayRotationRaw=new U;_rayMatrix=new K;_rayPosition=new b;_rayQuaternion=new U;get gripPosition(){return D(this._gripPosition)}get gripQuaternion(){return ri(this._gripQuaternion)}get gripMatrix(){return this._gripMatrix}get gripLinearVelocity(){return D(this._linearVelocity).applyQuaternion($i)}get rayPosition(){return D(this._rayPosition)}get rayQuaternion(){return ri(this._rayQuaternion)}get gripWorldPosition(){return D(this._gripWorldPosition)}_gripWorldPosition=new b;get gripWorldQuaternion(){return ri(this._gripWorldQuaternion)}_gripWorldQuaternion=new U;get rayWorldPosition(){return D(this._rayWorldPosition)}_rayWorldPosition=new b;updateRayWorldPosition(){const e=this.xr.context.mainCamera?.parent;this._rayWorldPosition.copy(this._rayPositionRaw),e&&this._rayWorldPosition.applyMatrix4(e.matrixWorld)}get rayWorldQuaternion(){return ri(this._rayWorldQuaternion)}_rayWorldQuaternion=new U;get pinchPosition(){return D(this._pinchPosition)}_pinchPosition=new b;updateRayWorldQuaternion(){const e=this.xr.context.mainCamera?.parent,t=e?be(e):void 0;this._rayWorldQuaternion.copy(this._rayRotationRaw).multiply($i),t&&this._rayWorldQuaternion.premultiply(t)}get ray(){return this._ray.origin.copy(this.rayWorldPosition),this._ray.direction.copy(D(0,0,1).applyQuaternion(this.rayWorldQuaternion)),this._ray}_ray;_hand_wristDotUp=void 0;get handWristDotUp(){if(this._hand_wristDotUp!==void 0)return this._hand_wristDotUp;const e=this.handObject?.joints.wrist;if(e){const t=D(0,1,0).applyQuaternion(e.quaternion),i=D(0,1,0).dot(t);return this._hand_wristDotUp=i}}get isHandUpsideDown(){return this.handWristDotUp!==void 0?this.handWristDotUp<-.7:!1}get isTeleportGesture(){return this.isHandUpsideDown&&this.getGesture("pinch")?.isDown}get object(){return this._object}_object;_gripSpaceObject;_raySpaceObject;model=null;_debugAxesHelper=new xi(.15);_debugGripAxesHelper=new xi(.07);_debugRayAxesHelper=new xi(.07);async getModelUrl(){return this.getMotionController?.then(e=>e?.assetUrl||null)}constructor(e,t,i){this.xr=e,this.inputSource=t,this.index=i,this._object=new k,this._object.name=`NeedleXRController_${i}`,Ro&&(this._object.add(this._debugAxesHelper),this._gripSpaceObject=new k,this._raySpaceObject=new k,this._gripSpaceObject.name=`NeedleXRController_${i}_gripSpace`,this._raySpaceObject.name=`NeedleXRController_${i}_raySpace`,this._gripSpaceObject.add(this._debugGripAxesHelper),this._raySpaceObject.add(this._debugRayAxesHelper),this.xr.context.scene.add(this._gripSpaceObject),this.xr.context.scene.add(this._raySpaceObject)),this.xr.context.scene.add(this._object),this._ray=new vo,this.pointerInit={origin:this,pointerType:this.hand?"hand":"controller",deviceIndex:this.index,pointerId:-1,mode:this.inputSource.targetRayMode,ray:this._ray,device:this._object,buttonName:"none"},this.initialize(),this.subscribeEvents()}_hitTestSourcePromise=null;_requestHitTestSource(){return this._hitTestSourcePromise?this._hitTestSourcePromise:this.xr.mode==="immersive-ar"&&this.inputSource.targetRayMode==="tracked-pointer"&&this.xr.session.requestHitTestSourceForTransientInput?this._hitTestSourcePromise=this.xr.session.requestHitTestSourceForTransientInput({profile:this.inputSource.profiles[0],offsetRay:new XRRay})?.then(e=>(this._hitTestSourcePromise=null,this.connected?this._hitTestSource=e:(e.cancel(),null)))??null:null}onPointerHits=e=>{};onUpdate(e){this.onUpdateFrame(e),this.updateInputEvents(),this.onUpdateMove()}onRenderDebug(){B.DrawSphere(this.rayWorldPosition,.003),B.DrawDirection(this.rayWorldPosition,D(0,0,10).applyQuaternion(this.rayWorldQuaternion));const e=(this.inputSource.gripSpace?this.gripWorldPosition:this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(.1)),t=this.inputSource.profiles.join(`
146
146
  `);let i=`Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
147
147
  C:${this.connected?"x":"-"} T:${this.isTracking?"x":"-"} Hand:${this.inputSource.hand?"x":"-"} Pen: ${this._isMxInk?"x":"-"}`;if(this.inputSource.hand&&(i+=`
@@ -686,16 +686,15 @@ vec3 AgXToneMapping( vec3 color ) {
686
686
  bottom: calc(100% + 5px);
687
687
  z-index: 100;
688
688
  width: auto;
689
- left: .2rem;
690
- right: .2rem;
691
- padding: .2rem;
689
+ max-width: 90vw;
690
+ left: 50%;
691
+ transform: translateX(-50%);
692
+ padding: .2rem 1em;
692
693
 
693
694
  }
694
695
  .compact.logo-hidden .foldout {
695
696
  /** for when there's no logo we want to center the foldout **/
696
697
  min-width: 24ch;
697
- margin-left: 50%;
698
- transform: translateX(calc(-50% - .2rem));
699
698
  }
700
699
 
701
700
  .compact.top .foldout {
@@ -948,7 +947,7 @@ Exit Time: `+c,s.hasExitTime)}this.transitionTo(s.destinationState,s.duration,s.
948
947
  // Uncomment to visualize blur amount
949
948
  // gl_FragColor = vec4(blurAmount, 0.0, 0.0, 1.0);
950
949
  }
951
- `;function Lw(o){if(Z.active)return console.warn("[OrbitControls] Can not fit camera while XR session is active"),null;const e=z.Current;if(!e)return console.warn("[OrbitControls] No context found"),null;const t=o?.camera||e.mainCamera;if(!t)return console.warn("No camera or controls found to fit camera to objects..."),null;o||(o={}),o.autoApply=o.autoApply!==!1,o.minZoom||=0,o.maxZoom||=1/0;const{centerCamera:i,cameraNearFar:n="auto",fitOffset:s=1.1,fov:r=t instanceof re?t?.fov:-1}=o,a=new b,l=new b,c=t instanceof re?t.aspect:1,h=o.objects||e.scene,d=Xt(h,void 0,t?.layers),p=d.clone();d.getCenter(l);const m=new b;if(d.getSize(m),t instanceof re&&t.updateProjectionMatrix(),t.updateMatrixWorld(),d.applyMatrix4(t.matrixWorldInverse),d.getSize(a),d.setFromCenterAndSize(l,a),Number.isNaN(a.x)||Number.isNaN(a.y)||Number.isNaN(a.z))return console.warn("Camera fit size resultet in NaN",t,d),null;if(a.length()<=1e-10)return console.warn("Camera fit size is zero",d),null;const f=r,g=2*Math.atan(Math.tan(f*Math.PI/360/2)*c)/Math.PI*360,y=a.y/(2*Math.atan(Math.PI*f/360)),_=a.x/(2*Math.atan(Math.PI*g/360)),w=s*Math.max(y,_)+a.z/2;o.maxZoom=w*10,o.minZoom=w*.01,o.debug===!0&&console.log("Fit camera to objects",{fitHeightDistance:y,fitWidthDistance:_,distance:w,verticalFov:f,horizontalFov:g});const P=.05,M=l.clone();if(M.y-=a.y*P,o.targetOffset&&(o.targetOffset.x!==void 0&&(M.x+=o.targetOffset.x),o.targetOffset.y!==void 0&&(M.y+=o.targetOffset.y),o.targetOffset.z!==void 0&&(M.z+=o.targetOffset.z)),o.relativeTargetOffset&&(o.relativeTargetOffset.x!==void 0&&(M.x+=o.relativeTargetOffset.x*a.x),o.relativeTargetOffset.y!==void 0&&(M.y+=o.relativeTargetOffset.y*a.y),o.relativeTargetOffset.z!==void 0&&(M.z+=o.relativeTargetOffset.z*a.z)),n==null||n=="auto"){const I=$a(Yn),N=I?I.radius:0,V=Math.max(m.x,m.y,m.z,N);t instanceof re&&(t.near=w/100,t.far=V+w*10,t.updateProjectionMatrix()),I&&(o.maxZoom=Math.max(Math.min(o.maxZoom,N*.5),w))}o.currentZoom!==void 0&&(o.currentZoom<o.minZoom&&(o.minZoom=o.currentZoom*.9),o.currentZoom>o.maxZoom&&(o.maxZoom=o.currentZoom*1.1));const O=l.clone();o.fitDirection?O.sub(new b().copy(o.fitDirection).multiplyScalar(1e6)):O.sub(t.worldPosition),i==="y"&&(O.y=0),O.normalize(),O.multiplyScalar(w),i==="y"&&(O.y+=-P*4*w);let j=l.clone().sub(O);return o.cameraOffset&&(o.cameraOffset.x!==void 0&&(j.x+=o.cameraOffset.x),o.cameraOffset.y!==void 0&&(j.y+=o.cameraOffset.y),o.cameraOffset.z!==void 0&&(j.z+=o.cameraOffset.z)),o.relativeCameraOffset&&(o.relativeCameraOffset.x!==void 0&&(j.x+=o.relativeCameraOffset.x*a.x),o.relativeCameraOffset.y!==void 0&&(j.y+=o.relativeCameraOffset.y*a.y),o.relativeCameraOffset.z!==void 0&&(j.z+=o.relativeCameraOffset.z*a.z)),t.parent&&(j=t.parent.worldToLocal(j)),o.debug&&(B.DrawWireBox3(d,16777011,10),B.DrawWireBox3(p,65280,10)),o.autoApply&&(t.position.copy(j),t.lookAt(M),r>0&&t instanceof re&&(t.fov=r,t.updateProjectionMatrix())),{camera:t,position:j,lookAt:M,fov:o.fov}}var dR=Object.defineProperty,ff=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&dR(e,t,n),n};class jr extends R{constraintActive=!0;locked=!1;sources=[];setConstraintPosition(e){const t=this.sources[0];t&&(t.worldPosition=e)}}ff([u()],jr.prototype,"constraintActive"),ff([u()],jr.prototype,"locked"),ff([u(k)],jr.prototype,"sources");let Dr=class{bb=null;bb_pos=0;__init(o,e){return this.bb_pos=o,this.bb=e,this}x(){return this.bb.readFloat32(this.bb_pos)}y(){return this.bb.readFloat32(this.bb_pos+4)}z(){return this.bb.readFloat32(this.bb_pos+8)}static sizeOf(){return 12}static createVec3(o,e,t,i){return o.prep(4,12),o.writeFloat32(i),o.writeFloat32(t),o.writeFloat32(e),o.offset()}};class jw{bb=null;bb_pos=0;__init(e,t){return this.bb_pos=e,this.bb=t,this}position(e){return(e||new Dr).__init(this.bb_pos,this.bb)}rotation(e){return(e||new Dr).__init(this.bb_pos+12,this.bb)}scale(e){return(e||new Dr).__init(this.bb_pos+24,this.bb)}static sizeOf(){return 36}static createTransform(e,t,i,n,s,r,a,l,c,h){return e.prep(4,36),e.prep(4,12),e.writeFloat32(h),e.writeFloat32(c),e.writeFloat32(l),e.prep(4,12),e.writeFloat32(a),e.writeFloat32(r),e.writeFloat32(s),e.prep(4,12),e.writeFloat32(n),e.writeFloat32(i),e.writeFloat32(t),e.offset()}}class as{bb=null;bb_pos=0;__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSyncedTransformModel(e,t){return(t||new as).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSyncedTransformModel(e,t){return e.setPosition(e.position()+Pb),(t||new as).__init(e.readInt32(e.position())+e.position(),e)}guid(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}fast(){const e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}transform(e){const t=this.bb.__offset(this.bb_pos,8);return t?(e||new jw).__init(this.bb_pos+t,this.bb):null}dontSave(){const e=this.bb.__offset(this.bb_pos,10);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startSyncedTransformModel(e){e.startObject(4)}static addGuid(e,t){e.addFieldOffset(0,t,0)}static addFast(e,t){e.addFieldInt8(1,+t,0)}static addTransform(e,t){e.addFieldStruct(2,t,0)}static addDontSave(e,t){e.addFieldInt8(3,+t,0)}static endSyncedTransformModel(e){return e.endObject()}static finishSyncedTransformModelBuffer(e,t){e.finish(t)}static finishSizePrefixedSyncedTransformModelBuffer(e,t){e.finish(t,void 0,!0)}}var E;(o=>{(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./rapier-DJ-luMxr.min.js");return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.RAPIER_PHYSICS||(o.RAPIER_PHYSICS={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./postprocessing-BkY94MUG.min.js").then(r=>r.index);return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.POSTPROCESSING||(o.POSTPROCESSING={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./postprocessing-BkY94MUG.min.js").then(r=>r.N8AO);return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.POSTPROCESSING_AO||(o.POSTPROCESSING_AO={}))})(E||(E={}));var bt=(o=>(o[o.Average=0]="Average",o[o.Multiply=1]="Multiply",o[o.Minimum=2]="Minimum",o[o.Maximum=3]="Maximum",o))(bt||{}),Ru=(o=>(o[o.Discrete=0]="Discrete",o[o.Continuous=1]="Continuous",o))(Ru||{}),Xe=(o=>(o[o.None=0]="None",o[o.FreezePositionX=2]="FreezePositionX",o[o.FreezePositionY=4]="FreezePositionY",o[o.FreezePositionZ=8]="FreezePositionZ",o[o.FreezePosition=14]="FreezePosition",o[o.FreezeRotationX=16]="FreezeRotationX",o[o.FreezeRotationY=32]="FreezeRotationY",o[o.FreezeRotationZ=64]="FreezeRotationZ",o[o.FreezeRotation=112]="FreezeRotation",o[o.FreezeAll=126]="FreezeAll",o))(Xe||{}),Za=(o=>(o[o.None=0]="None",o[o.X=2]="X",o[o.Y=4]="Y",o[o.Z=8]="Z",o[o.All=-1]="All",o))(Za||{});const kt=function(o,e){return function(t,i,n){uR(t,i,n,o,e)}};function uR(o,e,t,i,n){if(!n&&!i&&!o.onValidate)return;if(t!==void 0){console.error("Invalid usage of validate decorator. Only fields can be validated.",o,e,t),Te("Invalid usage of validate decorator. Only fields can be validated. Property: "+e,Oi.Error);return}let s="";if(typeof e=="string"?s=e:s=e.name,o.__internalAwake){const r=Symbol(s),a=o.__internalAwake;o.__internalAwake=function(){if(!this.onValidate){A()&&console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "'+o.constructor?.name+'"');return}if(this[r]===void 0){this[r]=this[s];const l=this[s];if(l instanceof ee||l instanceof b||l instanceof pe||l instanceof U){const c=this[s];Rd(c,()=>{this.onValidate(s)})}Object.defineProperty(this,s,{set:function(c){if(this[Gg]===!0)this[r]=c;else{i?.call(this,c);const h=this[r];this[r]=c,this.onValidate?.call(this,s,h)}},get:function(){return n?.call(this),this[r]}})}a.call(this)}}}const pR=function(o){return function(e,t,i){let n="";typeof t=="string"?n=t:n=t.name;const s=o.prototype,r=Object.getOwnPropertyDescriptor(s,n);if(!r?.value){console.warn("Can not apply prefix: type does not have method named",t,o);return}const a=r.value,l=e[n];Object.defineProperty(s,n,{value:function(...c){const h=l?.call(this,...c);if(h instanceof Promise){h.then(d=>{if(d!==!1)return a.call(this,...c)});return}if(h!==!1)return a.call(this,...c)}})}};var mR=Object.defineProperty,gR=Object.getOwnPropertyDescriptor,Mi=(o,e,t,i)=>{for(var n=i>1?void 0:i?gR(e,t):e,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=(i?r(e,t,n):r(n))||n);return i&&n&&mR(e,t,n),n};class fR{get isDirty(){return this.positionChanged||this.rotationChanged}positionChanged=!1;rotationChanged=!1;position;quaternion;_positionKeys=["x","y","z"];_quaternionKeys=["_x","_y","_z","_w"];reset(e=!1){if(this.positionChanged=!1,this.rotationChanged=!1,this.mute=!1,e){if(this.position)for(const t of this._positionKeys)delete this.position[t];if(this.quaternion)for(const t of this._quaternionKeys)delete this.quaternion[t]}}syncValues(){for(const e of this._positionKeys)this.position[e]=this.obj.position[e];for(const e of this._quaternionKeys)this.quaternion[e]=this.obj.quaternion[e]}mute=!1;applyValues(){if(this.positionChanged&&this.position)for(const e of this._positionKeys){const t=this.position[e];t!==void 0&&(this.obj.position[e]=t)}if(this.rotationChanged&&this.quaternion)for(const e of this._quaternionKeys){const t=this.quaternion[e];t!==void 0&&(this.obj.quaternion[e]=t)}}context;obj;_positionWatch;_rotationWatch;constructor(e,t){this.context=t,this.obj=e}start(e,t){this.reset(),e&&(this._positionWatch||(this._positionWatch=new rs(this.obj.position,["x","y","z"])),this._positionWatch.apply(),this.position={},this._positionWatch.subscribeWrite((s,r)=>{if(this.context.physics.engine?.isUpdating||this.mute)return;const a=this.position[r];Math.abs(a-s)<1e-5||(this.position[r]=s,this.positionChanged=!0)})),t&&(this._rotationWatch||(this._rotationWatch=new rs(this.obj.quaternion,["_x","_y","_z","_w"])),this._rotationWatch.apply(),this.quaternion={},this._rotationWatch.subscribeWrite((s,r)=>{if(this.context.physics.engine?.isUpdating||this.mute)return;const a=this.quaternion[r];Math.abs(a-s)<1e-5||(this.quaternion[r]=s,this.rotationChanged=!0)}));const i=this.obj.matrixWorld.multiplyMatrices.bind(this.obj.matrixWorld),n=new K;this.obj.matrixWorld.multiplyMatrices=(s,r)=>(this.context.physics.engine?.isUpdating||this.mute||n.equals(s)||(this.positionChanged=!0,this.rotationChanged=!0,n.copy(s)),i(s,r))}stop(){this._positionWatch?.revoke(),this._rotationWatch?.revoke()}}const ci=class om extends R{get isRigidbody(){return!0}autoMass=!0;set mass(e){e!==this._mass&&(this._mass=e,this._propertiesChanged=!0,this.__didAwake&&(this.autoMass=!1))}get mass(){return this.autoMass?this.context.physics.engine?.getBody(this)?.mass()??-1:this._mass}_mass=0;useGravity=!0;centerOfMass=new b(0,0,0);constraints=Xe.None;isKinematic=!1;drag=0;angularDrag=1;detectCollisions=!0;sleepThreshold=.01;collisionDetectionMode=Ru.Discrete;get lockPositionX(){return(this.constraints&Xe.FreezePositionX)!==0}get lockPositionY(){return(this.constraints&Xe.FreezePositionY)!==0}get lockPositionZ(){return(this.constraints&Xe.FreezePositionZ)!==0}get lockRotationX(){return(this.constraints&Xe.FreezeRotationX)!==0}get lockRotationY(){return(this.constraints&Xe.FreezeRotationY)!==0}get lockRotationZ(){return(this.constraints&Xe.FreezeRotationZ)!==0}set lockPositionX(e){e?this.constraints|=Xe.FreezePositionX:this.constraints&=~Xe.FreezePositionX}set lockPositionY(e){e?this.constraints|=Xe.FreezePositionY:this.constraints&=~Xe.FreezePositionY}set lockPositionZ(e){e?this.constraints|=Xe.FreezePositionZ:this.constraints&=~Xe.FreezePositionZ}set lockRotationX(e){e?this.constraints|=Xe.FreezeRotationX:this.constraints&=~Xe.FreezeRotationX}set lockRotationY(e){e?this.constraints|=Xe.FreezeRotationY:this.constraints&=~Xe.FreezeRotationY}set lockRotationZ(e){e?this.constraints|=Xe.FreezeRotationZ:this.constraints&=~Xe.FreezeRotationZ}set gravityScale(e){this._gravityScale=e}get gravityScale(){return this._gravityScale}_gravityScale=1;dominanceGroup=0;static tempPosition=new b;_propertiesChanged=!1;_currentVelocity=new b;_smoothedVelocity=new b;_smoothedVelocityGetter=new b;_lastPosition=new b;_watch;awake(){this._watch=void 0,this._propertiesChanged=!1}onEnable(){this._watch||(this._watch=new fR(this.gameObject,this.context)),this._watch.start(!0,!0),this.startCoroutine(this.beforePhysics(),we.LateUpdate),A()&&(globalThis.NEEDLE_USE_RAPIER?E.RAPIER_PHYSICS.ready().then(async()=>{await ic(3),this.context.physics.engine?.getBody(this)||console.warn(`Rigidbody could not be created. Ensure "${this.name}" has a Collider component.`)}):console.warn("Rigidbody could not be created: Rapier physics are explicitly disabled."))}onDisable(){this._watch?.stop(),this.context.physics.engine?.removeBody(this)}onDestroy(){this.context.physics.engine?.removeBody(this)}onValidate(){this._propertiesChanged=!0}*beforePhysics(){for(;;)this._propertiesChanged&&(this._propertiesChanged=!1,this.context.physics.engine?.updateProperties(this)),this._watch?.isDirty?(this._watch.mute=!0,this._watch.applyValues(),this.context.physics.engine?.updateBody(this,this._watch.positionChanged,this._watch.rotationChanged),this._watch.reset()):this._watch?.syncValues(),this.captureVelocity(),yield}teleport(e,t=!0){this._watch?.reset(!0),t?this.gameObject.position.set(e.x,e.y,e.z):this.setWorldPosition(e.x,e.y,e.z),this.resetForcesAndTorques(),this.resetVelocities()}resetForces(e=!0){this.context.physics.engine?.resetForces(this,e)}resetTorques(e=!0){this.context.physics.engine?.resetTorques(this,e)}resetVelocities(){this.setVelocity(0,0,0),this.setAngularVelocity(0,0,0)}resetForcesAndTorques(){this.resetForces(),this.resetTorques()}wakeUp(){this.context.physics.engine?.wakeup(this)}get isSleeping(){return this.context.physics.engine?.isSleeping(this)}updateProperties(){return this._propertiesChanged=!1,this.context.physics.engine?.updateProperties(this)}applyForce(e,t,i=!0){this._propertiesChanged&&this.updateProperties(),this.context.physics.engine?.addForce(this,e,i)}applyImpulse(e,t=!0){this._propertiesChanged&&this.updateProperties(),this.context.physics.engine?.applyImpulse(this,e,t)}setForce(e,t,i,n=!0){this.context.physics.engine?.resetForces(this,n),typeof e=="number"?(t??=0,i??=0,this.context.physics.engine?.addForce(this,{x:e,y:t,z:i},n)):this.context.physics.engine?.addForce(this,e,n)}getVelocity(){const e=this.context.physics.engine?.getLinearVelocity(this);return e?(this._currentVelocity.x=e.x,this._currentVelocity.y=e.y,this._currentVelocity.z=e.z,this._currentVelocity):this._currentVelocity.set(0,0,0)}setVelocity(e,t,i,n=!0){if(e instanceof b){const s=e;this.context.physics.engine?.setLinearVelocity(this,s,n);return}t===void 0||i===void 0||this.context.physics.engine?.setLinearVelocity(this,{x:e,y:t,z:i},n)}getAngularVelocity(){const e=this.context.physics.engine?.getAngularVelocity(this);return e?(this._currentVelocity.x=e.x,this._currentVelocity.y=e.y,this._currentVelocity.z=e.z,this._currentVelocity):this._currentVelocity.set(0,0,0)}setAngularVelocity(e,t,i,n=!0){if(typeof e=="object"){const s=e;this.context.physics.engine?.setAngularVelocity(this,s,n);return}if(t===void 0||i===void 0||typeof t=="boolean"){console.warn("setAngularVelocity expects either a Vec3 or 3 numbers");return}this.context.physics.engine?.setAngularVelocity(this,{x:e,y:t,z:i},n)}setTorque(e,t,i){typeof e=="number"?this.setAngularVelocity(e,t,i):this.setAngularVelocity(e)}get smoothedVelocity(){return this._smoothedVelocityGetter.copy(this._smoothedVelocity),this._smoothedVelocityGetter.multiplyScalar(1/this.context.time.deltaTime)}setBodyFromGameObject(e=null){}captureVelocity(){const e=this.gameObject.matrixWorld;om.tempPosition.setFromMatrixPosition(e);const t=om.tempPosition.sub(this._lastPosition);this._lastPosition.copy(om.tempPosition),this._smoothedVelocity.lerp(t,this.context.time.deltaTime/.1)}};Mi([kt()],ci.prototype,"autoMass",2),Mi([u()],ci.prototype,"mass",1),Mi([kt(),u()],ci.prototype,"useGravity",2),Mi([u(b)],ci.prototype,"centerOfMass",2),Mi([kt(),u()],ci.prototype,"constraints",2),Mi([kt(),u()],ci.prototype,"isKinematic",2),Mi([kt(),u()],ci.prototype,"drag",2),Mi([kt(),u()],ci.prototype,"angularDrag",2),Mi([kt(),u()],ci.prototype,"detectCollisions",2),Mi([kt(),u()],ci.prototype,"sleepThreshold",2),Mi([kt(),u()],ci.prototype,"collisionDetectionMode",2),Mi([kt()],ci.prototype,"_gravityScale",2),Mi([kt()],ci.prototype,"dominanceGroup",2);let Ze=ci;new b,new b;const Ps=v("debugsync"),Fc="STRS";mg(Fc,as.getRootAsSyncedTransformModel);const Zn=new Rm;function Dw(o,e,t=!0){Zn.clear();const i=Zn.createString(o);as.startSyncedTransformModel(Zn),as.addGuid(Zn,i),as.addFast(Zn,t);const n=e.worldPosition,s=e.worldEuler,r=e.gameObject.scale;as.addTransform(Zn,jw.createTransform(Zn,n.x,n.y,n.z,s.x,s.y,s.z,r.x,r.y,r.z));const a=as.endSyncedTransformModel(Zn);return Zn.finish(a,Fc),Zn.asUint8Array()}let yf=0,Uc=0;_w(o=>{const e=o.connection.currentServerUrl?.includes("glitch")?10:40;Uc=Math.floor(yf/e),yf=0,Ps&&Uc>0&&console.log("Sync Transform Fast Interval",Uc)});class Pn extends R{overridePhysics=!0;interpolatePosition=!0;interpolateRotation=!0;fastMode=!1;syncDestroy=!1;_model=null;_needsUpdate=!0;rb=null;_wasKinematic=!1;_receivedDataBefore=!1;_targetPosition;_targetRotation;_receivedFastUpdate=!1;_shouldRequestOwnership=!1;requestOwnership(){Ps&&console.log("Request ownership"),this._model?this._model.requestOwnership():(this._shouldRequestOwnership=!0,this._needsUpdate=!0)}freeOwnership(){this._model?.freeOwnership()}hasOwnership(){return this._model?.hasOwnership??void 0}isOwned(){return this._model?.isOwned}joinedRoomCallback=null;receivedDataCallback=null;awake(){Ps&&console.log("new instance",this.guid,this),this._receivedDataBefore=!1,this._targetPosition=new b,this._targetRotation=new U,this.lastPosition=new b,this.lastRotation=new U,this.lastScale=new b,this.rb=x.getComponentInChildren(this.gameObject,Ze),this.rb&&(this._wasKinematic=this.rb.isKinematic),this.receivedUpdate=!0,this._model=new fg(this.context.connection,this.guid),this.context.connection.isConnected&&this.tryGetLastState(),this.joinedRoomCallback=this.tryGetLastState.bind(this),this.context.connection.beginListen(te.JoinedRoom,this.joinedRoomCallback),this.receivedDataCallback=this.onReceivedData.bind(this),this.context.connection.beginListenBinary(Fc,this.receivedDataCallback)}onDestroy(){this.syncDestroy&&Dg(this.guid,this.context.connection),this._model=null,this.context.connection.stopListen(te.JoinedRoom,this.joinedRoomCallback),this.context.connection.stopListenBinary(Fc,this.receivedDataCallback)}tryGetLastState(){const e=this.context.connection.tryGetState(this.guid);e&&this.onReceivedData(e)}tempEuler=new ot;onReceivedData(e){if(!this.destroyed&&typeof e.guid=="function"&&e.guid()===this.guid){Ps&&console.log("new data",this.context.connection.connectionId,this.context.time.frameCount,this.guid,e),this.receivedUpdate=!0,this._receivedFastUpdate=e.fast();const t=e.transform();if(t){hn.markDirty(this.gameObject,!0);const i=t.position();i&&(this.interpolatePosition&&this._targetPosition?.set(i.x(),i.y(),i.z()),(!this.interpolatePosition||!this._receivedDataBefore)&&this.setWorldPosition(i.x(),i.y(),i.z()));const n=t.rotation();n&&(this.tempEuler.set(n.x(),n.y(),n.z()),this.interpolateRotation&&this._targetRotation.setFromEuler(this.tempEuler),(!this.interpolateRotation||!this._receivedDataBefore)&&Jm(this.gameObject,this.tempEuler));const s=t.scale();s&&this.gameObject.scale.set(s.x(),s.y(),s.z())}this._receivedDataBefore=!0}}onEnable(){this.lastPosition.copy(this.worldPosition),this.lastRotation.copy(this.worldQuaternion),this.lastScale.copy(this.gameObject.scale),this._needsUpdate=!0,this._model&&this._model.updateIsOwned()}onDisable(){this._model&&this._model.freeOwnership()}receivedUpdate=!1;lastPosition;lastRotation;lastScale;onBeforeRender(){if(!this.activeAndEnabled||!this.context.connection.isConnected)return;if(!this.context.connection.isInRoom||!this._model){Ps&&console.log("no model or room",this.name,this.guid,this.context.connection.isInRoom);return}this._shouldRequestOwnership&&(this._shouldRequestOwnership=!1,this._model.requestOwnership());const e=this.worldPosition,t=this.worldQuaternion,i=this.gameObject.scale;if(this._model.isOwned&&!this.receivedUpdate){const r=this._model.hasOwnership||this.fastMode?1e-4:.001;(e.distanceTo(this.lastPosition)>r||t.angleTo(this.lastRotation)>r||i.distanceTo(this.lastScale)>r)&&(this._model.hasOwnership?this._needsUpdate=!0:(Ps&&console.log(this.guid,"reset because not owned but",this.gameObject.name,this.lastPosition),this.worldPosition=this.lastPosition,e.copy(this.lastPosition),this.worldQuaternion=this.lastRotation,t.copy(this.lastRotation),this.gameObject.scale.copy(this.lastScale),hn.markDirty(this.gameObject,!0),this._needsUpdate=!1))}if(this._model&&!this._model.hasOwnership&&this._model.isOwned&&this._receivedDataBefore){const r=this._receivedFastUpdate||this.fastMode?.5:.3;let a=!1;if(this.interpolatePosition&&this._targetPosition){const l=this.worldPosition;l.lerp(this._targetPosition,r),this.worldPosition=l,a=!0}if(this.interpolateRotation&&this._targetRotation){const l=this.worldQuaternion;l.slerp(this._targetRotation,r),this.worldQuaternion=l,a=!0}a&&hn.markDirty(this.gameObject,!0)}if(this.receivedUpdate=!1,this.lastPosition.copy(e),this.lastRotation.copy(t),this.lastScale.copy(i),!this._model||!this._model||this._model.hasOwnership===void 0||!this._model.hasOwnership)return;this.rb&&this.overridePhysics&&this._wasKinematic!==void 0&&(Ps&&console.log("reset kinematic",this.rb.name,this._wasKinematic),this.rb.isKinematic=this._wasKinematic);const n=10,s=this.rb||this.fastMode;if(this._needsUpdate&&(this.context.time.frameCount%n===0||s)){if(yf++,s&&Uc>0&&this.context.time.frameCount%Uc!==0)return;Ps&&console.debug("[SyncedTransform] Send update",this.context.connection.connectionId,this.guid,this.gameObject.name,this.gameObject.guid),this._needsUpdate=!1;const r=Dw(this.guid,this,!!s);this.context.connection.sendBinary(r)}}}class ud{event;get deviceIndex(){return this.event.deviceIndex}get pointerId(){return this.event.pointerId}button;buttonName;get pressure(){return this.event.pressure}get used(){return this._used}_used=!1;use(){this._used||(this._used=!0,this.event.use())}_propagationStopped=!1;get propagationStopped(){return this._propagationStopped}stopPropagation(){this._propagationStopped=!0,this.event.stopImmediatePropagation()}stopImmediatePropagation(){this._propagationStopped=!0,this.event.stopImmediatePropagation()}z__pointer_ctured=!1;setPointerCapture(){this.z__pointer_ctured=!0}z__pointer_cture_rleased=!1;releasePointerCapture(){this.z__pointer_cture_rleased=!0}inputSource;get mode(){return this.event.mode}object;point;normal;face;distance;instanceId;intersection;isDown;isUp;isPressed;isClick;isDoubleClick;input;constructor(e,t){this.event=t,this.input=e,this.button=t.button}clone(){const e=new ud(this.input,this.event);return Object.assign(e,this),e}Use(){this.use()}StopPropagation(){this.event.stopImmediatePropagation()}}function Tu(o,e){return x.foreachComponent(o,t=>{if(!t.enabled)return;const i=t;if(e)switch(e){case"pointerdown":if(i.onPointerDown)return!0;break;case"pointerup":if(i.onPointerUp||i.onPointerClick)return!0;break;case"pointermove":if(i.onPointerEnter||i.onPointerExit||i.onPointerMove)return!0;break}else if(i.onPointerDown||i.onPointerUp||i.onPointerEnter||i.onPointerExit||i.onPointerClick)return!0},!1)===!0}const Lo=new Array;class jo{enabled=!0;target;methodName;arguments;get canClone(){return this.target instanceof Object}constructor(e,t,i,n){this.target=e,this.methodName=t||null,this.arguments=i,n!=null&&(this.enabled=n)}invoke(...e){if(this.enabled!==!1){if(typeof this.target=="function")this.arguments?(Lo.length=0,e!==void 0&&e.length>0&&Lo.push(...e),Lo.push(...this.arguments),this.target(...this.arguments),Lo.length=0):this.target(...e);else if(this.methodName!=null){const t=this.target[this.methodName];typeof t=="function"?this.arguments?(Lo.length=0,e!==void 0&&e.length>0&&Lo.push(...e),Lo.push(...this.arguments),t.call(this.target,...Lo),Lo.length=0):t.call(this.target,...e):this.arguments?this.target[this.methodName]=this.arguments[0]||e[0]:this.target[this.methodName]=e[0]}}}}const yR=o=>/^[A-Z]*$/.test(o);class Eu extends Event{args}class he{isEventList=!0;__internalOnInstantiate(e){const t=new Array;for(let i=0;i<this.methods.length;i++){const n=this.methods[i];if(!(n.target instanceof Function)){const s=n.target;let r=s?.uuid;if(s&&(r=s.guid),r){const a=e[r];if(a){const l=n.arguments?.map(c=>c instanceof Object&&c.uuid?e[c.uuid]:c?.isComponent?e[c.guid]:c);t.push(new jo(a.clone,n.methodName,l,n.enabled))}else A()&&console.warn("Could not find target for event listener")}}}return new he(t)}target;key;setEventTarget(e,t){if(this.key=e,this.target=t,this.key!==void 0){let i="",n=!1;for(const s of this.key)n&&yR(s)&&(i+="-"),n=!0,i+=s.toLowerCase();this.key=i}}get listenerCount(){return this.methods?.length??0}get isInvoking(){return this._isInvoking}_isInvoking=!1;methods=[];_methodsCopy=[];static from(...e){return new he(e)}constructor(e){if(this.methods=[],Array.isArray(e))for(const t of e)t instanceof jo?this.methods.push(t):typeof t=="function"&&this.methods.push(new jo(t));else typeof e=="function"&&this.methods.push(new jo(e))}invoke(...e){if(this._isInvoking)return console.warn("Circular event invocation detected. Please check your event listeners for circular references.",this),!1;if(this.methods?.length<=0)return!1;this._isInvoking=!0;try{this._methodsCopy.length=0,this._methodsCopy.push(...this.methods);for(const t of this._methodsCopy)t.invoke(...e);if(typeof this.target=="object"&&typeof this.key=="string"){const t=this.target.dispatchEvent;if(typeof t=="function"){const i=new Eu(this.key);i.args=e,t.call(this.target,i)}}}finally{this._isInvoking=!1,this._methodsCopy.length=0}return!0}addEventListener(e){return this.methods.push(new jo(e)),e}removeEventListener(e){if(e)for(let t=this.methods.length-1;t>=0;t--)this.methods[t].target===e&&(this.methods[t].enabled=!1,this.methods.splice(t,1))}removeAllEventListeners(){this.methods.length=0}}class bR extends Xi{constructor(){super([ne,oe],"ColorSerializer")}onDeserialize(e){if(e!=null)return e.a!==void 0?new oe(e.r,e.g,e.b,e.a):e.alpha!==void 0?new oe(e.r,e.g,e.b,e.alpha):new ne(e.r,e.g,e.b)}onSerialize(e){if(e!=null)return e.a!==void 0?{r:e.r,g:e.g,b:e.b,a:e.a}:{r:e.r,g:e.g,b:e.b}}}const _R=new bR;class vR extends Xi{constructor(){super([ot],"EulerSerializer")}onDeserialize(e,t){if(e!=null){if(e.order)return new ot(e.x,e.y,e.z,e.order);if(e.x!=null)return new ot(e.x,e.y,e.z)}}onSerialize(e,t){return{x:e.x,y:e.y,z:e.z,order:e.order}}}const wR=new vR;class xR extends Xi{constructor(){super(k,"ObjectSerializer")}onSerialize(e,t){if(t.objectToNode!==void 0&&e.uuid){const i=t.objectToNode[e.uuid];return ft&&console.log(i,e.name,e.uuid),{node:i}}}onDeserialize(e,t){if(typeof e=="string"){if(e.endsWith(".glb")||e.endsWith(".gltf")){if(t.serializable instanceof Array&&t.serializable.includes(ie))return;A()&&ye("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");const i=t.target?.constructor?.name;console.warn(`Wrong usage of @serializable detected in your script "${i}"
950
+ `;function Lw(o){if(Z.active)return console.warn("[OrbitControls] Can not fit camera while XR session is active"),null;const e=z.Current;if(!e)return console.warn("[OrbitControls] No context found"),null;const t=o?.camera||e.mainCamera;if(!t)return console.warn("No camera or controls found to fit camera to objects..."),null;o||(o={}),o.autoApply=o.autoApply!==!1,o.minZoom||=0,o.maxZoom||=1/0;const{centerCamera:i,cameraNearFar:n="auto",fitOffset:s=1.1,fov:r=t instanceof re?t?.fov:-1}=o,a=new b,l=new b,c=t instanceof re?t.aspect:1,h=o.objects||e.scene,d=Xt(h,void 0,t?.layers),p=d.clone();d.getCenter(l);const m=new b;if(d.getSize(m),t instanceof re&&t.updateProjectionMatrix(),t.updateMatrixWorld(),d.applyMatrix4(t.matrixWorldInverse),d.getSize(a),d.setFromCenterAndSize(l,a),Number.isNaN(a.x)||Number.isNaN(a.y)||Number.isNaN(a.z))return console.warn("Camera fit size resultet in NaN",t,d),null;if(a.length()<=1e-10)return console.warn("Camera fit size is zero",d),null;const f=r,g=2*Math.atan(Math.tan(f*Math.PI/360/2)*c)/Math.PI*360,y=a.y/(2*Math.atan(Math.PI*f/360)),_=a.x/(2*Math.atan(Math.PI*g/360)),w=s*Math.max(y,_)+a.z/2;o.maxZoom=w*10,o.minZoom=w*.01,o.debug===!0&&console.log("Fit camera to objects",{fitHeightDistance:y,fitWidthDistance:_,distance:w,verticalFov:f,horizontalFov:g});const P=.05,M=l.clone();if(M.y-=a.y*P,o.targetOffset&&(o.targetOffset.x!==void 0&&(M.x+=o.targetOffset.x),o.targetOffset.y!==void 0&&(M.y+=o.targetOffset.y),o.targetOffset.z!==void 0&&(M.z+=o.targetOffset.z)),o.relativeTargetOffset&&(o.relativeTargetOffset.x!==void 0&&(M.x+=o.relativeTargetOffset.x*a.x),o.relativeTargetOffset.y!==void 0&&(M.y+=o.relativeTargetOffset.y*a.y),o.relativeTargetOffset.z!==void 0&&(M.z+=o.relativeTargetOffset.z*a.z)),n==null||n=="auto"){const I=$a(Yn),N=I?I.radius:0,V=Math.max(m.x,m.y,m.z,N);t instanceof re&&(t.near=w/100,t.far=V+w*10,t.updateProjectionMatrix()),I&&(o.maxZoom=Math.max(Math.min(o.maxZoom,N*.5),w))}o.currentZoom!==void 0&&(o.currentZoom<o.minZoom&&(o.minZoom=o.currentZoom*.9),o.currentZoom>o.maxZoom&&(o.maxZoom=o.currentZoom*1.1));const O=l.clone();o.fitDirection?O.sub(new b().copy(o.fitDirection).multiplyScalar(1e6)):O.sub(t.worldPosition),i==="y"&&(O.y=0),O.normalize(),O.multiplyScalar(w),i==="y"&&(O.y+=-P*4*w);let j=l.clone().sub(O);return o.cameraOffset&&(o.cameraOffset.x!==void 0&&(j.x+=o.cameraOffset.x),o.cameraOffset.y!==void 0&&(j.y+=o.cameraOffset.y),o.cameraOffset.z!==void 0&&(j.z+=o.cameraOffset.z)),o.relativeCameraOffset&&(o.relativeCameraOffset.x!==void 0&&(j.x+=o.relativeCameraOffset.x*a.x),o.relativeCameraOffset.y!==void 0&&(j.y+=o.relativeCameraOffset.y*a.y),o.relativeCameraOffset.z!==void 0&&(j.z+=o.relativeCameraOffset.z*a.z)),t.parent&&(j=t.parent.worldToLocal(j)),o.debug&&(B.DrawWireBox3(d,16777011,10),B.DrawWireBox3(p,65280,10)),o.autoApply&&(t.position.copy(j),t.lookAt(M),r>0&&t instanceof re&&(t.fov=r,t.updateProjectionMatrix())),{camera:t,position:j,lookAt:M,fov:o.fov}}var dR=Object.defineProperty,ff=(o,e,t,i)=>{for(var n=void 0,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=r(e,t,n)||n);return n&&dR(e,t,n),n};class jr extends R{constraintActive=!0;locked=!1;sources=[];setConstraintPosition(e){const t=this.sources[0];t&&(t.worldPosition=e)}}ff([u()],jr.prototype,"constraintActive"),ff([u()],jr.prototype,"locked"),ff([u(k)],jr.prototype,"sources");let Dr=class{bb=null;bb_pos=0;__init(o,e){return this.bb_pos=o,this.bb=e,this}x(){return this.bb.readFloat32(this.bb_pos)}y(){return this.bb.readFloat32(this.bb_pos+4)}z(){return this.bb.readFloat32(this.bb_pos+8)}static sizeOf(){return 12}static createVec3(o,e,t,i){return o.prep(4,12),o.writeFloat32(i),o.writeFloat32(t),o.writeFloat32(e),o.offset()}};class jw{bb=null;bb_pos=0;__init(e,t){return this.bb_pos=e,this.bb=t,this}position(e){return(e||new Dr).__init(this.bb_pos,this.bb)}rotation(e){return(e||new Dr).__init(this.bb_pos+12,this.bb)}scale(e){return(e||new Dr).__init(this.bb_pos+24,this.bb)}static sizeOf(){return 36}static createTransform(e,t,i,n,s,r,a,l,c,h){return e.prep(4,36),e.prep(4,12),e.writeFloat32(h),e.writeFloat32(c),e.writeFloat32(l),e.prep(4,12),e.writeFloat32(a),e.writeFloat32(r),e.writeFloat32(s),e.prep(4,12),e.writeFloat32(n),e.writeFloat32(i),e.writeFloat32(t),e.offset()}}class as{bb=null;bb_pos=0;__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSyncedTransformModel(e,t){return(t||new as).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSyncedTransformModel(e,t){return e.setPosition(e.position()+Pb),(t||new as).__init(e.readInt32(e.position())+e.position(),e)}guid(e){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}fast(){const e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}transform(e){const t=this.bb.__offset(this.bb_pos,8);return t?(e||new jw).__init(this.bb_pos+t,this.bb):null}dontSave(){const e=this.bb.__offset(this.bb_pos,10);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startSyncedTransformModel(e){e.startObject(4)}static addGuid(e,t){e.addFieldOffset(0,t,0)}static addFast(e,t){e.addFieldInt8(1,+t,0)}static addTransform(e,t){e.addFieldStruct(2,t,0)}static addDontSave(e,t){e.addFieldInt8(3,+t,0)}static endSyncedTransformModel(e){return e.endObject()}static finishSyncedTransformModelBuffer(e,t){e.finish(t)}static finishSizePrefixedSyncedTransformModelBuffer(e,t){e.finish(t,void 0,!0)}}var E;(o=>{(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./rapier-DJ-luMxr.min.js");return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.RAPIER_PHYSICS||(o.RAPIER_PHYSICS={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./postprocessing-B5ksn9-G.min.js").then(r=>r.index);return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.POSTPROCESSING||(o.POSTPROCESSING={})),(e=>{e.MAYBEMODULE=null;const t=[];function i(){return e.MODULE?Promise.resolve(e.MODULE):new Promise(s=>{t.push(s)})}e.ready=i;async function n(){if(e.MODULE)return e.MODULE;const s=await import("./postprocessing-B5ksn9-G.min.js").then(r=>r.N8AO);return e.MODULE=s,e.MAYBEMODULE=s,t.forEach(r=>r(s)),t.length=0,s}e.load=n})(o.POSTPROCESSING_AO||(o.POSTPROCESSING_AO={}))})(E||(E={}));var bt=(o=>(o[o.Average=0]="Average",o[o.Multiply=1]="Multiply",o[o.Minimum=2]="Minimum",o[o.Maximum=3]="Maximum",o))(bt||{}),Ru=(o=>(o[o.Discrete=0]="Discrete",o[o.Continuous=1]="Continuous",o))(Ru||{}),Xe=(o=>(o[o.None=0]="None",o[o.FreezePositionX=2]="FreezePositionX",o[o.FreezePositionY=4]="FreezePositionY",o[o.FreezePositionZ=8]="FreezePositionZ",o[o.FreezePosition=14]="FreezePosition",o[o.FreezeRotationX=16]="FreezeRotationX",o[o.FreezeRotationY=32]="FreezeRotationY",o[o.FreezeRotationZ=64]="FreezeRotationZ",o[o.FreezeRotation=112]="FreezeRotation",o[o.FreezeAll=126]="FreezeAll",o))(Xe||{}),Za=(o=>(o[o.None=0]="None",o[o.X=2]="X",o[o.Y=4]="Y",o[o.Z=8]="Z",o[o.All=-1]="All",o))(Za||{});const kt=function(o,e){return function(t,i,n){uR(t,i,n,o,e)}};function uR(o,e,t,i,n){if(!n&&!i&&!o.onValidate)return;if(t!==void 0){console.error("Invalid usage of validate decorator. Only fields can be validated.",o,e,t),Te("Invalid usage of validate decorator. Only fields can be validated. Property: "+e,Oi.Error);return}let s="";if(typeof e=="string"?s=e:s=e.name,o.__internalAwake){const r=Symbol(s),a=o.__internalAwake;o.__internalAwake=function(){if(!this.onValidate){A()&&console.warn('Usage of @validate decorate detected but there is no onValidate method in your class: "'+o.constructor?.name+'"');return}if(this[r]===void 0){this[r]=this[s];const l=this[s];if(l instanceof ee||l instanceof b||l instanceof pe||l instanceof U){const c=this[s];Rd(c,()=>{this.onValidate(s)})}Object.defineProperty(this,s,{set:function(c){if(this[Gg]===!0)this[r]=c;else{i?.call(this,c);const h=this[r];this[r]=c,this.onValidate?.call(this,s,h)}},get:function(){return n?.call(this),this[r]}})}a.call(this)}}}const pR=function(o){return function(e,t,i){let n="";typeof t=="string"?n=t:n=t.name;const s=o.prototype,r=Object.getOwnPropertyDescriptor(s,n);if(!r?.value){console.warn("Can not apply prefix: type does not have method named",t,o);return}const a=r.value,l=e[n];Object.defineProperty(s,n,{value:function(...c){const h=l?.call(this,...c);if(h instanceof Promise){h.then(d=>{if(d!==!1)return a.call(this,...c)});return}if(h!==!1)return a.call(this,...c)}})}};var mR=Object.defineProperty,gR=Object.getOwnPropertyDescriptor,Mi=(o,e,t,i)=>{for(var n=i>1?void 0:i?gR(e,t):e,s=o.length-1,r;s>=0;s--)(r=o[s])&&(n=(i?r(e,t,n):r(n))||n);return i&&n&&mR(e,t,n),n};class fR{get isDirty(){return this.positionChanged||this.rotationChanged}positionChanged=!1;rotationChanged=!1;position;quaternion;_positionKeys=["x","y","z"];_quaternionKeys=["_x","_y","_z","_w"];reset(e=!1){if(this.positionChanged=!1,this.rotationChanged=!1,this.mute=!1,e){if(this.position)for(const t of this._positionKeys)delete this.position[t];if(this.quaternion)for(const t of this._quaternionKeys)delete this.quaternion[t]}}syncValues(){for(const e of this._positionKeys)this.position[e]=this.obj.position[e];for(const e of this._quaternionKeys)this.quaternion[e]=this.obj.quaternion[e]}mute=!1;applyValues(){if(this.positionChanged&&this.position)for(const e of this._positionKeys){const t=this.position[e];t!==void 0&&(this.obj.position[e]=t)}if(this.rotationChanged&&this.quaternion)for(const e of this._quaternionKeys){const t=this.quaternion[e];t!==void 0&&(this.obj.quaternion[e]=t)}}context;obj;_positionWatch;_rotationWatch;constructor(e,t){this.context=t,this.obj=e}start(e,t){this.reset(),e&&(this._positionWatch||(this._positionWatch=new rs(this.obj.position,["x","y","z"])),this._positionWatch.apply(),this.position={},this._positionWatch.subscribeWrite((s,r)=>{if(this.context.physics.engine?.isUpdating||this.mute)return;const a=this.position[r];Math.abs(a-s)<1e-5||(this.position[r]=s,this.positionChanged=!0)})),t&&(this._rotationWatch||(this._rotationWatch=new rs(this.obj.quaternion,["_x","_y","_z","_w"])),this._rotationWatch.apply(),this.quaternion={},this._rotationWatch.subscribeWrite((s,r)=>{if(this.context.physics.engine?.isUpdating||this.mute)return;const a=this.quaternion[r];Math.abs(a-s)<1e-5||(this.quaternion[r]=s,this.rotationChanged=!0)}));const i=this.obj.matrixWorld.multiplyMatrices.bind(this.obj.matrixWorld),n=new K;this.obj.matrixWorld.multiplyMatrices=(s,r)=>(this.context.physics.engine?.isUpdating||this.mute||n.equals(s)||(this.positionChanged=!0,this.rotationChanged=!0,n.copy(s)),i(s,r))}stop(){this._positionWatch?.revoke(),this._rotationWatch?.revoke()}}const ci=class om extends R{get isRigidbody(){return!0}autoMass=!0;set mass(e){e!==this._mass&&(this._mass=e,this._propertiesChanged=!0,this.__didAwake&&(this.autoMass=!1))}get mass(){return this.autoMass?this.context.physics.engine?.getBody(this)?.mass()??-1:this._mass}_mass=0;useGravity=!0;centerOfMass=new b(0,0,0);constraints=Xe.None;isKinematic=!1;drag=0;angularDrag=1;detectCollisions=!0;sleepThreshold=.01;collisionDetectionMode=Ru.Discrete;get lockPositionX(){return(this.constraints&Xe.FreezePositionX)!==0}get lockPositionY(){return(this.constraints&Xe.FreezePositionY)!==0}get lockPositionZ(){return(this.constraints&Xe.FreezePositionZ)!==0}get lockRotationX(){return(this.constraints&Xe.FreezeRotationX)!==0}get lockRotationY(){return(this.constraints&Xe.FreezeRotationY)!==0}get lockRotationZ(){return(this.constraints&Xe.FreezeRotationZ)!==0}set lockPositionX(e){e?this.constraints|=Xe.FreezePositionX:this.constraints&=~Xe.FreezePositionX}set lockPositionY(e){e?this.constraints|=Xe.FreezePositionY:this.constraints&=~Xe.FreezePositionY}set lockPositionZ(e){e?this.constraints|=Xe.FreezePositionZ:this.constraints&=~Xe.FreezePositionZ}set lockRotationX(e){e?this.constraints|=Xe.FreezeRotationX:this.constraints&=~Xe.FreezeRotationX}set lockRotationY(e){e?this.constraints|=Xe.FreezeRotationY:this.constraints&=~Xe.FreezeRotationY}set lockRotationZ(e){e?this.constraints|=Xe.FreezeRotationZ:this.constraints&=~Xe.FreezeRotationZ}set gravityScale(e){this._gravityScale=e}get gravityScale(){return this._gravityScale}_gravityScale=1;dominanceGroup=0;static tempPosition=new b;_propertiesChanged=!1;_currentVelocity=new b;_smoothedVelocity=new b;_smoothedVelocityGetter=new b;_lastPosition=new b;_watch;awake(){this._watch=void 0,this._propertiesChanged=!1}onEnable(){this._watch||(this._watch=new fR(this.gameObject,this.context)),this._watch.start(!0,!0),this.startCoroutine(this.beforePhysics(),we.LateUpdate),A()&&(globalThis.NEEDLE_USE_RAPIER?E.RAPIER_PHYSICS.ready().then(async()=>{await ic(3),this.context.physics.engine?.getBody(this)||console.warn(`Rigidbody could not be created. Ensure "${this.name}" has a Collider component.`)}):console.warn("Rigidbody could not be created: Rapier physics are explicitly disabled."))}onDisable(){this._watch?.stop(),this.context.physics.engine?.removeBody(this)}onDestroy(){this.context.physics.engine?.removeBody(this)}onValidate(){this._propertiesChanged=!0}*beforePhysics(){for(;;)this._propertiesChanged&&(this._propertiesChanged=!1,this.context.physics.engine?.updateProperties(this)),this._watch?.isDirty?(this._watch.mute=!0,this._watch.applyValues(),this.context.physics.engine?.updateBody(this,this._watch.positionChanged,this._watch.rotationChanged),this._watch.reset()):this._watch?.syncValues(),this.captureVelocity(),yield}teleport(e,t=!0){this._watch?.reset(!0),t?this.gameObject.position.set(e.x,e.y,e.z):this.setWorldPosition(e.x,e.y,e.z),this.resetForcesAndTorques(),this.resetVelocities()}resetForces(e=!0){this.context.physics.engine?.resetForces(this,e)}resetTorques(e=!0){this.context.physics.engine?.resetTorques(this,e)}resetVelocities(){this.setVelocity(0,0,0),this.setAngularVelocity(0,0,0)}resetForcesAndTorques(){this.resetForces(),this.resetTorques()}wakeUp(){this.context.physics.engine?.wakeup(this)}get isSleeping(){return this.context.physics.engine?.isSleeping(this)}updateProperties(){return this._propertiesChanged=!1,this.context.physics.engine?.updateProperties(this)}applyForce(e,t,i=!0){this._propertiesChanged&&this.updateProperties(),this.context.physics.engine?.addForce(this,e,i)}applyImpulse(e,t=!0){this._propertiesChanged&&this.updateProperties(),this.context.physics.engine?.applyImpulse(this,e,t)}setForce(e,t,i,n=!0){this.context.physics.engine?.resetForces(this,n),typeof e=="number"?(t??=0,i??=0,this.context.physics.engine?.addForce(this,{x:e,y:t,z:i},n)):this.context.physics.engine?.addForce(this,e,n)}getVelocity(){const e=this.context.physics.engine?.getLinearVelocity(this);return e?(this._currentVelocity.x=e.x,this._currentVelocity.y=e.y,this._currentVelocity.z=e.z,this._currentVelocity):this._currentVelocity.set(0,0,0)}setVelocity(e,t,i,n=!0){if(e instanceof b){const s=e;this.context.physics.engine?.setLinearVelocity(this,s,n);return}t===void 0||i===void 0||this.context.physics.engine?.setLinearVelocity(this,{x:e,y:t,z:i},n)}getAngularVelocity(){const e=this.context.physics.engine?.getAngularVelocity(this);return e?(this._currentVelocity.x=e.x,this._currentVelocity.y=e.y,this._currentVelocity.z=e.z,this._currentVelocity):this._currentVelocity.set(0,0,0)}setAngularVelocity(e,t,i,n=!0){if(typeof e=="object"){const s=e;this.context.physics.engine?.setAngularVelocity(this,s,n);return}if(t===void 0||i===void 0||typeof t=="boolean"){console.warn("setAngularVelocity expects either a Vec3 or 3 numbers");return}this.context.physics.engine?.setAngularVelocity(this,{x:e,y:t,z:i},n)}setTorque(e,t,i){typeof e=="number"?this.setAngularVelocity(e,t,i):this.setAngularVelocity(e)}get smoothedVelocity(){return this._smoothedVelocityGetter.copy(this._smoothedVelocity),this._smoothedVelocityGetter.multiplyScalar(1/this.context.time.deltaTime)}setBodyFromGameObject(e=null){}captureVelocity(){const e=this.gameObject.matrixWorld;om.tempPosition.setFromMatrixPosition(e);const t=om.tempPosition.sub(this._lastPosition);this._lastPosition.copy(om.tempPosition),this._smoothedVelocity.lerp(t,this.context.time.deltaTime/.1)}};Mi([kt()],ci.prototype,"autoMass",2),Mi([u()],ci.prototype,"mass",1),Mi([kt(),u()],ci.prototype,"useGravity",2),Mi([u(b)],ci.prototype,"centerOfMass",2),Mi([kt(),u()],ci.prototype,"constraints",2),Mi([kt(),u()],ci.prototype,"isKinematic",2),Mi([kt(),u()],ci.prototype,"drag",2),Mi([kt(),u()],ci.prototype,"angularDrag",2),Mi([kt(),u()],ci.prototype,"detectCollisions",2),Mi([kt(),u()],ci.prototype,"sleepThreshold",2),Mi([kt(),u()],ci.prototype,"collisionDetectionMode",2),Mi([kt()],ci.prototype,"_gravityScale",2),Mi([kt()],ci.prototype,"dominanceGroup",2);let Ze=ci;new b,new b;const Ps=v("debugsync"),Fc="STRS";mg(Fc,as.getRootAsSyncedTransformModel);const Zn=new Rm;function Dw(o,e,t=!0){Zn.clear();const i=Zn.createString(o);as.startSyncedTransformModel(Zn),as.addGuid(Zn,i),as.addFast(Zn,t);const n=e.worldPosition,s=e.worldEuler,r=e.gameObject.scale;as.addTransform(Zn,jw.createTransform(Zn,n.x,n.y,n.z,s.x,s.y,s.z,r.x,r.y,r.z));const a=as.endSyncedTransformModel(Zn);return Zn.finish(a,Fc),Zn.asUint8Array()}let yf=0,Uc=0;_w(o=>{const e=o.connection.currentServerUrl?.includes("glitch")?10:40;Uc=Math.floor(yf/e),yf=0,Ps&&Uc>0&&console.log("Sync Transform Fast Interval",Uc)});class Pn extends R{overridePhysics=!0;interpolatePosition=!0;interpolateRotation=!0;fastMode=!1;syncDestroy=!1;_model=null;_needsUpdate=!0;rb=null;_wasKinematic=!1;_receivedDataBefore=!1;_targetPosition;_targetRotation;_receivedFastUpdate=!1;_shouldRequestOwnership=!1;requestOwnership(){Ps&&console.log("Request ownership"),this._model?this._model.requestOwnership():(this._shouldRequestOwnership=!0,this._needsUpdate=!0)}freeOwnership(){this._model?.freeOwnership()}hasOwnership(){return this._model?.hasOwnership??void 0}isOwned(){return this._model?.isOwned}joinedRoomCallback=null;receivedDataCallback=null;awake(){Ps&&console.log("new instance",this.guid,this),this._receivedDataBefore=!1,this._targetPosition=new b,this._targetRotation=new U,this.lastPosition=new b,this.lastRotation=new U,this.lastScale=new b,this.rb=x.getComponentInChildren(this.gameObject,Ze),this.rb&&(this._wasKinematic=this.rb.isKinematic),this.receivedUpdate=!0,this._model=new fg(this.context.connection,this.guid),this.context.connection.isConnected&&this.tryGetLastState(),this.joinedRoomCallback=this.tryGetLastState.bind(this),this.context.connection.beginListen(te.JoinedRoom,this.joinedRoomCallback),this.receivedDataCallback=this.onReceivedData.bind(this),this.context.connection.beginListenBinary(Fc,this.receivedDataCallback)}onDestroy(){this.syncDestroy&&Dg(this.guid,this.context.connection),this._model=null,this.context.connection.stopListen(te.JoinedRoom,this.joinedRoomCallback),this.context.connection.stopListenBinary(Fc,this.receivedDataCallback)}tryGetLastState(){const e=this.context.connection.tryGetState(this.guid);e&&this.onReceivedData(e)}tempEuler=new ot;onReceivedData(e){if(!this.destroyed&&typeof e.guid=="function"&&e.guid()===this.guid){Ps&&console.log("new data",this.context.connection.connectionId,this.context.time.frameCount,this.guid,e),this.receivedUpdate=!0,this._receivedFastUpdate=e.fast();const t=e.transform();if(t){hn.markDirty(this.gameObject,!0);const i=t.position();i&&(this.interpolatePosition&&this._targetPosition?.set(i.x(),i.y(),i.z()),(!this.interpolatePosition||!this._receivedDataBefore)&&this.setWorldPosition(i.x(),i.y(),i.z()));const n=t.rotation();n&&(this.tempEuler.set(n.x(),n.y(),n.z()),this.interpolateRotation&&this._targetRotation.setFromEuler(this.tempEuler),(!this.interpolateRotation||!this._receivedDataBefore)&&Jm(this.gameObject,this.tempEuler));const s=t.scale();s&&this.gameObject.scale.set(s.x(),s.y(),s.z())}this._receivedDataBefore=!0}}onEnable(){this.lastPosition.copy(this.worldPosition),this.lastRotation.copy(this.worldQuaternion),this.lastScale.copy(this.gameObject.scale),this._needsUpdate=!0,this._model&&this._model.updateIsOwned()}onDisable(){this._model&&this._model.freeOwnership()}receivedUpdate=!1;lastPosition;lastRotation;lastScale;onBeforeRender(){if(!this.activeAndEnabled||!this.context.connection.isConnected)return;if(!this.context.connection.isInRoom||!this._model){Ps&&console.log("no model or room",this.name,this.guid,this.context.connection.isInRoom);return}this._shouldRequestOwnership&&(this._shouldRequestOwnership=!1,this._model.requestOwnership());const e=this.worldPosition,t=this.worldQuaternion,i=this.gameObject.scale;if(this._model.isOwned&&!this.receivedUpdate){const r=this._model.hasOwnership||this.fastMode?1e-4:.001;(e.distanceTo(this.lastPosition)>r||t.angleTo(this.lastRotation)>r||i.distanceTo(this.lastScale)>r)&&(this._model.hasOwnership?this._needsUpdate=!0:(Ps&&console.log(this.guid,"reset because not owned but",this.gameObject.name,this.lastPosition),this.worldPosition=this.lastPosition,e.copy(this.lastPosition),this.worldQuaternion=this.lastRotation,t.copy(this.lastRotation),this.gameObject.scale.copy(this.lastScale),hn.markDirty(this.gameObject,!0),this._needsUpdate=!1))}if(this._model&&!this._model.hasOwnership&&this._model.isOwned&&this._receivedDataBefore){const r=this._receivedFastUpdate||this.fastMode?.5:.3;let a=!1;if(this.interpolatePosition&&this._targetPosition){const l=this.worldPosition;l.lerp(this._targetPosition,r),this.worldPosition=l,a=!0}if(this.interpolateRotation&&this._targetRotation){const l=this.worldQuaternion;l.slerp(this._targetRotation,r),this.worldQuaternion=l,a=!0}a&&hn.markDirty(this.gameObject,!0)}if(this.receivedUpdate=!1,this.lastPosition.copy(e),this.lastRotation.copy(t),this.lastScale.copy(i),!this._model||!this._model||this._model.hasOwnership===void 0||!this._model.hasOwnership)return;this.rb&&this.overridePhysics&&this._wasKinematic!==void 0&&(Ps&&console.log("reset kinematic",this.rb.name,this._wasKinematic),this.rb.isKinematic=this._wasKinematic);const n=10,s=this.rb||this.fastMode;if(this._needsUpdate&&(this.context.time.frameCount%n===0||s)){if(yf++,s&&Uc>0&&this.context.time.frameCount%Uc!==0)return;Ps&&console.debug("[SyncedTransform] Send update",this.context.connection.connectionId,this.guid,this.gameObject.name,this.gameObject.guid),this._needsUpdate=!1;const r=Dw(this.guid,this,!!s);this.context.connection.sendBinary(r)}}}class ud{event;get deviceIndex(){return this.event.deviceIndex}get pointerId(){return this.event.pointerId}button;buttonName;get pressure(){return this.event.pressure}get used(){return this._used}_used=!1;use(){this._used||(this._used=!0,this.event.use())}_propagationStopped=!1;get propagationStopped(){return this._propagationStopped}stopPropagation(){this._propagationStopped=!0,this.event.stopImmediatePropagation()}stopImmediatePropagation(){this._propagationStopped=!0,this.event.stopImmediatePropagation()}z__pointer_ctured=!1;setPointerCapture(){this.z__pointer_ctured=!0}z__pointer_cture_rleased=!1;releasePointerCapture(){this.z__pointer_cture_rleased=!0}inputSource;get mode(){return this.event.mode}object;point;normal;face;distance;instanceId;intersection;isDown;isUp;isPressed;isClick;isDoubleClick;input;constructor(e,t){this.event=t,this.input=e,this.button=t.button}clone(){const e=new ud(this.input,this.event);return Object.assign(e,this),e}Use(){this.use()}StopPropagation(){this.event.stopImmediatePropagation()}}function Tu(o,e){return x.foreachComponent(o,t=>{if(!t.enabled)return;const i=t;if(e)switch(e){case"pointerdown":if(i.onPointerDown)return!0;break;case"pointerup":if(i.onPointerUp||i.onPointerClick)return!0;break;case"pointermove":if(i.onPointerEnter||i.onPointerExit||i.onPointerMove)return!0;break}else if(i.onPointerDown||i.onPointerUp||i.onPointerEnter||i.onPointerExit||i.onPointerClick)return!0},!1)===!0}const Lo=new Array;class jo{enabled=!0;target;methodName;arguments;get canClone(){return this.target instanceof Object}constructor(e,t,i,n){this.target=e,this.methodName=t||null,this.arguments=i,n!=null&&(this.enabled=n)}invoke(...e){if(this.enabled!==!1){if(typeof this.target=="function")this.arguments?(Lo.length=0,e!==void 0&&e.length>0&&Lo.push(...e),Lo.push(...this.arguments),this.target(...this.arguments),Lo.length=0):this.target(...e);else if(this.methodName!=null){const t=this.target[this.methodName];typeof t=="function"?this.arguments?(Lo.length=0,e!==void 0&&e.length>0&&Lo.push(...e),Lo.push(...this.arguments),t.call(this.target,...Lo),Lo.length=0):t.call(this.target,...e):this.arguments?this.target[this.methodName]=this.arguments[0]||e[0]:this.target[this.methodName]=e[0]}}}}const yR=o=>/^[A-Z]*$/.test(o);class Eu extends Event{args}class he{isEventList=!0;__internalOnInstantiate(e){const t=new Array;for(let i=0;i<this.methods.length;i++){const n=this.methods[i];if(!(n.target instanceof Function)){const s=n.target;let r=s?.uuid;if(s&&(r=s.guid),r){const a=e[r];if(a){const l=n.arguments?.map(c=>c instanceof Object&&c.uuid?e[c.uuid]:c?.isComponent?e[c.guid]:c);t.push(new jo(a.clone,n.methodName,l,n.enabled))}else A()&&console.warn("Could not find target for event listener")}}}return new he(t)}target;key;setEventTarget(e,t){if(this.key=e,this.target=t,this.key!==void 0){let i="",n=!1;for(const s of this.key)n&&yR(s)&&(i+="-"),n=!0,i+=s.toLowerCase();this.key=i}}get listenerCount(){return this.methods?.length??0}get isInvoking(){return this._isInvoking}_isInvoking=!1;methods=[];_methodsCopy=[];static from(...e){return new he(e)}constructor(e){if(this.methods=[],Array.isArray(e))for(const t of e)t instanceof jo?this.methods.push(t):typeof t=="function"&&this.methods.push(new jo(t));else typeof e=="function"&&this.methods.push(new jo(e))}invoke(...e){if(this._isInvoking)return console.warn("Circular event invocation detected. Please check your event listeners for circular references.",this),!1;if(this.methods?.length<=0)return!1;this._isInvoking=!0;try{this._methodsCopy.length=0,this._methodsCopy.push(...this.methods);for(const t of this._methodsCopy)t.invoke(...e);if(typeof this.target=="object"&&typeof this.key=="string"){const t=this.target.dispatchEvent;if(typeof t=="function"){const i=new Eu(this.key);i.args=e,t.call(this.target,i)}}}finally{this._isInvoking=!1,this._methodsCopy.length=0}return!0}addEventListener(e){return this.methods.push(new jo(e)),e}removeEventListener(e){if(e)for(let t=this.methods.length-1;t>=0;t--)this.methods[t].target===e&&(this.methods[t].enabled=!1,this.methods.splice(t,1))}removeAllEventListeners(){this.methods.length=0}}class bR extends Xi{constructor(){super([ne,oe],"ColorSerializer")}onDeserialize(e){if(e!=null)return e.a!==void 0?new oe(e.r,e.g,e.b,e.a):e.alpha!==void 0?new oe(e.r,e.g,e.b,e.alpha):new ne(e.r,e.g,e.b)}onSerialize(e){if(e!=null)return e.a!==void 0?{r:e.r,g:e.g,b:e.b,a:e.a}:{r:e.r,g:e.g,b:e.b}}}const _R=new bR;class vR extends Xi{constructor(){super([ot],"EulerSerializer")}onDeserialize(e,t){if(e!=null){if(e.order)return new ot(e.x,e.y,e.z,e.order);if(e.x!=null)return new ot(e.x,e.y,e.z)}}onSerialize(e,t){return{x:e.x,y:e.y,z:e.z,order:e.order}}}const wR=new vR;class xR extends Xi{constructor(){super(k,"ObjectSerializer")}onSerialize(e,t){if(t.objectToNode!==void 0&&e.uuid){const i=t.objectToNode[e.uuid];return ft&&console.log(i,e.name,e.uuid),{node:i}}}onDeserialize(e,t){if(typeof e=="string"){if(e.endsWith(".glb")||e.endsWith(".gltf")){if(t.serializable instanceof Array&&t.serializable.includes(ie))return;A()&&ye("Detected wrong usage of @serializable with Object3D or GameObject. Instead you should use AssetReference here! Please see the console for details.");const i=t.target?.constructor?.name;console.warn(`Wrong usage of @serializable detected in your script "${i}"
952
951
 
953
952
  It looks like you used @serializable(Object3D) or @serializable(GameObject) for a prefab or scene reference which is exported to a separate glTF file.
954
953
 
@@ -6835,16 +6835,33 @@ export declare interface INeedleEngineComponent extends HTMLElement {
6835
6835
  }
6836
6836
 
6837
6837
  /**
6838
- * Interface for registering custom glTF extensions to the Needle Engine GLTFLoaders. Register your plugin via {@link addCustomExtensionPlugin}
6838
+ * Interface for registering custom glTF extensions to the Needle Engine GLTFLoaders.
6839
+ * Register your plugin using the {@link addCustomExtensionPlugin} method
6839
6840
  */
6840
6841
  export declare interface INeedleGLTFExtensionPlugin {
6841
6842
  /** The Name of your plugin */
6842
6843
  name: string;
6843
- /** Called before starting to load a glTF file. This callback can be used to add custom extensions to the GLTFLoader */
6844
+ /** Called before starting to load a glTF file. This callback can be used to add custom extensions to the [GLTFLoader](https://threejs.org/docs/#GLTFLoader.register)
6845
+ *
6846
+ * @example Add a custom extension to the GLTFloader
6847
+ * ```ts
6848
+ * onImport: (loader, url, context) => {
6849
+ * loader.register((parser) => new MyCustomExtension(parser));
6850
+ * }
6851
+ * ```
6852
+ */
6844
6853
  onImport?: OnImportCallback;
6845
- /** Called after the glTF has been loaded */
6854
+ /** Called after a glTF file has been loaded */
6846
6855
  onLoaded?: (url: string, gltf: GLTF, context: Context) => void;
6847
- /** Called before starting to export a glTF file. This callback can be used to add custom extensions to the GLTFExporter */
6856
+ /** Called before starting to export a glTF file. This callback can be used to add custom extensions to the [GLTFExporter](https://threejs.org/docs/#examples/en/exporters/GLTFExporter.register)
6857
+ *
6858
+ * @example Add a custom extension to the GLTFExporter
6859
+ * ```ts
6860
+ * onExport: (exporter, context) => {
6861
+ * exporter.register((writer) => new MyCustomExportExtension(writer));
6862
+ * }
6863
+ *
6864
+ */
6848
6865
  onExport?: OnExportCallback;
6849
6866
  }
6850
6867
 
@@ -10802,9 +10819,15 @@ export declare class OneEuroFilterXYZ {
10802
10819
  reset(value?: Vec3): void;
10803
10820
  }
10804
10821
 
10805
- declare type OnExportCallback = (exporter: GLTFExporter, context: Context) => void;
10822
+ /**
10823
+ * Callback type for glTF export plugins. See {@link INeedleGLTFExtensionPlugin.onExport}
10824
+ */
10825
+ export declare type OnExportCallback = (exporter: GLTFExporter, context: Context) => void;
10806
10826
 
10807
- declare type OnImportCallback = (loader: GLTFLoader, url: string, context: Context) => void;
10827
+ /**
10828
+ * Callback type for glTF import plugins. See {@link INeedleGLTFExtensionPlugin.onImport}
10829
+ */
10830
+ export declare type OnImportCallback = (loader: GLTFLoader, url: string, context: Context) => void;
10808
10831
 
10809
10832
  /**
10810
10833
  * Register a callback in the engine context created event.
@@ -18231,6 +18254,21 @@ export declare class OrbitControls extends Component implements ICameraControlle
18231
18254
  export { }
18232
18255
 
18233
18256
 
18257
+ declare module 'three/examples/jsm/controls/OrbitControls.js' {
18258
+ interface OrbitControls {
18259
+ _sphericalDelta: import("three").Spherical;
18260
+ _rotateLeft: (angleInRadians: number) => void;
18261
+ _rotateUp: (angleInRadians: number) => void;
18262
+ _pan: (dx: number, dy: number) => void;
18263
+ _dollyIn: (dollyScale: number) => void;
18264
+ _dollyOut: (dollyScale: number) => void;
18265
+ }
18266
+ interface OrbitControlsEventMap {
18267
+ endMovement: Event;
18268
+ }
18269
+ }
18270
+
18271
+
18234
18272
  declare module 'three' {
18235
18273
  interface SkinnedMesh {
18236
18274
  staticGenerator?: StaticGeometryGenerator;
@@ -18253,21 +18291,6 @@ declare module 'three' {
18253
18291
  }
18254
18292
 
18255
18293
 
18256
- declare module 'three/examples/jsm/controls/OrbitControls.js' {
18257
- interface OrbitControls {
18258
- _sphericalDelta: import("three").Spherical;
18259
- _rotateLeft: (angleInRadians: number) => void;
18260
- _rotateUp: (angleInRadians: number) => void;
18261
- _pan: (dx: number, dy: number) => void;
18262
- _dollyIn: (dollyScale: number) => void;
18263
- _dollyOut: (dollyScale: number) => void;
18264
- }
18265
- interface OrbitControlsEventMap {
18266
- endMovement: Event;
18267
- }
18268
- }
18269
-
18270
-
18271
18294
  declare module 'three' {
18272
18295
  interface Object3D {
18273
18296
  get guid(): string | undefined;
@@ -1,5 +1,5 @@
1
- import { GameObject as r, onClear as i, onDestroy as a, onInitialized as s, onAfterRender as l, onBeforeRender as d, onUpdate as c, onStart as m, TypeStore as p, loadAsset as g, NeedleXRSession as u, Context as S, VERSION as C, Component as y, Components as E } from "./needle-engine.bundle-BktxajaZ.js";
2
- import { $physicsKey as T, ActionBuilder as A, ActionCollection as b, ActionModel as M, Addressables as I, AlignmentConstraint as D, AmbientMode as O, Animation as x, AnimationCurve as k, AnimationExtension as L, AnimationTrackHandler as N, AnimationUtils as B, Animator as F, AnimatorConditionMode as w, AnimatorController as U, AnimatorControllerParameterType as G, AnimatorStateInfo as W, Antialiasing as H, Application as X, AssetDatabase as z, AssetReference as V, Attractor as _, AudioExtension as j, AudioListener as K, AudioSource as Z, AudioTrackHandler as Q, Avatar as Y, AvatarBlink_Simple as $, AvatarEyeLook_Rotation as J, AvatarLoader as q, AvatarMarker as ee, AvatarModel as te, Avatar_Brain_LookAt as oe, Avatar_MouthShapes as re, Avatar_MustacheShake as ne, Avatar_POI as ie, Axes as ae, AxesHelper as se, BUILD_TIME as le, BaseUIComponent as de, BasicIKConstraint as ce, BehaviorExtension as me, BehaviorModel as pe, Component$1 as ge, BlobStorage as ue, BloomEffect as Se, BoxCollider as Ce, BoxGizmo as ye, BoxHelperComponent as Ee, Button as Re, ButtonsFactory as he, CallDirection as fe, CallInfo as ve, Camera as Pe, CameraTargetReachedEvent as Te, Canvas as Ae, CanvasGroup as be, CapsuleCollider as Me, ChangeMaterialOnClick as Ie, ChangeTransformOnClick as De, CharacterController as Oe, CharacterControllerInput as xe, ChromaticAberration as ke, CircularBuffer as Le, ClearFlags as Ne, ClickThrough as Be, ClipExtrapolation as Fe, Collider as we, Collision as Ue, CollisionDetectionMode as Ge, ColorAdjustments as We, ColorBySpeedModule as He, ColorOverLifetimeModule as Xe, Component$1 as ze, ComponentLifecycleEvents as Ve, ConnectionEvents as _e, ContactPoint as je, ContactShadows as Ke, ContextArgs as Ze, ContextEvent as Qe, ContextRegistry as Ye, ControlTrackHandler as $e, CursorFollow as Je, CustomBranding as qe, CustomShader as et, DefaultReflectionMode as tt, Deletable as ot, DeleteBox as rt, DepthOfField as nt, DeviceFlag as it, DeviceUtilities as at, DocumentExtension as st, DragControls as lt, DragMode as dt, DropListener as ct, Duplicatable as mt, EffectWrapper as pt, EmissionModule as gt, EmphasizeOnClick as ut, EngineLoadingView as St, EnvironmentScene as Ct, EventList as yt, EventListEvent as Et, EventSystem as Rt, EventTrigger as ht, FieldWithDefault as ft, FileReference as vt, FileReferenceSerializer as Pt, FileSpawnModel as Tt, File_Event as At, FixedJoint as bt, Fog as Mt, FrameEvent as It, GENERATOR as Dt, Gizmos as Ot, GltfExport as xt, GltfExportBox as kt, Gradient as Lt, Graphic as Nt, GraphicRaycaster as Bt, Graphics as Ft, GridHelper as wt, GridLayoutGroup as Ut, GroundProjectedEnv as Gt, GroupActionModel as Wt, HideFlags as Ht, HideOnStart as Xt, HingeJoint as zt, HorizontalLayoutGroup as Vt, HostData as _t, HoverAnimation as jt, Image as Kt, ImageReference as Zt, ImageReferenceSerializer as Qt, InheritVelocityModule as Yt, Input as $t, InputEventQueue as Jt, InputEvents as qt, InputField as eo, InstanceHandle as to, InstancingHandler as oo, InstancingUtil as ro, InstantiateEvent as no, InstantiateIdProvider as io, InstantiateOptions as ao, Interactable as so, InternalScreenshotUtils as lo, JoinedRoomResponse as co, KeyEventArgs as mo, Keyframe as po, LODGroup as go, LODModel as uo, LeftRoomResponse as So, Light as Co, LightData as yo, LimitVelocityOverLifetimeModule as Eo, LoadingElementOptions as Ro, LogStats as ho, LogType as fo, LookAt as vo, LookAtConstraint as Po, MainModule as To, MarkerTrackHandler as Ao, MarkerType as bo, MaskableGraphic as Mo, Mathf as Io, MeshCollider as Do, MeshRenderer as Oo, MinMaxCurve as xo, MinMaxGradient as ko, NEEDLE_ENGINE_FEATURE_FLAGS as Lo, MODULES as No, NEKeyboardEvent as Bo, NEPointerEvent as Fo, NeedleButtonElement as wo, ContextRegistry as Uo, NeedleEngineModelLoader as Go, NeedleEngineWebComponent as Wo, NeedleMenu as Ho, NeedlePatchesKey as Xo, USDZExporter$1 as zo, NeedleXRController as Vo, NeedleXRSync as _o, NeedleXRUtils as jo, NestedGltf as Ko, NetworkConnection as Zo, NetworkedStreamEvents as Qo, NetworkedStreams as Yo, Networking as $o, NewInstanceModel as Jo, NoiseModule as qo, ObjectRaycaster as er, ObjectUtils as tr, OffsetConstraint as or, OneEuroFilter as rr, OneEuroFilterXYZ as nr, OpenURL as ir, OrbitControls as ar, Outline as sr, OwnershipEvent as lr, OwnershipModel as dr, PUBLIC_KEY as cr, Padding as mr, ParticleBurst as pr, ParticleSubEmitter as gr, ParticleSystem as ur, ParticleSystemBaseBehaviour as Sr, ParticleSystemRenderer as Cr, ParticleSystemShapeType as yr, PeerHandle as Er, PeerNetworking as Rr, Physics as hr, PhysicsExtension as fr, PhysicsMaterialCombine as vr, PixelationEffect as Pr, PlayAnimationOnClick as Tr, PlayAudioOnClick as Ar, PlayableDirector as br, PlayerColor as Mr, PlayerState as Ir, PlayerStateEvent as Dr, PlayerSync as Or, PlayerView as xr, PlayerViewManager as kr, PointerEventData as Lr, PointerType as Nr, PostProcessingEffect as Br, PostProcessingEffectOrder as Fr, PostProcessingHandler as wr, Volume as Ur, PreliminaryAction as Gr, PreliminaryTrigger as Wr, PreviewHelper as Hr, PrimitiveType as Xr, Progress as zr, PromiseAllWithErrors as Vr, PromiseErrorResult as _r, RGBAColor as jr, RapierPhysics as Kr, RawImage as Zr, RaycastOptions as Qr, Rect as Yr, RectTransform as $r, ReflectionProbe as Jr, RegisteredAnimationInfo as qr, RemoteSkybox as en, RenderTexture as tn, RenderTextureSerializer as on, Renderer as rn, RendererData as nn, RendererLightmap as an, Rigidbody as sn, RigidbodyConstraints as ln, RoomEvents as dn, RotationBySpeedModule as cn, RotationOverLifetimeModule as mn, SceneLightSettings as pn, SceneSwitcher as gn, ScreenCapture as un, ScreenSpaceAmbientOcclusion as Sn, ScreenSpaceAmbientOcclusionN8 as Cn, ScrollFollow as yn, SeeThrough as En, SendQueue as Rn, SerializationContext as hn, SetActiveOnClick as fn, ShadowCatcher as vn, ShapeModule as Pn, ShapeOverlapResult as Tn, SharpeningEffect as An, SignalAsset as bn, SignalReceiver as Mn, SignalReceiverEvent as In, SignalTrackHandler as Dn, Size as On, SizeBySpeedModule as xn, SizeOverLifetimeModule as kn, SkinnedMeshRenderer as Ln, SmoothFollow as Nn, SpatialGrabRaycaster as Bn, SpatialHtml as Fn, SpatialTrigger as wn, SpatialTriggerReceiver as Un, SpectatorCamera as Gn, SphereCollider as Wn, SphereIntersection as Hn, SplineContainer as Xn, SplineData as zn, SplineUtils as Vn, SplineWalker as _n, Sprite as jn, SpriteData as Kn, SpriteRenderer as Zn, SpriteSheet as Qn, StateMachineBehaviour as Yn, StreamEndedEvent as $n, StreamReceivedEvent as Jn, SubEmitterSystem as qn, SyncedCamera as ei, SyncedRoom as ti, SyncedTransform as oi, TapGestureTrigger as ri, TeleportTarget as ni, TestRunner as ii, TestSceneUtils as ai, TestSimulateUserData as si, Text as li, TextBuilder as di, TextExtension as ci, TextureSheetAnimationModule as mi, TiltShiftEffect as pi, Time as gi, ToneMappingEffect as ui, TrackHandler as Si, TrackType as Ci, TrailModule as yi, TransformData as Ei, TransformGizmo as Ri, TriggerBuilder as hi, TriggerModel as fi, UIRaycastUtils as vi, UIRootComponent as Pi, USDDocument as Ti, USDObject as Ai, USDWriter as bi, USDZExporter as Mi, USDZText as Ii, USDZUIExtension as Di, UriSerializer as Oi, UsageMarker as xi, UserJoinedOrLeftRoomModel as ki, VariantAction as Li, VelocityOverLifetimeModule as Ni, VerticalLayoutGroup as Bi, VideoPlayer as Fi, ViewBox as wi, ViewDevice as Ui, Vignette as Gi, VisibilityAction as Wi, Voip as Hi, Volume as Xi, VolumeParameter as zi, VolumeProfile as Vi, WaitForFrames as _i, WaitForPromise as ji, WaitForSeconds as Ki, Watch as Zi, WebARCameraBackground as Qi, WebARSessionRoot as Yi, WebXR as $i, WebXRButtonFactory as Ji, WebXRImageTracking as qi, WebXRImageTrackingModel as ea, WebXRPlaneTracking as ta, WebXRTrackedImage as oa, XRControllerFollow as ra, XRControllerModel as na, XRControllerMovement as ia, XRFlag as aa, XRRig as sa, XRState as la, XRStateFlag as da, __Ignore as ca, __internalNotifyObjectDestroyed as ma, activeInHierarchyFieldName as pa, addAttributeChangeCallback as ga, addComponent as ua, addCustomExtensionPlugin as Sa, addNewComponent as Ca, addPatch as ya, apply as Ea, applyHMRChanges as Ra, applyPrototypeExtensions as ha, beginListenDestroy as fa, beginListenInstantiate as va, binaryIdentifierCasts as Pa, build_scene_functions as Ta, builtinComponentKeyName as Aa, calculateProgress01 as ba, clearMessages as Ma, clearMessages as Ia, colorSerializer as Da, compareAssociation as Oa, componentSerializer as xa, copyTexture as ka, createMotion as La, debugNet as Na, debugOwner as Ba, decompressGpuTexture as Fa, deepClone as wa, delay as Ua, delayForFrames as Ga, deserializeObject as Wa, destroy as Ha, destroyComponentInstance as Xa, determineMimeTypeFromExtension as za, disposeObjectResources as Va, disposeStream as _a, editorGuidKeyName as ja, enableSpatialConsole as Ka, euler as Za, eventListSerializer as Qa, exportAsGLTF as Ya, findByGuid as $a, findObjectOfType as Ja, findObjectsOfType as qa, findResourceUsers as es, fitCamera as ts, fitObjectIntoVolume as os, foreachComponent as rs, foreachComponentEnumerator as ns, forward as is, generateQRCode as as, generateSeed as ss, getBoundingBox as ls, getCameraController as ds, getComponent as cs, getComponentInChildren as ms, getComponentInParent as ps, getComponents as gs, getComponentsInChildren as us, getComponentsInParent as Ss, getFormattedDate as Cs, getIconElement as ys, getIconTexture as Es, getLoader as Rs, getOrAddComponent as hs, getParam as fs, getParentHierarchyPath as vs, getPath as Ps, getPeerOptions as Ts, getPeerjsInstance as As, getResourceUserCount as bs, getTempColor as Ms, getTempQuaternion as Is, getTempVector as Ds, getUrlParams as Os, getVisibleInCustomShadowRendering as xs, getWorldDirection as ks, getWorldEuler as Ls, getWorldPosition as Ns, getWorldQuaternion as Bs, getWorldRotation as Fs, getWorldScale as ws, hasCommercialLicense as Us, hasIndieLicense as Gs, hasPointerEventComponent as Ws, hasProLicense as Hs, hideDebugConsole as Xs, imageToCanvas as zs, instantiate as Vs, invokeLoadedImportPluginHooks as _s, invokeXRSessionEnd as js, invokeXRSessionStart as Ks, isActiveInHierarchy as Zs, isActiveSelf as Qs, isAndroidDevice as Ys, isAnimationAction as $s, isComponent as Js, isDebugMode as qs, isDesktop as el, isDestroyed as tl, isDevEnvironment as ol, isDisposed as rl, isExporting as nl, isGLTFModel as il, isHostedOnGlitch as al, isHotReloadEnabled as sl, isHotReloading as ll, isIPad as dl, isIconElement as cl, isLocalNetwork as ml, isMacOS as pl, isMobileDevice as gl, isMozillaXR as ul, isQuest as Sl, isResourceTrackingEnabled as Cl, isSafari as yl, isUsingInstancing as El, isiOS as Rl, isiPad as hl, loadPMREM as fl, loadSync as vl, logHierarchy as Pl, lookAtInverse as Tl, lookAtObject as Al, lookAtScreenPoint as bl, makeId as Ml, makeIdFromRandomWords as Il, makeNameSafe as Dl, markAsInstancedRendered as Ol, microphonePermissionsGranted as xl, nameof as kl, nameofFactory as Ll, objectSerializer as Nl, offXRSessionEnd as Bl, offXRSessionStart as Fl, onXRSessionEnd as wl, onXRSessionStart as Ul, parseSync as Gl, placeOnSurface as Wl, postprocessFBXMaterials as Hl, prefix as Xl, pushState as zl, randomNumber as Vl, registerBinaryType as _l, registerComponent as jl, registerComponentExtension as Kl, registerCustomEffectType as Zl, registerExportExtensions as Ql, registerExtensions as Yl, registerHotReloadType as $l, registerLoader as Jl, registerPrefabProvider as ql, registerPrototypeExtensions as ed, registerType as td, relativePathPrefix as od, removeAttributeChangeCallback as rd, removeComponent as nd, removeCustomImportExtensionType as id, removePatch as ad, resolveUrl as sd, sanitizeString as ld, saveImage as dd, screenshot as cd, screenshot2 as md, sendDestroyed as pd, serializable as gd, serializeObject as ud, serializeable as Sd, setActive as Cd, setAllowBalloonMessages as yd, setAllowOverlayMessages as Ed, setAutoFitEnabled as Rd, setCameraController as hd, setDestroyed as fd, setDevEnvironment as vd, setDisposable as Pd, setDontDestroy as Td, setOrAddParamsToUrl as Ad, setParam as bd, setParamWithoutReload as Md, setPeerOptions as Id, setResourceTrackingEnabled as Dd, setState as Od, setVisibleInCustomShadowRendering as xd, setWorldEuler as kd, setWorldPosition as Ld, setWorldPositionXYZ as Nd, setWorldQuaternion as Bd, setWorldQuaternionXYZW as Fd, setWorldRotation as wd, setWorldRotationXYZ as Ud, setWorldScale as Gd, showBalloonError as Wd, showBalloonMessage as Hd, showBalloonWarning as Xd, showDebugConsole as zd, slerp as Vd, syncDestroy as _d, syncField as jd, syncInstantiate as Kd, textureToCanvas as Zd, toSourceId as Qd, tryCastBinary as Yd, tryDetermineMimetypeFromBinary as $d, tryDetermineMimetypeFromURL as Jd, tryFindObject as qd, tryGetGuid as ec, unregisterHotReloadType as tc, unwatchWrite as oc, useForAutoFit as rc, validate as nc, watchWrite as ic } from "./needle-engine.bundle-BktxajaZ.js";
1
+ import { GameObject as r, onClear as i, onDestroy as a, onInitialized as s, onAfterRender as l, onBeforeRender as d, onUpdate as c, onStart as m, TypeStore as p, loadAsset as g, NeedleXRSession as u, Context as S, VERSION as C, Component as y, Components as E } from "./needle-engine.bundle-BVdPECIB.js";
2
+ import { $physicsKey as T, ActionBuilder as A, ActionCollection as b, ActionModel as M, Addressables as I, AlignmentConstraint as D, AmbientMode as O, Animation as x, AnimationCurve as k, AnimationExtension as L, AnimationTrackHandler as N, AnimationUtils as B, Animator as F, AnimatorConditionMode as w, AnimatorController as U, AnimatorControllerParameterType as G, AnimatorStateInfo as W, Antialiasing as H, Application as X, AssetDatabase as z, AssetReference as V, Attractor as _, AudioExtension as j, AudioListener as K, AudioSource as Z, AudioTrackHandler as Q, Avatar as Y, AvatarBlink_Simple as $, AvatarEyeLook_Rotation as J, AvatarLoader as q, AvatarMarker as ee, AvatarModel as te, Avatar_Brain_LookAt as oe, Avatar_MouthShapes as re, Avatar_MustacheShake as ne, Avatar_POI as ie, Axes as ae, AxesHelper as se, BUILD_TIME as le, BaseUIComponent as de, BasicIKConstraint as ce, BehaviorExtension as me, BehaviorModel as pe, Component$1 as ge, BlobStorage as ue, BloomEffect as Se, BoxCollider as Ce, BoxGizmo as ye, BoxHelperComponent as Ee, Button as Re, ButtonsFactory as he, CallDirection as fe, CallInfo as ve, Camera as Pe, CameraTargetReachedEvent as Te, Canvas as Ae, CanvasGroup as be, CapsuleCollider as Me, ChangeMaterialOnClick as Ie, ChangeTransformOnClick as De, CharacterController as Oe, CharacterControllerInput as xe, ChromaticAberration as ke, CircularBuffer as Le, ClearFlags as Ne, ClickThrough as Be, ClipExtrapolation as Fe, Collider as we, Collision as Ue, CollisionDetectionMode as Ge, ColorAdjustments as We, ColorBySpeedModule as He, ColorOverLifetimeModule as Xe, Component$1 as ze, ComponentLifecycleEvents as Ve, ConnectionEvents as _e, ContactPoint as je, ContactShadows as Ke, ContextArgs as Ze, ContextEvent as Qe, ContextRegistry as Ye, ControlTrackHandler as $e, CursorFollow as Je, CustomBranding as qe, CustomShader as et, DefaultReflectionMode as tt, Deletable as ot, DeleteBox as rt, DepthOfField as nt, DeviceFlag as it, DeviceUtilities as at, DocumentExtension as st, DragControls as lt, DragMode as dt, DropListener as ct, Duplicatable as mt, EffectWrapper as pt, EmissionModule as gt, EmphasizeOnClick as ut, EngineLoadingView as St, EnvironmentScene as Ct, EventList as yt, EventListEvent as Et, EventSystem as Rt, EventTrigger as ht, FieldWithDefault as ft, FileReference as vt, FileReferenceSerializer as Pt, FileSpawnModel as Tt, File_Event as At, FixedJoint as bt, Fog as Mt, FrameEvent as It, GENERATOR as Dt, Gizmos as Ot, GltfExport as xt, GltfExportBox as kt, Gradient as Lt, Graphic as Nt, GraphicRaycaster as Bt, Graphics as Ft, GridHelper as wt, GridLayoutGroup as Ut, GroundProjectedEnv as Gt, GroupActionModel as Wt, HideFlags as Ht, HideOnStart as Xt, HingeJoint as zt, HorizontalLayoutGroup as Vt, HostData as _t, HoverAnimation as jt, Image as Kt, ImageReference as Zt, ImageReferenceSerializer as Qt, InheritVelocityModule as Yt, Input as $t, InputEventQueue as Jt, InputEvents as qt, InputField as eo, InstanceHandle as to, InstancingHandler as oo, InstancingUtil as ro, InstantiateEvent as no, InstantiateIdProvider as io, InstantiateOptions as ao, Interactable as so, InternalScreenshotUtils as lo, JoinedRoomResponse as co, KeyEventArgs as mo, Keyframe as po, LODGroup as go, LODModel as uo, LeftRoomResponse as So, Light as Co, LightData as yo, LimitVelocityOverLifetimeModule as Eo, LoadingElementOptions as Ro, LogStats as ho, LogType as fo, LookAt as vo, LookAtConstraint as Po, MainModule as To, MarkerTrackHandler as Ao, MarkerType as bo, MaskableGraphic as Mo, Mathf as Io, MeshCollider as Do, MeshRenderer as Oo, MinMaxCurve as xo, MinMaxGradient as ko, NEEDLE_ENGINE_FEATURE_FLAGS as Lo, MODULES as No, NEKeyboardEvent as Bo, NEPointerEvent as Fo, NeedleButtonElement as wo, ContextRegistry as Uo, NeedleEngineModelLoader as Go, NeedleEngineWebComponent as Wo, NeedleMenu as Ho, NeedlePatchesKey as Xo, USDZExporter$1 as zo, NeedleXRController as Vo, NeedleXRSync as _o, NeedleXRUtils as jo, NestedGltf as Ko, NetworkConnection as Zo, NetworkedStreamEvents as Qo, NetworkedStreams as Yo, Networking as $o, NewInstanceModel as Jo, NoiseModule as qo, ObjectRaycaster as er, ObjectUtils as tr, OffsetConstraint as or, OneEuroFilter as rr, OneEuroFilterXYZ as nr, OpenURL as ir, OrbitControls as ar, Outline as sr, OwnershipEvent as lr, OwnershipModel as dr, PUBLIC_KEY as cr, Padding as mr, ParticleBurst as pr, ParticleSubEmitter as gr, ParticleSystem as ur, ParticleSystemBaseBehaviour as Sr, ParticleSystemRenderer as Cr, ParticleSystemShapeType as yr, PeerHandle as Er, PeerNetworking as Rr, Physics as hr, PhysicsExtension as fr, PhysicsMaterialCombine as vr, PixelationEffect as Pr, PlayAnimationOnClick as Tr, PlayAudioOnClick as Ar, PlayableDirector as br, PlayerColor as Mr, PlayerState as Ir, PlayerStateEvent as Dr, PlayerSync as Or, PlayerView as xr, PlayerViewManager as kr, PointerEventData as Lr, PointerType as Nr, PostProcessingEffect as Br, PostProcessingEffectOrder as Fr, PostProcessingHandler as wr, Volume as Ur, PreliminaryAction as Gr, PreliminaryTrigger as Wr, PreviewHelper as Hr, PrimitiveType as Xr, Progress as zr, PromiseAllWithErrors as Vr, PromiseErrorResult as _r, RGBAColor as jr, RapierPhysics as Kr, RawImage as Zr, RaycastOptions as Qr, Rect as Yr, RectTransform as $r, ReflectionProbe as Jr, RegisteredAnimationInfo as qr, RemoteSkybox as en, RenderTexture as tn, RenderTextureSerializer as on, Renderer as rn, RendererData as nn, RendererLightmap as an, Rigidbody as sn, RigidbodyConstraints as ln, RoomEvents as dn, RotationBySpeedModule as cn, RotationOverLifetimeModule as mn, SceneLightSettings as pn, SceneSwitcher as gn, ScreenCapture as un, ScreenSpaceAmbientOcclusion as Sn, ScreenSpaceAmbientOcclusionN8 as Cn, ScrollFollow as yn, SeeThrough as En, SendQueue as Rn, SerializationContext as hn, SetActiveOnClick as fn, ShadowCatcher as vn, ShapeModule as Pn, ShapeOverlapResult as Tn, SharpeningEffect as An, SignalAsset as bn, SignalReceiver as Mn, SignalReceiverEvent as In, SignalTrackHandler as Dn, Size as On, SizeBySpeedModule as xn, SizeOverLifetimeModule as kn, SkinnedMeshRenderer as Ln, SmoothFollow as Nn, SpatialGrabRaycaster as Bn, SpatialHtml as Fn, SpatialTrigger as wn, SpatialTriggerReceiver as Un, SpectatorCamera as Gn, SphereCollider as Wn, SphereIntersection as Hn, SplineContainer as Xn, SplineData as zn, SplineUtils as Vn, SplineWalker as _n, Sprite as jn, SpriteData as Kn, SpriteRenderer as Zn, SpriteSheet as Qn, StateMachineBehaviour as Yn, StreamEndedEvent as $n, StreamReceivedEvent as Jn, SubEmitterSystem as qn, SyncedCamera as ei, SyncedRoom as ti, SyncedTransform as oi, TapGestureTrigger as ri, TeleportTarget as ni, TestRunner as ii, TestSceneUtils as ai, TestSimulateUserData as si, Text as li, TextBuilder as di, TextExtension as ci, TextureSheetAnimationModule as mi, TiltShiftEffect as pi, Time as gi, ToneMappingEffect as ui, TrackHandler as Si, TrackType as Ci, TrailModule as yi, TransformData as Ei, TransformGizmo as Ri, TriggerBuilder as hi, TriggerModel as fi, UIRaycastUtils as vi, UIRootComponent as Pi, USDDocument as Ti, USDObject as Ai, USDWriter as bi, USDZExporter as Mi, USDZText as Ii, USDZUIExtension as Di, UriSerializer as Oi, UsageMarker as xi, UserJoinedOrLeftRoomModel as ki, VariantAction as Li, VelocityOverLifetimeModule as Ni, VerticalLayoutGroup as Bi, VideoPlayer as Fi, ViewBox as wi, ViewDevice as Ui, Vignette as Gi, VisibilityAction as Wi, Voip as Hi, Volume as Xi, VolumeParameter as zi, VolumeProfile as Vi, WaitForFrames as _i, WaitForPromise as ji, WaitForSeconds as Ki, Watch as Zi, WebARCameraBackground as Qi, WebARSessionRoot as Yi, WebXR as $i, WebXRButtonFactory as Ji, WebXRImageTracking as qi, WebXRImageTrackingModel as ea, WebXRPlaneTracking as ta, WebXRTrackedImage as oa, XRControllerFollow as ra, XRControllerModel as na, XRControllerMovement as ia, XRFlag as aa, XRRig as sa, XRState as la, XRStateFlag as da, __Ignore as ca, __internalNotifyObjectDestroyed as ma, activeInHierarchyFieldName as pa, addAttributeChangeCallback as ga, addComponent as ua, addCustomExtensionPlugin as Sa, addNewComponent as Ca, addPatch as ya, apply as Ea, applyHMRChanges as Ra, applyPrototypeExtensions as ha, beginListenDestroy as fa, beginListenInstantiate as va, binaryIdentifierCasts as Pa, build_scene_functions as Ta, builtinComponentKeyName as Aa, calculateProgress01 as ba, clearMessages as Ma, clearMessages as Ia, colorSerializer as Da, compareAssociation as Oa, componentSerializer as xa, copyTexture as ka, createMotion as La, debugNet as Na, debugOwner as Ba, decompressGpuTexture as Fa, deepClone as wa, delay as Ua, delayForFrames as Ga, deserializeObject as Wa, destroy as Ha, destroyComponentInstance as Xa, determineMimeTypeFromExtension as za, disposeObjectResources as Va, disposeStream as _a, editorGuidKeyName as ja, enableSpatialConsole as Ka, euler as Za, eventListSerializer as Qa, exportAsGLTF as Ya, findByGuid as $a, findObjectOfType as Ja, findObjectsOfType as qa, findResourceUsers as es, fitCamera as ts, fitObjectIntoVolume as os, foreachComponent as rs, foreachComponentEnumerator as ns, forward as is, generateQRCode as as, generateSeed as ss, getBoundingBox as ls, getCameraController as ds, getComponent as cs, getComponentInChildren as ms, getComponentInParent as ps, getComponents as gs, getComponentsInChildren as us, getComponentsInParent as Ss, getFormattedDate as Cs, getIconElement as ys, getIconTexture as Es, getLoader as Rs, getOrAddComponent as hs, getParam as fs, getParentHierarchyPath as vs, getPath as Ps, getPeerOptions as Ts, getPeerjsInstance as As, getResourceUserCount as bs, getTempColor as Ms, getTempQuaternion as Is, getTempVector as Ds, getUrlParams as Os, getVisibleInCustomShadowRendering as xs, getWorldDirection as ks, getWorldEuler as Ls, getWorldPosition as Ns, getWorldQuaternion as Bs, getWorldRotation as Fs, getWorldScale as ws, hasCommercialLicense as Us, hasIndieLicense as Gs, hasPointerEventComponent as Ws, hasProLicense as Hs, hideDebugConsole as Xs, imageToCanvas as zs, instantiate as Vs, invokeLoadedImportPluginHooks as _s, invokeXRSessionEnd as js, invokeXRSessionStart as Ks, isActiveInHierarchy as Zs, isActiveSelf as Qs, isAndroidDevice as Ys, isAnimationAction as $s, isComponent as Js, isDebugMode as qs, isDesktop as el, isDestroyed as tl, isDevEnvironment as ol, isDisposed as rl, isExporting as nl, isGLTFModel as il, isHostedOnGlitch as al, isHotReloadEnabled as sl, isHotReloading as ll, isIPad as dl, isIconElement as cl, isLocalNetwork as ml, isMacOS as pl, isMobileDevice as gl, isMozillaXR as ul, isQuest as Sl, isResourceTrackingEnabled as Cl, isSafari as yl, isUsingInstancing as El, isiOS as Rl, isiPad as hl, loadPMREM as fl, loadSync as vl, logHierarchy as Pl, lookAtInverse as Tl, lookAtObject as Al, lookAtScreenPoint as bl, makeId as Ml, makeIdFromRandomWords as Il, makeNameSafe as Dl, markAsInstancedRendered as Ol, microphonePermissionsGranted as xl, nameof as kl, nameofFactory as Ll, objectSerializer as Nl, offXRSessionEnd as Bl, offXRSessionStart as Fl, onXRSessionEnd as wl, onXRSessionStart as Ul, parseSync as Gl, placeOnSurface as Wl, postprocessFBXMaterials as Hl, prefix as Xl, pushState as zl, randomNumber as Vl, registerBinaryType as _l, registerComponent as jl, registerComponentExtension as Kl, registerCustomEffectType as Zl, registerExportExtensions as Ql, registerExtensions as Yl, registerHotReloadType as $l, registerLoader as Jl, registerPrefabProvider as ql, registerPrototypeExtensions as ed, registerType as td, relativePathPrefix as od, removeAttributeChangeCallback as rd, removeComponent as nd, removeCustomImportExtensionType as id, removePatch as ad, resolveUrl as sd, sanitizeString as ld, saveImage as dd, screenshot as cd, screenshot2 as md, sendDestroyed as pd, serializable as gd, serializeObject as ud, serializeable as Sd, setActive as Cd, setAllowBalloonMessages as yd, setAllowOverlayMessages as Ed, setAutoFitEnabled as Rd, setCameraController as hd, setDestroyed as fd, setDevEnvironment as vd, setDisposable as Pd, setDontDestroy as Td, setOrAddParamsToUrl as Ad, setParam as bd, setParamWithoutReload as Md, setPeerOptions as Id, setResourceTrackingEnabled as Dd, setState as Od, setVisibleInCustomShadowRendering as xd, setWorldEuler as kd, setWorldPosition as Ld, setWorldPositionXYZ as Nd, setWorldQuaternion as Bd, setWorldQuaternionXYZW as Fd, setWorldRotation as wd, setWorldRotationXYZ as Ud, setWorldScale as Gd, showBalloonError as Wd, showBalloonMessage as Hd, showBalloonWarning as Xd, showDebugConsole as zd, slerp as Vd, syncDestroy as _d, syncField as jd, syncInstantiate as Kd, textureToCanvas as Zd, toSourceId as Qd, tryCastBinary as Yd, tryDetermineMimetypeFromBinary as $d, tryDetermineMimetypeFromURL as Jd, tryFindObject as qd, tryGetGuid as ec, unregisterHotReloadType as tc, unwatchWrite as oc, useForAutoFit as rc, validate as nc, watchWrite as ic } from "./needle-engine.bundle-BVdPECIB.js";
3
3
  import { NEEDLE_progressive as sc } from "./gltf-progressive-DnLBuGK5.js";
4
4
  import { THREE as R } from "./three-BCCkyCA5.js";
5
5
  const t = {