@needle-tools/engine 4.5.5-next.a31058b → 4.5.5-next.e37c6ec

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.
@@ -130,7 +130,7 @@ Open this page to get the console: `+t.toString())}const o=exports.DeviceUtiliti
130
130
  #__vconsole .vc-mask {
131
131
  overflow: hidden;
132
132
  }
133
- `,_i==null||_i.prepend(i),o===!0&&Tm()<=0&&_0(),console.log("🌵 Debug console has loaded")}},t.onerror=()=>{console.warn("🌵 Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),Sl=!1,Wt=null},t.src="https://cdn.jsdelivr.net/npm/vconsole@3.9.1/dist/vconsole.min.js",document.body.appendChild(t)}function qS(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","🌵 Inspect glTF"),t=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(e){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 l=location.protocol+"//"+location.host+location.pathname+"/"+n,c=encodeURIComponent(l);o.fullUrl="https://viewer.needle.tools?inspect&file="+c;var h='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';e(h)}),o.on("show",function(){const e=t();e&&e.src!==o.fullUrl&&(e.src=o.fullUrl)}),o.on("hide",function(){const e=t();e&&(e.src="")}),o.on("addTopBar",function(e){var i=new Array;i.push({name:"Open in new window ↗",onClick:function(n){window.open(o.fullUrl,"_blank"),Wt==null||Wt.hide()}}),i.push({name:"Reload",onClick:function(n){const s=t();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=t();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),e(i)}),o}function XS(){const o=document.querySelector("#__vconsole .vc-switch");return o||null}function QS(){const o=document.querySelector("#__vconsole");return o||null}const w0=x("debugdefines");Oo('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";');Oo('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');Oo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');Oo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');Oo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.5.5";');Oo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');Oo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Jun 05 2025 13:36:38 GMT+0000 (Coordinated Universal Time)";');Oo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const pn="4.5.5",Su="undefined",zm="Thu Jun 05 2025 13:36:38 GMT+0000 (Coordinated Universal Time)";w0&&console.log(`Engine version: ${pn} (generator: ${Su})
133
+ `,_i==null||_i.prepend(i),o===!0&&Tm()<=0&&_0(),console.log("🌵 Debug console has loaded")}},t.onerror=()=>{console.warn("🌵 Debug console failed to load."+(window.crossOriginIsolated?"This page is using cross-origin isolation, so external scripts can't be loaded.":"")),Sl=!1,Wt=null},t.src="https://cdn.jsdelivr.net/npm/vconsole@3.9.1/dist/vconsole.min.js",document.body.appendChild(t)}function qS(){if(!globalThis.VConsole)return;const o=new VConsole.VConsolePlugin("needle-console","🌵 Inspect glTF"),t=()=>document.querySelector("#__vc_plug_"+o._id+" iframe");return o.on("renderTab",function(e){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 l=location.protocol+"//"+location.host+location.pathname+"/"+n,c=encodeURIComponent(l);o.fullUrl="https://viewer.needle.tools?inspect&file="+c;var h='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';e(h)}),o.on("show",function(){const e=t();e&&e.src!==o.fullUrl&&(e.src=o.fullUrl)}),o.on("hide",function(){const e=t();e&&(e.src="")}),o.on("addTopBar",function(e){var i=new Array;i.push({name:"Open in new window ↗",onClick:function(n){window.open(o.fullUrl,"_blank"),Wt==null||Wt.hide()}}),i.push({name:"Reload",onClick:function(n){const s=t();s&&(s.src=o.fullUrl)}}),i.push({name:"Fullscreen",onClick:function(n){const s=t();s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen instanceof Function&&s.webkitRequestFullscreen()}}),e(i)}),o}function XS(){const o=document.querySelector("#__vconsole .vc-switch");return o||null}function QS(){const o=document.querySelector("#__vconsole");return o||null}const w0=x("debugdefines");Oo('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";');Oo('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";');Oo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";');Oo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');Oo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.5.5";');Oo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');Oo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Jun 05 2025 14:17:21 GMT+0000 (Coordinated Universal Time)";');Oo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const pn="4.5.5",Su="undefined",zm="Thu Jun 05 2025 14:17:21 GMT+0000 (Coordinated Universal Time)";w0&&console.log(`Engine version: ${pn} (generator: ${Su})
134
134
  Project built at ${zm}`);const ua=NEEDLE_PUBLIC_KEY,Ps="needle_isActiveInHierarchy",Qo="builtin_components",Jl="needle_editor_guid";function Oo(o){try{(0,eval)(o)}catch(t){w0&&console.error(t)}}let x0,e_=null;function gn(){return x0}function Nm(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}e_!==o&&(e_=o,x0=new o)}const wi=Symbol("shadowDomOwner"),YS=x("debugpatch");function Cu(o,t,e,i){const n=YS===t;if(!e&&!i)return;const s=t+"___needle";ZS(o,t,e,i);const a=Object.getOwnPropertyDescriptor(o,t),l=o[t];n&&console.log("Patch",o.constructor.name,t,a,l),a?(n&&console.log("Apply patch with existing descriptor",o.constructor.name,t,a),typeof a.value=="function"&&(o[t]=i_(a.value,o,t))):(n&&console.log("Create patch with new property",o.constructor.name,t,a),Object.defineProperty(o,t,{set:function(c){if(typeof c=="function")this[s]=i_(c,o,t);else{const h=this[s];S0(o,t,this,h,c),this[s]=c,C0(o,t,this,h,c)}},get:function(){const c=this[s];return typeof c=="function"&&c[s]?c[s]:c}}))}function KS(o,t,e){const i=Vm(o,t);if(i)for(let n=i.length-1;n>=0;n--){const s=i[n];s.prefix===e&&(s.prefix=null),s.postfix===e&&(s.postfix=null),!s.prefix&&!s.postfix&&i.splice(n,1)}}const t_=Symbol("Needle:Patches:WrappedFunction");function i_(o,t,e){if(o[t_])return o;const i=function(...n){S0(t,e,this,...n);const s=o.apply(this,n);return C0(t,e,this,s,...n),s};return i[t_]=!0,i}const yd="Needle:Patches";function zp(){return globalThis[yd]||(globalThis[yd]=new WeakMap),globalThis[yd]}function Vm(o,t){const e=zp().get(o);return e?e.get(t):null}function ZS(o,t,e,i){let n=zp().get(o);n||(n=new Map,zp().set(o,n));let s=n.get(t);s||(s=[],n.set(t,s)),s.push({prefix:e,postfix:i})}function S0(o,t,e,...i){var s;if(!e)return;const n=Vm(o,t);if(n)for(const a of n)(s=a.prefix)==null||s.call(e,...i)}function C0(o,t,e,i,...n){var a;if(!e)return;const s=Vm(o,t);if(s)for(const l of s)(a=l.postfix)==null||a.call(e,i,...n)}const Ia=[];function Pu(o){Ia.indexOf(o)===-1&&Ia.push(o)}function JS(o){const t=Ia.indexOf(o);t!==-1&&Ia.splice(t,1)}const ja=[];function $m(o){ja.indexOf(o)===-1&&ja.push(o)}function eC(o){const t=ja.indexOf(o);t!==-1&&ja.splice(t,1)}function P0(o){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-start",{detail:o}));for(let t=0;t<Ia.length;t++)Ia[t](o)}function M0(o){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-end",{detail:o}));for(let t=0;t<ja.length;t++)ja[t](o)}const Ke=x("debuginput");var Mu=(o=>(o.Mouse="mouse",o.Touch="touch",o.Controller="controller",o.Hand="hand",o))(Mu||{}),Ee=(o=>(o.PointerDown="pointerdown",o.PointerUp="pointerup",o.PointerMove="pointermove",o.KeyDown="keydown",o.KeyUp="keyup",o.KeyPressed="keypress",o))(Ee||{});class us extends PointerEvent{constructor(e,i,n){super(e,n);r(this,"clientZ");r(this,"deviceIndex");r(this,"origin");r(this,"source");r(this,"mode");r(this,"_ray");r(this,"space");r(this,"isClick",!1);r(this,"isDoubleClick",!1);r(this,"_used",!1);r(this,"_pointerid");r(this,"_pointerType");r(this,"_type");r(this,"metadata",{});r(this,"intersections",new Array);r(this,"_immediatePropagationStopped",!1);r(this,"_propagationStopped",!1);this.clientZ=n.clientZ,this._pointerid=n.pointerId,this._pointerType=n.pointerType,this._type=e,this.deviceIndex=n.deviceIndex,this.origin=n.origin,this.source=i,this.mode=n.mode,this._ray=n.ray,this.space=n.device}get isSpatial(){return this.mode!="screen"}get ray(){return this._ray||(this._ray=new d.Ray(this.space.worldPosition.clone(),this.space.worldForward.clone())),this._ray}set ray(e){this._ray=e}get hasRay(){return this._ray!==void 0}get used(){return this._used}use(){this._used=!0}get pointerId(){return this._pointerid}get pointerType(){return this._pointerType}get type(){return this._type}get immediatePropagationStopped(){return this._immediatePropagationStopped}get propagationStopped(){return this._immediatePropagationStopped||this._propagationStopped}stopImmediatePropagation(){var e;this._immediatePropagationStopped=!0,super.stopImmediatePropagation(),(e=this.source)==null||e.stopImmediatePropagation()}stopPropagation(){var e;this._propagationStopped=!0,super.stopPropagation(),(e=this.source)==null||e.stopPropagation(),Ke&&console.warn("Stop propagation...",this.pointerId,this.pointerType)}}class zl extends KeyboardEvent{constructor(e,i,n){super(e,n);r(this,"source");this.source=i}stopImmediatePropagation(){var e;super.stopImmediatePropagation(),(e=this.source)==null||e.stopImmediatePropagation()}}class tC{constructor(t){r(this,"key");r(this,"keyType");r(this,"source");this.key=t.key,this.keyType=t.type,this.source=t}}var ni=(o=>(o[o.Early=-100]="Early",o[o.Default=0]="Default",o[o.Late=100]="Late",o))(ni||{});class O0{constructor(t){r(this,"_eventListeners",{});r(this,"_doubleClickTimeThreshold",.2);r(this,"_longPressTimeThreshold",1);r(this,"_setCursorTypes",[]);r(this,"context");r(this,"_pointerDown",[!1]);r(this,"_pointerUp",[!1]);r(this,"_pointerClick",[!1]);r(this,"_pointerDoubleClick",[!1]);r(this,"_pointerPressed",[!1]);r(this,"_pointerPositions",[new d.Vector2]);r(this,"_pointerPositionsLastFrame",[new d.Vector2]);r(this,"_pointerPositionsDelta",[new d.Vector2]);r(this,"_pointerPositionsRC",[new d.Vector2]);r(this,"_pointerPositionDown",[new d.Vector3]);r(this,"_pointerDownTime",[]);r(this,"_pointerUpTime",[]);r(this,"_pointerUpTimestamp",[]);r(this,"_pointerIds",[]);r(this,"_pointerTypes",[""]);r(this,"_mouseWheelChanged",[!1]);r(this,"_mouseWheelDeltaY",[0]);r(this,"_pointerEvent",[]);r(this,"_pointerEventsPressed",[]);r(this,"_pointerSpace",[]);r(this,"_pressedStack",new Map);r(this,"_htmlEventSource");r(this,"onLostFocus",()=>{for(const t in this.keysPressed)this.keysPressed[t].pressed=!1});r(this,"_receivedPointerMoveEventsThisFrame",new Array);r(this,"onEndOfFrame",()=>{this._receivedPointerMoveEventsThisFrame.length=0;for(let t=0;t<this._pointerUp.length;t++)this._pointerUp[t]=!1;for(let t=0;t<this._pointerDown.length;t++)this._pointerDown[t]=!1;for(let t=0;t<this._pointerClick.length;t++)this._pointerClick[t]=!1;for(let t=0;t<this._pointerDoubleClick.length;t++)this._pointerDoubleClick[t]=!1;for(const t of this._pointerPositionsDelta)t.set(0,0);for(let t=0;t<this._mouseWheelChanged.length;t++)this._mouseWheelChanged[t]=!1;for(let t=0;t<this._mouseWheelDeltaY.length;t++)this._mouseWheelDeltaY[t]=0});r(this,"onContextMenu",t=>{this.canReceiveInput(t)!==!1&&t instanceof PointerEvent&&t.pointerType});r(this,"keysPressed",{});r(this,"onKeyDown",t=>{if(Ke&&console.log(`key down ${t.code}, ${this.context.application.hasFocus}`,t),!this.context.application.hasFocus)return;const e=this.keysPressed[t.code];if(e&&e.pressed)return;this.keysPressed[t.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:t.key,code:t.code};const i=new zl("keydown",t,t);this.onDispatchEvent(i)});r(this,"onKeyPressed",t=>{if(!this.context.application.hasFocus)return;const e=this.keysPressed[t.code];if(!e)return;e.pressed=!0,e.frame=this.context.time.frameCount+1;const i=new zl("keypress",t,t);this.onDispatchEvent(i)});r(this,"onKeyUp",t=>{if(!this.context.application.hasFocus)return;const e=this.keysPressed[t.code];if(!e)return;e.pressed=!1,e.frame=this.context.time.frameCount+1;const i=new zl("keyup",t,t);this.onDispatchEvent(i)});r(this,"onWheelWindow",t=>{document.pointerLockElement&&this.onMouseWheel(t)});r(this,"onMouseWheel",t=>{if(this.canReceiveInput(t)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const e=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=e+t.deltaY});r(this,"onPointerDown",t=>{if(this.context.isInAR||this.canReceiveInput(t)===!1)return;t.target instanceof HTMLElement&&t.target.setPointerCapture(t.pointerId);const e=this.getPointerId(t);Ke&&Te(`pointer down #${e}, identifier:${t.pointerId}`);const i=this.getAndUpdateSpatialObjectForScreenPosition(e,t.clientX,t.clientY),n=new us("pointerdown",t,{origin:this,mode:"screen",deviceIndex:0,pointerId:e,button:t.button,clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,buttonName:this.getButtonName(t),device:i,pressure:t.pressure});this.onDown(n)});r(this,"onPointerMove",t=>{if(this.context.isInAR||this._receivedPointerMoveEventsThisFrame.includes(t.pointerId))return;this._receivedPointerMoveEventsThisFrame.push(t.pointerId);let e=t.button;t.pointerType==="mouse"&&(e=this.getFirstPressedButtonForPointer(0)??0);const i=this.getPointerId(t,e);e===-1&&(e=i);const n=this.getAndUpdateSpatialObjectForScreenPosition(i,t.clientX,t.clientY),s=new us("pointermove",t,{origin:this,mode:"screen",deviceIndex:0,pointerId:i,button:e,clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,buttonName:this.getButtonName(t),device:n,pressure:t.pressure});this.onMove(s)});r(this,"onPointerCancel",t=>{this.context.isInAR||(Ke&&console.log("Pointer cancel",t),this.onPointerUp(t))});r(this,"onPointerUp",t=>{if(this.context.isInAR)return;t.target instanceof HTMLElement&&t.target.releasePointerCapture(t.pointerId);const e=this.getPointerId(t),i=new us("pointerup",t,{origin:this,mode:"screen",deviceIndex:0,pointerId:e,button:t.button,clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,buttonName:this.getButtonName(t),device:this.getAndUpdateSpatialObjectForScreenPosition(e,t.clientX,t.clientY),pressure:t.pressure});this.onUp(i),this._pointerIds[e]=-1,Ke&&console.log("ID="+e,"PointerId="+t.pointerId,"ALL:",[...this._pointerIds])});r(this,"onTouchStart",t=>{if(this.context.isInAR)for(let e=0;e<t.changedTouches.length;e++){const i=t.changedTouches[e],n=this.getPointerIndex(i.identifier),s=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),a=new us("pointerdown",t,{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(a)}});r(this,"onTouchMove",t=>{if(this.context.isInAR)for(let e=0;e<t.changedTouches.length;e++){const i=t.changedTouches[e],n=this.getPointerIndex(i.identifier),s=this.getAndUpdateSpatialObjectForScreenPosition(n,i.clientX,i.clientY),a=new us("pointermove",t,{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(a)}});r(this,"onTouchEnd",t=>{if(this.context.isInAR)for(let e=0;e<t.changedTouches.length;e++){const i=t.changedTouches[e],n=this.getPointerIndex(i.identifier),s=new us("pointerup",t,{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}});r(this,"tempNearPlaneVector",new d.Vector3);r(this,"tempFarPlaneVector",new d.Vector3);r(this,"tempLookMatrix",new d.Matrix4);this.context=t,this.context.post_render_callbacks.push(this.onEndOfFrame)}addEventListener(t,e,i){if(this._eventListeners[t]||(this._eventListeners[t]=[]),!e||typeof e!="function"){console.error("Invalid call to addEventListener: callback is required and must be a function!");return}i?i={...i}:i={};let n=0;(i==null?void 0:i.queue)!=null&&(n=i.queue);const s=this._eventListeners[t],a=s.find(l=>l.priority===n);a?a.listeners.push({callback:e,options:i}):(s.push({priority:n,listeners:[{callback:e,options:i}]}),s.sort((l,c)=>l.priority-c.priority))}removeEventListener(t,e,i){if(!this._eventListeners[t]||!e)return;const n=this._eventListeners[t];if((i==null?void 0:i.queue)!=null){const s=n.find(l=>l.priority===i.queue);if(!s)return;const a=s.listeners.findIndex(l=>l.callback===e);a>=0&&s.listeners.splice(a,1)}else for(const s of n){const a=s.listeners.findIndex(l=>l.callback===e);a>=0&&s.listeners.splice(a,1)}}dispatchEvent(t){var i,n,s,a;let e=!1;if(t instanceof zl){const l=this._eventListeners[t.type];if(l)for(const c of l)for(let h=0;h<c.listeners.length;h++){const u=c.listeners[h];if((n=(i=u.options)==null?void 0:i.signal)!=null&&n.aborted){c.listeners.splice(h,1),h--;continue}u.options.once&&(c.listeners.splice(h,1),h--),u.callback(t)}}if(t instanceof us){const l=this._eventListeners[t.type];if(l)for(const c of l){if(e)break;for(let h=0;h<c.listeners.length;h++){const u=c.listeners[h];if((a=(s=u.options)==null?void 0:s.signal)!=null&&a.aborted){c.listeners.splice(h,1),h--;continue}if(t.immediatePropagationStopped){e=!0,Ke&&console.log("immediatePropagationStopped",t.type);break}else t.propagationStopped&&(e=!0,Ke&&console.log("propagationStopped",t.type));u.options.once&&(c.listeners.splice(h,1),h--),u.callback(t)}}}}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(t=0){return typeof navigator<"u"&&"getGamepads"in navigator&&navigator.getGamepads()[t]||null}setCursorPointer(){this.setCursor("pointer")}setCursorNormal(){this.unsetCursor("pointer")}setCursor(t){this._setCursorTypes.push(t),this._setCursorTypes.length>10&&this._setCursorTypes.shift(),this.updateCursor()}unsetCursor(t){for(let e=this._setCursorTypes.length-1;e>=0;e--)if(this._setCursorTypes[e]===t){this._setCursorTypes.splice(e,1),this.updateCursor();break}}updateCursor(){var t;((t=this._setCursorTypes)==null?void 0:t.length)==0?this.context.domElement.style.cursor="default":this.context.domElement.style.cursor=this._setCursorTypes[this._setCursorTypes.length-1]}getIsPointerIdInUse(t){for(const e of this._pointerEventsPressed)if(e.pointerId===t&&e.used)return!0;return!1}getPointerPressedCount(){let t=0;for(let e=0;e<this._pointerPressed.length;e++)this._pointerPressed[e]&&t++;return t}getPointerPosition(t){return t>=this._pointerPositions.length?null:this._pointerPositions[t]}getPointerPositionLastFrame(t){return t>=this._pointerPositionsLastFrame.length?null:this._pointerPositionsLastFrame[t]}getPointerPositionDelta(t){return t>=this._pointerPositionsDelta.length?null:this._pointerPositionsDelta[t]}getPointerPositionRC(t){return t>=this._pointerPositionsRC.length?null:this._pointerPositionsRC[t]}getPointerDown(t){return t>=this._pointerDown.length?!1:this._pointerDown[t]}getPointerUp(t){return t>=this._pointerUp.length?!1:this._pointerUp[t]}getPointerPressed(t){return t>=this._pointerPressed.length?!1:this._pointerPressed[t]}getPointerClicked(t){return t>=this._pointerClick.length?!1:this._pointerClick[t]}getPointerDoubleClicked(t){return t>=this._pointerDoubleClick.length?!1:this._pointerDoubleClick[t]}getPointerDownTime(t){return t>=this._pointerDownTime.length?-1:this._pointerDownTime[t]}getPointerUpTime(t){return t>=this._pointerUpTime.length?-1:this._pointerUpTime[t]}getPointerLongPress(t){return t>=this._pointerDownTime.length?!1:this.getPointerPressed(t)&&this.context.time.time-this._pointerDownTime[t]>this._longPressTimeThreshold}getIsMouse(t){return t<0||t>=this._pointerTypes.length?!1:this._pointerTypes[t]==="mouse"}getIsTouch(t){return t<0||t>=this._pointerTypes.length?!1:this._pointerTypes[t]==="touch"}getTouchesPressedCount(){let t=0;for(let e=0;e<this._pointerPressed.length;e++)this._pointerPressed[e]&&this.getIsTouch(e)&&t++;return t}getMouseWheelChanged(t=0){return t>=this._mouseWheelChanged.length?!1:this._mouseWheelChanged[t]}getMouseWheelDeltaY(t=0){return t>=this._mouseWheelDeltaY.length?0:this._mouseWheelDeltaY[t]}getPointerEvent(t){if(!(t>=this._pointerEvent.length))return this._pointerEvent[t]??void 0}*foreachPointerId(t){for(let e=0;e<this._pointerTypes.length;e++)if(this._pointerIsActive(e)){if(t!==void 0){const i=this._pointerTypes[e];if(Array.isArray(t)){let n=!1;for(const s of t)if(i===s){n=!0;break}if(!n)continue}else if(t!==i)continue}yield e}}*foreachTouchId(){for(let t=0;t<this._pointerTypes.length;t++)this._pointerTypes[t]==="touch"&&this._pointerIsActive[t]&&(yield t)}_pointerIsActive(t){return t<0?!1:this._pointerPressed[t]||this._pointerDown[t]||this._pointerUp[t]}onDownButton(t,e){let i=this._pressedStack.get(t);i||(i=[],this._pressedStack.set(t,i)),i.push(e)}onReleaseButton(t,e){const i=this._pressedStack.get(t);if(!i)return;const n=i.indexOf(e);n>=0&&i.splice(n,1)}getFirstPressedButtonForPointer(t){const e=this._pressedStack.get(t);if(e)return e[0]}getLatestPressedButtonForPointer(t){const e=this._pressedStack.get(t);if(e)return e[e.length-1]}getKeyDown(t){if(t!==void 0)return this.isKeyDown(t);for(const e in this.keysPressed){const i=this.keysPressed[e];if(i.startFrame===this.context.time.frameCount)return i.key}return null}getKeyPressed(t){if(t!==void 0)return this.isKeyPressed(t);for(const e in this.keysPressed){const i=this.keysPressed[e];if(i.pressed)return i.key}return null}getKeyUp(t){if(t!==void 0)return this.isKeyUp(t);for(const e in this.keysPressed){const i=this.keysPressed[e];return i.pressed===!1&&i.frame===this.context.time.frameCount}return null}isKeyDown(t){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const e=this.getCodeForCommonKeyName(t);if(e!==null){for(const n of e)if(this.isKeyDown(n))return!0;return!1}const i=this.keysPressed[t];return i?i.startFrame===this.context.time.frameCount&&i.pressed:!1}isKeyUp(t){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const e=this.getCodeForCommonKeyName(t);if(e!==null){for(const n of e)if(this.isKeyUp(n))return!0;return!1}const i=this.keysPressed[t];return i?i.frame===this.context.time.frameCount&&i.pressed===!1:!1}isKeyPressed(t){if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const e=this.getCodeForCommonKeyName(t);if(e!==null){for(const n of e)if(this.isKeyPressed(n))return!0;return!1}const i=this.keysPressed[t];return i&&i.pressed||!1}getCodeForCommonKeyName(t){if(t.length===1){if(t>="0"&&t<="9")return["Digit"+t];if(t>="a"&&t<="z")return["Key"+t.toUpperCase()];if(t==" ")return["Space"]}switch(t){case"shift":case"Shift":return["ShiftLeft","ShiftRight"];case"control":case"Control":return["ControlLeft","ControlRight"];case"alt":case"Alt":return["AltLeft","AltRight"]}return null}createInputEvent(t){switch(t.type){case"pointerdown":Ke&&Te("Create Pointer down"),this.onDownButton(t.deviceIndex,t.button),this.onDown(t);break;case"pointermove":Ke&&Te("Create Pointer move"),this.onMove(t);break;case"pointerup":Ke&&Te("Create Pointer up"),this.onUp(t),this.onReleaseButton(t.deviceIndex,t.button);break}}convertScreenspaceToRaycastSpace(t){return t.x=(t.x-this.context.domX)/this.context.domWidth*2-1,t.y=-((t.y-this.context.domY)/this.context.domHeight)*2+1,t}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(){var t,e;window.removeEventListener("contextmenu",this.onContextMenu),(t=this._htmlEventSource)==null||t.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),(e=this._htmlEventSource)==null||e.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 t=this.context.post_render_callbacks.indexOf(this.onEndOfFrame);t>=0&&this.context.post_render_callbacks.splice(t,1),this.unbindEvents()}canReceiveInput(t){var e;return t.target===((e=this.context.renderer)==null?void 0:e.domElement)||t.target===this.context.domElement||this.context.isInAR||this.context.isInAR&&t.target===document.body&&exports.DeviceUtilities.isMozillaXR()?!0:(Ke&&console.warn("CanReceiveInput:False for",t.target),!1)}getPointerId(t,e){return t.pointerType==="mouse"?0+(e??t.button):this.getPointerIndex(t.pointerId)}getButtonName(t){const e=t.button;if(t.pointerType==="mouse")switch(e){case 0:return"left";case 1:return"middle";case 2:return"right"}return"unknown"}getAndUpdateSpatialObjectForScreenPosition(t,e,i){let n=this._pointerSpace[t];n||(n=new d.Object3D,this._pointerSpace[t]=n),this._pointerSpace[t]=n;const s=this.context.mainCamera;if(s){const a=this.tempNearPlaneVector.set(e,i,-1);this.convertScreenspaceToRaycastSpace(a);const l=this.tempFarPlaneVector.set(a.x,a.y,1);a.unproject(s),l.unproject(s);const c=s.worldUp||$(0,1,0).applyQuaternion(_e(s));this.tempLookMatrix.lookAt(l,a,c),n.position.set(a.x,a.y,a.z),n.quaternion.setFromRotationMatrix(this.tempLookMatrix)}return n}isInRect(t){if(this.context.isInXR)return!0;const e=this.context.domElement.getBoundingClientRect(),i=t.clientX,n=t.clientY,s=i>=e.x&&i<=e.right&&n>=e.y&&n<=e.bottom;return Ke&&!s&&console.log("Not in rect",e,i,n),s}onDown(t){const e=t.pointerId;if(this.getPointerPressed(e)&&console.warn(`Received pointerDown for pointerId that is already pressed: ${e}`,Ke?t:""),Ke&&console.log(t.pointerType,"DOWN",e),!!this.isInRect(t)){for(this.setPointerState(e,this._pointerPressed,!0),this.setPointerState(e,this._pointerDown,!0),this.setPointerStateT(e,this._pointerEvent,t.source);e>=this._pointerTypes.length;)this._pointerTypes.push(t.pointerType);for(this._pointerTypes[e]=t.pointerType;e>=this._pointerPositionDown.length;)this._pointerPositionDown.push(new d.Vector3);for(this._pointerPositionDown[e].set(t.clientX,t.clientY,t.clientZ??0);e>=this._pointerPositions.length;)this._pointerPositions.push(new d.Vector2);this._pointerPositions[e].set(t.clientX,t.clientY),e>=this._pointerDownTime.length&&this._pointerDownTime.push(0),this._pointerDownTime[e]=this.context.time.realtimeSinceStartup,this.updatePointerPosition(t),this._pointerEventsPressed.push(t),this.onDispatchEvent(t)}}onMove(t){const e=t.pointerId,i=this.getPointerPressed(e);i===!1&&!this.isInRect(t)||t.pointerType==="touch"&&!i||(this.updatePointerPosition(t),this.setPointerStateT(e,this._pointerEvent,t.source),this.onDispatchEvent(t))}onUp(t){const e=t.pointerId;if(!this.getPointerPressed(e)){Ke&&console.log(t.pointerType,"UP",e,"was not down");return}Ke&&console.log(t.pointerType,"UP",e),this.setPointerState(e,this._pointerPressed,!1),this.setPointerStateT(e,this._pointerEvent,t.source),this.setPointerState(e,this._pointerUp,!0),this.updatePointerPosition(t);for(let c=this._pointerEventsPressed.length-1;c>=0;c--)if(this._pointerEventsPressed[c].pointerId===e){this._pointerEventsPressed.splice(c,1);break}if(!this._pointerPositionDown[e]){Ke&&me("Received pointer up event without matching down event for button: "+e),console.warn("Received pointer up event without matching down event for button: "+e);return}const n=this._pointerUpTime[e],s=this._pointerDownTime[e],a=this.context.time.realtimeSinceStartup,l=a-s;if(e>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),this._pointerUpTime[e]=a,l<1){let c=t.clientX-this._pointerPositionDown[e].x,h=t.clientY-this._pointerPositionDown[e].y,u=0;if(t.isSpatial&&t.clientZ!=null&&(u=t.clientZ-this._pointerPositionDown[e].z,c*=200,h*=200,u*=200),Math.abs(c)<5&&Math.abs(h)<5&&Math.abs(u)<5){this.setPointerState(e,this._pointerClick,!0),t.isClick=!0;const f=a-n;Ke&&console.log("CLICK",e,c,h,u,f),f<this._doubleClickTimeThreshold&&f>0&&(this.setPointerState(e,this._pointerDoubleClick,!0),t.isDoubleClick=!0)}}this.onDispatchEvent(t)}updatePointerPosition(t){const e=t.pointerId;for(;e>=this._pointerPositions.length;)this._pointerPositions.push(new d.Vector2);for(;e>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new d.Vector2);for(;e>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new d.Vector2);const i=this._pointerPositionsLastFrame[e];i.copy(this._pointerPositions[e]);const n=this._pointerPositionsDelta[e];let s=t.clientX-i.x,a=t.clientY-i.y;if(t.source instanceof MouseEvent||t.source instanceof TouchEvent){const u=t.source;s===0&&u.movementX!==0&&(s=u.movementX||0),a===0&&u.movementY!==0&&(a=u.movementY||0)}n.x+=s,n.y+=a,this._pointerPositions[e].x=t.clientX,this._pointerPositions[e].y=t.clientY;const l=t.clientX,c=t.clientY;for(;e>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new d.Vector2);const h=this._pointerPositionsRC[e];h.set(l,c),this.convertScreenspaceToRaycastSpace(h)}getPointerIndex(t){let e=-1;for(let i=0;i<this._pointerIds.length;i++){if(this._pointerIds[i]===t)return i;e===-1&&this._pointerIds[i]===-1&&(e=i)}return e!==-1?(this._pointerIds[e]=t,e):(Ke&&console.log("PUSH pointerId:",t),this._pointerIds.push(t),this._pointerIds.length-1)}setPointerState(t,e,i){e[t]=i}setPointerStateT(t,e,i){return e[t]=i,i}onDispatchEvent(t){const e=Q.Current;try{Q.Current=this.context,this.dispatchEvent(t)}finally{Q.Current=e}}}const Pa=new d.Matrix4().makeRotationY(Math.PI),Fi=new d.Quaternion().setFromAxisAngle(new d.Vector3(0,1,0),Math.PI),iC=x("debugwebxr");class nC{constructor(){r(this,"priority",-1e5);r(this,"gameObject");if(this.gameObject=new d.Object3D,this.gameObject.name="Implicit XR Rig",iC){const t=Ym(16733661);t.position.y+=.5,this.gameObject.add(t)}}isXRRig(){return!0}get isActive(){return this.gameObject.visible}}const rs=x("debugwebxr"),Vh=x("debugcustomgesture"),sC="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",oC="generic-trigger",rC=new d.Quaternion().setFromEuler(new d.Euler(d.MathUtils.degToRad(0),d.MathUtils.degToRad(-90),d.MathUtils.degToRad(-90))),aC=new d.Vector3(.04,-.04,0);class Wm{constructor(t,e,i){r(this,"xr");r(this,"inputSource");r(this,"index",0);r(this,"emitEvents",!0);r(this,"_connected",!0);r(this,"_isTracking",!1);r(this,"__gamepad");r(this,"__hand");r(this,"__side");r(this,"_hitTestSource");r(this,"_hasSelectEvent",!1);r(this,"_isMxInk",!1);r(this,"_isMetaQuestTouchController",!1);r(this,"_handJointPoses",new Map);r(this,"_gripMatrix",new d.Matrix4);r(this,"_gripPosition",new d.Vector3);r(this,"_gripQuaternion",new d.Quaternion);r(this,"_linearVelocity",new d.Vector3);r(this,"_rayPositionRaw",new d.Vector3);r(this,"_rayRotationRaw",new d.Quaternion);r(this,"_rayMatrix",new d.Matrix4);r(this,"_rayPosition",new d.Vector3);r(this,"_rayQuaternion",new d.Quaternion);r(this,"_gripWorldPosition",new d.Vector3);r(this,"_gripWorldQuaternion",new d.Quaternion);r(this,"_rayWorldPosition",new d.Vector3);r(this,"_rayWorldQuaternion",new d.Quaternion);r(this,"_pinchPosition",new d.Vector3);r(this,"_ray");r(this,"_hand_wristDotUp");r(this,"_object");r(this,"_gripSpaceObject");r(this,"_raySpaceObject");r(this,"model",null);r(this,"_debugAxesHelper",new d.AxesHelper(.15));r(this,"_debugGripAxesHelper",new d.AxesHelper(.07));r(this,"_debugRayAxesHelper",new d.AxesHelper(.07));r(this,"_hitTestSourcePromise",null);r(this,"onPointerHits",t=>{});r(this,"_needleGamepadButtons",{});r(this,"_buttonMap",new Map);r(this,"_motioncontroller");r(this,"_layout");r(this,"getMotionController");r(this,"emitPointerDownEvent",!0);r(this,"emitPointerUpEvent",!0);r(this,"emitPointerMoveEvent",!0);r(this,"pointerMoveDistanceThreshold",.03);r(this,"pointerMoveAngleThreshold",.05);r(this,"_selectButtonIndex");r(this,"_squeezeButtonIndex");r(this,"onSelectStart",t=>{var n,s,a,l;if(!this.emitPointerDownEvent||this.inputSource!==t.inputSource)return;this.onUpdateFrame(t.frame),this._hasSelectEvent=!0;const e=(n=this._layout)==null?void 0:n.selectComponentId,i=(l=(a=(s=this._layout)==null?void 0:s.components[e])==null?void 0:a.gamepadIndices)==null?void 0:l.button;i!==void 0&&(this._selectButtonIndex=i),!Vh&&(rs&&V.DrawDirection(this.rayWorldPosition,$(0,.01,1).applyQuaternion(this.rayWorldQuaternion),16711680,10),this.emitPointerEvent(Ee.PointerDown,this._selectButtonIndex||0,"xr-standard-trigger",!0,t))});r(this,"onSelectEnd",t=>{this.emitPointerUpEvent&&(Vh||this.inputSource===t.inputSource&&this.emitPointerEvent(Ee.PointerUp,this._selectButtonIndex||0,"xr-standard-trigger",!0,t))});r(this,"onSequeezeStart",t=>{var e,i,n;this.emitPointerDownEvent&&this.inputSource===t.inputSource&&(this._squeezeButtonIndex=(n=(i=(e=this._layout)==null?void 0:e.components["xr-standard-squeeze"])==null?void 0:i.gamepadIndices)==null?void 0:n.button,this._squeezeButtonIndex!==void 0&&(rs&&V.DrawDirection(this.rayWorldPosition,$(0,.01,1).applyQuaternion(this.rayWorldQuaternion),255,10),this.emitPointerEvent(Ee.PointerDown,this._squeezeButtonIndex||0,"xr-standard-squeeze",!0,t)))});r(this,"onSequeezeEnd",t=>{this.emitPointerUpEvent&&this.inputSource===t.inputSource&&this._squeezeButtonIndex!==void 0&&this.emitPointerEvent(Ee.PointerUp,this._squeezeButtonIndex||0,"xr-standard-squeeze",!0,t)});r(this,"states",{});r(this,"_didMoveLastFrame",!1);r(this,"_lastPointerMovePosition",new d.Vector3);r(this,"_lastPointerMoveQuaternion",new d.Quaternion);r(this,"pointerInit");this.xr=t,this.inputSource=e,this.index=i,this._object=new d.Object3D,this._object.name=`NeedleXRController_${i}`,rs&&(this._object.add(this._debugAxesHelper),this._gripSpaceObject=new d.Object3D,this._raySpaceObject=new d.Object3D,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 d.Ray,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()}get context(){return this.xr.context}get connected(){return this._connected}get isTracking(){return this._isTracking}get gamepad(){return this.__gamepad??(this.__gamepad=this.inputSource.gamepad)}get isHand(){return this.hand!=null}get hand(){return this.__hand??(this.__hand=this.inputSource.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.__side=this.inputSource.handedness)}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)}get hasSelectEvent(){return this._hasSelectEvent}getHitTest(){return this.xr.getHitTest(this)}getHandJointPose(t,e){var n;if(e=e||this.xr.frame,!this.hand||!(e!=null&&e.getJointPose)||!this.xr.referenceSpace)return null;let i=(n=this._handJointPoses)==null?void 0:n.get(t);return i||(i=e.getJointPose(t,this.xr.referenceSpace),i&&this._handJointPoses.set(t,i),i)}get gripPosition(){return $(this._gripPosition)}get gripQuaternion(){return ln(this._gripQuaternion)}get gripMatrix(){return this._gripMatrix}get gripLinearVelocity(){return $(this._linearVelocity).applyQuaternion(Fi)}get rayPosition(){return $(this._rayPosition)}get rayQuaternion(){return ln(this._rayQuaternion)}get gripWorldPosition(){return $(this._gripWorldPosition)}get gripWorldQuaternion(){return ln(this._gripWorldQuaternion)}get rayWorldPosition(){return $(this._rayWorldPosition)}updateRayWorldPosition(){var e;const t=(e=this.xr.context.mainCamera)==null?void 0:e.parent;this._rayWorldPosition.copy(this._rayPositionRaw),t&&this._rayWorldPosition.applyMatrix4(t.matrixWorld)}get rayWorldQuaternion(){return ln(this._rayWorldQuaternion)}get pinchPosition(){return $(this._pinchPosition)}updateRayWorldQuaternion(){var i;const t=(i=this.xr.context.mainCamera)==null?void 0:i.parent,e=t?_e(t):void 0;this._rayWorldQuaternion.copy(this._rayRotationRaw).multiply(Fi),e&&this._rayWorldQuaternion.premultiply(e)}get ray(){return this._ray.origin.copy(this.rayWorldPosition),this._ray.direction.copy($(0,0,1).applyQuaternion(this.rayWorldQuaternion)),this._ray}get handWristDotUp(){var e;if(this._hand_wristDotUp!==void 0)return this._hand_wristDotUp;const t=(e=this.handObject)==null?void 0:e.joints.wrist;if(t){const i=$(0,1,0).applyQuaternion(t.quaternion),n=$(0,1,0).dot(i);return this._hand_wristDotUp=n}}get isHandUpsideDown(){return this.handWristDotUp!==void 0?this.handWristDotUp<-.7:!1}get isTeleportGesture(){var t;return this.isHandUpsideDown&&((t=this.getGesture("pinch"))==null?void 0:t.isDown)}get object(){return this._object}async getModelUrl(){var t;return(t=this.getMotionController)==null?void 0:t.then(e=>(e==null?void 0:e.assetUrl)||null)}_requestHitTestSource(){var t;return this._hitTestSourcePromise?this._hitTestSourcePromise:this.xr.mode==="immersive-ar"&&this.inputSource.targetRayMode==="tracked-pointer"&&this.xr.session.requestHitTestSourceForTransientInput?this._hitTestSourcePromise=((t=this.xr.session.requestHitTestSourceForTransientInput({profile:this.inputSource.profiles[0],offsetRay:new XRRay}))==null?void 0:t.then(e=>(this._hitTestSourcePromise=null,this.connected?this._hitTestSource=e:(e.cancel(),null))))??null:null}onUpdate(t){this.onUpdateFrame(t),this.updateInputEvents(),this.onUpdateMove()}onRenderDebug(){var s;V.DrawSphere(this.rayWorldPosition,.003),V.DrawDirection(this.rayWorldPosition,$(0,0,10).applyQuaternion(this.rayWorldQuaternion));const e=(this.inputSource.gripSpace?this.gripWorldPosition:this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(.1)),i=this.inputSource.profiles.join(`
135
135
  `);let n=`Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
136
136
  C:${this.connected?"x":"-"} T:${this.isTracking?"x":"-"} Hand:${this.inputSource.hand?"x":"-"} Pen: ${this._isMxInk?"x":"-"}`;if(this.inputSource.hand&&(n+=`
@@ -1556,4 +1556,4 @@ Error:`,l),null}}updateColliderCollisionGroups(t){const e=t[Ft],i=t.membership;l
1556
1556
  justify-content: center;
1557
1557
  gap: .5rem;
1558
1558
  }
1559
- `),ce(this,hr).innerHTML=ce(this,zt).innerHTML,ce(this,hr).style.cssText="display: flex; align-items: center; justify-content: center;",ce(this,zt).innerHTML=ce(this,hr).outerHTML,ce(this,cr).innerHTML=ce(this,zt).outerHTML,ce(this,cr).prepend(ce(this,dr)),qd(im,{element:ce(this,cr)}),(n=ce(this,Aa))==null||n.disconnect(),ce(this,Aa)??nn(this,Aa,new MutationObserver(()=>wl(this,Ka,kx).call(this))),ce(this,Aa).observe(ce(this,zt),{attributes:!0}),Ep&&console.log("Needle Button updated")},kx=function(){ce(this,zt)&&(ce(this,zt).style.display==="none"?this.style.display="none":this.style.display==="none"&&(this.style.display=""))},zc=new WeakMap,r(By,"observedAttributes",["ar","vr","quicklook"]);typeof window<"u"&&!window.customElements.get(Nb)&&window.customElements.define(Nb,By);const Fl=x("debugavatar");class Fy{constructor(t,e,i,n){r(this,"root");r(this,"head");r(this,"leftHand");r(this,"rigthHand");var s;this.root=t,this.head=e,this.leftHand=i,this.rigthHand=n,(s=this.root)==null||s.traverse(a=>a.layers.set(2))}get isValid(){return this.head!==null&&this.head!==void 0}}class Rx{constructor(){r(this,"avatarRegistryUrl",null)}async getOrCreateNewAvatarInstance(t,e){if(!e)return console.error("Can not create avatar: failed to provide id or root object"),null;let i=null;if(typeof e=="string"){if(i=await this.loadAvatar(t,e),!i){const s=new vn;i=C.instantiate(La(e,t.scene),s)}}else i=e;if(!i)return null;const n=this.findAvatar(i);return n.isValid?(Fl&&console.log("[Custom Avatar] valid config",e,Fl?n:""),n):(console.warn("[Custom Avatar] config isn't valid",e,Fl?n:""),null)}async loadAvatar(t,e){if(console.assert(e!=null&&typeof e=="string","Avatar id must not be null"),e.length<=0||!e)return null;if(Fl&&console.log("[Custom Avatar] "+e+", loading..."),e.endsWith(".glb")||(e+=".glb"),this.avatarRegistryUrl===null){const n=await fetch("./"+e);let s=null;if(n.ok){const l=await n.blob();l&&(s=await l.arrayBuffer())}if(!s)return null;const a=await gn().parseSync(t,s,null,0);return(a==null?void 0:a.scene)??null}const i=new H.GLTFLoader;return dg(i,t),new Promise((n,s)=>{const a=this.avatarRegistryUrl+"/"+e;i.load(a,async l=>{await gn().createBuiltinComponents(t,a,l,null,void 0),n(l.scene)},l=>{Fl&&console.log("[Custom Avatar] "+l.loaded/l.total*100+"% loaded of "+l.total/1024+"kB")},l=>{console.error("[Custom Avatar] Error when loading: "+l),n(null)})})}cacheModel(t,e){}findAvatar(t){const e=t;let i=e;i.children.length==1&&(i=t.children[0]);let n=this.findAvatarPart(i,["head"]);const s=this.findAvatarPart(i,["left","hand"]),a=this.findAvatarPart(i,["right","hand"]);if(!n){n=e;const c=new d.Vector3;new d.Box3().setFromObject(n).getSize(c);const h=Math.max(c.x,c.y,c.z);console.warn("[Custom Avatar] Normalizing head scale, it's too big: "+h+" meters! Should be < 0.3m"),h>.3&&n.scale.multiplyScalar(1/h*.3)}return new Fy(e,n,s,a)}findAvatarPart(t,e){const i=t.name.toLowerCase();let n=!0;for(const s of e){if(!n)break;i.indexOf(s)===-1&&(n=!1)}if(n)return t;if(t.children)for(const s of t.children){const a=this.findAvatarPart(s,e);if(a)return a}return null}handleCustomAvatarErrors(t){if(!t.ok)throw Error(t.statusText);return t}}class Ex{get extensionName(){return"DocumentExtension"}onAfterBuildDocument(t){}}class Tx{}const qE=Object.freeze(Object.defineProperty({__proto__:null,ActionBuilder:fe,ActionCollection:Fw,ActionModel:vi,AlignmentConstraint:ih,Animation:Ot,AnimationCurve:wh,AnimationExtension:Gu,AnimationTrackHandler:mf,Animator:_t,AnimatorController:Wi,Antialiasing:Sh,AudioExtension:Br,AudioListener:ws,AudioSource:Hi,AudioTrackHandler:Qa,Avatar:Co,AvatarBlink_Simple:Lr,AvatarEyeLook_Rotation:vg,AvatarLoader:Rx,AvatarMarker:kt,AvatarModel:Fy,Avatar_Brain_LookAt:Rc,Avatar_MouthShapes:rh,Avatar_MustacheShake:_g,Avatar_POI:Ms,AxesHelper:el,BaseUIComponent:qi,BasicIKConstraint:xg,BehaviorExtension:Kg,BehaviorModel:gt,BloomEffect:rf,BoxCollider:zu,BoxGizmo:Nr,BoxHelperComponent:Kn,Button:Fs,CallInfo:bs,Camera:si,CameraTargetReachedEvent:kc,Canvas:Ha,CanvasGroup:Po,CapsuleCollider:Os,ChangeMaterialOnClick:Vg,ChangeTransformOnClick:Fr,CharacterController:Dr,CharacterControllerInput:Es,ChromaticAberration:Ch,Collider:ci,ColorAdjustments:Fo,ColorBySpeedModule:ul,ColorOverLifetimeModule:nf,ContactShadows:ah,ControlTrackHandler:gf,CustomBranding:zr,Deletable:Mg,DeleteBox:Na,DepthOfField:Sn,DeviceFlag:Nu,DocumentExtension:Ex,DragControls:nr,DropListener:Ts,Duplicatable:Rg,EffectWrapper:Dc,EmissionModule:js,EmphasizeOnClick:sl,EnvironmentScene:wf,EventList:ye,EventListEvent:Iu,EventSystem:Ht,EventTrigger:$u,FieldWithDefault:xw,FixedJoint:dy,Fog:cl,GltfExport:Fg,GltfExportBox:jg,Gradient:$r,Graphic:gh,GraphicRaycaster:ju,GridHelper:hl,GridLayoutGroup:ny,GroundProjectedEnv:es,GroupActionModel:fo,HideOnStart:$a,HingeJoint:_h,HorizontalLayoutGroup:iy,Image:ml,InheritVelocityModule:my,InputField:Ry,InstanceHandle:Ec,InstancingHandler:Va,Interactable:Pg,Keyframe:oi,LODGroup:vh,LODModel:dl,Light:ui,LimitVelocityOverLifetimeModule:st,LogStats:Cg,LookAt:Ey,LookAtConstraint:Ar,MainModule:Tt,MaskableGraphic:yh,MeshCollider:To,MeshRenderer:ch,MinMaxCurve:q,MinMaxGradient:Wr,NeedleMenu:is,NestedGltf:Ju,Networking:fy,NoiseModule:be,ObjectRaycaster:ki,OffsetConstraint:Vr,OpenURL:gl,OrbitControls:ge,Outline:ll,Padding:Ur,ParticleBurst:lu,ParticleSubEmitter:gy,ParticleSystem:Lc,ParticleSystemRenderer:Zi,PhysicsExtension:Zg,PixelationEffect:Ph,PlayAnimationOnClick:Tc,PlayAudioOnClick:So,PlayableDirector:Ya,PlayerColor:qa,PointerEventData:sh,PostProcessingHandler:wy,PreliminaryAction:ol,PreliminaryTrigger:uh,RawImage:bf,Rect:$w,RectTransform:bn,ReflectionProbe:Wu,RegisteredAnimationInfo:po,RemoteSkybox:lf,Renderer:Ri,RendererLightmap:ou,Rigidbody:tt,RotationBySpeedModule:Ki,RotationOverLifetimeModule:xn,SceneSwitcher:We,ScreenCapture:Uo,ScreenSpaceAmbientOcclusion:Bs,ScreenSpaceAmbientOcclusionN8:Cn,SetActiveOnClick:$g,ShadowCatcher:Rh,ShapeModule:py,SharpeningEffect:Oh,SignalAsset:pf,SignalReceiver:Dh,SignalReceiverEvent:Lh,SignalTrackHandler:Ic,Size:Vw,SizeBySpeedModule:fi,SizeOverLifetimeModule:Gr,SkinnedMeshRenderer:Ig,SmoothFollow:hf,SpatialGrabRaycaster:Cr,SpatialHtml:Bh,SpatialTrigger:df,SpatialTriggerReceiver:Xn,SpectatorCamera:uf,SphereCollider:tl,Sprite:Ls,SpriteData:Ta,SpriteRenderer:hi,SpriteSheet:Ga,SubEmitterSystem:cu,SyncedCamera:Sy,SyncedRoom:Pn,SyncedTransform:Yn,TapGestureTrigger:Gg,TeleportTarget:Yu,TestRunner:Cy,TestSimulateUserData:Py,Text:Et,TextBuilder:ey,TextExtension:Zu,TextureSheetAnimationModule:At,TiltShiftEffect:os,ToneMappingEffect:Xa,TrailModule:je,TransformData:$e,TransformGizmo:Qr,TriggerBuilder:yt,TriggerModel:wo,UIRaycastUtils:pg,UIRootComponent:ph,USDZExporter:qn,USDZText:sr,USDZUIExtension:oy,UsageMarker:lh,VariantAction:Ng,VelocityOverLifetimeModule:Ue,VerticalLayoutGroup:ty,VideoPlayer:it,Vignette:Xr,VisibilityAction:fh,Voip:Eo,Volume:pl,VolumeParameter:U,VolumeProfile:sf,WebARCameraBackground:Uh,WebARSessionRoot:Zn,WebXR:Ku,WebXRImageTracking:Bc,WebXRImageTrackingModel:zs,WebXRPlaneTracking:Ns,WebXRTrackedImage:jc,XRControllerFollow:Us,XRControllerModel:Jn,XRControllerMovement:Ei,XRFlag:Ni,XRRig:Sf,XRState:Gt,__Ignore:Tx},Symbol.toStringTag,{value:"Module"})),fu=x("debugmissingcamera");he.registerCallback(de.MissingCamera,o=>{var l,c,h,u;fu&&console.warn("Creating missing camera");const t=o.context.scene,e=new d.PerspectiveCamera;e.name="Default Fallback Camera",t.add(e);const i=new si;if(i.sourceId=((c=(l=o.files)==null?void 0:l[0])==null?void 0:c.src)??"unknown",i.fieldOfView=35,o.context.domElement.getAttribute("transparent")!=null)i.clearFlags=vo.Uninitialized;else if((h=o.context.domElement.getAttribute("skybox-image"))!=null&&h.length||(u=o.context.domElement.getAttribute("background-image"))!=null&&u.length||o.context.lightmaps.tryGetSkybox(i.sourceId))i.clearFlags=vo.Skybox,i.backgroundBlurriness=.2;else{if(i.clearFlags=vo.SolidColor,!o.context.domElement.getAttribute("background-color")){let f="#efefef";typeof window!==void 0&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(f="#1f1f1f"),t.background=new d.Color(f)}if(!t.environment){const f=new d.PMREMGenerator$1(o.context.renderer),m=new wf("neutral");t.environment=f.fromScene(m,.025).texture}}const s=mr(e,i,!0);e.position.x=0,e.position.y=1,e.position.z=2;const a=o.context.domElement;return(a==null?void 0:a.cameraControls)!=!1&&Ax(o.context,s),s});he.registerCallback(de.ContextCreated,o=>{if(!o.context.mainCamera){fu&&console.log("Will not auto-fit because a default camera exists");return}const t=o.context.domElement;if((t==null?void 0:t.cameraControls)==!0){const e=o0(o.context.mainCamera);if((e==null?void 0:e.isCameraController)==!0){fu&&console.log("Will not auto-fit because a camera controller exists");return}Ax(o.context)}});function Ax(o,t){t=t??o.mainCameraComponent;const e=t==null?void 0:t.gameObject;if(fu&&console.log("Creating default camera controls",t==null?void 0:t.name),e){const i=Yc(e,ge);i.sourceId=(t==null?void 0:t.sourceId)??"unknown";const n=o.domElement.getAttribute("auto-rotate");if(i.autoRotate=n!=null&&n!="0"&&(n==null?void 0:n.toLowerCase())!="false",i.autoRotateSpeed=.5,i.autoFit=!0,i.autoRotate&&n){const s=parseFloat(n);isNaN(s)||(i.autoRotateSpeed=s)}}else console.warn("Missing camera object, can not add orbit controls")}he.registerCallback(de.ContextCreated,o=>{const t=o.context.domElement.getAttribute("autoplay");if(t!==void 0&&(t===""||t==="true"||t==="1")&&o.files)for(const e of o.files)C.foreachComponent(e.file.scene,n=>{if(n.enabled!==!1){if(n instanceof Ot&&n.playAutomatically||n instanceof _t||n instanceof Ya&&n.playOnAwake===!0)return!0;if(n instanceof Ot)return n.playAutomatically=!0,!0;if(n instanceof Ya)return n.playOnAwake=!0,!0}},!0)!==!0&&Ua.assignAnimationsFromFile(e.file,{createAnimationComponent:(n,s)=>Pi(n,Ot)})});class XE extends re.WorkerBase{constructor(){super(new Worker(new URL("/generateMeshBVH.worker-Cdfpaq5W.js",typeof document>"u"?require("url").pathToFileURL(__filename).href:Pf&&Pf.tagName.toUpperCase()==="SCRIPT"&&Pf.src||new URL("needle-engine.bundle-CsiSPuug.light.umd.cjs",document.baseURI).href),{type:"module"})),this.name="GenerateMeshBVHWorker"}runTask(t,e,i={}){return new Promise((n,s)=>{if(e.getAttribute("position").isInterleavedBufferAttribute||e.index&&e.index.isInterleavedBufferAttribute)throw new Error("GenerateMeshBVHWorker: InterleavedBufferAttribute are not supported for the geometry attributes.");t.onerror=h=>{s(new Error(`[GenerateMeshBVHWorker] ${h.message||"Unknown error. Please check the server console. If you're using vite try adding 'three-mesh-bvh' to 'optimizeDeps.exclude' in your vite.config.js"}`))},t.onmessage=h=>{const{data:u}=h;if(u.error)s(new Error(u.error)),t.onmessage=null;else if(u.serialized){const{serialized:f,position:m}=u,g=re.MeshBVH.deserialize(f,e,{setIndex:!1}),y=Object.assign({setBoundingBox:!0},i);if(e.attributes.position.array=m,f.index)if(e.index)e.index.array=f.index;else{const _=new d.BufferAttribute(f.index,1,!1);e.setIndex(_)}y.setBoundingBox&&(e.boundingBox=g.getBoundingBox(new d.Box3)),i.onProgress&&i.onProgress(u.progress),n(g),t.onmessage=null}else i.onProgress&&i.onProgress(u.progress)};const a=e.index?e.index.array:null,l=e.attributes.position.array,c=[l];a&&c.push(a),t.postMessage({index:a,position:l,options:{...i,onProgress:null,includedProgressCallback:!!i.onProgress,groups:[...e.groups]}},c.map(h=>h.buffer).filter(h=>typeof SharedArrayBuffer>"u"||!(h instanceof SharedArrayBuffer)))})}}const QE=Object.freeze(Object.defineProperty({__proto__:null,GenerateMeshBVHWorker:XE},Symbol.toStringTag,{value:"Module"}));exports.$physicsKey=$P;exports.ActionBuilder=fe;exports.ActionCollection=Fw;exports.ActionModel=vi;exports.Addressables=xv;exports.AlignmentConstraint=ih;exports.AmbientMode=ka;exports.Animation=Ot;exports.AnimationCurve=wh;exports.AnimationExtension=Gu;exports.AnimationTrackHandler=mf;exports.AnimationUtils=Ua;exports.Animator=_t;exports.AnimatorConditionMode=eo;exports.AnimatorController=Wi;exports.AnimatorControllerParameterType=ug;exports.AnimatorStateInfo=Gl;exports.Antialiasing=Sh;exports.Application=yn;exports.AssetDatabase=U0;exports.AssetReference=te;exports.AudioExtension=Br;exports.AudioListener=ws;exports.AudioSource=Hi;exports.AudioTrackHandler=Qa;exports.Avatar=Co;exports.AvatarBlink_Simple=Lr;exports.AvatarEyeLook_Rotation=vg;exports.AvatarLoader=Rx;exports.AvatarMarker=kt;exports.AvatarModel=Fy;exports.Avatar_Brain_LookAt=Rc;exports.Avatar_MouthShapes=rh;exports.Avatar_MustacheShake=_g;exports.Avatar_POI=Ms;exports.Axes=ma;exports.AxesHelper=el;exports.BUILD_TIME=zm;exports.BaseUIComponent=qi;exports.BasicIKConstraint=xg;exports.BehaviorExtension=Kg;exports.BehaviorModel=gt;exports.BloomEffect=rf;exports.BoxCollider=zu;exports.BoxGizmo=Nr;exports.BoxHelperComponent=Kn;exports.Button=Fs;exports.ButtonsFactory=jn;exports.CallDirection=nw;exports.CallInfo=bs;exports.Camera=si;exports.CameraTargetReachedEvent=kc;exports.Canvas=Ha;exports.CanvasGroup=Po;exports.CapsuleCollider=Os;exports.ChangeMaterialOnClick=Vg;exports.ChangeTransformOnClick=Fr;exports.CharacterController=Dr;exports.CharacterControllerInput=Es;exports.ChromaticAberration=Ch;exports.CircularBuffer=Mi;exports.ClearFlags=vo;exports.ClipExtrapolation=Rn;exports.Collider=ci;exports.Collision=ew;exports.CollisionDetectionMode=Du;exports.ColorAdjustments=Fo;exports.ColorBySpeedModule=ul;exports.ColorOverLifetimeModule=nf;exports.Component=X1;exports.Component$1=L;exports.ComponentLifecycleEvents=qc;exports.Components=qE;exports.ConnectionEvents=L0;exports.ContactPoint=Jv;exports.ContactShadows=ah;exports.Context=Q;exports.ContextArgs=B1;exports.ContextEvent=de;exports.ContextRegistry=he;exports.ControlTrackHandler=gf;exports.CustomBranding=zr;exports.CustomShader=iu;exports.DefaultReflectionMode=Hd;exports.Deletable=Mg;exports.DeleteBox=Na;exports.DepthOfField=Sn;exports.DeviceFlag=Nu;exports.DocumentExtension=Ex;exports.DragControls=nr;exports.DragMode=Og;exports.DropListener=Ts;exports.Duplicatable=Rg;exports.EffectWrapper=Dc;exports.EmissionModule=js;exports.EmphasizeOnClick=sl;exports.EngineLoadingView=uu;exports.EnvironmentScene=wf;exports.EventList=ye;exports.EventListEvent=Iu;exports.EventSystem=Ht;exports.EventTrigger=$u;exports.FieldWithDefault=xw;exports.FileReference=Pc;exports.FileReferenceSerializer=Cv;exports.FileSpawnModel=uM;exports.File_Event=lw;exports.FixedJoint=dy;exports.Fog=cl;exports.FrameEvent=we;exports.GENERATOR=Su;exports.GameObject=C;exports.Gizmos=V;exports.GltfExport=Fg;exports.GltfExportBox=jg;exports.Gradient=$r;exports.Graphic=gh;exports.GraphicRaycaster=ju;exports.Graphics=Ui;exports.GridHelper=hl;exports.GridLayoutGroup=ny;exports.GroundProjectedEnv=es;exports.GroupActionModel=fo;exports.HideFlags=Bu;exports.HideOnStart=$a;exports.HingeJoint=_h;exports.HorizontalLayoutGroup=iy;exports.HostData=NC;exports.Image=ml;exports.ImageReference=Cc;exports.ImageReferenceSerializer=Sv;exports.InheritVelocityModule=my;exports.Input=O0;exports.InputEventQueue=ni;exports.InputEvents=Ee;exports.InputField=Ry;exports.InstanceHandle=Ec;exports.InstancingHandler=Va;exports.InstancingUtil=$i;exports.InstantiateEvent=Y0;exports.InstantiateIdProvider=mt;exports.InstantiateOptions=vn;exports.Interactable=Pg;exports.JoinedRoomResponse=uC;exports.KeyEventArgs=tC;exports.Keyframe=oi;exports.LODGroup=vh;exports.LODModel=dl;exports.LeftRoomResponse=fC;exports.Light=ui;exports.LightData=Rv;exports.LimitVelocityOverLifetimeModule=st;exports.LoadingElementOptions=LE;exports.LogStats=Cg;exports.LogType=Ci;exports.LookAt=Ey;exports.LookAtConstraint=Ar;exports.MainModule=Tt;exports.MarkerType=My;exports.MaskableGraphic=yh;exports.Mathf=z;exports.MeshCollider=To;exports.MeshRenderer=ch;exports.MinMaxCurve=q;exports.MinMaxGradient=Wr;exports.NEKeyboardEvent=zl;exports.NEPointerEvent=us;exports.NeedleButtonElement=By;exports.NeedleEngineHTMLElement=jy;exports.NeedleMenu=is;exports.NeedlePatchesKey=yd;exports.NeedleXRController=Wm;exports.NeedleXRSession=Z;exports.NeedleXRSync=j0;exports.NeedleXRUtils=F0;exports.NestedGltf=Ju;exports.NetworkConnection=I0;exports.NetworkedStreamEvents=Bn;exports.NetworkedStreams=oh;exports.Networking=fy;exports.NewInstanceModel=Z0;exports.NoiseModule=be;exports.ObjectRaycaster=ki;exports.ObjectUtils=Ro;exports.OffsetConstraint=Vr;exports.OneEuroFilter=md;exports.OneEuroFilterXYZ=Am;exports.OpenURL=gl;exports.OrbitControls=ge;exports.Outline=ll;exports.OwnershipEvent=D0;exports.OwnershipModel=Xm;exports.PUBLIC_KEY=ua;exports.Padding=Ur;exports.ParticleBurst=lu;exports.ParticleSubEmitter=gy;exports.ParticleSystem=Lc;exports.ParticleSystemBaseBehaviour=Bo;exports.ParticleSystemRenderer=Zi;exports.ParticleSystemShapeType=au;exports.PeerHandle=Ra;exports.PeerNetworking=A0;exports.Physics=vc;exports.PhysicsExtension=Zg;exports.PhysicsMaterialCombine=rt;exports.PixelationEffect=Ph;exports.PlayAnimationOnClick=Tc;exports.PlayAudioOnClick=So;exports.PlayableDirector=Ya;exports.PlayerColor=qa;exports.PlayerState=fn;exports.PlayerStateEvent=Nw;exports.PlayerSync=Qg;exports.PlayerView=Mv;exports.PlayerViewManager=Ov;exports.PointerEventData=sh;exports.PointerType=Mu;exports.PostProcessingEffect=qe;exports.PostProcessingHandler=wy;exports.PreliminaryAction=ol;exports.PreliminaryTrigger=uh;exports.PrimitiveType=vr;exports.Progress=oe;exports.PromiseAllWithErrors=Em;exports.PromiseErrorResult=Lp;exports.RGBAColor=ie;exports.RapierPhysics=Mm;exports.RawImage=bf;exports.RaycastOptions=Qn;exports.Rect=$w;exports.RectTransform=bn;exports.ReflectionProbe=Wu;exports.RegisteredAnimationInfo=po;exports.RemoteSkybox=lf;exports.RenderTexture=yr;exports.RenderTextureSerializer=Qv;exports.Renderer=Ri;exports.RendererData=kv;exports.RendererLightmap=ou;exports.Rigidbody=tt;exports.RigidbodyConstraints=ze;exports.RoomEvents=J;exports.RotationBySpeedModule=Ki;exports.RotationOverLifetimeModule=xn;exports.SceneLightSettings=eu;exports.SceneSwitcher=We;exports.ScreenCapture=Uo;exports.ScreenSpaceAmbientOcclusion=Bs;exports.ScreenSpaceAmbientOcclusionN8=Cn;exports.SendQueue=cn;exports.SerializationContext=og;exports.SetActiveOnClick=$g;exports.ShadowCatcher=Rh;exports.ShapeModule=py;exports.SharpeningEffect=Oh;exports.SignalAsset=pf;exports.SignalReceiver=Dh;exports.SignalReceiverEvent=Lh;exports.SignalTrackHandler=Ic;exports.Size=Vw;exports.SizeBySpeedModule=fi;exports.SizeOverLifetimeModule=Gr;exports.SkinnedMeshRenderer=Ig;exports.SmoothFollow=hf;exports.SpatialGrabRaycaster=Cr;exports.SpatialHtml=Bh;exports.SpatialTrigger=df;exports.SpatialTriggerReceiver=Xn;exports.SpectatorCamera=uf;exports.SphereCollider=tl;exports.SphereIntersection=Km;exports.SphereOverlapResult=tw;exports.Sprite=Ls;exports.SpriteData=Ta;exports.SpriteRenderer=hi;exports.SpriteSheet=Ga;exports.StateMachineBehaviour=eP;exports.StreamEndedEvent=gg;exports.StreamReceivedEvent=iw;exports.SubEmitterSystem=cu;exports.SyncedCamera=Sy;exports.SyncedRoom=Pn;exports.SyncedTransform=Yn;exports.TapGestureTrigger=Gg;exports.TeleportTarget=Yu;exports.TestRunner=Cy;exports.TestSceneUtils=NE;exports.TestSimulateUserData=Py;exports.Text=Et;exports.TextBuilder=ey;exports.TextExtension=Zu;exports.TextureSheetAnimationModule=At;exports.TiltShiftEffect=os;exports.Time=Ev;exports.ToneMappingEffect=Xa;exports.TrackHandler=Ih;exports.TrackType=gi;exports.TrailModule=je;exports.TransformData=$e;exports.TransformGizmo=Qr;exports.TriggerBuilder=yt;exports.TriggerModel=wo;exports.TypeStore=O;exports.UIRaycastUtils=pg;exports.UIRootComponent=ph;exports.USDDocument=Ug;exports.USDObject=Mt;exports.USDWriter=kw;exports.USDZExporter=qn;exports.USDZExporter$1=Rw;exports.USDZText=sr;exports.USDZUIExtension=oy;exports.UriSerializer=Yv;exports.UsageMarker=lh;exports.UserJoinedOrLeftRoomModel=pC;exports.VERSION=pn;exports.VariantAction=Ng;exports.VelocityOverLifetimeModule=Ue;exports.VerticalLayoutGroup=ty;exports.VideoPlayer=it;exports.ViewDevice=yo;exports.Vignette=Xr;exports.VisibilityAction=fh;exports.Voip=Eo;exports.Volume=pl;exports.VolumeParameter=U;exports.VolumeProfile=sf;exports.WaitForFrames=g1;exports.WaitForPromise=Pv;exports.WaitForSeconds=lg;exports.Watch=Cs;exports.WebARCameraBackground=Uh;exports.WebARSessionRoot=Zn;exports.WebXR=Ku;exports.WebXRButtonFactory=xo;exports.WebXRImageTracking=Bc;exports.WebXRImageTrackingModel=zs;exports.WebXRPlaneTracking=Ns;exports.WebXRTrackedImage=jc;exports.XRControllerFollow=Us;exports.XRControllerModel=Jn;exports.XRControllerMovement=Ei;exports.XRFlag=Ni;exports.XRRig=Sf;exports.XRState=Gt;exports.XRStateFlag=Ln;exports.__Ignore=Tx;exports.__internalNotifyObjectDestroyed=W0;exports.activeInHierarchyFieldName=Ps;exports.addAttributeChangeCallback=Yb;exports.addComponent=Pi;exports.addCustomExtensionPlugin=DM;exports.addNewComponent=mr;exports.addPatch=Cu;exports.apply=Ru;exports.applyHMRChanges=q1;exports.applyPrototypeExtensions=hv;exports.beginListenDestroy=K0;exports.beginListenInstantiate=ev;exports.binaryIdentifierCasts=Gm;exports.build_scene_functions=j1;exports.builtinComponentKeyName=Qo;exports.calculateProgress01=Iy;exports.clearMessages=mS;exports.colorSerializer=wP;exports.compareAssociation=sv;exports.componentSerializer=Pd;exports.copyTexture=u0;exports.createMotion=Vv;exports.debugNet=Kt;exports.debugOwner=Nl;exports.decompressGpuTexture=Lw;exports.deepClone=Vc;exports.delay=mn;exports.delayForFrames=$c;exports.deserializeObject=Wd;exports.destroy=Oi;exports.destroyComponentInstance=fv;exports.determineMimeTypeFromExtension=cw;exports.disposeObjectResources=Se;exports.disposeStream=Fn;exports.editorGuidKeyName=Jl;exports.enableSpatialConsole=fr;exports.euler=SP;exports.eventListSerializer=OP;exports.exportAsGLTF=WE;exports.findByGuid=ag;exports.findObjectOfType=Jc;exports.findObjectsOfType=mv;exports.findResourceUsers=Jm;exports.fitObjectIntoVolume=p0;exports.foreachComponent=xr;exports.foreachComponentEnumerator=Tu;exports.forward=ES;exports.generateQRCode=Zb;exports.generateSeed=J0;exports.getBoundingBox=ri;exports.getCameraController=o0;exports.getComponent=Rr;exports.getComponentInChildren=Zc;exports.getComponentInParent=Sc;exports.getComponents=Kc;exports.getComponentsInChildren=Za;exports.getComponentsInParent=ku;exports.getFormattedDate=Cw;exports.getIconElement=pt;exports.getIconTexture=tm;exports.getLoader=gn;exports.getOrAddComponent=Yc;exports.getParam=x;exports.getParentHierarchyPath=LS;exports.getPath=Xx;exports.getPeerOptions=lC;exports.getPeerjsInstance=T0;exports.getResourceUserCount=AC;exports.getTempColor=l0;exports.getTempQuaternion=ln;exports.getTempVector=$;exports.getUrlParams=Nc;exports.getVisibleInCustomShadowRendering=f0;exports.getWorldDirection=c0;exports.getWorldEuler=Im;exports.getWorldPosition=K;exports.getWorldQuaternion=_e;exports.getWorldRotation=xu;exports.getWorldScale=Fe;exports.hasCommercialLicense=Hn;exports.hasIndieLicense=th;exports.hasPointerEventComponent=Yd;exports.hasProLicense=Gn;exports.hideDebugConsole=_0;exports.imageToCanvas=Dw;exports.instantiate=Sr;exports.invokeLoadedImportPluginHooks=_w;exports.invokeXRSessionEnd=M0;exports.invokeXRSessionStart=P0;exports.isActiveInHierarchy=gv;exports.isActiveSelf=Ja;exports.isAndroidDevice=eS;exports.isAnimationAction=d0;exports.isComponent=Zv;exports.isDebugMode=Wx;exports.isDesktop=Yx;exports.isDestroyed=wr;exports.isDevEnvironment=F;exports.isDisposed=EC;exports.isExporting=VE;exports.isGLTFModel=Kv;exports.isHostedOnGlitch=$b;exports.isHotReloadEnabled=om;exports.isHotReloading=G1;exports.isIPad=Zx;exports.isIconElement=Av;exports.isLocalNetwork=qt;exports.isMacOS=iS;exports.isMobileDevice=Kx;exports.isMozillaXR=tS;exports.isQuest=oS;exports.isResourceTrackingEnabled=N0;exports.isSafari=sS;exports.isUsingInstancing=Eu;exports.isiOS=nS;exports.isiPad=Jx;exports.loadAsset=OE;exports.loadSync=Dy;exports.logHierarchy=jd;exports.lookAtInverse=xS;exports.lookAtObject=Wc;exports.lookAtScreenPoint=SS;exports.makeId=Hx;exports.makeIdFromRandomWords=qb;exports.makeNameSafe=_n;exports.markAsInstancedRendered=yv;exports.microphonePermissionsGranted=rS;exports.nameof=$x;exports.nameofFactory=Gb;exports.objectSerializer=Xv;exports.offXRSessionEnd=eC;exports.offXRSessionStart=JS;exports.onAfterRender=fP;exports.onBeforeRender=uP;exports.onClear=hP;exports.onDestroy=dP;exports.onInitialized=$v;exports.onStart=Wv;exports.onUpdate=Gv;exports.onXRSessionEnd=$m;exports.onXRSessionStart=Pu;exports.parseSync=xx;exports.placeOnSurface=m0;exports.postprocessFBXMaterials=Fm;exports.prefix=mP;exports.pushState=Hb;exports.randomNumber=qx;exports.registerBinaryType=Hm;exports.registerComponent=Au;exports.registerComponentExtension=Ag;exports.registerCustomEffectType=Ji;exports.registerExportExtensions=Lg;exports.registerExtensions=su;exports.registerHotReloadType=Fv;exports.registerLoader=Nm;exports.registerPrefabProvider=iv;exports.registerPrototypeExtensions=dv;exports.registerType=HC;exports.relativePathPrefix=Qb;exports.removeAttributeChangeCallback=Kb;exports.removeComponent=rg;exports.removeCustomImportExtensionType=IM;exports.removePatch=KS;exports.resolveUrl=Mo;exports.sanitizeString=Xb;exports.saveImage=_x;exports.screenshot=hE;exports.screenshot2=Ay;exports.sendDestroyed=tg;exports.serializable=p;exports.serializeObject=rv;exports.serializeable=Er;exports.setActive=ic;exports.setAllowBalloonMessages=i0;exports.setAllowOverlayMessages=dS;exports.setAutoFitEnabled=Dd;exports.setCameraController=jp;exports.setDestroyed=bv;exports.setDevEnvironment=NS;exports.setDisposable=Zm;exports.setDontDestroy=aa;exports.setOrAddParamsToUrl=Ap;exports.setParam=Gx;exports.setParamWithoutReload=yc;exports.setPeerOptions=cC;exports.setResourceTrackingEnabled=RC;exports.setState=km;exports.setVisibleInCustomShadowRendering=Bm;exports.setWorldEuler=jm;exports.setWorldPosition=et;exports.setWorldPositionXYZ=br;exports.setWorldQuaternion=Gi;exports.setWorldQuaternionXYZW=Dm;exports.setWorldRotation=h0;exports.setWorldRotationXYZ=Gc;exports.setWorldScale=Da;exports.showBalloonError=Hc;exports.showBalloonMessage=Te;exports.showBalloonWarning=me;exports.showDebugConsole=Um;exports.slerp=wS;exports.syncDestroy=Xc;exports.syncField=Xg;exports.syncInstantiate=ig;exports.textureToCanvas=DS;exports.tryCastBinary=R0;exports.tryDetermineMimetypeFromBinary=dw;exports.tryDetermineMimetypeFromURL=hw;exports.tryFindObject=La;exports.tryGetGuid=E0;exports.unregisterHotReloadType=Uv;exports.unwatchWrite=Rm;exports.useForAutoFit=r0;exports.validate=bt;exports.watchWrite=wu;
1559
+ `),ce(this,hr).innerHTML=ce(this,zt).innerHTML,ce(this,hr).style.cssText="display: flex; align-items: center; justify-content: center;",ce(this,zt).innerHTML=ce(this,hr).outerHTML,ce(this,cr).innerHTML=ce(this,zt).outerHTML,ce(this,cr).prepend(ce(this,dr)),qd(im,{element:ce(this,cr)}),(n=ce(this,Aa))==null||n.disconnect(),ce(this,Aa)??nn(this,Aa,new MutationObserver(()=>wl(this,Ka,kx).call(this))),ce(this,Aa).observe(ce(this,zt),{attributes:!0}),Ep&&console.log("Needle Button updated")},kx=function(){ce(this,zt)&&(ce(this,zt).style.display==="none"?this.style.display="none":this.style.display==="none"&&(this.style.display=""))},zc=new WeakMap,r(By,"observedAttributes",["ar","vr","quicklook"]);typeof window<"u"&&!window.customElements.get(Nb)&&window.customElements.define(Nb,By);const Fl=x("debugavatar");class Fy{constructor(t,e,i,n){r(this,"root");r(this,"head");r(this,"leftHand");r(this,"rigthHand");var s;this.root=t,this.head=e,this.leftHand=i,this.rigthHand=n,(s=this.root)==null||s.traverse(a=>a.layers.set(2))}get isValid(){return this.head!==null&&this.head!==void 0}}class Rx{constructor(){r(this,"avatarRegistryUrl",null)}async getOrCreateNewAvatarInstance(t,e){if(!e)return console.error("Can not create avatar: failed to provide id or root object"),null;let i=null;if(typeof e=="string"){if(i=await this.loadAvatar(t,e),!i){const s=new vn;i=C.instantiate(La(e,t.scene),s)}}else i=e;if(!i)return null;const n=this.findAvatar(i);return n.isValid?(Fl&&console.log("[Custom Avatar] valid config",e,Fl?n:""),n):(console.warn("[Custom Avatar] config isn't valid",e,Fl?n:""),null)}async loadAvatar(t,e){if(console.assert(e!=null&&typeof e=="string","Avatar id must not be null"),e.length<=0||!e)return null;if(Fl&&console.log("[Custom Avatar] "+e+", loading..."),e.endsWith(".glb")||(e+=".glb"),this.avatarRegistryUrl===null){const n=await fetch("./"+e);let s=null;if(n.ok){const l=await n.blob();l&&(s=await l.arrayBuffer())}if(!s)return null;const a=await gn().parseSync(t,s,null,0);return(a==null?void 0:a.scene)??null}const i=new H.GLTFLoader;return dg(i,t),new Promise((n,s)=>{const a=this.avatarRegistryUrl+"/"+e;i.load(a,async l=>{await gn().createBuiltinComponents(t,a,l,null,void 0),n(l.scene)},l=>{Fl&&console.log("[Custom Avatar] "+l.loaded/l.total*100+"% loaded of "+l.total/1024+"kB")},l=>{console.error("[Custom Avatar] Error when loading: "+l),n(null)})})}cacheModel(t,e){}findAvatar(t){const e=t;let i=e;i.children.length==1&&(i=t.children[0]);let n=this.findAvatarPart(i,["head"]);const s=this.findAvatarPart(i,["left","hand"]),a=this.findAvatarPart(i,["right","hand"]);if(!n){n=e;const c=new d.Vector3;new d.Box3().setFromObject(n).getSize(c);const h=Math.max(c.x,c.y,c.z);console.warn("[Custom Avatar] Normalizing head scale, it's too big: "+h+" meters! Should be < 0.3m"),h>.3&&n.scale.multiplyScalar(1/h*.3)}return new Fy(e,n,s,a)}findAvatarPart(t,e){const i=t.name.toLowerCase();let n=!0;for(const s of e){if(!n)break;i.indexOf(s)===-1&&(n=!1)}if(n)return t;if(t.children)for(const s of t.children){const a=this.findAvatarPart(s,e);if(a)return a}return null}handleCustomAvatarErrors(t){if(!t.ok)throw Error(t.statusText);return t}}class Ex{get extensionName(){return"DocumentExtension"}onAfterBuildDocument(t){}}class Tx{}const qE=Object.freeze(Object.defineProperty({__proto__:null,ActionBuilder:fe,ActionCollection:Fw,ActionModel:vi,AlignmentConstraint:ih,Animation:Ot,AnimationCurve:wh,AnimationExtension:Gu,AnimationTrackHandler:mf,Animator:_t,AnimatorController:Wi,Antialiasing:Sh,AudioExtension:Br,AudioListener:ws,AudioSource:Hi,AudioTrackHandler:Qa,Avatar:Co,AvatarBlink_Simple:Lr,AvatarEyeLook_Rotation:vg,AvatarLoader:Rx,AvatarMarker:kt,AvatarModel:Fy,Avatar_Brain_LookAt:Rc,Avatar_MouthShapes:rh,Avatar_MustacheShake:_g,Avatar_POI:Ms,AxesHelper:el,BaseUIComponent:qi,BasicIKConstraint:xg,BehaviorExtension:Kg,BehaviorModel:gt,BloomEffect:rf,BoxCollider:zu,BoxGizmo:Nr,BoxHelperComponent:Kn,Button:Fs,CallInfo:bs,Camera:si,CameraTargetReachedEvent:kc,Canvas:Ha,CanvasGroup:Po,CapsuleCollider:Os,ChangeMaterialOnClick:Vg,ChangeTransformOnClick:Fr,CharacterController:Dr,CharacterControllerInput:Es,ChromaticAberration:Ch,Collider:ci,ColorAdjustments:Fo,ColorBySpeedModule:ul,ColorOverLifetimeModule:nf,ContactShadows:ah,ControlTrackHandler:gf,CustomBranding:zr,Deletable:Mg,DeleteBox:Na,DepthOfField:Sn,DeviceFlag:Nu,DocumentExtension:Ex,DragControls:nr,DropListener:Ts,Duplicatable:Rg,EffectWrapper:Dc,EmissionModule:js,EmphasizeOnClick:sl,EnvironmentScene:wf,EventList:ye,EventListEvent:Iu,EventSystem:Ht,EventTrigger:$u,FieldWithDefault:xw,FixedJoint:dy,Fog:cl,GltfExport:Fg,GltfExportBox:jg,Gradient:$r,Graphic:gh,GraphicRaycaster:ju,GridHelper:hl,GridLayoutGroup:ny,GroundProjectedEnv:es,GroupActionModel:fo,HideOnStart:$a,HingeJoint:_h,HorizontalLayoutGroup:iy,Image:ml,InheritVelocityModule:my,InputField:Ry,InstanceHandle:Ec,InstancingHandler:Va,Interactable:Pg,Keyframe:oi,LODGroup:vh,LODModel:dl,Light:ui,LimitVelocityOverLifetimeModule:st,LogStats:Cg,LookAt:Ey,LookAtConstraint:Ar,MainModule:Tt,MaskableGraphic:yh,MeshCollider:To,MeshRenderer:ch,MinMaxCurve:q,MinMaxGradient:Wr,NeedleMenu:is,NestedGltf:Ju,Networking:fy,NoiseModule:be,ObjectRaycaster:ki,OffsetConstraint:Vr,OpenURL:gl,OrbitControls:ge,Outline:ll,Padding:Ur,ParticleBurst:lu,ParticleSubEmitter:gy,ParticleSystem:Lc,ParticleSystemRenderer:Zi,PhysicsExtension:Zg,PixelationEffect:Ph,PlayAnimationOnClick:Tc,PlayAudioOnClick:So,PlayableDirector:Ya,PlayerColor:qa,PointerEventData:sh,PostProcessingHandler:wy,PreliminaryAction:ol,PreliminaryTrigger:uh,RawImage:bf,Rect:$w,RectTransform:bn,ReflectionProbe:Wu,RegisteredAnimationInfo:po,RemoteSkybox:lf,Renderer:Ri,RendererLightmap:ou,Rigidbody:tt,RotationBySpeedModule:Ki,RotationOverLifetimeModule:xn,SceneSwitcher:We,ScreenCapture:Uo,ScreenSpaceAmbientOcclusion:Bs,ScreenSpaceAmbientOcclusionN8:Cn,SetActiveOnClick:$g,ShadowCatcher:Rh,ShapeModule:py,SharpeningEffect:Oh,SignalAsset:pf,SignalReceiver:Dh,SignalReceiverEvent:Lh,SignalTrackHandler:Ic,Size:Vw,SizeBySpeedModule:fi,SizeOverLifetimeModule:Gr,SkinnedMeshRenderer:Ig,SmoothFollow:hf,SpatialGrabRaycaster:Cr,SpatialHtml:Bh,SpatialTrigger:df,SpatialTriggerReceiver:Xn,SpectatorCamera:uf,SphereCollider:tl,Sprite:Ls,SpriteData:Ta,SpriteRenderer:hi,SpriteSheet:Ga,SubEmitterSystem:cu,SyncedCamera:Sy,SyncedRoom:Pn,SyncedTransform:Yn,TapGestureTrigger:Gg,TeleportTarget:Yu,TestRunner:Cy,TestSimulateUserData:Py,Text:Et,TextBuilder:ey,TextExtension:Zu,TextureSheetAnimationModule:At,TiltShiftEffect:os,ToneMappingEffect:Xa,TrailModule:je,TransformData:$e,TransformGizmo:Qr,TriggerBuilder:yt,TriggerModel:wo,UIRaycastUtils:pg,UIRootComponent:ph,USDZExporter:qn,USDZText:sr,USDZUIExtension:oy,UsageMarker:lh,VariantAction:Ng,VelocityOverLifetimeModule:Ue,VerticalLayoutGroup:ty,VideoPlayer:it,Vignette:Xr,VisibilityAction:fh,Voip:Eo,Volume:pl,VolumeParameter:U,VolumeProfile:sf,WebARCameraBackground:Uh,WebARSessionRoot:Zn,WebXR:Ku,WebXRImageTracking:Bc,WebXRImageTrackingModel:zs,WebXRPlaneTracking:Ns,WebXRTrackedImage:jc,XRControllerFollow:Us,XRControllerModel:Jn,XRControllerMovement:Ei,XRFlag:Ni,XRRig:Sf,XRState:Gt,__Ignore:Tx},Symbol.toStringTag,{value:"Module"})),fu=x("debugmissingcamera");he.registerCallback(de.MissingCamera,o=>{var l,c,h,u;fu&&console.warn("Creating missing camera");const t=o.context.scene,e=new d.PerspectiveCamera;e.name="Default Fallback Camera",t.add(e);const i=new si;if(i.sourceId=((c=(l=o.files)==null?void 0:l[0])==null?void 0:c.src)??"unknown",i.fieldOfView=35,o.context.domElement.getAttribute("transparent")!=null)i.clearFlags=vo.Uninitialized;else if((h=o.context.domElement.getAttribute("skybox-image"))!=null&&h.length||(u=o.context.domElement.getAttribute("background-image"))!=null&&u.length||o.context.lightmaps.tryGetSkybox(i.sourceId))i.clearFlags=vo.Skybox,i.backgroundBlurriness=.2;else{if(i.clearFlags=vo.SolidColor,!o.context.domElement.getAttribute("background-color")){let f="#efefef";typeof window!==void 0&&window.matchMedia("(prefers-color-scheme: dark)").matches&&(f="#1f1f1f"),t.background=new d.Color(f)}if(!t.environment){const f=new d.PMREMGenerator$1(o.context.renderer),m=new wf("neutral");t.environment=f.fromScene(m,.025).texture}}const s=mr(e,i,!0);e.position.x=0,e.position.y=1,e.position.z=2;const a=o.context.domElement;return(a==null?void 0:a.cameraControls)!=!1&&Ax(o.context,s),s});he.registerCallback(de.ContextCreated,o=>{if(!o.context.mainCamera){fu&&console.log("Will not auto-fit because a default camera exists");return}const t=o.context.domElement;if((t==null?void 0:t.cameraControls)==!0){const e=o0(o.context.mainCamera);if((e==null?void 0:e.isCameraController)==!0){fu&&console.log("Will not auto-fit because a camera controller exists");return}Ax(o.context)}});function Ax(o,t){t=t??o.mainCameraComponent;const e=t==null?void 0:t.gameObject;if(fu&&console.log("Creating default camera controls",t==null?void 0:t.name),e){const i=Yc(e,ge);i.sourceId=(t==null?void 0:t.sourceId)??"unknown";const n=o.domElement.getAttribute("auto-rotate");if(i.autoRotate=n!=null&&n!="0"&&(n==null?void 0:n.toLowerCase())!="false",i.autoRotateSpeed=.5,i.autoFit=!0,i.autoRotate&&n){const s=parseFloat(n);isNaN(s)||(i.autoRotateSpeed=s)}}else console.warn("Missing camera object, can not add orbit controls")}he.registerCallback(de.ContextCreated,o=>{const t=o.context.domElement.getAttribute("autoplay");if(t!==void 0&&(t===""||t==="true"||t==="1")&&o.files)for(const e of o.files)C.foreachComponent(e.file.scene,n=>{if(n.enabled!==!1){if(n instanceof Ot&&n.playAutomatically||n instanceof _t||n instanceof Ya&&n.playOnAwake===!0)return!0;if(n instanceof Ot)return n.playAutomatically=!0,!0;if(n instanceof Ya)return n.playOnAwake=!0,!0}},!0)!==!0&&Ua.assignAnimationsFromFile(e.file,{createAnimationComponent:(n,s)=>Pi(n,Ot)})});class XE extends re.WorkerBase{constructor(){super(new Worker(new URL("/generateMeshBVH.worker-Cdfpaq5W.js",typeof document>"u"?require("url").pathToFileURL(__filename).href:Pf&&Pf.tagName.toUpperCase()==="SCRIPT"&&Pf.src||new URL("needle-engine.bundle-DkWbrQA-.light.umd.cjs",document.baseURI).href),{type:"module"})),this.name="GenerateMeshBVHWorker"}runTask(t,e,i={}){return new Promise((n,s)=>{if(e.getAttribute("position").isInterleavedBufferAttribute||e.index&&e.index.isInterleavedBufferAttribute)throw new Error("GenerateMeshBVHWorker: InterleavedBufferAttribute are not supported for the geometry attributes.");t.onerror=h=>{s(new Error(`[GenerateMeshBVHWorker] ${h.message||"Unknown error. Please check the server console. If you're using vite try adding 'three-mesh-bvh' to 'optimizeDeps.exclude' in your vite.config.js"}`))},t.onmessage=h=>{const{data:u}=h;if(u.error)s(new Error(u.error)),t.onmessage=null;else if(u.serialized){const{serialized:f,position:m}=u,g=re.MeshBVH.deserialize(f,e,{setIndex:!1}),y=Object.assign({setBoundingBox:!0},i);if(e.attributes.position.array=m,f.index)if(e.index)e.index.array=f.index;else{const _=new d.BufferAttribute(f.index,1,!1);e.setIndex(_)}y.setBoundingBox&&(e.boundingBox=g.getBoundingBox(new d.Box3)),i.onProgress&&i.onProgress(u.progress),n(g),t.onmessage=null}else i.onProgress&&i.onProgress(u.progress)};const a=e.index?e.index.array:null,l=e.attributes.position.array,c=[l];a&&c.push(a),t.postMessage({index:a,position:l,options:{...i,onProgress:null,includedProgressCallback:!!i.onProgress,groups:[...e.groups]}},c.map(h=>h.buffer).filter(h=>typeof SharedArrayBuffer>"u"||!(h instanceof SharedArrayBuffer)))})}}const QE=Object.freeze(Object.defineProperty({__proto__:null,GenerateMeshBVHWorker:XE},Symbol.toStringTag,{value:"Module"}));exports.$physicsKey=$P;exports.ActionBuilder=fe;exports.ActionCollection=Fw;exports.ActionModel=vi;exports.Addressables=xv;exports.AlignmentConstraint=ih;exports.AmbientMode=ka;exports.Animation=Ot;exports.AnimationCurve=wh;exports.AnimationExtension=Gu;exports.AnimationTrackHandler=mf;exports.AnimationUtils=Ua;exports.Animator=_t;exports.AnimatorConditionMode=eo;exports.AnimatorController=Wi;exports.AnimatorControllerParameterType=ug;exports.AnimatorStateInfo=Gl;exports.Antialiasing=Sh;exports.Application=yn;exports.AssetDatabase=U0;exports.AssetReference=te;exports.AudioExtension=Br;exports.AudioListener=ws;exports.AudioSource=Hi;exports.AudioTrackHandler=Qa;exports.Avatar=Co;exports.AvatarBlink_Simple=Lr;exports.AvatarEyeLook_Rotation=vg;exports.AvatarLoader=Rx;exports.AvatarMarker=kt;exports.AvatarModel=Fy;exports.Avatar_Brain_LookAt=Rc;exports.Avatar_MouthShapes=rh;exports.Avatar_MustacheShake=_g;exports.Avatar_POI=Ms;exports.Axes=ma;exports.AxesHelper=el;exports.BUILD_TIME=zm;exports.BaseUIComponent=qi;exports.BasicIKConstraint=xg;exports.BehaviorExtension=Kg;exports.BehaviorModel=gt;exports.BloomEffect=rf;exports.BoxCollider=zu;exports.BoxGizmo=Nr;exports.BoxHelperComponent=Kn;exports.Button=Fs;exports.ButtonsFactory=jn;exports.CallDirection=nw;exports.CallInfo=bs;exports.Camera=si;exports.CameraTargetReachedEvent=kc;exports.Canvas=Ha;exports.CanvasGroup=Po;exports.CapsuleCollider=Os;exports.ChangeMaterialOnClick=Vg;exports.ChangeTransformOnClick=Fr;exports.CharacterController=Dr;exports.CharacterControllerInput=Es;exports.ChromaticAberration=Ch;exports.CircularBuffer=Mi;exports.ClearFlags=vo;exports.ClipExtrapolation=Rn;exports.Collider=ci;exports.Collision=ew;exports.CollisionDetectionMode=Du;exports.ColorAdjustments=Fo;exports.ColorBySpeedModule=ul;exports.ColorOverLifetimeModule=nf;exports.Component=X1;exports.Component$1=L;exports.ComponentLifecycleEvents=qc;exports.Components=qE;exports.ConnectionEvents=L0;exports.ContactPoint=Jv;exports.ContactShadows=ah;exports.Context=Q;exports.ContextArgs=B1;exports.ContextEvent=de;exports.ContextRegistry=he;exports.ControlTrackHandler=gf;exports.CustomBranding=zr;exports.CustomShader=iu;exports.DefaultReflectionMode=Hd;exports.Deletable=Mg;exports.DeleteBox=Na;exports.DepthOfField=Sn;exports.DeviceFlag=Nu;exports.DocumentExtension=Ex;exports.DragControls=nr;exports.DragMode=Og;exports.DropListener=Ts;exports.Duplicatable=Rg;exports.EffectWrapper=Dc;exports.EmissionModule=js;exports.EmphasizeOnClick=sl;exports.EngineLoadingView=uu;exports.EnvironmentScene=wf;exports.EventList=ye;exports.EventListEvent=Iu;exports.EventSystem=Ht;exports.EventTrigger=$u;exports.FieldWithDefault=xw;exports.FileReference=Pc;exports.FileReferenceSerializer=Cv;exports.FileSpawnModel=uM;exports.File_Event=lw;exports.FixedJoint=dy;exports.Fog=cl;exports.FrameEvent=we;exports.GENERATOR=Su;exports.GameObject=C;exports.Gizmos=V;exports.GltfExport=Fg;exports.GltfExportBox=jg;exports.Gradient=$r;exports.Graphic=gh;exports.GraphicRaycaster=ju;exports.Graphics=Ui;exports.GridHelper=hl;exports.GridLayoutGroup=ny;exports.GroundProjectedEnv=es;exports.GroupActionModel=fo;exports.HideFlags=Bu;exports.HideOnStart=$a;exports.HingeJoint=_h;exports.HorizontalLayoutGroup=iy;exports.HostData=NC;exports.Image=ml;exports.ImageReference=Cc;exports.ImageReferenceSerializer=Sv;exports.InheritVelocityModule=my;exports.Input=O0;exports.InputEventQueue=ni;exports.InputEvents=Ee;exports.InputField=Ry;exports.InstanceHandle=Ec;exports.InstancingHandler=Va;exports.InstancingUtil=$i;exports.InstantiateEvent=Y0;exports.InstantiateIdProvider=mt;exports.InstantiateOptions=vn;exports.Interactable=Pg;exports.JoinedRoomResponse=uC;exports.KeyEventArgs=tC;exports.Keyframe=oi;exports.LODGroup=vh;exports.LODModel=dl;exports.LeftRoomResponse=fC;exports.Light=ui;exports.LightData=Rv;exports.LimitVelocityOverLifetimeModule=st;exports.LoadingElementOptions=LE;exports.LogStats=Cg;exports.LogType=Ci;exports.LookAt=Ey;exports.LookAtConstraint=Ar;exports.MainModule=Tt;exports.MarkerType=My;exports.MaskableGraphic=yh;exports.Mathf=z;exports.MeshCollider=To;exports.MeshRenderer=ch;exports.MinMaxCurve=q;exports.MinMaxGradient=Wr;exports.NEKeyboardEvent=zl;exports.NEPointerEvent=us;exports.NeedleButtonElement=By;exports.NeedleEngineHTMLElement=jy;exports.NeedleMenu=is;exports.NeedlePatchesKey=yd;exports.NeedleXRController=Wm;exports.NeedleXRSession=Z;exports.NeedleXRSync=j0;exports.NeedleXRUtils=F0;exports.NestedGltf=Ju;exports.NetworkConnection=I0;exports.NetworkedStreamEvents=Bn;exports.NetworkedStreams=oh;exports.Networking=fy;exports.NewInstanceModel=Z0;exports.NoiseModule=be;exports.ObjectRaycaster=ki;exports.ObjectUtils=Ro;exports.OffsetConstraint=Vr;exports.OneEuroFilter=md;exports.OneEuroFilterXYZ=Am;exports.OpenURL=gl;exports.OrbitControls=ge;exports.Outline=ll;exports.OwnershipEvent=D0;exports.OwnershipModel=Xm;exports.PUBLIC_KEY=ua;exports.Padding=Ur;exports.ParticleBurst=lu;exports.ParticleSubEmitter=gy;exports.ParticleSystem=Lc;exports.ParticleSystemBaseBehaviour=Bo;exports.ParticleSystemRenderer=Zi;exports.ParticleSystemShapeType=au;exports.PeerHandle=Ra;exports.PeerNetworking=A0;exports.Physics=vc;exports.PhysicsExtension=Zg;exports.PhysicsMaterialCombine=rt;exports.PixelationEffect=Ph;exports.PlayAnimationOnClick=Tc;exports.PlayAudioOnClick=So;exports.PlayableDirector=Ya;exports.PlayerColor=qa;exports.PlayerState=fn;exports.PlayerStateEvent=Nw;exports.PlayerSync=Qg;exports.PlayerView=Mv;exports.PlayerViewManager=Ov;exports.PointerEventData=sh;exports.PointerType=Mu;exports.PostProcessingEffect=qe;exports.PostProcessingHandler=wy;exports.PreliminaryAction=ol;exports.PreliminaryTrigger=uh;exports.PrimitiveType=vr;exports.Progress=oe;exports.PromiseAllWithErrors=Em;exports.PromiseErrorResult=Lp;exports.RGBAColor=ie;exports.RapierPhysics=Mm;exports.RawImage=bf;exports.RaycastOptions=Qn;exports.Rect=$w;exports.RectTransform=bn;exports.ReflectionProbe=Wu;exports.RegisteredAnimationInfo=po;exports.RemoteSkybox=lf;exports.RenderTexture=yr;exports.RenderTextureSerializer=Qv;exports.Renderer=Ri;exports.RendererData=kv;exports.RendererLightmap=ou;exports.Rigidbody=tt;exports.RigidbodyConstraints=ze;exports.RoomEvents=J;exports.RotationBySpeedModule=Ki;exports.RotationOverLifetimeModule=xn;exports.SceneLightSettings=eu;exports.SceneSwitcher=We;exports.ScreenCapture=Uo;exports.ScreenSpaceAmbientOcclusion=Bs;exports.ScreenSpaceAmbientOcclusionN8=Cn;exports.SendQueue=cn;exports.SerializationContext=og;exports.SetActiveOnClick=$g;exports.ShadowCatcher=Rh;exports.ShapeModule=py;exports.SharpeningEffect=Oh;exports.SignalAsset=pf;exports.SignalReceiver=Dh;exports.SignalReceiverEvent=Lh;exports.SignalTrackHandler=Ic;exports.Size=Vw;exports.SizeBySpeedModule=fi;exports.SizeOverLifetimeModule=Gr;exports.SkinnedMeshRenderer=Ig;exports.SmoothFollow=hf;exports.SpatialGrabRaycaster=Cr;exports.SpatialHtml=Bh;exports.SpatialTrigger=df;exports.SpatialTriggerReceiver=Xn;exports.SpectatorCamera=uf;exports.SphereCollider=tl;exports.SphereIntersection=Km;exports.SphereOverlapResult=tw;exports.Sprite=Ls;exports.SpriteData=Ta;exports.SpriteRenderer=hi;exports.SpriteSheet=Ga;exports.StateMachineBehaviour=eP;exports.StreamEndedEvent=gg;exports.StreamReceivedEvent=iw;exports.SubEmitterSystem=cu;exports.SyncedCamera=Sy;exports.SyncedRoom=Pn;exports.SyncedTransform=Yn;exports.TapGestureTrigger=Gg;exports.TeleportTarget=Yu;exports.TestRunner=Cy;exports.TestSceneUtils=NE;exports.TestSimulateUserData=Py;exports.Text=Et;exports.TextBuilder=ey;exports.TextExtension=Zu;exports.TextureSheetAnimationModule=At;exports.TiltShiftEffect=os;exports.Time=Ev;exports.ToneMappingEffect=Xa;exports.TrackHandler=Ih;exports.TrackType=gi;exports.TrailModule=je;exports.TransformData=$e;exports.TransformGizmo=Qr;exports.TriggerBuilder=yt;exports.TriggerModel=wo;exports.TypeStore=O;exports.UIRaycastUtils=pg;exports.UIRootComponent=ph;exports.USDDocument=Ug;exports.USDObject=Mt;exports.USDWriter=kw;exports.USDZExporter=qn;exports.USDZExporter$1=Rw;exports.USDZText=sr;exports.USDZUIExtension=oy;exports.UriSerializer=Yv;exports.UsageMarker=lh;exports.UserJoinedOrLeftRoomModel=pC;exports.VERSION=pn;exports.VariantAction=Ng;exports.VelocityOverLifetimeModule=Ue;exports.VerticalLayoutGroup=ty;exports.VideoPlayer=it;exports.ViewDevice=yo;exports.Vignette=Xr;exports.VisibilityAction=fh;exports.Voip=Eo;exports.Volume=pl;exports.VolumeParameter=U;exports.VolumeProfile=sf;exports.WaitForFrames=g1;exports.WaitForPromise=Pv;exports.WaitForSeconds=lg;exports.Watch=Cs;exports.WebARCameraBackground=Uh;exports.WebARSessionRoot=Zn;exports.WebXR=Ku;exports.WebXRButtonFactory=xo;exports.WebXRImageTracking=Bc;exports.WebXRImageTrackingModel=zs;exports.WebXRPlaneTracking=Ns;exports.WebXRTrackedImage=jc;exports.XRControllerFollow=Us;exports.XRControllerModel=Jn;exports.XRControllerMovement=Ei;exports.XRFlag=Ni;exports.XRRig=Sf;exports.XRState=Gt;exports.XRStateFlag=Ln;exports.__Ignore=Tx;exports.__internalNotifyObjectDestroyed=W0;exports.activeInHierarchyFieldName=Ps;exports.addAttributeChangeCallback=Yb;exports.addComponent=Pi;exports.addCustomExtensionPlugin=DM;exports.addNewComponent=mr;exports.addPatch=Cu;exports.apply=Ru;exports.applyHMRChanges=q1;exports.applyPrototypeExtensions=hv;exports.beginListenDestroy=K0;exports.beginListenInstantiate=ev;exports.binaryIdentifierCasts=Gm;exports.build_scene_functions=j1;exports.builtinComponentKeyName=Qo;exports.calculateProgress01=Iy;exports.clearMessages=mS;exports.colorSerializer=wP;exports.compareAssociation=sv;exports.componentSerializer=Pd;exports.copyTexture=u0;exports.createMotion=Vv;exports.debugNet=Kt;exports.debugOwner=Nl;exports.decompressGpuTexture=Lw;exports.deepClone=Vc;exports.delay=mn;exports.delayForFrames=$c;exports.deserializeObject=Wd;exports.destroy=Oi;exports.destroyComponentInstance=fv;exports.determineMimeTypeFromExtension=cw;exports.disposeObjectResources=Se;exports.disposeStream=Fn;exports.editorGuidKeyName=Jl;exports.enableSpatialConsole=fr;exports.euler=SP;exports.eventListSerializer=OP;exports.exportAsGLTF=WE;exports.findByGuid=ag;exports.findObjectOfType=Jc;exports.findObjectsOfType=mv;exports.findResourceUsers=Jm;exports.fitObjectIntoVolume=p0;exports.foreachComponent=xr;exports.foreachComponentEnumerator=Tu;exports.forward=ES;exports.generateQRCode=Zb;exports.generateSeed=J0;exports.getBoundingBox=ri;exports.getCameraController=o0;exports.getComponent=Rr;exports.getComponentInChildren=Zc;exports.getComponentInParent=Sc;exports.getComponents=Kc;exports.getComponentsInChildren=Za;exports.getComponentsInParent=ku;exports.getFormattedDate=Cw;exports.getIconElement=pt;exports.getIconTexture=tm;exports.getLoader=gn;exports.getOrAddComponent=Yc;exports.getParam=x;exports.getParentHierarchyPath=LS;exports.getPath=Xx;exports.getPeerOptions=lC;exports.getPeerjsInstance=T0;exports.getResourceUserCount=AC;exports.getTempColor=l0;exports.getTempQuaternion=ln;exports.getTempVector=$;exports.getUrlParams=Nc;exports.getVisibleInCustomShadowRendering=f0;exports.getWorldDirection=c0;exports.getWorldEuler=Im;exports.getWorldPosition=K;exports.getWorldQuaternion=_e;exports.getWorldRotation=xu;exports.getWorldScale=Fe;exports.hasCommercialLicense=Hn;exports.hasIndieLicense=th;exports.hasPointerEventComponent=Yd;exports.hasProLicense=Gn;exports.hideDebugConsole=_0;exports.imageToCanvas=Dw;exports.instantiate=Sr;exports.invokeLoadedImportPluginHooks=_w;exports.invokeXRSessionEnd=M0;exports.invokeXRSessionStart=P0;exports.isActiveInHierarchy=gv;exports.isActiveSelf=Ja;exports.isAndroidDevice=eS;exports.isAnimationAction=d0;exports.isComponent=Zv;exports.isDebugMode=Wx;exports.isDesktop=Yx;exports.isDestroyed=wr;exports.isDevEnvironment=F;exports.isDisposed=EC;exports.isExporting=VE;exports.isGLTFModel=Kv;exports.isHostedOnGlitch=$b;exports.isHotReloadEnabled=om;exports.isHotReloading=G1;exports.isIPad=Zx;exports.isIconElement=Av;exports.isLocalNetwork=qt;exports.isMacOS=iS;exports.isMobileDevice=Kx;exports.isMozillaXR=tS;exports.isQuest=oS;exports.isResourceTrackingEnabled=N0;exports.isSafari=sS;exports.isUsingInstancing=Eu;exports.isiOS=nS;exports.isiPad=Jx;exports.loadAsset=OE;exports.loadSync=Dy;exports.logHierarchy=jd;exports.lookAtInverse=xS;exports.lookAtObject=Wc;exports.lookAtScreenPoint=SS;exports.makeId=Hx;exports.makeIdFromRandomWords=qb;exports.makeNameSafe=_n;exports.markAsInstancedRendered=yv;exports.microphonePermissionsGranted=rS;exports.nameof=$x;exports.nameofFactory=Gb;exports.objectSerializer=Xv;exports.offXRSessionEnd=eC;exports.offXRSessionStart=JS;exports.onAfterRender=fP;exports.onBeforeRender=uP;exports.onClear=hP;exports.onDestroy=dP;exports.onInitialized=$v;exports.onStart=Wv;exports.onUpdate=Gv;exports.onXRSessionEnd=$m;exports.onXRSessionStart=Pu;exports.parseSync=xx;exports.placeOnSurface=m0;exports.postprocessFBXMaterials=Fm;exports.prefix=mP;exports.pushState=Hb;exports.randomNumber=qx;exports.registerBinaryType=Hm;exports.registerComponent=Au;exports.registerComponentExtension=Ag;exports.registerCustomEffectType=Ji;exports.registerExportExtensions=Lg;exports.registerExtensions=su;exports.registerHotReloadType=Fv;exports.registerLoader=Nm;exports.registerPrefabProvider=iv;exports.registerPrototypeExtensions=dv;exports.registerType=HC;exports.relativePathPrefix=Qb;exports.removeAttributeChangeCallback=Kb;exports.removeComponent=rg;exports.removeCustomImportExtensionType=IM;exports.removePatch=KS;exports.resolveUrl=Mo;exports.sanitizeString=Xb;exports.saveImage=_x;exports.screenshot=hE;exports.screenshot2=Ay;exports.sendDestroyed=tg;exports.serializable=p;exports.serializeObject=rv;exports.serializeable=Er;exports.setActive=ic;exports.setAllowBalloonMessages=i0;exports.setAllowOverlayMessages=dS;exports.setAutoFitEnabled=Dd;exports.setCameraController=jp;exports.setDestroyed=bv;exports.setDevEnvironment=NS;exports.setDisposable=Zm;exports.setDontDestroy=aa;exports.setOrAddParamsToUrl=Ap;exports.setParam=Gx;exports.setParamWithoutReload=yc;exports.setPeerOptions=cC;exports.setResourceTrackingEnabled=RC;exports.setState=km;exports.setVisibleInCustomShadowRendering=Bm;exports.setWorldEuler=jm;exports.setWorldPosition=et;exports.setWorldPositionXYZ=br;exports.setWorldQuaternion=Gi;exports.setWorldQuaternionXYZW=Dm;exports.setWorldRotation=h0;exports.setWorldRotationXYZ=Gc;exports.setWorldScale=Da;exports.showBalloonError=Hc;exports.showBalloonMessage=Te;exports.showBalloonWarning=me;exports.showDebugConsole=Um;exports.slerp=wS;exports.syncDestroy=Xc;exports.syncField=Xg;exports.syncInstantiate=ig;exports.textureToCanvas=DS;exports.tryCastBinary=R0;exports.tryDetermineMimetypeFromBinary=dw;exports.tryDetermineMimetypeFromURL=hw;exports.tryFindObject=La;exports.tryGetGuid=E0;exports.unregisterHotReloadType=Uv;exports.unwatchWrite=Rm;exports.useForAutoFit=r0;exports.validate=bt;exports.watchWrite=wu;
@@ -1780,9 +1780,9 @@ Wo('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUIL
1780
1780
  Wo('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";');
1781
1781
  Wo('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.5.5";');
1782
1782
  Wo('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
1783
- Wo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Jun 05 2025 13:36:38 GMT+0000 (Coordinated Universal Time)";');
1783
+ Wo('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Jun 05 2025 14:17:21 GMT+0000 (Coordinated Universal Time)";');
1784
1784
  Wo('globalThis["__NEEDLE_PUBLIC_KEY__"] = "' + NEEDLE_PUBLIC_KEY + '";');
1785
- const Qn = "4.5.5", ug = "undefined", H0 = "Thu Jun 05 2025 13:36:38 GMT+0000 (Coordinated Universal Time)";
1785
+ const Qn = "4.5.5", ug = "undefined", H0 = "Thu Jun 05 2025 14:17:21 GMT+0000 (Coordinated Universal Time)";
1786
1786
  V0 && console.log(`Engine version: ${Qn} (generator: ${ug})
1787
1787
  Project built at ${H0}`);
1788
1788
  const tc = NEEDLE_PUBLIC_KEY, Do = "needle_isActiveInHierarchy", _a = "builtin_components", hd = "needle_editor_guid";
@@ -130,7 +130,7 @@ Open this page to get the console: `+e.toString())}const n=Q.isMobileDevice()||Q
130
130
  #__vconsole .vc-mask {
131
131
  overflow: hidden;
132
132
  }
133
- `,qi?.prepend(s),n===!0&&Wm()<=0&&Tb(),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.":"")),Jl=!1,ei=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.9.1/dist/vconsole.min.js",document.body.appendChild(e)}function Ok(){if(!globalThis.VConsole)return;const n=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+n._id+" iframe");return n.on("renderTab",function(t){const s=globalThis["needle:codegen_files"];if(!s||s.length===0)return;let o=globalThis["needle:codegen_files"][0];const r=o.indexOf("?");r>-1&&(o=o.substring(0,r));const l=location.protocol+"//"+location.host+location.pathname+"/"+o,c=encodeURIComponent(l);n.fullUrl="https://viewer.needle.tools?inspect&file="+c;var h='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(h)}),n.on("show",function(){const t=e();t&&t.src!==n.fullUrl&&(t.src=n.fullUrl)}),n.on("hide",function(){const t=e();t&&(t.src="")}),n.on("addTopBar",function(t){var s=new Array;s.push({name:"Open in new window \u2197",onClick:function(o){window.open(n.fullUrl,"_blank"),ei?.hide()}}),s.push({name:"Reload",onClick:function(o){const r=e();r&&(r.src=n.fullUrl)}}),s.push({name:"Fullscreen",onClick:function(o){const r=e();r.requestFullscreen?r.requestFullscreen():r.webkitRequestFullscreen instanceof Function&&r.webkitRequestFullscreen()}}),t(s)}),n}function kk(){return document.querySelector("#__vconsole .vc-switch")||null}function Mk(){return document.querySelector("#__vconsole")||null}const Lb=C("debugdefines");go('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),go('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),go('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),go('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),go('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.5.5";'),go('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),go('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Jun 05 2025 13:36:38 GMT+0000 (Coordinated Universal Time)";'),go('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const bs="4.5.5",Sd="undefined",ag="Thu Jun 05 2025 13:36:38 GMT+0000 (Coordinated Universal Time)";Lb&&console.log(`Engine version: ${bs} (generator: ${Sd})
133
+ `,qi?.prepend(s),n===!0&&Wm()<=0&&Tb(),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.":"")),Jl=!1,ei=null},e.src="https://cdn.jsdelivr.net/npm/vconsole@3.9.1/dist/vconsole.min.js",document.body.appendChild(e)}function Ok(){if(!globalThis.VConsole)return;const n=new VConsole.VConsolePlugin("needle-console","\u{1F335} Inspect glTF"),e=()=>document.querySelector("#__vc_plug_"+n._id+" iframe");return n.on("renderTab",function(t){const s=globalThis["needle:codegen_files"];if(!s||s.length===0)return;let o=globalThis["needle:codegen_files"][0];const r=o.indexOf("?");r>-1&&(o=o.substring(0,r));const l=location.protocol+"//"+location.host+location.pathname+"/"+o,c=encodeURIComponent(l);n.fullUrl="https://viewer.needle.tools?inspect&file="+c;var h='<iframe src="" style="width: 100%; height: 99%; border: none;"></iframe>';t(h)}),n.on("show",function(){const t=e();t&&t.src!==n.fullUrl&&(t.src=n.fullUrl)}),n.on("hide",function(){const t=e();t&&(t.src="")}),n.on("addTopBar",function(t){var s=new Array;s.push({name:"Open in new window \u2197",onClick:function(o){window.open(n.fullUrl,"_blank"),ei?.hide()}}),s.push({name:"Reload",onClick:function(o){const r=e();r&&(r.src=n.fullUrl)}}),s.push({name:"Fullscreen",onClick:function(o){const r=e();r.requestFullscreen?r.requestFullscreen():r.webkitRequestFullscreen instanceof Function&&r.webkitRequestFullscreen()}}),t(s)}),n}function kk(){return document.querySelector("#__vconsole .vc-switch")||null}function Mk(){return document.querySelector("#__vconsole")||null}const Lb=C("debugdefines");go('if(!globalThis["NEEDLE_ENGINE_VERSION"]) globalThis["NEEDLE_ENGINE_VERSION"] = "0.0.0";'),go('if(!globalThis["NEEDLE_ENGINE_GENERATOR"]) globalThis["NEEDLE_ENGINE_GENERATOR"] = "unknown";'),go('if(!globalThis["NEEDLE_PROJECT_BUILD_TIME"]) globalThis["NEEDLE_PROJECT_BUILD_TIME"] = "unknown";'),go('if(!globalThis["NEEDLE_PUBLIC_KEY"]) globalThis["NEEDLE_PUBLIC_KEY"] = "unknown";'),go('globalThis["__NEEDLE_ENGINE_VERSION__"] = "4.5.5";'),go('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),go('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Thu Jun 05 2025 14:17:21 GMT+0000 (Coordinated Universal Time)";'),go('globalThis["__NEEDLE_PUBLIC_KEY__"] = "'+NEEDLE_PUBLIC_KEY+'";');const bs="4.5.5",Sd="undefined",ag="Thu Jun 05 2025 14:17:21 GMT+0000 (Coordinated Universal Time)";Lb&&console.log(`Engine version: ${bs} (generator: ${Sd})
134
134
  Project built at ${ag}`);const Ca=NEEDLE_PUBLIC_KEY,Mn="needle_isActiveInHierarchy",fr="builtin_components",tc="needle_editor_guid";function go(n){try{(0,eval)(n)}catch(e){Lb&&console.error(e)}}let jb,Db=null;function _s(){return jb}function lg(n){if(n==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}Db!==n&&(Db=n,jb=new n)}const Ci=Symbol("shadowDomOwner"),Rk=C("debugpatch");function Cd(n,e,t,s){const o=Rk===e;if(!t&&!s)return;const r=e+"___needle";Ek(n,e,t,s);const l=Object.getOwnPropertyDescriptor(n,e),c=n[e];o&&console.log("Patch",n.constructor.name,e,l,c),l?(o&&console.log("Apply patch with existing descriptor",n.constructor.name,e,l),typeof l.value=="function"&&(n[e]=Fb(l.value,n,e))):(o&&console.log("Create patch with new property",n.constructor.name,e,l),Object.defineProperty(n,e,{set:function(h){if(typeof h=="function")this[r]=Fb(h,n,e);else{const d=this[r];zb(n,e,this,d,h),this[r]=h,Ub(n,e,this,d,h)}},get:function(){const h=this[r];return typeof h=="function"&&h[r]?h[r]:h}}))}function Tk(n,e,t){const s=hg(n,e);if(s)for(let o=s.length-1;o>=0;o--){const r=s[o];r.prefix===t&&(r.prefix=null),r.postfix===t&&(r.postfix=null),!r.prefix&&!r.postfix&&s.splice(o,1)}}const Bb=Symbol("Needle:Patches:WrappedFunction");function Fb(n,e,t){if(n[Bb])return n;const s=function(...o){zb(e,t,this,...o);const r=n.apply(this,o);return Ub(e,t,this,r,...o),r};return s[Bb]=!0,s}const Pd="Needle:Patches";function cg(){return globalThis[Pd]||(globalThis[Pd]=new WeakMap),globalThis[Pd]}function hg(n,e){const t=cg().get(n);return t?t.get(e):null}function Ek(n,e,t,s){let o=cg().get(n);o||(o=new Map,cg().set(n,o));let r=o.get(e);r||(r=[],o.set(e,r)),r.push({prefix:t,postfix:s})}function zb(n,e,t,...s){var o;if(!t)return;const r=hg(n,e);if(r)for(const l of r)(o=l.prefix)==null||o.call(t,...s)}function Ub(n,e,t,s,...o){var r;if(!t)return;const l=hg(n,e);if(l)for(const c of l)(r=c.postfix)==null||r.call(t,s,...o)}const Pa=[];function Od(n){Pa.indexOf(n)===-1&&Pa.push(n)}function Ak(n){const e=Pa.indexOf(n);e!==-1&&Pa.splice(e,1)}const Oa=[];function dg(n){Oa.indexOf(n)===-1&&Oa.push(n)}function Ik(n){const e=Oa.indexOf(n);e!==-1&&Oa.splice(e,1)}function Nb(n){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-start",{detail:n}));for(let e=0;e<Pa.length;e++)Pa[e](n)}function Wb(n){globalThis.dispatchEvent(new CustomEvent("needle-xrsession-end",{detail:n}));for(let e=0;e<Oa.length;e++)Oa[e](n)}const at=C("debuginput");var kd=(n=>(n.Mouse="mouse",n.Touch="touch",n.Controller="controller",n.Hand="hand",n))(kd||{}),Be=(n=>(n.PointerDown="pointerdown",n.PointerUp="pointerup",n.PointerMove="pointermove",n.KeyDown="keydown",n.KeyUp="keyup",n.KeyPressed="keypress",n))(Be||{});class Rn extends PointerEvent{constructor(e,t,s){super(e,s),a(this,"clientZ"),a(this,"deviceIndex"),a(this,"origin"),a(this,"source"),a(this,"mode"),a(this,"_ray"),a(this,"space"),a(this,"isClick",!1),a(this,"isDoubleClick",!1),a(this,"_used",!1),a(this,"_pointerid"),a(this,"_pointerType"),a(this,"_type"),a(this,"metadata",{}),a(this,"intersections",new Array),a(this,"_immediatePropagationStopped",!1),a(this,"_propagationStopped",!1),this.clientZ=s.clientZ,this._pointerid=s.pointerId,this._pointerType=s.pointerType,this._type=e,this.deviceIndex=s.deviceIndex,this.origin=s.origin,this.source=t,this.mode=s.mode,this._ray=s.ray,this.space=s.device}get isSpatial(){return this.mode!="screen"}get ray(){return this._ray||(this._ray=new lo(this.space.worldPosition.clone(),this.space.worldForward.clone())),this._ray}set ray(e){this._ray=e}get hasRay(){return this._ray!==void 0}get used(){return this._used}use(){this._used=!0}get pointerId(){return this._pointerid}get pointerType(){return this._pointerType}get type(){return this._type}get immediatePropagationStopped(){return this._immediatePropagationStopped}get propagationStopped(){return this._immediatePropagationStopped||this._propagationStopped}stopImmediatePropagation(){var e;this._immediatePropagationStopped=!0,super.stopImmediatePropagation(),(e=this.source)==null||e.stopImmediatePropagation()}stopPropagation(){var e;this._propagationStopped=!0,super.stopPropagation(),(e=this.source)==null||e.stopPropagation(),at&&console.warn("Stop propagation...",this.pointerId,this.pointerType)}}class ic extends KeyboardEvent{constructor(e,t,s){super(e,s),a(this,"source"),this.source=t}stopImmediatePropagation(){var e;super.stopImmediatePropagation(),(e=this.source)==null||e.stopImmediatePropagation()}}class Lk{constructor(e){a(this,"key"),a(this,"keyType"),a(this,"source"),this.key=e.key,this.keyType=e.type,this.source=e}}var ti=(n=>(n[n.Early=-100]="Early",n[n.Default=0]="Default",n[n.Late=100]="Late",n))(ti||{});class Vb{constructor(e){a(this,"_eventListeners",{}),a(this,"_doubleClickTimeThreshold",.2),a(this,"_longPressTimeThreshold",1),a(this,"_setCursorTypes",[]),a(this,"context"),a(this,"_pointerDown",[!1]),a(this,"_pointerUp",[!1]),a(this,"_pointerClick",[!1]),a(this,"_pointerDoubleClick",[!1]),a(this,"_pointerPressed",[!1]),a(this,"_pointerPositions",[new re]),a(this,"_pointerPositionsLastFrame",[new re]),a(this,"_pointerPositionsDelta",[new re]),a(this,"_pointerPositionsRC",[new re]),a(this,"_pointerPositionDown",[new S]),a(this,"_pointerDownTime",[]),a(this,"_pointerUpTime",[]),a(this,"_pointerUpTimestamp",[]),a(this,"_pointerIds",[]),a(this,"_pointerTypes",[""]),a(this,"_mouseWheelChanged",[!1]),a(this,"_mouseWheelDeltaY",[0]),a(this,"_pointerEvent",[]),a(this,"_pointerEventsPressed",[]),a(this,"_pointerSpace",[]),a(this,"_pressedStack",new Map),a(this,"_htmlEventSource"),a(this,"onLostFocus",()=>{for(const t in this.keysPressed)this.keysPressed[t].pressed=!1}),a(this,"_receivedPointerMoveEventsThisFrame",new Array),a(this,"onEndOfFrame",()=>{this._receivedPointerMoveEventsThisFrame.length=0;for(let t=0;t<this._pointerUp.length;t++)this._pointerUp[t]=!1;for(let t=0;t<this._pointerDown.length;t++)this._pointerDown[t]=!1;for(let t=0;t<this._pointerClick.length;t++)this._pointerClick[t]=!1;for(let t=0;t<this._pointerDoubleClick.length;t++)this._pointerDoubleClick[t]=!1;for(const t of this._pointerPositionsDelta)t.set(0,0);for(let t=0;t<this._mouseWheelChanged.length;t++)this._mouseWheelChanged[t]=!1;for(let t=0;t<this._mouseWheelDeltaY.length;t++)this._mouseWheelDeltaY[t]=0}),a(this,"onContextMenu",t=>{this.canReceiveInput(t)!==!1&&t instanceof PointerEvent&&t.pointerType}),a(this,"keysPressed",{}),a(this,"onKeyDown",t=>{if(at&&console.log(`key down ${t.code}, ${this.context.application.hasFocus}`,t),!this.context.application.hasFocus)return;const s=this.keysPressed[t.code];if(s&&s.pressed)return;this.keysPressed[t.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:t.key,code:t.code};const o=new ic("keydown",t,t);this.onDispatchEvent(o)}),a(this,"onKeyPressed",t=>{if(!this.context.application.hasFocus)return;const s=this.keysPressed[t.code];if(!s)return;s.pressed=!0,s.frame=this.context.time.frameCount+1;const o=new ic("keypress",t,t);this.onDispatchEvent(o)}),a(this,"onKeyUp",t=>{if(!this.context.application.hasFocus)return;const s=this.keysPressed[t.code];if(!s)return;s.pressed=!1,s.frame=this.context.time.frameCount+1;const o=new ic("keyup",t,t);this.onDispatchEvent(o)}),a(this,"onWheelWindow",t=>{document.pointerLockElement&&this.onMouseWheel(t)}),a(this,"onMouseWheel",t=>{if(this.canReceiveInput(t)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const s=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=s+t.deltaY}),a(this,"onPointerDown",t=>{if(this.context.isInAR||this.canReceiveInput(t)===!1)return;t.target instanceof HTMLElement&&t.target.setPointerCapture(t.pointerId);const s=this.getPointerId(t);at&&De(`pointer down #${s}, identifier:${t.pointerId}`);const o=this.getAndUpdateSpatialObjectForScreenPosition(s,t.clientX,t.clientY),r=new Rn("pointerdown",t,{origin:this,mode:"screen",deviceIndex:0,pointerId:s,button:t.button,clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,buttonName:this.getButtonName(t),device:o,pressure:t.pressure});this.onDown(r)}),a(this,"onPointerMove",t=>{if(this.context.isInAR||this._receivedPointerMoveEventsThisFrame.includes(t.pointerId))return;this._receivedPointerMoveEventsThisFrame.push(t.pointerId);let s=t.button;t.pointerType==="mouse"&&(s=this.getFirstPressedButtonForPointer(0)??0);const o=this.getPointerId(t,s);s===-1&&(s=o);const r=this.getAndUpdateSpatialObjectForScreenPosition(o,t.clientX,t.clientY),l=new Rn("pointermove",t,{origin:this,mode:"screen",deviceIndex:0,pointerId:o,button:s,clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,buttonName:this.getButtonName(t),device:r,pressure:t.pressure});this.onMove(l)}),a(this,"onPointerCancel",t=>{this.context.isInAR||(at&&console.log("Pointer cancel",t),this.onPointerUp(t))}),a(this,"onPointerUp",t=>{if(this.context.isInAR)return;t.target instanceof HTMLElement&&t.target.releasePointerCapture(t.pointerId);const s=this.getPointerId(t),o=new Rn("pointerup",t,{origin:this,mode:"screen",deviceIndex:0,pointerId:s,button:t.button,clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,buttonName:this.getButtonName(t),device:this.getAndUpdateSpatialObjectForScreenPosition(s,t.clientX,t.clientY),pressure:t.pressure});this.onUp(o),this._pointerIds[s]=-1,at&&console.log("ID="+s,"PointerId="+t.pointerId,"ALL:",[...this._pointerIds])}),a(this,"onTouchStart",t=>{if(this.context.isInAR)for(let s=0;s<t.changedTouches.length;s++){const o=t.changedTouches[s],r=this.getPointerIndex(o.identifier),l=this.getAndUpdateSpatialObjectForScreenPosition(r,o.clientX,o.clientY),c=new Rn("pointerdown",t,{origin:this,mode:"screen",deviceIndex:0,pointerId:r,button:0,clientX:o.clientX,clientY:o.clientY,pointerType:"touch",buttonName:"unknown",device:l,pressure:o.force});this.onDown(c)}}),a(this,"onTouchMove",t=>{if(this.context.isInAR)for(let s=0;s<t.changedTouches.length;s++){const o=t.changedTouches[s],r=this.getPointerIndex(o.identifier),l=this.getAndUpdateSpatialObjectForScreenPosition(r,o.clientX,o.clientY),c=new Rn("pointermove",t,{origin:this,mode:"screen",deviceIndex:0,pointerId:r,button:0,clientX:o.clientX,clientY:o.clientY,pointerType:"touch",buttonName:"unknown",device:l,pressure:o.force});this.onMove(c)}}),a(this,"onTouchEnd",t=>{if(this.context.isInAR)for(let s=0;s<t.changedTouches.length;s++){const o=t.changedTouches[s],r=this.getPointerIndex(o.identifier),l=new Rn("pointerup",t,{origin:this,mode:"screen",deviceIndex:0,pointerId:r,button:0,clientX:o.clientX,clientY:o.clientY,pointerType:"touch",buttonName:"unknown",device:this.getAndUpdateSpatialObjectForScreenPosition(r,o.clientX,o.clientY),pressure:o.force});this.onUp(l),this._pointerIds[r]=-1}}),a(this,"tempNearPlaneVector",new S),a(this,"tempFarPlaneVector",new S),a(this,"tempLookMatrix",new se),this.context=e,this.context.post_render_callbacks.push(this.onEndOfFrame)}addEventListener(e,t,s){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}s?s={...s}:s={};let o=0;s?.queue!=null&&(o=s.queue);const r=this._eventListeners[e],l=r.find(c=>c.priority===o);l?l.listeners.push({callback:t,options:s}):(r.push({priority:o,listeners:[{callback:t,options:s}]}),r.sort((c,h)=>c.priority-h.priority))}removeEventListener(e,t,s){if(!this._eventListeners[e]||!t)return;const o=this._eventListeners[e];if(s?.queue!=null){const r=o.find(c=>c.priority===s.queue);if(!r)return;const l=r.listeners.findIndex(c=>c.callback===t);l>=0&&r.listeners.splice(l,1)}else for(const r of o){const l=r.listeners.findIndex(c=>c.callback===t);l>=0&&r.listeners.splice(l,1)}}dispatchEvent(e){var t,s,o,r;let l=!1;if(e instanceof ic){const c=this._eventListeners[e.type];if(c)for(const h of c)for(let d=0;d<h.listeners.length;d++){const u=h.listeners[d];if((s=(t=u.options)==null?void 0:t.signal)!=null&&s.aborted){h.listeners.splice(d,1),d--;continue}u.options.once&&(h.listeners.splice(d,1),d--),u.callback(e)}}if(e instanceof Rn){const c=this._eventListeners[e.type];if(c)for(const h of c){if(l)break;for(let d=0;d<h.listeners.length;d++){const u=h.listeners[d];if((r=(o=u.options)==null?void 0:o.signal)!=null&&r.aborted){h.listeners.splice(d,1),d--;continue}if(e.immediatePropagationStopped){l=!0,at&&console.log("immediatePropagationStopped",e.type);break}else e.propagationStopped&&(l=!0,at&&console.log("propagationStopped",e.type));u.options.once&&(h.listeners.splice(d,1),d--),u.callback(e)}}}}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}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(){var e;((e=this._setCursorTypes)==null?void 0:e.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 s=this._pointerTypes[t];if(Array.isArray(e)){let o=!1;for(const r of e)if(s===r){o=!0;break}if(!o)continue}else if(e!==s)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]}onDownButton(e,t){let s=this._pressedStack.get(e);s||(s=[],this._pressedStack.set(e,s)),s.push(t)}onReleaseButton(e,t){const s=this._pressedStack.get(e);if(!s)return;const o=s.indexOf(t);o>=0&&s.splice(o,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 s=this.keysPressed[t];if(s.startFrame===this.context.time.frameCount)return s.key}return null}getKeyPressed(e){if(e!==void 0)return this.isKeyPressed(e);for(const t in this.keysPressed){const s=this.keysPressed[t];if(s.pressed)return s.key}return null}getKeyUp(e){if(e!==void 0)return this.isKeyUp(e);for(const t in this.keysPressed){const s=this.keysPressed[t];return s.pressed===!1&&s.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 o of t)if(this.isKeyDown(o))return!0;return!1}const s=this.keysPressed[e];return s?s.startFrame===this.context.time.frameCount&&s.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 o of t)if(this.isKeyUp(o))return!0;return!1}const s=this.keysPressed[e];return s?s.frame===this.context.time.frameCount&&s.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 o of t)if(this.isKeyPressed(o))return!0;return!1}const s=this.keysPressed[e];return s&&s.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":at&&De("Create Pointer down"),this.onDownButton(e.deviceIndex,e.button),this.onDown(e);break;case"pointermove":at&&De("Create Pointer move"),this.onMove(e);break;case"pointerup":at&&De("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}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(){var e,t;window.removeEventListener("contextmenu",this.onContextMenu),(e=this._htmlEventSource)==null||e.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),(t=this._htmlEventSource)==null||t.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()}canReceiveInput(e){var t;return e.target===((t=this.context.renderer)==null?void 0:t.domElement)||e.target===this.context.domElement||this.context.isInAR||this.context.isInAR&&e.target===document.body&&Q.isMozillaXR()?!0:(at&&console.warn("CanReceiveInput:False for",e.target),!1)}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"}getAndUpdateSpatialObjectForScreenPosition(e,t,s){let o=this._pointerSpace[e];o||(o=new A,this._pointerSpace[e]=o),this._pointerSpace[e]=o;const r=this.context.mainCamera;if(r){const l=this.tempNearPlaneVector.set(t,s,-1);this.convertScreenspaceToRaycastSpace(l);const c=this.tempFarPlaneVector.set(l.x,l.y,1);l.unproject(r),c.unproject(r);const h=r.worldUp||q(0,1,0).applyQuaternion(Se(r));this.tempLookMatrix.lookAt(c,l,h),o.position.set(l.x,l.y,l.z),o.quaternion.setFromRotationMatrix(this.tempLookMatrix)}return o}isInRect(e){if(this.context.isInXR)return!0;const t=this.context.domElement.getBoundingClientRect(),s=e.clientX,o=e.clientY,r=s>=t.x&&s<=t.right&&o>=t.y&&o<=t.bottom;return at&&!r&&console.log("Not in rect",t,s,o),r}onDown(e){const t=e.pointerId;if(this.getPointerPressed(t)&&console.warn(`Received pointerDown for pointerId that is already pressed: ${t}`,at?e:""),at&&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 S);for(this._pointerPositionDown[t].set(e.clientX,e.clientY,e.clientZ??0);t>=this._pointerPositions.length;)this._pointerPositions.push(new re);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,s=this.getPointerPressed(t);s===!1&&!this.isInRect(e)||e.pointerType==="touch"&&!s||(this.updatePointerPosition(e),this.setPointerStateT(t,this._pointerEvent,e.source),this.onDispatchEvent(e))}onUp(e){const t=e.pointerId;if(!this.getPointerPressed(t)){at&&console.log(e.pointerType,"UP",t,"was not down");return}at&&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 c=this._pointerEventsPressed.length-1;c>=0;c--)if(this._pointerEventsPressed[c].pointerId===t){this._pointerEventsPressed.splice(c,1);break}if(!this._pointerPositionDown[t]){at&&be("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 s=this._pointerUpTime[t],o=this._pointerDownTime[t],r=this.context.time.realtimeSinceStartup,l=r-o;if(t>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),this._pointerUpTime[t]=r,l<1){let c=e.clientX-this._pointerPositionDown[t].x,h=e.clientY-this._pointerPositionDown[t].y,d=0;if(e.isSpatial&&e.clientZ!=null&&(d=e.clientZ-this._pointerPositionDown[t].z,c*=200,h*=200,d*=200),Math.abs(c)<5&&Math.abs(h)<5&&Math.abs(d)<5){this.setPointerState(t,this._pointerClick,!0),e.isClick=!0;const u=r-s;at&&console.log("CLICK",t,c,h,d,u),u<this._doubleClickTimeThreshold&&u>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 re);for(;t>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new re);for(;t>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new re);const s=this._pointerPositionsLastFrame[t];s.copy(this._pointerPositions[t]);const o=this._pointerPositionsDelta[t];let r=e.clientX-s.x,l=e.clientY-s.y;if(e.source instanceof MouseEvent||e.source instanceof TouchEvent){const u=e.source;r===0&&u.movementX!==0&&(r=u.movementX||0),l===0&&u.movementY!==0&&(l=u.movementY||0)}o.x+=r,o.y+=l,this._pointerPositions[t].x=e.clientX,this._pointerPositions[t].y=e.clientY;const c=e.clientX,h=e.clientY;for(;t>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new re);const d=this._pointerPositionsRC[t];d.set(c,h),this.convertScreenspaceToRaycastSpace(d)}getPointerIndex(e){let t=-1;for(let s=0;s<this._pointerIds.length;s++){if(this._pointerIds[s]===e)return s;t===-1&&this._pointerIds[s]===-1&&(t=s)}return t!==-1?(this._pointerIds[t]=e,t):(at&&console.log("PUSH pointerId:",e),this._pointerIds.push(e),this._pointerIds.length-1)}setPointerState(e,t,s){t[e]=s}setPointerStateT(e,t,s){return t[e]=s,s}onDispatchEvent(e){const t=J.Current;try{J.Current=this.context,this.dispatchEvent(e)}finally{J.Current=t}}}const ka=new se().makeRotationY(Math.PI),Xi=new V().setFromAxisAngle(new S(0,1,0),Math.PI),jk=C("debugwebxr");class Dk{constructor(){if(a(this,"priority",-1e5),a(this,"gameObject"),this.gameObject=new A,this.gameObject.name="Implicit XR Rig",jk){const e=Tg(16733661);e.position.y+=.5,this.gameObject.add(e)}}isXRRig(){return!0}get isActive(){return this.gameObject.visible}}const Tn=C("debugwebxr"),Md=C("debugcustomgesture"),Bk="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Fk="generic-trigger",zk=new V().setFromEuler(new At(_n.degToRad(0),_n.degToRad(-90),_n.degToRad(-90))),Uk=new S(.04,-.04,0);class ug{constructor(e,t,s){a(this,"xr"),a(this,"inputSource"),a(this,"index",0),a(this,"emitEvents",!0),a(this,"_connected",!0),a(this,"_isTracking",!1),a(this,"__gamepad"),a(this,"__hand"),a(this,"__side"),a(this,"_hitTestSource"),a(this,"_hasSelectEvent",!1),a(this,"_isMxInk",!1),a(this,"_isMetaQuestTouchController",!1),a(this,"_handJointPoses",new Map),a(this,"_gripMatrix",new se),a(this,"_gripPosition",new S),a(this,"_gripQuaternion",new V),a(this,"_linearVelocity",new S),a(this,"_rayPositionRaw",new S),a(this,"_rayRotationRaw",new V),a(this,"_rayMatrix",new se),a(this,"_rayPosition",new S),a(this,"_rayQuaternion",new V),a(this,"_gripWorldPosition",new S),a(this,"_gripWorldQuaternion",new V),a(this,"_rayWorldPosition",new S),a(this,"_rayWorldQuaternion",new V),a(this,"_pinchPosition",new S),a(this,"_ray"),a(this,"_hand_wristDotUp"),a(this,"_object"),a(this,"_gripSpaceObject"),a(this,"_raySpaceObject"),a(this,"model",null),a(this,"_debugAxesHelper",new _i(.15)),a(this,"_debugGripAxesHelper",new _i(.07)),a(this,"_debugRayAxesHelper",new _i(.07)),a(this,"_hitTestSourcePromise",null),a(this,"onPointerHits",o=>{}),a(this,"_needleGamepadButtons",{}),a(this,"_buttonMap",new Map),a(this,"_motioncontroller"),a(this,"_layout"),a(this,"getMotionController"),a(this,"emitPointerDownEvent",!0),a(this,"emitPointerUpEvent",!0),a(this,"emitPointerMoveEvent",!0),a(this,"pointerMoveDistanceThreshold",.03),a(this,"pointerMoveAngleThreshold",.05),a(this,"_selectButtonIndex"),a(this,"_squeezeButtonIndex"),a(this,"onSelectStart",o=>{var r,l,c,h;if(!this.emitPointerDownEvent||this.inputSource!==o.inputSource)return;this.onUpdateFrame(o.frame),this._hasSelectEvent=!0;const d=(r=this._layout)==null?void 0:r.selectComponentId,u=(h=(c=(l=this._layout)==null?void 0:l.components[d])==null?void 0:c.gamepadIndices)==null?void 0:h.button;u!==void 0&&(this._selectButtonIndex=u),!Md&&(Tn&&$.DrawDirection(this.rayWorldPosition,q(0,.01,1).applyQuaternion(this.rayWorldQuaternion),16711680,10),this.emitPointerEvent(Be.PointerDown,this._selectButtonIndex||0,"xr-standard-trigger",!0,o))}),a(this,"onSelectEnd",o=>{this.emitPointerUpEvent&&(Md||this.inputSource===o.inputSource&&this.emitPointerEvent(Be.PointerUp,this._selectButtonIndex||0,"xr-standard-trigger",!0,o))}),a(this,"onSequeezeStart",o=>{var r,l,c;this.emitPointerDownEvent&&this.inputSource===o.inputSource&&(this._squeezeButtonIndex=(c=(l=(r=this._layout)==null?void 0:r.components["xr-standard-squeeze"])==null?void 0:l.gamepadIndices)==null?void 0:c.button,this._squeezeButtonIndex!==void 0&&(Tn&&$.DrawDirection(this.rayWorldPosition,q(0,.01,1).applyQuaternion(this.rayWorldQuaternion),255,10),this.emitPointerEvent(Be.PointerDown,this._squeezeButtonIndex||0,"xr-standard-squeeze",!0,o)))}),a(this,"onSequeezeEnd",o=>{this.emitPointerUpEvent&&this.inputSource===o.inputSource&&this._squeezeButtonIndex!==void 0&&this.emitPointerEvent(Be.PointerUp,this._squeezeButtonIndex||0,"xr-standard-squeeze",!0,o)}),a(this,"states",{}),a(this,"_didMoveLastFrame",!1),a(this,"_lastPointerMovePosition",new S),a(this,"_lastPointerMoveQuaternion",new V),a(this,"pointerInit"),this.xr=e,this.inputSource=t,this.index=s,this._object=new A,this._object.name=`NeedleXRController_${s}`,Tn&&(this._object.add(this._debugAxesHelper),this._gripSpaceObject=new A,this._raySpaceObject=new A,this._gripSpaceObject.name=`NeedleXRController_${s}_gripSpace`,this._raySpaceObject.name=`NeedleXRController_${s}_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 lo,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()}get context(){return this.xr.context}get connected(){return this._connected}get isTracking(){return this._isTracking}get gamepad(){return this.__gamepad??(this.__gamepad=this.inputSource.gamepad)}get isHand(){return this.hand!=null}get hand(){return this.__hand??(this.__hand=this.inputSource.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.__side=this.inputSource.handedness)}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)}get hasSelectEvent(){return this._hasSelectEvent}getHitTest(){return this.xr.getHitTest(this)}getHandJointPose(e,t){var s;if(t=t||this.xr.frame,!this.hand||!(t!=null&&t.getJointPose)||!this.xr.referenceSpace)return null;let o=(s=this._handJointPoses)==null?void 0:s.get(e);return o||(o=t.getJointPose(e,this.xr.referenceSpace),o&&this._handJointPoses.set(e,o),o)}get gripPosition(){return q(this._gripPosition)}get gripQuaternion(){return ys(this._gripQuaternion)}get gripMatrix(){return this._gripMatrix}get gripLinearVelocity(){return q(this._linearVelocity).applyQuaternion(Xi)}get rayPosition(){return q(this._rayPosition)}get rayQuaternion(){return ys(this._rayQuaternion)}get gripWorldPosition(){return q(this._gripWorldPosition)}get gripWorldQuaternion(){return ys(this._gripWorldQuaternion)}get rayWorldPosition(){return q(this._rayWorldPosition)}updateRayWorldPosition(){var e;const t=(e=this.xr.context.mainCamera)==null?void 0:e.parent;this._rayWorldPosition.copy(this._rayPositionRaw),t&&this._rayWorldPosition.applyMatrix4(t.matrixWorld)}get rayWorldQuaternion(){return ys(this._rayWorldQuaternion)}get pinchPosition(){return q(this._pinchPosition)}updateRayWorldQuaternion(){var e;const t=(e=this.xr.context.mainCamera)==null?void 0:e.parent,s=t?Se(t):void 0;this._rayWorldQuaternion.copy(this._rayRotationRaw).multiply(Xi),s&&this._rayWorldQuaternion.premultiply(s)}get ray(){return this._ray.origin.copy(this.rayWorldPosition),this._ray.direction.copy(q(0,0,1).applyQuaternion(this.rayWorldQuaternion)),this._ray}get handWristDotUp(){var e;if(this._hand_wristDotUp!==void 0)return this._hand_wristDotUp;const t=(e=this.handObject)==null?void 0:e.joints.wrist;if(t){const s=q(0,1,0).applyQuaternion(t.quaternion),o=q(0,1,0).dot(s);return this._hand_wristDotUp=o}}get isHandUpsideDown(){return this.handWristDotUp!==void 0?this.handWristDotUp<-.7:!1}get isTeleportGesture(){var e;return this.isHandUpsideDown&&((e=this.getGesture("pinch"))==null?void 0:e.isDown)}get object(){return this._object}async getModelUrl(){var e;return(e=this.getMotionController)==null?void 0:e.then(t=>t?.assetUrl||null)}_requestHitTestSource(){var e;return this._hitTestSourcePromise?this._hitTestSourcePromise:this.xr.mode==="immersive-ar"&&this.inputSource.targetRayMode==="tracked-pointer"&&this.xr.session.requestHitTestSourceForTransientInput?this._hitTestSourcePromise=((e=this.xr.session.requestHitTestSourceForTransientInput({profile:this.inputSource.profiles[0],offsetRay:new XRRay}))==null?void 0:e.then(t=>(this._hitTestSourcePromise=null,this.connected?this._hitTestSource=t:(t.cancel(),null))))??null:null}onUpdate(e){this.onUpdateFrame(e),this.updateInputEvents(),this.onUpdateMove()}onRenderDebug(){var e;$.DrawSphere(this.rayWorldPosition,.003),$.DrawDirection(this.rayWorldPosition,q(0,0,10).applyQuaternion(this.rayWorldQuaternion));const t=(this.inputSource.gripSpace?this.gripWorldPosition:this.object.worldPosition).sub(this.object.worldForward.multiplyScalar(.1)),s=this.inputSource.profiles.join(`
135
135
  `);let o=`Controller[${this.index}] (${this.inputSource.targetRayMode}, ${this.side})
136
136
  C:${this.connected?"x":"-"} T:${this.isTracking?"x":"-"} Hand:${this.inputSource.hand?"x":"-"} Pen: ${this._isMxInk?"x":"-"}`;if(this.inputSource.hand&&(o+=`
@@ -1,5 +1,5 @@
1
- import { GameObject as r, onClear as a, onDestroy as s, onInitialized as l, onAfterRender as d, onBeforeRender as c, onUpdate as m, onStart as g, loadAsset as p, NeedleXRSession as u, Context as S, VERSION as C, Component as y, Components as E } from "./needle-engine.bundle-Bay7lmZk.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 U, AnimatorController as w, AnimatorControllerParameterType as G, AnimatorStateInfo as W, Antialiasing as H, Application as X, AssetDatabase as z, AssetReference as V, AudioExtension as _, AudioListener as j, AudioSource as K, AudioTrackHandler as Z, Avatar as Q, AvatarBlink_Simple as Y, AvatarEyeLook_Rotation as $, AvatarLoader as J, AvatarMarker as q, AvatarModel as ee, Avatar_Brain_LookAt as te, Avatar_MouthShapes as oe, Avatar_MustacheShake as re, Avatar_POI as ne, Axes as ie, AxesHelper as ae, BUILD_TIME as se, BaseUIComponent as le, BasicIKConstraint as de, BehaviorExtension as ce, BehaviorModel as me, Component$1 as ge, BlobStorage as pe, BloomEffect as ue, BoxCollider as Se, BoxGizmo as Ce, BoxHelperComponent as ye, Button as Ee, ButtonsFactory as Re, CallDirection as he, CallInfo as fe, Camera as ve, CameraTargetReachedEvent as Pe, Canvas as Te, CanvasGroup as Ae, CapsuleCollider as be, ChangeMaterialOnClick as Me, ChangeTransformOnClick as Ie, CharacterController as De, CharacterControllerInput as Oe, ChromaticAberration as xe, CircularBuffer as ke, ClearFlags as Le, ClipExtrapolation as Ne, Collider as Be, Collision as Fe, CollisionDetectionMode as Ue, ColorAdjustments as we, ColorBySpeedModule as Ge, ColorOverLifetimeModule as We, Component$1 as He, ComponentLifecycleEvents as Xe, ConnectionEvents as ze, ContactPoint as Ve, ContactShadows as _e, ContextArgs as je, ContextEvent as Ke, ContextRegistry as Ze, ControlTrackHandler as Qe, CustomBranding as Ye, CustomShader as $e, DefaultReflectionMode as Je, Deletable as qe, DeleteBox as et, DepthOfField as tt, DeviceFlag as ot, DeviceUtilities as rt, DocumentExtension as nt, DragControls as it, DragMode as at, DropListener as st, Duplicatable as lt, EffectWrapper as dt, EmissionModule as ct, EmphasizeOnClick as mt, EngineLoadingView as gt, EnvironmentScene as pt, EventList as ut, EventListEvent as St, EventSystem as Ct, EventTrigger as yt, FieldWithDefault as Et, FileReference as Rt, FileReferenceSerializer as ht, FileSpawnModel as ft, File_Event as vt, FixedJoint as Pt, Fog as Tt, FrameEvent as At, GENERATOR as bt, Gizmos as Mt, GltfExport as It, GltfExportBox as Dt, Gradient as Ot, Graphic as xt, GraphicRaycaster as kt, Graphics as Lt, GridHelper as Nt, GridLayoutGroup as Bt, GroundProjectedEnv as Ft, GroupActionModel as Ut, HideFlags as wt, HideOnStart as Gt, HingeJoint as Wt, HorizontalLayoutGroup as Ht, HostData as Xt, Image as zt, ImageReference as Vt, ImageReferenceSerializer as _t, InheritVelocityModule as jt, Input as Kt, InputEventQueue as Zt, InputEvents as Qt, InputField as Yt, InstanceHandle as $t, InstancingHandler as Jt, InstancingUtil as qt, InstantiateEvent as eo, InstantiateIdProvider as to, InstantiateOptions as oo, Interactable as ro, InternalScreenshotUtils as no, JoinedRoomResponse as io, KeyEventArgs as ao, Keyframe as so, LODGroup as lo, LODModel as co, LeftRoomResponse as mo, Light as go, LightData as po, LimitVelocityOverLifetimeModule as uo, LoadingElementOptions as So, LogStats as Co, LogType as yo, LookAt as Eo, LookAtConstraint as Ro, MainModule as ho, MarkerType as fo, MaskableGraphic as vo, Mathf as Po, MeshCollider as To, MeshRenderer as Ao, MinMaxCurve as bo, MinMaxGradient as Mo, MODULES as Io, NEKeyboardEvent as Do, NEPointerEvent as Oo, NeedleButtonElement as xo, ContextRegistry as ko, NeedleEngineHTMLElement as Lo, NeedleEngineModelLoader as No, NeedleMenu as Bo, NeedlePatchesKey as Fo, USDZExporter$1 as Uo, NeedleXRController as wo, NeedleXRSync as Go, NeedleXRUtils as Wo, NestedGltf as Ho, NetworkConnection as Xo, NetworkedStreamEvents as zo, NetworkedStreams as Vo, Networking as _o, NewInstanceModel as jo, NoiseModule as Ko, ObjectRaycaster as Zo, ObjectUtils as Qo, OffsetConstraint as Yo, OneEuroFilter as $o, OneEuroFilterXYZ as Jo, OpenURL as qo, OrbitControls as er, Outline as tr, OwnershipEvent as or, OwnershipModel as rr, PUBLIC_KEY as nr, Padding as ir, ParticleBurst as ar, ParticleSubEmitter as sr, ParticleSystem as lr, ParticleSystemBaseBehaviour as dr, ParticleSystemRenderer as cr, ParticleSystemShapeType as mr, PeerHandle as gr, PeerNetworking as pr, Physics as ur, PhysicsExtension as Sr, PhysicsMaterialCombine as Cr, PixelationEffect as yr, PlayAnimationOnClick as Er, PlayAudioOnClick as Rr, PlayableDirector as hr, PlayerColor as fr, PlayerState as vr, PlayerStateEvent as Pr, PlayerSync as Tr, PlayerView as Ar, PlayerViewManager as br, PointerEventData as Mr, PointerType as Ir, PostProcessingEffect as Dr, PostProcessingHandler as Or, Volume as xr, PreliminaryAction as kr, PreliminaryTrigger as Lr, PreviewHelper as Nr, PrimitiveType as Br, Progress as Fr, PromiseAllWithErrors as Ur, PromiseErrorResult as wr, RGBAColor as Gr, RapierPhysics as Wr, RawImage as Hr, RaycastOptions as Xr, Rect as zr, RectTransform as Vr, ReflectionProbe as _r, RegisteredAnimationInfo as jr, RemoteSkybox as Kr, RenderTexture as Zr, RenderTextureSerializer as Qr, Renderer as Yr, RendererData as $r, RendererLightmap as Jr, Rigidbody as qr, RigidbodyConstraints as en, RoomEvents as tn, RotationBySpeedModule as on, RotationOverLifetimeModule as rn, SceneLightSettings as nn, SceneSwitcher as an, ScreenCapture as sn, ScreenSpaceAmbientOcclusion as ln, ScreenSpaceAmbientOcclusionN8 as dn, SendQueue as cn, SerializationContext as mn, SetActiveOnClick as gn, ShadowCatcher as pn, ShapeModule as un, SharpeningEffect as Sn, SignalAsset as Cn, SignalReceiver as yn, SignalReceiverEvent as En, SignalTrackHandler as Rn, Size as hn, SizeBySpeedModule as fn, SizeOverLifetimeModule as vn, SkinnedMeshRenderer as Pn, SmoothFollow as Tn, SpatialGrabRaycaster as An, SpatialHtml as bn, SpatialTrigger as Mn, SpatialTriggerReceiver as In, SpectatorCamera as Dn, SphereCollider as On, SphereIntersection as xn, SphereOverlapResult as kn, Sprite as Ln, SpriteData as Nn, SpriteRenderer as Bn, SpriteSheet as Fn, StateMachineBehaviour as Un, StreamEndedEvent as wn, StreamReceivedEvent as Gn, SubEmitterSystem as Wn, SyncedCamera as Hn, SyncedRoom as Xn, SyncedTransform as zn, TapGestureTrigger as Vn, TeleportTarget as _n, TestRunner as jn, TestSceneUtils as Kn, TestSimulateUserData as Zn, Text as Qn, TextBuilder as Yn, TextExtension as $n, TextureSheetAnimationModule as Jn, TiltShiftEffect as qn, Time as ei, ToneMappingEffect as ti, TrackHandler as oi, TrackType as ri, TrailModule as ni, TransformData as ii, TransformGizmo as ai, TriggerBuilder as si, TriggerModel as li, TypeStore as di, UIRaycastUtils as ci, UIRootComponent as mi, USDDocument as gi, USDObject as pi, USDWriter as ui, USDZExporter as Si, USDZText as Ci, USDZUIExtension as yi, UriSerializer as Ei, UsageMarker as Ri, UserJoinedOrLeftRoomModel as hi, VariantAction as fi, VelocityOverLifetimeModule as vi, VerticalLayoutGroup as Pi, VideoPlayer as Ti, ViewDevice as Ai, Vignette as bi, VisibilityAction as Mi, Voip as Ii, Volume as Di, VolumeParameter as Oi, VolumeProfile as xi, WaitForFrames as ki, WaitForPromise as Li, WaitForSeconds as Ni, Watch as Bi, WebARCameraBackground as Fi, WebARSessionRoot as Ui, WebXR as wi, WebXRButtonFactory as Gi, WebXRImageTracking as Wi, WebXRImageTrackingModel as Hi, WebXRPlaneTracking as Xi, WebXRTrackedImage as zi, XRControllerFollow as Vi, XRControllerModel as _i, XRControllerMovement as ji, XRFlag as Ki, XRRig as Zi, XRState as Qi, XRStateFlag as Yi, __Ignore as $i, __internalNotifyObjectDestroyed as Ji, activeInHierarchyFieldName as qi, addAttributeChangeCallback as ea, addComponent as ta, addCustomExtensionPlugin as oa, addNewComponent as ra, addPatch as na, apply as ia, applyHMRChanges as aa, applyPrototypeExtensions as sa, beginListenDestroy as la, beginListenInstantiate as da, binaryIdentifierCasts as ca, build_scene_functions as ma, builtinComponentKeyName as ga, calculateProgress01 as pa, clearMessages as ua, clearMessages as Sa, colorSerializer as Ca, compareAssociation as ya, componentSerializer as Ea, copyTexture as Ra, createMotion as ha, debugNet as fa, debugOwner as va, decompressGpuTexture as Pa, deepClone as Ta, delay as Aa, delayForFrames as ba, deserializeObject as Ma, destroy as Ia, destroyComponentInstance as Da, determineMimeTypeFromExtension as Oa, disposeObjectResources as xa, disposeStream as ka, editorGuidKeyName as La, enableSpatialConsole as Na, euler as Ba, eventListSerializer as Fa, exportAsGLTF as Ua, findByGuid as wa, findObjectOfType as Ga, findObjectsOfType as Wa, findResourceUsers as Ha, fitObjectIntoVolume as Xa, foreachComponent as za, foreachComponentEnumerator as Va, forward as _a, generateQRCode as ja, generateSeed as Ka, getBoundingBox as Za, getCameraController as Qa, getComponent as Ya, getComponentInChildren as $a, getComponentInParent as Ja, getComponents as qa, getComponentsInChildren as es, getComponentsInParent as ts, getFormattedDate as os, getIconElement as rs, getIconTexture as ns, getLoader as is, getOrAddComponent as as, getParam as ss, getParentHierarchyPath as ls, getPath as ds, getPeerOptions as cs, getPeerjsInstance as ms, getResourceUserCount as gs, getTempColor as ps, getTempQuaternion as us, getTempVector as Ss, getUrlParams as Cs, getVisibleInCustomShadowRendering as ys, getWorldDirection as Es, getWorldEuler as Rs, getWorldPosition as hs, getWorldQuaternion as fs, getWorldRotation as vs, getWorldScale as Ps, hasCommercialLicense as Ts, hasIndieLicense as As, hasPointerEventComponent as bs, hasProLicense as Ms, hideDebugConsole as Is, imageToCanvas as Ds, instantiate as Os, invokeLoadedImportPluginHooks as xs, invokeXRSessionEnd as ks, invokeXRSessionStart as Ls, isActiveInHierarchy as Ns, isActiveSelf as Bs, isAndroidDevice as Fs, isAnimationAction as Us, isComponent as ws, isDebugMode as Gs, isDesktop as Ws, isDestroyed as Hs, isDevEnvironment as Xs, isDisposed as zs, isExporting as Vs, isGLTFModel as _s, isHostedOnGlitch as js, isHotReloadEnabled as Ks, isHotReloading as Zs, isIPad as Qs, isIconElement as Ys, isLocalNetwork as $s, isMacOS as Js, isMobileDevice as qs, isMozillaXR as el, isQuest as tl, isResourceTrackingEnabled as ol, isSafari as rl, isUsingInstancing as nl, isiOS as il, isiPad as al, loadSync as sl, logHierarchy as ll, lookAtInverse as dl, lookAtObject as cl, lookAtScreenPoint as ml, makeId as gl, makeIdFromRandomWords as pl, makeNameSafe as ul, markAsInstancedRendered as Sl, microphonePermissionsGranted as Cl, nameof as yl, nameofFactory as El, objectSerializer as Rl, offXRSessionEnd as hl, offXRSessionStart as fl, onXRSessionEnd as vl, onXRSessionStart as Pl, parseSync as Tl, placeOnSurface as Al, postprocessFBXMaterials as bl, prefix as Ml, pushState as Il, randomNumber as Dl, registerBinaryType as Ol, registerComponent as xl, registerComponentExtension as kl, registerCustomEffectType as Ll, registerExportExtensions as Nl, registerExtensions as Bl, registerHotReloadType as Fl, registerLoader as Ul, registerPrefabProvider as wl, registerPrototypeExtensions as Gl, registerType as Wl, relativePathPrefix as Hl, removeAttributeChangeCallback as Xl, removeComponent as zl, removeCustomImportExtensionType as Vl, removePatch as _l, resolveUrl as jl, sanitizeString as Kl, saveImage as Zl, screenshot as Ql, screenshot2 as Yl, sendDestroyed as $l, serializable as Jl, serializeObject as ql, serializeable as ed, setActive as td, setAllowBalloonMessages as od, setAllowOverlayMessages as rd, setAutoFitEnabled as nd, setCameraController as id, setDestroyed as ad, setDevEnvironment as sd, setDisposable as ld, setDontDestroy as dd, setOrAddParamsToUrl as cd, setParam as md, setParamWithoutReload as gd, setPeerOptions as pd, setResourceTrackingEnabled as ud, setState as Sd, setVisibleInCustomShadowRendering as Cd, setWorldEuler as yd, setWorldPosition as Ed, setWorldPositionXYZ as Rd, setWorldQuaternion as hd, setWorldQuaternionXYZW as fd, setWorldRotation as vd, setWorldRotationXYZ as Pd, setWorldScale as Td, showBalloonError as Ad, showBalloonMessage as bd, showBalloonWarning as Md, showDebugConsole as Id, slerp as Dd, syncDestroy as Od, syncField as xd, syncInstantiate as kd, textureToCanvas as Ld, tryCastBinary as Nd, tryDetermineMimetypeFromBinary as Bd, tryDetermineMimetypeFromURL as Fd, tryFindObject as Ud, tryGetGuid as wd, unregisterHotReloadType as Gd, unwatchWrite as Wd, useForAutoFit as Hd, validate as Xd, watchWrite as zd } from "./needle-engine.bundle-Bay7lmZk.js";
1
+ import { GameObject as r, onClear as a, onDestroy as s, onInitialized as l, onAfterRender as d, onBeforeRender as c, onUpdate as m, onStart as g, loadAsset as p, NeedleXRSession as u, Context as S, VERSION as C, Component as y, Components as E } from "./needle-engine.bundle-D5IlZkG6.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 U, AnimatorController as w, AnimatorControllerParameterType as G, AnimatorStateInfo as W, Antialiasing as H, Application as X, AssetDatabase as z, AssetReference as V, AudioExtension as _, AudioListener as j, AudioSource as K, AudioTrackHandler as Z, Avatar as Q, AvatarBlink_Simple as Y, AvatarEyeLook_Rotation as $, AvatarLoader as J, AvatarMarker as q, AvatarModel as ee, Avatar_Brain_LookAt as te, Avatar_MouthShapes as oe, Avatar_MustacheShake as re, Avatar_POI as ne, Axes as ie, AxesHelper as ae, BUILD_TIME as se, BaseUIComponent as le, BasicIKConstraint as de, BehaviorExtension as ce, BehaviorModel as me, Component$1 as ge, BlobStorage as pe, BloomEffect as ue, BoxCollider as Se, BoxGizmo as Ce, BoxHelperComponent as ye, Button as Ee, ButtonsFactory as Re, CallDirection as he, CallInfo as fe, Camera as ve, CameraTargetReachedEvent as Pe, Canvas as Te, CanvasGroup as Ae, CapsuleCollider as be, ChangeMaterialOnClick as Me, ChangeTransformOnClick as Ie, CharacterController as De, CharacterControllerInput as Oe, ChromaticAberration as xe, CircularBuffer as ke, ClearFlags as Le, ClipExtrapolation as Ne, Collider as Be, Collision as Fe, CollisionDetectionMode as Ue, ColorAdjustments as we, ColorBySpeedModule as Ge, ColorOverLifetimeModule as We, Component$1 as He, ComponentLifecycleEvents as Xe, ConnectionEvents as ze, ContactPoint as Ve, ContactShadows as _e, ContextArgs as je, ContextEvent as Ke, ContextRegistry as Ze, ControlTrackHandler as Qe, CustomBranding as Ye, CustomShader as $e, DefaultReflectionMode as Je, Deletable as qe, DeleteBox as et, DepthOfField as tt, DeviceFlag as ot, DeviceUtilities as rt, DocumentExtension as nt, DragControls as it, DragMode as at, DropListener as st, Duplicatable as lt, EffectWrapper as dt, EmissionModule as ct, EmphasizeOnClick as mt, EngineLoadingView as gt, EnvironmentScene as pt, EventList as ut, EventListEvent as St, EventSystem as Ct, EventTrigger as yt, FieldWithDefault as Et, FileReference as Rt, FileReferenceSerializer as ht, FileSpawnModel as ft, File_Event as vt, FixedJoint as Pt, Fog as Tt, FrameEvent as At, GENERATOR as bt, Gizmos as Mt, GltfExport as It, GltfExportBox as Dt, Gradient as Ot, Graphic as xt, GraphicRaycaster as kt, Graphics as Lt, GridHelper as Nt, GridLayoutGroup as Bt, GroundProjectedEnv as Ft, GroupActionModel as Ut, HideFlags as wt, HideOnStart as Gt, HingeJoint as Wt, HorizontalLayoutGroup as Ht, HostData as Xt, Image as zt, ImageReference as Vt, ImageReferenceSerializer as _t, InheritVelocityModule as jt, Input as Kt, InputEventQueue as Zt, InputEvents as Qt, InputField as Yt, InstanceHandle as $t, InstancingHandler as Jt, InstancingUtil as qt, InstantiateEvent as eo, InstantiateIdProvider as to, InstantiateOptions as oo, Interactable as ro, InternalScreenshotUtils as no, JoinedRoomResponse as io, KeyEventArgs as ao, Keyframe as so, LODGroup as lo, LODModel as co, LeftRoomResponse as mo, Light as go, LightData as po, LimitVelocityOverLifetimeModule as uo, LoadingElementOptions as So, LogStats as Co, LogType as yo, LookAt as Eo, LookAtConstraint as Ro, MainModule as ho, MarkerType as fo, MaskableGraphic as vo, Mathf as Po, MeshCollider as To, MeshRenderer as Ao, MinMaxCurve as bo, MinMaxGradient as Mo, MODULES as Io, NEKeyboardEvent as Do, NEPointerEvent as Oo, NeedleButtonElement as xo, ContextRegistry as ko, NeedleEngineHTMLElement as Lo, NeedleEngineModelLoader as No, NeedleMenu as Bo, NeedlePatchesKey as Fo, USDZExporter$1 as Uo, NeedleXRController as wo, NeedleXRSync as Go, NeedleXRUtils as Wo, NestedGltf as Ho, NetworkConnection as Xo, NetworkedStreamEvents as zo, NetworkedStreams as Vo, Networking as _o, NewInstanceModel as jo, NoiseModule as Ko, ObjectRaycaster as Zo, ObjectUtils as Qo, OffsetConstraint as Yo, OneEuroFilter as $o, OneEuroFilterXYZ as Jo, OpenURL as qo, OrbitControls as er, Outline as tr, OwnershipEvent as or, OwnershipModel as rr, PUBLIC_KEY as nr, Padding as ir, ParticleBurst as ar, ParticleSubEmitter as sr, ParticleSystem as lr, ParticleSystemBaseBehaviour as dr, ParticleSystemRenderer as cr, ParticleSystemShapeType as mr, PeerHandle as gr, PeerNetworking as pr, Physics as ur, PhysicsExtension as Sr, PhysicsMaterialCombine as Cr, PixelationEffect as yr, PlayAnimationOnClick as Er, PlayAudioOnClick as Rr, PlayableDirector as hr, PlayerColor as fr, PlayerState as vr, PlayerStateEvent as Pr, PlayerSync as Tr, PlayerView as Ar, PlayerViewManager as br, PointerEventData as Mr, PointerType as Ir, PostProcessingEffect as Dr, PostProcessingHandler as Or, Volume as xr, PreliminaryAction as kr, PreliminaryTrigger as Lr, PreviewHelper as Nr, PrimitiveType as Br, Progress as Fr, PromiseAllWithErrors as Ur, PromiseErrorResult as wr, RGBAColor as Gr, RapierPhysics as Wr, RawImage as Hr, RaycastOptions as Xr, Rect as zr, RectTransform as Vr, ReflectionProbe as _r, RegisteredAnimationInfo as jr, RemoteSkybox as Kr, RenderTexture as Zr, RenderTextureSerializer as Qr, Renderer as Yr, RendererData as $r, RendererLightmap as Jr, Rigidbody as qr, RigidbodyConstraints as en, RoomEvents as tn, RotationBySpeedModule as on, RotationOverLifetimeModule as rn, SceneLightSettings as nn, SceneSwitcher as an, ScreenCapture as sn, ScreenSpaceAmbientOcclusion as ln, ScreenSpaceAmbientOcclusionN8 as dn, SendQueue as cn, SerializationContext as mn, SetActiveOnClick as gn, ShadowCatcher as pn, ShapeModule as un, SharpeningEffect as Sn, SignalAsset as Cn, SignalReceiver as yn, SignalReceiverEvent as En, SignalTrackHandler as Rn, Size as hn, SizeBySpeedModule as fn, SizeOverLifetimeModule as vn, SkinnedMeshRenderer as Pn, SmoothFollow as Tn, SpatialGrabRaycaster as An, SpatialHtml as bn, SpatialTrigger as Mn, SpatialTriggerReceiver as In, SpectatorCamera as Dn, SphereCollider as On, SphereIntersection as xn, SphereOverlapResult as kn, Sprite as Ln, SpriteData as Nn, SpriteRenderer as Bn, SpriteSheet as Fn, StateMachineBehaviour as Un, StreamEndedEvent as wn, StreamReceivedEvent as Gn, SubEmitterSystem as Wn, SyncedCamera as Hn, SyncedRoom as Xn, SyncedTransform as zn, TapGestureTrigger as Vn, TeleportTarget as _n, TestRunner as jn, TestSceneUtils as Kn, TestSimulateUserData as Zn, Text as Qn, TextBuilder as Yn, TextExtension as $n, TextureSheetAnimationModule as Jn, TiltShiftEffect as qn, Time as ei, ToneMappingEffect as ti, TrackHandler as oi, TrackType as ri, TrailModule as ni, TransformData as ii, TransformGizmo as ai, TriggerBuilder as si, TriggerModel as li, TypeStore as di, UIRaycastUtils as ci, UIRootComponent as mi, USDDocument as gi, USDObject as pi, USDWriter as ui, USDZExporter as Si, USDZText as Ci, USDZUIExtension as yi, UriSerializer as Ei, UsageMarker as Ri, UserJoinedOrLeftRoomModel as hi, VariantAction as fi, VelocityOverLifetimeModule as vi, VerticalLayoutGroup as Pi, VideoPlayer as Ti, ViewDevice as Ai, Vignette as bi, VisibilityAction as Mi, Voip as Ii, Volume as Di, VolumeParameter as Oi, VolumeProfile as xi, WaitForFrames as ki, WaitForPromise as Li, WaitForSeconds as Ni, Watch as Bi, WebARCameraBackground as Fi, WebARSessionRoot as Ui, WebXR as wi, WebXRButtonFactory as Gi, WebXRImageTracking as Wi, WebXRImageTrackingModel as Hi, WebXRPlaneTracking as Xi, WebXRTrackedImage as zi, XRControllerFollow as Vi, XRControllerModel as _i, XRControllerMovement as ji, XRFlag as Ki, XRRig as Zi, XRState as Qi, XRStateFlag as Yi, __Ignore as $i, __internalNotifyObjectDestroyed as Ji, activeInHierarchyFieldName as qi, addAttributeChangeCallback as ea, addComponent as ta, addCustomExtensionPlugin as oa, addNewComponent as ra, addPatch as na, apply as ia, applyHMRChanges as aa, applyPrototypeExtensions as sa, beginListenDestroy as la, beginListenInstantiate as da, binaryIdentifierCasts as ca, build_scene_functions as ma, builtinComponentKeyName as ga, calculateProgress01 as pa, clearMessages as ua, clearMessages as Sa, colorSerializer as Ca, compareAssociation as ya, componentSerializer as Ea, copyTexture as Ra, createMotion as ha, debugNet as fa, debugOwner as va, decompressGpuTexture as Pa, deepClone as Ta, delay as Aa, delayForFrames as ba, deserializeObject as Ma, destroy as Ia, destroyComponentInstance as Da, determineMimeTypeFromExtension as Oa, disposeObjectResources as xa, disposeStream as ka, editorGuidKeyName as La, enableSpatialConsole as Na, euler as Ba, eventListSerializer as Fa, exportAsGLTF as Ua, findByGuid as wa, findObjectOfType as Ga, findObjectsOfType as Wa, findResourceUsers as Ha, fitObjectIntoVolume as Xa, foreachComponent as za, foreachComponentEnumerator as Va, forward as _a, generateQRCode as ja, generateSeed as Ka, getBoundingBox as Za, getCameraController as Qa, getComponent as Ya, getComponentInChildren as $a, getComponentInParent as Ja, getComponents as qa, getComponentsInChildren as es, getComponentsInParent as ts, getFormattedDate as os, getIconElement as rs, getIconTexture as ns, getLoader as is, getOrAddComponent as as, getParam as ss, getParentHierarchyPath as ls, getPath as ds, getPeerOptions as cs, getPeerjsInstance as ms, getResourceUserCount as gs, getTempColor as ps, getTempQuaternion as us, getTempVector as Ss, getUrlParams as Cs, getVisibleInCustomShadowRendering as ys, getWorldDirection as Es, getWorldEuler as Rs, getWorldPosition as hs, getWorldQuaternion as fs, getWorldRotation as vs, getWorldScale as Ps, hasCommercialLicense as Ts, hasIndieLicense as As, hasPointerEventComponent as bs, hasProLicense as Ms, hideDebugConsole as Is, imageToCanvas as Ds, instantiate as Os, invokeLoadedImportPluginHooks as xs, invokeXRSessionEnd as ks, invokeXRSessionStart as Ls, isActiveInHierarchy as Ns, isActiveSelf as Bs, isAndroidDevice as Fs, isAnimationAction as Us, isComponent as ws, isDebugMode as Gs, isDesktop as Ws, isDestroyed as Hs, isDevEnvironment as Xs, isDisposed as zs, isExporting as Vs, isGLTFModel as _s, isHostedOnGlitch as js, isHotReloadEnabled as Ks, isHotReloading as Zs, isIPad as Qs, isIconElement as Ys, isLocalNetwork as $s, isMacOS as Js, isMobileDevice as qs, isMozillaXR as el, isQuest as tl, isResourceTrackingEnabled as ol, isSafari as rl, isUsingInstancing as nl, isiOS as il, isiPad as al, loadSync as sl, logHierarchy as ll, lookAtInverse as dl, lookAtObject as cl, lookAtScreenPoint as ml, makeId as gl, makeIdFromRandomWords as pl, makeNameSafe as ul, markAsInstancedRendered as Sl, microphonePermissionsGranted as Cl, nameof as yl, nameofFactory as El, objectSerializer as Rl, offXRSessionEnd as hl, offXRSessionStart as fl, onXRSessionEnd as vl, onXRSessionStart as Pl, parseSync as Tl, placeOnSurface as Al, postprocessFBXMaterials as bl, prefix as Ml, pushState as Il, randomNumber as Dl, registerBinaryType as Ol, registerComponent as xl, registerComponentExtension as kl, registerCustomEffectType as Ll, registerExportExtensions as Nl, registerExtensions as Bl, registerHotReloadType as Fl, registerLoader as Ul, registerPrefabProvider as wl, registerPrototypeExtensions as Gl, registerType as Wl, relativePathPrefix as Hl, removeAttributeChangeCallback as Xl, removeComponent as zl, removeCustomImportExtensionType as Vl, removePatch as _l, resolveUrl as jl, sanitizeString as Kl, saveImage as Zl, screenshot as Ql, screenshot2 as Yl, sendDestroyed as $l, serializable as Jl, serializeObject as ql, serializeable as ed, setActive as td, setAllowBalloonMessages as od, setAllowOverlayMessages as rd, setAutoFitEnabled as nd, setCameraController as id, setDestroyed as ad, setDevEnvironment as sd, setDisposable as ld, setDontDestroy as dd, setOrAddParamsToUrl as cd, setParam as md, setParamWithoutReload as gd, setPeerOptions as pd, setResourceTrackingEnabled as ud, setState as Sd, setVisibleInCustomShadowRendering as Cd, setWorldEuler as yd, setWorldPosition as Ed, setWorldPositionXYZ as Rd, setWorldQuaternion as hd, setWorldQuaternionXYZW as fd, setWorldRotation as vd, setWorldRotationXYZ as Pd, setWorldScale as Td, showBalloonError as Ad, showBalloonMessage as bd, showBalloonWarning as Md, showDebugConsole as Id, slerp as Dd, syncDestroy as Od, syncField as xd, syncInstantiate as kd, textureToCanvas as Ld, tryCastBinary as Nd, tryDetermineMimetypeFromBinary as Bd, tryDetermineMimetypeFromURL as Fd, tryFindObject as Ud, tryGetGuid as wd, unregisterHotReloadType as Gd, unwatchWrite as Wd, useForAutoFit as Hd, validate as Xd, watchWrite as zd } from "./needle-engine.bundle-D5IlZkG6.js";
3
3
  import { NEEDLE_progressive as _d } from "./gltf-progressive-D8GP6sjZ.js";
4
4
  import { THREE as R } from "./three-1JG7vpNC.js";
5
5
  const t = {
@@ -1,5 +1,5 @@
1
- import { GameObject as r, onClear as a, onDestroy as s, onInitialized as l, onAfterRender as d, onBeforeRender as c, onUpdate as m, onStart as g, loadAsset as p, NeedleXRSession as u, Context as S, VERSION as C, Component as y, Components as E } from "./needle-engine.bundle-bJ0EPCie.light.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 U, AnimatorController as w, AnimatorControllerParameterType as G, AnimatorStateInfo as W, Antialiasing as H, Application as X, AssetDatabase as z, AssetReference as V, AudioExtension as _, AudioListener as j, AudioSource as K, AudioTrackHandler as Z, Avatar as Q, AvatarBlink_Simple as Y, AvatarEyeLook_Rotation as $, AvatarLoader as J, AvatarMarker as q, AvatarModel as ee, Avatar_Brain_LookAt as te, Avatar_MouthShapes as oe, Avatar_MustacheShake as re, Avatar_POI as ne, Axes as ie, AxesHelper as ae, BUILD_TIME as se, BaseUIComponent as le, BasicIKConstraint as de, BehaviorExtension as ce, BehaviorModel as me, Component$1 as ge, BlobStorage as pe, BloomEffect as ue, BoxCollider as Se, BoxGizmo as Ce, BoxHelperComponent as ye, Button as Ee, ButtonsFactory as Re, CallDirection as he, CallInfo as fe, Camera as ve, CameraTargetReachedEvent as Pe, Canvas as Te, CanvasGroup as Ae, CapsuleCollider as be, ChangeMaterialOnClick as Me, ChangeTransformOnClick as Ie, CharacterController as De, CharacterControllerInput as Oe, ChromaticAberration as xe, CircularBuffer as ke, ClearFlags as Le, ClipExtrapolation as Ne, Collider as Be, Collision as Fe, CollisionDetectionMode as Ue, ColorAdjustments as we, ColorBySpeedModule as Ge, ColorOverLifetimeModule as We, Component$1 as He, ComponentLifecycleEvents as Xe, ConnectionEvents as ze, ContactPoint as Ve, ContactShadows as _e, ContextArgs as je, ContextEvent as Ke, ContextRegistry as Ze, ControlTrackHandler as Qe, CustomBranding as Ye, CustomShader as $e, DefaultReflectionMode as Je, Deletable as qe, DeleteBox as et, DepthOfField as tt, DeviceFlag as ot, DeviceUtilities as rt, DocumentExtension as nt, DragControls as it, DragMode as at, DropListener as st, Duplicatable as lt, EffectWrapper as dt, EmissionModule as ct, EmphasizeOnClick as mt, EngineLoadingView as gt, EnvironmentScene as pt, EventList as ut, EventListEvent as St, EventSystem as Ct, EventTrigger as yt, FieldWithDefault as Et, FileReference as Rt, FileReferenceSerializer as ht, FileSpawnModel as ft, File_Event as vt, FixedJoint as Pt, Fog as Tt, FrameEvent as At, GENERATOR as bt, Gizmos as Mt, GltfExport as It, GltfExportBox as Dt, Gradient as Ot, Graphic as xt, GraphicRaycaster as kt, Graphics as Lt, GridHelper as Nt, GridLayoutGroup as Bt, GroundProjectedEnv as Ft, GroupActionModel as Ut, HideFlags as wt, HideOnStart as Gt, HingeJoint as Wt, HorizontalLayoutGroup as Ht, HostData as Xt, Image as zt, ImageReference as Vt, ImageReferenceSerializer as _t, InheritVelocityModule as jt, Input as Kt, InputEventQueue as Zt, InputEvents as Qt, InputField as Yt, InstanceHandle as $t, InstancingHandler as Jt, InstancingUtil as qt, InstantiateEvent as eo, InstantiateIdProvider as to, InstantiateOptions as oo, Interactable as ro, InternalScreenshotUtils as no, JoinedRoomResponse as io, KeyEventArgs as ao, Keyframe as so, LODGroup as lo, LODModel as co, LeftRoomResponse as mo, Light as go, LightData as po, LimitVelocityOverLifetimeModule as uo, LoadingElementOptions as So, LogStats as Co, LogType as yo, LookAt as Eo, LookAtConstraint as Ro, MainModule as ho, MarkerType as fo, MaskableGraphic as vo, Mathf as Po, MeshCollider as To, MeshRenderer as Ao, MinMaxCurve as bo, MinMaxGradient as Mo, MODULES as Io, NEKeyboardEvent as Do, NEPointerEvent as Oo, NeedleButtonElement as xo, ContextRegistry as ko, NeedleEngineHTMLElement as Lo, NeedleEngineModelLoader as No, NeedleMenu as Bo, NeedlePatchesKey as Fo, USDZExporter$1 as Uo, NeedleXRController as wo, NeedleXRSync as Go, NeedleXRUtils as Wo, NestedGltf as Ho, NetworkConnection as Xo, NetworkedStreamEvents as zo, NetworkedStreams as Vo, Networking as _o, NewInstanceModel as jo, NoiseModule as Ko, ObjectRaycaster as Zo, ObjectUtils as Qo, OffsetConstraint as Yo, OneEuroFilter as $o, OneEuroFilterXYZ as Jo, OpenURL as qo, OrbitControls as er, Outline as tr, OwnershipEvent as or, OwnershipModel as rr, PUBLIC_KEY as nr, Padding as ir, ParticleBurst as ar, ParticleSubEmitter as sr, ParticleSystem as lr, ParticleSystemBaseBehaviour as dr, ParticleSystemRenderer as cr, ParticleSystemShapeType as mr, PeerHandle as gr, PeerNetworking as pr, Physics as ur, PhysicsExtension as Sr, PhysicsMaterialCombine as Cr, PixelationEffect as yr, PlayAnimationOnClick as Er, PlayAudioOnClick as Rr, PlayableDirector as hr, PlayerColor as fr, PlayerState as vr, PlayerStateEvent as Pr, PlayerSync as Tr, PlayerView as Ar, PlayerViewManager as br, PointerEventData as Mr, PointerType as Ir, PostProcessingEffect as Dr, PostProcessingHandler as Or, Volume as xr, PreliminaryAction as kr, PreliminaryTrigger as Lr, PreviewHelper as Nr, PrimitiveType as Br, Progress as Fr, PromiseAllWithErrors as Ur, PromiseErrorResult as wr, RGBAColor as Gr, RapierPhysics as Wr, RawImage as Hr, RaycastOptions as Xr, Rect as zr, RectTransform as Vr, ReflectionProbe as _r, RegisteredAnimationInfo as jr, RemoteSkybox as Kr, RenderTexture as Zr, RenderTextureSerializer as Qr, Renderer as Yr, RendererData as $r, RendererLightmap as Jr, Rigidbody as qr, RigidbodyConstraints as en, RoomEvents as tn, RotationBySpeedModule as on, RotationOverLifetimeModule as rn, SceneLightSettings as nn, SceneSwitcher as an, ScreenCapture as sn, ScreenSpaceAmbientOcclusion as ln, ScreenSpaceAmbientOcclusionN8 as dn, SendQueue as cn, SerializationContext as mn, SetActiveOnClick as gn, ShadowCatcher as pn, ShapeModule as un, SharpeningEffect as Sn, SignalAsset as Cn, SignalReceiver as yn, SignalReceiverEvent as En, SignalTrackHandler as Rn, Size as hn, SizeBySpeedModule as fn, SizeOverLifetimeModule as vn, SkinnedMeshRenderer as Pn, SmoothFollow as Tn, SpatialGrabRaycaster as An, SpatialHtml as bn, SpatialTrigger as Mn, SpatialTriggerReceiver as In, SpectatorCamera as Dn, SphereCollider as On, SphereIntersection as xn, SphereOverlapResult as kn, Sprite as Ln, SpriteData as Nn, SpriteRenderer as Bn, SpriteSheet as Fn, StateMachineBehaviour as Un, StreamEndedEvent as wn, StreamReceivedEvent as Gn, SubEmitterSystem as Wn, SyncedCamera as Hn, SyncedRoom as Xn, SyncedTransform as zn, TapGestureTrigger as Vn, TeleportTarget as _n, TestRunner as jn, TestSceneUtils as Kn, TestSimulateUserData as Zn, Text as Qn, TextBuilder as Yn, TextExtension as $n, TextureSheetAnimationModule as Jn, TiltShiftEffect as qn, Time as ei, ToneMappingEffect as ti, TrackHandler as oi, TrackType as ri, TrailModule as ni, TransformData as ii, TransformGizmo as ai, TriggerBuilder as si, TriggerModel as li, TypeStore as di, UIRaycastUtils as ci, UIRootComponent as mi, USDDocument as gi, USDObject as pi, USDWriter as ui, USDZExporter as Si, USDZText as Ci, USDZUIExtension as yi, UriSerializer as Ei, UsageMarker as Ri, UserJoinedOrLeftRoomModel as hi, VariantAction as fi, VelocityOverLifetimeModule as vi, VerticalLayoutGroup as Pi, VideoPlayer as Ti, ViewDevice as Ai, Vignette as bi, VisibilityAction as Mi, Voip as Ii, Volume as Di, VolumeParameter as Oi, VolumeProfile as xi, WaitForFrames as ki, WaitForPromise as Li, WaitForSeconds as Ni, Watch as Bi, WebARCameraBackground as Fi, WebARSessionRoot as Ui, WebXR as wi, WebXRButtonFactory as Gi, WebXRImageTracking as Wi, WebXRImageTrackingModel as Hi, WebXRPlaneTracking as Xi, WebXRTrackedImage as zi, XRControllerFollow as Vi, XRControllerModel as _i, XRControllerMovement as ji, XRFlag as Ki, XRRig as Zi, XRState as Qi, XRStateFlag as Yi, __Ignore as $i, __internalNotifyObjectDestroyed as Ji, activeInHierarchyFieldName as qi, addAttributeChangeCallback as ea, addComponent as ta, addCustomExtensionPlugin as oa, addNewComponent as ra, addPatch as na, apply as ia, applyHMRChanges as aa, applyPrototypeExtensions as sa, beginListenDestroy as la, beginListenInstantiate as da, binaryIdentifierCasts as ca, build_scene_functions as ma, builtinComponentKeyName as ga, calculateProgress01 as pa, clearMessages as ua, clearMessages as Sa, colorSerializer as Ca, compareAssociation as ya, componentSerializer as Ea, copyTexture as Ra, createMotion as ha, debugNet as fa, debugOwner as va, decompressGpuTexture as Pa, deepClone as Ta, delay as Aa, delayForFrames as ba, deserializeObject as Ma, destroy as Ia, destroyComponentInstance as Da, determineMimeTypeFromExtension as Oa, disposeObjectResources as xa, disposeStream as ka, editorGuidKeyName as La, enableSpatialConsole as Na, euler as Ba, eventListSerializer as Fa, exportAsGLTF as Ua, findByGuid as wa, findObjectOfType as Ga, findObjectsOfType as Wa, findResourceUsers as Ha, fitObjectIntoVolume as Xa, foreachComponent as za, foreachComponentEnumerator as Va, forward as _a, generateQRCode as ja, generateSeed as Ka, getBoundingBox as Za, getCameraController as Qa, getComponent as Ya, getComponentInChildren as $a, getComponentInParent as Ja, getComponents as qa, getComponentsInChildren as es, getComponentsInParent as ts, getFormattedDate as os, getIconElement as rs, getIconTexture as ns, getLoader as is, getOrAddComponent as as, getParam as ss, getParentHierarchyPath as ls, getPath as ds, getPeerOptions as cs, getPeerjsInstance as ms, getResourceUserCount as gs, getTempColor as ps, getTempQuaternion as us, getTempVector as Ss, getUrlParams as Cs, getVisibleInCustomShadowRendering as ys, getWorldDirection as Es, getWorldEuler as Rs, getWorldPosition as hs, getWorldQuaternion as fs, getWorldRotation as vs, getWorldScale as Ps, hasCommercialLicense as Ts, hasIndieLicense as As, hasPointerEventComponent as bs, hasProLicense as Ms, hideDebugConsole as Is, imageToCanvas as Ds, instantiate as Os, invokeLoadedImportPluginHooks as xs, invokeXRSessionEnd as ks, invokeXRSessionStart as Ls, isActiveInHierarchy as Ns, isActiveSelf as Bs, isAndroidDevice as Fs, isAnimationAction as Us, isComponent as ws, isDebugMode as Gs, isDesktop as Ws, isDestroyed as Hs, isDevEnvironment as Xs, isDisposed as zs, isExporting as Vs, isGLTFModel as _s, isHostedOnGlitch as js, isHotReloadEnabled as Ks, isHotReloading as Zs, isIPad as Qs, isIconElement as Ys, isLocalNetwork as $s, isMacOS as Js, isMobileDevice as qs, isMozillaXR as el, isQuest as tl, isResourceTrackingEnabled as ol, isSafari as rl, isUsingInstancing as nl, isiOS as il, isiPad as al, loadSync as sl, logHierarchy as ll, lookAtInverse as dl, lookAtObject as cl, lookAtScreenPoint as ml, makeId as gl, makeIdFromRandomWords as pl, makeNameSafe as ul, markAsInstancedRendered as Sl, microphonePermissionsGranted as Cl, nameof as yl, nameofFactory as El, objectSerializer as Rl, offXRSessionEnd as hl, offXRSessionStart as fl, onXRSessionEnd as vl, onXRSessionStart as Pl, parseSync as Tl, placeOnSurface as Al, postprocessFBXMaterials as bl, prefix as Ml, pushState as Il, randomNumber as Dl, registerBinaryType as Ol, registerComponent as xl, registerComponentExtension as kl, registerCustomEffectType as Ll, registerExportExtensions as Nl, registerExtensions as Bl, registerHotReloadType as Fl, registerLoader as Ul, registerPrefabProvider as wl, registerPrototypeExtensions as Gl, registerType as Wl, relativePathPrefix as Hl, removeAttributeChangeCallback as Xl, removeComponent as zl, removeCustomImportExtensionType as Vl, removePatch as _l, resolveUrl as jl, sanitizeString as Kl, saveImage as Zl, screenshot as Ql, screenshot2 as Yl, sendDestroyed as $l, serializable as Jl, serializeObject as ql, serializeable as ed, setActive as td, setAllowBalloonMessages as od, setAllowOverlayMessages as rd, setAutoFitEnabled as nd, setCameraController as id, setDestroyed as ad, setDevEnvironment as sd, setDisposable as ld, setDontDestroy as dd, setOrAddParamsToUrl as cd, setParam as md, setParamWithoutReload as gd, setPeerOptions as pd, setResourceTrackingEnabled as ud, setState as Sd, setVisibleInCustomShadowRendering as Cd, setWorldEuler as yd, setWorldPosition as Ed, setWorldPositionXYZ as Rd, setWorldQuaternion as hd, setWorldQuaternionXYZW as fd, setWorldRotation as vd, setWorldRotationXYZ as Pd, setWorldScale as Td, showBalloonError as Ad, showBalloonMessage as bd, showBalloonWarning as Md, showDebugConsole as Id, slerp as Dd, syncDestroy as Od, syncField as xd, syncInstantiate as kd, textureToCanvas as Ld, tryCastBinary as Nd, tryDetermineMimetypeFromBinary as Bd, tryDetermineMimetypeFromURL as Fd, tryFindObject as Ud, tryGetGuid as wd, unregisterHotReloadType as Gd, unwatchWrite as Wd, useForAutoFit as Hd, validate as Xd, watchWrite as zd } from "./needle-engine.bundle-bJ0EPCie.light.js";
1
+ import { GameObject as r, onClear as a, onDestroy as s, onInitialized as l, onAfterRender as d, onBeforeRender as c, onUpdate as m, onStart as g, loadAsset as p, NeedleXRSession as u, Context as S, VERSION as C, Component as y, Components as E } from "./needle-engine.bundle-Dw8SMOP4.light.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 U, AnimatorController as w, AnimatorControllerParameterType as G, AnimatorStateInfo as W, Antialiasing as H, Application as X, AssetDatabase as z, AssetReference as V, AudioExtension as _, AudioListener as j, AudioSource as K, AudioTrackHandler as Z, Avatar as Q, AvatarBlink_Simple as Y, AvatarEyeLook_Rotation as $, AvatarLoader as J, AvatarMarker as q, AvatarModel as ee, Avatar_Brain_LookAt as te, Avatar_MouthShapes as oe, Avatar_MustacheShake as re, Avatar_POI as ne, Axes as ie, AxesHelper as ae, BUILD_TIME as se, BaseUIComponent as le, BasicIKConstraint as de, BehaviorExtension as ce, BehaviorModel as me, Component$1 as ge, BlobStorage as pe, BloomEffect as ue, BoxCollider as Se, BoxGizmo as Ce, BoxHelperComponent as ye, Button as Ee, ButtonsFactory as Re, CallDirection as he, CallInfo as fe, Camera as ve, CameraTargetReachedEvent as Pe, Canvas as Te, CanvasGroup as Ae, CapsuleCollider as be, ChangeMaterialOnClick as Me, ChangeTransformOnClick as Ie, CharacterController as De, CharacterControllerInput as Oe, ChromaticAberration as xe, CircularBuffer as ke, ClearFlags as Le, ClipExtrapolation as Ne, Collider as Be, Collision as Fe, CollisionDetectionMode as Ue, ColorAdjustments as we, ColorBySpeedModule as Ge, ColorOverLifetimeModule as We, Component$1 as He, ComponentLifecycleEvents as Xe, ConnectionEvents as ze, ContactPoint as Ve, ContactShadows as _e, ContextArgs as je, ContextEvent as Ke, ContextRegistry as Ze, ControlTrackHandler as Qe, CustomBranding as Ye, CustomShader as $e, DefaultReflectionMode as Je, Deletable as qe, DeleteBox as et, DepthOfField as tt, DeviceFlag as ot, DeviceUtilities as rt, DocumentExtension as nt, DragControls as it, DragMode as at, DropListener as st, Duplicatable as lt, EffectWrapper as dt, EmissionModule as ct, EmphasizeOnClick as mt, EngineLoadingView as gt, EnvironmentScene as pt, EventList as ut, EventListEvent as St, EventSystem as Ct, EventTrigger as yt, FieldWithDefault as Et, FileReference as Rt, FileReferenceSerializer as ht, FileSpawnModel as ft, File_Event as vt, FixedJoint as Pt, Fog as Tt, FrameEvent as At, GENERATOR as bt, Gizmos as Mt, GltfExport as It, GltfExportBox as Dt, Gradient as Ot, Graphic as xt, GraphicRaycaster as kt, Graphics as Lt, GridHelper as Nt, GridLayoutGroup as Bt, GroundProjectedEnv as Ft, GroupActionModel as Ut, HideFlags as wt, HideOnStart as Gt, HingeJoint as Wt, HorizontalLayoutGroup as Ht, HostData as Xt, Image as zt, ImageReference as Vt, ImageReferenceSerializer as _t, InheritVelocityModule as jt, Input as Kt, InputEventQueue as Zt, InputEvents as Qt, InputField as Yt, InstanceHandle as $t, InstancingHandler as Jt, InstancingUtil as qt, InstantiateEvent as eo, InstantiateIdProvider as to, InstantiateOptions as oo, Interactable as ro, InternalScreenshotUtils as no, JoinedRoomResponse as io, KeyEventArgs as ao, Keyframe as so, LODGroup as lo, LODModel as co, LeftRoomResponse as mo, Light as go, LightData as po, LimitVelocityOverLifetimeModule as uo, LoadingElementOptions as So, LogStats as Co, LogType as yo, LookAt as Eo, LookAtConstraint as Ro, MainModule as ho, MarkerType as fo, MaskableGraphic as vo, Mathf as Po, MeshCollider as To, MeshRenderer as Ao, MinMaxCurve as bo, MinMaxGradient as Mo, MODULES as Io, NEKeyboardEvent as Do, NEPointerEvent as Oo, NeedleButtonElement as xo, ContextRegistry as ko, NeedleEngineHTMLElement as Lo, NeedleEngineModelLoader as No, NeedleMenu as Bo, NeedlePatchesKey as Fo, USDZExporter$1 as Uo, NeedleXRController as wo, NeedleXRSync as Go, NeedleXRUtils as Wo, NestedGltf as Ho, NetworkConnection as Xo, NetworkedStreamEvents as zo, NetworkedStreams as Vo, Networking as _o, NewInstanceModel as jo, NoiseModule as Ko, ObjectRaycaster as Zo, ObjectUtils as Qo, OffsetConstraint as Yo, OneEuroFilter as $o, OneEuroFilterXYZ as Jo, OpenURL as qo, OrbitControls as er, Outline as tr, OwnershipEvent as or, OwnershipModel as rr, PUBLIC_KEY as nr, Padding as ir, ParticleBurst as ar, ParticleSubEmitter as sr, ParticleSystem as lr, ParticleSystemBaseBehaviour as dr, ParticleSystemRenderer as cr, ParticleSystemShapeType as mr, PeerHandle as gr, PeerNetworking as pr, Physics as ur, PhysicsExtension as Sr, PhysicsMaterialCombine as Cr, PixelationEffect as yr, PlayAnimationOnClick as Er, PlayAudioOnClick as Rr, PlayableDirector as hr, PlayerColor as fr, PlayerState as vr, PlayerStateEvent as Pr, PlayerSync as Tr, PlayerView as Ar, PlayerViewManager as br, PointerEventData as Mr, PointerType as Ir, PostProcessingEffect as Dr, PostProcessingHandler as Or, Volume as xr, PreliminaryAction as kr, PreliminaryTrigger as Lr, PreviewHelper as Nr, PrimitiveType as Br, Progress as Fr, PromiseAllWithErrors as Ur, PromiseErrorResult as wr, RGBAColor as Gr, RapierPhysics as Wr, RawImage as Hr, RaycastOptions as Xr, Rect as zr, RectTransform as Vr, ReflectionProbe as _r, RegisteredAnimationInfo as jr, RemoteSkybox as Kr, RenderTexture as Zr, RenderTextureSerializer as Qr, Renderer as Yr, RendererData as $r, RendererLightmap as Jr, Rigidbody as qr, RigidbodyConstraints as en, RoomEvents as tn, RotationBySpeedModule as on, RotationOverLifetimeModule as rn, SceneLightSettings as nn, SceneSwitcher as an, ScreenCapture as sn, ScreenSpaceAmbientOcclusion as ln, ScreenSpaceAmbientOcclusionN8 as dn, SendQueue as cn, SerializationContext as mn, SetActiveOnClick as gn, ShadowCatcher as pn, ShapeModule as un, SharpeningEffect as Sn, SignalAsset as Cn, SignalReceiver as yn, SignalReceiverEvent as En, SignalTrackHandler as Rn, Size as hn, SizeBySpeedModule as fn, SizeOverLifetimeModule as vn, SkinnedMeshRenderer as Pn, SmoothFollow as Tn, SpatialGrabRaycaster as An, SpatialHtml as bn, SpatialTrigger as Mn, SpatialTriggerReceiver as In, SpectatorCamera as Dn, SphereCollider as On, SphereIntersection as xn, SphereOverlapResult as kn, Sprite as Ln, SpriteData as Nn, SpriteRenderer as Bn, SpriteSheet as Fn, StateMachineBehaviour as Un, StreamEndedEvent as wn, StreamReceivedEvent as Gn, SubEmitterSystem as Wn, SyncedCamera as Hn, SyncedRoom as Xn, SyncedTransform as zn, TapGestureTrigger as Vn, TeleportTarget as _n, TestRunner as jn, TestSceneUtils as Kn, TestSimulateUserData as Zn, Text as Qn, TextBuilder as Yn, TextExtension as $n, TextureSheetAnimationModule as Jn, TiltShiftEffect as qn, Time as ei, ToneMappingEffect as ti, TrackHandler as oi, TrackType as ri, TrailModule as ni, TransformData as ii, TransformGizmo as ai, TriggerBuilder as si, TriggerModel as li, TypeStore as di, UIRaycastUtils as ci, UIRootComponent as mi, USDDocument as gi, USDObject as pi, USDWriter as ui, USDZExporter as Si, USDZText as Ci, USDZUIExtension as yi, UriSerializer as Ei, UsageMarker as Ri, UserJoinedOrLeftRoomModel as hi, VariantAction as fi, VelocityOverLifetimeModule as vi, VerticalLayoutGroup as Pi, VideoPlayer as Ti, ViewDevice as Ai, Vignette as bi, VisibilityAction as Mi, Voip as Ii, Volume as Di, VolumeParameter as Oi, VolumeProfile as xi, WaitForFrames as ki, WaitForPromise as Li, WaitForSeconds as Ni, Watch as Bi, WebARCameraBackground as Fi, WebARSessionRoot as Ui, WebXR as wi, WebXRButtonFactory as Gi, WebXRImageTracking as Wi, WebXRImageTrackingModel as Hi, WebXRPlaneTracking as Xi, WebXRTrackedImage as zi, XRControllerFollow as Vi, XRControllerModel as _i, XRControllerMovement as ji, XRFlag as Ki, XRRig as Zi, XRState as Qi, XRStateFlag as Yi, __Ignore as $i, __internalNotifyObjectDestroyed as Ji, activeInHierarchyFieldName as qi, addAttributeChangeCallback as ea, addComponent as ta, addCustomExtensionPlugin as oa, addNewComponent as ra, addPatch as na, apply as ia, applyHMRChanges as aa, applyPrototypeExtensions as sa, beginListenDestroy as la, beginListenInstantiate as da, binaryIdentifierCasts as ca, build_scene_functions as ma, builtinComponentKeyName as ga, calculateProgress01 as pa, clearMessages as ua, clearMessages as Sa, colorSerializer as Ca, compareAssociation as ya, componentSerializer as Ea, copyTexture as Ra, createMotion as ha, debugNet as fa, debugOwner as va, decompressGpuTexture as Pa, deepClone as Ta, delay as Aa, delayForFrames as ba, deserializeObject as Ma, destroy as Ia, destroyComponentInstance as Da, determineMimeTypeFromExtension as Oa, disposeObjectResources as xa, disposeStream as ka, editorGuidKeyName as La, enableSpatialConsole as Na, euler as Ba, eventListSerializer as Fa, exportAsGLTF as Ua, findByGuid as wa, findObjectOfType as Ga, findObjectsOfType as Wa, findResourceUsers as Ha, fitObjectIntoVolume as Xa, foreachComponent as za, foreachComponentEnumerator as Va, forward as _a, generateQRCode as ja, generateSeed as Ka, getBoundingBox as Za, getCameraController as Qa, getComponent as Ya, getComponentInChildren as $a, getComponentInParent as Ja, getComponents as qa, getComponentsInChildren as es, getComponentsInParent as ts, getFormattedDate as os, getIconElement as rs, getIconTexture as ns, getLoader as is, getOrAddComponent as as, getParam as ss, getParentHierarchyPath as ls, getPath as ds, getPeerOptions as cs, getPeerjsInstance as ms, getResourceUserCount as gs, getTempColor as ps, getTempQuaternion as us, getTempVector as Ss, getUrlParams as Cs, getVisibleInCustomShadowRendering as ys, getWorldDirection as Es, getWorldEuler as Rs, getWorldPosition as hs, getWorldQuaternion as fs, getWorldRotation as vs, getWorldScale as Ps, hasCommercialLicense as Ts, hasIndieLicense as As, hasPointerEventComponent as bs, hasProLicense as Ms, hideDebugConsole as Is, imageToCanvas as Ds, instantiate as Os, invokeLoadedImportPluginHooks as xs, invokeXRSessionEnd as ks, invokeXRSessionStart as Ls, isActiveInHierarchy as Ns, isActiveSelf as Bs, isAndroidDevice as Fs, isAnimationAction as Us, isComponent as ws, isDebugMode as Gs, isDesktop as Ws, isDestroyed as Hs, isDevEnvironment as Xs, isDisposed as zs, isExporting as Vs, isGLTFModel as _s, isHostedOnGlitch as js, isHotReloadEnabled as Ks, isHotReloading as Zs, isIPad as Qs, isIconElement as Ys, isLocalNetwork as $s, isMacOS as Js, isMobileDevice as qs, isMozillaXR as el, isQuest as tl, isResourceTrackingEnabled as ol, isSafari as rl, isUsingInstancing as nl, isiOS as il, isiPad as al, loadSync as sl, logHierarchy as ll, lookAtInverse as dl, lookAtObject as cl, lookAtScreenPoint as ml, makeId as gl, makeIdFromRandomWords as pl, makeNameSafe as ul, markAsInstancedRendered as Sl, microphonePermissionsGranted as Cl, nameof as yl, nameofFactory as El, objectSerializer as Rl, offXRSessionEnd as hl, offXRSessionStart as fl, onXRSessionEnd as vl, onXRSessionStart as Pl, parseSync as Tl, placeOnSurface as Al, postprocessFBXMaterials as bl, prefix as Ml, pushState as Il, randomNumber as Dl, registerBinaryType as Ol, registerComponent as xl, registerComponentExtension as kl, registerCustomEffectType as Ll, registerExportExtensions as Nl, registerExtensions as Bl, registerHotReloadType as Fl, registerLoader as Ul, registerPrefabProvider as wl, registerPrototypeExtensions as Gl, registerType as Wl, relativePathPrefix as Hl, removeAttributeChangeCallback as Xl, removeComponent as zl, removeCustomImportExtensionType as Vl, removePatch as _l, resolveUrl as jl, sanitizeString as Kl, saveImage as Zl, screenshot as Ql, screenshot2 as Yl, sendDestroyed as $l, serializable as Jl, serializeObject as ql, serializeable as ed, setActive as td, setAllowBalloonMessages as od, setAllowOverlayMessages as rd, setAutoFitEnabled as nd, setCameraController as id, setDestroyed as ad, setDevEnvironment as sd, setDisposable as ld, setDontDestroy as dd, setOrAddParamsToUrl as cd, setParam as md, setParamWithoutReload as gd, setPeerOptions as pd, setResourceTrackingEnabled as ud, setState as Sd, setVisibleInCustomShadowRendering as Cd, setWorldEuler as yd, setWorldPosition as Ed, setWorldPositionXYZ as Rd, setWorldQuaternion as hd, setWorldQuaternionXYZW as fd, setWorldRotation as vd, setWorldRotationXYZ as Pd, setWorldScale as Td, showBalloonError as Ad, showBalloonMessage as bd, showBalloonWarning as Md, showDebugConsole as Id, slerp as Dd, syncDestroy as Od, syncField as xd, syncInstantiate as kd, textureToCanvas as Ld, tryCastBinary as Nd, tryDetermineMimetypeFromBinary as Bd, tryDetermineMimetypeFromURL as Fd, tryFindObject as Ud, tryGetGuid as wd, unregisterHotReloadType as Gd, unwatchWrite as Wd, useForAutoFit as Hd, validate as Xd, watchWrite as zd } from "./needle-engine.bundle-Dw8SMOP4.light.js";
3
3
  import { NEEDLE_progressive as _d } from "./gltf-progressive-ZWp05WqX.light.js";
4
4
  import { THREE as R } from "./three-1JG7vpNC.light.js";
5
5
  const t = {